{"version":3,"sources":["webpack:///webpack/bootstrap a32a179e519de26be928","webpack:///./~/cjs-emitter/index.js","webpack:///./src/js/modules/launcher.api.provider.js","webpack:///./~/cjs-gettext/index.js","webpack:///./~/spa-gettext/index.js","webpack:///./src/js/main.js","webpack:///./src/js/modules/utils/eval.space.js"],"names":[],"mappings":";;;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;AChEA;AACA;AACA;AACA;;AAEA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C,+DAA+D;AAC3G;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,mCAAmC,MAAM;AACzC,mCAAmC;AACnC;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB;AACA;AACA,uDAAuD,MAAM;AAC7D;AACA,uDAAuD,MAAM;AAC7D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,8CAA8C,0DAA0D;AACxG,qEAAqE,uDAAuD;AAC5H,sDAAsD,uDAAuD;AAC7G;;AAEA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB;AACA;AACA,gDAAgD,MAAM;AACtD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;;AAGL;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,sCAAsC;AACtC;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0FAA0F,wBAAwB,EAAE;AACpH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,0CAA0C,wDAAwD;AAClG;;AAEA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,8BAA8B,yBAAyB;AACvD;AACA;AACA;AACA;AACA,+BAA+B,aAAa;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,sBAAsB;AAClD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;ACtRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B,mBAAmB,OAAO;AAC1B,mBAAmB,SAAS;AAC5B;AACA;AACA,2EAA2E;AAC3E;;;AAGA;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA,4BAA4B,OAAO;AACnC;AACA;AACA;AACA;;AAEA,oCAAoC,gEAAgE;AACpG;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA,4EAA4E,8CAA8C;AAC1H;AACA;;AAEA;;AAEA;AACA;AACA,yBAAyB;AACzB,4EAA4E,yBAAyB,EAAE;AACvG;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,oEAAoE,8CAA8C;AAClH;AACA;;AAEA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;;;;;;;;;;;;;ACpRA;AACA;AACA;AACA;;AAEA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;AAC3D;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AC1FA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA,gEAAgE,yEAAyE;AACzI,+CAA+C,uDAAuD;AACtG;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;ACjHA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;;;AAGA","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap a32a179e519de26be928","/**\n * @license The MIT License (MIT)\n * @copyright Stanislav Kalashnik <darkpark.main@gmail.com>\n */\n\n/* eslint no-path-concat: 0 */\n\n'use strict';\n\n\n/**\n * Base Events Emitter implementation.\n *\n * @see http://nodejs.org/api/events.html\n * @constructor\n *\n * @example\n * var emitter = new Emitter();\n */\nfunction Emitter () {\n    console.assert(typeof this === 'object', 'must be constructed via new');\n\n    // if ( DEVELOP ) {\n    //     if ( typeof this !== 'object' ) { throw new Error(__filename + ': must be constructed via new'); }\n    // }\n\n    /**\n     * Inner hash table for event names and linked callbacks.\n     * Manual editing should be avoided.\n     *\n     * @member {Object.<string, function[]>}\n     *\n     * @example\n     * {\n     *     click: [\n     *         function click1 () { ... },\n     *         function click2 () { ... }\n     *     ],\n     *     keydown: [\n     *         function () { ... }\n     *     ]\n     * }\n     **/\n    this.events = {};\n}\n\n\nEmitter.prototype = {\n    /**\n     * Bind an event to the given callback function.\n     * The same callback function can be added multiple times for the same event name.\n     *\n     * @param {string} name event identifier\n     * @param {function} callback function to call on this event\n     *\n     * @example\n     * emitter.addListener('click', function ( data ) { ... });\n     * // one more click handler\n     * emitter.addListener('click', function ( data ) { ... });\n     */\n    addListener: function ( name, callback ) {\n        console.assert(arguments.length === 2, 'wrong arguments number');\n        console.assert(typeof name === 'string', 'wrong name type');\n        console.assert(name.length > 0, 'empty name');\n        console.assert(typeof callback === 'function', 'callback should be a function');\n\n        // if ( DEVELOP ) {\n        //     if ( arguments.length !== 2 ) { throw new Error(__filename + ': wrong arguments number'); }\n        //     if ( typeof name !== 'string' || name.length === 0 ) { throw new Error(__filename + ': wrong or empty name'); }\n        //     if ( typeof callback !== 'function' ) { throw new Error(__filename + ': wrong callback type'); }\n        // }\n\n        // initialization may be required\n        this.events[name] = this.events[name] || [];\n        // append this new event to the list\n        this.events[name].push(callback);\n    },\n\n\n    /**\n     * Add a one time listener for the event.\n     * This listener is invoked only the next time the event is fired, after which it is removed.\n     *\n     * @param {string} name event identifier\n     * @param {function} callback function to call on this event\n     *\n     * @example\n     * emitter.once('click', function ( data ) { ... });\n     */\n    once: function ( name, callback ) {\n        // current execution context\n        var self = this;\n\n        if ( DEVELOP ) {\n            if ( arguments.length !== 2 ) {\n                throw new Error(__filename + ': wrong arguments number');\n            }\n            if ( typeof name !== 'string' || name.length === 0 ) {\n                throw new Error(__filename + ': wrong or empty name');\n            }\n            if ( typeof callback !== 'function' ) {\n                throw new Error(__filename + ': wrong callback type');\n            }\n        }\n\n        // initialization may be required\n        this.events[name] = this.events[name] || [];\n        // append this new event to the list\n        this.events[name].push(function onceWrapper () {\n            self.removeListener(name, onceWrapper);\n            callback.apply(self, arguments);\n        });\n    },\n\n\n    /**\n     * Apply multiple listeners at once.\n     *\n     * @param {Object} callbacks event names with callbacks\n     *\n     * @example\n     * emitter.addListeners({\n     *     click: function ( data ) {},\n     *     close: function ( data ) {}\n     * });\n     */\n    addListeners: function ( callbacks ) {\n        var name;\n\n        if ( DEVELOP ) {\n            if ( arguments.length !== 1 ) {\n                throw new Error(__filename + ': wrong arguments number');\n            }\n            if ( typeof callbacks !== 'object' ) {\n                throw new Error(__filename + ': wrong callbacks type');\n            }\n            if ( Object.keys(callbacks).length === 0 ) {\n                throw new Error(__filename + ': no callbacks given');\n            }\n        }\n\n        for ( name in callbacks ) {\n            if ( callbacks.hasOwnProperty(name) ) {\n                this.addListener(name, callbacks[name]);\n            }\n        }\n    },\n\n\n    /**\n     * Remove all instances of the given callback.\n     *\n     * @param {string} name event identifier\n     * @param {function} callback function to remove\n     *\n     * @example\n     * emitter.removeListener('click', func1);\n     */\n    removeListener: function ( name, callback ) {\n        if ( DEVELOP ) {\n            if ( arguments.length !== 2 ) {\n                throw new Error(__filename + ': wrong arguments number');\n            }\n            if ( typeof name !== 'string' || name.length === 0 ) {\n                throw new Error(__filename + ': wrong or empty name');\n            }\n            if ( typeof callback !== 'function' ) {\n                throw new Error(__filename + ': wrong callback type');\n            }\n            if ( this.events[name] && !Array.isArray(this.events[name]) ) {\n                throw new Error(__filename + ': corrupted inner data');\n            }\n        }\n\n        // the event exists and should have some callbacks\n        if ( this.events[name] ) {\n            // rework the callback list to exclude the given one\n            this.events[name] = this.events[name].filter(function callbacksFilter ( fn ) { return fn !== callback; });\n            // event has no more callbacks so clean it\n            if ( this.events[name].length === 0 ) {\n                // as if there were no listeners at all\n                this.events[name] = undefined;\n            }\n        }\n    },\n\n\n    /**\n     * Remove all callbacks for the given event name.\n     * Without event name clears all events.\n     *\n     * @param {string} [name] event identifier\n     *\n     * @example\n     * emitter.removeAllListeners('click');\n     * emitter.removeAllListeners();\n     *\n     * @deprecated\n     */\n    /*removeAllListeners: function ( name ) {\n        if ( DEVELOP ) {\n            if ( arguments.length !== 0 && (typeof name !== 'string' || name.length === 0) ) {\n                throw new Error(__filename + ': wrong or empty name');\n            }\n        }\n\n        // check input\n        if ( arguments.length === 0 ) {\n            // no arguments so remove everything\n            this.events = {};\n        } else if ( name ) {\n            if ( DEVELOP ) {\n                if ( this.events[name] ) { throw new Error(__filename + ': event is not removed'); }\n            }\n\n            // only name is given so remove all callbacks for the given event\n            // but object structure modification should be avoided\n            this.events[name] = undefined;\n        }\n    },*/\n\n\n    /**\n     * Execute each of the listeners in the given order with the supplied arguments.\n     *\n     * @param {string} name event identifier\n     *\n     * @example\n     * emitter.emit('init');\n     * emitter.emit('click', {src: panel1, dst: panel2});\n     * emitter.emit('load', error, data);\n     *\n     * // it's a good idea to emit event only when there are some listeners\n     * if ( this.events['click'] ) {\n     *     this.emit('click', {event: event});\n     * }\n     */\n    emit: function ( name ) {\n        var event = this.events[name],\n            index;\n\n        if ( DEVELOP ) {\n            if ( arguments.length < 1 ) {\n                throw new Error(__filename + ': wrong arguments number');\n            }\n            if ( typeof name !== 'string' || name.length === 0 ) {\n                throw new Error(__filename + ': wrong or empty name');\n            }\n        }\n\n        // the event exists and should have some callbacks\n        if ( event ) {\n            if ( DEVELOP ) {\n                if ( !Array.isArray(event) ) {\n                    throw new Error(__filename + ': wrong event type');\n                }\n            }\n\n            for ( index = 0; index < event.length; index++ ) {\n                if ( DEVELOP ) {\n                    if ( typeof event[index] !== 'function' ) {\n                        throw new Error(__filename + ': wrong event callback type');\n                    }\n                }\n\n                // invoke the callback with parameters\n                event[index].apply(this, Array.prototype.slice.call(arguments, 1));\n            }\n        }\n    }\n};\n\n\n// correct constructor name\nEmitter.prototype.constructor = Emitter;\n\n\n// public\nmodule.exports = Emitter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/cjs-emitter/index.js\n// module id = 0\n// module chunks = 0","/**\n * Provide convenient API for Leanback Launcher.\n * Use abstract data provider for data retrieving and handle it for Leanback Launcher purposes.\n *\n * @module launcher.api.provider\n *\n * @author Yaroslav Surilov <y.surilov@infomir.com>\n */\n\n'use strict';\n\nvar RESOLUTION   = screen.height,\n    pluginFS     = core.plugins.fs,\n    uniqueItemID = 1,\n    resources    = {\n        APP:       1,\n        STORAGE:   2,\n        SAMBA:     3,\n        NFS:       4,\n        UPNP:      5,\n        FAVORITES: 6\n    };\n\nconsole.log('Init plugin and inside plugin!');\n\n/**\n * Open content item (mounted storage or shortcut) via sending intent to application.\n *\n * @param {number} resource resource type to open\n * @param {Object} [data] additional specific data for resource\n */\nfunction openContentItem ( resource, data ) {\n    var intentData = {\n        action: 'explorer:openResource',\n        data: {\n            resourceType: resource\n        },\n        events: {}\n    },\n    property;\n\n    if ( data ) {\n        for ( property in data ) {\n            intentData.data[property] = data[property];\n        }\n    }\n\n    core.intent(intentData, function ( error ) {\n        if ( error ) {\n            console.log(error);\n        }\n    });\n}\n\n\nmodule.exports = function ( config, callback ) {\n    require('spa-gettext').load({\n        name: core.environment.language,\n        path: 'app/lang'\n    }, function () {\n        var Emitter             = require('cjs-emitter'),\n            evalStorageCapacity = require('./utils/eval.space'),\n            contentProvider     = new Emitter(),\n            launcherAPI         = config.api,\n            layout              = launcherAPI.layouts.static,\n            geometry            = launcherAPI.geometry.horizontal,\n            setup               = {\n                storageItemsAmount: 6, // how many storages send to Leanback Launcher (max)\n                shortcuts: [\n                    {\n                        id:       ++uniqueItemID,\n                        layout:   layout,\n                        geometry: geometry,\n                        data: {\n                            name: _('Favorites'),\n                            icon: {\n                                normal: config.path + 'app/img/' + RESOLUTION + '/favorites.png',\n                                active: config.path + 'app/img/' + RESOLUTION + '/favorites.png'\n                            }\n                        },\n                        onClick: function () {\n                            openContentItem(resources.FAVORITES);\n                        }\n                    },\n                    {\n                        id:       ++uniqueItemID,\n                        layout:   layout,\n                        geometry: geometry,\n                        data: {\n                            name: 'SAMBA',\n                            icon: {\n                                normal: config.path + 'app/img/' + RESOLUTION + '/samba.png',\n                                active: config.path + 'app/img/' + RESOLUTION + '/samba.png'\n                            }\n                        },\n                        onClick: function () {\n                            openContentItem(resources.SAMBA);\n                        }\n                    },\n                    {\n                        id:       ++uniqueItemID,\n                        layout:   layout,\n                        geometry: geometry,\n                        data: {\n                            name: 'NFS',\n                            icon: {\n                                normal: config.path + 'app/img/' + RESOLUTION + '/samba.png',\n                                active: config.path + 'app/img/' + RESOLUTION + '/samba.png'\n                            }\n                        },\n                        onClick: function () {\n                            openContentItem(resources.NFS);\n                        }\n                    },\n                    {\n                        id:       ++uniqueItemID,\n                        layout:   layout,\n                        geometry: geometry,\n                        data: {\n                            name: 'UPnP',\n                            icon: {\n                                normal: config.path + 'app/img/' + RESOLUTION + '/upnp.png',\n                                active: config.path + 'app/img/' + RESOLUTION + '/upnp.png'\n                            }\n                        },\n                        onClick: function () {\n                            openContentItem(resources.UPNP);\n                        }\n                    }\n\n                ],\n                moreButton: {\n                    id:       ++uniqueItemID,\n                    layout:   layout,\n                    geometry: geometry,\n                    data: {\n                        name: _('See more'),\n                        icon: {\n                            normal: config.path + 'app/img/' + RESOLUTION + '/see-more-focus.png',\n                            active: config.path + 'app/img/' + RESOLUTION + '/see-more-focus.png'\n                        }\n                    },\n                    onClick: function () {\n                        openContentItem(resources.APP)\n                    }\n                }\n            };\n\n        console.log('....Yooo! it works!');\n\n        /**\n         * Content search.\n         *\n         * @param {Object} config configuration for search\n         * @param {string} config.query query search request\n         * @param {function} callback which called when content is ready\n         */\n        contentProvider.search = function ( config, callback ) {\n            // TODO: query data and invoke `callback(error, ContentItem[]);`\n        };\n\n\n        // invoke the basic FS plugin method for gathering information and listening mount events\n        pluginFS.onAppInit({}, function ( error, fs ) {\n            var getSwitchedStorageItem, storages, storageHeap;\n\n            if ( fs ) {\n                storages = [];\n                storageHeap = {};\n\n\n                /**\n                 * Add new content item or delete existent one.\n                 *\n                 * @param {boolean} state mount/unmount event flag\n                 *\n                 * @return {Object} item with switched state\n                 */\n                getSwitchedStorageItem = function ( state ) {\n                    var mountPoints = fs.getMountPoints(),\n                        index, item, tmp;\n\n                    for ( index = 0; index < [Object.keys(storageHeap), mountPoints][+state].length; index += 1 ) {\n                        item = [Object.keys(storageHeap), mountPoints][+state][index];\n\n                        if ( state ) {\n                            if ( !storageHeap[item.sn] ) {\n                                storageHeap[item.sn] = {\n                                    id:       ++uniqueItemID,\n                                    index:    setup.storageItemsAmount - storages.length - 1,\n                                    layout:   layout,\n                                    geometry: geometry,\n                                    data: {\n                                        name:       item.label || item.vendor || item.model,\n                                        isReadOnly: item.isReadOnly,\n                                        capacity:   evalStorageCapacity(item.freeSize) + ' / ' + evalStorageCapacity(item.size),\n                                        icon: {\n                                            normal: config.path + 'app/img/' + RESOLUTION + '/usb-placeholder.png',\n                                            active: config.path + 'app/img/' + RESOLUTION + '/usb-focus.png'\n                                        }\n                                    },\n                                    onClick: function () {\n                                        openContentItem(resources.STORAGE, {name: item.label || item.vendor || item.model});\n                                    }\n                                };\n\n                                storages.push(storageHeap[item.sn]);\n\n                                return storageHeap[item.sn];\n                            }\n                        } else {\n                            if ( !mountPoints.some(function ( mountPoint ) { return mountPoint[item]; }) ) {\n                                tmp = storageHeap[item];\n\n                                storages.splice(storages.indexOf(tmp), 1);\n                                delete storageHeap[item];\n\n                                return tmp;\n                            }\n                        }\n                    }\n                };\n\n\n                /**\n                 * Callback for mount/unmount event.\n                 *\n                 * @param {boolean} state mount/unmount storage\n                 */\n                fs.onMount = function ( state ) {\n                    if ( state && storages.length === 6 ) {\n                        // TODO: possibly show notification for this case with suggestion to go to the Explorer\n                        return;\n                    }\n\n                    contentProvider.emit(['delete', 'add'][+state], getSwitchedStorageItem(state))\n                };\n\n\n                fs.getMountPoints()\n                    .slice(0, setup.storageItemsAmount)\n                    .forEach(function ( item ) {\n                        storageHeap[item.sn] = {\n                            id:       ++uniqueItemID,\n                            layout:   layout,\n                            geometry: geometry,\n                            data: {\n                                name:       item.label || item.vendor || item.model,\n                                isReadOnly: item.isReadOnly,\n                                capacity:   evalStorageCapacity(item.freeSize) + ' / ' + evalStorageCapacity(item.size),\n                                icon: {\n                                    normal: config.path + 'app/img/' + RESOLUTION + '/usb-placeholder.png',\n                                    active: config.path + 'app/img/' + RESOLUTION + '/usb-focus.png'\n                                }\n                            },\n                            onClick: function () {\n                                openContentItem(resources.STORAGE, {name: item.label || item.vendor || item.model});\n                            }\n                        };\n\n                        storages.push(storageHeap[item.sn]);\n                    });\n\n                callback(null, {\n                    provider: contentProvider,\n                    data: storages.concat(setup.shortcuts, setup.moreButton)\n                });\n            } else {\n                // information from FS plugin is unavailable\n                callback(null, {\n                    provider: contentProvider,\n                    data: setup.shortcuts.concat(setup.moreButton)\n                });\n            }\n        });\n    });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/modules/launcher.api.provider.js\n// module id = 1\n// module chunks = 0","/**\n * @license The MIT License (MIT)\n * @copyright Stanislav Kalashnik <darkpark.main@gmail.com>\n */\n\n/* eslint no-path-concat: 0 */\n\n'use strict';\n\n\n/**\n * Translations handler.\n *\n * @constructor\n *\n * @param {Object} config init parameters\n */\nfunction Gettext ( config ) {\n    var data, meta;\n\n    // sanitize\n    config   = config || {};\n    data     = config.data || {};\n    data[''] = data[''] || {};\n\n    // shortcut\n    meta = config.meta;\n\n    /**\n     * Display the native language translation of a textual message.\n     *\n     * @param {string} msgId textual message\n     *\n     * @return {string} translated text\n     */\n    this.gettext = function ( msgId ) {\n        return data[''][msgId] || msgId;\n    };\n\n\n    /**\n     * The \"p\" in \"pgettext\" stands for \"particular\": fetches a particular translation of the textual message.\n     *\n     * @param {string} context message context\n     * @param {string} msgId textual message\n     *\n     * @return {string} translated text\n     */\n    this.pgettext = function ( context, msgId ) {\n        return data[context] && data[context][msgId] || msgId;\n    };\n\n\n    /**\n     * Display the native language translation of a textual message whose grammatical form depends on a number.\n     *\n     * @param {string} msgId textual message in a singular form\n     * @param {string} plural textual message in a plural form\n     * @param {number} value message number\n     *\n     * @return {string} translated text\n     */\n    this.ngettext = function ( msgId, plural, value ) {\n        /* eslint no-unused-vars: 0 */\n        /* eslint no-eval: 0 */\n        /* eslint id-length: 0 */\n        var n;\n\n        if ( DEVELOP ) {\n            if ( Number(value) !== value ) {\n                throw new Error(__filename + ': value must be a number');\n            }\n        }\n\n        if ( data && meta && data[''][msgId] ) {\n            // translation\n            return data[''][msgId][eval('n = ' + value + '; ' + meta.plural)];\n        }\n\n        // english\n        return value === 1 ? msgId : plural;\n    };\n}\n\n\n// correct constructor name\nGettext.prototype.constructor = Gettext;\n\n\n// public\nmodule.exports = Gettext;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/cjs-gettext/index.js\n// module id = 2\n// module chunks = 0","/**\n * @license The MIT License (MIT)\n * @copyright Stanislav Kalashnik <darkpark.main@gmail.com>\n */\n\n/* eslint no-path-concat: 0 */\n\n'use strict';\n\nvar Emitter = require('cjs-emitter'),\n    Gettext = require('cjs-gettext'),\n    loader  = new Emitter();\n\n\n/**\n * Wrap the given data with gettext instance\n * and export methods to the global scope.\n *\n * @param {Object} [data] localization data\n *\n * @return {Gettext} gettext instance\n */\nfunction prepare ( data ) {\n    var gettext = new Gettext(data);\n\n    // make it global\n    window.gettext  = window._ = gettext.gettext;\n    window.pgettext = gettext.pgettext;\n    window.ngettext = gettext.ngettext;\n\n    return gettext;\n}\n\n\n/**\n * Main application language\n */\nloader.defaultLanguage = 'en';\n\n\n/**\n * Simple gettext implementation.\n *\n * @param {Object} config options\n * @param {string} [config.path=lang] relative path to project root\n * @param {string} config.name language name\n * @param {string} [config.ext=json] language file extension\n * @param {function} callback hook on ready\n *\n * @return {boolean} flag is ajax request was made\n */\nloader.load = function ( config, callback ) {\n    var xhr;\n\n    if ( DEVELOP ) {\n        if ( !config.name || typeof config.name !== 'string' ) { throw new Error(__filename + ': config.name must be a nonempty string'); }\n        if ( typeof callback !== 'function' ) { throw new Error(__filename + ': wrong callback type'); }\n    }\n\n    // defaults\n    config.ext  = config.ext  || 'json';\n    config.path = config.path || 'lang';\n\n    // is it necessary to request a localization file?\n    if ( config.name === loader.defaultLanguage ) {\n        // no\n        prepare();\n        callback(null);\n\n        return false;\n    }\n\n    // yes\n    xhr = new XMLHttpRequest();\n\n    xhr.onload = function () {\n        var json;\n\n        try {\n            json = JSON.parse(xhr.responseText);\n\n            prepare(json);\n            callback(null);\n\n            // there are some listeners\n            if ( loader.events['load'] ) {\n                // notify listeners\n                loader.emit('load');\n            }\n        } catch ( error ) {\n            xhr.onerror(error);\n        }\n    };\n\n    xhr.ontimeout = xhr.onerror = function ( error ) {\n        prepare();\n        callback(error);\n\n        // there are some listeners\n        if ( loader.events['error'] ) {\n            // notify listeners\n            loader.emit('error', error);\n        }\n    };\n\n    xhr.open('GET', config.path + '/' + config.name + '.' + config.ext, true);\n    xhr.send(null);\n\n    return true;\n};\n\n\n// public\nmodule.exports = loader;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/spa-gettext/index.js\n// module id = 3\n// module chunks = 0","/**\n * Entry point for content provider plugin.\n * Consists of API initializer for Leanback Launcher.\n *\n * @author Yaroslav Surilov <y.surilov@infomir.com>\n */\n\n'use strict';\n\nmodule.exports = {\n    /** Initialization of API provider for external (Leanback Launcher for now) subscriber. */\n    onContentBoardInit: require('./modules/launcher.api.provider')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/main.js\n// module id = 4\n// module chunks = 0","/**\n * Convert number of bytes into human readable format.\n *\n * @module eval.space\n *\n * @author Stanislav Kalashnik <sk@infomir.eu>\n * @author Yaroslav Surilov <y.surilov@infomir.com>\n */\n\n'use strict';\n\n\n/**\n * Convert number of bytes into human readable format with some precision.\n *\n * @param {number} bytes number of bytes to convert\n * @param {number} [precision] number of digits after the decimal separator\n *\n * @return {string} converted view\n */\nfunction bytesToSize ( bytes, precision ) {\n    var kilobyte = 1024,\n        megabyte = kilobyte * 1024,\n        gigabyte = megabyte * 1024,\n        terabyte = gigabyte * 1024;\n\n    if ( !precision ) {\n        precision = 1;\n    }\n\n    if ( (bytes >= 0) && (bytes < kilobyte) ) {\n        return bytes + ' B';\n    } else if ( (bytes >= kilobyte) && (bytes < megabyte) ) {\n        return (bytes / kilobyte).toFixed(precision) + ' KB';\n    } else if ( (bytes >= megabyte) && (bytes < gigabyte) ) {\n        return (bytes / megabyte).toFixed(precision) + ' MB';\n    } else if ( (bytes >= gigabyte) && (bytes < terabyte) ) {\n        return (bytes / gigabyte).toFixed(precision) + ' GB';\n    } else if ( bytes >= terabyte ) {\n        return (bytes / terabyte).toFixed(precision) + ' TB';\n    }\n\n    return bytes + ' B';\n}\n\n\nmodule.exports = bytesToSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/modules/utils/eval.space.js\n// module id = 5\n// module chunks = 0"],"sourceRoot":""}