import { _ as defaultBaseState, f as createBaseState, t as PHDocumentController } from "./dist-DZj99xX4.js";
import { T as useDocumentById, c as useDocumentsInSelectedFolder, g as useSelectedDocument, s as useDocumentsInSelectedDrive } from "./dist-DAY54QOk.js";
import { a as utils, d as isMocDocument, l as assertIsMocDocument, t as Moc } from "./module-DqlppH9U.js";
//#region document-models/moc/v1/gen/controller.ts
/**
* WARNING: DO NOT EDIT
* This file is auto-generated and updated by codegen
*/
const MocController = PHDocumentController.forDocumentModel(Moc);
//#endregion
//#region document-models/moc/v1/gen/ph-factories.ts
function defaultGlobalState() {
	return {
		title: null,
		description: null,
		orientation: null,
		tier: null,
		coreIdeas: [],
		tensions: [],
		openQuestions: [],
		agentNotes: [],
		parentRef: null,
		childRefs: [],
		noteCount: 0,
		createdAt: null,
		updatedAt: null
	};
}
function defaultLocalState() {
	return {};
}
function defaultPHState() {
	return {
		...defaultBaseState(),
		global: defaultGlobalState(),
		local: defaultLocalState()
	};
}
function createGlobalState(state) {
	return {
		...defaultGlobalState(),
		...state || {}
	};
}
function createLocalState(state) {
	return {
		...defaultLocalState(),
		...state || {}
	};
}
function createState(baseState, globalState, localState) {
	return {
		...createBaseState(baseState?.auth, baseState?.document),
		global: createGlobalState(globalState),
		local: createLocalState(localState)
	};
}
/**
* Creates a MocDocument with custom global and local state
* This properly handles the PHBaseState requirements while allowing
* document-specific state to be set.
*/
function createMocDocument(state) {
	return utils.createDocument(state ? createState(createBaseState(state.auth, state.document), state.global, state.local) : void 0);
}
//#endregion
//#region document-models/moc/v1/hooks.ts
/** Hook to get a Moc document by its id */
function useMocDocumentById(documentId) {
	const [document, dispatch] = useDocumentById(documentId);
	if (!isMocDocument(document)) return [void 0, void 0];
	return [document, dispatch];
}
/** Hook to get the selected Moc document */
function useSelectedMocDocument() {
	const [document, dispatch] = useSelectedDocument();
	assertIsMocDocument(document);
	return [document, dispatch];
}
/** Hook to get all Moc documents in the selected drive */
function useMocDocumentsInSelectedDrive() {
	return useDocumentsInSelectedDrive()?.filter(isMocDocument);
}
/** Hook to get all Moc documents in the selected folder */
function useMocDocumentsInSelectedFolder() {
	return useDocumentsInSelectedFolder()?.filter(isMocDocument);
}
//#endregion
export { createMocDocument as a, defaultLocalState as c, useSelectedMocDocument as i, defaultPHState as l, useMocDocumentsInSelectedDrive as n, createState as o, useMocDocumentsInSelectedFolder as r, defaultGlobalState as s, useMocDocumentById as t, MocController as u };

//# sourceMappingURL=moc-CxzmRV1n.js.map