@myrjfa/ui 2.1.8 → 2.2.0

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.
Files changed (459) hide show
  1. package/dist/chat/ChatMain.d.ts +1 -1
  2. package/dist/chat/ChatMain.d.ts.map +1 -1
  3. package/dist/chat/ChatMain.js +3 -3
  4. package/dist/chat/ChatSidebar.d.ts +1 -1
  5. package/dist/chat/ChatSidebar.d.ts.map +1 -1
  6. package/dist/chat/ConversationList.d.ts +1 -1
  7. package/dist/chat/ConversationList.d.ts.map +1 -1
  8. package/dist/chat/ConversationList.js +1 -1
  9. package/dist/chat/ExpensePanel.js +1 -1
  10. package/dist/chat/MessageBubble.d.ts +1 -1
  11. package/dist/chat/MessageBubble.d.ts.map +1 -1
  12. package/dist/chat/MessageInput.js +1 -1
  13. package/dist/chat/MilestonePanel.js +1 -1
  14. package/dist/chat/components/SplitInputs.d.ts +1 -1
  15. package/dist/chat/components/SplitInputs.d.ts.map +1 -1
  16. package/dist/chat/components/SplitTypeSelector.d.ts +1 -1
  17. package/dist/chat/components/SplitTypeSelector.d.ts.map +1 -1
  18. package/dist/chat/dialogs/AddMemberDialog.d.ts +1 -1
  19. package/dist/chat/dialogs/AddMemberDialog.d.ts.map +1 -1
  20. package/dist/chat/dialogs/AddMemberDialog.js +1 -1
  21. package/dist/chat/dialogs/ExpenseAnalyticsDialog.js +1 -1
  22. package/dist/chat/dialogs/GroupInfoDialog.d.ts +1 -1
  23. package/dist/chat/dialogs/GroupInfoDialog.d.ts.map +1 -1
  24. package/dist/chat/dialogs/GroupInfoDialog.js +1 -1
  25. package/dist/chat/dialogs/GroupInfoViewDialog.d.ts +1 -1
  26. package/dist/chat/dialogs/GroupInfoViewDialog.d.ts.map +1 -1
  27. package/dist/chat/dialogs/NewChatDialog.js +2 -2
  28. package/dist/chat/dialogs/NewGroupDialog.js +2 -2
  29. package/dist/chat/dialogs/ParticipantsDialog.d.ts +1 -1
  30. package/dist/chat/dialogs/ParticipantsDialog.d.ts.map +1 -1
  31. package/dist/chat/dialogs/ParticipantsDialog.js +1 -1
  32. package/dist/components/CityAutocomplete.d.ts +5 -0
  33. package/dist/components/CityAutocomplete.d.ts.map +1 -0
  34. package/dist/components/CityAutocomplete.js +112 -0
  35. package/dist/components/CreateListingDropdown.d.ts +5 -0
  36. package/dist/components/CreateListingDropdown.d.ts.map +1 -0
  37. package/dist/components/CreateListingDropdown.js +21 -0
  38. package/dist/components/DestinationAutocomplete.d.ts +11 -0
  39. package/dist/components/DestinationAutocomplete.d.ts.map +1 -0
  40. package/dist/components/DestinationAutocomplete.js +24 -0
  41. package/dist/components/StateAutocomplete.d.ts +10 -0
  42. package/dist/components/StateAutocomplete.d.ts.map +1 -0
  43. package/dist/components/StateAutocomplete.js +34 -0
  44. package/dist/components/admin/AdminBookingRegistrationsList.d.ts +5 -0
  45. package/dist/components/admin/AdminBookingRegistrationsList.d.ts.map +1 -0
  46. package/dist/components/admin/AdminBookingRegistrationsList.js +69 -0
  47. package/dist/components/admin/AdminListingActionsWrapper.d.ts +9 -0
  48. package/dist/components/admin/AdminListingActionsWrapper.d.ts.map +1 -0
  49. package/dist/components/admin/AdminListingActionsWrapper.js +200 -0
  50. package/dist/components/ads/ActivateAdPlacementButton.d.ts +6 -0
  51. package/dist/components/ads/ActivateAdPlacementButton.d.ts.map +1 -0
  52. package/dist/components/ads/ActivateAdPlacementButton.js +27 -0
  53. package/dist/components/ads/AdOfferCard.d.ts +6 -0
  54. package/dist/components/ads/AdOfferCard.d.ts.map +1 -0
  55. package/dist/components/ads/AdOfferCard.js +15 -0
  56. package/dist/components/adventure/AdventureAvailabilityPlanner.d.ts +17 -0
  57. package/dist/components/adventure/AdventureAvailabilityPlanner.d.ts.map +1 -0
  58. package/dist/components/adventure/AdventureAvailabilityPlanner.js +106 -0
  59. package/dist/components/adventure/AdventureQueryCard.d.ts +5 -0
  60. package/dist/components/adventure/AdventureQueryCard.d.ts.map +1 -0
  61. package/dist/components/adventure/AdventureQueryCard.js +65 -0
  62. package/dist/components/adventure/AdventureSlotBuilder.d.ts +41 -0
  63. package/dist/components/adventure/AdventureSlotBuilder.d.ts.map +1 -0
  64. package/dist/components/adventure/AdventureSlotBuilder.js +146 -0
  65. package/dist/components/booking/booking-form.d.ts +39 -0
  66. package/dist/components/booking/booking-form.d.ts.map +1 -0
  67. package/dist/components/booking/booking-form.js +824 -0
  68. package/dist/components/brand/BrandPageView.d.ts +8 -0
  69. package/dist/components/brand/BrandPageView.d.ts.map +1 -0
  70. package/dist/components/brand/BrandPageView.js +97 -0
  71. package/dist/components/companion/AnonymousChat.d.ts +22 -0
  72. package/dist/components/companion/AnonymousChat.d.ts.map +1 -0
  73. package/dist/components/companion/AnonymousChat.js +24 -0
  74. package/dist/components/companion/SwipeCard.d.ts +25 -0
  75. package/dist/components/companion/SwipeCard.d.ts.map +1 -0
  76. package/dist/components/companion/SwipeCard.js +58 -0
  77. package/dist/components/create-flow/ConfirmDiscardDialog.d.ts +11 -0
  78. package/dist/components/create-flow/ConfirmDiscardDialog.d.ts.map +1 -0
  79. package/dist/components/create-flow/ConfirmDiscardDialog.js +14 -0
  80. package/dist/components/create-flow/EntityEditLoadingState.d.ts +2 -0
  81. package/dist/components/create-flow/EntityEditLoadingState.d.ts.map +1 -0
  82. package/dist/components/create-flow/EntityEditLoadingState.js +6 -0
  83. package/dist/components/create-flow/EntityFormCompletionState.d.ts +12 -0
  84. package/dist/components/create-flow/EntityFormCompletionState.d.ts.map +1 -0
  85. package/dist/components/create-flow/EntityFormCompletionState.js +10 -0
  86. package/dist/components/create-flow/EntityFormHeader.d.ts +9 -0
  87. package/dist/components/create-flow/EntityFormHeader.d.ts.map +1 -0
  88. package/dist/components/create-flow/EntityFormHeader.js +7 -0
  89. package/dist/components/create-flow/EntityFormPageFrame.d.ts +10 -0
  90. package/dist/components/create-flow/EntityFormPageFrame.d.ts.map +1 -0
  91. package/dist/components/create-flow/EntityFormPageFrame.js +10 -0
  92. package/dist/components/create-flow/ImageUploadStep.d.ts +15 -0
  93. package/dist/components/create-flow/ImageUploadStep.d.ts.map +1 -0
  94. package/dist/components/create-flow/ImageUploadStep.js +11 -0
  95. package/dist/components/create-flow/ImageUploader.d.ts +30 -0
  96. package/dist/components/create-flow/ImageUploader.d.ts.map +1 -0
  97. package/dist/components/create-flow/ImageUploader.js +193 -0
  98. package/dist/components/create-flow/MultiStepWizard.d.ts +25 -0
  99. package/dist/components/create-flow/MultiStepWizard.d.ts.map +1 -0
  100. package/dist/components/create-flow/MultiStepWizard.js +31 -0
  101. package/dist/components/create-flow/ReviewConfirmationCard.d.ts +8 -0
  102. package/dist/components/create-flow/ReviewConfirmationCard.d.ts.map +1 -0
  103. package/dist/components/create-flow/ReviewConfirmationCard.js +5 -0
  104. package/dist/components/create-flow/ReviewMetricGrid.d.ts +15 -0
  105. package/dist/components/create-flow/ReviewMetricGrid.d.ts.map +1 -0
  106. package/dist/components/create-flow/ReviewMetricGrid.js +8 -0
  107. package/dist/components/create-flow/TemplateSelectionDialog.d.ts +17 -0
  108. package/dist/components/create-flow/TemplateSelectionDialog.d.ts.map +1 -0
  109. package/dist/components/create-flow/TemplateSelectionDialog.js +7 -0
  110. package/dist/components/enquiry/EnquiryFormParts.d.ts +40 -0
  111. package/dist/components/enquiry/EnquiryFormParts.d.ts.map +1 -0
  112. package/dist/components/enquiry/EnquiryFormParts.js +29 -0
  113. package/dist/components/form-sections/FaqSection.d.ts +24 -0
  114. package/dist/components/form-sections/FaqSection.d.ts.map +1 -0
  115. package/dist/components/form-sections/FaqSection.js +17 -0
  116. package/dist/components/form-sections/ImageUploadSection.d.ts +12 -0
  117. package/dist/components/form-sections/ImageUploadSection.d.ts.map +1 -0
  118. package/dist/components/form-sections/ImageUploadSection.js +8 -0
  119. package/dist/components/form-sections/OpportunityBasicsSection.d.ts +8 -0
  120. package/dist/components/form-sections/OpportunityBasicsSection.d.ts.map +1 -0
  121. package/dist/components/form-sections/OpportunityBasicsSection.js +26 -0
  122. package/dist/components/form-sections/OpportunityDetailsSection.d.ts +18 -0
  123. package/dist/components/form-sections/OpportunityDetailsSection.d.ts.map +1 -0
  124. package/dist/components/form-sections/OpportunityDetailsSection.js +10 -0
  125. package/dist/components/form-sections/OpportunityTypeSection.d.ts +7 -0
  126. package/dist/components/form-sections/OpportunityTypeSection.d.ts.map +1 -0
  127. package/dist/components/form-sections/OpportunityTypeSection.js +15 -0
  128. package/dist/components/form-sections/PackageDetailsSection.d.ts +22 -0
  129. package/dist/components/form-sections/PackageDetailsSection.d.ts.map +1 -0
  130. package/dist/components/form-sections/PackageDetailsSection.js +20 -0
  131. package/dist/components/form-sections/PackageItinerarySection.d.ts +21 -0
  132. package/dist/components/form-sections/PackageItinerarySection.d.ts.map +1 -0
  133. package/dist/components/form-sections/PackageItinerarySection.js +112 -0
  134. package/dist/components/form-sections/PackagePricingSection.d.ts +8 -0
  135. package/dist/components/form-sections/PackagePricingSection.d.ts.map +1 -0
  136. package/dist/components/form-sections/PackagePricingSection.js +11 -0
  137. package/dist/components/form-sections/PackageReviewSection.d.ts +12 -0
  138. package/dist/components/form-sections/PackageReviewSection.d.ts.map +1 -0
  139. package/dist/components/form-sections/PackageReviewSection.js +26 -0
  140. package/dist/components/form-sections/RentalBasicsSection.d.ts +12 -0
  141. package/dist/components/form-sections/RentalBasicsSection.d.ts.map +1 -0
  142. package/dist/components/form-sections/RentalBasicsSection.js +91 -0
  143. package/dist/components/form-sections/RentalCapacitySection.d.ts +9 -0
  144. package/dist/components/form-sections/RentalCapacitySection.d.ts.map +1 -0
  145. package/dist/components/form-sections/RentalCapacitySection.js +23 -0
  146. package/dist/components/form-sections/RentalLocationSection.d.ts +10 -0
  147. package/dist/components/form-sections/RentalLocationSection.d.ts.map +1 -0
  148. package/dist/components/form-sections/RentalLocationSection.js +41 -0
  149. package/dist/components/form-sections/RentalPhotosSection.d.ts +8 -0
  150. package/dist/components/form-sections/RentalPhotosSection.d.ts.map +1 -0
  151. package/dist/components/form-sections/RentalPhotosSection.js +7 -0
  152. package/dist/components/form-sections/RentalReviewSection.d.ts +10 -0
  153. package/dist/components/form-sections/RentalReviewSection.d.ts.map +1 -0
  154. package/dist/components/form-sections/RentalReviewSection.js +27 -0
  155. package/dist/components/form-sections/RentalRulesSection.d.ts +7 -0
  156. package/dist/components/form-sections/RentalRulesSection.d.ts.map +1 -0
  157. package/dist/components/form-sections/RentalRulesSection.js +10 -0
  158. package/dist/components/form-sections/RentalSpecsSection.d.ts +7 -0
  159. package/dist/components/form-sections/RentalSpecsSection.d.ts.map +1 -0
  160. package/dist/components/form-sections/RentalSpecsSection.js +10 -0
  161. package/dist/components/host-dashboard/HostCalendar.d.ts +8 -0
  162. package/dist/components/host-dashboard/HostCalendar.d.ts.map +1 -0
  163. package/dist/components/host-dashboard/HostCalendar.js +43 -0
  164. package/dist/components/host-dashboard/HostCalendarGrid.d.ts +34 -0
  165. package/dist/components/host-dashboard/HostCalendarGrid.d.ts.map +1 -0
  166. package/dist/components/host-dashboard/HostCalendarGrid.js +30 -0
  167. package/dist/components/host-dashboard/HostListingMultiSelect.d.ts +12 -0
  168. package/dist/components/host-dashboard/HostListingMultiSelect.d.ts.map +1 -0
  169. package/dist/components/host-dashboard/HostListingMultiSelect.js +24 -0
  170. package/dist/components/host-dashboard/HostManageCalendarShell.d.ts +17 -0
  171. package/dist/components/host-dashboard/HostManageCalendarShell.d.ts.map +1 -0
  172. package/dist/components/host-dashboard/HostManageCalendarShell.js +5 -0
  173. package/dist/components/host-dashboard/HostSidebarNavigation.d.ts +2 -0
  174. package/dist/components/host-dashboard/HostSidebarNavigation.d.ts.map +1 -0
  175. package/dist/components/host-dashboard/HostSidebarNavigation.js +262 -0
  176. package/dist/components/host-dashboard/ManageFeatureSwitcher.d.ts +15 -0
  177. package/dist/components/host-dashboard/ManageFeatureSwitcher.d.ts.map +1 -0
  178. package/dist/components/host-dashboard/ManageFeatureSwitcher.js +43 -0
  179. package/dist/components/host-dashboard/PageHeader.d.ts +14 -0
  180. package/dist/components/host-dashboard/PageHeader.d.ts.map +1 -0
  181. package/dist/components/host-dashboard/PageHeader.js +8 -0
  182. package/dist/components/host-dashboard/PlaceholderPage.d.ts +4 -0
  183. package/dist/components/host-dashboard/PlaceholderPage.d.ts.map +1 -0
  184. package/dist/components/host-dashboard/PlaceholderPage.js +9 -0
  185. package/dist/components/host-dashboard/StatCard.d.ts +15 -0
  186. package/dist/components/host-dashboard/StatCard.d.ts.map +1 -0
  187. package/dist/components/host-dashboard/StatCard.js +38 -0
  188. package/dist/components/layout/AppProviders.d.ts +5 -0
  189. package/dist/components/layout/AppProviders.d.ts.map +1 -0
  190. package/dist/components/layout/AppProviders.js +11 -0
  191. package/dist/components/layout/PublicRouteLayout.d.ts +5 -0
  192. package/dist/components/layout/PublicRouteLayout.d.ts.map +1 -0
  193. package/dist/components/layout/PublicRouteLayout.js +5 -0
  194. package/dist/components/layout/PublicShell.d.ts +5 -0
  195. package/dist/components/layout/PublicShell.d.ts.map +1 -0
  196. package/dist/components/layout/PublicShell.js +5 -0
  197. package/dist/components/location/LocationPicker.d.ts +27 -0
  198. package/dist/components/location/LocationPicker.d.ts.map +1 -0
  199. package/dist/components/location/LocationPicker.js +415 -0
  200. package/dist/components/location/LocationPreview.d.ts +11 -0
  201. package/dist/components/location/LocationPreview.d.ts.map +1 -0
  202. package/dist/components/location/LocationPreview.js +12 -0
  203. package/dist/components/location/MapPicker.d.ts +9 -0
  204. package/dist/components/location/MapPicker.d.ts.map +1 -0
  205. package/dist/components/location/MapPicker.js +40 -0
  206. package/dist/components/location/MapPreview.d.ts +8 -0
  207. package/dist/components/location/MapPreview.d.ts.map +1 -0
  208. package/dist/components/location/MapPreview.js +17 -0
  209. package/dist/components/location/PlaceLinkInline.d.ts +14 -0
  210. package/dist/components/location/PlaceLinkInline.d.ts.map +1 -0
  211. package/dist/components/location/PlaceLinkInline.js +30 -0
  212. package/dist/components/location/leafletMap.d.ts +8 -0
  213. package/dist/components/location/leafletMap.d.ts.map +1 -0
  214. package/dist/components/location/leafletMap.js +74 -0
  215. package/dist/components/ui/GuestOrLoginDialog.d.ts +11 -0
  216. package/dist/components/ui/GuestOrLoginDialog.d.ts.map +1 -0
  217. package/dist/components/ui/GuestOrLoginDialog.js +19 -0
  218. package/dist/components/ui/ImageGalleryViewer.d.ts +10 -0
  219. package/dist/components/ui/ImageGalleryViewer.d.ts.map +1 -0
  220. package/dist/components/ui/ImageGalleryViewer.js +59 -0
  221. package/dist/components/ui/LocationInput.d.ts +12 -0
  222. package/dist/components/ui/LocationInput.d.ts.map +1 -0
  223. package/dist/components/ui/LocationInput.js +39 -0
  224. package/dist/components/ui/PropertyGalleryClient.d.ts +8 -0
  225. package/dist/components/ui/PropertyGalleryClient.d.ts.map +1 -0
  226. package/dist/components/ui/PropertyGalleryClient.js +22 -0
  227. package/dist/components/ui/calendar.d.ts +9 -0
  228. package/dist/components/ui/calendar.d.ts.map +1 -0
  229. package/dist/components/ui/calendar.js +75 -0
  230. package/dist/components/ui/dashboard/admin-adventures-table.d.ts +12 -0
  231. package/dist/components/ui/dashboard/admin-adventures-table.d.ts.map +1 -0
  232. package/dist/components/ui/dashboard/admin-adventures-table.js +94 -0
  233. package/dist/components/ui/dashboard/admin-blogs-table.d.ts +11 -0
  234. package/dist/components/ui/dashboard/admin-blogs-table.d.ts.map +1 -0
  235. package/dist/components/ui/dashboard/admin-blogs-table.js +58 -0
  236. package/dist/components/ui/dashboard/admin-opportunities-table.d.ts +20 -0
  237. package/dist/components/ui/dashboard/admin-opportunities-table.d.ts.map +1 -0
  238. package/dist/components/ui/dashboard/admin-opportunities-table.js +133 -0
  239. package/dist/components/ui/dashboard/admin-rentals-table.d.ts +12 -0
  240. package/dist/components/ui/dashboard/admin-rentals-table.d.ts.map +1 -0
  241. package/dist/components/ui/dashboard/admin-rentals-table.js +85 -0
  242. package/dist/components/ui/dashboard/admin-travel-package-table.d.ts +16 -0
  243. package/dist/components/ui/dashboard/admin-travel-package-table.d.ts.map +1 -0
  244. package/dist/components/ui/dashboard/admin-travel-package-table.js +100 -0
  245. package/dist/components/ui/dashboard/adventures-table.d.ts +16 -0
  246. package/dist/components/ui/dashboard/adventures-table.d.ts.map +1 -0
  247. package/dist/components/ui/dashboard/adventures-table.js +151 -0
  248. package/dist/components/ui/dashboard/approver-applications-table.d.ts +13 -0
  249. package/dist/components/ui/dashboard/approver-applications-table.d.ts.map +1 -0
  250. package/dist/components/ui/dashboard/approver-applications-table.js +85 -0
  251. package/dist/components/ui/dashboard/approver-package-enquiries-table.d.ts +11 -0
  252. package/dist/components/ui/dashboard/approver-package-enquiries-table.d.ts.map +1 -0
  253. package/dist/components/ui/dashboard/approver-package-enquiries-table.js +102 -0
  254. package/dist/components/ui/dashboard/archive-confirm-modal.d.ts +9 -0
  255. package/dist/components/ui/dashboard/archive-confirm-modal.d.ts.map +1 -0
  256. package/dist/components/ui/dashboard/archive-confirm-modal.js +6 -0
  257. package/dist/components/ui/dashboard/blogs-table.d.ts +10 -0
  258. package/dist/components/ui/dashboard/blogs-table.d.ts.map +1 -0
  259. package/dist/components/ui/dashboard/blogs-table.js +62 -0
  260. package/dist/components/ui/dashboard/bookings-table.d.ts +12 -0
  261. package/dist/components/ui/dashboard/bookings-table.d.ts.map +1 -0
  262. package/dist/components/ui/dashboard/bookings-table.js +160 -0
  263. package/dist/components/ui/dashboard/dashboard-page-shell.d.ts +7 -0
  264. package/dist/components/ui/dashboard/dashboard-page-shell.d.ts.map +1 -0
  265. package/dist/components/ui/dashboard/dashboard-page-shell.js +5 -0
  266. package/dist/components/ui/dashboard/data-table-shell.d.ts +18 -0
  267. package/dist/components/ui/dashboard/data-table-shell.d.ts.map +1 -0
  268. package/dist/components/ui/dashboard/data-table-shell.js +6 -0
  269. package/dist/components/ui/dashboard/delete-confirm-modal.d.ts +9 -0
  270. package/dist/components/ui/dashboard/delete-confirm-modal.d.ts.map +1 -0
  271. package/dist/components/ui/dashboard/delete-confirm-modal.js +6 -0
  272. package/dist/components/ui/dashboard/entity-list-page-state.d.ts +25 -0
  273. package/dist/components/ui/dashboard/entity-list-page-state.d.ts.map +1 -0
  274. package/dist/components/ui/dashboard/entity-list-page-state.js +17 -0
  275. package/dist/components/ui/dashboard/generic-entity-table.d.ts +36 -0
  276. package/dist/components/ui/dashboard/generic-entity-table.d.ts.map +1 -0
  277. package/dist/components/ui/dashboard/generic-entity-table.js +203 -0
  278. package/dist/components/ui/dashboard/opportunities-table.d.ts +17 -0
  279. package/dist/components/ui/dashboard/opportunities-table.d.ts.map +1 -0
  280. package/dist/components/ui/dashboard/opportunities-table.js +143 -0
  281. package/dist/components/ui/dashboard/rentals-table.d.ts +17 -0
  282. package/dist/components/ui/dashboard/rentals-table.d.ts.map +1 -0
  283. package/dist/components/ui/dashboard/rentals-table.js +155 -0
  284. package/dist/components/ui/dashboard/restore-confirm-modal.d.ts +9 -0
  285. package/dist/components/ui/dashboard/restore-confirm-modal.d.ts.map +1 -0
  286. package/dist/components/ui/dashboard/restore-confirm-modal.js +6 -0
  287. package/dist/components/ui/dashboard/stats-card.d.ts +6 -0
  288. package/dist/components/ui/dashboard/stats-card.d.ts.map +1 -0
  289. package/dist/components/ui/dashboard/stats-card.js +5 -0
  290. package/dist/components/ui/dashboard/travel-packages-table.d.ts +16 -0
  291. package/dist/components/ui/dashboard/travel-packages-table.d.ts.map +1 -0
  292. package/dist/components/ui/dashboard/travel-packages-table.js +134 -0
  293. package/dist/components/ui/dashboard/user-applications-table.d.ts +12 -0
  294. package/dist/components/ui/dashboard/user-applications-table.d.ts.map +1 -0
  295. package/dist/components/ui/dashboard/user-applications-table.js +79 -0
  296. package/dist/components/ui/loading-skeleton.d.ts +10 -0
  297. package/dist/components/ui/loading-skeleton.d.ts.map +1 -0
  298. package/dist/components/ui/loading-skeleton.js +49 -0
  299. package/dist/components/ui/misc/IosPwaNavBar.d.ts +8 -0
  300. package/dist/components/ui/misc/IosPwaNavBar.d.ts.map +1 -0
  301. package/dist/components/ui/misc/IosPwaNavBar.js +25 -0
  302. package/dist/components/ui/misc/document-upload-button.d.ts +10 -0
  303. package/dist/components/ui/misc/document-upload-button.d.ts.map +1 -0
  304. package/dist/components/ui/misc/document-upload-button.js +12 -0
  305. package/dist/components/ui/misc/empty-state.d.ts +9 -0
  306. package/dist/components/ui/misc/empty-state.d.ts.map +1 -0
  307. package/dist/components/ui/misc/empty-state.js +4 -0
  308. package/dist/components/ui/misc/image-cropper.d.ts +9 -0
  309. package/dist/components/ui/misc/image-cropper.d.ts.map +1 -0
  310. package/dist/components/ui/misc/image-cropper.js +28 -0
  311. package/dist/components/ui/misc/rental-tile.d.ts +6 -0
  312. package/dist/components/ui/misc/rental-tile.d.ts.map +1 -0
  313. package/dist/components/ui/misc/rental-tile.js +56 -0
  314. package/dist/components/ui/misc/skeleton-extras.d.ts +32 -0
  315. package/dist/components/ui/misc/skeleton-extras.d.ts.map +1 -0
  316. package/dist/components/ui/misc/skeleton-extras.js +58 -0
  317. package/dist/components/ui/misc/tile.d.ts +4 -0
  318. package/dist/components/ui/misc/tile.d.ts.map +1 -0
  319. package/dist/components/ui/misc/tile.js +45 -0
  320. package/dist/components/ui/misc/whatsapp-help.d.ts +7 -0
  321. package/dist/components/ui/misc/whatsapp-help.d.ts.map +1 -0
  322. package/dist/components/ui/misc/whatsapp-help.js +6 -0
  323. package/dist/components/ui/motion.d.ts +14 -0
  324. package/dist/components/ui/motion.d.ts.map +1 -0
  325. package/dist/components/ui/motion.js +17 -0
  326. package/dist/components/ui/trippeaze/breadcrumb-trail.d.ts +10 -0
  327. package/dist/components/ui/trippeaze/breadcrumb-trail.d.ts.map +1 -0
  328. package/dist/components/ui/trippeaze/breadcrumb-trail.js +15 -0
  329. package/dist/components/ui/trippeaze/chip-tabs.d.ts +13 -0
  330. package/dist/components/ui/trippeaze/chip-tabs.d.ts.map +1 -0
  331. package/dist/components/ui/trippeaze/chip-tabs.js +6 -0
  332. package/dist/components/ui/trippeaze/page-shell.d.ts +22 -0
  333. package/dist/components/ui/trippeaze/page-shell.d.ts.map +1 -0
  334. package/dist/components/ui/trippeaze/page-shell.js +15 -0
  335. package/dist/components/ui/trippeaze/search-input.d.ts +5 -0
  336. package/dist/components/ui/trippeaze/search-input.d.ts.map +1 -0
  337. package/dist/components/ui/trippeaze/search-input.js +7 -0
  338. package/dist/components/user-dashboard/UserDashboardShellSidebar.d.ts +2 -0
  339. package/dist/components/user-dashboard/UserDashboardShellSidebar.d.ts.map +1 -0
  340. package/dist/components/user-dashboard/UserDashboardShellSidebar.js +17 -0
  341. package/dist/components/user-dashboard/UserSidebarNav.d.ts +2 -0
  342. package/dist/components/user-dashboard/UserSidebarNav.d.ts.map +1 -0
  343. package/dist/components/user-dashboard/UserSidebarNav.js +67 -0
  344. package/dist/dashboard/action-buttons.d.ts +2 -1
  345. package/dist/dashboard/action-buttons.d.ts.map +1 -1
  346. package/dist/dashboard/action-buttons.js +18 -11
  347. package/dist/dashboard/app-sidebar.d.ts.map +1 -1
  348. package/dist/dashboard/app-sidebar.js +3 -36
  349. package/dist/dashboard/dashboard-components.js +1 -1
  350. package/dist/dashboard/data-table.d.ts +5 -1
  351. package/dist/dashboard/data-table.d.ts.map +1 -1
  352. package/dist/dashboard/data-table.js +39 -7
  353. package/dist/dashboard/table.js +1 -1
  354. package/dist/header/mobile-nav-item.js +2 -2
  355. package/dist/header/mobile-navbar.d.ts.map +1 -1
  356. package/dist/header/mobile-navbar.js +10 -1
  357. package/dist/header/nav-item.js +2 -2
  358. package/dist/index.d.ts +17 -0
  359. package/dist/index.d.ts.map +1 -1
  360. package/dist/index.js +17 -0
  361. package/dist/main/footer.d.ts +0 -1
  362. package/dist/main/footer.d.ts.map +1 -1
  363. package/dist/main/footer.js +0 -1
  364. package/dist/main/navbar.d.ts +2 -2
  365. package/dist/main/navbar.d.ts.map +1 -1
  366. package/dist/main/navbar.js +73 -44
  367. package/dist/main/portfolio/portfolioItem.d.ts +1 -1
  368. package/dist/main/portfolio/portfolioItem.d.ts.map +1 -1
  369. package/dist/main/portfolio/portfolioPopup.d.ts +1 -1
  370. package/dist/main/portfolio/portfolioPopup.d.ts.map +1 -1
  371. package/dist/main/review-page.d.ts +2 -1
  372. package/dist/main/review-page.d.ts.map +1 -1
  373. package/dist/main/review-page.js +34 -4
  374. package/dist/misc/accordion.js +1 -1
  375. package/dist/misc/alert-dialog.js +1 -1
  376. package/dist/misc/alert.js +1 -1
  377. package/dist/misc/alertdialogclaude.js +1 -1
  378. package/dist/misc/avatar.js +1 -1
  379. package/dist/misc/badge.js +1 -1
  380. package/dist/misc/button.d.ts +6 -3
  381. package/dist/misc/button.d.ts.map +1 -1
  382. package/dist/misc/button.js +33 -5
  383. package/dist/misc/card.js +1 -1
  384. package/dist/misc/carousel.d.ts +2 -2
  385. package/dist/misc/carousel.d.ts.map +1 -1
  386. package/dist/misc/carousel.js +13 -5
  387. package/dist/misc/checkbox.js +1 -1
  388. package/dist/misc/command.js +1 -1
  389. package/dist/misc/datepicker.d.ts +2 -1
  390. package/dist/misc/datepicker.d.ts.map +1 -1
  391. package/dist/misc/datepicker.js +23 -21
  392. package/dist/misc/dialog.js +3 -3
  393. package/dist/misc/discount-strategy-editor.d.ts +11 -0
  394. package/dist/misc/discount-strategy-editor.d.ts.map +1 -0
  395. package/dist/misc/discount-strategy-editor.js +82 -0
  396. package/dist/misc/dropdown-menu.js +1 -1
  397. package/dist/misc/faq.d.ts +1 -1
  398. package/dist/misc/faq.d.ts.map +1 -1
  399. package/dist/misc/filter.js +2 -2
  400. package/dist/misc/filterBar.d.ts +11 -3
  401. package/dist/misc/filterBar.d.ts.map +1 -1
  402. package/dist/misc/filterBar.js +109 -55
  403. package/dist/misc/form.js +1 -1
  404. package/dist/misc/input.d.ts +4 -1
  405. package/dist/misc/input.d.ts.map +1 -1
  406. package/dist/misc/input.js +8 -3
  407. package/dist/misc/label.js +1 -1
  408. package/dist/misc/listing-wishlist-button.d.ts +13 -0
  409. package/dist/misc/listing-wishlist-button.d.ts.map +1 -0
  410. package/dist/misc/listing-wishlist-button.js +42 -0
  411. package/dist/misc/location/locationPicker.js +1 -1
  412. package/dist/misc/location-autocomplete.d.ts +28 -0
  413. package/dist/misc/location-autocomplete.d.ts.map +1 -0
  414. package/dist/misc/location-autocomplete.js +121 -0
  415. package/dist/misc/notification.js +2 -2
  416. package/dist/misc/pagination.js +1 -1
  417. package/dist/misc/popover.js +1 -1
  418. package/dist/misc/pricing-strategy-editor.d.ts +17 -0
  419. package/dist/misc/pricing-strategy-editor.d.ts.map +1 -0
  420. package/dist/misc/pricing-strategy-editor.js +80 -0
  421. package/dist/misc/progress.js +1 -1
  422. package/dist/misc/pwa-install-button.d.ts.map +1 -1
  423. package/dist/misc/pwa-install-button.js +2 -0
  424. package/dist/misc/rental-tile.d.ts +1 -1
  425. package/dist/misc/rental-tile.d.ts.map +1 -1
  426. package/dist/misc/rental-tile.js +24 -14
  427. package/dist/misc/scroll-area.js +1 -1
  428. package/dist/misc/select.js +1 -1
  429. package/dist/misc/separator.js +1 -1
  430. package/dist/misc/sheet.js +1 -1
  431. package/dist/misc/sidebar.js +2 -2
  432. package/dist/misc/slider.js +1 -1
  433. package/dist/misc/stateCard.d.ts +1 -1
  434. package/dist/misc/stateCard.d.ts.map +1 -1
  435. package/dist/misc/stateCard.js +1 -1
  436. package/dist/misc/step-progress.d.ts +16 -0
  437. package/dist/misc/step-progress.d.ts.map +1 -0
  438. package/dist/misc/step-progress.js +40 -0
  439. package/dist/misc/switch.js +1 -1
  440. package/dist/misc/tabs.js +1 -1
  441. package/dist/misc/tag-filter-input.d.ts +16 -0
  442. package/dist/misc/tag-filter-input.d.ts.map +1 -0
  443. package/dist/misc/tag-filter-input.js +26 -0
  444. package/dist/misc/textarea.js +1 -1
  445. package/dist/misc/tile.d.ts +1 -1
  446. package/dist/misc/tile.d.ts.map +1 -1
  447. package/dist/misc/tile.js +12 -47
  448. package/dist/misc/time-select.d.ts +14 -0
  449. package/dist/misc/time-select.d.ts.map +1 -0
  450. package/dist/misc/time-select.js +13 -0
  451. package/dist/misc/tooltip.js +1 -1
  452. package/dist/misc/wizard-footer.d.ts +18 -0
  453. package/dist/misc/wizard-footer.d.ts.map +1 -0
  454. package/dist/misc/wizard-footer.js +11 -0
  455. package/package.json +9 -6
  456. package/dist/misc/dashboard/action-buttons.js +0 -31
  457. package/dist/misc/misc/alertdialogclaude.js +0 -221
  458. package/dist/misc/misc/button.js +0 -46
  459. package/dist/misc/misc/dropdown-menu.js +0 -136
@@ -0,0 +1,69 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { AlertCircle, BedDouble, Calendar, Clock, IndianRupee, Mail, MapPin, Phone, Tag, Ticket, User, Users, } from "lucide-react";
4
+ const STATUS_COLORS = {
5
+ pending: "bg-amber-100 text-amber-700 border-amber-200",
6
+ confirmed: "bg-green-100 text-green-700 border-green-200",
7
+ completed: "bg-blue-100 text-blue-700 border-blue-200",
8
+ cancelled: "bg-red-100 text-red-700 border-red-200",
9
+ };
10
+ const STATUS_LABELS = {
11
+ pending: { label: "Pending", desc: "Awaiting confirmation" },
12
+ confirmed: { label: "Confirmed", desc: "Booking is confirmed" },
13
+ completed: { label: "Completed", desc: "Trip has been completed" },
14
+ cancelled: { label: "Cancelled", desc: "Booking was cancelled" },
15
+ };
16
+ const PAYMENT_COLORS = {
17
+ paid: "bg-green-100 text-green-700 border-green-200",
18
+ pending: "bg-amber-100 text-amber-700 border-amber-200",
19
+ failed: "bg-red-100 text-red-700 border-red-200",
20
+ refunded: "bg-purple-100 text-purple-700 border-purple-200",
21
+ };
22
+ const PAYMENT_LABELS = {
23
+ paid: { label: "Payment Received", desc: "Payment successfully processed" },
24
+ pending: { label: "Payment Pending", desc: "Awaiting payment from guest" },
25
+ failed: { label: "Payment Failed", desc: "Payment attempt was unsuccessful" },
26
+ refunded: { label: "Refunded", desc: "Payment has been refunded" },
27
+ };
28
+ function InfoRow({ icon: Icon, label, value, }) {
29
+ if (!value && value !== 0)
30
+ return null;
31
+ return (_jsxs("div", { className: "flex items-start gap-3", children: [_jsx("div", { className: "w-8 h-8 rounded-xl bg-slate-100 flex items-center justify-center flex-shrink-0", children: _jsx(Icon, { className: "w-4 h-4 text-slate-500" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-[10px] font-bold uppercase tracking-wider text-slate-400", children: label }), _jsx("p", { className: "text-sm font-semibold text-slate-800", children: value })] })] }));
32
+ }
33
+ function formatDate(date) {
34
+ if (!date)
35
+ return null;
36
+ return new Date(date).toLocaleDateString("en-IN", {
37
+ day: "numeric",
38
+ month: "long",
39
+ year: "numeric",
40
+ });
41
+ }
42
+ export default function AdminBookingRegistrationsList({ bookings, type, }) {
43
+ return (_jsx("div", { className: "grid gap-4", children: bookings.map((booking) => {
44
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
45
+ const user = booking.userId;
46
+ const contact = booking.contactDetails;
47
+ const entity = booking.entityId || booking.stayId;
48
+ const isStay = type === "stay";
49
+ const isEvent = type === "event";
50
+ const attendeeName = user
51
+ ? [user.firstName, user.lastName].filter(Boolean).join(" ")
52
+ : (contact === null || contact === void 0 ? void 0 : contact.name) || "Guest User";
53
+ const startDate = booking.checkIn || booking.startDate || booking.eventDate;
54
+ const endDate = booking.checkOut || booking.endDate;
55
+ const quantity = booking.qty || booking.roomQty;
56
+ const peopleValue = isEvent
57
+ ? booking.numberOfSeats
58
+ : isStay
59
+ ? booking.guests
60
+ : booking.numberOfPeople;
61
+ return (_jsxs("div", { className: "rounded-3xl border border-slate-100 bg-white p-6 shadow-sm", children: [_jsxs("div", { className: "flex flex-col gap-4 md:flex-row md:items-start md:justify-between", children: [_jsxs("div", { children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsxs("div", { className: `flex flex-col items-start px-3 py-1.5 rounded-2xl border ${STATUS_COLORS[booking.status] || "bg-slate-100 text-slate-600 border-slate-200"}`, children: [_jsx("span", { className: "text-xs font-bold leading-tight", children: ((_a = STATUS_LABELS[booking.status]) === null || _a === void 0 ? void 0 : _a.label) || ((_b = booking.status) === null || _b === void 0 ? void 0 : _b.toUpperCase()) }), _jsx("span", { className: "text-[10px] font-medium opacity-75 leading-tight", children: ((_c = STATUS_LABELS[booking.status]) === null || _c === void 0 ? void 0 : _c.desc) || "Booking status" })] }), _jsxs("div", { className: `flex flex-col items-start px-3 py-1.5 rounded-2xl border ${PAYMENT_COLORS[booking.paymentStatus] || "bg-slate-100 text-slate-600 border-slate-200"}`, children: [_jsx("span", { className: "text-xs font-bold leading-tight", children: ((_d = PAYMENT_LABELS[booking.paymentStatus]) === null || _d === void 0 ? void 0 : _d.label) || booking.paymentStatus }), _jsx("span", { className: "text-[10px] font-medium opacity-75 leading-tight", children: ((_e = PAYMENT_LABELS[booking.paymentStatus]) === null || _e === void 0 ? void 0 : _e.desc) || "Payment status" })] })] }), _jsx("h2", { className: "mt-4 text-xl font-bold text-slate-900", children: attendeeName }), _jsxs("p", { className: "text-sm font-medium text-slate-400", children: ["Booking ID: ", booking._id] })] }), _jsxs("div", { className: "rounded-2xl bg-slate-50 px-4 py-3 text-right", children: [_jsx("p", { className: "text-xs font-bold uppercase tracking-widest text-slate-400", children: "Total Amount" }), _jsxs("p", { className: "mt-1 flex items-center justify-end gap-1 text-xl font-bold text-slate-900", children: [_jsx(IndianRupee, { className: "w-4 h-4" }), (_j = (_h = (_g = (_f = booking.totalPrice) === null || _f === void 0 ? void 0 : _f.toLocaleString) === null || _g === void 0 ? void 0 : _g.call(_f)) !== null && _h !== void 0 ? _h : booking.totalPrice) !== null && _j !== void 0 ? _j : 0] }), _jsx("p", { className: "mt-1 text-xs font-bold uppercase text-slate-500", children: booking.currency || "INR" })] })] }), _jsxs("div", { className: "mt-6 grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-4 rounded-3xl border border-slate-100 bg-slate-50/50 p-5", children: [_jsx("p", { className: "text-xs font-bold uppercase tracking-widest text-slate-400", children: "Guest Details" }), _jsx(InfoRow, { icon: User, label: "Guest Name", value: attendeeName }), _jsx(InfoRow, { icon: Mail, label: "Email", value: (user === null || user === void 0 ? void 0 : user.email) || (contact === null || contact === void 0 ? void 0 : contact.email) }), _jsx(InfoRow, { icon: Phone, label: "Phone", value: (user === null || user === void 0 ? void 0 : user.phoneNumber) || (contact === null || contact === void 0 ? void 0 : contact.phone) }), (user === null || user === void 0 ? void 0 : user.username) && (_jsx(InfoRow, { icon: Tag, label: "Username", value: `@${user.username}` })), _jsx(InfoRow, { icon: AlertCircle, label: "Booking Type", value: booking.isGuest ? "Guest Booking" : "Registered User" }), booking.specialRequests && (_jsxs("div", { className: "rounded-2xl bg-white p-4", children: [_jsx("p", { className: "text-[10px] font-bold uppercase tracking-widest text-slate-400", children: "Special Requests" }), _jsx("p", { className: "mt-1 text-sm font-medium text-slate-700", children: booking.specialRequests })] }))] }), _jsxs("div", { className: "space-y-4 rounded-3xl border border-slate-100 bg-slate-50/50 p-5", children: [_jsx("p", { className: "text-xs font-bold uppercase tracking-widest text-slate-400", children: "Booking Details" }), _jsx(InfoRow, { icon: Tag, label: "Listing", value: entity === null || entity === void 0 ? void 0 : entity.title }), _jsx(InfoRow, { icon: MapPin, label: "Location", value: [
62
+ booking.venue,
63
+ (entity === null || entity === void 0 ? void 0 : entity.city) || booking.city,
64
+ entity === null || entity === void 0 ? void 0 : entity.state,
65
+ ]
66
+ .filter(Boolean)
67
+ .join(", ") }), _jsx(InfoRow, { icon: Calendar, label: isStay ? "Check-in" : "Start Date", value: formatDate(startDate) }), _jsx(InfoRow, { icon: Calendar, label: isStay ? "Check-out" : isEvent ? "Event Date" : "End Date", value: formatDate(endDate || (isEvent ? startDate : null)) }), isStay && (_jsxs(_Fragment, { children: [_jsx(InfoRow, { icon: BedDouble, label: "Room", value: booking.roomName || booking.roomType }), _jsx(InfoRow, { icon: Clock, label: "Nights", value: booking.nights })] })), _jsx(InfoRow, { icon: Users, label: isEvent ? "Seats" : "Guests", value: peopleValue }), booking.pickupPointName && !booking.homeDeliverySelected && (_jsx(InfoRow, { icon: MapPin, label: "Pickup Point", value: booking.pickupPointName })), booking.homeDeliverySelected && (_jsx(InfoRow, { icon: MapPin, label: "Delivery Mode", value: "Home Delivery" })), (quantity || 0) > 1 && (_jsx(InfoRow, { icon: Ticket, label: "Quantity", value: quantity }))] })] }), _jsxs("div", { className: "mt-6 rounded-3xl border border-slate-100 bg-slate-50 p-5", children: [_jsx("p", { className: "text-xs font-bold uppercase tracking-widest text-slate-400", children: "Price Breakdown" }), _jsxs("div", { className: "mt-3 space-y-2", children: [isStay && booking.pricePerNight ? (_jsxs("div", { className: "flex justify-between text-sm font-medium text-slate-500", children: [_jsxs("span", { children: ["Rs. ", (_m = (_l = (_k = booking.pricePerNight) === null || _k === void 0 ? void 0 : _k.toLocaleString) === null || _l === void 0 ? void 0 : _l.call(_k)) !== null && _m !== void 0 ? _m : booking.pricePerNight, " × ", booking.nights, " night", booking.nights > 1 ? "s" : "", quantity > 1 ? ` × ${quantity}` : ""] }), _jsxs("span", { children: ["Rs. ", (_q = (_p = (_o = booking.totalPrice) === null || _o === void 0 ? void 0 : _o.toLocaleString) === null || _p === void 0 ? void 0 : _p.call(_o)) !== null && _q !== void 0 ? _q : booking.totalPrice] })] })) : (_jsxs("div", { className: "flex justify-between text-sm font-medium text-slate-500", children: [_jsx("span", { children: "Booking Amount" }), _jsxs("span", { children: ["Rs. ", (_t = (_s = (_r = booking.totalPrice) === null || _r === void 0 ? void 0 : _r.toLocaleString) === null || _s === void 0 ? void 0 : _s.call(_r)) !== null && _t !== void 0 ? _t : booking.totalPrice] })] })), !!booking.homeDeliveryCharge && (_jsxs("div", { className: "flex justify-between text-sm font-medium text-slate-500", children: [_jsx("span", { children: "Includes delivery fee" }), _jsxs("span", { children: ["Rs. ", (_w = (_v = (_u = booking.homeDeliveryCharge) === null || _u === void 0 ? void 0 : _u.toLocaleString) === null || _v === void 0 ? void 0 : _v.call(_u)) !== null && _w !== void 0 ? _w : booking.homeDeliveryCharge] })] })), _jsxs("div", { className: "flex justify-between border-t border-slate-200 pt-2 text-base font-bold text-slate-900", children: [_jsx("span", { children: "Total" }), _jsxs("span", { children: ["Rs. ", (_z = (_y = (_x = booking.totalPrice) === null || _x === void 0 ? void 0 : _x.toLocaleString) === null || _y === void 0 ? void 0 : _y.call(_x)) !== null && _z !== void 0 ? _z : booking.totalPrice] })] })] })] })] }, booking._id));
68
+ }) }));
69
+ }
@@ -0,0 +1,9 @@
1
+ type ListingType = "adventure" | "stay" | "package" | "event" | "rental";
2
+ interface Props {
3
+ initialItems: any[];
4
+ type: ListingType;
5
+ viewBasePath: string;
6
+ }
7
+ export default function AdminListingActionsWrapper({ initialItems, type, viewBasePath }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=AdminListingActionsWrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdminListingActionsWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/admin/AdminListingActionsWrapper.tsx"],"names":[],"mappings":"AAeA,KAAK,WAAW,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzE,UAAU,KAAK;IACb,YAAY,EAAE,GAAG,EAAE,CAAC;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,KAAK,2CA0Q7F"}
@@ -0,0 +1,200 @@
1
+ "use client";
2
+ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { useRouter } from "next/navigation";
5
+ import { showAlert } from "@myrjfa/ui/dist/misc/alertdialogclaude";
6
+ import { approveAdventure, rejectAdventure, deleteAdventure } from "@myrjfa/state/dist/lib/adventureActions";
7
+ import { approveStay, rejectStay, deleteStayListing } from "@myrjfa/state/dist/lib/stayActions";
8
+ import { approvePackage, rejectPackage, deletePackage } from "@myrjfa/state/dist/lib/packageActions";
9
+ import { approveEventAdmin, rejectEventAdmin, deleteEventListing } from "@myrjfa/state/dist/lib/eventActions";
10
+ import { approveRental, rejectRental, deleteRental } from "@myrjfa/state/dist/lib/rentalActions";
11
+ import { deleteHostDashboardListing, archiveHostDashboardListing, restoreHostDashboardListing } from "@myrjfa/state/dist/lib/hostDashboardActions";
12
+ import { Check, X, Eye, MapPin, Calendar, Tag, Edit, Trash2, Archive, RefreshCw, Mail, Users } from "lucide-react";
13
+ import { handleEmail } from "@myrjfa/state/dist/lib/utils";
14
+ import { getPrimaryPricingStrategy, getPricingCurrency } from "@myrjfa/state/dist/lib/models/pricing";
15
+ export default function AdminListingActionsWrapper({ initialItems, type, viewBasePath }) {
16
+ const [items, setItems] = useState(initialItems);
17
+ const [processing, setProcessing] = useState(null);
18
+ const router = useRouter();
19
+ const getIdentifier = (item) => item.slug || item._id;
20
+ const getResolvedPrice = (item) => { var _a; return (_a = getPrimaryPricingStrategy(item)) === null || _a === void 0 ? void 0 : _a.finalBasePrice; };
21
+ const handleApprove = async (item) => {
22
+ const id = getIdentifier(item);
23
+ setProcessing(id);
24
+ try {
25
+ let result;
26
+ if (type === "adventure")
27
+ result = await approveAdventure(id);
28
+ else if (type === "stay")
29
+ result = await approveStay(id);
30
+ else if (type === "package")
31
+ result = await approvePackage(id);
32
+ else if (type === "rental")
33
+ result = await approveRental(id);
34
+ else
35
+ result = await approveEventAdmin(item._id);
36
+ if (result.success) {
37
+ setItems((prev) => prev.map((i) => getIdentifier(i) === id ? { ...i, status: "open" } : i));
38
+ await showAlert(`${capitalize(type)} approved and is now public.`);
39
+ router.refresh();
40
+ }
41
+ else {
42
+ await showAlert(result.error || `Failed to approve ${type}`);
43
+ }
44
+ }
45
+ catch (_a) {
46
+ await showAlert("An error occurred while approving.");
47
+ }
48
+ finally {
49
+ setProcessing(null);
50
+ }
51
+ };
52
+ const handleReject = async (item) => {
53
+ const id = getIdentifier(item);
54
+ const reason = window.prompt(`Reason for rejecting this ${type}:`);
55
+ if (reason === null)
56
+ return;
57
+ setProcessing(id);
58
+ try {
59
+ let result;
60
+ const rejectionReason = reason || "Did not meet platform guidelines";
61
+ if (type === "adventure")
62
+ result = await rejectAdventure(id, rejectionReason);
63
+ else if (type === "stay")
64
+ result = await rejectStay(id, rejectionReason);
65
+ else if (type === "package")
66
+ result = await rejectPackage(id, rejectionReason);
67
+ else if (type === "rental")
68
+ result = await rejectRental(id, rejectionReason);
69
+ else
70
+ result = await rejectEventAdmin(item._id, rejectionReason);
71
+ if (result.success) {
72
+ setItems((prev) => prev.map((i) => getIdentifier(i) === id ? { ...i, status: "denied" } : i));
73
+ await showAlert(`${capitalize(type)} rejected.`);
74
+ router.refresh();
75
+ }
76
+ else {
77
+ await showAlert(result.error || `Failed to reject ${type}`);
78
+ }
79
+ }
80
+ catch (_a) {
81
+ await showAlert("An error occurred while rejecting.");
82
+ }
83
+ finally {
84
+ setProcessing(null);
85
+ }
86
+ };
87
+ const handleDelete = async (item) => {
88
+ if (!window.confirm(`Are you sure you want to permanently delete this ${type}?`))
89
+ return;
90
+ setProcessing(getIdentifier(item));
91
+ try {
92
+ const res = type === "package"
93
+ ? await deletePackage(item.slug)
94
+ : type === "stay"
95
+ ? await deleteStayListing(item._id)
96
+ : type === "adventure"
97
+ ? await deleteAdventure(item.slug)
98
+ : type === "rental"
99
+ ? await deleteRental(item.slug)
100
+ : type === "event"
101
+ ? await deleteEventListing(item._id)
102
+ : await deleteHostDashboardListing(item._id, type);
103
+ if (res.success) {
104
+ setItems(prev => prev.filter(i => getIdentifier(i) !== getIdentifier(item)));
105
+ router.refresh();
106
+ }
107
+ else {
108
+ await showAlert(res.error || "Failed to delete");
109
+ }
110
+ }
111
+ finally {
112
+ setProcessing(null);
113
+ }
114
+ };
115
+ const handleArchive = async (item) => {
116
+ if (!window.confirm(`Archive this ${type}? It will be hidden from the public.`))
117
+ return;
118
+ setProcessing(getIdentifier(item));
119
+ try {
120
+ const res = await archiveHostDashboardListing(item._id, type);
121
+ if (res.success) {
122
+ setItems(prev => prev.map((i) => getIdentifier(i) === getIdentifier(item) ? { ...i, status: "archived" } : i));
123
+ router.refresh();
124
+ }
125
+ else {
126
+ await showAlert(res.error || "Failed to archive");
127
+ }
128
+ }
129
+ finally {
130
+ setProcessing(null);
131
+ }
132
+ };
133
+ const handleRestore = async (item) => {
134
+ if (!window.confirm(`Restore this ${type}? It will become public again.`))
135
+ return;
136
+ setProcessing(getIdentifier(item));
137
+ try {
138
+ const res = await restoreHostDashboardListing(item._id, type);
139
+ if (res.success) {
140
+ setItems(prev => prev.map((i) => getIdentifier(i) === getIdentifier(item) ? { ...i, status: "open" } : i));
141
+ router.refresh();
142
+ }
143
+ else {
144
+ await showAlert(res.error || "Failed to restore");
145
+ }
146
+ }
147
+ finally {
148
+ setProcessing(null);
149
+ }
150
+ };
151
+ const handleEdit = (item) => {
152
+ // Navigate dynamically based on standard routes
153
+ switch (type) {
154
+ case "stay":
155
+ router.push(`/dashboard/host/stays/${item.slug}/edit`);
156
+ break;
157
+ case "package":
158
+ router.push(`/dashboard/host/packages/${item.slug}/edit`);
159
+ break;
160
+ case "rental":
161
+ router.push(`/dashboard/host/rentals/${item.slug}/edit`);
162
+ break;
163
+ case "adventure":
164
+ router.push(`/dashboard/host/adventures/${item.slug}/edit`);
165
+ break;
166
+ case "event":
167
+ router.push(`/dashboard/host/events/${item.slug}/edit`);
168
+ break;
169
+ default:
170
+ router.push(`${viewBasePath}/${item.slug}/edit`);
171
+ }
172
+ };
173
+ if (items.length === 0) {
174
+ return (_jsxs("div", { className: "p-12 text-center text-slate-500 bg-card rounded-lg border border-dashed", children: [_jsxs("p", { className: "text-lg font-medium", children: ["No ", type, "s found"] }), _jsx("p", { className: "text-sm", children: "You are all caught up! No listings to display." })] }));
175
+ }
176
+ return (_jsx("div", { className: "divide-y divide-slate-100", children: items.map((item) => {
177
+ var _a, _b, _c, _d;
178
+ const id = getIdentifier(item);
179
+ const isProcessing = processing === id;
180
+ const status = item.status || "open";
181
+ return (_jsxs("div", { className: "flex flex-col md:flex-row md:items-center justify-between gap-4 p-5 hover:bg-slate-50 transition-colors", children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("p", { className: "font-bold text-slate-800 truncate", children: item.title || "Untitled" }), _jsx("div", { className: `text-[10px] uppercase font-bold tracking-widest px-2 py-0.5 rounded-full ${status === 'pending' ? 'bg-amber-100 text-amber-700' : status === 'open' ? 'bg-emerald-100 text-emerald-700' : 'bg-slate-100 text-slate-700'}`, children: status })] }), _jsxs("div", { className: "flex items-center gap-3 mt-1 flex-wrap", children: [(item.city || item.state) && (_jsxs("span", { className: "flex items-center gap-1 text-xs text-slate-500", children: [_jsx(MapPin, { className: "w-3 h-3" }), [item.city, item.state].filter(Boolean).join(", ")] })), item.eventDate && (_jsxs("span", { className: "flex items-center gap-1 text-xs text-slate-500", children: [_jsx(Calendar, { className: "w-3 h-3" }), new Date(item.eventDate).toLocaleDateString()] })), getResolvedPrice(item) != null && (_jsxs("span", { className: "flex items-center gap-1 text-xs text-slate-500", children: [_jsx(Tag, { className: "w-3 h-3" }), getPricingCurrency(item), " ", getResolvedPrice(item)] })), _jsxs("span", { className: "text-xs text-slate-400", children: [(_a = item.hostId) === null || _a === void 0 ? void 0 : _a.firstName, " ", (_b = item.hostId) === null || _b === void 0 ? void 0 : _b.lastName, ((_c = item.hostId) === null || _c === void 0 ? void 0 : _c.username) && ` (@${item.hostId.username})`] })] })] }), _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [_jsx("button", { onClick: () => handleEdit(item), disabled: isProcessing, className: "p-2 text-slate-500 hover:text-indigo-600 hover:bg-indigo-50 rounded-lg transition-colors", title: "Edit listing", children: _jsx(Edit, { className: "w-4 h-4" }) }), status !== "archived" ? (_jsx("button", { onClick: () => handleArchive(item), disabled: isProcessing, className: "p-2 text-slate-500 hover:text-amber-600 hover:bg-amber-50 rounded-lg transition-colors", title: "Archive listing", children: _jsx(Archive, { className: "w-4 h-4" }) })) : (_jsx("button", { onClick: () => handleRestore(item), disabled: isProcessing, className: "p-2 text-slate-500 hover:text-emerald-600 hover:bg-emerald-50 rounded-lg transition-colors", title: "Restore listing", children: _jsx(RefreshCw, { className: "w-4 h-4" }) })), _jsx("button", { onClick: () => handleDelete(item), disabled: isProcessing, className: "p-2 text-slate-500 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors", title: "Delete listing", children: _jsx(Trash2, { className: "w-4 h-4" }) }), _jsx("a", { href: `${viewBasePath}/${item.slug}`, target: "_blank", rel: "noopener noreferrer", className: "p-2 text-slate-500 hover:text-slate-700 hover:bg-slate-100 rounded-lg transition-colors", title: "View listing", children: _jsx(Eye, { className: "w-4 h-4" }) }), (type === "event" || type === "adventure" || type === "stay" || type === "rental") && (_jsx("button", { onClick: () => {
182
+ const base = type === "event"
183
+ ? "/dashboard/admin/events"
184
+ : type === "adventure"
185
+ ? "/dashboard/admin/adventures"
186
+ : type === "rental"
187
+ ? "/dashboard/admin/rentals"
188
+ : "/dashboard/admin/stays";
189
+ router.push(`${base}/${item.slug || item._id}/registrations`);
190
+ }, disabled: isProcessing, className: "p-2 text-slate-500 hover:text-violet-600 hover:bg-violet-50 rounded-lg transition-colors", title: "View registrations", children: _jsx(Users, { className: "w-4 h-4" }) })), ((_d = item.hostId) === null || _d === void 0 ? void 0 : _d.email) && (_jsx("button", { onClick: () => {
191
+ var _a, _b;
192
+ const subject = encodeURIComponent(`Trippeaze: Feedback on your ${type} listing`);
193
+ const body = encodeURIComponent(`Dear ${(_b = (_a = item.hostId) === null || _a === void 0 ? void 0 : _a.firstName) !== null && _b !== void 0 ? _b : "Host"},\n\nWe are reviewing your ${type} listing "${item.title}". Please let us know if you have any questions.\n\nBest regards,\nTrippeaze`);
194
+ handleEmail(item.hostId.email, subject, body);
195
+ }, className: "p-2 text-slate-500 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors", title: "Contact host", children: _jsx(Mail, { className: "w-4 h-4" }) })), status === "pending" && (_jsxs(_Fragment, { children: [_jsxs("button", { onClick: () => handleReject(item), disabled: isProcessing, className: "flex items-center gap-1.5 px-3 py-2 text-sm font-bold text-red-600 bg-red-50 hover:bg-red-100 rounded-lg transition-colors disabled:opacity-50", children: [_jsx(X, { className: "w-4 h-4" }), "Reject"] }), _jsxs("button", { onClick: () => handleApprove(item), disabled: isProcessing, className: "flex items-center gap-1.5 px-3 py-2 text-sm font-bold text-white bg-green-500 hover:bg-green-600 rounded-lg transition-colors disabled:opacity-50 shadow-sm", children: [isProcessing && processing === getIdentifier(item) ? (_jsx("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" })) : (_jsx(Check, { className: "w-4 h-4" })), "Approve"] })] }))] })] }, id));
196
+ }) }));
197
+ }
198
+ function capitalize(s) {
199
+ return s.charAt(0).toUpperCase() + s.slice(1);
200
+ }
@@ -0,0 +1,6 @@
1
+ export declare function ActivateAdPlacementButton({ slug, placementType, publisherPlacePath, }: {
2
+ slug: string;
3
+ placementType?: "creator_profile" | "creator_content" | "brand_page";
4
+ publisherPlacePath?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=ActivateAdPlacementButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActivateAdPlacementButton.d.ts","sourceRoot":"","sources":["../../../src/components/ads/ActivateAdPlacementButton.tsx"],"names":[],"mappings":"AAOA,wBAAgB,yBAAyB,CAAC,EACxC,IAAI,EACJ,aAAiC,EACjC,kBAAkB,GACnB,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,YAAY,CAAC;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,2CAiCA"}
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { Loader2 } from "lucide-react";
5
+ import { toast } from "sonner";
6
+ import { activateAdPlacement } from "@myrjfa/state/dist/lib/brandActions";
7
+ export function ActivateAdPlacementButton({ slug, placementType = "creator_profile", publisherPlacePath, }) {
8
+ const [pending, setPending] = useState(false);
9
+ const onActivate = async () => {
10
+ setPending(true);
11
+ try {
12
+ const result = await activateAdPlacement(slug, {
13
+ placementType,
14
+ publisherPlacePath,
15
+ });
16
+ if (!result.success) {
17
+ toast.error(result.error || "Could not activate ad placement");
18
+ return;
19
+ }
20
+ toast.success("Ad offer added to your monetized surfaces");
21
+ }
22
+ finally {
23
+ setPending(false);
24
+ }
25
+ };
26
+ return (_jsxs("button", { type: "button", onClick: onActivate, disabled: pending, className: "inline-flex items-center justify-center gap-2 rounded-full bg-primary px-5 py-3 text-sm font-bold text-white transition hover:opacity-92 disabled:cursor-not-allowed disabled:opacity-65", children: [pending ? _jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : null, "Pick this ad"] }));
27
+ }
@@ -0,0 +1,6 @@
1
+ import type { AdOfferSummary } from "@myrjfa/state/dist/lib/placeActions";
2
+ export declare function AdOfferCard({ offer, compact, }: {
3
+ offer: AdOfferSummary;
4
+ compact?: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=AdOfferCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdOfferCard.d.ts","sourceRoot":"","sources":["../../../src/components/ads/AdOfferCard.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAM1E,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAe,GAChB,EAAE;IACD,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,2CAsFA"}
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Image from "next/image";
4
+ import Link from "next/link";
5
+ import { BadgePercent, MousePointerClick, Eye, ArrowRight, ShieldCheck } from "lucide-react";
6
+ function percent(value) {
7
+ return `${Number(value || 0).toFixed(value && value % 1 !== 0 ? 1 : 0)}%`;
8
+ }
9
+ export function AdOfferCard({ offer, compact = false, }) {
10
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
11
+ const creative = (_a = offer.creative) === null || _a === void 0 ? void 0 : _a[0];
12
+ const expected = ((_b = offer.placement) === null || _b === void 0 ? void 0 : _b.expectedCommission) || offer.maxCommission;
13
+ const score = ((_d = (_c = offer.placement) === null || _c === void 0 ? void 0 : _c.scores) === null || _d === void 0 ? void 0 : _d.finalScore) || ((_f = (_e = offer.placement) === null || _e === void 0 ? void 0 : _e.scores) === null || _f === void 0 ? void 0 : _f.relevanceScore) || 0;
14
+ return (_jsxs(Link, { href: `/ads/${offer.slug}`, className: `group overflow-hidden rounded-[1.4rem] border border-slate-200/70 bg-white shadow-sm transition hover:-translate-y-0.5 hover:border-primary/25 hover:shadow-lg ${compact ? "" : ""}`, children: [_jsxs("div", { className: "relative aspect-[4/3] bg-slate-100", children: [(creative === null || creative === void 0 ? void 0 : creative.image) || ((_g = offer.brand) === null || _g === void 0 ? void 0 : _g.coverImage) || ((_h = offer.brand) === null || _h === void 0 ? void 0 : _h.logo) ? (_jsx(Image, { src: (creative === null || creative === void 0 ? void 0 : creative.image) || ((_j = offer.brand) === null || _j === void 0 ? void 0 : _j.coverImage) || ((_k = offer.brand) === null || _k === void 0 ? void 0 : _k.logo) || "/images/profile_placeholder.webp", alt: (creative === null || creative === void 0 ? void 0 : creative.title) || offer.title, fill: true, className: "object-cover transition duration-500 group-hover:scale-105" })) : null, _jsx("div", { className: "absolute inset-0 bg-[linear-gradient(180deg,rgba(5,16,18,0.04),rgba(5,16,18,0.7))]" }), _jsxs("div", { className: "absolute left-3 top-3 flex flex-wrap gap-2", children: [(creative === null || creative === void 0 ? void 0 : creative.badge) ? (_jsx("span", { className: "rounded-full bg-white/92 px-2.5 py-1 text-[10px] font-bold uppercase tracking-[0.18em] text-slate-700", children: creative.badge })) : null, ((_l = offer.brand) === null || _l === void 0 ? void 0 : _l.verificationStatus) === "verified" ? (_jsxs("span", { className: "inline-flex items-center gap-1 rounded-full bg-emerald-50/95 px-2.5 py-1 text-[10px] font-bold uppercase tracking-[0.18em] text-emerald-700", children: [_jsx(ShieldCheck, { className: "h-3 w-3" }), "verified"] })) : null] }), _jsxs("div", { className: "absolute bottom-3 right-3 rounded-full bg-slate-950/70 px-2.5 py-1 text-[10px] font-bold uppercase tracking-[0.18em] text-white backdrop-blur", children: ["score ", Math.round(score)] })] }), _jsxs("div", { className: "space-y-4 p-4", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("span", { className: "text-[10px] font-bold uppercase tracking-[0.18em] text-primary", children: ((_m = offer.brand) === null || _m === void 0 ? void 0 : _m.name) || "Trippeaze ad" }), _jsx("span", { className: "text-[10px] font-bold uppercase tracking-[0.18em] text-slate-400", children: ((_o = offer.promotedEntity) === null || _o === void 0 ? void 0 : _o.entityType) || "offer" })] }), _jsx("h3", { className: "line-clamp-2 text-base font-bold text-slate-950 group-hover:text-primary", children: (creative === null || creative === void 0 ? void 0 : creative.title) || offer.title }), _jsx("p", { className: "line-clamp-3 text-sm leading-6 text-slate-600", children: (creative === null || creative === void 0 ? void 0 : creative.subtitle) || offer.shortDescription || offer.description || "Performance-based promotion inside Trippeaze." })] }), _jsxs("div", { className: "grid grid-cols-3 gap-2 text-center", children: [_jsxs("div", { className: "rounded-2xl bg-slate-50 px-3 py-3", children: [_jsx(BadgePercent, { className: "mx-auto mb-1.5 h-4 w-4 text-primary" }), _jsx("p", { className: "text-[10px] font-bold uppercase tracking-[0.18em] text-slate-400", children: "Booking" }), _jsx("p", { className: "mt-1 text-sm font-bold text-slate-950", children: percent(expected === null || expected === void 0 ? void 0 : expected.booking) })] }), _jsxs("div", { className: "rounded-2xl bg-slate-50 px-3 py-3", children: [_jsx(MousePointerClick, { className: "mx-auto mb-1.5 h-4 w-4 text-primary" }), _jsx("p", { className: "text-[10px] font-bold uppercase tracking-[0.18em] text-slate-400", children: "Click" }), _jsx("p", { className: "mt-1 text-sm font-bold text-slate-950", children: percent(expected === null || expected === void 0 ? void 0 : expected.click) })] }), _jsxs("div", { className: "rounded-2xl bg-slate-50 px-3 py-3", children: [_jsx(Eye, { className: "mx-auto mb-1.5 h-4 w-4 text-primary" }), _jsx("p", { className: "text-[10px] font-bold uppercase tracking-[0.18em] text-slate-400", children: "View" }), _jsx("p", { className: "mt-1 text-sm font-bold text-slate-950", children: percent(expected === null || expected === void 0 ? void 0 : expected.view) })] })] }), _jsxs("div", { className: "flex items-center justify-between gap-3 text-sm", children: [_jsxs("span", { className: "text-slate-500", children: [((_q = (_p = offer.placement) === null || _p === void 0 ? void 0 : _p.publisherPayoutRate) !== null && _q !== void 0 ? _q : 0.8) * 100, "% to promoter"] }), _jsxs("span", { className: "inline-flex items-center gap-1 font-bold text-primary", children: ["Open offer", _jsx(ArrowRight, { className: "h-4 w-4" })] })] })] })] }));
15
+ }
@@ -0,0 +1,17 @@
1
+ type AdventureSlot = {
2
+ date: string | Date;
3
+ startTime: string;
4
+ endTime?: string;
5
+ maxParticipants: number;
6
+ bookedCount?: number;
7
+ remainingCapacity?: number;
8
+ isAvailable?: boolean;
9
+ isBookable?: boolean;
10
+ };
11
+ export declare function AdventureAvailabilityPlanner({ slug, slots, blockedDates, }: {
12
+ slug: string;
13
+ slots: AdventureSlot[];
14
+ blockedDates?: (string | Date)[];
15
+ }): import("react/jsx-runtime").JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=AdventureAvailabilityPlanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdventureAvailabilityPlanner.d.ts","sourceRoot":"","sources":["../../../src/components/adventure/AdventureAvailabilityPlanner.tsx"],"names":[],"mappings":"AAyBA,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAMF,wBAAgB,4BAA4B,CAAC,EAC3C,IAAI,EACJ,KAAK,EACL,YAAY,GACb,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;CAClC,2CAwUA"}
@@ -0,0 +1,106 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
4
+ import { useMemo, useState } from "react";
5
+ import { addDays, addMonths, endOfMonth, endOfWeek, format, isBefore, isSameMonth, startOfMonth, startOfToday, startOfWeek, subMonths, } from "date-fns";
6
+ import { Calendar, ChevronLeft, ChevronRight, Clock, Users, } from "lucide-react";
7
+ function dateKey(value) {
8
+ return format(new Date(value), "yyyy-MM-dd");
9
+ }
10
+ export function AdventureAvailabilityPlanner({ slug, slots, blockedDates, }) {
11
+ const today = startOfToday();
12
+ const todayKey = dateKey(today);
13
+ const [currentMonth, setCurrentMonth] = useState(today);
14
+ const normalizedSlots = useMemo(() => (slots || [])
15
+ .map((slot) => {
16
+ var _a, _b, _c;
17
+ return ({
18
+ ...slot,
19
+ date: new Date(slot.date),
20
+ remainingCapacity: (_a = slot.remainingCapacity) !== null && _a !== void 0 ? _a : Math.max((Number(slot.maxParticipants) || 0) -
21
+ (Number(slot.bookedCount) || 0), 0),
22
+ isBookable: (_b = slot.isBookable) !== null && _b !== void 0 ? _b : (slot.isAvailable !== false &&
23
+ (((_c = slot.remainingCapacity) !== null && _c !== void 0 ? _c : Math.max((Number(slot.maxParticipants) || 0) -
24
+ (Number(slot.bookedCount) || 0), 0)) > 0)),
25
+ });
26
+ })
27
+ .sort((a, b) => {
28
+ const day = a.date.getTime() - b.date.getTime();
29
+ if (day !== 0)
30
+ return day;
31
+ return a.startTime.localeCompare(b.startTime);
32
+ }), [slots]);
33
+ const slotsByDate = useMemo(() => {
34
+ const map = new Map();
35
+ for (const slot of normalizedSlots) {
36
+ const key = dateKey(slot.date);
37
+ map.set(key, [...(map.get(key) || []), slot]);
38
+ }
39
+ return map;
40
+ }, [normalizedSlots]);
41
+ const blockedDateKeys = useMemo(() => new Set((blockedDates || []).map((value) => dateKey(value))), [blockedDates]);
42
+ const nextAvailableKey = useMemo(() => {
43
+ const nextSlot = normalizedSlots.find((slot) => !isBefore(slot.date, today) && slot.isBookable);
44
+ return nextSlot ? dateKey(nextSlot.date) : "";
45
+ }, [normalizedSlots, today]);
46
+ const [selectedDateKey, setSelectedDateKey] = useState(nextAvailableKey);
47
+ const selectedSlots = selectedDateKey
48
+ ? slotsByDate.get(selectedDateKey) || []
49
+ : [];
50
+ const selectedAvailableSlots = selectedSlots.filter((slot) => slot.isBookable);
51
+ const nextSelectedSlot = selectedAvailableSlots[0] || null;
52
+ const monthStart = startOfMonth(currentMonth);
53
+ const monthEnd = endOfMonth(monthStart);
54
+ const calendarStart = startOfWeek(monthStart);
55
+ const calendarEnd = endOfWeek(monthEnd);
56
+ const rows = [];
57
+ let day = calendarStart;
58
+ while (day <= calendarEnd) {
59
+ const cells = [];
60
+ for (let i = 0; i < 7; i++) {
61
+ const key = dateKey(day);
62
+ const daySlots = slotsByDate.get(key) || [];
63
+ const availableSlots = daySlots.filter((slot) => slot.isBookable);
64
+ const isBlocked = blockedDateKeys.has(key);
65
+ const isPast = isBefore(day, today);
66
+ const isOutsideMonth = !isSameMonth(day, currentMonth);
67
+ const isUnavailable = isOutsideMonth || isPast || isBlocked || availableSlots.length === 0;
68
+ const isSelected = key === selectedDateKey;
69
+ const isToday = key === todayKey;
70
+ cells.push(_jsx("button", { type: "button", disabled: isUnavailable, onClick: () => setSelectedDateKey(key), className: [
71
+ "group flex h-11 items-center justify-center rounded-full text-center transition sm:h-12 md:h-14",
72
+ isOutsideMonth ? "invisible" : "",
73
+ isUnavailable
74
+ ? "cursor-not-allowed text-slate-300"
75
+ : "text-slate-950 hover:bg-slate-100",
76
+ ].join(" "), "aria-label": `${format(day, "d MMM yyyy")}${isUnavailable ? " unavailable" : " available"}`, children: _jsxs("span", { className: [
77
+ "relative flex h-10 w-10 items-center justify-center rounded-full text-sm font-semibold sm:h-11 sm:w-11 sm:text-base",
78
+ isSelected ? "bg-slate-950 text-white" : "",
79
+ isToday && !isSelected && !isUnavailable ? "ring-1 ring-slate-950" : "",
80
+ ].join(" "), children: [format(day, "d"), isUnavailable && !isOutsideMonth && (_jsx("span", { className: "absolute h-px w-7 rotate-[-35deg] bg-slate-400", "aria-hidden": "true" }))] }) }, key));
81
+ day = addDays(day, 1);
82
+ }
83
+ rows.push(_jsx("div", { className: "grid grid-cols-7 gap-1.5 sm:gap-2", children: cells }, day.toString()));
84
+ }
85
+ return (_jsxs("section", { id: "availability-planner", className: "overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-[0_24px_80px_-48px_rgba(15,23,42,0.45)]", children: [_jsx("div", { className: "border-b border-slate-200 bg-slate-50 p-5 md:p-6", children: _jsx("div", { className: "flex flex-col gap-4 md:flex-row md:items-end md:justify-between", children: _jsxs("div", { children: [_jsx("p", { className: "text-xs font-semibold uppercase text-trippeaze-primary", children: "Check Availability" }), _jsx("h2", { className: "mt-2 text-2xl font-semibold text-slate-950 md:text-[2rem]", children: "Pick a real slot before you head to checkout" }), _jsx("p", { className: "mt-2 max-w-2xl text-sm leading-6 text-slate-600", children: "View open dates, compare time windows, and see how many spots are still left before you reserve." })] }) }) }), _jsxs("div", { className: "p-5 md:p-6", children: [_jsxs("div", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-lg font-semibold text-slate-950", children: format(currentMonth, "MMMM yyyy") }), _jsx("p", { className: "mt-1 text-sm text-slate-500", children: "Crossed dates are unavailable." })] }), _jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [_jsxs("div", { className: "flex items-center gap-3 rounded-xl border border-slate-200 bg-slate-50 px-4 py-2 text-[11px] font-semibold uppercase text-slate-500", children: [_jsxs("span", { className: "flex items-center gap-2", children: [_jsx("span", { className: "h-2.5 w-2.5 rounded-full bg-slate-950" }), "Available"] }), _jsxs("span", { className: "flex items-center gap-2", children: [_jsx("span", { className: "relative h-2.5 w-2.5 rounded-full border border-slate-300", children: _jsx("span", { className: "absolute left-[-2px] top-1/2 h-px w-4 rotate-[-35deg] bg-slate-400" }) }), "Unavailable"] })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { type: "button", onClick: () => setCurrentMonth(subMonths(currentMonth, 1)), className: "rounded-xl border border-slate-200 bg-white p-2 text-slate-600 transition hover:bg-slate-50", children: _jsx(ChevronLeft, { className: "h-4 w-4" }) }), _jsx("button", { type: "button", onClick: () => setCurrentMonth(addMonths(currentMonth, 1)), className: "rounded-xl border border-slate-200 bg-white p-2 text-slate-600 transition hover:bg-slate-50", children: _jsx(ChevronRight, { className: "h-4 w-4" }) })] })] })] }), _jsxs("div", { className: "mt-6 grid gap-6 xl:grid-cols-[minmax(0,1.18fr)_minmax(22rem,0.82fr)]", children: [_jsxs("div", { className: "rounded-2xl border border-slate-200 bg-white p-4 md:p-5", children: [_jsx("div", { className: "grid grid-cols-7 border-b border-slate-100 pb-3", children: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"].map((label) => (_jsx("div", { className: "px-1 py-2 text-center text-[9px] font-semibold uppercase text-slate-500 sm:text-[11px]", children: label }, label))) }), _jsx("div", { className: "mt-2 space-y-1", children: rows })] }), _jsxs("div", { className: "rounded-2xl border border-slate-200 bg-slate-50 p-5 shadow-sm", children: [_jsxs("div", { className: "flex items-center gap-2 text-xs font-semibold uppercase text-slate-500", children: [_jsx(Calendar, { className: "h-4 w-4 text-trippeaze-primary" }), selectedDateKey
86
+ ? format(new Date(selectedDateKey), "EEE, d MMM yyyy")
87
+ : "Select a date"] }), selectedDateKey && (_jsx("div", { className: "mt-4 rounded-xl border border-slate-200 bg-white px-4 py-4", children: _jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm font-semibold text-slate-950", children: selectedAvailableSlots.length > 0
88
+ ? `${selectedAvailableSlots.length} slot${selectedAvailableSlots.length > 1 ? "s" : ""} ready to book`
89
+ : blockedDateKeys.has(selectedDateKey)
90
+ ? "This date is blocked"
91
+ : "No slot is bookable on this date" }), _jsx("p", { className: "mt-1 text-sm leading-6 text-slate-500", children: nextSelectedSlot
92
+ ? `Earliest start time is ${nextSelectedSlot.startTime}. Pick the slot that works best for your group.`
93
+ : "Choose another highlighted day to see active time windows and remaining capacity." })] }), nextSelectedSlot && (_jsxs("span", { className: "rounded-full bg-emerald-50 px-3 py-1 text-[11px] font-semibold uppercase text-emerald-700", children: ["Starts ", nextSelectedSlot.startTime] }))] }) })), selectedSlots.length > 0 ? (_jsx("div", { className: "mt-4 space-y-3", children: selectedSlots.map((slot) => {
94
+ var _a;
95
+ const remaining = (_a = slot.remainingCapacity) !== null && _a !== void 0 ? _a : 0;
96
+ const href = `/book/adventure/${slug}?startDate=${encodeURIComponent(dateKey(slot.date))}&startTime=${encodeURIComponent(slot.startTime)}`;
97
+ return (_jsxs("div", { className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm shadow-slate-200/40", children: [_jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { children: [_jsxs("p", { className: "flex items-center gap-2 text-base font-semibold text-slate-950", children: [_jsx(Clock, { className: "h-4 w-4 text-trippeaze-primary" }), slot.startTime, slot.endTime ? ` - ${slot.endTime}` : ""] }), _jsxs("p", { className: "mt-2 flex items-center gap-2 text-sm text-slate-500", children: [_jsx(Users, { className: "h-4 w-4" }), remaining, " of ", slot.maxParticipants, " spot", slot.maxParticipants === 1 ? "" : "s", " left"] })] }), _jsx("span", { className: [
98
+ "rounded-full px-3 py-1 text-[11px] font-semibold uppercase",
99
+ remaining > 0
100
+ ? "bg-emerald-50 text-emerald-700"
101
+ : "bg-slate-100 text-slate-500",
102
+ ].join(" "), children: remaining > 0 ? "Bookable" : "Full" })] }), remaining > 0 && (_jsx("div", { className: "mt-4 h-2 overflow-hidden rounded-full bg-slate-100", children: _jsx("div", { className: "h-full rounded-full bg-gradient-to-r from-trippeaze-primary to-emerald-500", style: {
103
+ width: `${Math.max(12, Math.min(100, (remaining / Math.max(slot.maxParticipants, 1)) * 100))}%`,
104
+ } }) })), _jsx("div", { className: "mt-4", children: remaining > 0 ? (_jsx(Link, { href: href, className: "inline-flex w-full items-center justify-center rounded-xl bg-slate-950 px-4 py-3 text-sm font-semibold uppercase text-white transition hover:bg-slate-800", children: "Reserve This Slot" })) : (_jsx("div", { className: "rounded-xl border border-slate-200 bg-slate-50 px-4 py-3 text-center text-sm font-semibold text-slate-500", children: "This slot is currently full" })) })] }, `${dateKey(slot.date)}-${slot.startTime}`));
105
+ }) })) : (_jsx("div", { className: "mt-4 rounded-xl border border-dashed border-slate-200 bg-white p-5 text-sm leading-6 text-slate-500", children: "Pick a highlighted date to view live slot timings and remaining capacity before you reserve." }))] })] })] })] }));
106
+ }
@@ -0,0 +1,5 @@
1
+ export declare function AdventureQueryCard({ slug, adventureTitle, }: {
2
+ slug: string;
3
+ adventureTitle?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=AdventureQueryCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdventureQueryCard.d.ts","sourceRoot":"","sources":["../../../src/components/adventure/AdventureQueryCard.tsx"],"names":[],"mappings":"AAkBA,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,cAAc,GACf,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,2CAmHA"}
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { useAtomValue } from "jotai";
5
+ import { CalendarDays } from "lucide-react";
6
+ import { DatePicker } from "@myrjfa/ui/dist/misc/datepicker";
7
+ import { Label } from "@myrjfa/ui/dist/misc/label";
8
+ import { showAlert } from "@myrjfa/ui/dist/misc/alertdialogclaude";
9
+ import { EnquiryGuestFields, EnquiryMessageField, EnquirySectionCard, EnquirySubmitButton, EnquiryTravellerCountField, } from "@myrjfa/ui/dist/components/enquiry/EnquiryFormParts";
10
+ import { userAtom } from "@myrjfa/state/dist/lib/userAtom";
11
+ import { submitAdventureQuery } from "@myrjfa/state/dist/lib/adventureActions";
12
+ export function AdventureQueryCard({ slug, adventureTitle, }) {
13
+ const user = useAtomValue(userAtom);
14
+ const [loading, setLoading] = useState(false);
15
+ const [preferredDate, setPreferredDate] = useState(null);
16
+ const [form, setForm] = useState({
17
+ name: (user === null || user === void 0 ? void 0 : user.firstName) ? `${user.firstName} ${user.lastName || ""}`.trim() : "",
18
+ email: (user === null || user === void 0 ? void 0 : user.email) || "",
19
+ phone: (user === null || user === void 0 ? void 0 : user.phoneNumber) || "",
20
+ numberOfPeople: "1",
21
+ message: "",
22
+ });
23
+ const isLoggedInUser = (user === null || user === void 0 ? void 0 : user.role) === "user";
24
+ useEffect(() => {
25
+ setForm((prev) => ({
26
+ ...prev,
27
+ name: prev.name || ((user === null || user === void 0 ? void 0 : user.firstName) ? `${user.firstName} ${user.lastName || ""}`.trim() : ""),
28
+ email: prev.email || (user === null || user === void 0 ? void 0 : user.email) || "",
29
+ phone: prev.phone || (user === null || user === void 0 ? void 0 : user.phoneNumber) || "",
30
+ }));
31
+ }, [user]);
32
+ const handleSubmit = async (event) => {
33
+ event.preventDefault();
34
+ if (!form.message.trim()) {
35
+ await showAlert("Please add your question before sending.");
36
+ return;
37
+ }
38
+ if (!isLoggedInUser && (!form.name.trim() || !form.email.trim())) {
39
+ await showAlert("Name and email are required for guest enquiries.");
40
+ return;
41
+ }
42
+ setLoading(true);
43
+ const result = await submitAdventureQuery(slug, {
44
+ name: form.name,
45
+ email: form.email,
46
+ phone: form.phone,
47
+ message: form.message,
48
+ preferredDate: preferredDate ? preferredDate.toISOString() : null,
49
+ numberOfPeople: Math.max(Number(form.numberOfPeople) || 1, 1),
50
+ });
51
+ setLoading(false);
52
+ if (!result.success) {
53
+ await showAlert(result.error || "Failed to send your enquiry.");
54
+ return;
55
+ }
56
+ await showAlert("Your enquiry has been sent. We'll follow up soon.");
57
+ setPreferredDate(null);
58
+ setForm((prev) => ({
59
+ ...prev,
60
+ numberOfPeople: "1",
61
+ message: "",
62
+ }));
63
+ };
64
+ return (_jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [!isLoggedInUser && (_jsx(EnquirySectionCard, { step: 1, title: "Your details", children: _jsx(EnquiryGuestFields, { values: form, onChange: (field, value) => setForm((prev) => ({ ...prev, [field]: value })) }) })), _jsx(EnquirySectionCard, { step: isLoggedInUser ? 1 : 2, title: "Trip details", description: "Date is optional, but it helps the host respond with more useful availability details.", children: _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [_jsx(EnquiryTravellerCountField, { value: form.numberOfPeople, onChange: (value) => setForm((prev) => ({ ...prev, numberOfPeople: value })) }), _jsxs("div", { className: "space-y-2", children: [_jsxs(Label, { className: "flex items-center gap-2", children: [_jsx(CalendarDays, { className: "h-4 w-4 text-slate-400" }), "Preferred date"] }), _jsx(DatePicker, { field: { value: preferredDate, onChange: setPreferredDate }, minDate: new Date(), label: "Preferred date" })] })] }) }), _jsx(EnquirySectionCard, { step: isLoggedInUser ? 2 : 3, title: "Your question", children: _jsx(EnquiryMessageField, { value: form.message, onChange: (value) => setForm((prev) => ({ ...prev, message: value })), placeholder: "Ask about fitness level, transport, safety, gear, inclusions, or anything else you want clarified." }) }), _jsxs("div", { children: [_jsx(EnquirySubmitButton, { loading: loading, children: "Send Enquiry" }), _jsx("p", { className: "mt-3 text-center text-xs text-slate-400", children: "No payment required now. The host will follow up with details." })] })] }));
65
+ }