import { p as createBaseState, t as PHDocumentController, v as defaultBaseState } from "./dist-RakiOObV.mjs";
import { T as useDocumentById, c as useDocumentsInSelectedFolder, g as useSelectedDocument, s as useDocumentsInSelectedDrive } from "./dist-DFMBprYi.mjs";
import { a as utils, d as isPipelineQueueDocument, l as assertIsPipelineQueueDocument, t as PipelineQueue } from "./module-DYhTlUAr.mjs";
//#region document-models/pipeline-queue/v1/gen/controller.ts
/**
* WARNING: DO NOT EDIT
* This file is auto-generated and updated by codegen
*/
const PipelineQueueController = PHDocumentController.forDocumentModel(PipelineQueue);
//#endregion
//#region document-models/pipeline-queue/v1/gen/ph-factories.ts
function defaultGlobalState() {
	return {
		schemaVersion: 3,
		phaseOrder: [{
			taskType: "claim",
			phases: [
				"create",
				"reflect",
				"reweave",
				"verify"
			]
		}, {
			taskType: "enrichment",
			phases: [
				"enrich",
				"reflect",
				"reweave",
				"verify"
			]
		}],
		tasks: [],
		completedCount: 0,
		activeCount: 0,
		lastProcessedAt: 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 PipelineQueueDocument with custom global and local state
* This properly handles the PHBaseState requirements while allowing
* document-specific state to be set.
*/
function createPipelineQueueDocument(state) {
	return utils.createDocument(state ? createState(createBaseState(state.auth, state.document), state.global, state.local) : void 0);
}
//#endregion
//#region document-models/pipeline-queue/v1/hooks.ts
/** Hook to get a PipelineQueue document by its id */
function usePipelineQueueDocumentById(documentId) {
	const [document, dispatch] = useDocumentById(documentId);
	if (!isPipelineQueueDocument(document)) return [void 0, void 0];
	return [document, dispatch];
}
/** Hook to get the selected PipelineQueue document */
function useSelectedPipelineQueueDocument() {
	const [document, dispatch] = useSelectedDocument();
	assertIsPipelineQueueDocument(document);
	return [document, dispatch];
}
/** Hook to get all PipelineQueue documents in the selected drive */
function usePipelineQueueDocumentsInSelectedDrive() {
	return useDocumentsInSelectedDrive()?.filter(isPipelineQueueDocument);
}
/** Hook to get all PipelineQueue documents in the selected folder */
function usePipelineQueueDocumentsInSelectedFolder() {
	return useDocumentsInSelectedFolder()?.filter(isPipelineQueueDocument);
}
//#endregion
export { createPipelineQueueDocument as a, defaultLocalState as c, useSelectedPipelineQueueDocument as i, defaultPHState as l, usePipelineQueueDocumentsInSelectedDrive as n, createState as o, usePipelineQueueDocumentsInSelectedFolder as r, defaultGlobalState as s, usePipelineQueueDocumentById as t, PipelineQueueController as u };

//# sourceMappingURL=pipeline-queue-CioH53De.mjs.map