define([
    'knockout',
    'jquery',
    'arches',
    'viewmodels/workflow',
    'templates/views/components/plugins/inmaterial-workflow.htm',
    'views/components/workflows/final-step'
], function(ko, $, arches, Workflow, InmaterialWorkflowTemplate) {
    return ko.components.register('inmaterial-workflow', {
        viewModel: function(params) {
            this.componentName = 'inmaterial-workflow';
            this.quitUrl = "/plugins/registro-abreviado";
            this.stepConfig = [
                {
                    title: 'Crear nuevo Patrimonio Inmaterial',
                    name: 'fijar-info-pi-basica',  /* unique to workflow */
                    required: true,
                    workflowstepclass: 'crear-pcb-pi-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-pi-lugar', /* unique to step */
                                    tilesManaged: 'one',
                                    parameters: {
                                        graphid: '9b0e22c7-5c56-4be6-aa89-ae2632ba28e8',
                                        nodegroupid: '590ea397-83c9-11ee-8351-b3afcc77ba3e',
                                        hiddenNodes: "['3bb3aefc-d658-11ee-95bc-e96777d12b77', '590ea395-83c9-11ee-8351-b3afcc77ba3e', '590ea39a-83c9-11ee-8351-b3afcc77ba3e']",
                                    },
                                },
                            ], 
                        },
                    ]
                },
                {
                    title: 'Establecer Ámbito y subámbito',
                    name: 'fijar-alcance',  /* unique to workflow */
                    required: true,
                    informationboxdata: {
                        heading: 'Establezca El Ámbito y el subámbito del Patrimonio, procure llenar ambos valores',
                        text: 'Finalmente introduzca un valor numérico en el campo del Código principal... o \
                            introduzca el caracter ? para que el sistema asigne un valor continuando la secuencia.',
                    },
                    layoutSections: [
                        {
                            componentConfigs: [
                                {
                                    componentName: 'default-card',
                                    uniqueInstanceName: 'pcb-pi-alcance', /* unique to step */
                                    tilesManaged: 'one',
                                    parameters: {
                                        graphid: '9b0e22c7-5c56-4be6-aa89-ae2632ba28e8',
                                        nodegroupid: '7406f472-83cd-11ee-8351-b3afcc77ba3e',
                                        hiddenNodes: [
                                            '1991315c-dc96-11ee-a1be-65cdbcd6a3c5',
                                            '40a3ea0a-83d1-11ee-8351-b3afcc77ba3e',
                                            'd7935cd2-83d8-11ee-8351-b3afcc77ba3e',
                                            '6ad432e4-d28c-11ee-9bd3-55ef88b37b94',
                                            '1590de86-d28c-11ee-9bd3-55ef88b37b94',
                                            '3bf0b76e-83da-11ee-8351-b3afcc77ba3e',
                                            '095779fc-dc98-11ee-a1be-65cdbcd6a3c5',
                                        ],
                                        resourceid: "['fijar-info-pi-basica']['pcb-pi-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-pi-basica']['pcb-pi-lugar'][0]['resourceInstanceId']",
                                    },
                                },
                            ], 
                        },
                    ],
                }
            ];
            Workflow.apply(this, [params]);
        },
        template: InmaterialWorkflowTemplate,
    });
});
