import { p as createBaseState, t as PHDocumentController, v as defaultBaseState } from "./dist-uUUuTqM0.js";
import { a as utils, d as isSnapshotReportDocument, l as assertIsSnapshotReportDocument, t as SnapshotReport } from "./module-CIT3HO-c.js";
import { O as useSelectedDocument, _ as useDocumentsInSelectedFolder, g as useDocumentsInSelectedDrive, p as useDocumentById } from "./dist-mx7YTOSV.js";
//#region document-models/snapshot-report/v1/gen/ph-factories.ts
function defaultGlobalState() {
	return {
		ownerIds: [],
		accountsDocumentId: null,
		startDate: null,
		endDate: null,
		reportName: null,
		reportPeriodStart: null,
		reportPeriodEnd: null,
		snapshotAccounts: []
	};
}
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 SnapshotReportDocument with custom global and local state
* This properly handles the PHBaseState requirements while allowing
* document-specific state to be set.
*/
function createSnapshotReportDocument(state) {
	return utils.createDocument(state ? createState(createBaseState(state.auth, state.document), state.global, state.local) : void 0);
}
//#endregion
//#region document-models/snapshot-report/v1/gen/controller.ts
const SnapshotReportController = PHDocumentController.forDocumentModel(SnapshotReport);
//#endregion
//#region document-models/snapshot-report/v1/hooks.ts
/** Hook to get a SnapshotReport document by its id */
function useSnapshotReportDocumentById(documentId) {
	const [document, dispatch] = useDocumentById(documentId);
	if (!isSnapshotReportDocument(document)) return [void 0, void 0];
	return [document, dispatch];
}
/** Hook to get the selected SnapshotReport document */
function useSelectedSnapshotReportDocument() {
	const [document, dispatch] = useSelectedDocument();
	assertIsSnapshotReportDocument(document);
	return [document, dispatch];
}
/** Hook to get all SnapshotReport documents in the selected drive */
function useSnapshotReportDocumentsInSelectedDrive() {
	return useDocumentsInSelectedDrive()?.filter(isSnapshotReportDocument);
}
/** Hook to get all SnapshotReport documents in the selected folder */
function useSnapshotReportDocumentsInSelectedFolder() {
	return useDocumentsInSelectedFolder()?.filter(isSnapshotReportDocument);
}
//#endregion
//#region document-models/snapshot-report/upgrades/versions.ts
const supportedVersions = [1];
const latestVersion = supportedVersions[0];
//#endregion
//#region document-models/snapshot-report/upgrades/upgrade-manifest.ts
const snapshotReportUpgradeManifest = {
	documentType: "powerhouse/snapshot-report",
	latestVersion,
	supportedVersions,
	upgrades: {}
};
//#endregion
export { useSnapshotReportDocumentById as a, SnapshotReportController as c, defaultGlobalState as d, defaultLocalState as f, useSelectedSnapshotReportDocument as i, createSnapshotReportDocument as l, latestVersion as n, useSnapshotReportDocumentsInSelectedDrive as o, defaultPHState as p, supportedVersions as r, useSnapshotReportDocumentsInSelectedFolder as s, snapshotReportUpgradeManifest as t, createState as u };

//# sourceMappingURL=snapshot-report-B5WIHbu8.js.map