import { r as __exportAll } from "./chunk-BSw8zbkd.mjs";
import { A as any, B as generateId, F as number, I as object, L as string, N as lazy, P as literal, a as BaseDocumentHeaderSchema, b as isDocumentAction, c as baseCreateDocument, f as createAction, g as createState, h as createReducer, j as array, k as _enum, l as baseLoadFromInput, o as BaseDocumentStateSchema, s as baseActions, u as baseSaveToFileHandle, v as defaultBaseState, z as datetime } from "./dist-RakiOObV.mjs";
//#region document-models/moc/v1/gen/schema/zod.ts
const isDefinedNonNullAny = (v) => v !== void 0 && v !== null;
const definedNonNullAnySchema = any().refine((v) => isDefinedNonNullAny(v));
const MocTierSchema = _enum([
	"DOMAIN",
	"HUB",
	"TOPIC"
]);
function AddChildMocInputSchema() {
	return object({ childRef: string() });
}
function AddCoreIdeaInputSchema() {
	return object({
		addedAt: datetime(),
		addedBy: string().nullish(),
		contextPhrase: string(),
		id: string(),
		noteRef: string(),
		sortOrder: number()
	});
}
function AddOpenQuestionInputSchema() {
	return object({ question: string() });
}
function AddTensionInputSchema() {
	return object({
		addedAt: datetime(),
		description: string(),
		id: string(),
		involvedRefs: array(string())
	});
}
function CreateMocInputSchema() {
	return object({
		createdAt: datetime(),
		description: string(),
		orientation: string(),
		parentRef: string().nullish(),
		tier: MocTierSchema,
		title: string()
	});
}
function MocEntrySchema() {
	return object({
		__typename: literal("MocEntry").optional(),
		addedAt: datetime().nullish(),
		addedBy: string().nullish(),
		contextPhrase: string(),
		id: string(),
		noteRef: string(),
		sortOrder: number()
	});
}
function MocStateSchema() {
	return object({
		__typename: literal("MocState").optional(),
		agentNotes: array(string()),
		childRefs: array(string()),
		coreIdeas: array(lazy(() => MocEntrySchema())),
		createdAt: datetime().nullish(),
		description: string().nullish(),
		noteCount: number().nullish(),
		openQuestions: array(string()),
		orientation: string().nullish(),
		parentRef: string().nullish(),
		tensions: array(lazy(() => MocTensionEntrySchema())),
		tier: MocTierSchema.nullish(),
		title: string().nullish(),
		updatedAt: datetime().nullish()
	});
}
function MocTensionEntrySchema() {
	return object({
		__typename: literal("MocTensionEntry").optional(),
		addedAt: datetime().nullish(),
		description: string(),
		id: string(),
		involvedRefs: array(string())
	});
}
function RemoveChildMocInputSchema() {
	return object({ childRef: string() });
}
function RemoveCoreIdeaInputSchema() {
	return object({ id: string() });
}
function RemoveOpenQuestionInputSchema() {
	return object({ question: string() });
}
function RemoveTensionInputSchema() {
	return object({ id: string() });
}
function ReorderCoreIdeasInputSchema() {
	return object({ ids: array(string()) });
}
function UpdateCoreIdeaInputSchema() {
	return object({
		contextPhrase: string().nullish(),
		id: string(),
		sortOrder: number().nullish()
	});
}
function UpdateDescriptionInputSchema() {
	return object({
		description: string(),
		updatedAt: datetime()
	});
}
function UpdateOrientationInputSchema() {
	return object({
		orientation: string(),
		updatedAt: datetime()
	});
}
//#endregion
//#region document-models/moc/v1/gen/moc-management/creators.ts
/**
* WARNING: DO NOT EDIT
* This file is auto-generated and updated by codegen
*/
var creators_exports = /* @__PURE__ */ __exportAll({
	addChildMoc: () => addChildMoc,
	addCoreIdea: () => addCoreIdea,
	addOpenQuestion: () => addOpenQuestion,
	addTension: () => addTension,
	createMoc: () => createMoc,
	removeChildMoc: () => removeChildMoc,
	removeCoreIdea: () => removeCoreIdea,
	removeOpenQuestion: () => removeOpenQuestion,
	removeTension: () => removeTension,
	reorderCoreIdeas: () => reorderCoreIdeas,
	updateCoreIdea: () => updateCoreIdea,
	updateDescription: () => updateDescription,
	updateOrientation: () => updateOrientation
});
const createMoc = (input) => createAction("CREATE_MOC", { ...input }, void 0, CreateMocInputSchema, "global");
const updateOrientation = (input) => createAction("UPDATE_ORIENTATION", { ...input }, void 0, UpdateOrientationInputSchema, "global");
const updateDescription = (input) => createAction("UPDATE_DESCRIPTION", { ...input }, void 0, UpdateDescriptionInputSchema, "global");
const addCoreIdea = (input) => createAction("ADD_CORE_IDEA", { ...input }, void 0, AddCoreIdeaInputSchema, "global");
const updateCoreIdea = (input) => createAction("UPDATE_CORE_IDEA", { ...input }, void 0, UpdateCoreIdeaInputSchema, "global");
const removeCoreIdea = (input) => createAction("REMOVE_CORE_IDEA", { ...input }, void 0, RemoveCoreIdeaInputSchema, "global");
const reorderCoreIdeas = (input) => createAction("REORDER_CORE_IDEAS", { ...input }, void 0, ReorderCoreIdeasInputSchema, "global");
const addTension = (input) => createAction("ADD_TENSION", { ...input }, void 0, AddTensionInputSchema, "global");
const removeTension = (input) => createAction("REMOVE_TENSION", { ...input }, void 0, RemoveTensionInputSchema, "global");
const addOpenQuestion = (input) => createAction("ADD_OPEN_QUESTION", { ...input }, void 0, AddOpenQuestionInputSchema, "global");
const removeOpenQuestion = (input) => createAction("REMOVE_OPEN_QUESTION", { ...input }, void 0, RemoveOpenQuestionInputSchema, "global");
const addChildMoc = (input) => createAction("ADD_CHILD_MOC", { ...input }, void 0, AddChildMocInputSchema, "global");
const removeChildMoc = (input) => createAction("REMOVE_CHILD_MOC", { ...input }, void 0, RemoveChildMocInputSchema, "global");
//#endregion
//#region document-models/moc/v1/actions.ts
/**
* WARNING: DO NOT EDIT
* This file is auto-generated and updated by codegen
*/
/** Actions for the Moc document model */
const actions = {
	...baseActions,
	...creators_exports
};
//#endregion
//#region document-models/moc/v1/gen/document-model.ts
const documentModel = {
	author: {
		name: "BAI",
		website: "https://bai.powerhouse.io/"
	},
	description: "Map of Content — navigation and synthesis document organizing knowledge notes by topic. Hub → domain → topic hierarchy with core ideas, tensions, and traversal hints",
	extension: "",
	id: "bai/moc",
	name: "Moc",
	specifications: [{
		changeLog: [],
		modules: [{
			description: "MOC lifecycle and content operations",
			id: "moc-management",
			name: "moc-management",
			operations: [
				{
					description: "Initialize a new Map of Content",
					errors: [],
					examples: [],
					id: "create-moc",
					name: "CREATE_MOC",
					reducer: "state.title = action.input.title;\nstate.description = action.input.description;\nstate.orientation = action.input.orientation;\nstate.tier = action.input.tier;\nstate.parentRef = action.input.parentRef || null;\nstate.createdAt = action.input.createdAt;\nstate.updatedAt = action.input.createdAt;",
					schema: "input CreateMocInput {\n    title: String!\n    description: String!\n    orientation: String!\n    tier: MocTier!\n    parentRef: String\n    createdAt: DateTime!\n}",
					template: "Initialize a new Map of Content",
					scope: "global"
				},
				{
					description: "Update the synthesis paragraph",
					errors: [],
					examples: [],
					id: "update-orientation",
					name: "UPDATE_ORIENTATION",
					reducer: "state.orientation = action.input.orientation;\nstate.updatedAt = action.input.updatedAt;",
					schema: "input UpdateOrientationInput {\n    orientation: String!\n    updatedAt: DateTime!\n}",
					template: "Update the synthesis paragraph",
					scope: "global"
				},
				{
					description: "Update the progressive disclosure summary",
					errors: [],
					examples: [],
					id: "update-description",
					name: "UPDATE_DESCRIPTION",
					reducer: "state.description = action.input.description;\nstate.updatedAt = action.input.updatedAt;",
					schema: "input UpdateDescriptionInput {\n    description: String!\n    updatedAt: DateTime!\n}",
					template: "Update the progressive disclosure summary",
					scope: "global"
				},
				{
					description: "Add a note to Core Ideas with context phrase",
					errors: [{
						code: "DUPLICATE_CORE_IDEA",
						description: "This note is already in Core Ideas",
						id: "err-duplicate-core-idea",
						name: "DuplicateCoreIdeaError",
						template: ""
					}],
					examples: [],
					id: "add-core-idea",
					name: "ADD_CORE_IDEA",
					reducer: "const existing = state.coreIdeas.find(c => c.noteRef === action.input.noteRef);\nif (existing) {\n    throw new DuplicateCoreIdeaError(\"This note is already in Core Ideas\");\n}\nstate.coreIdeas.push({\n    id: action.input.id,\n    noteRef: action.input.noteRef,\n    contextPhrase: action.input.contextPhrase,\n    sortOrder: action.input.sortOrder,\n    addedAt: action.input.addedAt,\n    addedBy: action.input.addedBy || null,\n});\nstate.noteCount = (state.noteCount || 0) + 1;",
					schema: "input AddCoreIdeaInput {\n    id: OID!\n    noteRef: String!\n    contextPhrase: String!\n    sortOrder: Int!\n    addedAt: DateTime!\n    addedBy: String\n}",
					template: "Add a note to Core Ideas with context phrase",
					scope: "global"
				},
				{
					description: "Update a core idea's context phrase or order",
					errors: [{
						code: "CORE_IDEA_NOT_FOUND",
						description: "Core idea not found",
						id: "err-core-idea-not-found-update",
						name: "CoreIdeaNotFoundError",
						template: ""
					}],
					examples: [],
					id: "update-core-idea",
					name: "UPDATE_CORE_IDEA",
					reducer: "const idea = state.coreIdeas.find(c => c.id === action.input.id);\nif (!idea) {\n    throw new CoreIdeaNotFoundError(\"Core idea not found\");\n}\nif (action.input.contextPhrase) idea.contextPhrase = action.input.contextPhrase;\nif (action.input.sortOrder !== undefined && action.input.sortOrder !== null) idea.sortOrder = action.input.sortOrder;",
					schema: "input UpdateCoreIdeaInput {\n    id: OID!\n    contextPhrase: String\n    sortOrder: Int\n}",
					template: "Update a core idea's context phrase or order",
					scope: "global"
				},
				{
					description: "Remove a note from Core Ideas",
					errors: [{
						code: "CORE_IDEA_NOT_FOUND",
						description: "Core idea not found",
						id: "err-core-idea-not-found-remove",
						name: "CoreIdeaNotFoundError",
						template: ""
					}],
					examples: [],
					id: "remove-core-idea",
					name: "REMOVE_CORE_IDEA",
					reducer: "const index = state.coreIdeas.findIndex(c => c.id === action.input.id);\nif (index === -1) {\n    throw new CoreIdeaNotFoundError(\"Core idea not found\");\n}\nstate.coreIdeas.splice(index, 1);\nstate.noteCount = Math.max(0, (state.noteCount || 0) - 1);",
					schema: "input RemoveCoreIdeaInput {\n    id: OID!\n}",
					template: "Remove a note from Core Ideas",
					scope: "global"
				},
				{
					description: "Reorder core ideas by providing ordered IDs",
					errors: [],
					examples: [],
					id: "reorder-core-ideas",
					name: "REORDER_CORE_IDEAS",
					reducer: "const reordered = action.input.ids.map((id, i) => {\n    const idea = state.coreIdeas.find(c => c.id === id);\n    if (idea) idea.sortOrder = i;\n    return idea;\n}).filter(Boolean);\nstate.coreIdeas = reordered;",
					schema: "input ReorderCoreIdeasInput {\n    ids: [OID!]!\n}",
					template: "Reorder core ideas by providing ordered IDs",
					scope: "global"
				},
				{
					description: "Add an unresolved tension",
					errors: [],
					examples: [],
					id: "add-tension",
					name: "ADD_TENSION",
					reducer: "state.tensions.push({\n    id: action.input.id,\n    description: action.input.description,\n    involvedRefs: action.input.involvedRefs,\n    addedAt: action.input.addedAt,\n});",
					schema: "input AddTensionInput {\n    id: OID!\n    description: String!\n    involvedRefs: [String!]!\n    addedAt: DateTime!\n}",
					template: "Add an unresolved tension",
					scope: "global"
				},
				{
					description: "Remove a resolved or dissolved tension",
					errors: [{
						code: "TENSION_NOT_FOUND",
						description: "Tension not found",
						id: "err-tension-not-found",
						name: "TensionNotFoundError",
						template: ""
					}],
					examples: [],
					id: "remove-tension",
					name: "REMOVE_TENSION",
					reducer: "const index = state.tensions.findIndex(t => t.id === action.input.id);\nif (index === -1) {\n    throw new TensionNotFoundError(\"Tension not found\");\n}\nstate.tensions.splice(index, 1);",
					schema: "input RemoveTensionInput {\n    id: OID!\n}",
					template: "Remove a resolved or dissolved tension",
					scope: "global"
				},
				{
					description: "Add an unexplored direction",
					errors: [],
					examples: [],
					id: "add-open-question",
					name: "ADD_OPEN_QUESTION",
					reducer: "state.openQuestions.push(action.input.question);",
					schema: "input AddOpenQuestionInput {\n    question: String!\n}",
					template: "Add an unexplored direction",
					scope: "global"
				},
				{
					description: "Remove an open question",
					errors: [],
					examples: [],
					id: "remove-open-question",
					name: "REMOVE_OPEN_QUESTION",
					reducer: "state.openQuestions = state.openQuestions.filter(q => q !== action.input.question);",
					schema: "input RemoveOpenQuestionInput {\n    question: String!\n}",
					template: "Remove an open question",
					scope: "global"
				},
				{
					description: "Add a child MOC reference",
					errors: [{
						code: "DUPLICATE_CHILD_MOC",
						description: "This child MOC is already linked",
						id: "err-duplicate-child-moc",
						name: "DuplicateChildMocError",
						template: ""
					}],
					examples: [],
					id: "add-child-moc",
					name: "ADD_CHILD_MOC",
					reducer: "if (state.childRefs.includes(action.input.childRef)) {\n    throw new DuplicateChildMocError(\"This child MOC is already linked\");\n}\nstate.childRefs.push(action.input.childRef);",
					schema: "input AddChildMocInput {\n    childRef: String!\n}",
					template: "Add a child MOC reference",
					scope: "global"
				},
				{
					description: "Remove a child MOC reference",
					errors: [],
					examples: [],
					id: "remove-child-moc",
					name: "REMOVE_CHILD_MOC",
					reducer: "state.childRefs = state.childRefs.filter(r => r !== action.input.childRef);",
					schema: "input RemoveChildMocInput {\n    childRef: String!\n}",
					template: "Remove a child MOC reference",
					scope: "global"
				}
			]
		}],
		state: {
			global: {
				examples: [],
				initialValue: "{\n    \"title\": null,\n    \"description\": null,\n    \"orientation\": null,\n    \"tier\": null,\n    \"coreIdeas\": [],\n    \"tensions\": [],\n    \"openQuestions\": [],\n    \"agentNotes\": [],\n    \"parentRef\": null,\n    \"childRefs\": [],\n    \"noteCount\": 0,\n    \"createdAt\": null,\n    \"updatedAt\": null\n}",
				schema: "enum MocTier {\n    HUB\n    DOMAIN\n    TOPIC\n}\n\ntype MocEntry {\n    id: OID!\n    noteRef: String!\n    contextPhrase: String!\n    sortOrder: Int!\n    addedAt: DateTime\n    addedBy: String\n}\n\ntype MocTensionEntry {\n    id: OID!\n    description: String!\n    involvedRefs: [String!]!\n    addedAt: DateTime\n}\n\ntype MocState {\n    title: String\n    description: String\n    orientation: String\n    tier: MocTier\n    coreIdeas: [MocEntry!]!\n    tensions: [MocTensionEntry!]!\n    openQuestions: [String!]!\n    agentNotes: [String!]!\n    parentRef: String\n    childRefs: [String!]!\n    noteCount: Int\n    createdAt: DateTime\n    updatedAt: DateTime\n}"
			},
			local: {
				examples: [],
				initialValue: "",
				schema: ""
			}
		},
		version: 1
	}]
};
//#endregion
//#region document-models/moc/v1/gen/moc-management/error.ts
var DuplicateCoreIdeaError = class extends Error {
	errorCode = "DuplicateCoreIdeaError";
	constructor(message = "DuplicateCoreIdeaError") {
		super(message);
	}
};
var CoreIdeaNotFoundError = class extends Error {
	errorCode = "CoreIdeaNotFoundError";
	constructor(message = "CoreIdeaNotFoundError") {
		super(message);
	}
};
var TensionNotFoundError = class extends Error {
	errorCode = "TensionNotFoundError";
	constructor(message = "TensionNotFoundError") {
		super(message);
	}
};
var DuplicateChildMocError = class extends Error {
	errorCode = "DuplicateChildMocError";
	constructor(message = "DuplicateChildMocError") {
		super(message);
	}
};
//#endregion
//#region document-models/moc/v1/src/reducers/moc-management.ts
const mocMocManagementOperations = {
	createMocOperation(state, action) {
		state.title = action.input.title;
		state.description = action.input.description;
		state.orientation = action.input.orientation;
		state.tier = action.input.tier;
		state.parentRef = action.input.parentRef || null;
		state.createdAt = action.input.createdAt;
		state.updatedAt = action.input.createdAt;
	},
	updateOrientationOperation(state, action) {
		state.orientation = action.input.orientation;
		state.updatedAt = action.input.updatedAt;
	},
	updateDescriptionOperation(state, action) {
		state.description = action.input.description;
		state.updatedAt = action.input.updatedAt;
	},
	addCoreIdeaOperation(state, action) {
		if (state.coreIdeas.find((c) => c.noteRef === action.input.noteRef)) throw new DuplicateCoreIdeaError("This note is already in Core Ideas");
		state.coreIdeas.push({
			id: action.input.id,
			noteRef: action.input.noteRef,
			contextPhrase: action.input.contextPhrase,
			sortOrder: action.input.sortOrder,
			addedAt: action.input.addedAt,
			addedBy: action.input.addedBy || null
		});
		state.noteCount = (state.noteCount || 0) + 1;
	},
	updateCoreIdeaOperation(state, action) {
		const idea = state.coreIdeas.find((c) => c.id === action.input.id);
		if (!idea) throw new CoreIdeaNotFoundError("Core idea not found");
		if (action.input.contextPhrase) idea.contextPhrase = action.input.contextPhrase;
		if (action.input.sortOrder !== void 0 && action.input.sortOrder !== null) idea.sortOrder = action.input.sortOrder;
	},
	removeCoreIdeaOperation(state, action) {
		const index = state.coreIdeas.findIndex((c) => c.id === action.input.id);
		if (index === -1) throw new CoreIdeaNotFoundError("Core idea not found");
		state.coreIdeas.splice(index, 1);
		state.noteCount = Math.max(0, (state.noteCount || 0) - 1);
	},
	reorderCoreIdeasOperation(state, action) {
		state.coreIdeas = action.input.ids.map((id, i) => {
			const idea = state.coreIdeas.find((c) => c.id === id);
			if (idea) idea.sortOrder = i;
			return idea;
		}).filter((idea) => Boolean(idea));
	},
	addTensionOperation(state, action) {
		state.tensions.push({
			id: action.input.id,
			description: action.input.description,
			involvedRefs: action.input.involvedRefs,
			addedAt: action.input.addedAt
		});
	},
	removeTensionOperation(state, action) {
		const index = state.tensions.findIndex((t) => t.id === action.input.id);
		if (index === -1) throw new TensionNotFoundError("Tension not found");
		state.tensions.splice(index, 1);
	},
	addOpenQuestionOperation(state, action) {
		state.openQuestions.push(action.input.question);
	},
	removeOpenQuestionOperation(state, action) {
		state.openQuestions = state.openQuestions.filter((q) => q !== action.input.question);
	},
	addChildMocOperation(state, action) {
		if (state.childRefs.includes(action.input.childRef)) throw new DuplicateChildMocError("This child MOC is already linked");
		state.childRefs.push(action.input.childRef);
	},
	removeChildMocOperation(state, action) {
		state.childRefs = state.childRefs.filter((r) => r !== action.input.childRef);
	}
};
//#endregion
//#region document-models/moc/v1/gen/reducer.ts
const stateReducer = (state, action, dispatch) => {
	if (isDocumentAction(action)) return state;
	switch (action.type) {
		case "CREATE_MOC":
			CreateMocInputSchema().parse(action.input);
			mocMocManagementOperations.createMocOperation(state[action.scope], action, dispatch);
			break;
		case "UPDATE_ORIENTATION":
			UpdateOrientationInputSchema().parse(action.input);
			mocMocManagementOperations.updateOrientationOperation(state[action.scope], action, dispatch);
			break;
		case "UPDATE_DESCRIPTION":
			UpdateDescriptionInputSchema().parse(action.input);
			mocMocManagementOperations.updateDescriptionOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_CORE_IDEA":
			AddCoreIdeaInputSchema().parse(action.input);
			mocMocManagementOperations.addCoreIdeaOperation(state[action.scope], action, dispatch);
			break;
		case "UPDATE_CORE_IDEA":
			UpdateCoreIdeaInputSchema().parse(action.input);
			mocMocManagementOperations.updateCoreIdeaOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_CORE_IDEA":
			RemoveCoreIdeaInputSchema().parse(action.input);
			mocMocManagementOperations.removeCoreIdeaOperation(state[action.scope], action, dispatch);
			break;
		case "REORDER_CORE_IDEAS":
			ReorderCoreIdeasInputSchema().parse(action.input);
			mocMocManagementOperations.reorderCoreIdeasOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_TENSION":
			AddTensionInputSchema().parse(action.input);
			mocMocManagementOperations.addTensionOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_TENSION":
			RemoveTensionInputSchema().parse(action.input);
			mocMocManagementOperations.removeTensionOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_OPEN_QUESTION":
			AddOpenQuestionInputSchema().parse(action.input);
			mocMocManagementOperations.addOpenQuestionOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_OPEN_QUESTION":
			RemoveOpenQuestionInputSchema().parse(action.input);
			mocMocManagementOperations.removeOpenQuestionOperation(state[action.scope], action, dispatch);
			break;
		case "ADD_CHILD_MOC":
			AddChildMocInputSchema().parse(action.input);
			mocMocManagementOperations.addChildMocOperation(state[action.scope], action, dispatch);
			break;
		case "REMOVE_CHILD_MOC":
			RemoveChildMocInputSchema().parse(action.input);
			mocMocManagementOperations.removeChildMocOperation(state[action.scope], action, dispatch);
			break;
		default: return state;
	}
};
const reducer = createReducer(stateReducer);
//#endregion
//#region document-models/moc/v1/gen/document-type.ts
/**
* WARNING: DO NOT EDIT
* This file is auto-generated and updated by codegen
*/
const mocDocumentType = "bai/moc";
//#endregion
//#region document-models/moc/v1/gen/document-schema.ts
/**
* WARNING: DO NOT EDIT
* This file is auto-generated and updated by codegen
*/
/** Schema for validating the header object of a Moc document */
const MocDocumentHeaderSchema = BaseDocumentHeaderSchema.extend({ documentType: literal(mocDocumentType) });
/** Schema for validating the state object of a Moc document */
const MocPHStateSchema = BaseDocumentStateSchema.extend({ global: MocStateSchema() });
const MocDocumentSchema = object({
	header: MocDocumentHeaderSchema,
	state: MocPHStateSchema,
	initialState: MocPHStateSchema
});
/** Simple helper function to check if a state object is a Moc document state object */
function isMocState(state) {
	return MocPHStateSchema.safeParse(state).success;
}
/** Simple helper function to assert that a document state object is a Moc document state object */
function assertIsMocState(state) {
	MocPHStateSchema.parse(state);
}
/** Simple helper function to check if a document is a Moc document */
function isMocDocument(document) {
	return MocDocumentSchema.safeParse(document).success;
}
/** Simple helper function to assert that a document is a Moc document */
function assertIsMocDocument(document) {
	MocDocumentSchema.parse(document);
}
//#endregion
//#region document-models/moc/v1/gen/utils.ts
const initialGlobalState = {
	title: null,
	description: null,
	orientation: null,
	tier: null,
	coreIdeas: [],
	tensions: [],
	openQuestions: [],
	agentNotes: [],
	parentRef: null,
	childRefs: [],
	noteCount: 0,
	createdAt: null,
	updatedAt: null
};
const initialLocalState = {};
const utils$1 = {
	fileExtension: "",
	createState(state) {
		return {
			...defaultBaseState(),
			global: {
				...initialGlobalState,
				...state?.global
			},
			local: {
				...initialLocalState,
				...state?.local
			}
		};
	},
	createDocument(state) {
		const document = baseCreateDocument(utils$1.createState, state);
		document.header.documentType = mocDocumentType;
		document.header.id = generateId();
		return document;
	},
	saveToFileHandle(document, input) {
		return baseSaveToFileHandle(document, input);
	},
	loadFromInput(input) {
		return baseLoadFromInput(input, reducer);
	},
	isStateOfType(state) {
		return isMocState(state);
	},
	assertIsStateOfType(state) {
		return assertIsMocState(state);
	},
	isDocumentOfType(document) {
		return isMocDocument(document);
	},
	assertIsDocumentOfType(document) {
		return assertIsMocDocument(document);
	}
};
//#endregion
//#region document-models/moc/v1/src/utils.ts
var utils_exports = /* @__PURE__ */ __exportAll({});
//#endregion
//#region document-models/moc/v1/utils.ts
/** Utils for the Moc document model */
const utils = {
	...utils$1,
	...utils_exports
};
//#endregion
//#region document-models/moc/v1/module.ts
/** Document model module for the Moc document type */
const Moc = {
	version: 1,
	reducer,
	actions,
	utils,
	documentModel: createState(defaultBaseState(), documentModel)
};
//#endregion
export { updateOrientation as A, RemoveChildMocInputSchema as B, removeChildMoc as C, reorderCoreIdeas as D, removeTension as E, CreateMocInputSchema as F, UpdateCoreIdeaInputSchema as G, RemoveOpenQuestionInputSchema as H, MocEntrySchema as I, definedNonNullAnySchema as J, UpdateDescriptionInputSchema as K, MocStateSchema as L, AddCoreIdeaInputSchema as M, AddOpenQuestionInputSchema as N, updateCoreIdea as O, AddTensionInputSchema as P, MocTensionEntrySchema as R, creators_exports as S, removeOpenQuestion as T, RemoveTensionInputSchema as U, RemoveCoreIdeaInputSchema as V, ReorderCoreIdeasInputSchema as W, isDefinedNonNullAny as Y, addChildMoc as _, utils$1 as a, addTension as b, MocPHStateSchema as c, isMocDocument as d, isMocState as f, actions as g, documentModel as h, initialLocalState as i, AddChildMocInputSchema as j, updateDescription as k, assertIsMocDocument as l, reducer as m, utils as n, MocDocumentHeaderSchema as o, mocDocumentType as p, UpdateOrientationInputSchema as q, initialGlobalState as r, MocDocumentSchema as s, Moc as t, assertIsMocState as u, addCoreIdea as v, removeCoreIdea as w, createMoc as x, addOpenQuestion as y, MocTierSchema as z };

//# sourceMappingURL=module-BR-YtMNM.mjs.map