@emintech/core 0.9.2 → 0.9.3
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/dist/{chunk-5FVKVAPS.js → chunk-2S3N3ZQJ.js} +1 -1
- package/dist/{chunk-4MUMD45S.js → chunk-3DS33G4X.js} +1 -1
- package/dist/chunk-3MDAZIT3.js +1 -0
- package/dist/{chunk-NT6DGMKA.js → chunk-4LGMTPZR.js} +1 -1
- package/dist/chunk-5EDG5QB4.js +1 -0
- package/dist/chunk-6EJQRYHD.js +1 -0
- package/dist/chunk-AQUA6LR6.js +1 -0
- package/dist/chunk-BYXOSCJY.js +1 -0
- package/dist/{chunk-G54HADDZ.js → chunk-C2WPMEXW.js} +1 -1
- package/dist/chunk-CAS5DGWY.js +1 -0
- package/dist/{chunk-D5ORVBB6.js → chunk-CZ63LMPT.js} +1 -1
- package/dist/{chunk-5G426RD5.js → chunk-E54ENK4T.js} +1 -1
- package/dist/{chunk-3QPHFHMI.js → chunk-EWJA77WO.js} +1 -1
- package/dist/{chunk-2IH2TPAG.js → chunk-HM5F3SGK.js} +2 -2
- package/dist/chunk-I6LAKJDJ.js +3 -0
- package/dist/{chunk-52RQB6LX.js → chunk-INW53CPC.js} +1 -1
- package/dist/chunk-JT7YMU2O.js +1 -0
- package/dist/chunk-LFDQQW42.js +1 -0
- package/dist/chunk-OBBQ6J7P.js +1 -0
- package/dist/chunk-OLGZQWWX.js +1 -0
- package/dist/chunk-OZAS7KV6.js +1 -0
- package/dist/chunk-PYHKO2QR.js +1 -0
- package/dist/chunk-QFLK7PAU.js +1 -0
- package/dist/chunk-QK56PGOF.js +1 -0
- package/dist/{chunk-U5MR4K3S.js → chunk-QZ7BICYJ.js} +1 -1
- package/dist/{chunk-KB7HH24O.js → chunk-SAIBZJF3.js} +1 -1
- package/dist/chunk-SRP3WWVX.js +1 -0
- package/dist/chunk-T5R5N4HX.js +1 -0
- package/dist/chunk-TJBWSVJU.js +1 -0
- package/dist/{chunk-ICVWICWV.js → chunk-TSOFP3AR.js} +1 -1
- package/dist/chunk-VAQBKUR5.js +1 -0
- package/dist/chunk-VLAHRLQQ.js +1 -0
- package/dist/{chunk-GVFPSY2S.js → chunk-X72P6HTC.js} +1 -1
- package/dist/{chunk-73CHDK3X.js → chunk-XLEUHJR2.js} +1 -1
- package/dist/chunk-Y7NR7PFG.js +1 -0
- package/dist/{chunk-RAUR55QN.js → chunk-YGGYI4WM.js} +1 -1
- package/dist/emincore.register.js +1 -1
- package/dist/features/account/change-password/components/PasswordForm.js +1 -1
- package/dist/features/account/change-password/index.js +1 -1
- package/dist/features/account/change-password/pages/index.js +1 -1
- package/dist/features/account/delete-account/components/DeleteAccountForm.js +1 -1
- package/dist/features/account/delete-account/index.js +1 -1
- package/dist/features/account/delete-account/pages/index.js +1 -1
- package/dist/features/account/index.js +1 -1
- package/dist/features/account/profile/components/Profile.js +1 -1
- package/dist/features/account/profile/components/ProfileForm.js +1 -1
- package/dist/features/account/profile/index.d.ts +2 -0
- package/dist/features/account/profile/index.js +1 -1
- package/dist/features/account/profile/pages/EditProfilePage.js +1 -1
- package/dist/features/account/profile/pages/IndexProfilePage.js +1 -1
- package/dist/features/account/shared/components/MyAccountHeader.js +1 -1
- package/dist/features/account/shared/components/UserLabel.js +1 -1
- package/dist/features/account/shared/components/UserMenu.js +1 -1
- package/dist/features/account/shared/components/index.js +1 -1
- package/dist/features/account/shared/index.js +1 -1
- package/dist/features/account/shared/layouts/MyAccountLayout.js +1 -1
- package/dist/features/app/components/AppHeader.js +1 -1
- package/dist/features/app/components/AppLogo.js +1 -1
- package/dist/features/app/index.d.ts +3 -3
- package/dist/features/app/index.js +1 -1
- package/dist/features/app/layout/AppLayout.js +1 -1
- package/dist/features/appearance/components/AppearanceButton.js +1 -1
- package/dist/features/appearance/components/AppearanceDropdown.js +1 -1
- package/dist/features/appearance/components/AppearanceToggle.js +1 -1
- package/dist/features/appearance/index.d.ts +3 -3
- package/dist/features/appearance/index.js +1 -1
- package/dist/features/appearance/lib/appearance-service.d.ts +1 -1
- package/dist/features/appearance/lib/appearance-service.js +1 -1
- package/dist/features/appearance/{hooks → lib}/use-appearance-listener.d.ts +1 -1
- package/dist/features/appearance/{hooks → lib}/use-appearance-listener.js +1 -1
- package/dist/features/appearance/{hooks → lib}/use-appearance.d.ts +1 -1
- package/dist/features/appearance/lib/use-appearance.js +1 -0
- package/dist/features/auth/index.js +1 -1
- package/dist/features/auth/login/components/Login.js +1 -1
- package/dist/features/auth/login/index.d.ts +1 -1
- package/dist/features/auth/login/index.js +1 -1
- package/dist/features/auth/login/{hooks → lib}/use-login-form.d.ts +2 -2
- package/dist/features/auth/login/lib/use-login-form.js +1 -0
- package/dist/features/auth/password/confirmation/components/PasswordConfirmation.js +1 -1
- package/dist/features/auth/password/confirmation/index.d.ts +2 -2
- package/dist/features/auth/password/confirmation/index.js +1 -1
- package/dist/features/auth/password/confirmation/{hooks → lib}/use-password-form.d.ts +2 -2
- package/dist/features/auth/password/confirmation/lib/use-password-form.js +1 -0
- package/dist/features/auth/password/forgot/components/PasswordForgot.js +1 -1
- package/dist/features/auth/password/forgot/index.d.ts +2 -2
- package/dist/features/auth/password/forgot/index.js +1 -1
- package/dist/features/auth/password/forgot/{hooks → lib}/use-password-forgot-form.d.ts +2 -2
- package/dist/features/auth/password/forgot/lib/use-password-forgot-form.js +1 -0
- package/dist/features/auth/password/index.js +1 -1
- package/dist/features/auth/password/reset/components/PasswordReset.js +1 -1
- package/dist/features/auth/password/reset/index.d.ts +3 -3
- package/dist/features/auth/password/reset/index.js +1 -1
- package/dist/features/auth/password/reset/{hooks → lib}/use-reset-password-form.d.ts +2 -2
- package/dist/features/auth/password/reset/lib/use-reset-password-form.js +1 -0
- package/dist/features/auth/register/components/Register.js +1 -1
- package/dist/features/auth/register/index.d.ts +2 -2
- package/dist/features/auth/register/index.js +1 -1
- package/dist/features/auth/register/{hooks → lib}/use-register-form.d.ts +2 -2
- package/dist/features/auth/register/lib/use-register-form.js +1 -0
- package/dist/features/auth/shared/components/PasswordInput.d.ts +1 -1
- package/dist/features/auth/shared/components/PasswordInput.js +1 -1
- package/dist/features/auth/shared/index.d.ts +1 -1
- package/dist/features/auth/shared/index.js +1 -1
- package/dist/features/auth/shared/layouts/AuthLayout.js +1 -1
- package/dist/features/auth/verify/email/components/EmailVerify.js +1 -1
- package/dist/features/auth/verify/email/index.d.ts +2 -2
- package/dist/features/auth/verify/email/index.js +1 -1
- package/dist/features/auth/verify/email/{hooks → lib}/use-verify-email-form.d.ts +2 -2
- package/dist/features/auth/verify/email/lib/use-verify-email-form.js +1 -0
- package/dist/features/auth/verify/index.js +1 -1
- package/dist/features/dashboard/components/DashboardSidebar.js +1 -1
- package/dist/features/dashboard/components/DashboardTopbar.js +1 -1
- package/dist/features/dashboard/index.d.ts +3 -3
- package/dist/features/dashboard/index.js +1 -1
- package/dist/features/dashboard/layouts/DashboardLayout.js +1 -1
- package/dist/features/emin-jobs/components/EminJobsComponents.d.ts +0 -3
- package/dist/features/emin-jobs/components/EminJobsComponents.js +1 -1
- package/dist/features/emin-jobs/index.d.ts +1 -1
- package/dist/features/emin-jobs/index.js +1 -1
- package/dist/features/emin-jobs/lib/use-emin-jobs.js +1 -0
- package/dist/features/marketplace/components/MarketplaceComponents.js +1 -1
- package/dist/features/marketplace/context/MarketplaceContext.js +1 -1
- package/dist/features/marketplace/index.js +1 -1
- package/dist/features/marketplace/pages/IndexMarketplacePage.js +1 -1
- package/dist/features/notifications/components/EminNotification.js +1 -1
- package/dist/features/notifications/context/NotificationsContext.js +1 -1
- package/dist/features/notifications/index.js +1 -1
- package/dist/features/notifications/pages/UserNotificationsPage.js +1 -1
- package/dist/features/package-manager/index.js +1 -1
- package/dist/features/package-manager/installer/index.js +1 -1
- package/dist/features/package-manager/installer/lib/installer-formatter.d.ts +2 -2
- package/dist/features/package-manager/installer/lib/installer-formatter.js +1 -1
- package/dist/features/package-manager/shared/components/PackageManagerModal.js +1 -1
- package/dist/features/package-manager/shared/context/PackageManagerContext.d.ts +1 -2
- package/dist/features/package-manager/shared/context/PackageManagerContext.js +1 -1
- package/dist/features/package-manager/shared/index.d.ts +1 -0
- package/dist/features/package-manager/shared/index.js +1 -1
- package/dist/features/package-manager/shared/lib/package-manager-formatter.d.ts +1 -1
- package/dist/features/package-manager/shared/lib/package-manager-formatter.js +1 -1
- package/dist/features/package-manager/shared/lib/package-manager-services.js +1 -1
- package/dist/features/package-manager/shared/lib/use-package-version-selector.js +1 -0
- package/dist/features/package-manager/updater/index.d.ts +1 -1
- package/dist/features/package-manager/updater/index.js +1 -1
- package/dist/features/package-manager/updater/lib/updater-formatter.d.ts +2 -2
- package/dist/features/package-manager/updater/lib/updater-formatter.js +1 -1
- package/dist/features/package-manager/updater/lib/updater-utils.d.ts +2 -0
- package/dist/features/package-manager/updater/lib/updater-utils.js +1 -0
- package/dist/features/packages/components/Packages.js +1 -1
- package/dist/features/packages/components/PackagesTable.js +1 -1
- package/dist/features/packages/context/PackagesContext.js +1 -1
- package/dist/features/packages/index.d.ts +1 -1
- package/dist/features/packages/index.js +1 -1
- package/dist/features/packages/lib/packages-formatter.js +1 -1
- package/dist/features/packages/pages/IndexPackagesPage.js +1 -1
- package/dist/features/platform/components/PlatformComponents.js +1 -1
- package/dist/features/platform/components/PlatformPageComponents.js +1 -1
- package/dist/features/platform/index.js +1 -1
- package/dist/features/platform/lib/platform-formatter.js +1 -1
- package/dist/features/platform/pages/IndexPlatformPage.js +1 -1
- package/dist/features/settings/api/settings.api.js +1 -1
- package/dist/features/settings/context/SettingsContext.js +1 -1
- package/dist/features/settings/index.js +1 -1
- package/dist/features/settings/layouts/SettingsLayout.js +1 -1
- package/dist/features/settings/lib/settings-formatter.d.ts +5 -4
- package/dist/features/settings/lib/settings-formatter.js +1 -1
- package/dist/features/settings/pages/DesignSettingsPage.js +1 -1
- package/dist/features/settings/pages/GeneralSettingsPage.js +1 -1
- package/dist/features/settings/pages/MailSettingsPage.js +1 -1
- package/dist/features/settings/pages/NavPage.js +1 -1
- package/dist/features/slugs/api/slugs.api.d.ts +1 -1
- package/dist/features/slugs/api/slugs.api.js +1 -1
- package/dist/features/slugs/components/slugs.js +1 -1
- package/dist/features/slugs/context/SlugsContext.d.ts +1 -1
- package/dist/features/slugs/context/SlugsContext.js +1 -1
- package/dist/features/slugs/index.d.ts +4 -4
- package/dist/features/slugs/index.js +1 -1
- package/dist/features/slugs/lib/slugs-utils.js +1 -1
- package/dist/features/users/components/UserModal.js +1 -1
- package/dist/features/users/components/UsersPage.d.ts +1 -1
- package/dist/features/users/components/UsersPage.js +1 -1
- package/dist/features/users/components/UsersStatistics.js +1 -1
- package/dist/features/users/components/UsersTable.js +1 -1
- package/dist/features/users/index.d.ts +4 -4
- package/dist/features/users/index.js +1 -1
- package/dist/features/users/lib/users-formatter.d.ts +2 -2
- package/dist/features/users/lib/users-formatter.js +1 -1
- package/dist/features/users/widgets/UserStatisticsWidget.js +1 -1
- package/dist/features/widgets/components/WidgetMenu.js +1 -1
- package/dist/features/widgets/components/WidgetProfileMenu.js +1 -1
- package/dist/features/widgets/components/WidgetsComponents.js +1 -1
- package/dist/features/widgets/components/WidgetsScreen.js +1 -1
- package/dist/features/widgets/index.js +1 -1
- package/dist/features/widgets/lib/widgets-utils.js +1 -1
- package/dist/integrations/emincore/page.registry.js +1 -1
- package/dist/integrations/emincore/provider.registry.js +1 -1
- package/dist/integrations/emincore/widget.registry.js +1 -1
- package/dist/pages/auth/login.js +1 -1
- package/dist/pages/auth/password-confirm.js +1 -1
- package/dist/pages/auth/password-forgot.js +1 -1
- package/dist/pages/auth/password-reset.js +1 -1
- package/dist/pages/auth/register.js +1 -1
- package/dist/pages/auth/verify-email.js +1 -1
- package/dist/pages/dashboard/index.js +1 -1
- package/dist/pages/dashboard/marketplace/index.js +1 -1
- package/dist/pages/dashboard/packages/index.js +1 -1
- package/dist/pages/dashboard/platform/index.js +1 -1
- package/dist/pages/dashboard/settings/index.js +1 -1
- package/dist/pages/dashboard/settings/slugs/index.js +1 -1
- package/dist/pages/dashboard/users/index.js +1 -1
- package/dist/pages/my-account/notifications/index.js +1 -1
- package/dist/pages/my-account/profile/edit-password.js +1 -1
- package/dist/pages/my-account/profile/edit.js +1 -1
- package/dist/pages/my-account/profile/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/registry/index.js +1 -1
- package/dist/registry/page-registry.js +1 -1
- package/dist/registry/widget-registry.js +1 -1
- package/dist/shared/components/composite/AlertModal.js +1 -1
- package/dist/shared/components/composite/EminEditable.js +1 -1
- package/dist/shared/components/composite/EminFormButton.js +1 -1
- package/dist/shared/components/composite/EminInput.js +1 -1
- package/dist/shared/components/composite/EminPreference.js +1 -1
- package/dist/shared/components/composite/EminPreloader.js +1 -1
- package/dist/shared/components/composite/EminRichTextEditor/EminRichTextEditor.js +1 -1
- package/dist/shared/components/composite/EminRichTextEditor/EminRichTextToolbar.js +1 -1
- package/dist/shared/components/composite/EminRichTextEditor/index.js +1 -1
- package/dist/shared/components/composite/Menu/EminMenu.js +1 -1
- package/dist/shared/components/composite/Menu/EminSidebarMenu.js +1 -1
- package/dist/shared/components/composite/Menu/index.js +1 -1
- package/dist/shared/components/composite/Menu/sidebar-menu.utils.js +1 -1
- package/dist/shared/components/composite/QuickMenu/QuickMenu.js +1 -1
- package/dist/shared/components/composite/QuickMenu/index.js +1 -1
- package/dist/shared/components/composite/RoleBadge.js +1 -1
- package/dist/shared/components/composite/SectionCard.js +1 -1
- package/dist/shared/components/composite/StatisticCards.js +1 -1
- package/dist/shared/components/composite/index.js +1 -1
- package/dist/shared/components/index.js +1 -1
- package/dist/shared/components/ui/avatar.js +1 -1
- package/dist/shared/components/ui/breadcrumbs.js +1 -1
- package/dist/shared/components/ui/chart.js +1 -1
- package/dist/shared/components/ui/sidebar.js +1 -1
- package/dist/shared/components/ui/slider.js +1 -1
- package/dist/shared/components/ui/team-switcher.js +1 -1
- package/dist/shared/index.d.ts +4 -4
- package/dist/shared/index.js +1 -1
- package/dist/shared/lib/use-initials.js +1 -0
- package/dist/shared/lib/use-mobile-navigation.js +1 -0
- package/dist/shared/lib/use-mobile.js +1 -0
- package/dist/shared/lib/use-selection.js +1 -0
- package/dist/shared/modules/emin-table/components/EminTable.js +1 -1
- package/dist/shared/modules/emin-table/components/EminTableContent.js +1 -1
- package/dist/shared/modules/emin-table/components/EminTablePagination.js +1 -1
- package/dist/shared/modules/emin-table/components/EminTableToolbar.js +1 -1
- package/dist/shared/modules/emin-table/context/EminTableContext.d.ts +1 -2
- package/dist/shared/modules/emin-table/context/EminTableContext.js +1 -1
- package/dist/shared/modules/emin-table/index.js +1 -1
- package/dist/shared/modules/index.js +1 -1
- package/dist/shared/modules/world-map/components/WorldMap2D.js +1 -1
- package/dist/shared/modules/world-map/context/WorldMapContext.js +1 -1
- package/dist/shared/modules/world-map/index.js +1 -1
- package/dist/shared/types/index.d.ts +0 -8
- package/dist/shared/types/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3IGI4YCZ.js +0 -1
- package/dist/chunk-6RKLDLSC.js +0 -1
- package/dist/chunk-AG4EHKB7.js +0 -1
- package/dist/chunk-CNTR7Q6L.js +0 -1
- package/dist/chunk-E2ZUBHVJ.js +0 -1
- package/dist/chunk-FLR2KO5I.js +0 -1
- package/dist/chunk-GJ3Z7ZV5.js +0 -1
- package/dist/chunk-GYMXN7BF.js +0 -1
- package/dist/chunk-HDYNFDEV.js +0 -1
- package/dist/chunk-JHSE5LFF.js +0 -1
- package/dist/chunk-LMJAV6MI.js +0 -1
- package/dist/chunk-LQAGAWQQ.js +0 -1
- package/dist/chunk-LUP2QMP6.js +0 -1
- package/dist/chunk-MQQ7W7QI.js +0 -1
- package/dist/chunk-N3MF3ZWP.js +0 -1
- package/dist/chunk-NFOQ4KW2.js +0 -1
- package/dist/chunk-OFQZZZJO.js +0 -1
- package/dist/chunk-PWQOU5TI.js +0 -1
- package/dist/chunk-QKP3C5FM.js +0 -1
- package/dist/chunk-QL2STABI.js +0 -1
- package/dist/chunk-SLZ26UCQ.js +0 -1
- package/dist/chunk-XFR4DFQ4.js +0 -3
- package/dist/chunk-XHCRX2OP.js +0 -1
- package/dist/chunk-Y7U6EVDQ.js +0 -1
- package/dist/chunk-ZYAM2VUN.js +0 -1
- package/dist/features/account/preferences/index.d.ts +0 -0
- package/dist/features/account/preferences/index.js +0 -0
- package/dist/features/account/preferences/pages/index.d.ts +0 -1
- package/dist/features/account/preferences/pages/index.js +0 -1
- package/dist/features/app/hooks/usePresence.d.ts +0 -1
- package/dist/features/app/hooks/usePresence.js +0 -1
- package/dist/features/appearance/hooks/use-appearance.js +0 -1
- package/dist/features/auth/login/hooks/use-login-form.js +0 -1
- package/dist/features/auth/password/confirmation/hooks/use-password-form.js +0 -1
- package/dist/features/auth/password/forgot/hooks/use-password-forgot-form.js +0 -1
- package/dist/features/auth/password/reset/hooks/use-reset-password-form.js +0 -1
- package/dist/features/auth/register/hooks/use-register-form.js +0 -1
- package/dist/features/auth/verify/email/hooks/use-verify-email-form.js +0 -1
- package/dist/features/emin-jobs/hooks/use-emin-jobs.js +0 -1
- package/dist/features/package-manager/shared/hooks/use-package-version-selector.js +0 -1
- package/dist/features/package-manager/updater/lib/updater-service.d.ts +0 -2
- package/dist/features/package-manager/updater/lib/updater-service.js +0 -1
- package/dist/shared/hooks/use-initials.js +0 -1
- package/dist/shared/hooks/use-mobile-navigation.js +0 -1
- package/dist/shared/hooks/use-mobile.js +0 -1
- package/dist/shared/hooks/use-selection.js +0 -1
- package/dist/shared/layouts/menu-yedek.d.ts +0 -0
- package/dist/shared/layouts/menu-yedek.js +0 -0
- package/dist/shared/lib/axios.d.ts +0 -0
- package/dist/shared/lib/axios.js +0 -0
- /package/dist/{chunk-ZYEQMWUG.js → chunk-2HEFLNRE.js} +0 -0
- /package/dist/{chunk-7ZTD2OS6.js → chunk-74MUFOMQ.js} +0 -0
- /package/dist/{chunk-3ZSQL2FG.js → chunk-EDDLZMXK.js} +0 -0
- /package/dist/{chunk-V2NMVGDZ.js → chunk-EQXKOPKH.js} +0 -0
- /package/dist/{chunk-UAIWQHYT.js → chunk-GIHBVFVT.js} +0 -0
- /package/dist/{chunk-P5HBVZKY.js → chunk-QKEP6HZU.js} +0 -0
- /package/dist/{chunk-QVUL22EY.js → chunk-XUEJAJL7.js} +0 -0
- /package/dist/features/emin-jobs/{hooks → lib}/use-emin-jobs.d.ts +0 -0
- /package/dist/features/package-manager/shared/{hooks → lib}/use-package-version-selector.d.ts +0 -0
- /package/dist/shared/{hooks → lib}/use-initials.d.ts +0 -0
- /package/dist/shared/{hooks → lib}/use-mobile-navigation.d.ts +0 -0
- /package/dist/shared/{hooks → lib}/use-mobile.d.ts +0 -0
- /package/dist/shared/{hooks → lib}/use-selection.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-Y7NR7PFG.js";import{a as i}from"./chunk-BYXOSCJY.js";var o=t=>e+"_"+t,r=[{code:o("users_statistics"),loader:()=>import("./features/users/widgets/UserStatisticsWidget.js"),icon:"IconUsers",min_height:160}];r.forEach(t=>i.register(t));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as se,c as x}from"./chunk-QXMEPU4D.js";import{a as ne}from"./chunk-BI4PD4EL.js";import{a as re,c as Z,d as de,e as le,f as j,h as ce}from"./chunk-3QPHFHMI.js";import{a as ae}from"./chunk-U5MR4K3S.js";import{b as X,c as $,g as A}from"./chunk-OFQZZZJO.js";import{b as T,c as B,d as G,e as H,f as R,h as O}from"./chunk-GBXDCZP6.js";import{a as J,b as q,f as K,g as V,h as ee,i as te,j as oe}from"./chunk-QFUZ6MVT.js";import{a as ie}from"./chunk-65LRDGYI.js";import{b as k}from"./chunk-TVCWAJFT.js";import{a as y}from"./chunk-G4EEZUTC.js";import{a as h}from"./chunk-GND5KQRZ.js";import{a as U}from"./chunk-QL2STABI.js";import{useEffect as be,useState as we}from"react";import{useForm as Ie}from"@inertiajs/react";import{IconPlus as Ne,IconTrash as Ce}from"@tabler/icons-react";import{Fragment as Le,jsx as m,jsxs as b}from"react/jsx-runtime";var me=()=>{let[e,o]=we(!1);return b(Le,{children:[b(k,{variant:"outline",className:"flex items-center gap-2",onClick:()=>o(!e),children:[m(y,{iconName:"IconLayoutGrid"}),"Widgets"]}),m(We,{isOpen:e,setIsOpen:o})]})},We=({isOpen:e,setIsOpen:o})=>{let{widgets:t}=x(),n=ne(t);return b(T,{open:e,onOpenChange:o,title:"Widgets",description:"Select a widget to add to your dashboard.",children:[m(B,{placeholder:"Search widgets..."}),b(G,{className:"max-h-[420px]",children:[m(H,{children:"No widget found."}),n.map(({packageCode:a,widgets:r})=>r.length>0&&m(R,{className:"p-5",heading:m(De,{packageCode:a,totalWidgets:r.length}),children:r.map(s=>m(O,{value:s.id,keywords:[s.title,s?.description??""],className:"!bg-background",children:m(Pe,{widget:s})},s.id))}))]})]})},De=({packageCode:e,totalWidgets:o})=>b("div",{className:"flex items-center gap-2",children:[m(y,{iconName:"IconLayoutGrid",className:"w-5 h-5 text-primary"}),b("span",{className:"font-bold text-base capitalize text-primary",children:[e.replace("_"," ")," widgets"]}),b("span",{className:"text-xs text-muted-foreground ml-auto",children:[o," ",o===1?"widget":"widgets"," provided"]})]}),Pe=({widget:e})=>{let{profile:o}=x(),t=o.items?.find(n=>n.widget_id===e.id);return b("div",{className:h("flex items-center gap-3 justify-center h-full w-full min-h-[50px] rounded-lg border p-4",t?.is_expanded?"text-muted-foreground":""),children:[m(y,{iconName:e?.icon??"IconPackage",className:"h-7 w-7 shrink-0"}),b("div",{className:"grid gap-2",children:[m("div",{className:"text-sm font-bold",children:e.title}),e.description&&m("div",{className:"text-xs text-center",children:e.description??""})]}),m(ke,{widget:e})]})},ke=({widget:e})=>{let{profile:o,breakPoints:t}=x(),a=re(e,o)?"delete":"post",r=()=>a==="delete"?{id:o.items?.find(D=>D.widget_id===e.id)?.id}:{widget_profile_id:o.id,widget_id:e.id,is_expanded:!0,layouts:le(e,t)},s=Ie(r());be(()=>s.setData(r()),[o]);let g=a==="delete"?route("widgets.profiles.items.destroy"):route("widgets.profiles.items.store"),d=()=>s[a](g),C=a==="delete"?s.recentlySuccessful?"outline":"destructive":s.recentlySuccessful?"destructive":"outline",W=a==="delete"?s.recentlySuccessful?"Widget Added!":"":s.recentlySuccessful?"Widget Removed!":"",I=a==="delete"?"Widget Removing...":"Widget Adding...";return b(A,{variant:C,size:"sm",className:"text-primary ml-auto",recentlySuccessful:s.recentlySuccessful,processing:s.processing,successText:W,processingText:I,onClick:()=>d(),children:[a==="delete"?m(Ce,{}):m(Ne,{}),m("span",{children:a==="delete"?"Remove":"Add"})]})};import{useState as ue}from"react";import{router as pe,useForm as Y}from"@inertiajs/react";import{Fragment as fe,jsx as i,jsxs as p}from"react/jsx-runtime";var ge=()=>{let{profile:e}=x(),[o,t]=ue(!1);return p(fe,{children:[p(k,{variant:"outline",className:"flex items-center gap-2",onClick:()=>t(!o),children:[i(y,{iconName:"IconLayout"}),e?.title||"Layouts"]}),i(Ee,{open:o,onOpenChange:t})]})},Ee=({open:e,onOpenChange:o})=>{let{profiles:t,profile:n}=x();return p(T,{open:e,onOpenChange:o,title:"Layouts",description:"See your current layout, default layout, and create a new one.",children:[i(B,{placeholder:"Search layouts..."}),p(G,{className:"max-h-[420px]",children:[i(H,{children:"No layout found."}),i(R,{className:"p-5",children:t.map(a=>i(O,{value:`${a.title} ${a.is_default?"default":"normal"} ${a.id===n?.id?"current active":""}`,className:"mb-2 flex items-center gap-3 rounded-lg border bg-background hover:bg-background/70 !py-5 !px-5 data-[selected=true]:bg-background data-[selected=true]:text-foreground last:mb-0",children:i(Se,{profile:a})},a.id))})]}),p("div",{className:"px-3 pt-3 pb-7 grid gap-2",children:[i("div",{className:"text-sm text-muted-foreground text-center",children:"Create a new layout from here."}),i(_e,{})]})]})},Se=({profile:e})=>{let{profile:o,indexRouteName:t}=x(),n={label:"Layout Name",key:"title",value:e.title,type:"text",editable:!0},a=g=>new Promise((d,C)=>{pe.put(route("widgets.profiles.update"),{id:e.id,title:g},{onSuccess:()=>d(!0),onError:()=>C(!1)})}),r=e.id===o?.id,s=route(t,{widget_profile_id:e.id});return p(fe,{children:[i("div",{className:"flex items-center w-2 h-2",children:i("span",{className:h("h-2 w-2 rounded-full",r?"bg-green-500":"bg-muted")})}),p("div",{className:"grid gap-1 text-left",children:[p("div",{className:"flex flex-wrap items-center gap-2",children:[i("div",{className:"group flex items-center gap-1",children:i($,{item:n,onChange:(g,d)=>a(d),children:p("div",{className:"flex items-center gap-2 !cursor-text",children:[i("span",{className:"font-semibold text-base",children:e.title}),i(y,{iconName:"IconPencil",className:"h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100"})]})})}),e.is_default&&i("span",{className:"rounded-md border px-2 py-0.5 text-xs font-medium",children:"Default"})]}),i(Me,{updatedAt:e.updated_at}),i(ze,{profile:e})]}),i("div",{className:"flex items-center gap-2 ml-auto shrink-0 self-center cursor-pointer",onClick:()=>!r&&pe.visit(s,{preserveUrl:!0}),children:i("div",{className:h("h-4 w-4 rounded-full border-2 flex items-center justify-center",r?"border-primary":"border-muted hover:border-primary"),children:r&&i("div",{className:"h-2 w-2 rounded-full bg-primary"})})})]})},ze=({profile:e})=>p("div",{className:"flex items-center gap-2",children:[i(Ae,{profile:e,className:"!p-0 h-4"}),i(Te,{profile:e,className:"!p-0 h-4"})]}),Me=({updatedAt:e})=>p("span",{className:"text-xs text-primary/70",children:["Updated At: ",e?new Date(e).toLocaleString():"Never"]}),_e=()=>{let[e,o]=ue(!1),t=Y({title:""}),n=()=>t.post(route("widgets.profiles.store"),{onSuccess:()=>t.reset()});return p(J,{open:e,onOpenChange:o,children:[i(q,{children:p(k,{variant:"outline",className:"flex items-center justify-center mx-auto gap-2",onClick:()=>o(!0),children:[i(y,{iconName:"IconPlus"}),i("span",{children:"Create new layout"})]})}),p(K,{className:"grid gap-3",children:[p(V,{children:[i(te,{children:"Create new layout"}),i(oe,{children:"Create a new layout to use. You can switch between layouts at any time."})]}),i("div",{children:i(ae,{label:"Layout Name",icon:"IconLayout",type:"text",placeholder:"Give a name to your new layout",error:t.errors.title,value:t.data.title,onChange:a=>t.setData({title:a.target.value})})}),i(ee,{children:p(A,{recentlySuccessful:t.recentlySuccessful,processing:t.processing,successText:"Layout Created!",processingText:"Layout creating...",variant:"default",onClick:()=>n(),children:[i(y,{iconName:"IconPlus"}),"Create Now"]})})]})]})},Ae=({profile:e,className:o})=>{let t=Y(),n=()=>{t.setData({id:e.id}),t.delete(route("widgets.profiles.destroy"))};return i(X,{title:"Are you sure to delete this layout?",content:"This action is permanent and cannot be undone.",onConfirm:()=>n(),children:i(k,{className:h(!t.processing||!t.recentlySuccessful?"text-red-500":"text-primary",o),type:"button",variant:"link",size:"sm",disabled:t.processing,onClick:a=>a.stopPropagation(),children:t.processing?"Deleting...":"Delete"})})},Te=({profile:e,className:o})=>{let t=Y(),n=()=>{t.setData({id:e.id,is_default:!e.is_default}),t.put(route("widgets.profiles.update"))};return!e.is_default&&i(k,{className:h("",o),type:"button",variant:"link",size:"sm",disabled:t.processing,onClick:a=>{a.preventDefault(),a.stopPropagation(),n()},children:t.processing?"Saving...":"Set as default"})};import{Fragment as Be,jsx as S,jsxs as ye}from"react/jsx-runtime";var Ct=({profile:e,profiles:o,widgets:t,indexRouteName:n})=>S(se,{profile:e,profiles:o,widgets:t,indexRouteName:n,children:ye("div",{className:"grid grid-cols-1 gap-7 overflow-visible",children:[S(ie,{title:"Dashboard",description:"Overview of your application",icon:"IconDeviceDesktop",buttons:ye(Be,{children:[S(me,{}),S(ge,{})]})}),S(xe,{})]})});import{useHttp as he}from"@inertiajs/react";import{IconLoader2 as Ge,IconMinus as He,IconPlus as Re,IconX as Oe}from"@tabler/icons-react";import{lazy as Fe,Suspense as Ze,useCallback as Q,useMemo as F}from"react";import{useContainerWidth as je,Responsive as Ye}from"react-grid-layout";import"react-grid-layout/css/styles.css";import{jsx as l,jsxs as z}from"react/jsx-runtime";var ve=new Map,Qe=(e,o)=>{let t=ve.get(e);if(t)return t;let n=Fe(o);return ve.set(e,n),n},xe=()=>{let{width:e,containerRef:o,mounted:t}=je(),{breakPoints:n,profile:a,setProfile:r}=x(),s=a?.items,g=F(()=>Object.keys(Z),[]),d=he({items:s??[]}),C=F(()=>s?.map(u=>u.widget)??[],[s]),W=F(()=>{let u={};return g.forEach(v=>{u[v]=s?.map(c=>c.layouts?.[v]??j(c.widget,!c.is_expanded,v))??[]}),u},[g,s]),I=Q((u,v)=>{r(c=>c&&{...c,items:u}),d.setData({items:u}),d.put(route("widgets.profiles.items.update"),{onError:()=>r(c=>c&&{...c,items:v})})},[d,r]),D=Q((u,v)=>{let c=v;if(ce(W,c,g))return;let w=s??[],M=w.map(_=>({..._,layouts:g.reduce((E,L)=>{let P=(c[L]??[]).find(f=>f.i===String(_.widget.id));return P&&(E[L]=P),E},{})}));I(M,w)},[I,g,W,s]),N=Q(u=>{let v=s??[],c=v.map(w=>{if(w.id!==u)return w;let M=!w.is_expanded,_=g.reduce((E,L)=>{let P=w.layouts?.[L],f=j(w.widget,!M,L);return E[L]={...P??f,i:f.i,x:P?.x??f.x,y:P?.y??f.y,w:P?.w??f.w,h:f.h,minH:f.minH,maxH:f.maxH,minW:f.minW,maxW:f.maxW},E},{});return{...w,is_expanded:M,layouts:_}});I(c,v)},[I,g,s]);return t&&l("div",{ref:o,children:l(Ye,{width:e,layouts:W,breakpoints:n,cols:Z,rowHeight:de,margin:[12,12],containerPadding:[0,0],dragConfig:{enabled:!0,handle:".widget-drag-handle"},resizeConfig:{enabled:!0},onLayoutChange:D,children:C.map(u=>l("div",{className:" overflow-visible",children:l(Ue,{widget:u,onToggleExpand:N})},String(u.id)))})})},Ue=({widget:e,onToggleExpand:o})=>{let{profile:t,setProfile:n}=x(),a=U.get(e.code),r=a?.loader,s=typeof r=="function",g=F(()=>s?Qe(e.code,r):()=>null,[e.code,r,s]),d=t.items.find(D=>D.widget_id===e.id),C=()=>o(d.id),W=he({id:d.id}),I=()=>{let D=t.items??[];n(N=>({...N,items:N?.items?.filter(u=>u.id!==d.id)})),W.delete(route("widgets.profiles.items.destroy"),{onError:()=>n(N=>N&&{...N,items:D})})};return s&&d&&z("div",{className:h(d?.is_expanded?"flex h-full w-full min-h-0 flex-col overflow-hidden rounded-lg border bg-background shadow-sm":""),children:[z("div",{className:h("flex items-center gap-2 widget-drag-handle shrink-0 px-3 py-3 bg-muted/30",d?.is_expanded?"border-b cursor-move select-none":"rounded-lg border shadow-sm"),children:[l(y,{iconName:a?.icon??"IconTag",className:"w-5 h-5 shrink-0"}),l("span",{className:"text-sm font-medium",children:e.title}),z("div",{className:"flex items-center gap-5 ml-auto",children:[l("span",{className:"text-sm text-muted-foreground",children:e.package_code}),z("div",{className:"flex items-center gap-2",children:[l("div",{onClick:()=>C(),children:d?.is_expanded?l(He,{className:"h-5 w-5 cursor-pointer"}):l(Re,{className:"h-5 w-5 cursor-pointer"})}),l("div",{onClick:()=>I(),children:l(Oe,{className:"h-5 w-5 cursor-pointer"})})]})]})]}),d?.is_expanded&&l("div",{className:"flex-1 min-h-0 overflow-auto p-3",children:l(Ze,{fallback:l("div",{className:"flex items-center justify-center w-full h-full",children:z("div",{className:"grid gap-2",children:[l("span",{className:"font-bold",children:e.title}),l(Ge,{className:"animate-spin h-7 w-7 mx-auto"})]})}),children:l(g,{props:e.props})})})]})};export{xe as a,Ue as b,me as c,ge as d,Ct as e};
|
|
1
|
+
import{a as re,c as Z,d as de,e as le,f as j,h as ce}from"./chunk-EWJA77WO.js";import{b as se,c as x}from"./chunk-QXMEPU4D.js";import{a as ne}from"./chunk-BI4PD4EL.js";import{a as ae}from"./chunk-QZ7BICYJ.js";import{A as $,E as A,z as X}from"./chunk-AQUA6LR6.js";import{b as T,c as B,d as G,e as H,f as R,h as O}from"./chunk-GBXDCZP6.js";import{a as J,b as q,f as K,g as V,h as ee,i as te,j as oe}from"./chunk-QFUZ6MVT.js";import{b as k}from"./chunk-TVCWAJFT.js";import{a as ie}from"./chunk-65LRDGYI.js";import{a as y}from"./chunk-G4EEZUTC.js";import{a as h}from"./chunk-GND5KQRZ.js";import{a as U}from"./chunk-BYXOSCJY.js";import{useEffect as be,useState as we}from"react";import{useForm as Ie}from"@inertiajs/react";import{IconPlus as Ne,IconTrash as Ce}from"@tabler/icons-react";import{Fragment as Le,jsx as m,jsxs as b}from"react/jsx-runtime";var me=()=>{let[e,o]=we(!1);return b(Le,{children:[b(k,{variant:"outline",className:"flex items-center gap-2",onClick:()=>o(!e),children:[m(y,{iconName:"IconLayoutGrid"}),"Widgets"]}),m(We,{isOpen:e,setIsOpen:o})]})},We=({isOpen:e,setIsOpen:o})=>{let{widgets:t}=x(),n=ne(t);return b(T,{open:e,onOpenChange:o,title:"Widgets",description:"Select a widget to add to your dashboard.",children:[m(B,{placeholder:"Search widgets..."}),b(G,{className:"max-h-[420px]",children:[m(H,{children:"No widget found."}),n.map(({packageCode:a,widgets:r})=>r.length>0&&m(R,{className:"p-5",heading:m(De,{packageCode:a,totalWidgets:r.length}),children:r.map(s=>m(O,{value:s.id,keywords:[s.title,s?.description??""],className:"!bg-background",children:m(Pe,{widget:s})},s.id))}))]})]})},De=({packageCode:e,totalWidgets:o})=>b("div",{className:"flex items-center gap-2",children:[m(y,{iconName:"IconLayoutGrid",className:"w-5 h-5 text-primary"}),b("span",{className:"font-bold text-base capitalize text-primary",children:[e.replace("_"," ")," widgets"]}),b("span",{className:"text-xs text-muted-foreground ml-auto",children:[o," ",o===1?"widget":"widgets"," provided"]})]}),Pe=({widget:e})=>{let{profile:o}=x(),t=o.items?.find(n=>n.widget_id===e.id);return b("div",{className:h("flex items-center gap-3 justify-center h-full w-full min-h-[50px] rounded-lg border p-4",t?.is_expanded?"text-muted-foreground":""),children:[m(y,{iconName:e?.icon??"IconPackage",className:"h-7 w-7 shrink-0"}),b("div",{className:"grid gap-2",children:[m("div",{className:"text-sm font-bold",children:e.title}),e.description&&m("div",{className:"text-xs text-center",children:e.description??""})]}),m(ke,{widget:e})]})},ke=({widget:e})=>{let{profile:o,breakPoints:t}=x(),a=re(e,o)?"delete":"post",r=()=>a==="delete"?{id:o.items?.find(D=>D.widget_id===e.id)?.id}:{widget_profile_id:o.id,widget_id:e.id,is_expanded:!0,layouts:le(e,t)},s=Ie(r());be(()=>s.setData(r()),[o]);let g=a==="delete"?route("widgets.profiles.items.destroy"):route("widgets.profiles.items.store"),d=()=>s[a](g),C=a==="delete"?s.recentlySuccessful?"outline":"destructive":s.recentlySuccessful?"destructive":"outline",W=a==="delete"?s.recentlySuccessful?"Widget Added!":"":s.recentlySuccessful?"Widget Removed!":"",I=a==="delete"?"Widget Removing...":"Widget Adding...";return b(A,{variant:C,size:"sm",className:"text-primary ml-auto",recentlySuccessful:s.recentlySuccessful,processing:s.processing,successText:W,processingText:I,onClick:()=>d(),children:[a==="delete"?m(Ce,{}):m(Ne,{}),m("span",{children:a==="delete"?"Remove":"Add"})]})};import{useState as ue}from"react";import{router as pe,useForm as Y}from"@inertiajs/react";import{Fragment as fe,jsx as i,jsxs as p}from"react/jsx-runtime";var ge=()=>{let{profile:e}=x(),[o,t]=ue(!1);return p(fe,{children:[p(k,{variant:"outline",className:"flex items-center gap-2",onClick:()=>t(!o),children:[i(y,{iconName:"IconLayout"}),e?.title||"Layouts"]}),i(Ee,{open:o,onOpenChange:t})]})},Ee=({open:e,onOpenChange:o})=>{let{profiles:t,profile:n}=x();return p(T,{open:e,onOpenChange:o,title:"Layouts",description:"See your current layout, default layout, and create a new one.",children:[i(B,{placeholder:"Search layouts..."}),p(G,{className:"max-h-[420px]",children:[i(H,{children:"No layout found."}),i(R,{className:"p-5",children:t.map(a=>i(O,{value:`${a.title} ${a.is_default?"default":"normal"} ${a.id===n?.id?"current active":""}`,className:"mb-2 flex items-center gap-3 rounded-lg border bg-background hover:bg-background/70 !py-5 !px-5 data-[selected=true]:bg-background data-[selected=true]:text-foreground last:mb-0",children:i(Se,{profile:a})},a.id))})]}),p("div",{className:"px-3 pt-3 pb-7 grid gap-2",children:[i("div",{className:"text-sm text-muted-foreground text-center",children:"Create a new layout from here."}),i(_e,{})]})]})},Se=({profile:e})=>{let{profile:o,indexRouteName:t}=x(),n={label:"Layout Name",key:"title",value:e.title,type:"text",editable:!0},a=g=>new Promise((d,C)=>{pe.put(route("widgets.profiles.update"),{id:e.id,title:g},{onSuccess:()=>d(!0),onError:()=>C(!1)})}),r=e.id===o?.id,s=route(t,{widget_profile_id:e.id});return p(fe,{children:[i("div",{className:"flex items-center w-2 h-2",children:i("span",{className:h("h-2 w-2 rounded-full",r?"bg-green-500":"bg-muted")})}),p("div",{className:"grid gap-1 text-left",children:[p("div",{className:"flex flex-wrap items-center gap-2",children:[i("div",{className:"group flex items-center gap-1",children:i($,{item:n,onChange:(g,d)=>a(d),children:p("div",{className:"flex items-center gap-2 !cursor-text",children:[i("span",{className:"font-semibold text-base",children:e.title}),i(y,{iconName:"IconPencil",className:"h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100"})]})})}),e.is_default&&i("span",{className:"rounded-md border px-2 py-0.5 text-xs font-medium",children:"Default"})]}),i(Me,{updatedAt:e.updated_at}),i(ze,{profile:e})]}),i("div",{className:"flex items-center gap-2 ml-auto shrink-0 self-center cursor-pointer",onClick:()=>!r&&pe.visit(s,{preserveUrl:!0}),children:i("div",{className:h("h-4 w-4 rounded-full border-2 flex items-center justify-center",r?"border-primary":"border-muted hover:border-primary"),children:r&&i("div",{className:"h-2 w-2 rounded-full bg-primary"})})})]})},ze=({profile:e})=>p("div",{className:"flex items-center gap-2",children:[i(Ae,{profile:e,className:"!p-0 h-4"}),i(Te,{profile:e,className:"!p-0 h-4"})]}),Me=({updatedAt:e})=>p("span",{className:"text-xs text-primary/70",children:["Updated At: ",e?new Date(e).toLocaleString():"Never"]}),_e=()=>{let[e,o]=ue(!1),t=Y({title:""}),n=()=>t.post(route("widgets.profiles.store"),{onSuccess:()=>t.reset()});return p(J,{open:e,onOpenChange:o,children:[i(q,{children:p(k,{variant:"outline",className:"flex items-center justify-center mx-auto gap-2",onClick:()=>o(!0),children:[i(y,{iconName:"IconPlus"}),i("span",{children:"Create new layout"})]})}),p(K,{className:"grid gap-3",children:[p(V,{children:[i(te,{children:"Create new layout"}),i(oe,{children:"Create a new layout to use. You can switch between layouts at any time."})]}),i("div",{children:i(ae,{label:"Layout Name",icon:"IconLayout",type:"text",placeholder:"Give a name to your new layout",error:t.errors.title,value:t.data.title,onChange:a=>t.setData({title:a.target.value})})}),i(ee,{children:p(A,{recentlySuccessful:t.recentlySuccessful,processing:t.processing,successText:"Layout Created!",processingText:"Layout creating...",variant:"default",onClick:()=>n(),children:[i(y,{iconName:"IconPlus"}),"Create Now"]})})]})]})},Ae=({profile:e,className:o})=>{let t=Y(),n=()=>{t.setData({id:e.id}),t.delete(route("widgets.profiles.destroy"))};return i(X,{title:"Are you sure to delete this layout?",content:"This action is permanent and cannot be undone.",onConfirm:()=>n(),children:i(k,{className:h(!t.processing||!t.recentlySuccessful?"text-red-500":"text-primary",o),type:"button",variant:"link",size:"sm",disabled:t.processing,onClick:a=>a.stopPropagation(),children:t.processing?"Deleting...":"Delete"})})},Te=({profile:e,className:o})=>{let t=Y(),n=()=>{t.setData({id:e.id,is_default:!e.is_default}),t.put(route("widgets.profiles.update"))};return!e.is_default&&i(k,{className:h("",o),type:"button",variant:"link",size:"sm",disabled:t.processing,onClick:a=>{a.preventDefault(),a.stopPropagation(),n()},children:t.processing?"Saving...":"Set as default"})};import{Fragment as Be,jsx as S,jsxs as ye}from"react/jsx-runtime";var Ct=({profile:e,profiles:o,widgets:t,indexRouteName:n})=>S(se,{profile:e,profiles:o,widgets:t,indexRouteName:n,children:ye("div",{className:"grid grid-cols-1 gap-7 overflow-visible",children:[S(ie,{title:"Dashboard",description:"Overview of your application",icon:"IconDeviceDesktop",buttons:ye(Be,{children:[S(me,{}),S(ge,{})]})}),S(xe,{})]})});import{useHttp as he}from"@inertiajs/react";import{IconLoader2 as Ge,IconMinus as He,IconPlus as Re,IconX as Oe}from"@tabler/icons-react";import{lazy as Fe,Suspense as Ze,useCallback as Q,useMemo as F}from"react";import{useContainerWidth as je,Responsive as Ye}from"react-grid-layout";import"react-grid-layout/css/styles.css";import{jsx as l,jsxs as z}from"react/jsx-runtime";var ve=new Map,Qe=(e,o)=>{let t=ve.get(e);if(t)return t;let n=Fe(o);return ve.set(e,n),n},xe=()=>{let{width:e,containerRef:o,mounted:t}=je(),{breakPoints:n,profile:a,setProfile:r}=x(),s=a?.items,g=F(()=>Object.keys(Z),[]),d=he({items:s??[]}),C=F(()=>s?.map(u=>u.widget)??[],[s]),W=F(()=>{let u={};return g.forEach(v=>{u[v]=s?.map(c=>c.layouts?.[v]??j(c.widget,!c.is_expanded,v))??[]}),u},[g,s]),I=Q((u,v)=>{r(c=>c&&{...c,items:u}),d.setData({items:u}),d.put(route("widgets.profiles.items.update"),{onError:()=>r(c=>c&&{...c,items:v})})},[d,r]),D=Q((u,v)=>{let c=v;if(ce(W,c,g))return;let w=s??[],M=w.map(_=>({..._,layouts:g.reduce((E,L)=>{let P=(c[L]??[]).find(f=>f.i===String(_.widget.id));return P&&(E[L]=P),E},{})}));I(M,w)},[I,g,W,s]),N=Q(u=>{let v=s??[],c=v.map(w=>{if(w.id!==u)return w;let M=!w.is_expanded,_=g.reduce((E,L)=>{let P=w.layouts?.[L],f=j(w.widget,!M,L);return E[L]={...P??f,i:f.i,x:P?.x??f.x,y:P?.y??f.y,w:P?.w??f.w,h:f.h,minH:f.minH,maxH:f.maxH,minW:f.minW,maxW:f.maxW},E},{});return{...w,is_expanded:M,layouts:_}});I(c,v)},[I,g,s]);return t&&l("div",{ref:o,children:l(Ye,{width:e,layouts:W,breakpoints:n,cols:Z,rowHeight:de,margin:[12,12],containerPadding:[0,0],dragConfig:{enabled:!0,handle:".widget-drag-handle"},resizeConfig:{enabled:!0},onLayoutChange:D,children:C.map(u=>l("div",{className:" overflow-visible",children:l(Ue,{widget:u,onToggleExpand:N})},String(u.id)))})})},Ue=({widget:e,onToggleExpand:o})=>{let{profile:t,setProfile:n}=x(),a=U.get(e.code),r=a?.loader,s=typeof r=="function",g=F(()=>s?Qe(e.code,r):()=>null,[e.code,r,s]),d=t.items.find(D=>D.widget_id===e.id),C=()=>o(d.id),W=he({id:d.id}),I=()=>{let D=t.items??[];n(N=>({...N,items:N?.items?.filter(u=>u.id!==d.id)})),W.delete(route("widgets.profiles.items.destroy"),{onError:()=>n(N=>N&&{...N,items:D})})};return s&&d&&z("div",{className:h(d?.is_expanded?"flex h-full w-full min-h-0 flex-col overflow-hidden rounded-lg border bg-background shadow-sm":""),children:[z("div",{className:h("flex items-center gap-2 widget-drag-handle shrink-0 px-3 py-3 bg-muted/30",d?.is_expanded?"border-b cursor-move select-none":"rounded-lg border shadow-sm"),children:[l(y,{iconName:a?.icon??"IconTag",className:"w-5 h-5 shrink-0"}),l("span",{className:"text-sm font-medium",children:e.title}),z("div",{className:"flex items-center gap-5 ml-auto",children:[l("span",{className:"text-sm text-muted-foreground",children:e.package_code}),z("div",{className:"flex items-center gap-2",children:[l("div",{onClick:()=>C(),children:d?.is_expanded?l(He,{className:"h-5 w-5 cursor-pointer"}):l(Re,{className:"h-5 w-5 cursor-pointer"})}),l("div",{onClick:()=>I(),children:l(Oe,{className:"h-5 w-5 cursor-pointer"})})]})]})]}),d?.is_expanded&&l("div",{className:"flex-1 min-h-0 overflow-auto p-3",children:l(Ze,{fallback:l("div",{className:"flex items-center justify-center w-full h-full",children:z("div",{className:"grid gap-2",children:[l("span",{className:"font-bold",children:e.title}),l(Ge,{className:"animate-spin h-7 w-7 mx-auto"})]})}),children:l(g,{props:e.props})})})]})};export{xe as a,Ue as b,me as c,ge as d,Ct as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ua as v,W as h,a as n,c as s,e as d,h as p,i as c,k as m,y as l}from"./chunk-AQUA6LR6.js";import{a as u}from"./chunk-OZAS7KV6.js";import{b as t}from"./chunk-TVCWAJFT.js";import{a as b}from"./chunk-G4EEZUTC.js";import{d as i}from"./chunk-GND5KQRZ.js";import{usePage as S}from"@inertiajs/react";import{Transition as f}from"@headlessui/react";import{jsx as e,jsxs as o}from"react/jsx-runtime";var E=({...y})=>{let{url:T}=S(),a=S().props,{dashboard:g}=a?.emin_core_menus,x=a?.app?.logos??[],{state:r}=n(),F=u(g,T);return o(s,{collapsible:"icon",...y,children:[o(p,{children:[o("div",{className:"relative items-center !h-[50px]",children:[e(f,{show:r=="collapsed",enter:"duration-500",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-500",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e("img",{className:"absolute !max-w-[35px] !max-h-[35px]",src:i(x?.favicon)})}),e(f,{show:r=="expanded",enter:"duration-500",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-500",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e("div",{children:e(v,{link:route("dashboard")})})})]}),e("hr",{className:"w-full"}),e(h,{})]}),e("hr",{}),e(m,{children:e(l,{sidebarMenu:F})}),e(c,{children:o(t,{variant:"outline",className:"flex items-center",children:[e(b,{iconName:"IconHelp"}),e("span",{className:"group-data-[collapsible=icon]:hidden",children:"Get Help"})]})}),e(d,{})]})};export{E as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as O,b as f,c as y,d as V,e as R,f as U}from"./chunk-X5PHT6XR.js";import{a as A,b as p}from"./chunk-C2WPMEXW.js";import{c as x,h as I}from"./chunk-I6LAKJDJ.js";import{a as F}from"./chunk-LFDQQW42.js";import{E as k}from"./chunk-AQUA6LR6.js";import{a as E}from"./chunk-QKGQOXDM.js";import{a as B,f as L,j as _}from"./chunk-QFUZ6MVT.js";import{b as d}from"./chunk-TVCWAJFT.js";import{a as z}from"./chunk-3DBYUBWW.js";import{a as b}from"./chunk-65LRDGYI.js";import{a as m}from"./chunk-G4EEZUTC.js";import{a as o}from"./chunk-GND5KQRZ.js";import{IconCircleCheckFilled as H,IconCircleX as W,IconDownload as re,IconRefresh as oe,IconStar as q,IconStarFilled as M,IconUsersGroup as ne,IconX as ie}from"@tabler/icons-react";import{Fragment as ce,jsx as n,jsxs as N}from"react/jsx-runtime";var fe=({packages:a,marketPackages:t,meta:c,account:r,error:i})=>n(F,{breadcrumbs:[{icon:"IconBuildingStore",title:"Marketplace"}],children:n(A,{packages:a,marketPackages:t,account:r??null,meta:c,error:i,children:N("div",{className:"grid gap-10",children:[n(T,{className:"mt-15 mb-25"}),n(te,{}),n($,{})]})})}),te=()=>{let{marketPackages:a}=p(),t=a?.filter(r=>r.code.startsWith("emintech")),c=a?.filter(r=>!r.code.startsWith("emintech"));return N(ce,{children:[t&&t?.length>0&&N("div",{className:"grid gap-7",children:[n(b,{title:"Official Packages",description:"Explore the Emin Tech's official packages.",icon:"IconStar",buttons:n(d,{variant:"link",children:"View All"})}),n("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-5",children:t.map(r=>n(C,{pkg:r}))})]}),c&&c.length>0&&N("div",{className:"grid gap-7",children:[n(b,{title:"Community Packages",description:"These community packages have been quality-checked and are fully compatible.",icon:"IconUsers",buttons:n(d,{variant:"link",children:"View All"})}),n("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-5",children:c.map(r=>n(C,{pkg:r}))})]})]})};import{useForm as le}from"@inertiajs/react";import{Fragment as G,jsx as e,jsxs as s}from"react/jsx-runtime";var T=({className:a})=>{let{meta:t}=p();return s("div",{className:o("grid gap-4",a),children:[e(m,{iconName:"IconPackages",className:"mx-auto h-15 w-15"}),s("div",{className:"grid text-center",children:[e("h2",{className:"text-2xl font-bold",children:"Search what do you need?"}),e("span",{className:"text-sm text-muted-foreground",children:"Search for packages by name or category."})]}),e(E,{placeholder:"Search package name, author, or category...",value:t?.search,className:"bg-accent/10"})]})},C=({pkg:a,className:t})=>{let{setSelectedPackage:c,setIsDetailModalOpen:r}=p(),{packages:i}=x(),g=i.find(h=>h.code===a.code)??null;return s(z,{className:o("p-2 bg-accent/10 w-full shadow-md hover:scale-105 duration-300",t),children:[s("div",{className:"grid gap-4 cursor-pointer",onClick:()=>{c(a),r(!0)},children:[e("div",{className:"w-full h-auto rounded-lg aspect-[4/3] shadow-sm",style:{backgroundImage:`url(${a.image})`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}}),s("div",{className:"grid px-2 gap-2",children:[s("div",{className:"flex items-center gap-1",children:[e(X,{pkg:a}),e(I,{pkg:{...a,is_custom:!1},className:"ml-auto text-sm",size:18})]}),e("hr",{}),s("span",{className:"text-sm text-muted-foreground truncate",children:[a.description," "]}),s("div",{className:"flex items-center",children:[g?s("div",{className:"flex items-center gap-2",children:[e(H,{className:"w-5 h-5 text-green-500 shrink-0"}),e("span",{className:"text-xs text-green-500",children:"Installed"})]}):e(K,{pkg:a,className:"text-xs"}),e(Y,{pkg:a,className:"text-xs ml-auto text-muted-foreground"})]})]})]}),e("div",{className:"px-2 mb-1",children:e(J,{pkg:a})})]})},$=()=>{let{isDetailModalOpen:a,setIsDetailModalOpen:t,selectedPackage:c}=p(),{packages:r}=x();if(!a||!c)return;let i=r.find(g=>g.code===c.code)??null;return e(B,{open:a,onOpenChange:t,children:s(L,{className:"min-h-[25vh] max-h-[80vh] min-w-[90vw] sm:min-w-[70vw] xl:min-w-[60vw] 2xl:min-w-[50vw] grid gap-5 overflow-y-auto",children:[e("div",{className:"",children:e("div",{className:"w-full h-auto rounded-lg aspect-[4/3] shadow-sm lg:aspect-[16/5]",style:{backgroundImage:`url(${c.cover??c.image})`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}})}),s("div",{className:"grid grid-cols-1 lg:grid-cols-[4fr_2fr] gap-5",children:[s("div",{className:"grid grid-cols-1 gap-2",children:[e(X,{pkg:c}),e(_,{children:c.description}),e(K,{pkg:c,className:"text-xs"})]}),s("div",{className:"grid gap-3",children:[e(j,{pkg:c,className:"text-sm text-muted-foreground hover:text-primary cursor-pointer"}),e(I,{pkg:{...c,is_custom:!1},className:"text-sm flex items-center gap-2",size:20}),e(de,{pkg:c,className:"text-sm text-muted-foreground"}),e(me,{pkg:c,className:"text-sm text-muted-foreground"}),s("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e(ne,{className:"w-5 h-5 shrink-0"}),e(Y,{pkg:c,className:"text-sm"})]})]}),s("div",{className:"col-span-full grid gap-2",children:[e(J,{pkg:c}),y(c,i)==="uninstall"&&e("div",{className:"col-span-full w-full grid gap-2",children:s("span",{className:"text-xs text-center text-muted-foreground",children:["You installed that at ",i?.created_at?new Date(i.created_at).toLocaleString():"N/A"]})})]})]})]})})},X=({pkg:a,className:t})=>s("div",{className:o("grid grid-cols-[25px_auto] gap-2",t),children:[e(m,{iconName:"IconPackage",className:"shrink-0 w-full"}),e("span",{className:"font-bold truncate",children:a.name})]}),Ue=({pkg:a,className:t})=>e("div",{className:o("grid gap-2",t),children:e(j,{pkg:a})}),K=({pkg:a,className:t})=>e("div",{className:o("flex items-center gap-2",t),children:U(a)?s(G,{children:[e(H,{className:"w-5 h-5 shrink-0 text-green-400"}),e("div",{className:"grid",children:e("span",{className:"text-green-400 truncate",children:"Compatible with your app"})})]}):s(G,{children:[e(W,{className:"w-5 h-5 shrink-0 text-red-400"}),e("div",{className:"grid",children:e("span",{className:"text-red-400 truncate",children:"Not compatible with your app"})})]})}),Y=({pkg:a,className:t})=>s("div",{className:o("flex items-center gap-2 shrink-0",t),children:[s("span",{className:"shrink-0",children:[Math.floor(Math.random()*1e3).toFixed(0)," Reviews"]}),s("div",{className:"flex items-center gap-0 shrink-0",children:[e(M,{className:"h-[18px] w-[18px] shrink-0 text-yellow-500"}),e(M,{className:"h-[18px] w-[18px] shrink-0 text-yellow-500"}),e(M,{className:"h-[18px] w-[18px] shrink-0 text-yellow-500"}),e(q,{className:"h-[18px] w-[18px] shrink-0"}),e(q,{className:"h-[18px] w-[18px] shrink-0"})]})]}),j=({pkg:a,className:t})=>s("div",{className:o("flex items-center gap-2",t),children:[e(m,{iconName:"IconUserCircle",className:"shrink-0 w-5 h-5"}),e("a",{href:O(a.author),className:"capitalize",children:a.author??"yok"})]}),me=({pkg:a,text:t="Last Update:",className:c})=>s("div",{className:o("flex items-center gap-2",c),children:[e(m,{iconName:"IconCalendar",className:"shrink-0 w-5 h-5"}),s("span",{children:[t,"\xA0",new Date(a.updated_at??"").toLocaleDateString()??"-"]})]}),de=({pkg:a,text:t="Core Requirement:",className:c})=>s("div",{className:o("flex items-center gap-2",c),children:[e(m,{iconName:"IconInfoCircle",className:"shrink-0 w-5 h-5"}),s("span",{children:[t,"\xA0",f(a)?.core_constraint??"-"]})]}),J=({pkg:a,className:t})=>{let{packages:c,setProcess:r,setPackageManifest:i,setIsLoading:g,setIsModalOpen:h,setValidationError:Q}=x(),Z=c.find(l=>l.code===a.code)??null,D=f(a),u=y(a,Z),{post:ee,setData:ae,recentlySuccessful:v,processing:P}=le(),se=()=>(g(!0),h(!0),new Promise(l=>ee(route("dashboard.packages.manager"),{onSuccess:()=>l(!0),onError:S=>{l(S),Q(Object.values(S).join(`
|
|
2
2
|
`))}}))),w=l=>{r(l),i(V(a,f(a).version)),ae({process:l,manifest:{code:a.code,version:D.version,core_constraint:D.core_constraint}}),se()};return u==="buy"?e("a",{href:R(a),target:"_blank",rel:"noopener noreferrer",children:s(d,{size:"sm",variant:"outline",className:o("col-span-full w-full flex items-center gap-2",t),children:[e(m,{iconName:a.price?"IconCreditCardPay":"IconMoodHappy",className:"shrink-0 w-5 h-5"}),e("span",{children:a.price?a.price+"$":"Get It Free"})]})}):u==="install"?s(k,{size:"sm",variant:"outline",className:o("col-span-full w-full flex items-center gap-2",t),onClick:()=>w("install"),recentlySuccessful:v,processing:P,children:[e(re,{className:"shrink-0 w-5 h-5"}),e("span",{children:"Install"})]}):u=="uninstall"?s(k,{size:"sm",variant:"destructive",className:o("col-span-full w-full flex items-center gap-2",t),onClick:()=>w("uninstall"),recentlySuccessful:v,processing:P,children:[e(ie,{className:"w-5 h-5 shrink-0"}),e("span",{children:"Uninstall"})]}):u=="update"?s(k,{size:"sm",variant:"outline",className:o("col-span-full w-full flex items-center gap-2",t),onClick:()=>w("update"),recentlySuccessful:v,processing:P,children:[e(oe,{className:"w-5 h-5 shrink-0"}),e("span",{children:"Update"})]}):s(d,{size:"sm",variant:"outline",className:o("col-span-full w-full flex items-center gap-2",t),disabled:!0,children:[e(W,{className:"w-5 h-5 shrink-0 text-red-400"}),e("span",{children:"Not Compatible with your core version"})]})};export{T as a,C as b,$ as c,X as d,Ue as e,K as f,Y as g,j as h,me as i,de as j,J as k,fe as l,te as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as t,Ia as n,Za as m,d as o}from"./chunk-AQUA6LR6.js";import{a as i}from"./chunk-OZAS7KV6.js";import{a as r}from"./chunk-CZM7FKLS.js";import{a as s}from"./chunk-3H6NZAII.js";import{usePage as a}from"@inertiajs/react";import{jsx as e,jsxs as c}from"react/jsx-runtime";var y=({breadcrumbs:p=[]})=>{let d=a().props,{dashboard:l}=a().props?.emin_core_menus,{url:h}=a(),{user:u,notifications:f,unread_notifications:b}=d.auth;return e("header",{className:"flex h-(--header-height) shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height)",children:c("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[e(o,{className:"-ml-1"}),e(r,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),e(s,{breadcrumbs:p,className:"hidden md:flex"}),c("div",{className:"ml-auto flex items-center gap-2",children:[u&&e(n,{notifications:f??[],unreadNotifications:b??0}),e(m,{placeholder:"Type a command or search...",menu:i(l,h)}),e(t,{className:"w-8 h-8"})]})]})})};export{y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v}from"./chunk-XHQB4Q52.js";import{a as H}from"./chunk-SAIBZJF3.js";import{a as z,b as p}from"./chunk-5SCOJRW6.js";import{a as L}from"./chunk-KND3PUAR.js";import{a as B}from"./chunk-LFDQQW42.js";import{A as S,R as U,S as C,T,ab as _,eb as M}from"./chunk-AQUA6LR6.js";import{a as k}from"./chunk-M5QT5SFN.js";import{a as D,f as A,g as w,i as R}from"./chunk-QFUZ6MVT.js";import{b as E}from"./chunk-TVCWAJFT.js";import{a as f,b as y,c as h,d as b}from"./chunk-CVRMJUDO.js";import{a as i}from"./chunk-G4EEZUTC.js";import{a as g}from"./chunk-G22OJQWL.js";import{b as l}from"./chunk-Y7NR7PFG.js";import{a as I}from"./chunk-GND5KQRZ.js";import{router as Z}from"@inertiajs/react";import{jsx as G}from"react/jsx-runtime";var q=()=>{let a=p(),{users:o,meta:r}=a,t=K(),d=W();return G(M,{data:o,columns:t,meta:r,handleRequest:s=>$(s,a),bulkActions:d})},$=(a,o)=>{Z.get(route("dashboard.users"),{...a},{preserveState:!0,preserveScroll:!0,preserveUrl:!0,only:["users","meta"],onSuccess:r=>{o.setUsers(r.props.users),o.setMeta(r.props.meta)}})};import{Head as J}from"@inertiajs/react";import{jsx as u,jsxs as P}from"react/jsx-runtime";var he=({users:a,roles:o,meta:r,statistics:t})=>{let d=[{title:"WM Dashboard",href:route("dashboard")},{title:"Users"}];return P(B,{breadcrumbs:d,children:[u(J,{title:"Users"}),u(L,{title:"Users",description:"Here you can see and manage all the system users.",icon:u(i,{iconName:"IconUsers",className:"h-10 w-10 my-2"})}),P(z,{users:a,roles:o,meta:r,children:[P("div",{className:"grid gap-4",children:[u(H,{statistics:t}),u("div",{children:u(q,{})})]}),u(O,{})]})]})};import{toast as x}from"sonner";import{useEffect as Q,useState as X}from"react";import{Fragment as Y,jsx as e,jsxs as n}from"react/jsx-runtime";var V=(a,o)=>[{key:"name",label:"Name",value:a.name,type:"text",editable:!1},{key:"surname",label:"surname",value:a.surname,type:"text",editable:!1},{key:"email",label:"Email",value:a.email,editable:!1},{key:"role_code",label:"Role",value:a.role_code,type:"select",options:o.map(r=>({label:r.title,value:r.code}))},{key:"status",label:"Status",value:Number(a.status),type:"select",options:Object.entries(l).map(([r,t])=>({label:r,value:Number(t)}))},{key:"last_seen_at",label:"Last Seen At",value:a.last_seen_at?new Date(a.last_seen_at).toLocaleString():"Never",editable:!1},{key:"registered_at",label:"Registered At",value:new Date(a.created_at).toLocaleString(),editable:!1},{key:"updated_at",label:"Updated At",value:new Date(a.updated_at).toLocaleString(),editable:!1}],K=()=>{let{setSelectedUser:a,setShowUserModal:o,roles:r}=p(),[t,d]=X(!0);return Q(()=>{d(!1);let s=setTimeout(()=>d(!0),50);return()=>clearTimeout(s)},[]),[{id:"select",header:({table:s})=>e(k,{checked:s.getIsAllPageRowsSelected()||s.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:m=>s.toggleAllPageRowsSelected(!!m),"aria-label":"T\xFCm\xFCn\xFC se\xE7"}),cell:({row:s})=>e(k,{id:`select-row-${s.id}`,checked:s.getIsSelected(),onCheckedChange:m=>{s.toggleSelected(!!m)},"aria-label":"Sat\u0131r se\xE7"}),enableSorting:!1,enableHiding:!1},{accessorKey:"id",header:"ID",cell:({row:s})=>n("div",{className:"flex",children:[e(g,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),n("span",{style:{display:t?"block":"none"},children:["#",s.original.id]})]})},{accessorKey:"user",header:"User",cell:({row:s})=>n("div",{className:"flex",children:[e(g,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),n("div",{style:{display:t?"flex":"none"},className:"cursor-pointer",onClick:()=>{a(s.original),o(!0)},children:[e("div",{className:"flex sm:hidden",children:e(T,{user:s.original??null,settings:{showEmail:!0}})}),n("div",{className:"hidden sm:flex items-center gap-2",children:[e(U,{user:s.original,type:"square"}),e(C,{user:s.original,settings:{showId:!1}})]})]})]})},{accessorKey:"status",header:()=>n(f,{trigger:"hover",children:[e(h,{children:"Status"}),n(b,{children:[e(y,{children:"Status"}),e("span",{children:"The status of user"})]})]}),cell:({row:s})=>n(f,{trigger:"hover",children:[n(h,{children:[e(g,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),e("div",{style:{display:t?"block":"none"},children:s.original.status==0?e(i,{iconName:"IconPlayerPause",className:"h-4 w-4 text-primary"}):s.original.status==1?e(i,{iconName:"IconCircleCheckFilled",className:"h-4 w-4 text-green-400"}):s.original.status==2?e(i,{iconName:"IconZoom",className:"h-4 w-4 text-yellow-400"}):s.original.status==3&&e(i,{iconName:"IconBan",className:"h-4 w-4 text-red-400"})})]}),n(b,{children:[e(y,{children:"User Status"}),e("span",{children:s.original?.status==l.Inactive?"Inactive":s.original?.status==l.Active?"Active":s.original?.status==l.Pending?"Pending":"Suspended"})]})]})},{id:"role",accessorKey:"role",header:()=>n(f,{trigger:"hover",children:[e(h,{children:"Role"}),n(b,{children:[e(y,{children:"Role"}),e("span",{children:"The role of user"})]})]}),cell:({row:s})=>{let m=r.find(F=>F.code==s.original.role_code);return n(f,{trigger:"hover",isActive:s.original.role!==void 0,children:[n(h,{children:[e(g,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),e("div",{style:{display:t?"block":"none"},children:m?e(_,{...m}):e("span",{className:"capitalize",children:s.original.role_code})})]}),n(b,{children:[e(y,{children:"Role"}),e("span",{children:s.original.role_code})]})]})}},{id:"actions",header:()=>"Actions",cell:({row:s})=>n(Y,{children:[e(g,{className:"my-2 h-5 w-10",style:{display:t?"none":"block"}}),e("div",{style:{display:t?"flex":"none"},className:"gap-1",children:e(E,{variant:"ghost",size:"sm",onClick:()=>{console.log("test"),a(s.original),o(!0)},children:e(i,{iconName:"IconEye"})})})]})}]},W=()=>[{label:"Suspend",icon:e(i,{iconName:"IconBan",className:"h-4 w-4 mr-1"}),variant:"destructive",confirm:!0,confirmTitle:"Suspend Users",confirmContent:"Are you sure to suspend these users?",confirmIcon:e(i,{iconName:"IconCheck",size:30}),cancel:()=>x.info("Process cancelled"),action:(a,o)=>{let r=a.map(t=>t.original.id.toString());v(r,{status:l.Suspended}).then(()=>o&&o())}},{label:"Confirm",icon:e(i,{iconName:"IconCheck",className:"h-4 w-4 mr-1"}),variant:"outline",confirm:!0,confirmTitle:"Confirm Users",confirmContent:"Are you sure to confirm these users?",confirmIcon:e(i,{iconName:"IconCheck",size:30}),cancel:()=>x.info("Process cancelled"),action:(a,o)=>{let r=a.map(t=>t.original.id.toString());v(r,{status:l.Active}).then(()=>o&&o())}},{label:"Disable",icon:e(i,{iconName:"IconPlayerPause",className:"h-4 w-4 mr-1"}),variant:"outline",confirm:!0,confirmTitle:"Make Users Inactive",confirmContent:"Are you sure to make these users inactive?",confirmIcon:e(i,{iconName:"IconCheck",size:30}),cancel:()=>x.info("Process cancelled"),action:(a,o)=>{let r=a.map(t=>t.original.id.toString());v(r,{status:l.Inactive}).then(()=>o&&o())}}];import{toast as j}from"sonner";import{jsx as c,jsxs as N}from"react/jsx-runtime";var O=()=>{let{selectedUser:a,showUserModal:o,setShowUserModal:r}=p();return c(D,{open:o,onOpenChange:r,children:N(A,{className:"max-h-[90vh] sm:max-w-[50vw] grid !gap-4 overflow-auto",children:[c(w,{className:"pb-4 border-b shrink-0",children:N(R,{children:["Details of ",a?.name]})}),c(ee,{})]})})},ee=()=>{let{selectedUser:a,roles:o}=p();if(!a)return;let r=V(a,o);return N("div",{className:"grid md:grid-cols-[200px_auto] gap-5",children:[c("div",{className:"flex items-center gap-4",children:c(U,{user:a,type:"square",className:"h-full w-full"})}),c("div",{className:"grid grid-cols-2 gap-y-3",children:r.map(t=>N("div",{className:I("flex flex-col items-start justify-start",t.value?.toString()?.length>30?"col-span-2":""),children:[c("p",{className:"text-sm text-muted-foreground capitalize",children:t?.label}),c(S,{item:t,onChange:(d,s)=>{let m=v([a.id.toString()],{[d]:s});return j.promise(m,{loading:"Updating user..."}),m},children:t.key==="status"?t.value==l.Inactive?c("span",{className:"text-sm text-primary",children:"Inactive"}):t.value==l.Active?c("span",{className:"text-sm text-green-400",children:"Active"}):t.value==l.Pending?c("span",{className:"text-sm text-yellow-400",children:"Pending"}):t.value==l.Suspended&&c("span",{className:"text-sm text-red-400",children:"Suspended"}):c("span",{className:"text-sm",children:t?.value??"-"})},t.key)]},t.key))})]})};export{O as a,ee as b,q as c,he as d,V as e,K as f,W as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as sr}from"./chunk-T5R5N4HX.js";import{a as tr}from"./chunk-CAS5DGWY.js";import{a as er}from"./chunk-QK56PGOF.js";import{a as ar}from"./chunk-EQXKOPKH.js";import{a as za,b as Sr,c as Pr}from"./chunk-UB5QQGPD.js";import{a as yt}from"./chunk-OZAS7KV6.js";import{a as ur,c as pr}from"./chunk-2RDTNW5J.js";import{a as la,b as Ba}from"./chunk-PZEX7JNQ.js";import{a as or}from"./chunk-X72P6HTC.js";import{b as lr,c as cr}from"./chunk-X2FAUFZV.js";import{a as Zo,b as Jo}from"./chunk-U7CCM2TG.js";import{a as Lo}from"./chunk-TGINGSSX.js";import{b as mr}from"./chunk-UNVT5GVP.js";import{a as ea,b as ht,c as xt,d as Nt}from"./chunk-2UOSQSPQ.js";import{a as Ro}from"./chunk-7NKFSFMC.js";import{a as yr,b as wr,c as Cr,e as ca,f as kr,g as Fa}from"./chunk-A6BBNBOV.js";import{a as Oe}from"./chunk-OFK4F5KR.js";import{a as aa,b as oa}from"./chunk-OTBFBEQW.js";import{a as Eo,c as Io,d as To,e as Do,g as Ao}from"./chunk-WNFQKV4B.js";import{a as Jt}from"./chunk-CZM7FKLS.js";import{a as Qt,b as vo,d as Xt,e as Yt,g as jt,h as ho}from"./chunk-AW6EOFKV.js";import{a as dr}from"./chunk-EEYT23VU.js";import{a as T}from"./chunk-DSY4KVMF.js";import{a as E}from"./chunk-QKGQOXDM.js";import{a as w}from"./chunk-XEBYLJU7.js";import{a as Bo,b as Fo,c as Ra,e as zo,f as Oo}from"./chunk-OTSYJWIO.js";import{a as ta}from"./chunk-M5QT5SFN.js";import{a as Ta,b as Da,c as Aa}from"./chunk-EV4GZ2HL.js";import{b as fr,c as gr,d as br,e as vr,f as hr,h as xr,i as Nr}from"./chunk-GBXDCZP6.js";import{a as Se,b as wt,d as Qo,f as Pe,g as Xo,h as sa,i as Yo,j as jo}from"./chunk-QFUZ6MVT.js";import{a as Be,c as Fe,d as ze,e as Ho,f as et,g as ra,j as Uo,k as _a}from"./chunk-AYYFGDAO.js";import{a as ir}from"./chunk-566X7DTI.js";import{a as xo,b as No,e as yo,f as wo,g as Co,h as ko,i as So,j as Po,k as Mo}from"./chunk-S46ZLDUA.js";import{b as Ze}from"./chunk-YLI3WTOQ.js";import{a as Wo,b as qo,c as $o,e as Ko,f as Go}from"./chunk-3H6NZAII.js";import{b as u}from"./chunk-TVCWAJFT.js";import{a as W,b as Q,c as tt,d as ia,e as rr,f as K,g as nr}from"./chunk-3DBYUBWW.js";import{a as ee,b as ke,c as te,d as ae}from"./chunk-CVRMJUDO.js";import{a as oe}from"./chunk-65LRDGYI.js";import{a as l}from"./chunk-G4EEZUTC.js";import{a as _o}from"./chunk-SO7A4MJT.js";import{a as La}from"./chunk-G22OJQWL.js";import{b as na,c as Vo}from"./chunk-2HEFLNRE.js";import{a as Mr}from"./chunk-QKEP6HZU.js";import{a as Er}from"./chunk-XUEJAJL7.js";import{a as d,b as Ce,c as bo,d as _e,e as H}from"./chunk-GND5KQRZ.js";import{a as go}from"./chunk-5RKCSYZG.js";import*as Y from"react";import{Slot as Vt}from"@radix-ui/react-slot";import{cva as Jl}from"class-variance-authority";import{useEffect as os,useRef as rs}from"react";import{Link as Ir,usePage as ns}from"@inertiajs/react";import{IconChevronRight as Tr}from"@tabler/icons-react";import{Fragment as Dr,jsx as I,jsxs as at}from"react/jsx-runtime";var Rr=({items:e})=>I(Dr,{children:e.map(t=>t.items&&t.items.length>0?I(Ta,{asChild:!0,defaultOpen:!!(t.isActive||t.hasActiveChild),className:"group/collapsible",children:at(Bt,{children:[I(Da,{asChild:!0,className:"cursor-pointer",children:at(ot,{tooltip:t.title,children:[t.icon&&I(l,{iconName:t.icon}),I("span",{children:t.title}),I(Tr,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),I(Aa,{children:I(Oa,{children:t.items.map(o=>I(Lr,{children:o.items&&o.items.length>0?I(Ta,{asChild:!0,defaultOpen:!!(o.isActive||o.hasActiveChild),className:"group/collapsible",children:at(Dr,{children:[I(Da,{asChild:!0,className:"cursor-pointer",children:at(Ha,{className:d(o.isActive&&"bg-muted font-medium text-foreground dark:bg-muted/50"),children:[o.icon&&I(l,{iconName:o.icon}),I("span",{children:o.title}),I(Tr,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),I(Aa,{children:I(Oa,{children:I(Rr,{items:o.items})})})]})}):I(Ha,{asChild:!0,className:d(o.isActive&&"bg-muted font-medium text-foreground dark:bg-muted/50"),children:at(Ir,{href:o.route_name?route(o.route_name,o.payload??{}):"#",children:[o.icon&&I(l,{iconName:o.icon}),I("span",{children:o.title})]})})},o.title))})})]})},t.title):I(Bt,{children:I(ot,{asChild:!0,tooltip:t.title,className:d(t.isActive&&"bg-muted font-medium text-foreground dark:bg-muted/50"),children:at(Ir,{href:t.route_name?route(t.route_name,t.payload??{}):"#",children:[t.icon&&I(l,{iconName:t.icon}),I("span",{children:t.title})]})})},t.title))}),Ua=({sidebarMenu:e})=>{let t=rs(null),o=ns(),a=()=>{if(t.current&&o?.props){let s=`nav-scroll-${window.location.pathname}`;localStorage.setItem(s,t.current.scrollTop.toString())}},r=()=>{if(t.current&&o?.props){let s=`nav-scroll-${window.location.pathname}`,i=localStorage.getItem(s);i&&(t.current.scrollTop=parseInt(i,10))}};return os(()=>{let s=setTimeout(()=>{r()},100);return()=>clearTimeout(s)},[]),I("div",{ref:t,onScroll:a,children:e.map((s,i)=>at(Ar,{children:[s.title&&I(da,{children:s.title}),I(ma,{className:"!flex ",children:I(Rr,{items:s.items.filter(n=>n.location!=="quick-menu")})})]},s.title||`section-${i}`))})};import{jsx as He,jsxs as Ue}from"react/jsx-runtime";var _r=({icon:e=He(l,{iconName:"IconAlertCircleFilled",className:"opacity-80"}),title:t="Confirm",content:o="Are you sure?",onConfirm:a=()=>{},confirmText:r=Ue("div",{className:"flex items-center gap-1",children:[He(l,{iconName:"IconCircleCheck"}),"Confirm"]}),onCancel:s=()=>{},cancelText:i=Ue("div",{className:"flex items-center gap-1",children:[He(l,{iconName:"IconCircleX"}),"Cancel"]}),children:n})=>Ue(xo,{children:[He(No,{asChild:!0,children:n}),Ue(yo,{children:[Ue("div",{className:"flex flex-col items-center gap-2",children:[He("div",{className:"flex size-auto p-2.5 shrink-0 items-center justify-center rounded-full border","aria-hidden":"true",children:e}),Ue(wo,{children:[He(ko,{className:"text-center",children:t}),He(So,{children:o})]})]}),Ue(Co,{children:[Ue(Mo,{className:"flex-1",onClick:s,children:[typeof i=="string"&&He(l,{iconName:"IconX"}),i]}),Ue(Po,{className:"flex-1",onClick:a,children:[typeof r=="string"&&He(l,{iconName:"IconCheck"}),r]})]})]})]});import{useEffect as ss,useState as Va}from"react";import{jsx as q,jsxs as Je}from"react/jsx-runtime";var is=({item:e,onChange:t,children:o,showIconOnHover:a=!0})=>e.editable!==!1?Je(ee,{trigger:"click",isActive:e.editable,children:[q(te,{children:Je("div",{className:"group inline-flex items-center gap-1",children:[o,a&&q(l,{iconName:"IconPencil",className:"h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100"})]})}),Je(ae,{children:[q(ke,{children:e.label}),q(ls,{item:e,onChange:t})]})]}):o,ls=({item:e,onChange:t,...o})=>{let a=e?.type,[r,s]=Va(e.value),[i,n]=Va(e.value);ss(()=>{s(e.value),n(e.value)},[e.value]);let[c,m]=Va(""),g=async b=>{if(!(e.editable===!1||!t)){console.log(e.options);try{if(!p(b))return;await t(e.key,b??r)&&s(b)}catch(R){s(e.value),m(R.message)}}},p=b=>!0,h=()=>i!==r&&g(r),D;switch(a){case"number":case"text":case"email":case"password":case"tel":case"url":case"date":case"datetime-local":case"time":D=q(E,{type:a,value:r,onBlur:h,onChange:b=>s(b.target.value),"aria-invalid":c?"true":"false"},e.key);break;case"textarea":D=q(Lo,{value:r,onBlur:h,onChange:b=>s(b.target.value),"aria-invalid":c?"true":"false"},e.key);break;case"select":D=Je(Eo,{value:r,onValueChange:b=>g(b),children:[q(Do,{children:e?.options&&e.options.length>0&&e.options.map(b=>q(Ao,{value:b.value,className:"capitalize",children:b.label},b.value))}),q(To,{size:"sm",className:"capitalize w-full",children:q(Io,{placeholder:"Select an option",children:e?.options?.find(b=>b.value===i)?.label??typeof r},r)})]},e.key);break;case"checkbox":D=q("div",{className:"flex items-center gap-2",children:Je(w,{children:[q(ta,{checked:r,onCheckedChange:b=>g(b)},e.key),e.label]})});break;case"switch":D=q("div",{className:"flex items-center gap-2",children:Je(w,{children:[q(Ro,{checked:r,onCheckedChange:b=>g(b)},e.key),e.label]})});break;case"radio":case"file":return null}return Je("div",{className:"grid gap-1 w-full",children:[D,c&&q("p",{className:"text-red-500 text-sm",children:c})]})},_c=({items:e,onChange:t})=>e.map(o=>Je("div",{className:d("flex flex-col items-start justify-start",o.value?.toString()?.length>30?"col-span-2":""),children:[q("p",{className:"text-sm text-muted-foreground capitalize",children:o?.label}),q(is,{item:o,onChange:o?.onChange??t,children:q("span",{className:"text-sm",children:o?.value??"-"})},o.key)]},o.key));import{jsx as G,jsxs as rt}from"react/jsx-runtime";var Br=[{color:"default",labelSelected:"border-primary/75 bg-primary/5",label:"hover:border-primary/50",iconSelected:"bg-primary/20",textSelected:"text-primary"},{color:"cyan",labelSelected:"border-cyan-500 bg-cyan-50 dark:bg-cyan-900/10",label:"hover:border-cyan-300",iconSelected:"bg-cyan-100 dark:bg-cyan-900/30",textSelected:"text-cyan-600 dark:text-cyan-400"},{color:"blue",labelSelected:"border-blue-500 bg-blue-50 dark:bg-blue-900/10",label:"hover:border-blue-300",iconSelected:"bg-blue-100 dark:bg-blue-900/30",textSelected:"text-blue-600 dark:text-blue-400"},{color:"green",labelSelected:"border-green-500 bg-green-50 dark:bg-green-900/10",label:"hover:border-green-300",iconSelected:"bg-green-100 dark:bg-green-900/30",textSelected:"text-green-600 dark:text-green-400"},{color:"red",labelSelected:"border-red-500 bg-red-50 dark:bg-red-900/10",label:"hover:border-red-300",iconSelected:"bg-red-100 dark:bg-red-900/30",textSelected:"text-red-600 dark:text-red-400"},{color:"orange",labelSelected:"border-orange-500 bg-orange-50 dark:bg-orange-900/10",label:"hover:border-orange-300",iconSelected:"bg-orange-100 dark:bg-orange-900/30",textSelected:"text-orange-600 dark:text-orange-400"},{color:"yellow",labelSelected:"border-yellow-500 bg-yellow-50 dark:bg-yellow-900/10",label:"hover:border-yellow-300",iconSelected:"bg-yellow-100 dark:bg-yellow-900/30",textSelected:"text-yellow-600 dark:text-yellow-400"}],Uc=({section:e})=>{let t=e.type==="checkbox",o=t?Array.isArray(e.value)?e.value:[]:[e.value],a=i=>{if(!t){e.onSave({key:e.key,value:i});return}let n=o.includes(i)?o.filter(c=>c!==i):[...o,i];e.onSave({key:e.key,value:n})},r=t?"div":aa,s=t?{className:`grid grid-cols-1 md:grid-cols-${e.options.length} gap-4`}:{className:`grid grid-cols-1 md:grid-cols-${e.options.length} gap-4`,value:e.value??null,onValueChange:i=>e.onSave({key:e.key,value:i})};return rt("div",{className:"space-y-6",children:[G(oe,{icon:typeof e.icon=="string"?G(l,{iconName:e.icon,size:24}):e.icon,title:e.title,description:e.description}),G(r,{...s,value:t?void 0:String(e.value??""),children:e.options.map((i,n)=>{let c=i.color??"default",m=Br.find(p=>p.color===c)||Br[0],g=t?i.key&&o.includes(i.key):e.value===i.value;return rt("div",{children:[!t&&G(oa,{id:`${e.key}:${i.value}`,value:String(i.value),className:"sr-only"}),G(w,{htmlFor:t?void 0:`${e.key}:${i.value}`,onClick:()=>t&&i.key&&a(i.key),className:`cursor-pointer border-2 rounded-lg p-4 flex items-center justify-center transition-all shadow-sm hover:shadow-md border-border ${g?m.labelSelected:m.label}`,children:rt("div",{className:"flex flex-col items-center text-center space-y-3",children:[i.icon&&G("div",{className:`p-3 rounded-full ${g?d(m.iconSelected,m.textSelected):"bg-muted text-muted-foreground"}`,children:typeof i.icon=="string"?G(l,{iconName:i.icon,size:24}):i.icon}),rt("div",{children:[rt("div",{className:"flex items-center justify-center gap-1 font-medium",children:[i.title&&G("span",{children:i.title}),i.help_text&&rt(ee,{trigger:"hover",children:[G(te,{children:G(l,{iconName:"IconHelpCircle",size:16,className:"mt-[1px] text-muted-foreground"})}),rt(ae,{className:"w-auto",children:[G(ke,{children:"What is this?"}),G("div",{className:"p-2 my-2 mx-3 text-sm break-all",children:i.help_text})]})]})]}),i.description&&G("p",{className:"text-xs text-muted-foreground mt-1",children:i.description})]}),G("div",{className:"w-5 h-5",onClick:p=>{p.stopPropagation(),t&&i.key&&a(i.key)},children:g?G("div",{className:`border border-primary/20 ${t?"rounded-sm":"rounded-full"} bg-muted flex h-5 w-5 my-auto flex-shrink-0 items-center justify-center`,children:G(l,{iconName:"IconCheck",className:"w-3 h-3"})}):G("span",{className:`border border-primary/20 ${t?"rounded-sm":"rounded-full"} flex h-5 w-5 my-auto flex-shrink-0`})})]})})]},n)})}),e.extra?typeof e.extra=="function"?e.extra():e.extra:null]},e.key)};import{Transition as cs}from"@headlessui/react";import{IconCircleCheck as ds,IconLoader2 as ms}from"@tabler/icons-react";import{Fragment as us,jsx as Ct,jsxs as Fr}from"react/jsx-runtime";var ua=({processing:e,recentlySuccessful:t,processingText:o="Saving...",successText:a="Saved!",children:r,className:s,...i})=>Ct(u,{disabled:e||t,className:d("flex items-center gap-2",s),variant:"outline",...i,children:t?Ct(cs,{show:t,enter:"transition ease-in-out",enterFrom:"opacity-0",leave:"transition ease-in-out",leaveTo:"opacity-0",children:Fr("div",{className:"flex items-center text-sm text-center text-muted-foreground mx-auto",children:[Ct(ds,{}),Ct("span",{className:"ml-2",children:a})]})}):e?Fr(us,{children:[Ct(ms,{className:"animate-spin"}),Ct("span",{children:o})]}):r});import{usePage as ji}from"@inertiajs/react";import{Link as ya,usePage as Nn}from"@inertiajs/react";import{Link as ps}from"@inertiajs/react";import{IconChevronRight as fs}from"@tabler/icons-react";import{jsx as O,jsxs as kt}from"react/jsx-runtime";var zr=({item:e})=>O(Ra,{className:"list-none",children:O(ps,{href:e?.route_name?route(e.route_name,e.payload??{}):"#",legacyBehavior:!0,passHref:!0,children:kt(u,{variant:"ghost",className:d("w-full justify-start font-normal",e.isActive&&"bg-accent text-accent-foreground"),children:[e.icon&&O(l,{iconName:e.icon,className:"h-4 w-4"}),O("span",{children:e.title})]})})}),gs=({item:e})=>kt("li",{className:"relative list-none [&:hover>div.flyout-menu]:block",children:[kt(u,{variant:"ghost",className:d("flex w-full cursor-pointer items-center justify-between font-normal transition-colors hover:bg-accent hover:text-accent-foreground",e.isActive&&"bg-accent text-accent-foreground"),children:[kt("div",{className:"flex items-center gap-2",children:[e.icon&&O(l,{iconName:e.icon,className:"h-4 w-4"}),O("span",{children:e.title})]}),O(fs,{className:"h-4 w-4 text-muted-foreground"})]}),O("div",{className:"flyout-menu absolute left-full top-0 z-50 hidden pl-1",children:O("ul",{className:"flex w-auto flex-col gap-1 rounded-md border bg-popover p-2 text-popover-foreground shadow-md animate-in fade-in zoom-in-95",children:e.items?.map(t=>O("li",{children:O(Or,{item:t})},t.title))})})]}),Or=({item:e})=>e?.items&&e?.items?.length>0?O(gs,{item:e}):O(zr,{item:e}),Hr=({menuItems:e})=>e?O(Bo,{viewport:!1,delayDuration:0,children:O(Fo,{className:"flex items-center",children:e.filter(t=>t.location!=="quick-menu").map(t=>t.items&&t.items.length>0?kt(Ra,{children:[kt(zo,{className:d("flex items-center gap-2",t.isActive&&"bg-accent text-accent-foreground"),children:[t.icon&&O(l,{iconName:t.icon,className:"h-4 w-4"}),O("span",{children:t.title})]}),O(Oo,{className:"!overflow-visible min-w-[200px]",children:O("ul",{className:"flex w-auto flex-col gap-1 p-2",children:t.items.filter(o=>o.location!=="quick-menu").map(o=>O("li",{children:O(Or,{item:o})},o.title))})})]},t.title):O(zr,{item:t}))})}):null;import{jsx as Wa,jsxs as bs}from"react/jsx-runtime";var Ur=({className:e,...t})=>{let{appearance:o,updateAppearance:a}=St(),r=Ce();return bs(u,{variant:"ghost",size:"icon",onClick:()=>{H("click",r),a(o==="dark"?"light":"dark")},className:d("group cursor-pointer",e),...t,children:[Wa(l,{iconName:"IconSun",className:"opacity-80 group-hover:opacity-100 !size-5 h-9 w-9 rotate-0 scale-100 transition-all dark:rotate-90 dark:scale-0"}),Wa(l,{iconName:"IconMoon",className:"opacity-80 group-hover:opacity-100 !size-5 absolute h-9 w-9 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),Wa("span",{className:"sr-only",children:"Temay\u0131 de\u011Fi\u015Ftir"})]})};import{jsx as fe,jsxs as Pt}from"react/jsx-runtime";function vs({className:e="",...t}){let{appearance:o,updateAppearance:a}=St();return fe("div",{className:e,...t,children:Pt(Be,{children:[fe(Fe,{asChild:!0,children:Pt(u,{variant:"ghost",size:"icon",className:"h-9 w-9 rounded-md",children:[(()=>{switch(o){case"dark":return fe(l,{iconName:"IconMoon",className:"h-5 w-5"});case"light":return fe(l,{iconName:"IconSun",className:"h-5 w-5"});default:return fe(l,{iconName:"IconDeviceDesktop",className:"h-5 w-5"})}})(),fe("span",{className:"sr-only",children:"Toggle theme"})]})}),Pt(ze,{align:"end",children:[fe(et,{onClick:()=>a("light"),children:Pt("span",{className:"flex items-center gap-2",children:[fe(l,{iconName:"IconSun",className:"h-5 w-5"}),"Light"]})}),fe(et,{onClick:()=>a("dark"),children:Pt("span",{className:"flex items-center gap-2",children:[fe(l,{iconName:"IconMoon",className:"h-5 w-5"}),"Dark"]})}),fe(et,{onClick:()=>a("system"),children:Pt("span",{className:"flex items-center gap-2",children:[fe(l,{iconName:"IconDeviceDesktop",className:"h-5 w-5"}),"System"]})})]})]})})}import{jsx as qa,jsxs as hs}from"react/jsx-runtime";var Vr=({className:e="",...t})=>{let{appearance:o,updateAppearance:a}=St(),r=[{value:"light",icon:"IconSun",label:"Light"},{value:"dark",icon:"IconMoon",label:"Dark"},{value:"system",icon:"IconDeviceDesktop",label:"System"}];return qa("div",{className:d("inline-flex gap-1 rounded-lg bg-neutral-100 p-1 dark:bg-neutral-800",e),...t,children:r.map(({value:s,icon:i,label:n})=>hs("button",{onClick:()=>a(s),className:d("flex items-center rounded-md px-3.5 py-1.5 transition-colors",o===s?"bg-white shadow-xs dark:bg-neutral-700 dark:text-neutral-100":"text-neutral-500 hover:bg-neutral-200/60 hover:text-black dark:text-neutral-400 dark:hover:bg-neutral-700/60"),children:[qa(l,{iconName:i,className:"-ml-1 h-4 w-4"}),qa("span",{className:"ml-1.5 text-sm",children:n})]},s))})};var xs=()=>typeof window>"u"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches,pa=e=>{let t=e==="dark"||e==="system"&&xs();document.documentElement.classList.toggle("dark",t)},$a=()=>typeof window>"u"?null:window.matchMedia("(prefers-color-scheme: dark)"),Ka=()=>{let e=localStorage.getItem("appearance");pa(e||"system"),na()};function wd(){let e=localStorage.getItem("appearance")||"system";pa(e),$a()?.addEventListener("change",Ka)}import{useCallback as Ns,useEffect as ys,useState as ws}from"react";function St(){let[e,t]=ws("system"),o=Ns(a=>{t(a),localStorage.setItem("appearance",a),bo("appearance",a),pa(a),na()},[]);return ys(()=>{let a=localStorage.getItem("appearance");return o(a||"system"),()=>$a()?.removeEventListener("change",Ka)},[o]),{appearance:e,updateAppearance:o}}import{Root as Cs,Image as ks,Fallback as Ss}from"@radix-ui/react-avatar";import{jsx as Za}from"react/jsx-runtime";function Wr({className:e,...t}){return Za(Cs,{"data-slot":"avatar",className:d("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function qr({className:e,...t}){return Za(ks,{"data-slot":"avatar-image",className:d("aspect-square size-full",e),...t})}function Ga({className:e,...t}){return Za(Ss,{"data-slot":"avatar-fallback",className:d("bg-muted flex size-full items-center justify-center rounded-[inherit] text-xs",e),...t})}import{Fragment as Ps,jsx as U,jsxs as Ve}from"react/jsx-runtime";var Mt=({user:e,type:t="circle",className:o,...a})=>{let r=Zo(e);return Ve("div",{className:d("relative",o),children:[U(Wr,{className:d(t==="circle"?"rounded-full":"rounded-sm","size-9",o),...a,children:e?e.avatar?U(qr,{src:_e(e.avatar),alt:e?.name,title:"Last seen at "+new Date(e?.last_seen_at??"").toLocaleString()}):U(Ga,{className:"capitalize bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white",children:e?.name?.slice(0,1)}):U(Ga,{className:"capitalize bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white",children:Ve(ee,{trigger:"hover",children:[U(te,{children:U(l,{iconName:"IconSpy",className:"w-4 h-4",stroke:"1.5"})}),Ve(ae,{className:"w-auto",children:[U(ke,{children:"What does it mean?"}),U("div",{className:"p-2 my-2 mx-3 text-sm break-all",children:"User is not available (Guest)"})]})]})})}),U("span",{className:`border-background absolute rounded-full -end-0.5 -bottom-0.5 size-3 border-2 ${Jo(r)}`,children:U("span",{className:"sr-only",children:r})})]})},fa=({user:e,settings:t,className:o,...a})=>Ve("div",{className:d("grid gap-1",o),...a,children:[Ve("span",{className:"block text-sm font-medium text-foreground flex items-center gap-1",children:[Ve("div",{className:"flex items-center gap-1",children:[t?.showName!==!1&&U("span",{children:e?.name}),t?.showId!==!1&&Ve("span",{className:"text-muted-foreground text-xs",children:["#",e?.id]})]}),t?.showRole!==!1&&U("div",{className:"flex h-4",children:e?.role&&U($r,{...e?.role})})]}),t?.showEmail!==!1&&U("span",{className:"block text-xs text-foreground/50",children:e?.email})]}),$d=({user:e,settings:t,...o})=>U(Ps,{children:Ve(ee,{trigger:"hover",isActive:t?.showPopover!==!1,children:[U(te,{children:t?.showAvatar!==!1&&U(Mt,{user:e,type:"circle"})}),U(ae,{className:"w-auto max-w-[250px] break-all",children:U("div",{className:"text-sm break-all",children:Ve("div",{className:"flex items-center gap-2",children:[t?.showAvatar!==!1&&U(Mt,{user:e,type:"square"}),U(fa,{user:e,settings:t})]})})})]})});import{Link as Kr,usePage as Ja}from"@inertiajs/react";import{Fragment as Ms,jsx as B,jsxs as We}from"react/jsx-runtime";var Gr=({settings:e})=>{let{user:t}=Ja().props.auth,o=Mr();return We(Ms,{children:[B(Uo,{className:"p-0 font-normal",children:We("div",{className:"flex items-center gap-2 px-1 text-left text-sm",children:[B(Mt,{user:t,type:"square"}),B(fa,{settings:e,className:"py-2",user:t})]})}),B(_a,{}),B(Ho,{children:B(et,{asChild:!0,children:We(Kr,{className:"block w-full",href:route("user"),as:"button",prefetch:!0,onClick:o,children:[B(l,{iconName:"IconUserSquare",className:"mr-2"}),"My Account"]})})}),B(_a,{}),B(et,{asChild:!0,children:We(Kr,{className:"block w-full",method:"post",href:route("logout"),as:"button",onClick:o,children:[B(l,{iconName:"IconLogout",className:"mr-2"}),"Log out"]})})]})},Zr=({showName:e=!0})=>{let{user:t}=Ja().props.auth;return We(Be,{children:[B(Fe,{asChild:!0,children:We("div",{className:"flex items-center gap-3 cursor-pointer",children:[We("span",{className:"text-sm",children:["Hello ",B("span",{className:"font-bold",children:t.name})]}),B(u,{variant:"ghost",className:"size-8 rounded-full",children:B(Mt,{user:t,type:"circle"})})]})}),B(ze,{className:"w-56",children:B(Gr,{settings:{showId:!1}})})]})},am=()=>{let{user:e}=Ja().props.auth,{isMobile:t}=Et();return B(ma,{children:B(Bt,{children:We(Be,{children:[B(Fe,{asChild:!0,children:We(ot,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[B(Mt,{user:e,type:"square"}),B(fa,{settings:{showRole:!1,showId:!1},user:e,className:"py-2"}),B(l,{iconName:"IconDotsVertical",className:"ml-auto size-4"})]})}),B(ze,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:t?"bottom":"right",sideOffset:4,children:B(Gr,{settings:{showRole:!1,showId:!1}})})]})})})};import{usePage as Es}from"@inertiajs/react";import{jsx as Is}from"react/jsx-runtime";var Jr=()=>{let{url:e,props:t}=Es(),{user:o}=t?.emin_core_menus,a=yt(o,e)[0];return Is(ga,{mainMenu:a})};import{Link as Ts}from"@inertiajs/react";import{Fragment as Ds}from"react";import{Fragment as As,jsx as nt,jsxs as Qr}from"react/jsx-runtime";function Xr({breadcrumbs:e}){return nt(As,{children:e.length>0&&nt(Wo,{children:nt(qo,{children:e.map((t,o)=>{let a=o===e.length-1;return Qr(Ds,{children:[Qr($o,{className:"flex items-center gap-2",children:[t.icon&&nt(l,{iconName:t.icon,size:16,className:a?"text-primary":"text-muted-foreground"}),a?nt(Ko,{children:t.title}):nt(Ts,{href:t.href??"#",children:t.title})]}),!a&&nt(Go,{})]},o)})})})})}import{jsx as st,jsxs as Yr}from"react/jsx-runtime";var Me=({children:e,breadcrumbs:t,...o})=>{if(typeof window>"u")return st(jr,{});let a=[{title:"My Account",href:route("user"),icon:"IconUserSquare"},...t||[]];return Yr(ba,{className:"mt-17",children:[st(Jr,{}),Yr("main",{className:"mx-auto flex h-full w-full max-w-7xl space-y-8 flex-1 flex-col gap-1 rounded-xl",...o,children:[a.length>0?st("div",{className:"border-sidebar-border/70 flex w-full border-b",children:st("div",{className:"mx-auto flex h-12 w-full items-center justify-center px-4 text-neutral-500 md:max-w-7xl",children:st(Xr,{breadcrumbs:a})})}):st("div",{className:"h-12"}),st("div",{className:"@container/main px-7",children:e})]})]})};import{useForm as mi}from"@inertiajs/react";import{useRef as rn}from"react";import{toast as ui}from"sonner";import{useState as Ls}from"react";import{Head as Rs}from"@inertiajs/react";import{Fragment as Bs,jsx as V,jsxs as ge}from"react/jsx-runtime";var en=({status:e,canResetPassword:t})=>{let{data:o,setData:a,processing:r,errors:s,submit:i}=tn();return ge(Bs,{children:[ge("form",{className:"flex flex-col gap-6",onSubmit:i,children:[ge("div",{className:"grid gap-6",children:[ge("div",{className:"grid gap-2",children:[V(w,{htmlFor:"email",children:"Email address"}),ge("div",{className:"group relative",children:[V(E,{id:"email",type:"email",required:!0,autoFocus:!0,tabIndex:1,autoComplete:"email",value:o.email,onChange:n=>a("email",n.target.value),placeholder:"email@example.com",className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1","aria-invalid":!!s.email}),V("div",{className:"text-muted-foreground/80 absolute inset-y-0 start-0 flex items-center justify-center ps-3",children:V(l,{iconName:"IconMail",size:16})})]}),V(T,{message:s.email})]}),ge("div",{className:"grid gap-2",children:[ge("div",{className:"flex items-center",children:[V(w,{htmlFor:"password",children:"Password"}),t&&V(Oe,{href:route("password.request"),className:"ml-auto text-sm",tabIndex:5,children:"Forgot password?"})]}),V(re,{id:"password",type:"password",required:!0,tabIndex:2,autoComplete:"current-password",value:o.password,onChange:n=>a("password",n.target.value),placeholder:"Password",className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1"}),V(T,{message:s.password})]}),ge("div",{className:"flex items-center space-x-3",children:[V(ta,{id:"remember",name:"remember",checked:o.remember,onClick:()=>a("remember",!o.remember),tabIndex:3}),V(w,{htmlFor:"remember",children:"Remember me"})]}),ge(u,{type:"submit",className:"mt-4 w-full",tabIndex:4,disabled:r,children:[r&&V(l,{iconName:"IconLoader2",className:"h-4 w-4 animate-spin"}),"Log in"]})]}),ge("div",{className:"text-muted-foreground text-center text-sm",children:["Don't have an account?"," ",V(Oe,{href:route("register"),tabIndex:5,children:"Sign up"})]})]}),e&&V("div",{className:"mb-4 text-center text-sm font-medium text-green-600",children:e})]})},qm=({trigger:e,status:t,canResetPassword:o})=>{let[a,r]=Ls(!1);return ge(Se,{open:a,onOpenChange:r,children:[V(Pe,{children:V(en,{status:t,canResetPassword:o})}),V(wt,{children:e})]})},_s=({status:e,canResetPassword:t})=>V(en,{status:e,canResetPassword:t}),$m=({status:e,canResetPassword:t})=>ge(be,{title:"Log in to your account",description:"Enter your email and password below to log in",children:[V(Rs,{title:"Log in"}),V(_s,{status:e,canResetPassword:t})]});import{useForm as Fs,usePage as zs}from"@inertiajs/react";import{toast as Os}from"sonner";var tn=()=>{let t=zs().props.app.media_base_path,{data:o,setData:a,post:r,processing:s,errors:i,reset:n}=Fs({email:"",password:"",remember:!1});return{data:o,setData:a,post:r,processing:s,errors:i,reset:n,submit:m=>{m.preventDefault(),Os.promise(new Promise((g,p)=>{r(route("login"),{onSuccess:()=>H("intro",t),onFinish:()=>{n("password"),g(!0)},onError:()=>{H("soft-alert",t),p(!1)}})}),{loading:"Logging in...",success:"Login successful!",error:"Login failed!"})}}};import{Head as Hs}from"@inertiajs/react";import{useState as Us}from"react";import{jsx as ve,jsxs as Ft}from"react/jsx-runtime";var an=({callback:e})=>{let{data:t,setData:o,submit:a,processing:r,errors:s}=er(e);return ve("form",{onSubmit:a,children:Ft("div",{className:"space-y-6",children:[Ft("div",{className:"grid gap-2",children:[ve(w,{htmlFor:"password",children:"Password"}),ve(re,{id:"password",type:"password",name:"password",placeholder:"Password",autoComplete:"current-password",value:t.password,autoFocus:!0,onChange:i=>o("password",i.target.value),className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1"}),ve(T,{message:s.password})]}),ve("div",{className:"flex items-center",children:Ft(u,{className:"w-full",disabled:r,children:[r&&ve(l,{iconName:"IconLoader2",className:"h-4 w-4 animate-spin"}),"Confirm password"]})})]})})},mu=({trigger:e,callback:t})=>{let[o,a]=Us(!1);return Ft(Se,{open:o,onOpenChange:a,children:[ve(Pe,{children:ve(an,{callback:s=>{t&&(t(s),a(!1))}})}),ve(wt,{children:e})]})},Vs=()=>ve(an,{}),uu=()=>Ft(be,{title:"Confirm your password",description:"This is a secure area of the application. Please confirm your password before continuing.",children:[ve(Hs,{title:"Confirm password"}),ve(Vs,{})]});import{Head as Ws}from"@inertiajs/react";import{Fragment as qs,jsx as me,jsxs as Qe}from"react/jsx-runtime";var on=({status:e})=>{let{data:t,setData:o,submit:a,processing:r,errors:s}=tr();return Qe(qs,{children:[e&&me("div",{className:"mb-4 text-center text-sm font-medium text-green-600",children:e}),Qe("div",{className:"space-y-6",children:[Qe("form",{onSubmit:a,children:[Qe("div",{className:"grid gap-2",children:[me(w,{htmlFor:"email",children:"Email address"}),Qe("div",{className:"group relative",children:[me(E,{id:"email",type:"email",name:"email",autoComplete:"off",value:t.email,autoFocus:!0,onChange:i=>o("email",i.target.value),placeholder:"email@example.com","aria-invalid":!!s.email,className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1"}),me("div",{className:"text-muted-foreground/80 absolute inset-y-0 start-0 flex items-center justify-center ps-3",children:me(l,{iconName:"IconMail",size:16})})]}),me(T,{message:s.email})]}),me("div",{className:"my-6 flex items-center justify-start",children:Qe(u,{className:"w-full",disabled:r,children:[r&&me(l,{iconName:"IconLoader2",className:"h-4 w-4 animate-spin"}),"Email password reset link"]})})]}),Qe("div",{className:"text-muted-foreground space-x-1 text-center text-sm",children:[me("span",{children:"Or, return to"}),me(Oe,{href:route("login"),children:"log in"})]})]})]})},Pu=({status:e})=>me(on,{status:e}),Mu=({status:e})=>Qe(be,{title:"Forgot password",description:"Enter your email to receive a password reset link",children:[me(Ws,{title:"Forgot password"}),me(on,{status:e})]});import{Head as $s}from"@inertiajs/react";import{jsx as ne,jsxs as It}from"react/jsx-runtime";var Ks=({token:e,email:t})=>{let{data:o,setData:a,submit:r,processing:s,errors:i}=ar({token:e,email:t});return ne("form",{onSubmit:r,children:It("div",{className:"grid gap-6",children:[It("div",{className:"grid gap-2",children:[ne(w,{htmlFor:"email",children:"Email"}),ne(E,{id:"email",type:"email",name:"email",autoComplete:"email",value:o.email,className:"mt-1 block w-full",readOnly:!0,onChange:n=>a("email",n.target.value)}),ne(T,{message:i.email,className:"mt-2"})]}),It("div",{className:"grid gap-2",children:[ne(w,{htmlFor:"password",children:"Password"}),ne(re,{id:"password",type:"password",name:"password",autoComplete:"new-password",value:o.password,className:"mt-1 block w-full",autoFocus:!0,onChange:n=>a("password",n.target.value),placeholder:"Password"}),ne(T,{message:i.password})]}),It("div",{className:"grid gap-2",children:[ne(w,{htmlFor:"password_confirmation",children:"Confirm password"}),ne(re,{id:"password_confirmation",type:"password",name:"password_confirmation",autoComplete:"new-password",value:o.password_confirmation,className:"mt-1 block w-full",onChange:n=>a("password_confirmation",n.target.value),placeholder:"Confirm password"}),ne(T,{message:i.password_confirmation,className:"mt-2"})]}),It(u,{type:"submit",className:"mt-4 w-full",disabled:s,children:[s&&ne(l,{iconName:"IconLoader2",className:"h-4 w-4 animate-spin"}),"Reset password"]})]})})},Gs=({token:e,email:t})=>ne(Ks,{token:e,email:t}),Uu=({token:e,email:t})=>It(be,{title:"Reset password",description:"Please enter your new password below",children:[ne($s,{title:"Reset password"}),ne(Gs,{token:e,email:t})]});import{useState as Zs}from"react";import{Head as Js}from"@inertiajs/react";import{IconLoader2 as Qs,IconMail as Xs,IconUserCircle as Ys}from"@tabler/icons-react";import{jsx as F,jsxs as xe}from"react/jsx-runtime";var Qa=()=>{let{data:e,setData:t,submit:o,processing:a,errors:r}=or();return xe("form",{className:"flex flex-col gap-6",onSubmit:o,children:[xe("div",{className:"grid gap-6",children:[xe("div",{className:"grid gap-2",children:[F(w,{htmlFor:"name",children:"Name"}),xe("div",{className:"group relative",children:[F(E,{id:"name",type:"text",required:!0,autoFocus:!0,tabIndex:1,autoComplete:"name",value:e.name,onChange:s=>t("name",s.target.value),disabled:a,placeholder:"Full name","aria-invalid":!!r.name,className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1"}),F("div",{className:"text-muted-foreground/80 absolute inset-y-0 start-0 flex items-center justify-center ps-3",children:F(Ys,{size:16})})]}),F(T,{message:r.name,className:"mt-2"})]}),xe("div",{className:"grid gap-2",children:[F(w,{htmlFor:"email",children:"Email address"}),xe("div",{className:"group relative",children:[F(E,{id:"email",type:"email",required:!0,tabIndex:2,autoComplete:"email",value:e.email,onChange:s=>t("email",s.target.value),disabled:a,placeholder:"email@example.com","aria-invalid":!!r.email,className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1"}),F("div",{className:"text-muted-foreground/80 absolute inset-y-0 start-0 flex items-center justify-center ps-3",children:F(Xs,{size:16})})]}),F(T,{message:r.email})]}),xe("div",{className:"grid gap-2",children:[F(w,{htmlFor:"password",children:"Password"}),F(re,{id:"password",type:"password",required:!0,tabIndex:3,autoComplete:"new-password",value:e.password,onChange:s=>t("password",s.target.value),disabled:a,placeholder:"Password","aria-invalid":!!r.password,className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1"}),F(T,{message:r.password})]}),xe("div",{className:"grid gap-2",children:[F(w,{htmlFor:"password_confirmation",children:"Confirm password"}),F(re,{id:"password_confirmation",type:"password",required:!0,tabIndex:4,autoComplete:"new-password",value:e.password_confirmation,onChange:s=>t("password_confirmation",s.target.value),disabled:a,placeholder:"Confirm password","aria-invalid":!!r.password_confirmation,className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1"}),F(T,{message:r.password_confirmation})]}),xe(u,{type:"submit",className:"mt-2 w-full",tabIndex:5,disabled:a,children:[a&&F(Qs,{className:"h-4 w-4 animate-spin"}),"Create account"]})]}),xe("div",{className:"text-muted-foreground text-center text-sm",children:["Already have an account?"," ",F(Oe,{href:route("login"),tabIndex:6,children:"Log in"})]})]})},lp=()=>{let[e,t]=Zs(!1);return F(Se,{open:e,onOpenChange:t,children:F(Pe,{children:F(Qa,{})})})},cp=()=>F(Qa,{}),dp=()=>xe(be,{title:"Create an account",description:"Enter your details below to create your account",children:[F(Js,{title:"Register"}),F(Qa,{})]});import{IconEye as js,IconEyeOff as ei}from"@tabler/icons-react";import{useState as ti}from"react";import{jsx as Tt,jsxs as ai}from"react/jsx-runtime";var re=({className:e,...t})=>{let[o,a]=ti(!0);return ai("div",{className:"group relative",children:[Tt(E,{id:"password",type:o?"password":"text",name:"password",placeholder:"Password",autoComplete:"current-password",autoFocus:!0,className:e,...t}),Tt("div",{className:"text-muted-foreground/80 absolute inset-y-0 start-0 flex items-center justify-center ps-3 shrink-0",children:Tt(l,{iconName:"IconLockCode",size:16})}),Tt("div",{className:"text-muted-foreground hover:text-primary absolute inset-y-0 end-0 flex items-center justify-center pr-3 shrink-0 cursor-pointer",onClick:()=>a(r=>!r),children:o?Tt(js,{size:18}):Tt(ei,{size:18})})]})};import{Link as va,usePage as oi}from"@inertiajs/react";import{jsx as L,jsxs as ue}from"react/jsx-runtime";var be=({children:e,title:t,description:o,variant:a="simple",...r})=>ue(ba,{children:[L(ga,{}),a==="simple"?L(ni,{children:e,title:t,description:o,...r}):a==="card"?L(ri,{children:e,title:t,description:o,...r}):a==="split"?L(si,{children:e,title:t,description:o,...r}):null]}),ri=({children:e,title:t,description:o})=>L("div",{className:"bg-muted flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10",children:ue("div",{className:"flex w-full max-w-md flex-col gap-6",children:[L(va,{href:route("home"),className:"flex items-center gap-2 self-center font-medium",children:L("div",{className:"mb-1 flex lg:w-[200px] w-[150px] items-center justify-center rounded-md",children:L(Ee,{})})}),L("div",{className:"flex flex-col gap-6",children:ue(W,{className:"rounded-xl",children:[ue(Q,{className:"px-10 pt-8 pb-0 text-center",children:[L(tt,{className:"text-xl",children:t}),L(ia,{children:o})]}),L(K,{className:"px-10 py-8",children:e})]})})]})}),ni=({children:e,title:t,description:o})=>L("div",{className:"bg-background flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10",children:L("div",{className:"w-full max-w-sm",children:ue("div",{className:"flex flex-col gap-8",children:[ue("div",{className:"flex flex-col items-center gap-4",children:[ue(va,{href:route("home"),className:"flex flex-col items-center gap-2 font-medium",children:[L("div",{className:"mb-1 flex lg:w-[200px] w-[150px] items-center justify-center rounded-md",children:L(Ee,{})}),L("span",{className:"sr-only",children:t})]}),ue("div",{className:"space-y-2 text-center",children:[L("h1",{className:"text-xl font-medium",children:t}),L("p",{className:"text-muted-foreground text-center text-sm",children:o})]})]}),e]})})}),si=({children:e,title:t,description:o})=>{let{name:a}=oi().props;return ue("div",{className:"relative grid h-dvh flex-col items-center justify-center px-8 sm:px-0 lg:max-w-none lg:grid-cols-2 lg:px-0",children:[ue("div",{className:"bg-muted relative hidden h-full flex-col p-10 text-white lg:flex dark:border-r",children:[L("div",{className:"absolute inset-0 bg-zinc-900"}),ue(va,{href:route("home"),className:"relative z-20 flex items-center text-lg font-medium",children:[L(Ee,{className:"mr-2 size-8 fill-current text-white"}),a]})]}),L("div",{className:"w-full lg:p-8",children:ue("div",{className:"mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px]",children:[L(va,{href:route("home"),className:"relative z-20 flex items-center justify-center lg:hidden",children:L(Ee,{className:"h-10 fill-current text-black sm:h-12"})}),ue("div",{className:"flex flex-col items-start gap-2 text-left sm:items-center sm:text-center",children:[L("h1",{className:"text-xl font-medium",children:t}),L("p",{className:"text-muted-foreground text-sm text-balance",children:o})]}),e]})})]})};import{Head as ii}from"@inertiajs/react";import{Fragment as di,jsx as Dt,jsxs as ha}from"react/jsx-runtime";var li=({status:e})=>{let{submit:t,processing:o}=sr();return ha(di,{children:[e==="verification-link-sent"&&Dt("div",{className:"mb-4 text-center text-sm font-medium text-green-600",children:"A new verification link has been sent to the email address you provided during registration."}),ha("form",{onSubmit:t,className:"space-y-6 text-center",children:[ha(u,{disabled:o,variant:"secondary",children:[o&&Dt(l,{iconName:"IconLoader2",className:"h-4 w-4 animate-spin"}),"Resend verification email"]}),Dt(Oe,{href:route("logout"),method:"post",className:"mx-auto block text-sm",children:"Log out"})]})]})},ci=({status:e})=>Dt(li,{status:e}),_p=({status:e})=>ha(be,{title:"Verify email",description:"Please verify your email address by clicking on the link we just emailed to you.",children:[Dt(ii,{title:"Email verification"}),Dt(ci,{status:e})]});import{jsx as he,jsxs as zt}from"react/jsx-runtime";var nn=()=>{let e=Ce(),t=rn(null),o=rn(null),{data:a,setData:r,errors:s,put:i,reset:n,processing:c,recentlySuccessful:m}=mi({current_password:"",password:"",password_confirmation:""});return zt("form",{onSubmit:p=>{p.preventDefault(),i(route("user.password.update"),{preserveScroll:!0,onSuccess:()=>{H("success",e),n()},onError:h=>{H("error",e),h.password&&(ui.error(h.password),n("password","password_confirmation"),t.current?.focus()),h.current_password&&(n("current_password"),o.current?.focus())}})},className:"space-y-6",children:[zt("div",{className:"grid gap-2",children:[he(w,{htmlFor:"current_password",children:"Current Password"}),he(re,{id:"current_password",type:"password",required:!0,value:a.current_password,onChange:p=>r("current_password",p.target.value),placeholder:"Current password",className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1",autoComplete:"off"}),he(T,{className:"mt-2",message:s.current_password})]}),zt("div",{className:"grid gap-2",children:[he(w,{htmlFor:"password",children:"New Password"}),he(re,{id:"password",type:"password",required:!0,value:a.password,onChange:p=>r("password",p.target.value),placeholder:"New password",className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1",autoComplete:"off"}),he(T,{className:"mt-2",message:s.password})]}),zt("div",{className:"grid gap-2",children:[he(w,{htmlFor:"password_confirmation",children:"Confirm Password"}),he(re,{id:"password_confirmation",type:"password",required:!0,value:a.password_confirmation,onChange:p=>r("password_confirmation",p.target.value),placeholder:"Confirm password",className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1",autoComplete:"off"}),he(T,{className:"mt-2",message:s.password_confirmation})]}),he("div",{className:"grid gap-4",children:zt(ua,{processing:c,recentlySuccessful:m,successText:"Password saved!",children:[he(l,{iconName:"IconDeviceFloppy"}),he("span",{children:"Save Password"})]})})]})};import{Head as pi}from"@inertiajs/react";import{jsx as it,jsxs as Xa}from"react/jsx-runtime";var df=()=>Xa(Me,{breadcrumbs:[{title:"Edit Password",href:route("user.password.edit"),icon:"IconKey"}],children:[it(pi,{title:"Edit Password"}),Xa("div",{className:"grid grid-cols-[2fr_4fr] gap-12",children:[it(Ot,{}),Xa(W,{children:[it(Q,{children:it(oe,{icon:it(l,{iconName:"IconLock"}),title:"Edit Password",description:"Update your password to keep your account secure"})}),it(K,{children:it(nn,{})})]})]})]});import{useForm as fi}from"@inertiajs/react";import{useRef as gi}from"react";import{toast as bi}from"sonner";import{jsx as se,jsxs as Xe}from"react/jsx-runtime";var Ya=()=>{let e=Ce(),t=gi(null),{data:o,setData:a,delete:r,processing:s,reset:i,errors:n,clearErrors:c}=fi({password:""}),m=p=>{p.preventDefault(),bi.promise(new Promise((h,D)=>{r(route("profile.destroy"),{preserveScroll:!0,onSuccess:()=>(h(!0),g(),H("success",e)),onError:()=>(D(!1),t.current?.focus(),H("error",e)),onFinish:()=>i()})}))},g=()=>{c(),i()};return Xe("div",{className:"space-y-6",children:[se(ir,{title:"Delete account",description:"Delete your account and all of its resources"}),Xe("div",{className:"space-y-4 rounded-lg border border-red-100 bg-red-50 p-4 dark:border-red-200/10 dark:bg-red-700/10",children:[Xe("div",{className:"relative space-y-0.5 text-red-600 dark:text-red-100",children:[se("p",{className:"font-medium",children:"Warning"}),se("p",{className:"text-sm",children:"Please proceed with caution, this cannot be undone."})]}),Xe(Se,{children:[se(wt,{asChild:!0,children:se(u,{variant:"destructive",children:"Delete account"})}),Xe(Pe,{children:[se(Yo,{children:"Are you sure you want to delete your account?"}),se(jo,{children:"Once your account is deleted, all of its resources and data will also be permanently deleted. Please enter your password to confirm you would like to permanently delete your account."}),Xe("form",{className:"space-y-6",onSubmit:m,children:[Xe("div",{className:"grid gap-2",children:[se(w,{htmlFor:"password",className:"sr-only",children:"Password"}),se(E,{id:"password",type:"password",name:"password",ref:t,value:o.password,onChange:p=>a("password",p.target.value),placeholder:"Password",autoComplete:"current-password"}),se(T,{message:n.password})]}),Xe(sa,{className:"gap-2",children:[se(Qo,{asChild:!0,children:se(u,{variant:"secondary",onClick:g,children:"Cancel"})}),se(u,{variant:"destructive",disabled:s,asChild:!0,children:se("button",{type:"submit",children:"Delete account"})})]})]})]})]})]})]})};import{Head as vi}from"@inertiajs/react";import{jsx as Ie,jsxs as sn}from"react/jsx-runtime";var Lf=()=>sn(Me,{children:[Ie(vi,{title:"Delete Account"}),Ie("div",{className:"max-w-7xl mx-auto space-y-8 my-8",children:sn(W,{children:[Ie(Q,{children:Ie(oe,{icon:Ie(l,{iconName:"IconDelete"}),title:"Delete Account",description:"Permanently delete your account and all associated data"})}),Ie(K,{children:Ie(Ya,{})})]})}),Ie("div",{className:"bg-card rounded-lg border border-destructive/20 p-6 shadow-sm",children:Ie("div",{className:"space-y-4",children:Ie(Ya,{})})})]});import{Link as ln,router as hi,usePage as cn}from"@inertiajs/react";import{useEffect as xi,useState as At}from"react";import Ni from"react-easy-crop";import{toast as yi}from"sonner";import{Fragment as Ht,jsx as v,jsxs as Z}from"react/jsx-runtime";var wi=({image:e,isOpen:t,setIsOpen:o,onSave:a})=>{let[r,s]=At({x:0,y:0}),[i,n]=At(1),[c,m]=At(e),[g,p]=At(null);return xi(()=>{m(e),s({x:0,y:0}),n(1),p(null)},[e,t]),v(Se,{open:t,onOpenChange:o,children:Z(Pe,{className:"max-h-[75vh] sm:max-w-[50vw] xl:max-w-[50vw] min-h-[50vh] grid !gap-4 overflow-auto",children:[Z(Xo,{className:"flex items-center gap-2",children:[v(l,{iconName:"IconCrop"}),v("span",{className:"text-lg",children:"Crop Avatar"})]}),v("div",{className:"grid",children:v("div",{className:"relative flex-1 bg-neutral-900 aspect-square w-full h-auto border max-h-[60vh] min-h-[200px] sm:min-h-[400px] ",children:v(Ni,{image:c,crop:r,zoom:i,aspect:1,zoomSpeed:.1,onCropChange:s,onZoomChange:n,onCropComplete:(D,b)=>p(b)})})}),Z(sa,{children:[v(u,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),v(u,{onClick:async()=>{if(!c||!g)return;let D=await lr(c,g);a(D),o(!1)},disabled:!g,children:"Save"})]})]})})},Ot=({className:e})=>{let{auth:t}=cn().props,[o,a]=At(t?.user?.avatar||""),[r,s]=At(!1),i=Ce(),n=new Date().getHours();return v(Ht,{children:v(W,{className:d("",e),children:Z(K,{className:"grid grid-cols-1 gap-7",children:[v("div",{className:"text-xl text-center",children:n>=5&&n<11?Z(Ht,{children:["\u{1F304} Good morning ",v("span",{className:"font-bold",children:t.user.name}),"!"]}):n>=11&&n<17?Z(Ht,{children:["\u2600\uFE0F Good afternoon ",v("span",{className:"font-bold",children:t.user.name}),"!"]}):n>=17&&n<21?Z(Ht,{children:["\u{1F307} Good evening ",v("span",{className:"font-bold",children:t.user.name}),"!"]}):Z(Ht,{children:["\u{1F319} Good night ",v("span",{className:"font-bold",children:t.user.name}),"!"]})}),v("div",{className:d("mx-auto max-w-[250px] w-full h-auto aspect-[1/1] flex items-center cursor-pointer object-fit transition-all hover:scale-105 duration-300 bg-accent/25 rounded-md border",t.user.avatar?"":"border-[1.5px] border-dashed rounded-md"),onClick:()=>{document.querySelector("#user-avatar")?.click()},style:t.user.avatar?{backgroundImage:`url(${_e(t.user.avatar)})`,backgroundSize:"cover"}:{},children:!t.user.avatar&&v(l,{className:"mx-auto h-8 w-8",iconName:"IconUpload"})}),Z("div",{className:"grid text-center",children:[v("div",{className:"mx-auto flex items-center gap-2",children:v("span",{className:"text-xl font-bold truncate",children:t.user.name+(t.user?.surname?" "+t.user.surname:"")})}),v("span",{className:"text-sm text-muted-foreground",children:t.user.email})]}),v("input",{id:"user-avatar",hidden:!0,type:"file",accept:"image/*",onChange:c=>{let m=c.target.files?.[0];if(!m){c.currentTarget.value="";return}a(URL.createObjectURL(m)),s(!0),c.currentTarget.value=""}}),v(wi,{image:o,isOpen:r,setIsOpen:s,onSave:c=>{yi.promise(new Promise((m,g)=>{hi.patch(route("user.profile.update"),{avatar:cr(c,"avatar.jpg")},{onSuccess:p=>{H("success",i),m(p)},onError:p=>{H("error",i),g(p)}})}),{loading:"Avatar Updating...",success:"Avatar Updated",error:"Avatar Update Failed"})}})]})})})},Ci=({className:e})=>{let{auth:t}=cn().props,o=[{icon:"IconUser",title:"Name-Surname",value:t.user.name+" "+(t.user?.surname??"")},{icon:"IconMail",title:"Email",value:t.user.email},{icon:"IconPhone",title:"Phone",value:t.user.phone},{icon:"IconUserKey",title:"User Role",value:t.user.role_code},{icon:"IconCalendar",title:"Registered At",value:new Date(t.user.created_at).toLocaleString()},{icon:"IconCalendar",title:"Last Seen At",value:t.user?.last_seen_at?new Date(t.user?.last_seen_at??"").toLocaleString():"Never"}];return Z(W,{className:d("",e),children:[Z(Q,{children:[v(oe,{icon:v(l,{iconName:"IconUser"}),title:"Account Overview",description:"Manage your personal information and account settings"}),v("hr",{className:"mt-2"})]}),Z(K,{className:"grid grid-cols-1 md:grid-cols-3 gap-5",children:[o.map(a=>v(W,{className:"bg-accent/15 transition-all hover:translate-y-[-5px] hover:scale-105 duration-300 cursor-pointer",children:Z(K,{className:"flex items-center gap-2",children:[v(l,{iconName:a.icon,className:"w-6 h-6 shrink-0"}),Z("div",{className:"grid",children:[v("span",{className:"text-sm font-bold truncate",children:a.title}),v("span",{className:"text-xs truncate",children:a.value})]})]})})),v(ln,{className:"col-span-full w-full",href:route("user.profile.edit"),children:Z(u,{variant:"outline",className:"w-full flex items-center gap-2",size:"sm",children:[v(l,{iconName:"IconEdit"}),"Edit Details"]})})]})]})},ki=({className:e})=>v(W,{className:d("",e),children:v(Q,{children:v(oe,{icon:v(l,{iconName:"IconLock"}),title:"Account Security",description:"Manage your account security settings",buttons:v(ln,{href:route("user.password.edit"),className:"w-full md:w-auto",children:Z(u,{variant:"outline",className:"flex items-center gap-2 w-full md:w-auto",children:[v(l,{iconName:"IconKey"}),"Change Password"]})})})})}),dn=()=>Z("div",{className:"grid lg:grid-cols-[2fr_4fr] gap-12",children:[v(Ot,{}),v(Ci,{}),v(ki,{className:"col-span-full"})]});import{Link as Si,useForm as Pi,usePage as Mi}from"@inertiajs/react";import{jsx as _,jsxs as pe}from"react/jsx-runtime";var mn=({mustVerifyEmail:e,status:t})=>{let o=Ce(),{auth:a}=Mi().props,{data:r,setData:s,patch:i,errors:n,processing:c,recentlySuccessful:m}=Pi({name:a.user.name,surname:a.user.surname,email:a.user.email,phone:a.user.phone});return pe("form",{onSubmit:p=>{p.preventDefault(),i(route("user.profile.update"),{preserveScroll:!0,onSuccess:()=>H("success",o),onError:()=>H("error",o)})},className:"space-y-6",children:[pe("div",{className:"grid md:grid-cols-2 gap-2",children:[pe("div",{className:"grid gap-2",children:[_(w,{htmlFor:"name",children:"Name"}),pe("div",{className:"group relative",children:[_(E,{id:"name",type:"text",required:!0,value:r.name,onChange:p=>s("name",p.target.value),placeholder:"Full name",className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1",autoComplete:"off"}),_("div",{className:"text-muted-foreground/80 absolute inset-y-0 start-0 flex items-center justify-center ps-3",children:_(l,{iconName:"IconUser",size:16})})]}),_(T,{className:"mt-2",message:n.name})]}),pe("div",{className:"grid gap-2",children:[_(w,{htmlFor:"surname",children:"Surname"}),pe("div",{className:"group relative",children:[_(E,{id:"surname",type:"text",value:r.surname,onChange:p=>s("surname",p.target.value),placeholder:"Surname",className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1",autoComplete:"off"}),_("div",{className:"text-muted-foreground/80 absolute inset-y-0 start-0 flex items-center justify-center ps-3",children:_(l,{iconName:"IconUser",size:16})})]}),_(T,{className:"mt-2",message:n.surname})]})]}),pe("div",{className:"grid gap-2",children:[_(w,{htmlFor:"email",children:"Email address"}),pe("div",{className:"group relative",children:[_(E,{id:"email",type:"email",required:!0,value:r.email,onChange:p=>s("email",p.target.value),placeholder:"Email address",className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1",autoComplete:"username"}),_("div",{className:"text-muted-foreground/80 absolute inset-y-0 start-0 flex items-center justify-center ps-3",children:_(l,{iconName:"IconMail",size:16})})]}),_(T,{className:"mt-2",message:n.email})]}),pe("div",{className:"grid gap-2",children:[_(w,{htmlFor:"phone",children:"Phone"}),pe("div",{className:"group relative",children:[_(E,{id:"phone",type:"tel",value:r.phone,onChange:p=>s("phone",p.target.value),placeholder:"Phone number",className:"border-0 bg-muted/50 focus-visible:ring-1 px-10 bg-background border-1",autoComplete:"off"}),_("div",{className:"text-muted-foreground/80 absolute inset-y-0 start-0 flex items-center justify-center ps-3",children:_(l,{iconName:"IconPhone",size:16})})]}),_(T,{className:"mt-2",message:n.phone})]}),e&&a.user.email_verified_at===null&&pe("div",{children:[pe("p",{className:"text-muted-foreground -mt-4 text-sm",children:["Your email address is unverified."," ",_(Si,{href:route("verification.send"),method:"post",as:"button",className:"text-foreground underline decoration-neutral-300 underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-neutral-500",children:"Click here to resend the verification email."})]}),t==="verification-link-sent"&&_("div",{className:"mt-2 text-sm font-medium text-green-600",children:"A new verification link has been sent to your email address."})]}),_("div",{className:"grid gap-4",children:pe(ua,{processing:c,recentlySuccessful:m,children:[_(l,{iconName:"IconDeviceFloppy"}),_("span",{children:"Save Profile"})]})})]})};import{Head as Ei}from"@inertiajs/react";import{jsx as Ne,jsxs as xa}from"react/jsx-runtime";var cg=({mustVerifyEmail:e,status:t})=>xa(Me,{breadcrumbs:[{title:"Edit Profile",href:route("user.profile.edit"),icon:"IconEdit"}],children:[Ne(Ei,{title:"Account Settings"}),xa("div",{className:"grid md:grid-cols-[2fr_4fr] gap-12",children:[Ne(Ot,{}),xa(W,{children:[Ne(Q,{children:Ne(oe,{icon:Ne(l,{iconName:"IconUser"}),title:"Profile Information",description:"Update your name and email address"})}),Ne(K,{children:Ne(mn,{mustVerifyEmail:e,status:t})})]}),Ne(W,{className:"col-span-full",children:xa(K,{className:"grid gap-8 md:flex md:items-center",children:[Ne(oe,{icon:Ne(l,{iconName:"IconPalette"}),title:"Appearance",description:"Change your account appearance"}),Ne(Vr,{className:"md:ml-auto"})]})})]})]});import{Head as Ii}from"@inertiajs/react";import{jsx as un,jsxs as Ti}from"react/jsx-runtime";var fg=()=>Ti(Me,{children:[un(Ii,{title:"Account Settings"}),un(dn,{})]});import{Link as fn}from"@inertiajs/react";import{IconEye as Di,IconEyeClosed as Ai}from"@tabler/icons-react";import{Fragment as pn,jsx as C,jsxs as Te}from"react/jsx-runtime";var gn=({notifications:e,unreadNotifications:t})=>C(Na,{notifications:e??[],unreadNotifications:t??0,meta:{per_page:5},children:Te(ee,{trigger:"click",children:[C(te,{children:C(Ri,{})}),C(ae,{className:"w-[400px] min-h-[150px] flex-row gap-5",children:C(Li,{})})]})}),Li=()=>{let{notifications:e}=Lt();return Te(pn,{children:[Te(ke,{className:"flex mx-auto items-center gap-2",children:[C(l,{iconName:"IconBell",size:16}),C("span",{children:"Notifications"})]}),e?.length>0?C(pn,{children:Te("div",{className:"grid gap-3 ",children:[e.slice(0,5).map(t=>{let o=new Date(t?.read_at??"").getTime()>0;return C(ja,{notification:t,children:C("div",{className:d("p-3 py-2 rounded-md hover:scale-103 shadow-sm dark:shadow-accent cursor-pointer animate-in fade-in duration-400",o?"text-muted-foreground":"dark:bg-accent/20 bg-accent"),children:Te("div",{className:"flex items-center gap-3 ",children:[C("div",{className:d("flex h-[5px] w-[5px] rounded-full shrink-0",o?"bg-muted-foreground":"bg-green-500")}),C(eo,{notification:t}),Te("div",{className:"grid gap-1",children:[C("span",{className:"capitalize font-bold truncate",children:t.data.title}),C("p",{className:"text-sm capitalize truncate",children:t.data.message}),C("p",{className:"text-xs text-muted-foreground",children:new Date(t.created_at).toLocaleString()})]}),C(ao,{notification:t,className:"ml-auto w-5 h-5"})]})})},t.id)}),C(fn,{href:route("user.notifications.index"),children:Te(u,{variant:"ghost",className:"w-full flex items-center justify-center",size:"sm",children:[C(l,{iconName:"IconEye",size:20}),C("span",{className:"text-sm",children:"View all"})]})})]})}):C(to,{})]})},ja=({notification:e,children:t})=>{let o=e.data.route_name?route(e.data.route_name,e.data?.payload??[]):"#";return C(fn,{href:o,target:"_blank",children:t},e.id)},eo=({notification:e})=>C(l,{iconName:e.data.icon??"IconBell",className:"shrink-0",size:25}),to=({className:e})=>C("div",{className:d("min-h-[150px] content-center",e),children:Te("div",{className:"text-center text-muted-foreground content-center gap-2",children:[C(l,{iconName:"IconBell",className:"mx-auto mb-2 w-8 h-8"}),C("span",{children:"No new notifications"})]})}),ao=({notification:e,className:t})=>{let o=new Date(e?.read_at??"").getTime()>0,{markAsRead:a}=Lt();return C("div",{className:d("shrink-0",t),onClick:r=>{r.preventDefault(),a(!o,[e.id])},children:Te(ee,{children:[C(te,{children:o?C(Ai,{className:"text-muted-foreground hover:text-primary w-full h-full"}):C(Di,{className:"text-primary w-full h-full"})}),C(ae,{children:o?"Mark as unread":"Mark as read"})]})})},Ri=()=>{let{unreadNotifications:e}=Lt(),t=e||0;return Te(u,{variant:t>0?"outline":"ghost",size:"sm",className:"group hidden sm:flex cursor-pointer flex items-center",children:[C(l,{iconName:"IconBell",className:"!w-[20px] !h-[20px] opacity-80 group-hover:opacity-100"}),C("span",{children:t})]})};import{createContext as _i,useContext as Bi,useEffect as bn,useState as oo}from"react";import{router as ro,usePage as Fi}from"@inertiajs/react";import{toast as vn}from"sonner";import{jsx as lt,jsxs as hn}from"react/jsx-runtime";var xn=_i({}),Na=({notifications:e,unreadNotifications:t,meta:o,children:a})=>{let[r,s]=oo(e??[]),[i,n]=oo(t??0),[c,m]=oo(o??{}),{auth:g,app:p}=Fi().props;bn(()=>{m(o??{})},[o]),bn(()=>!window?.Echo||!g.user?void 0:((window?.Echo?.private(`App.Models.User.${g.user.id}`)).notification(x=>{vn.custom(()=>(H(x.data?.kind??"ntf-general",p.media_base_path),hn("div",{className:"flex items-center gap-3 w-[350px] rounded-lg border bg-background/50 p-3 px-5 shadow-lg",children:[lt(l,{iconName:x.data?.icon??"IconBell",className:"shrink-0"}),hn("div",{className:"grid w-full",children:[lt("p",{className:"font-semibold",children:x.data.title}),lt("p",{className:"text-sm text-muted-foreground",children:x.data.message}),lt("p",{className:"text-xs text-muted-foreground",children:new Date(x.created_at??null).toLocaleString()})]}),x.data?.route_name&<(u,{variant:"outline",className:"ml-auto",size:"sm",onClick:()=>{ro.visit(route(x.data.route_name,x.data.payload??void 0))},children:lt(l,{iconName:"IconArrowRight"})})]})),{id:x.id,duration:5e3,closeButton:!0,richColors:!0}),s(P=>{if(!P)return[x];let k=[x,...P];return c.per_page?k.slice(0,c.per_page):k})}),()=>window?.Echo?.leave(`App.Models.User.${g.user.id}`)),[g?.user?.id,c?.per_page]);let b={notifications:r,setNotifications:s,unreadNotifications:i,setUnreadNotifications:n,meta:c,setMeta:m,markAsRead:(R,x)=>{H("click",p.media_base_path);let P=new Promise((k,Re)=>{ro.post(route("user.notifications.update"),{notification_ids:x==="all"?"all":x,all:x==="all",has_read:R},{replace:!0,preserveScroll:!0,preserveState:!0,onSuccess:()=>{s(j=>{let M=new Date().toISOString();return x==="all"?j.map(ce=>({...ce,read_at:R?M:""})):j.map(ce=>x.includes(ce.id)?{...ce,read_at:R?M:""}:ce)}),k(!0)},onError:j=>{H("alert",p.media_base_path),Re(j)}})});vn.promise(P,{loading:R?"Marking as read...":"Marking as unread...",success:R?"Marked as read":"Marked as unread",error:R?"Failed to mark as read":"Failed to mark as unread"})},loadMore:async R=>new Promise((x,P)=>{ro.get(route("user.notifications.index"),{next_cursor:R??c.next_cursor,feed:1,filter:c.filter},{onSuccess:k=>{s(Re=>[...Re,...k.props.notifications]),m(k.props.meta),x(!0)},only:["notifications","meta"],onError:k=>P(k),preserveScroll:!0,preserveState:!0,preserveUrl:!0,replace:!1})})};return lt(xn.Provider,{value:b,children:a})},Lt=()=>{let e=Bi(xn);if(!e)throw new Error("useNotifications must be used within a NotificationsProvider");return e};import{toast as zi}from"sonner";import{Head as Oi,router as Hi}from"@inertiajs/react";import{IconEye as Ui,IconFilter as Vi}from"@tabler/icons-react";import{Fragment as $i,jsx as z,jsxs as qe}from"react/jsx-runtime";var rb=({notifications:e,meta:t})=>qe(Me,{breadcrumbs:[{icon:"IconBell",title:"Notifications",href:"#"}],children:[z(Oi,{title:"Notifications"}),z(Na,{notifications:e??[],meta:t,children:z(Wi,{})})]}),Wi=()=>{let{notifications:e,setNotifications:t,meta:o,setMeta:a,markAsRead:r,loadMore:s}=Lt(),i=e.filter(n=>!n.read_at).length??0;return qe(_o,{className:"container mx-auto grid gap-4 mb-10",meta:o,onLoad:n=>s(n),noMoreContent:qe("div",{className:"h-8 w-full grid justify-center gap-2 my-5 text-muted-foreground",children:[z(l,{iconName:"IconBell",className:"mx-auto"}),z("span",{children:"No more notifications"})]}),children:[z(oe,{className:"mb-3",icon:z(l,{iconName:"IconBell"}),title:"Your Notifications",description:`You have ${o.total} notifications totally. ${i>0?`${i} unread notifications`:""}`,buttons:qe($i,{children:[qe(u,{variant:"ghost",size:"sm",className:"flex justify-start text-sm items-center gap-2",onClick:()=>r(!0,"all"),children:[z(Ui,{}),"Mark all as read"]}),qe(ee,{trigger:"click",children:[z(te,{children:z(u,{variant:o.filter?"default":"outline",children:z(Vi,{})})}),z(ae,{children:z(aa,{value:o?.filter??"all",onChange:()=>zi.info("test"),children:["all","read","unread"].map(n=>qe(w,{className:"capitalize",onClick:()=>Hi.get(route("user.notifications.index"),{filter:n},{replace:!0,preserveScroll:!0,preserveState:!0,onSuccess:c=>{t(c.props.notifications),a(c.props.meta)},only:["notifications","meta"]}),children:[z(oa,{value:n}),n]}))})})]})]})}),e.length>0?e?.map(n=>z(qi,{notification:n},n.id)):z(to,{})]})},qi=({notification:e,className:t,...o})=>{let a=new Date(e?.read_at??"").getTime()>0;return z(ja,{notification:e,...o,children:z("div",{className:d("p-5 rounded-md hover:scale-103 shadow-sm dark:shadow-accent cursor-pointer animate-in fade-in duration-400",a?"text-muted-foreground":"dark:bg-accent/20 bg-accent",t),children:qe("div",{className:"flex items-center gap-3 ",children:[z("div",{className:d("flex h-[5px] w-[5px] rounded-full shrink-0",a?"bg-muted-foreground":"bg-green-500")}),z(eo,{notification:e}),qe("div",{className:"grid gap-1 px-5",children:[z("span",{className:"capitalize font-bold truncate",children:e.data.title}),z("p",{className:"text-sm capitalize truncate",children:e.data.message}),z("p",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleString()})]}),z(ao,{notification:e,className:"ml-auto"})]})})})};import{Fragment as Ki,jsx as N,jsxs as ye}from"react/jsx-runtime";var ga=({mainMenu:e,rightNavItems:t})=>{let o=Nn().props,{url:a}=Nn(),r=o.auth?.user,s=o.auth?.notifications??[],i=o.auth?.unread_notifications??0;return N(Ki,{children:N("div",{className:"fixed top-0 left-0 right-0 z-10 backdrop-blur-sm border-sidebar-border/100 border-b",children:ye("div",{className:"mx-auto flex h-16 items-center px-4 md:max-w-7xl",children:[N("div",{className:"lg:hidden",children:ye(Qt,{children:[N(vo,{asChild:!0,children:N(u,{variant:"ghost",size:"icon",className:"mr-2 h-[34px] w-[34px]",children:N(l,{iconName:"IconMenu2",className:"h-5 w-5"})})}),ye(Xt,{side:"left",className:"bg-sidebar flex h-full w-64 flex-col items-stretch justify-between",children:[N(jt,{className:"sr-only",children:"Navigation Menu"}),N(Yt,{className:"flex justify-start text-left",children:N(Ee,{className:"w-[90%]"})}),N(yn,{children:ye(Cn,{children:[e&&N(Ua,{sidebarMenu:yt(e,a)}),ye(wn,{className:"max-w-full gap-0",children:[N(da,{children:"Quick"}),t?.map(n=>N(ot,{children:ye(ya,{href:n.route_name?route(n.route_name,n.payload??{}):"#",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[n.icon&&N(l,{iconName:n.icon,size:16}),N("span",{children:n.title})]},n.title)}))]})]})})]})]})}),N("div",{children:N(Ee,{className:"lg:w-[150px] w-[100px]"})}),e?.items&&e.items.length>0&&ye("div",{className:"ml-6 hidden h-full items-center space-x-6 lg:flex",children:[N(Jt,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),N(Hr,{menuItems:e.items||[]})]}),ye("div",{className:"ml-auto flex items-center space-x-2",children:[N("div",{className:"relative flex items-center space-x-1",children:N("div",{className:"hidden lg:flex",children:t?.map(n=>N(ea,{delayDuration:0,children:ye(ht,{children:[N(xt,{children:ye(ya,{href:n.route_name?route(n.route_name):"#",target:"_blank",rel:"noopener noreferrer",className:"group text-accent-foreground ring-offset-background hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring ml-1 inline-flex h-9 w-9 items-center justify-center rounded-md bg-transparent p-0 text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",children:[n.title&&N("span",{className:"sr-only",children:n.title}),n.icon&&N(l,{iconName:n.icon,className:"size-5 opacity-80 group-hover:opacity-100"})]})}),N(Nt,{children:N("p",{children:n.title})})]})},n.title))})}),r&&N(gn,{notifications:s??[],unreadNotifications:i??0}),e&&N(la,{placeholder:"Type a command or search...",menu:yt(e,a),children:N(no,{})}),r?N(Zr,{}):ye("div",{className:"flex items-center gap-2",children:[N(u,{asChild:!0,variant:"ghost",size:"sm",className:"text-sm",children:N(ya,{href:"/login",children:"Sign In"})}),N(u,{asChild:!0,size:"sm",className:"text-sm",children:N(ya,{href:"/register",children:"Get Started"})})]}),N(Ur,{className:"w-9 h-9"})]})]})})})};import{Link as Gi,usePage as Zi}from"@inertiajs/react";import{jsx as wa,jsxs as Ji}from"react/jsx-runtime";var Ee=({className:e,link:t,...o})=>{let r=Zi().props?.app?.logos??[];return Ji(({children:i,className:n,...c})=>t?wa(Gi,{href:t,className:n,...c,children:i}):wa("div",{className:n,...c,children:i}),{className:d("p-2 grid flex-1 text-left text-sm lg:w-[150px] w-[100px]",e),...o,children:[wa("img",{src:_e(r?.dark_logo),alt:"Logo",className:"w-full h-full hidden dark:block"}),wa("img",{src:_e(r?.light_logo),alt:"Logo",className:"w-full h-full dark:hidden"})]})};import{usePage as Qi}from"@inertiajs/react";import{toast as so}from"sonner";import{useEffect as Ca}from"react";import{jsx as Ye,jsxs as Yi}from"react/jsx-runtime";var ba=({children:e,className:t,...o})=>{let a=Qi().props;return Ca(()=>{a?.flash?.success&&so.success(a?.flash?.success),a?.flash?.error&&so.error(a?.flash?.error)},[a.flash]),Ca(()=>{a.errors&&Object.values(a.errors).map(r=>{console.log(a.errors),so.error(r)})},[a.errors]),Ca(()=>{a.ziggy&&Object.assign(Ziggy,a.ziggy)},[a.ziggy]),Ca(()=>{if(a.app?.logos?.favicon){let r=document.querySelector("link[rel*='icon']")||document.createElement("link");r.type="image/x-icon",r.rel="shortcut icon",r.href=_e(a.app.logos.favicon,a.app.media_base_path),document.getElementsByTagName("head")[0].appendChild(r)}},[a.app.logos?.favicon]),Yi("div",{className:t,...o,children:[Ye(Xi,{}),e,Ye(dr,{style:{pointerEvents:"auto"},richColors:!0,icons:{success:Ye(l,{iconName:"IconCircleCheckFilled",className:"h-5 w-5"}),error:Ye(l,{iconName:"IconCircleXFilled",className:"animate-shake h-5 w-5"}),warning:Ye(l,{iconName:"IconAlertCircleFilled",className:"animate-bounce h-5 w-5"}),info:Ye(l,{iconName:"IconInfoCircleFilled",className:"animate-pulse h-5 w-5"}),loading:Ye(l,{iconName:"IconLoader2",className:"animate-spin h-5 w-5"})}})]})},Xi=()=>go.all().map((t,o)=>Ye(t,{},o));import{IconLoader2 as el}from"@tabler/icons-react";import{jsx as io,jsxs as tl}from"react/jsx-runtime";var jr=()=>{let e=ji().props;return io("div",{className:"w-full h-[100vh] justify-center items-center grid",children:tl("div",{children:[io(Ee,{className:"lg:w-[250px] mx-auto mb-5"}),io(el,{className:"animate-spin mx-auto w-8 h-8"})]})})};import{EditorContent as il,useEditor as ll}from"@tiptap/react";import cl from"@tiptap/extension-link";import dl from"@tiptap/extension-placeholder";import ml from"@tiptap/extension-underline";import ul from"@tiptap/starter-kit";import{useEffect as dt,useMemo as pl,useRef as fl}from"react";import{useEditorState as al}from"@tiptap/react";import{useEffect as ol,useState as rl}from"react";import{jsx as S,jsxs as ct}from"react/jsx-runtime";var nl=e=>{let t=e.trim();if(!t)return null;let o=t.toLowerCase();return o.startsWith("javascript:")||o.startsWith("data:")?null:t.startsWith("/")||t.startsWith("#")||o.startsWith("mailto:")||o.startsWith("http://")||o.startsWith("https://")?t:`https://${t}`},ie=({label:e,iconName:t,text:o,pressed:a=!1,disabled:r=!1,onPressedChange:s,withTooltip:i=!0})=>{let n=ct(mr,{size:"sm",variant:"outline","aria-label":e,"aria-pressed":a,pressed:a,disabled:r,onPressedChange:s,className:d("h-8 min-w-8 px-2",a&&"bg-accent text-accent-foreground"),children:[t&&S(l,{iconName:t,className:"h-4 w-4"}),o&&S("span",{className:"text-xs font-semibold",children:o})]});return i?ct(ht,{children:[S(xt,{asChild:!0,children:n}),S(Nt,{children:e})]}):n},sl=({editor:e,disabled:t=!1,href:o,pressed:a=!1})=>{let[r,s]=rl(o);ol(()=>{s(o)},[o]);let i=c=>{let m=nl(c);m&&e.chain().focus().extendMarkRange("link").setLink({href:m,target:m.startsWith("mailto:")?null:"_blank",rel:m.startsWith("mailto:")?null:"noopener noreferrer nofollow"}).run()};return ct(ee,{trigger:"click",isActive:!t,children:[S(te,{children:S(ie,{label:"Link",iconName:"IconLink",pressed:a,disabled:t,withTooltip:!1})}),ct(ae,{className:"w-[320px]",children:[S(ke,{children:"Link"}),ct("div",{className:"grid gap-3",children:[S(E,{type:"url",value:r,placeholder:"https://example.com",onChange:c=>s(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),i(c.currentTarget.value))}}),ct("div",{className:"flex items-center justify-end gap-2",children:[S(u,{type:"button",size:"sm",variant:"outline",onClick:()=>{e.chain().focus().extendMarkRange("link").unsetLink().run()},disabled:!o,children:"Remove"}),S(u,{type:"button",size:"sm",onClick:()=>i(r),children:"Apply"})]})]})]})]})},kn=({editor:e,disabled:t=!1})=>{let o=al({editor:e,selector:({editor:a})=>({isBold:a?.isActive("bold")??!1,isItalic:a?.isActive("italic")??!1,isUnderline:a?.isActive("underline")??!1,isStrike:a?.isActive("strike")??!1,isParagraph:a?.isActive("paragraph")??!1,isHeading2:a?.isActive("heading",{level:2})??!1,isHeading3:a?.isActive("heading",{level:3})??!1,isBulletList:a?.isActive("bulletList")??!1,isOrderedList:a?.isActive("orderedList")??!1,isBlockquote:a?.isActive("blockquote")??!1,isCodeBlock:a?.isActive("codeBlock")??!1,isLink:a?.isActive("link")??!1,linkHref:a?.getAttributes("link").href??"",canUndo:a?.can().chain().focus().undo().run()??!1,canRedo:a?.can().chain().focus().redo().run()??!1})});return ct("div",{className:"flex flex-wrap items-center justify-center gap-1.5 border-b px-3 py-2",children:[S(ie,{label:"Undo",iconName:"IconArrowBackUp",disabled:t||!o.canUndo,onPressedChange:()=>e.chain().focus().undo().run()}),S(ie,{label:"Redo",iconName:"IconArrowForwardUp",disabled:t||!o.canRedo,onPressedChange:()=>e.chain().focus().redo().run()}),S("div",{className:"mx-0.5 w-[1px] h-[18px] bg-accent"}),S(ie,{label:"Bold",iconName:"IconBold",pressed:o.isBold,disabled:t,onPressedChange:()=>e.chain().focus().toggleBold().run()}),S(ie,{label:"Italic",iconName:"IconItalic",pressed:o.isItalic,disabled:t,onPressedChange:()=>e.chain().focus().toggleItalic().run()}),S(ie,{label:"Underline",iconName:"IconUnderline",pressed:o.isUnderline,disabled:t,onPressedChange:()=>e.chain().focus().toggleUnderline().run()}),S(ie,{label:"Strike",iconName:"IconStrikethrough",pressed:o.isStrike,disabled:t,onPressedChange:()=>e.chain().focus().toggleStrike().run()}),S("div",{className:"mx-0.5 w-[1px] h-[18px] bg-accent"}),S(ie,{label:"Paragraph",text:"P",pressed:o.isParagraph,disabled:t,onPressedChange:()=>e.chain().focus().setParagraph().run()}),S(ie,{label:"Heading 2",text:"H2",pressed:o.isHeading2,disabled:t,onPressedChange:()=>e.chain().focus().toggleHeading({level:2}).run()}),S(ie,{label:"Heading 3",text:"H3",pressed:o.isHeading3,disabled:t,onPressedChange:()=>e.chain().focus().toggleHeading({level:3}).run()}),S("div",{className:"mx-0.5 w-[1px] h-[18px] bg-accent"}),S(ie,{label:"Bullet list",iconName:"IconList",pressed:o.isBulletList,disabled:t,onPressedChange:()=>e.chain().focus().toggleBulletList().run()}),S(ie,{label:"Ordered list",iconName:"IconListNumbers",pressed:o.isOrderedList,disabled:t,onPressedChange:()=>e.chain().focus().toggleOrderedList().run()}),S("div",{className:"mx-0.5 w-[1px] h-[18px] bg-accent"}),S(ie,{label:"Blockquote",iconName:"IconBlockquote",pressed:o.isBlockquote,disabled:t,onPressedChange:()=>e.chain().focus().toggleBlockquote().run()}),S(ie,{label:"Code block",iconName:"IconCode",pressed:o.isCodeBlock,disabled:t,onPressedChange:()=>e.chain().focus().toggleCodeBlock().run()}),S("div",{className:"mx-0.5 w-[1px] h-[18px] bg-accent"}),S(sl,{editor:e,disabled:t,href:o.linkHref,pressed:o.isLink})]})};import{jsx as mt,jsxs as vl}from"react/jsx-runtime";var Ut={type:"doc",content:[{type:"paragraph"}]},Sn=({editor:e,disabled:t=!1,readOnly:o=!1,showToolbar:a=!0,className:r,contentClassName:s})=>vl("div",{className:d("flex min-h-0 flex-col overflow-hidden rounded-lg border bg-background","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",t&&"cursor-not-allowed opacity-70",r),children:[a&&!o&&e&&mt(kn,{editor:e,disabled:t}),mt("div",{className:d("min-h-0 overflow-y-auto",s),children:mt(il,{editor:e})})]}),gl=({value:e,defaultValue:t,onChange:o,onEditorReady:a,placeholder:r="Write something...",disabled:s=!1,readOnly:i=!1,showToolbar:n=!0,className:c,contentClassName:m})=>{let g=fl(e??t??Ut),p=pl(()=>[ul.configure({heading:{levels:[2,3]}}),ml,dl.configure({placeholder:r}),cl.configure({openOnClick:!1,autolink:!0,linkOnPaste:!0,protocols:["http","https","mailto"],HTMLAttributes:{rel:"noopener noreferrer nofollow",target:"_blank"},isAllowedUri:(b,R)=>{let x=b.trim().toLowerCase();return x.startsWith("javascript:")||x.startsWith("data:")?!1:x.startsWith("/")||x.startsWith("#")?!0:R.defaultValidate(b)}})],[r]),h=ll({immediatelyRender:!1,shouldRerenderOnTransaction:!1,extensions:p,content:g.current,editable:!(s||i),onUpdate:({editor:b})=>{o?.(b.getJSON())},editorProps:{attributes:{class:d("ProseMirror min-h-[220px] w-full px-4 py-3 text-sm outline-none","[&_h2]:mb-3 [&_h2]:text-xl [&_h2]:font-semibold","[&_h3]:mb-3 [&_h3]:text-lg [&_h3]:font-semibold","[&_p]:my-2 [&_ul]:my-3 [&_ol]:my-3","[&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5","[&_blockquote]:my-4 [&_blockquote]:border-l-2 [&_blockquote]:pl-4 [&_blockquote]:text-muted-foreground","[&_pre]:my-4 [&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:border [&_pre]:bg-muted [&_pre]:px-3 [&_pre]:py-2","[&_code]:rounded-sm [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5","[&_pre_code]:bg-transparent [&_pre_code]:p-0","[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-4","empty:before:pointer-events-none empty:before:text-muted-foreground/70 empty:before:content-[attr(data-placeholder)]")}}}),D=JSON.stringify(e??Ut);return dt(()=>{if(!h||e===void 0)return;JSON.stringify(h.getJSON())!==D&&h.commands.setContent(e??Ut,{emitUpdate:!1})},[h,D,e]),dt(()=>{h&&h.setEditable(!(s||i))},[s,h,i]),dt(()=>{if(!(!h||!a))return a(h),()=>{a(null)}},[h,a]),mt(Sn,{editor:h,disabled:s,readOnly:i,showToolbar:n,className:c,contentClassName:m})},bl=({editor:e,value:t,onChange:o,onEditorReady:a,disabled:r=!1,readOnly:s=!1,showToolbar:i=!0,className:n,contentClassName:c})=>{let m=JSON.stringify(t??Ut);return dt(()=>{if(!e){a?.(null);return}return a?.(e),()=>{a?.(null)}},[e,a]),dt(()=>{e&&e.setEditable(!(r||s))},[r,e,s]),dt(()=>{if(!e||!o)return;let g=()=>{o(e.getJSON())};return e.on("update",g),()=>{e.off("update",g)}},[e,o]),dt(()=>{if(!e||t===void 0)return;JSON.stringify(e.getJSON())!==m&&e.commands.setContent(t??Ut,{emitUpdate:!1})},[e,m,t]),mt(Sn,{editor:e,disabled:r,readOnly:s,showToolbar:i,className:n,contentClassName:c})},fv=({editor:e,...t})=>e!==void 0?mt(bl,{editor:e,...t}):mt(gl,{...t});import{useEffect as Pn}from"react";import{router as hl}from"@inertiajs/react";import{jsx as De,jsxs as Rt}from"react/jsx-runtime";var kv=({placeholder:e,menu:t,openShortcutKey:o="q"})=>Rt(la,{placeholder:e,menu:t,openShortcutKey:o,children:[De(xl,{}),De(no,{})]}),no=()=>{let{isCommandModalOpen:e,setIsCommandModalOpen:t,placeholder:o,menu:a,openShortcutKey:r}=Ba(),s=n=>{!n.action&&!n.route_name||(t(!1),n.action&&typeof n.action=="function"?setTimeout(()=>n.action?.(),100):n.route_name&&hl.visit(route(n.route_name,n.payload??[])))};if(Pn(()=>{let n=c=>{(c.metaKey||c.ctrlKey)&&c.key.toLowerCase()===r.toLowerCase()&&(c.preventDefault(),t(m=>!m))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[r,t]),Pn(()=>{if(!a||!Array.isArray(a)||a.length===0)return;let n=c=>pr(c,a);return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[a]),!a||!Array.isArray(a)||a.length===0)return null;let i=ur(a);return Rt(fr,{open:e,onOpenChange:t,children:[De(gr,{placeholder:o}),Rt(br,{children:[De(vr,{children:"No results found."}),Object.entries(i).map(([n,c])=>De(hr,{heading:n,children:c.map((m,g)=>(m.action||m.route_name)&&Rt(xr,{onSelect:()=>s(m),children:[m.icon&&De(l,{iconName:m.icon}),De("span",{children:m?.title||"Item"}),m?.shortcutLabel&&De(Nr,{children:String(m.shortcutLabel)})]},`${n}-${m?.title||g}`))},n))]})]})},xl=()=>{let{setIsCommandModalOpen:e,openShortcutKey:t}=Ba();return De(u,{variant:"outline",asChild:!0,size:"sm",className:"hidden sm:flex cursor-pointer",onClick:()=>e(!0),children:Rt("p",{className:"text-sm text-muted-foreground",children:["Quick Action",De("kbd",{className:"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100",children:Rt("span",{className:"text-xs",children:["\u2318 + ",t.toUpperCase()]})})]})})};import{jsx as Ae,jsxs as Mn}from"react/jsx-runtime";var $r=({title:e="Role Title",icon:t=null,color:o="#6a1717ff",badge_type:a="default"})=>a=="default"?Mn(Ze,{variant:"default",color:o??"default",className:"gap-1",style:{backgroundColor:o??"default"},children:[t&&Ae(l,{iconName:t,className:"text-white"}),Ae("span",{className:"text-white",children:e})]}):a=="outline"?Mn(Ze,{variant:"outline",color:o??"default",className:"gap-1",children:[t&&Ae(l,{iconName:t,color:o??"default"}),Ae("span",{children:e})]}):a=="icon"?Ae(Ze,{variant:"outline",color:o??"default",className:"aspect-1/1 rounded-full p-1",style:{backgroundColor:o??"default"},children:t&&Ae(l,{iconName:t,className:"text-white"})}):a=="icon2"?Ae(Ze,{variant:"outline",color:o??"default",className:"aspect-1/1 rounded-full p-1",children:t&&Ae(l,{iconName:t,color:o??"default"})}):a=="icon3"?Ae(Ze,{variant:"outline",color:o??"default",className:"aspect-1/1 rounded-full p-1",children:t&&Ae(l,{iconName:t,color:o??"default"})}):null;import{jsx as ka,jsxs as En}from"react/jsx-runtime";var zv=({title:e,icon:t,children:o})=>En(W,{children:[ka(Q,{children:En(tt,{className:"flex items-center",children:[t&&(typeof t=="string"?ka(l,{iconName:t,className:"h-4 w-4 mr-2 text-muted-foreground"}):t),e&&typeof e=="string"?ka("span",{className:"text-xl",children:e}):e]})}),ka(K,{children:o})]});import{jsx as Le,jsxs as ut}from"react/jsx-runtime";var qv=(e,...t)=>ut(W,{className:"gap-2",...t,children:[ut(Q,{className:"flex items-center gap-2 pb-2",children:[typeof e.icon=="string"?Le(l,{iconName:e.icon,className:"shrink-0 w-5 h-5 text-muted-foreground"}):e.icon,Le(tt,{className:"text-sm font-medium truncate",children:e.title})]}),ut(K,{children:[Le("div",{className:"text-2xl font-bold",children:e.value}),e.subtext&&Le("p",{className:"text-xs text-muted-foreground",children:e.subtext})]})]}),$v=(e,...t)=>ut(W,{className:"gap-2",...t,children:[ut(Q,{children:[Le(ia,{children:e.title}),Le(tt,{className:"text-2xl font-semibold tabular-nums @[250px]/card:text-3xl",children:e.value}),Le(rr,{children:ut(Ze,{variant:"outline",children:[Le(l,{iconName:Number(e.percentage)>0?"IconTrendingDown":"IconTrendingUp",className:"shrink-0"}),Number(e.percentage)>0?`-${e.percentage}%`:`${e.percentage}%`]})})]}),ut(nr,{className:"flex-col items-start gap-1.5 text-sm",children:[Le("div",{className:"line-clamp-1 flex gap-2 font-medium",children:e.description}),Le("div",{className:"text-muted-foreground",children:e.subdescription})]})]});import{jsx as lo,jsxs as Nl}from"react/jsx-runtime";var gh=({data:e,columns:t,meta:o,bulkActions:a=[],handleRequest:r,deletedIds:s=[],newIds:i=[],updatedIds:n=[],rowIdField:c="id"})=>Nl(An,{data:e,columns:t,meta:o,bulkActions:a,handleRequest:r,deletedIds:s,newIds:i,updatedIds:n,rowIdField:c,children:[lo(Dn,{}),lo(In,{}),lo(Tn,{})]});import{flexRender as Ln}from"@tanstack/react-table";import{jsx as $e,jsxs as Rn}from"react/jsx-runtime";var In=()=>{let{columns:e,table:t,handleCheckboxClick:o,isRowHidden:a,animatingRows:r}=we();return Rn(yr,{className:"rounded-md border",children:[$e(wr,{children:t.getHeaderGroups().map(s=>$e(ca,{children:s.headers.map(i=>$e(kr,{className:`py-3 px-4 ${i.column.getCanSort()?"cursor-pointer select-none":""}`,style:{textAlign:"left"},onClick:i.column.getCanSort()?i.column.getToggleSortingHandler():void 0,children:Rn("div",{className:"flex items-center",children:[i.isPlaceholder?null:Ln(i.column.columnDef.header,i.getContext()),i.column.getCanSort()&&$e("span",{className:"ml-1",children:{asc:"\u2191",desc:"\u2193"}[i.column.getIsSorted()]??""})]})},i.id))},s.id))}),$e(Cr,{children:t.getRowModel().rows?.length?t.getRowModel().rows.filter(s=>!a(s.original)).map(s=>{let i=s.original.id&&Sr(r[s.original.id]);return $e(ca,{id:s.id,"data-state":s.getIsSelected()&&"selected",className:`${s.getIsSelected()?"bg-muted/50":""} ${i} transition-all duration-500 ease-in-out`,children:s.getVisibleCells().map(n=>$e(Fa,{className:"py-3 px-4",style:{textAlign:"left"},onClick:n.column.id==="select"?c=>o(c,s.id):void 0,children:Ln(n.column.columnDef.cell,n.getContext())},n.id))},s.id)}):$e(ca,{children:$e(Fa,{colSpan:e.length,className:"h-24 text-center",children:"There is no result."})})})]})};import{jsx as le,jsxs as pt}from"react/jsx-runtime";var Tn=()=>{let{table:e}=we();return pt("div",{className:"flex items-center justify-end space-x-2 py-4",children:[pt("div",{className:"flex-1 text-sm text-muted-foreground",children:[e.getFilteredSelectedRowModel().rows.length," / "," ",e.getFilteredRowModel().rows.length," row(s) selected."]}),le(wl,{}),pt("div",{className:"flex items-center space-x-2",children:[le(u,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:"Previous"}),le("div",{className:"flex items-center gap-1",children:le(yl,{})}),le(u,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:"Next"})]})]})},yl=()=>{let{table:e,meta:t}=we(),o=e.getState().pagination.pageIndex+1,a=t?.last_page??e.getPageCount(),r=Math.min(5,a),s=1;return a>5&&(o<=3?s=1:o>=a-2?s=a-4:s=o-2),Array.from({length:r},(i,n)=>{let c=s+n;return le(u,{variant:c===o?"default":"outline",size:"sm",onClick:()=>c!==o?e.setPageIndex(c-1):null,className:"h-8 w-8 p-0",children:c},c)})},wl=()=>{let{table:e,customPageSize:t,setCustomPageSize:o}=we();return pt("div",{className:"flex items-center space-x-2",children:[le("span",{className:"text-sm text-muted-foreground",children:"Per Page"}),pt(Be,{children:[le(Fe,{asChild:!0,children:pt(u,{variant:"outline",className:"h-8 w-[70px]",children:[e.getState().pagination.pageSize.toString(),le(l,{iconName:"IconChevronDown",className:"ml-2 h-4 w-4"})]})}),pt(ze,{align:"start",children:[[10,20,30,50,100].map(a=>le(ra,{className:"py-2 pl-8",checked:Number(e.getState().pagination.pageSize)===a,onCheckedChange:()=>e.setPageSize(a),children:le("span",{className:"pl-0",children:a})},a)),le("hr",{}),le("p",{className:"text-muted-foreground text-xs mt-1 px-2",children:"Custom Page Size:"}),le(E,{type:"number",placeholder:"Custom Page Size",value:t,onChange:a=>o(Number(a.target.value)),onKeyDown:a=>a.stopPropagation(),onBlur:a=>{Number(a.target.value)!==e.getState().pagination.pageSize&&e.setPageSize(Number(a.target.value))},className:"px-2 text-sm w-full focus-visible:ring-0 border-none",max:100,min:1})]})]})]})};import{IconLoader2 as Cl,IconSearch as kl,IconX as Sl}from"@tabler/icons-react";import{jsx as $,jsxs as ft}from"react/jsx-runtime";var Dn=()=>{let{meta:e,handleResetTable:t,rowIdField:o}=we();return ft("div",{className:"flex justify-between items-center pb-4 gap-2",children:[$(Ml,{}),ft("div",{className:"flex-1 flex justify-end space-x-2",children:[$(El,{}),$(Pl,{}),Pr({meta:e,rowIdField:o})&&$(u,{variant:"outline",onClick:t,title:"Click to reset search",children:$(l,{iconName:"IconX"})})]})]})},Pl=()=>{let{table:e}=we();return ft(Be,{children:[$(Fe,{asChild:!0,children:ft(u,{variant:"outline",children:[$(l,{iconName:"IconList",className:"h-4 w-4"})," Rows"]})}),$(ze,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()).map(t=>$(ra,{className:"capitalize",checked:t.getIsVisible(),onCheckedChange:o=>t.toggleVisibility(!!o),children:t.id},t.id))})]})},Ml=()=>{let{searchValue:e,handleInputOnChange:t,handleKeyDown:o,globalFilter:a,isSearching:r,advancedTable:s,setSearchValue:i,handleGlobalFilterChange:n,handleSearch:c}=we();return ft("div",{className:"relative w-full flex",children:[$(E,{placeholder:"Write and press enter to search \u21B5",value:e,onChange:t,onKeyDown:m=>o(m),className:d("pr-10 focus-visible:ring-0",a?"border-gray-400":"")}),a?r&&s?$(u,{variant:"link",size:"sm",className:"absolute right-0 top-0 h-full px-3",disabled:!0,title:"Loading",children:$(Cl,{className:"animate-spin"})}):$(u,{variant:"link",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:()=>(i(""),n("")),title:"Click to reset search",children:$(Sl,{})}):$(u,{variant:"link",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:c,title:"Click enter to search",children:$(kl,{})})]})},El=()=>{let{bulkActions:e,table:t,resetSelection:o}=we();return e&&e?.length>0&&(t?.getFilteredSelectedRowModel()?.rows?.length||0)>0&&$("div",{className:"flex items-center gap-2",children:e.map((a,r)=>a.confirm?$(_r,{...a.confirmIcon!==void 0&&{icon:a.confirmIcon},...a.confirmTitle!==void 0&&{title:a.confirmTitle},...a.confirmContent!==void 0&&{content:a.confirmContent},...a.confirmText!==void 0&&{confirmText:a.confirmText},...a.cancelText!==void 0&&{cancelText:a.cancelText},onConfirm:()=>a.action(t.getFilteredSelectedRowModel().rows,o),...a.cancel!==void 0&&{onCancel:a.cancel},children:ft(u,{variant:a.variant||"outline",children:[a.icon&&a.icon,a.label," (",t.getFilteredSelectedRowModel().rows.length,")"]},r)}):ft(u,{variant:a.variant||"outline",onClick:()=>a.action(t.getFilteredSelectedRowModel().rows,o),className:"flex items-center",children:[a.icon&&a.icon,a.label," (",t.getFilteredSelectedRowModel().rows.length,")"]},r))})};import{getCoreRowModel as Il,getFilteredRowModel as Tl,getPaginationRowModel as Dl,getSortedRowModel as Al,useReactTable as Ll}from"@tanstack/react-table";import{createContext as Rl,useContext as _l,useEffect as gt,useRef as _n,useState as X}from"react";import{jsx as Bl}from"react/jsx-runtime";var Bn=Rl({}),An=({children:e,data:t,columns:o,meta:a,bulkActions:r,handleRequest:s,rowIdField:i})=>{let n=typeof s<"u",c=_n(!1),[m,g]=X(a?.per_page?Number(a?.per_page):10),[p,h]=X(a?.sort?[{id:a.sort,desc:a.order==="desc"}]:[]),[D,b]=X([]),[R,x]=X({}),[P,k]=X({}),[Re,j]=X({pageIndex:a?.current_page?Number(a?.current_page)-1:0,pageSize:a?.per_page?Number(a?.per_page):10}),[M,ce]=X(a?.search?a?.search:null),[Wt,bt]=X(a?.search?a?.search:""),[qn,qt]=X(!1),[uo,$n]=X(null);gt(()=>{a&&(h(a.sort?[{id:a.sort,desc:a.order==="desc"}]:[]),j({pageIndex:a.current_page?Number(a.current_page)-1:0,pageSize:a.per_page?Number(a.per_page):10}),g(a.per_page?Number(a.per_page):10),ce(a.search||null),bt(a.search||""))},[a?.current_page,a?.per_page,a?.sort,a?.order,a?.search]),gt(()=>{setTimeout(()=>c.current=!0,500)},[]),gt(()=>qt(!1),[t]);let[$t,vt]=X({}),[Sa,rc]=X([]),[Pa,nc]=X([]),[Ma,sc]=X([]),[Kn,Gn]=X(new Set),Kt=_n({});gt(()=>{if(Ma.length<1)return;let f={...$t};Ma.forEach(A=>{f[String(A)]="deleted",Kt.current[String(A)]=setTimeout(()=>{Gn(de=>new Set([...de,A])),vt(de=>{let J={...de};return delete J[String(A)],J})},500)}),vt(f)},[Ma]),gt(()=>{if(Sa.length<1)return;let f={...$t};Sa.forEach(A=>{f[String(A)]="new",Kt.current[String(A)]=setTimeout(()=>{vt(de=>{let J={...de};return delete J[String(A)],J})},500)}),vt(f)},[Sa]),gt(()=>{if(Pa.length<1)return;let f={...$t};Pa.forEach(A=>{f[String(A)]="updated",Kt.current[String(A)]=setTimeout(()=>{vt(de=>{let J={...de};return delete J[String(A)],J})},1e3)}),vt(f)},[Pa]),gt(()=>()=>Object.values(Kt.current).forEach(f=>clearTimeout(f)),[]);let Zn=f=>{if(!(!c.current||!n))return s({...a,current_page:f.pageIndex+1,per_page:f.pageSize})},Jn=f=>{if(!c.current||!n||f.length===0)return;let A={id:f[0].id,desc:f[0].desc};return s({...a,sort:A.id,order:A.desc?"desc":"asc"})},Qn=f=>!c.current||!n||(f=f.trim(),f===a?.search||f===""&&a?.search==null)?!1:(console.log(a),s({...a,search:f})),Xn=(f,A)=>{let de=Ea.getRowModel().rows.filter(je=>!po(je.original)),J=de.findIndex(je=>je.id===f),Zt=de.findIndex(je=>je.id===A);if(J===-1||Zt===-1)return[];let Ia=Math.min(J,Zt),Ge=Math.max(J,Zt);return de.slice(Ia,Ge+1).map(je=>je.id)},Yn=o.some(f=>f.id==="select"),jn=(f,A)=>{if(f.shiftKey&&uo&&Yn){f.preventDefault();let{rowsById:de}=Ea.getRowModel(),J=Xn(uo,A).map(Ge=>de[Ge]).filter(Boolean),Ia=J.filter(Ge=>Ge?.getIsSelected()).length<J.length/2;J.forEach(Ge=>Ge&&Ge.toggleSelected(Ia))}$n(A)},po=f=>Kn.has(f[i??f.id]),es=f=>{let A=typeof f=="function"?f(p):f;h(A),n&&Jn(A)},ts=f=>{let A=typeof f=="function"?f(Re):f;j(A),n&&Zn(A)},Gt=f=>{ce(f),n&&Qn(f)===!1&&qt(!1)},Ea=Ll({data:t,columns:o,filterFns:{fuzzy:za},onGlobalFilterChange:Gt,globalFilterFn:za,onSortingChange:es,onColumnFiltersChange:b,getCoreRowModel:Il(),getPaginationRowModel:n?void 0:Dl(),getSortedRowModel:n?void 0:Al(),getFilteredRowModel:n?void 0:Tl(),onColumnVisibilityChange:x,onRowSelectionChange:k,onPaginationChange:ts,manualPagination:n,manualSorting:n,manualFiltering:n,pageCount:a?.last_page??void 0,state:{sorting:p,columnFilters:D,columnVisibility:R,rowSelection:P,pagination:Re,globalFilter:M}}),fo=()=>(qt(!0),Gt(Wt)),as={data:t,meta:a,columns:o,bulkActions:r,table:Ea,resetSelection:()=>k({}),rowIdField:i,advancedTable:n,searchValue:Wt,setSearchValue:bt,handleSearch:fo,isSearching:qn,setIsSearching:qt,globalFilter:M,handleGlobalFilterChange:Gt,handleInputOnChange:f=>{bt(f.target.value),n||Gt(f.target.value)},handleResetTable:()=>{bt(""),ce(null),h([{id:i??"id",desc:!0}]),j({pageIndex:0,pageSize:a?.per_page?Number(a?.per_page):10}),b([]),k({}),typeof s<"u"&&s({current_page:1,per_page:10,sort:i||"id",order:"desc",search:""})},handleKeyDown:f=>f.key==="Enter"&&fo(),handleCheckboxClick:jn,isRowHidden:po,animatingRows:$t,customPageSize:m,setCustomPageSize:g};return Bl(Bn.Provider,{value:as,children:e})},we=()=>{let e=_l(Bn);if(!e)throw new Error("useEminTable must be used within a EminTableProvider");return e};import{useEffect as Fn,useMemo as zn,useRef as Fl,useState as On}from"react";import zl from"supercluster";import{Map as Ol,Marker as Hn,NavigationControl as Hl}from"react-map-gl/maplibre";import"maplibre-gl/dist/maplibre-gl.css";import{jsx as Ke,jsxs as ql}from"react/jsx-runtime";var gx=({markers:e,cluster:t,mapStyleUrl:o,initialView:a,...r})=>Ke(Un,{markers:e,cluster:t,mapStyleUrl:o,initialView:a,...r,children:Ke(Ul,{})}),Ul=()=>{let e=co(),{markers:t,cluster:o,initialView:a,DEFAULT_MIN_ZOOM:r,MAP_MIN_BOUND:s,MAP_MAX_BOUND:i}=e,n=M=>Math.max(s,Math.min(i,M)),c=M=>M?.properties?.cluster===!0,m=()=>{if(!x.current)return;if(!o){R([]);return}let M=x.current.getBounds();if(!M)return;let ce=[M.getWest(),M.getSouth(),M.getEast(),M.getNorth()],Wt=Math.round(n(x.current.getZoom()??r)),bt=j.getClusters(ce,Wt);R(bt)},g=({viewState:M})=>{if(D(M),typeof e?.onMove=="function")try{e?.onMove({viewState:M})}catch(ce){console.error("Error in onMove callback",ce)}m()},p={...a,zoom:n(typeof a?.zoom=="number"?a?.zoom:r)},[h,D]=On(p),[b,R]=On([]),x=Fl(null),P=typeof e?.minZoom=="number"?n(e?.minZoom):r,k=typeof e?.maxZoom=="number"?n(e?.maxZoom):i;if(P>k){let M=P;P=k,k=M}let Re=zn(()=>t&&t.map(M=>({type:"Feature",properties:{id:M.id},geometry:{type:"Point",coordinates:[M.lng,M.lat]}})),[t]),j=zn(()=>new zl({radius:e?.radius??40,maxZoom:k,minZoom:P}),[]);return Fn(()=>{o&&j.load(Re)},[j,Re,o]),Fn(()=>{m()},[j,h,e.cluster]),ql(Ol,{ref:x,mapStyle:e?.mapStyleUrl,initialViewState:p,...e,minZoom:P,maxZoom:k,style:{width:"100%",height:"100%"},onMove:g,onLoad:m,children:[Ke(Hl,{position:"top-left"}),(o?b:t||[]).map(M=>o&&c(M)?Ke(Wl,{item:M,index:j,mapRef:x,effectiveMaxZoom:k}):Ke(Vl,{item:M}))]})},Vl=({item:e})=>{let{cluster:t,markers:o}=co(),a=t?e.properties?.id:e.id,r=t?e.geometry.coordinates[0]:e.lng,s=t?e.geometry.coordinates[1]:e.lat,i=t?o?.find(n=>n.id===a)??{id:a,lat:s,lng:r}:e;return Ke(Hn,{longitude:r,latitude:s,anchor:"center",children:i?.component??Ke("div",{className:"w-3 h-3 rounded-full border-2 border-white shadow-md bg-blue-600 dark:bg-blue-500",title:"Marker"})},`p-${a}`)},Wl=({item:e,index:t,mapRef:o,effectiveMaxZoom:a})=>{let[r,s]=e.geometry.coordinates,i=e.properties.point_count;return Ke(Hn,{longitude:r,latitude:s,anchor:"center",children:Ke("div",{onClick:()=>{let c=Math.min(t.getClusterExpansionZoom(e.properties.cluster_id),a);o.current&&o.current.flyTo({center:[r,s],zoom:c,duration:500})},title:`${i}`,className:"cursor-pointer select-none flex items-center justify-center w-9 h-9 rounded-full border-2 shadow-md border-gray-500 bg-gray-900 text-white dark:bg-gray-800 dark:text-gray-200 font-bold text-xs",children:i})},`c-${e.properties.cluster_id}`)};import{createContext as $l,useContext as Kl,useEffect as Gl,useState as mo}from"react";import{jsx as Zl}from"react/jsx-runtime";var Vn=$l({}),Un=({children:e,markers:t,mapStyleUrl:o,initialView:a,...r})=>{let s="https://demotiles.maplibre.org/style.json",[g,p]=mo(t),[h,D]=mo(!0),[b,R]=mo(o||s),x={DEFAULT_STYLE:s,DEFAULT_MIN_ZOOM:1,DEFAULT_MAX_ZOOM:16,MAP_MIN_BOUND:0,MAP_MAX_BOUND:22,markers:g,setMarkers:p,cluster:h,setCluster:D,mapStyleUrl:b,setMapStyleUrl:R,initialView:a||{longitude:0,latitude:0,zoom:1},...r},P=Vo();return Gl(()=>{R(P==="dark"?"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json":"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json")},[P]),Zl(Vn.Provider,{value:x,children:e})},co=()=>{let e=Kl(Vn);if(!e)throw new Error("useWorldMap must be used within a WorldMapProvider");return e};import{IconLayoutSidebar as Ql}from"@tabler/icons-react";import{jsx as y,jsxs as _t}from"react/jsx-runtime";var Xl="sidebar_state",Yl=3600*24*7,jl="16rem",ec="18rem",tc="3rem",ac="b",Wn=Y.createContext(null);function Et(){let e=Y.useContext(Wn);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function yn({defaultOpen:e=!0,open:t,onOpenChange:o,className:a,style:r,children:s,...i}){let n=Er(),[c,m]=Y.useState(!1),[g,p]=Y.useState(e),h=t??g,D=Y.useCallback(P=>{let k=typeof P=="function"?P(h):P;o?o(k):p(k),document.cookie=`${Xl}=${k}; path=/; max-age=${Yl}`},[o,h]),b=Y.useCallback(()=>n?m(P=>!P):D(P=>!P),[n,D,m]);Y.useEffect(()=>{let P=k=>{k.key===ac&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),b())};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[b]);let R=h?"expanded":"collapsed",x=Y.useMemo(()=>({state:R,open:h,setOpen:D,isMobile:n,openMobile:c,setOpenMobile:m,toggleSidebar:b}),[R,h,D,n,c,m,b]);return y(Wn.Provider,{value:x,children:y(ea,{delayDuration:0,children:y("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":jl,"--sidebar-width-icon":tc,...r},className:d("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",a),...i,children:s})})})}function Xx({side:e="left",variant:t="sidebar",collapsible:o="offcanvas",className:a,children:r,...s}){let{isMobile:i,state:n,openMobile:c,setOpenMobile:m}=Et();return o==="none"?y("div",{"data-slot":"sidebar",className:d("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),...s,children:r}):i?y(Qt,{open:c,onOpenChange:m,...s,children:_t(Xt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":ec},side:e,children:[_t(Yt,{className:"sr-only",children:[y(jt,{children:"Sidebar"}),y(ho,{children:"Displays the mobile sidebar."})]}),y("div",{className:"flex h-full w-full flex-col",children:r})]})}):_t("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":n,"data-collapsible":n==="collapsed"?o:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[y("div",{"data-slot":"sidebar-gap",className:d("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),y("div",{"data-slot":"sidebar-container",className:d("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...s,children:y("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:r})})]})}function Yx({className:e,onClick:t,...o}){let{toggleSidebar:a}=Et();return _t(u,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:d("size-7",e),onClick:r=>{t?.(r),a()},...o,children:[y(Ql,{}),y("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function jx({className:e,...t}){let{toggleSidebar:o}=Et();return y("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:d("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function eN({className:e,...t}){return y("main",{"data-slot":"sidebar-inset",className:d("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function tN({className:e,...t}){return y(E,{"data-slot":"sidebar-input","data-sidebar":"input",className:d("bg-background h-8 w-full shadow-none",e),...t})}function aN({className:e,...t}){return y("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:d("flex flex-col gap-2 p-2",e),...t})}function wn({className:e,...t}){return y("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:d("flex flex-col gap-2 p-2",e),...t})}function oN({className:e,...t}){return y(Jt,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:d("bg-sidebar-border mx-2 w-auto",e),...t})}function Cn({className:e,...t}){return y("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:d("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function Ar({className:e,...t}){return y("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:d("relative flex w-full min-w-0 flex-col p-2",e),...t})}function da({className:e,asChild:t=!1,...o}){return y(t?Vt:"div",{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:d("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...o})}function rN({className:e,asChild:t=!1,...o}){return y(t?Vt:"button",{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:d("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...o})}function nN({className:e,...t}){return y("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:d("w-full text-sm",e),...t})}function ma({className:e,...t}){return y("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:d("flex w-full min-w-0 flex-col gap-1",e),...t})}function Bt({className:e,...t}){return y("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:d("group/menu-item relative",e),...t})}var oc=Jl("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function ot({asChild:e=!1,isActive:t=!1,variant:o="default",size:a="default",tooltip:r,className:s,...i}){let n=e?Vt:"button",{isMobile:c,state:m}=Et(),g=y(n,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":a,"data-active":t,className:d(oc({variant:o,size:a}),s),...i});return r?(typeof r=="string"&&(r={children:r}),_t(ht,{children:[y(xt,{asChild:!0,children:g}),y(Nt,{side:"right",align:"center",hidden:m!=="collapsed"||c,...r})]})):g}function sN({className:e,asChild:t=!1,showOnHover:o=!1,...a}){return y(t?Vt:"button",{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:d("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",o&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),...a})}function iN({className:e,...t}){return y("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:d("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t})}function lN({className:e,showIcon:t=!1,...o}){let a=Y.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return _t("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:d("flex h-8 items-center gap-2 rounded-md px-2",e),...o,children:[t&&y(La,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),y(La,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})}function Oa({className:e,...t}){return y("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:d("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function Lr({className:e,...t}){return y("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:d("group/menu-sub-item relative",e),...t})}function Ha({asChild:e=!1,size:t="md",isActive:o=!1,className:a,...r}){return y(e?Vt:"a",{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":o,className:d("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",a),...r})}export{Et as a,yn as b,Xx as c,Yx as d,jx as e,eN as f,tN as g,aN as h,wn as i,oN as j,Cn as k,Ar as l,da as m,rN as n,nN as o,ma as p,Bt as q,ot as r,sN as s,iN as t,lN as u,Oa as v,Lr as w,Ha as x,Ua as y,_r as z,is as A,ls as B,_c as C,Uc as D,ua as E,Hr as F,Ur as G,vs as H,Vr as I,pa as J,$a as K,Ka as L,wd as M,St as N,Wr as O,qr as P,Ga as Q,Mt as R,fa as S,$d as T,Gr as U,Zr as V,am as W,Jr as X,Xr as Y,Me as Z,en as _,qm as $,_s as aa,$m as ba,tn as ca,an as da,mu as ea,Vs as fa,uu as ga,on as ha,Pu as ia,Mu as ja,Ks as ka,Gs as la,Uu as ma,Qa as na,lp as oa,cp as pa,dp as qa,re as ra,be as sa,li as ta,ci as ua,_p as va,nn as wa,df as xa,Ya as ya,Lf as za,wi as Aa,Ot as Ba,Ci as Ca,ki as Da,dn as Ea,mn as Fa,cg as Ga,fg as Ha,gn as Ia,Li as Ja,ja as Ka,eo as La,to as Ma,ao as Na,Ri as Oa,Na as Pa,Lt as Qa,rb as Ra,Wi as Sa,ga as Ta,Ee as Ua,ba as Va,jr as Wa,kn as Xa,fv as Ya,kv as Za,no as _a,xl as $a,$r as ab,zv as bb,qv as cb,$v as db,gh as eb,In as fb,Tn as gb,Dn as hb,An as ib,we as jb,gx as kb,Un as lb,co as mb};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=class{widgets=new Map;register(t){this.widgets.set(t.code.trim(),t)}get(t){return this.widgets.get(t)}},s=new e;export{s as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,d as s}from"./chunk-
|
|
1
|
+
import{a as n,d as s}from"./chunk-XLEUHJR2.js";import{b as c}from"./chunk-I6LAKJDJ.js";import{createContext as E,useContext as O,useState as o}from"react";import{IconAlertCircle as h}from"@tabler/icons-react";import{jsx as r}from"react/jsx-runtime";var l=E({}),N=({packages:e,marketPackages:i,meta:k,account:P,error:a=null,children:m})=>{let[g,p]=o(!1),[u,d]=o({}),[M,C]=o(i??[]),[f,x]=o(k||{}),v={isDetailModalOpen:g,setIsDetailModalOpen:p,selectedPackage:u,setSelectedPackage:d,marketPackages:M,setMarketPackages:C,meta:f,setMeta:x,account:P,error:a};if(a){let t=s(a)??{icon:r(h,{className:"text-red-500 mx-auto h-15 w-15"}),title:"An Error Occured",message:a||"An internal server error occurred while processing your request.",content:null};return r(n,{icon:t.icon,title:t.title,message:t.message,content:t.content})}return r(c,{packages:e,children:r(l.Provider,{value:v,children:m})})},S=()=>{let e=O(l);if(!e)throw new Error("MarketplaceContext must be used within a MarketplaceProvider");return e};export{N as a,S as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useForm as a}from"@inertiajs/react";var u=()=>{let{data:t,setData:e,post:r,processing:o,errors:s}=a({email:""});return{data:t,setData:e,submit:m=>{m.preventDefault(),r(route("password.email"))},post:r,processing:o,errors:s}};export{u as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-SRP3WWVX.js";import{a as m}from"./chunk-G4EEZUTC.js";import{useEffect as f,useState as b}from"react";import{toast as u}from"sonner";import{usePage as d}from"@inertiajs/react";import{jsx as n}from"react/jsx-runtime";var l=()=>{let[e,o]=b({}),s=d().props,i=s.emin_jobs,a=s.auth?.user?.id;return f(()=>{if(i&&Array.isArray(i)){let r={};i.forEach(t=>{r[t.id]=t}),o(r)}},[i]),f(()=>{if(!a)return;let r=window?.Echo?.private("emin-jobs."+a).listen(".job.progress",t=>{o(p=>({...p,[t.job.id]:t.job}))});return()=>{r?.stopListening(".job.progress")}},[a]),e},L=()=>{let e=l();f(()=>{Object.values(e).forEach(o=>{let s=`job-${o.id}`;o.status==="completed"?u.success(n(c,{job:o}),{duration:5e3,icon:n(m,{iconName:"IconCheck"}),id:s,classNames:{content:"w-full"}}):o.status==="failed"?u.error(n(c,{job:o}),{duration:5e3,icon:n(m,{iconName:"IconX"}),id:s,classNames:{content:"w-full"}}):(o.status==="running"||o.status==="pending")&&u.loading(n(c,{job:o}),{id:s,classNames:{content:"w-full"}})})},[e])};export{l as a,L as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-KND3PUAR.js";import{a as s}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-KND3PUAR.js";import{a as s}from"./chunk-LFDQQW42.js";import{a as i,b as n,c as r}from"./chunk-3DBYUBWW.js";import{a as t}from"./chunk-G4EEZUTC.js";import{Head as m,Link as g}from"@inertiajs/react";import{jsx as e,jsxs as o}from"react/jsx-runtime";var S=()=>{let d=[{title:"General Settings",description:"Manage general system settings",href:route("dashboard.settings",{tab:"general"}),icon:e(t,{iconName:"IconSettings"}),colSpan:1},{title:"Manage Slugs",description:"Configure URL slugs and permalinks",href:route("dashboard.settings.slugs"),icon:e(t,{iconName:"IconLink"}),colSpan:1},{title:"Design Settings",description:"Manage appereance, branding and design settings for the system",href:route("dashboard.settings",{tab:"design"}),icon:e(t,{iconName:"IconPalette"}),colSpan:1},{title:"Mail Settings",description:"Manage email settings for the system",href:route("dashboard.settings",{tab:"mail"}),icon:e(t,{iconName:"IconMail"}),colSpan:1},{title:"Platform Status",description:"View system health and service status",href:route("dashboard.settings.platform"),icon:e(t,{iconName:"IconCloudCog"}),colSpan:2}],l=[{title:"WM Dashboard",href:route("dashboard")},{title:"Settings"}];return o(s,{breadcrumbs:l,children:[e(m,{title:"All Settings"}),o("div",{className:"container mx-auto grid grid-cols-2 gap-4",children:[e(c,{title:"All Settings",description:"Which settings do you want to manage?",icon:e(t,{iconName:"IconSettings2"})}),d.map(a=>e(g,{href:a.href,className:`col-span-${a.colSpan}`,children:e(i,{className:"cursor-pointer hover:shadow-lg transition-shadow",children:o(n,{children:[o(r,{className:"flex items-center gap-2 mx-auto",children:[a.icon,a.title]}),e("p",{className:"text-sm text-muted-foreground text-center",children:a.description})]})})}))]})]})};export{S as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-BYXOSCJY.js";var _=(t,e)=>e?.items?.find(o=>o.widget_id===t.id)!==void 0,h=t=>t==="xs"?1:t==="sm"?2:6,f={lg:12,md:6,sm:2,xs:1},p=10,H=(t,e)=>Object.keys(e).reduce((o,n)=>(o[n]=L(t,!1,n),o),{}),L=(t,e,o)=>{let r=c.get(t.code),i=r?.min_height??150,m=r?.max_height??null,x=r?.max_width??null,g=r?.min_width??null,a=l=>{let W=p+12;return Math.max(1,Math.ceil((l+12)/W))},d=a(i+45),u=a(45),y=e?u:Math.max(4,d);return{i:String(t.id),x:0,y:9999,w:Math.min(h(o),f[o]),h:y,minH:e?u:d,...e?{maxH:u}:m?{maxH:a(m+45)}:{},minW:g?a(g):1,...x?{maxW:a(x)}:{}}},P=(t,e)=>t.i===e.i&&t.x===e.x&&t.y===e.y&&t.w===e.w&&t.h===e.h,k=(t,e,o)=>{for(let n of o){let s=Array.isArray(t[n])?t[n]:[],r=Array.isArray(e[n])?e[n]:[];if(s.length!==r.length)return!1;for(let i=0;i<s.length;i++)if(!P(s[i],r[i]))return!1}return!0};export{_ as a,h as b,f as c,p as d,H as e,L as f,P as g,k as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as D}from"./chunk-
|
|
2
|
-
`))})})},u=async()=>{if(!s)return;if(s.latest.version!==s.latest_compatible.version)await j(s).then(l=>{if(l!==null){let K=l.version===s.latest.version?"upgrade":"update";i.setData(x(K,s))}else return Promise.reject("User cancelled selection.")});else return i.setData(x("update",s)),Promise.resolve()};return!o&&!P&&t(y,{processing:i.processing,recentlySuccessful:i.recentlySuccessful,processingText:"Updating System...",successText:"System updated successfully!",size:"sm",variant:"ghost",className:h("gap-2"),onClick:()=>p(),children:[e(Y,{className:h("h-4 w-4")}),"Update Now"]})},{}),e(()=>{let i=()=>{let p=new Date().getTime()-(m?.getTime()??0),u=60*1e3-p;if(u>0)return F.warning(`Please wait ${Math.ceil(u/1e3)} seconds before checking again.`),!1;let a=new Date().toISOString();return k(new Date(a)),localStorage.setItem("last_core_update_checked",a),!0},x=()=>{if(d.processing||!i())return;let p=I.find(a=>a.code==N);U("update"),_(p);let u=a=>{let l=a.latest.version===p.version;n(l),l||v(a)};B(d,p.id).then(a=>u(a)).catch(()=>F.error("Failed to check updates for Emin Core."))};return t(y,{processing:d.processing,recentlySuccessful:d.recentlySuccessful,processingText:"Checking updates...",successText:o?"System is up to date!":"New version available!",size:"sm",variant:"outline",onClick:()=>x(),children:[e(L,{className:"h-4 w-4"}),"Check Updates"]})},{})]}),e(q,{})]})};export{
|
|
1
|
+
import{c as D}from"./chunk-I6LAKJDJ.js";import{a as B}from"./chunk-SC5FEULM.js";import{a as E}from"./chunk-INW53CPC.js";import{E as y}from"./chunk-AQUA6LR6.js";import{b as g}from"./chunk-TVCWAJFT.js";import{a as C,b as S,c as w,d as T,f as b}from"./chunk-3DBYUBWW.js";import{a as M}from"./chunk-65LRDGYI.js";import{a as c}from"./chunk-G4EEZUTC.js";import{a as N}from"./chunk-Y7NR7PFG.js";import{a as h}from"./chunk-GND5KQRZ.js";import{Link as G,useForm as $,useHttp as Q}from"@inertiajs/react";import{useEffect as W,useState as f}from"react";import{toast as F}from"sonner";import{IconAlertCircleFilled as X,IconArrowUpRight as Y,IconCircleCheckFilled as Z,IconRefresh as L}from"@tabler/icons-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var ge=({account:r})=>e(M,{title:"My Platform Account",icon:"IconUserCircle",description:"Manage your platform account settings.",className:"col-span-full",buttons:r?e(g,{variant:"outline",size:"sm",children:t("a",{href:"https://emincore.io/login",target:"_blank",className:"flex items-center gap-2",children:[e(c,{iconName:"IconUserCircle",className:"h-4 w-4"}),e("span",{children:r.email})]})}):e(G,{href:route("dashboard.marketplace"),className:"flex items-center gap-2",children:t(g,{variant:"default",size:"sm",children:[e(c,{iconName:"IconUserCircle",className:"h-4 w-4"}),e("span",{children:"Connect to Platform"})]})})}),he=({eminCore:r})=>t(C,{className:"col-span-2",children:[t(S,{children:[t(w,{className:"flex gap-1",children:[t("div",{className:"grid gap-2",children:[e("img",{src:"https://emin.llc/wp-content/uploads/2022/11/siyah-logo-arkasiz.svg",className:"h-8"}),e("span",{className:"text-xl font-bold text-primary",children:"EminCore - The Cross-Ecosystem Orchestrator"})]}),t("div",{className:"ml-auto flex max-w-[400px] flex-wrap gap-1",children:[t(g,{variant:"outline",size:"sm",className:"gap-2",children:[e(c,{iconName:"IconCode",className:"h-4 w-4"}),t("span",{className:"text-xs font-bold",children:["v",r.version]})]}),t(g,{variant:"outline",size:"sm",className:"gap-2",children:[e(c,{iconName:"IconBuilding",className:"h-4 w-4"}),e("span",{className:"text-xs font-bold",children:"Emin Tech"})]}),t(g,{variant:"outline",size:"sm",className:"gap-2",children:[e(c,{iconName:"IconBook",className:"h-4 w-4"}),e("span",{className:"text-xs font-bold",children:"Docs"})]})]})]}),e(T,{children:e("p",{children:"A modular application platform that orchestrates Composer and npm ecosystems through a unified package architecture, marketplace, and runtime."})})]}),e(b,{className:"grid gap-6",children:e(ee,{})})]}),fe=({requirements:r})=>{let o=({requirement:n})=>{let m=Math.random()*500+800,[k,s]=f(!0);return f(()=>{let v=setTimeout(()=>s(!1),m);return()=>clearTimeout(v)}),k?e(c,{iconName:"IconLoader2",className:"animate-spin mx-auto h-4 w-4 my-0.5"}):e("span",{className:h("font-mono font-bold text-sm",n.status?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),children:n.value??"-"})};return t(C,{className:"col-span-2",children:[e(S,{children:t(w,{className:"flex items-center gap-2",children:[e(c,{iconName:"IconServer",className:"h-5 w-5 text-primary"}),e("h3",{className:"font-semibold",children:"System Status"})]})}),e(b,{children:e("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-3",children:r?.map(n=>t("div",{className:"rounded-md border p-3 text-center grid gap-[1px]",children:[t("span",{className:"text-xs text-muted-foreground mx-auto flex items-center gap-1",children:[e(c,{iconName:n.icon,className:"h-4 w-4 text-primary mx-auto"}),n.title]}),e(o,{requirement:n}),n.requirements&&e("span",{className:"font-mono font-bold text-xs text-muted-foreground",children:n.requirements})]}))})})]})},xe=()=>t("div",{className:"col-span-2 text-center grid gap-3",children:[t("p",{className:"text-sm text-muted-foreground px-5 mx-auto",children:["A two-year R&D effort carried out by a single-person team resulted in the completion of this platform and ecosystem. It provides users with a unique infrastructure built on the most modern and powerful technology stacks. This infrastructure enables you to prepare your project in the shortest possible time while achieving maximum performance, user engagement, and rich functionality.",e("br",{}),"Thank you for choosing us."]}),e("img",{src:"https://eminilhan.com/wp-content/uploads/2023/04/beyaz-logo-1.png",className:"h-10 mx-auto"})]}),ee=()=>{let r=localStorage?.getItem("last_core_update_checked"),[o,n]=f(localStorage?.getItem("is_core_up_to_date")==="true"),[m,k]=f(r?new Date(r):null),[s,v]=f(JSON.parse(localStorage?.getItem("last_core_versions")??"null")),d=Q();W(()=>{localStorage.setItem("is_core_up_to_date",o?"true":"false"),localStorage.setItem("last_core_versions",JSON.stringify(s)),localStorage.setItem("last_core_update_checked",m?m.toISOString():"")},[o,s,m]);let R=D(),{packages:I,isLoading:P,setIsLoading:V,setLoadingContent:O,setIsModalOpen:z,setPackageManifest:_,setProcess:U,setValidationError:A}=R,{selectVersion:j,SelectionModal:q}=E(),H=()=>d.processing?e(L,{className:"h-6 w-6 text-primary animate-spin shrink-0"}):o?e(Z,{className:"h-6 w-6 text-green-600 dark:text-green-400 shrink-0"}):e(X,{className:"h-6 w-6 text-blue-600 dark:text-blue-500 shrink-0"}),J=()=>t("div",{className:"grid",children:[e("span",{className:h("text-sm font-medium",d.processing?"text-primary":o?"text-green-600 dark:text-green-400":"text-blue-600 dark:text-blue-500"),children:d.processing?"Checking updates...":o?"System is up to date!":"New version available!"}),e("span",{className:"text-xs text-primary/70",children:o===!0?"Last checked: "+(m?.toLocaleString()??"never"):"Keep your system up to date with the latest features, performance improvements, and security updates."})]});return t("div",{className:"grid md:flex md:items-center gap-2",children:[e(()=>t("div",{className:"flex items-center gap-2",children:[e(H,{}),e(J,{})]}),{}),t("div",{className:"grid md:flex md:items-center gap-3 md:ml-auto",children:[e(()=>{let i=$(),x=(a,l)=>({process:"update",manifest:{code:N,version:a==="update"?l.latest_compatible.version:l.latest.version,core_constraint:"latest"}}),p=()=>{P||i.processing||!s||u().then(()=>{U("update"),V(!0),O({title:"Updating System",description:"Please wait while we update your system to the latest version."}),_({...I.find(a=>a.code==N),version:"latest"}),z(!0),i.post(route("dashboard.packages.manager"),{onError:a=>A(Object.values(a).join(`
|
|
2
|
+
`))})})},u=async()=>{if(!s)return;if(s.latest.version!==s.latest_compatible.version)await j(s).then(l=>{if(l!==null){let K=l.version===s.latest.version?"upgrade":"update";i.setData(x(K,s))}else return Promise.reject("User cancelled selection.")});else return i.setData(x("update",s)),Promise.resolve()};return!o&&!P&&t(y,{processing:i.processing,recentlySuccessful:i.recentlySuccessful,processingText:"Updating System...",successText:"System updated successfully!",size:"sm",variant:"ghost",className:h("gap-2"),onClick:()=>p(),children:[e(Y,{className:h("h-4 w-4")}),"Update Now"]})},{}),e(()=>{let i=()=>{let p=new Date().getTime()-(m?.getTime()??0),u=60*1e3-p;if(u>0)return F.warning(`Please wait ${Math.ceil(u/1e3)} seconds before checking again.`),!1;let a=new Date().toISOString();return k(new Date(a)),localStorage.setItem("last_core_update_checked",a),!0},x=()=>{if(d.processing||!i())return;let p=I.find(a=>a.code==N);U("update"),_(p);let u=a=>{let l=a.latest.version===p.version;n(l),l||v(a)};B(d,p.id).then(a=>u(a)).catch(()=>F.error("Failed to check updates for Emin Core."))};return t(y,{processing:d.processing,recentlySuccessful:d.recentlySuccessful,processingText:"Checking updates...",successText:o?"System is up to date!":"New version available!",size:"sm",variant:"outline",onClick:()=>x(),children:[e(L,{className:"h-4 w-4"}),"Check Updates"]})},{})]}),e(q,{})]})};export{ge as a,he as b,fe as c,xe as d};
|