import { create } from '../../../../../../node_modules/.pnpm/zustand@4.5.5_@types_react@19.2.6_immer@11.1.3_react@19.2.0/node_modules/zustand/esm/index.mjs';

const store = (set, get) => ({
  previewMode: "responsive",
  setPreviewMode: (mode) => set({ previewMode: mode }),
  registry: {},
  blocks: void 0,
  initialize: (registry, persistLayerStoreConfig, allowPagesCreation, allowPagesDeletion, allowVariableEditing, blocks) => {
    set((state) => ({ ...state, registry, persistLayerStoreConfig, allowPagesCreation, allowPagesDeletion, allowVariableEditing, blocks }));
  },
  getComponentDefinition: (type) => {
    const { registry } = get();
    if (!registry) {
      console.warn("Registry accessed via editor store before initialization.");
      return void 0;
    }
    return registry[type];
  },
  persistLayerStoreConfig: true,
  setPersistLayerStoreConfig: (shouldPersist) => set({ persistLayerStoreConfig: shouldPersist }),
  revisionCounter: 0,
  incrementRevision: () => set((state) => ({ revisionCounter: state.revisionCounter + 1 })),
  allowPagesCreation: true,
  setAllowPagesCreation: (allow) => set({ allowPagesCreation: allow }),
  allowPagesDeletion: true,
  setAllowPagesDeletion: (allow) => set({ allowPagesDeletion: allow }),
  allowVariableEditing: true,
  setAllowVariableEditing: (allow) => set({ allowVariableEditing: allow }),
  // Panel visibility state
  showLeftPanel: true,
  setShowLeftPanel: (show) => set({ showLeftPanel: show }),
  showRightPanel: true,
  setShowRightPanel: (show) => set({ showRightPanel: show })
});
const useEditorStore = create()(store);

export { useEditorStore };
