App(
    appid="js_app",
    name="JS Runner",
    apptype=FlipperAppType.SYSTEM,
    entry_point="js_app",
    stack_size=2 * 1024,
    resources="examples",
    order=0,
)

App(
    appid="js_app_start",
    apptype=FlipperAppType.STARTUP,
    entry_point="js_app_on_system_start",
    order=160,
)

App(
    appid="js_event_loop",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_event_loop_ep",
    requires=["js_app"],
    sources=[
        "modules/js_event_loop/js_event_loop.c",
        "modules/js_event_loop/js_event_loop_api_table.cpp",
    ],
)

App(
    appid="js_gui",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_gui_ep",
    requires=["js_app", "js_event_loop"],
    sources=["modules/js_gui/js_gui.c", "modules/js_gui/js_gui_api_table.cpp"],
)

App(
    appid="js_gui__loading",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_view_loading_ep",
    requires=["js_app", "js_gui", "js_event_loop"],
    sources=["modules/js_gui/loading.c"],
)

App(
    appid="js_gui__empty_screen",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_view_empty_screen_ep",
    requires=["js_app", "js_gui", "js_event_loop"],
    sources=["modules/js_gui/empty_screen.c"],
)

App(
    appid="js_gui__submenu",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_view_submenu_ep",
    requires=["js_app", "js_gui"],
    sources=["modules/js_gui/submenu.c"],
)

App(
    appid="js_gui__text_input",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_view_text_input_ep",
    requires=["js_app", "js_gui", "js_event_loop"],
    sources=["modules/js_gui/text_input.c"],
)

App(
    appid="js_gui__text_box",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_view_text_box_ep",
    requires=["js_app"],
    sources=["modules/js_gui/text_box.c"],
)

App(
    appid="js_gui__dialog",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_view_dialog_ep",
    requires=["js_app"],
    sources=["modules/js_gui/dialog.c"],
)

App(
    appid="js_notification",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_notification_ep",
    requires=["js_app"],
    sources=["modules/js_notification.c"],
)

App(
    appid="js_badusb",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_badusb_ep",
    requires=["js_app"],
    sources=["modules/js_badusb.c"],
)

App(
    appid="js_serial",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_serial_ep",
    requires=["js_app"],
    sources=["modules/js_serial.c"],
)

App(
    appid="js_gpio",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_gpio_ep",
    requires=["js_app", "js_event_loop"],
    sources=["modules/js_gpio.c"],
)

App(
    appid="js_math",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_math_ep",
    requires=["js_app"],
    sources=["modules/js_math.c"],
)

App(
    appid="js_storage",
    apptype=FlipperAppType.PLUGIN,
    entry_point="js_storage_ep",
    requires=["js_app"],
    sources=["modules/js_storage.c"],
)
