define([
    'knockout',
    'jquery',
    'arches',
    'viewmodels/workflow',
    'templates/views/components/plugins/sitios-arqueologicos-workflow.htm',
    'views/components/workflows/final-step'
], function(ko, $, arches, Workflow, SitiosArqueologicosWorkflowTemplate) {
    return ko.components.register('sitios-arqueologicos-workflow', {
        viewModel: function(params) {
            this.componentName = 'sitios-arqueologicos-workflow';
            this.quitUrl = "/search";
            this.stepConfig = [
                {
                    title: 'Crear nuevo Patrimonio Material de tipo Sitio arqueológico',
                    name: 'fijar-info-sa-basica',  /* unique to workflow */
                    required: true,
                    workflowstepclass: 'crear-pcb-sa-atajo',
                    informationboxdata: {
                        heading: 'Primero, establezca la ubicación Administrativa, Departamento / Provincia / Municipio',
                        text: 'Este descriptor es relevante para la conformación del código de identificación principal',
                    },
                    layoutSections: [
                        {
                            componentConfigs: [
                                {
                                    componentName: 'default-card',
                                    uniqueInstanceName: 'pcb-sa-lugar', /* unique to step */
                                    tilesManaged: 'one',
                                    parameters: {
                                        graphid: '76331d8a-4d85-11ee-a708-ffcd06c08a5d',
                                        nodegroupid: 'bcd5a136-87f3-11f0-9b11-0243bbc25517',
                                        hiddenNodes: "['7706bf7c-87f4-11f0-be17-0243bbc25517', 'c198f1ae-87f4-11f0-be17-0243bbc25517', 'f32a23aa-87f4-11f0-9b11-0243bbc25517']",
                                    },
                                },
                            ], 
                        },
                    ]
                },
                {
                    title: 'Establecer Ámbito y subámbito',
                    name: 'fijar-alcance',  /* unique to workflow */
                    required: true,
                    informationboxdata: {
                        heading: 'Valores predeterminados para Ámbito y el subámbito se recomienda no modificar, a no ser de casos especiales',
                        text: 'Finalmente establezca el valor para la ubicación urbana (parte derecha del codigo)',
                    },
                    layoutSections: [
                        {
                            componentConfigs: [
                                {
                                    componentName: 'default-card',
                                    uniqueInstanceName: 'pcb-sa-alcance', /* unique to step */
                                    tilesManaged: 'one',
                                    parameters: {
                                        graphid: '76331d8a-4d85-11ee-a708-ffcd06c08a5d',
                                        nodegroupid: '76331d91-4d85-11ee-a708-ffcd06c08a5d',
                                        hiddenNodes: ['188f6ab8-87f7-11f0-9b11-0243bbc25517'],
                                        resourceid: "['fijar-info-sa-basica']['pcb-sa-lugar'][0]['resourceInstanceId']",
                                    },
                                },
                            ], 
                        },
                    ],
                },
                {
                    title: 'Finalizar',
                    name: 'add-resource-complete',  /* unique to workflow */
                    description: 'Finalizar la creación del registro patrimonial.',
                    layoutSections: [
                        {
                            componentConfigs: [
                                { 
                                    componentName: 'final-step',
                                    uniqueInstanceName: 'create-resource-final',
                                    tilesManaged: 'none',
                                    parameters: {
                                        resourceid: "['fijar-info-sa-basica']['pcb-sa-lugar'][0]['resourceInstanceId']",
                                    },
                                },
                            ], 
                        },
                    ],
                }
            ];
            Workflow.apply(this, [params]);
        },
        template: SitiosArqueologicosWorkflowTemplate,
    });
});