import { configureStore } from '@reduxjs/toolkit';
import styleReducer from './styleSlice';
import mainReducer from './mainSlice';
import authSlice from './authSlice';
import openAiSlice from './openAiSlice';

import usersSlice from "./users/usersSlice";
import rolesSlice from "./roles/rolesSlice";
import permissionsSlice from "./permissions/permissionsSlice";
import developer_api_keysSlice from "./developer_api_keys/developer_api_keysSlice";
import addressesSlice from "./addresses/addressesSlice";
import categoriesSlice from "./categories/categoriesSlice";
import brandsSlice from "./brands/brandsSlice";
import suppliersSlice from "./suppliers/suppliersSlice";
import productsSlice from "./products/productsSlice";
import product_variantsSlice from "./product_variants/product_variantsSlice";
import collectionsSlice from "./collections/collectionsSlice";
import product_reviewsSlice from "./product_reviews/product_reviewsSlice";
import wishlist_itemsSlice from "./wishlist_items/wishlist_itemsSlice";
import compare_listsSlice from "./compare_lists/compare_listsSlice";
import compare_itemsSlice from "./compare_items/compare_itemsSlice";
import cartsSlice from "./carts/cartsSlice";
import cart_itemsSlice from "./cart_items/cart_itemsSlice";
import ordersSlice from "./orders/ordersSlice";
import order_itemsSlice from "./order_items/order_itemsSlice";
import shipping_carriersSlice from "./shipping_carriers/shipping_carriersSlice";
import shipmentsSlice from "./shipments/shipmentsSlice";
import paymentsSlice from "./payments/paymentsSlice";
import couponsSlice from "./coupons/couponsSlice";
import coupon_redemptionsSlice from "./coupon_redemptions/coupon_redemptionsSlice";
import loyalty_settingsSlice from "./loyalty_settings/loyalty_settingsSlice";
import point_ledger_entriesSlice from "./point_ledger_entries/point_ledger_entriesSlice";
import frequently_bought_together_groupsSlice from "./frequently_bought_together_groups/frequently_bought_together_groupsSlice";
import frequently_bought_together_itemsSlice from "./frequently_bought_together_items/frequently_bought_together_itemsSlice";
import ad_placementsSlice from "./ad_placements/ad_placementsSlice";
import adsSlice from "./ads/adsSlice";
import ad_eventsSlice from "./ad_events/ad_eventsSlice";
import site_settingsSlice from "./site_settings/site_settingsSlice";
import footer_content_blocksSlice from "./footer_content_blocks/footer_content_blocksSlice";
import social_linksSlice from "./social_links/social_linksSlice";
import footer_linksSlice from "./footer_links/footer_linksSlice";
import payment_badgesSlice from "./payment_badges/payment_badgesSlice";
import newsletter_subscribersSlice from "./newsletter_subscribers/newsletter_subscribersSlice";
import cms_pagesSlice from "./cms_pages/cms_pagesSlice";
import push_notificationsSlice from "./push_notifications/push_notificationsSlice";
import push_subscriptionsSlice from "./push_subscriptions/push_subscriptionsSlice";
import seo_entriesSlice from "./seo_entries/seo_entriesSlice";

export const store = configureStore({
  reducer: {
    style: styleReducer,
    main: mainReducer,
    auth: authSlice,
    openAi: openAiSlice,

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
developer_api_keys: developer_api_keysSlice,
addresses: addressesSlice,
categories: categoriesSlice,
brands: brandsSlice,
suppliers: suppliersSlice,
products: productsSlice,
product_variants: product_variantsSlice,
collections: collectionsSlice,
product_reviews: product_reviewsSlice,
wishlist_items: wishlist_itemsSlice,
compare_lists: compare_listsSlice,
compare_items: compare_itemsSlice,
carts: cartsSlice,
cart_items: cart_itemsSlice,
orders: ordersSlice,
order_items: order_itemsSlice,
shipping_carriers: shipping_carriersSlice,
shipments: shipmentsSlice,
payments: paymentsSlice,
coupons: couponsSlice,
coupon_redemptions: coupon_redemptionsSlice,
loyalty_settings: loyalty_settingsSlice,
point_ledger_entries: point_ledger_entriesSlice,
frequently_bought_together_groups: frequently_bought_together_groupsSlice,
frequently_bought_together_items: frequently_bought_together_itemsSlice,
ad_placements: ad_placementsSlice,
ads: adsSlice,
ad_events: ad_eventsSlice,
site_settings: site_settingsSlice,
footer_content_blocks: footer_content_blocksSlice,
social_links: social_linksSlice,
footer_links: footer_linksSlice,
payment_badges: payment_badgesSlice,
newsletter_subscribers: newsletter_subscribersSlice,
cms_pages: cms_pagesSlice,
push_notifications: push_notificationsSlice,
push_subscriptions: push_subscriptionsSlice,
seo_entries: seo_entriesSlice,
  },
})

// Infer the `RootState` and `AppDispatch` types from the store itself
export type RootState = ReturnType<typeof store.getState>
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch
