import { Injectable } from '@angular/core';
    
@Injectable()
export class NodeService {
    [x: string]: any;
    getTreeNodesData() {
        return [
            {
                key: '0',
                label: 'Documents',
                data: 'Documents Folder',
                icon: 'pi pi-fw pi-inbox',
                children: [
                    {
                        key: '0-0',
                        label: 'Work',
                        data: 'Work Folder',
                        icon: 'pi pi-fw pi-cog',
                        children: [
                            { key: '0-0-0', label: 'Expenses.doc', icon: 'pi pi-fw pi-file', data: 'Expenses Document' },
                            { key: '0-0-1', label: 'Resume.doc', icon: 'pi pi-fw pi-file', data: 'Resume Document' }
                        ]
                    },
                    {
                        key: '0-1',
                        label: 'Home',
                        data: 'Home Folder',
                        icon: 'pi pi-fw pi-home',
                        children: [{ key: '0-1-0', label: 'Invoices.txt', icon: 'pi pi-fw pi-file', data: 'Invoices for this month' }]
                    }
                ]
            },
            {
                key: '1',
                label: 'Events',
                data: 'Events Folder',
                icon: 'pi pi-fw pi-calendar',
                children: [
                    { key: '1-0', label: 'Meeting', icon: 'pi pi-fw pi-calendar-plus', data: 'Meeting' },
                    { key: '1-1', label: 'Product Launch', icon: 'pi pi-fw pi-calendar-plus', data: 'Product Launch' },
                    { key: '1-2', label: 'Report Review', icon: 'pi pi-fw pi-calendar-plus', data: 'Report Review' }
                ]
            },
            {
                key: '2',
                label: 'Movies',
                data: 'Movies Folder',
                icon: 'pi pi-fw pi-star-fill',
                children: [
                    {
                        key: '2-0',
                        icon: 'pi pi-fw pi-star-fill',
                        label: 'Al Pacino',
                        data: 'Pacino Movies',
                        children: [
                            { key: '2-0-0', label: 'Scarface', icon: 'pi pi-fw pi-video', data: 'Scarface Movie' },
                            { key: '2-0-1', label: 'Serpico', icon: 'pi pi-fw pi-video', data: 'Serpico Movie' }
                        ]
                    },
                    {
                        key: '2-1',
                        label: 'Robert De Niro',
                        icon: 'pi pi-fw pi-star-fill',
                        data: 'De Niro Movies',
                        children: [
                            { key: '2-1-0', label: 'Goodfellas', icon: 'pi pi-fw pi-video', data: 'Goodfellas Movie' },
                            { key: '2-1-1', label: 'Untouchables', icon: 'pi pi-fw pi-video', data: 'Untouchables Movie' }
                        ]
                    }
                ]
            }
        ];
    }

    getTreeTableNodesData() {
        return [
            {
                key: '0',
                data: {
                    name: 'Applications',
                    view: '100kb',
                    add: 'Folder'
                },
                children: [
                    {
                        key: '0-0',
                        data: {
                            name: 'React',
                            view: '25kb',
                            add: 'Folder'
                        },
                        children: [
                            {
                                key: '0-0-0',
                                data: {
                                    name: 'react.app',
                                    view: '10kb',
                                    add: 'Application'
                                }
                            },
                            {
                                key: '0-0-1',
                                data: {
                                    name: 'native.app',
                                    view: '10kb',
                                    add: 'Application'
                                }
                            },
                            {
                                key: '0-0-2',
                                data: {
                                    name: 'mobile.app',
                                    view: '5kb',
                                    add: 'Application'
                                }
                            }
                        ]
                    },
                    {
                        key: '0-1',
                        data: {
                            name: 'editor.app',
                            view: '25kb',
                            add: 'Application'
                        }
                    },
                    {
                        key: '0-2',
                        data: {
                            name: 'settings.app',
                            view: '50kb',
                            add: 'Application'
                        }
                    }
                ]
            },
            {
                key: '1',
                data: {
                    name: 'Cloud',
                    view: '20kb',
                    add: 'Folder'
                },
                children: [
                    {
                        key: '1-0',
                        data: {
                            name: 'backup-1.zip',
                            view: '10kb',
                            add: 'Zip'
                        }
                    },
                    {
                        key: '1-1',
                        data: {
                            name: 'backup-2.zip',
                            view: '10kb',
                            add: 'Zip'
                        }
                    }
                ]
            },
            {
                key: '2',
                data: {
                    name: 'Desktop',
                    view: '150kb',
                    add: 'Folder'
                },
                children: [
                    {
                        key: '2-0',
                        data: {
                            name: 'note-meeting.txt',
                            view: '50kb',
                            add: 'Text'
                        }
                    },
                    {
                        key: '2-1',
                        data: {
                            name: 'note-todo.txt',
                            view: '100kb',
                            add: 'Text'
                        }
                    }
                ]
            },
            {
                key: '3',
                data: {
                    name: 'Documents',
                    view: '75kb',
                    add: 'Folder'
                },
                children: [
                    {
                        key: '3-0',
                        data: {
                            name: 'Work',
                            view: '55kb',
                            add: 'Folder'
                        },
                        children: [
                            {
                                key: '3-0-0',
                                data: {
                                    name: 'Expenses.doc',
                                    view: '30kb',
                                    add: 'Document'
                                }
                            },
                            {
                                key: '3-0-1',
                                data: {
                                    name: 'Resume.doc',
                                    view: '25kb',
                                    add: 'Resume'
                                }
                            }
                        ]
                    },
                    {
                        key: '3-1',
                        data: {
                            name: 'Home',
                            view: '20kb',
                            add: 'Folder'
                        },
                        children: [
                            {
                                key: '3-1-0',
                                data: {
                                    name: 'Invoices',
                                    view: '20kb',
                                    add: 'Text'
                                }
                            }
                        ]
                    }
                ]
            },
            {
                key: '4',
                data: {
                    name: 'Downloads',
                    view: '25kb',
                    add: 'Folder'
                },
                children: [
                    {
                        key: '4-0',
                        data: {
                            name: 'Spanish',
                            view: '10kb',
                            add: 'Folder'
                        },
                        children: [
                            {
                                key: '4-0-0',
                                data: {
                                    name: 'tutorial-a1.txt',
                                    view: '5kb',
                                    add: 'Text'
                                }
                            },
                            {
                                key: '4-0-1',
                                data: {
                                    name: 'tutorial-a2.txt',
                                    view: '5kb',
                                    add: 'Text'
                                }
                            }
                        ]
                    },
                    {
                        key: '4-1',
                        data: {
                            name: 'Travel',
                            view: '15kb',
                            add: 'Text'
                        },
                        children: [
                            {
                                key: '4-1-0',
                                data: {
                                    name: 'Hotel.pdf',
                                    view: '10kb',
                                    add: 'PDF'
                                }
                            },
                            {
                                key: '4-1-1',
                                data: {
                                    name: 'Flight.pdf',
                                    view: '5kb',
                                    add: 'PDF'
                                }
                            }
                        ]
                    }
                ]
            },
            {
                key: '5',
                data: {
                    name: 'Main',
                    view: '50kb',
                    add: 'Folder'
                },
                children: [
                    {
                        key: '5-0',
                        data: {
                            name: 'bin',
                            view: '50kb',
                            add: 'Link'
                        }
                    },
                    {
                        key: '5-1',
                        data: {
                            name: 'etc',
                            view: '100kb',
                            add: 'Link'
                        }
                    },
                    {
                        key: '5-2',
                        data: {
                            name: 'var',
                            view: '100kb',
                            add: 'Link'
                        }
                    }
                ]
            },
            {
                key: '6',
                data: {
                    name: 'Other',
                    view: '5kb',
                    add: 'Folder'
                },
                children: [
                    {
                        key: '6-0',
                        data: {
                            name: 'todo.txt',
                            view: '3kb',
                            add: 'Text'
                        }
                    },
                    {
                        key: '6-1',
                        data: {
                            name: 'logo.png',
                            view: '2kb',
                            add: 'Picture'
                        }
                    }
                ]
            },
            {
                key: '7',
                data: {
                    name: 'Pictures',
                    view: '150kb',
                    add: 'Folder'
                },
                children: [
                    {
                        key: '7-0',
                        data: {
                            name: 'barcelona.jpg',
                            view: '90kb',
                            add: 'Picture'
                        }
                    },
                    {
                        key: '7-1',
                        data: {
                            name: 'primeng.png',
                            view: '30kb',
                            add: 'Picture'
                        }
                    },
                    {
                        key: '7-2',
                        data: {
                            name: 'prime.jpg',
                            view: '30kb',
                            add: 'Picture'
                        }
                    }
                ]
            },
            {
                key: '8',
                data: {
                    name: 'Videos',
                    view: '1500kb',
                    add: 'Folder'
                },
                children: [
                    {
                        key: '8-0',
                        data: {
                            name: 'primefaces.mkv',
                            view: '1000kb',
                            add: 'Video'
                        }
                    },
                    {
                        key: '8-1',
                        data: {
                            name: 'intro.avi',
                            view: '500kb',
                            add: 'Video'
                        }
                    }
                ]
            }
        ];
    }

    getLazyNodesData() {
        return [
            {
                "label": "Lazy Node 0",
                "data": "Node 0",
                "expandedIcon": "pi pi-folder-open",
                "collapsedIcon": "pi pi-folder",
                "leaf": false
            },
            {
                "label": "Lazy Node 1",
                "data": "Node 1",
                "expandedIcon": "pi pi-folder-open",
                "collapsedIcon": "pi pi-folder",
                "leaf": false
            },
            {
                "label": "Lazy Node 1",
                "data": "Node 2",
                "expandedIcon": "pi pi-folder-open",
                "collapsedIcon": "pi pi-folder",
                "leaf": false
            }
        ]
    }

    getFileSystemNodesData() {
        return [  
            {  
                "data":{  
                    "name":"Applications",
                    "view":"200mb",
                    "add":"Folder"
                },
                "children":[  
                    {  
                        "data":{  
                            "name":"Angular",
                            "view":"25mb",
                            "add":"Folder"
                        },
                        "children":[  
                            {  
                                "data":{  
                                    "name":"angular.app",
                                    "view":"10mb",
                                    "add":"Application"
                                }
                            },
                            {  
                                "data":{  
                                    "name":"cli.app",
                                    "view":"10mb",
                                    "add":"Application"
                                }
                            },
                            {  
                                "data":{  
                                    "name":"mobile.app",
                                    "view":"5mb",
                                    "add":"Application"
                                }
                            }
                        ]
                    },
                    {  
                        "data":{  
                            "name":"editor.app",
                            "view":"25mb",
                            "add":"Application"
                        }
                    },
                    {  
                        "data":{  
                            "name":"settings.app",
                            "view":"50mb",
                            "add":"Application"
                        }
                    }
                ]
            },
            {  
                "data":{  
                    "name":"Cloud",
                    "view":"20mb",
                    "add":"Folder"
                },
                "children":[  
                    {  
                        "data":{  
                            "name":"backup-1.zip",
                            "view":"10mb",
                            "add":"Zip"
                        }
                    },
                    {  
                        "data":{  
                            "name":"backup-2.zip",
                            "view":"10mb",
                            "add":"Zip"
                        }
                    }
                ]
            },
            {  
                "data": {  
                    "name":"Desktop",
                    "view":"150kb",
                    "add":"Folder"
                },
                "children":[  
                    {  
                        "data":{  
                            "name":"note-meeting.txt",
                            "view":"50kb",
                            "add":"Text"
                        }
                    },
                    {  
                        "data":{  
                            "name":"note-todo.txt",
                            "view":"100kb",
                            "add":"Text"
                        }
                    }
                ]
            },
            {  
                "data":{  
                    "name":"Documents",
                    "view":"75kb",
                    "add":"Folder"
                },
                "children":[
                    {  
                        "data":{  
                            "name":"Work",
                            "view":"55kb",
                            "add":"Folder"
                        },
                        "children":[  
                            {  
                                "data":{  
                                    "name":"Expenses.doc",
                                    "view":"30kb",
                                    "add":"Document"
                                }
                            },
                            {  
                                "data":{  
                                    "name":"Resume.doc",
                                    "view":"25kb",
                                    "add":"Resume"
                                }
                            }
                        ]
                    },
                    {  
                        "data":{  
                            "name":"Home",
                            "view":"20kb",
                            "add":"Folder"
                        },
                        "children":[  
                            {  
                                "data":{  
                                    "name":"Invoices",
                                    "view":"20kb",
                                    "add":"Text"
                                }
                            }
                        ]
                    }
                ]
            },
            {  
                "data": {  
                    "name":"Downloads",
                    "view":"25mb",
                    "add":"Folder"
                },
                "children":[  
                    {  
                        "data": {  
                            "name":"Spanish",
                            "view":"10mb",
                            "add":"Folder"
                        },
                        "children":[  
                            {  
                                "data":{  
                                    "name":"tutorial-a1.txt",
                                    "view":"5mb",
                                    "add":"Text"
                                }
                            },
                            {  
                                "data":{  
                                    "name":"tutorial-a2.txt",
                                    "view":"5mb",
                                    "add":"Text"
                                }
                            }
                        ]
                    },
                    {  
                        "data":{  
                            "name":"Travel",
                            "view":"15mb",
                            "add":"Text"
                        },
                        "children":[  
                            {  
                                "data":{  
                                    "name":"Hotel.pdf",
                                    "view":"10mb",
                                    "add":"PDF"
                                }
                            },
                            {  
                                "data":{  
                                    "name":"Flight.pdf",
                                    "view":"5mb",
                                    "add":"PDF"
                                }
                            }
                        ]
                    }
                ]
            },
            {  
                "data": {  
                    "name":"Main",
                    "view":"50mb",
                    "add":"Folder"
                },
                "children":[  
                    {  
                        "data":{  
                            "name":"bin",
                            "view":"50kb",
                            "add":"Link"
                        }
                    },
                    {  
                        "data":{  
                            "name":"etc",
                            "view":"100kb",
                            "add":"Link"
                        }
                    },
                    {  
                        "data":{  
                            "name":"var",
                            "view":"100kb",
                            "add":"Link"
                        }
                    }
                ]
            },
            {  
                "data":{  
                    "name":"Other",
                    "view":"5mb",
                    "add":"Folder"
                },
                "children":[  
                    {  
                        "data":{  
                            "name":"todo.txt",
                            "view":"3mb",
                            "add":"Text"
                        }
                    },
                    {  
                        "data":{  
                            "name":"logo.png",
                            "view":"2mb",
                            "add":"Picture"
                        }
                    }
                ]
            },
            {  
                "data":{  
                    "name":"Pictures",
                    "view":"150kb",
                    "add":"Folder"
                },
                "children":[  
                    {  
                        "data":{  
                            "name":"barcelona.jpg",
                            "view":"90kb",
                            "add":"Picture"
                        }
                    },
                    {  
                        "data":{  
                            "name":"primeng.png",
                            "view":"30kb",
                            "add":"Picture"
                        }
                    },
                    {  
                        "data":{  
                            "name":"prime.jpg",
                            "view":"30kb",
                            "add":"Picture"
                        }
                    }
                ]
            },
            {  
                "data":{  
                    "name":"Videos",
                    "view":"1500mb",
                    "add":"Folder"
                },
                "children":[  
                    {  
                        "data":{  
                            "name":"primefaces.mkv",
                            "view":"1000mb",
                            "add":"Video"
                        }
                    },
                    {  
                        "data":{  
                            "name":"intro.avi",
                            "view":"500mb",
                            "add":"Video"
                        }
                    }
                ]
            }
        ]
    }
    
    getTreeTableNodes() {
        return Promise.resolve(this.getTreeTableNodesData());
    }

    getTreeNodes() {
        return Promise.resolve(this.getTreeNodesData());
    }

    getFiles() {
        return Promise.resolve(this.getTreeNodesData());
    }

    getLazyFiles() {
        return Promise.resolve(this.getLazyNodesData());
    }

    getFilesystem() {
        return Promise.resolve(this.getFileSystemNodesData());
    }
    
};