// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import { ElementTemplateLifecycleConstant } from './lifecycle-constant.js';
export function createElementTemplateUpdateEvent(payload) {
    const flowIds = payload.ops.length > 0 && payload.flowIds && payload.flowIds.length > 0
        ? payload.flowIds
        : undefined;
    return {
        type: ElementTemplateLifecycleConstant.update,
        data: {
            payload: JSON.stringify(payload),
            patchOptions: {
                pipelineOptions: payload.flushOptions.pipelineOptions,
                reloadVersion: payload.reloadVersion,
                flowIds,
            },
        },
    };
}
export function parseElementTemplateUpdateEventPayload(data) {
    return JSON.parse(data.payload);
}
//# sourceMappingURL=update-event.js.map