"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports._webBoot = void 0;
const boot_1 = require("../../../boot");
const attachApp_1 = require("../../render/attachApp");
const attachCanvas_1 = require("../../render/attachCanvas");
const attachGesture_1 = require("../../render/attachGesture");
const attachLongPress_1 = require("../../render/attachLongPress");
const attachSprite_1 = require("../../render/attachSprite");
const attachStyle_1 = require("../../render/attachStyle");
const attachSVG_1 = require("../../render/attachSVG");
const SYSTEM_ROOT_ID_1 = require("../../SYSTEM_ROOT_ID");
const alert_1 = require("./api/alert");
const animation_1 = require("./api/animation");
const bluetooth_1 = require("./api/bluetooth");
const channel_1 = require("./api/channel");
const clipboard_1 = require("./api/clipboard");
const db_1 = require("./api/db");
const device_1 = require("./api/device");
const document_1 = require("./api/document");
const file_1 = require("./api/file");
const geolocation_1 = require("./api/geolocation");
const http_1 = require("./api/http");
const input_1 = require("./api/input");
const media_1 = require("./api/media");
const querystring_1 = require("./api/querystring");
const screen_1 = require("./api/screen");
const selection_1 = require("./api/selection");
const speech_1 = require("./api/speech");
const storage_1 = require("./api/storage");
const text_1 = require("./api/text");
const uri_1 = require("./api/uri");
const url_1 = require("./api/url");
const worker_1 = require("./api/worker");
function webBoot(opt = {}) {
    const root = document.getElementById(SYSTEM_ROOT_ID_1.SYSTEM_ROOT_ID);
    return _webBoot(window, root, opt);
}
exports.default = webBoot;
function _webBoot(window, root, opt = {}) {
    const _root = window.document.createElement('div');
    _root.style.width = '100%';
    _root.style.height = '100%';
    _root.style.overflow = 'hidden';
    _root.attachShadow({ mode: 'open' });
    const http = (0, http_1.webHTTP)(window, opt);
    const channel = (0, channel_1.webChannel)(window, opt);
    const file = (0, file_1.webFile)(window, opt);
    const screen = (0, screen_1.webScreen)(window, opt);
    const device = (0, device_1.webDevice)(window, opt);
    const geolocation = (0, geolocation_1.webGeolocation)(window, opt);
    const speech = (0, speech_1.webSpeech)(window, opt);
    const media = (0, media_1.webMedia)(window, opt);
    const clipboard = (0, clipboard_1.webClipboard)(window, opt);
    const selection = (0, selection_1.webSelection)(window, opt);
    const storage = (0, storage_1.webStorage)(window, opt);
    const animation = (0, animation_1.webAnimation)(window, opt);
    const document = (0, document_1.webDocument)(window, _root, opt);
    const querystring = (0, querystring_1.webQuerystring)(window, opt);
    const bluetooth = (0, bluetooth_1.webBluetooth)(window, opt);
    const text = (0, text_1.webText)(window, opt);
    const input = (0, input_1.webInput)(window, root, opt);
    const db = (0, db_1.webDB)(window, opt);
    const worker = (0, worker_1.webWorker)(window, opt);
    const url = (0, url_1.webURL)(window, opt);
    const uri = (0, uri_1.webURI)(window, opt);
    const alert = (0, alert_1.webAlert)(window, opt);
    const api = {
        alert,
        storage,
        selection,
        file,
        animation,
        db,
        device,
        screen,
        bluetooth,
        clipboard,
        geolocation,
        media,
        http,
        channel,
        input,
        speech,
        document,
        querystring,
        text,
        worker,
        url,
        uri,
    };
    const system = (0, boot_1.boot)(null, api, opt);
    root.appendChild(_root);
    system.root = _root;
    (0, attachSprite_1.attachSprite)(system);
    (0, attachStyle_1.attachStyle)(system);
    (0, attachApp_1.attachApp)(system);
    (0, attachCanvas_1.attachCanvas)(system);
    (0, attachSVG_1.attachSVG)(system);
    (0, attachGesture_1.attachGesture)(system);
    (0, attachLongPress_1.attachLongPress)(system);
    // attachFocus(system)
    return system;
}
exports._webBoot = _webBoot;
//# sourceMappingURL=boot.js.map