"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fastclick_1 = require("./lib/fastclick");
var composerEntryPage_1 = require("./view/composerEntryPage");
var browserHashService_1 = require("./service/browserHashService");
var fileChangeNotificationService_1 = require("./service/fileChangeNotificationService");
var testResourceMaintainer_1 = require("./service/testResourceMaintainer");
var Application = (function () {
    function Application() {
    }
    Application.prototype.initialize = function () {
        // Solve mobile problem
        fastclick_1.FastClick.attach(document.body);
        var hash = window.location.hash;
        browserHashService_1.browserHashService.syncFromHash(hash);
        var widget;
        var path = window.location.protocol + "//" + window.location.host;
        path = path.replace("http", "ws");
        this.fileChangeNotificationService = new fileChangeNotificationService_1.FileChangeNotificationService(path);
        this.testResourceMaintainer = new testResourceMaintainer_1.TestResourceMaintainer();
        var composerEntryPage;
        if (browserHashService_1.browserHashService.has("path")) {
            widget = browserHashService_1.browserHashService.get("path");
            composerEntryPage = new composerEntryPage_1.ComposerEntryPage(widget);
            // composerEntryPage.preview(widget)
        }
        else {
            composerEntryPage = new composerEntryPage_1.ComposerEntryPage();
        }
        composerEntryPage.appendTo(document.body);
    };
    return Application;
}());
exports.Application = Application;
exports.App = new Application();
