diff --git a/core/tauri-runtime-wry/Cargo.toml b/core/tauri-runtime-wry/Cargo.toml index 2f9a04fc6..c5e28817d 100644 --- a/core/tauri-runtime-wry/Cargo.toml +++ b/core/tauri-runtime-wry/Cargo.toml @@ -13,17 +13,18 @@ edition = { workspace = true } rust-version = { workspace = true } [dependencies] -wry = { version = "0.34.2", default-features = false, features = [ "tao", "file-drop", "protocol" ] } +wry = { version = "0.35", default-features = false, features = [ "file-drop", "protocol", "os-webview" ] } +tao = { version = "0.24", default-features = false, features = ["rwh_05"] } tauri-runtime = { version = "1.0.0-alpha.5", path = "../tauri-runtime" } tauri-utils = { version = "2.0.0-alpha.11", path = "../tauri-utils" } raw-window-handle = "0.5" http = "0.2" [target."cfg(windows)".dependencies] -webview2-com = "0.27" +webview2-com = "0.28" [target."cfg(windows)".dependencies.windows] - version = "0.51" + version = "0.52" features = [ "Win32_Foundation" ] [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] diff --git a/core/tauri-runtime-wry/src/lib.rs b/core/tauri-runtime-wry/src/lib.rs index 38b7abdb2..cbde23909 100644 --- a/core/tauri-runtime-wry/src/lib.rs +++ b/core/tauri-runtime-wry/src/lib.rs @@ -24,66 +24,65 @@ use tauri_runtime::{ WindowEventId, }; +#[cfg(target_os = "macos")] +use tao::platform::macos::EventLoopWindowTargetExtMacOS; +#[cfg(target_os = "macos")] +use tao::platform::macos::WindowBuilderExtMacOS; +#[cfg(target_os = "linux")] +use tao::platform::unix::{WindowBuilderExtUnix, WindowExtUnix}; +#[cfg(windows)] +use tao::platform::windows::{WindowBuilderExtWindows, WindowExtWindows}; #[cfg(windows)] use webview2_com::FocusChangedEventHandler; #[cfg(windows)] use windows::Win32::{Foundation::HWND, System::WinRT::EventRegistrationToken}; -#[cfg(target_os = "macos")] -use wry::application::platform::macos::EventLoopWindowTargetExtMacOS; -#[cfg(target_os = "macos")] -use wry::application::platform::macos::WindowBuilderExtMacOS; -#[cfg(target_os = "linux")] -use wry::application::platform::unix::{WindowBuilderExtUnix, WindowExtUnix}; #[cfg(windows)] -use wry::application::platform::windows::{WindowBuilderExtWindows, WindowExtWindows}; -#[cfg(windows)] -use wry::webview::WebViewBuilderExtWindows; +use wry::WebViewBuilderExtWindows; +use tao::{ + dpi::{ + LogicalPosition as TaoLogicalPosition, LogicalSize as TaoLogicalSize, + PhysicalPosition as TaoPhysicalPosition, PhysicalSize as TaoPhysicalSize, + Position as TaoPosition, Size as TaoSize, + }, + event::{Event, StartCause, WindowEvent as TaoWindowEvent}, + event_loop::{ + ControlFlow, DeviceEventFilter as TaoDeviceEventFilter, EventLoop, EventLoopBuilder, + EventLoopProxy as TaoEventLoopProxy, EventLoopWindowTarget, + }, + monitor::MonitorHandle, + window::{ + CursorIcon as TaoCursorIcon, Fullscreen, Icon as TaoWindowIcon, + ProgressBarState as TaoProgressBarState, ProgressState as TaoProgressState, Theme as TaoTheme, + UserAttentionType as TaoUserAttentionType, + }, +}; #[cfg(target_os = "macos")] use tauri_utils::TitleBarStyle; use tauri_utils::{ config::WindowConfig, debug_eprintln, ProgressBarState, ProgressBarStatus, Theme, }; -use wry::{ - application::{ - dpi::{ - LogicalPosition as WryLogicalPosition, LogicalSize as WryLogicalSize, - PhysicalPosition as WryPhysicalPosition, PhysicalSize as WryPhysicalSize, - Position as WryPosition, Size as WrySize, - }, - event::{Event, StartCause, WindowEvent as WryWindowEvent}, - event_loop::{ - ControlFlow, DeviceEventFilter as WryDeviceEventFilter, EventLoop, EventLoopBuilder, - EventLoopProxy as WryEventLoopProxy, EventLoopWindowTarget, - }, - monitor::MonitorHandle, - window::{ - CursorIcon as WryCursorIcon, Fullscreen, Icon as WryWindowIcon, - ProgressBarState as WryProgressBarState, ProgressState as WryProgressState, - Theme as WryTheme, UserAttentionType as WryUserAttentionType, - }, - }, - webview::{FileDropEvent as WryFileDropEvent, Url, WebContext, WebView, WebViewBuilder}, -}; +use wry::{FileDropEvent as WryFileDropEvent, Url, WebContext, WebView, WebViewBuilder}; +pub use tao; +pub use tao::window::{Window, WindowBuilder as TaoWindowBuilder, WindowId}; pub use wry; -pub use wry::application::window::{Window, WindowBuilder as WryWindowBuilder, WindowId}; -pub use wry::webview::webview_version; +pub use wry::webview_version; #[cfg(windows)] -use wry::webview::WebviewExtWindows; +use wry::WebViewExtWindows; #[cfg(target_os = "android")] -use wry::webview::{ +use wry::{ prelude::{dispatch, find_class}, - WebViewBuilderExtAndroid, WebviewExtAndroid, + WebViewBuilderExtAndroid, WebViewExtAndroid, }; #[cfg(target_os = "macos")] -use tauri_runtime::ActivationPolicy; -#[cfg(target_os = "macos")] -pub use wry::application::platform::macos::{ - ActivationPolicy as WryActivationPolicy, EventLoopExtMacOS, WindowExtMacOS, +pub use tao::platform::macos::{ + ActivationPolicy as TaoActivationPolicy, EventLoopExtMacOS, WindowExtMacOS, }; +#[cfg(target_os = "macos")] +use tauri_runtime::ActivationPolicy; use std::{ cell::RefCell, @@ -104,8 +103,8 @@ use std::{ }; pub type WebviewId = u32; -type IpcHandler = dyn Fn(&Window, String) + 'static; -type FileDropHandler = dyn Fn(&Window, WryFileDropEvent) -> bool + 'static; +type IpcHandler = dyn Fn(String) + 'static; +type FileDropHandler = dyn Fn(WryFileDropEvent) -> bool + 'static; mod webview; pub use webview::Webview; @@ -172,7 +171,7 @@ pub(crate) fn send_user_message( pub struct Context { pub webview_id_map: WebviewIdStore, main_thread_id: ThreadId, - pub proxy: WryEventLoopProxy>, + pub proxy: TaoEventLoopProxy>, main_thread: DispatcherMainThreadContext, plugins: Arc + Send>>>>, next_window_id: Arc, @@ -275,29 +274,29 @@ impl fmt::Debug for Context { } } -pub struct DeviceEventFilterWrapper(pub WryDeviceEventFilter); +pub struct DeviceEventFilterWrapper(pub TaoDeviceEventFilter); impl From for DeviceEventFilterWrapper { fn from(item: DeviceEventFilter) -> Self { match item { - DeviceEventFilter::Always => Self(WryDeviceEventFilter::Always), - DeviceEventFilter::Never => Self(WryDeviceEventFilter::Never), - DeviceEventFilter::Unfocused => Self(WryDeviceEventFilter::Unfocused), + DeviceEventFilter::Always => Self(TaoDeviceEventFilter::Always), + DeviceEventFilter::Never => Self(TaoDeviceEventFilter::Never), + DeviceEventFilter::Unfocused => Self(TaoDeviceEventFilter::Unfocused), } } } -/// Wrapper around a [`wry::application::window::Icon`] that can be created from an [`Icon`]. -pub struct WryIcon(pub WryWindowIcon); +/// Wrapper around a [`tao::window::Icon`] that can be created from an [`Icon`]. +pub struct TaoIcon(pub TaoWindowIcon); fn icon_err(e: E) -> Error { Error::InvalidIcon(Box::new(e)) } -impl TryFrom for WryIcon { +impl TryFrom for TaoIcon { type Error = Error; fn try_from(icon: Icon) -> std::result::Result { - WryWindowIcon::from_rgba(icon.rgba, icon.width, icon.height) + TaoWindowIcon::from_rgba(icon.rgba, icon.width, icon.height) .map(Self) .map_err(icon_err) } @@ -306,11 +305,11 @@ impl TryFrom for WryIcon { pub struct WindowEventWrapper(pub Option); impl WindowEventWrapper { - fn parse(webview: &Option, event: &WryWindowEvent<'_>) -> Self { + fn parse(webview: &Option, event: &TaoWindowEvent<'_>) -> Self { match event { // resized event from tao doesn't include a reliable size on macOS // because wry replaces the NSView - WryWindowEvent::Resized(_) => { + TaoWindowEvent::Resized(_) => { if let Some(webview) = webview { Self(Some(WindowEvent::Resized( PhysicalSizeWrapper(webview.inner_size()).into(), @@ -324,23 +323,23 @@ impl WindowEventWrapper { } } -pub fn map_theme(theme: &WryTheme) -> Theme { +pub fn map_theme(theme: &TaoTheme) -> Theme { match theme { - WryTheme::Light => Theme::Light, - WryTheme::Dark => Theme::Dark, + TaoTheme::Light => Theme::Light, + TaoTheme::Dark => Theme::Dark, _ => Theme::Light, } } -impl<'a> From<&WryWindowEvent<'a>> for WindowEventWrapper { - fn from(event: &WryWindowEvent<'a>) -> Self { +impl<'a> From<&TaoWindowEvent<'a>> for WindowEventWrapper { + fn from(event: &TaoWindowEvent<'a>) -> Self { let event = match event { - WryWindowEvent::Resized(size) => WindowEvent::Resized(PhysicalSizeWrapper(*size).into()), - WryWindowEvent::Moved(position) => { + TaoWindowEvent::Resized(size) => WindowEvent::Resized(PhysicalSizeWrapper(*size).into()), + TaoWindowEvent::Moved(position) => { WindowEvent::Moved(PhysicalPositionWrapper(*position).into()) } - WryWindowEvent::Destroyed => WindowEvent::Destroyed, - WryWindowEvent::ScaleFactorChanged { + TaoWindowEvent::Destroyed => WindowEvent::Destroyed, + TaoWindowEvent::ScaleFactorChanged { scale_factor, new_inner_size, } => WindowEvent::ScaleFactorChanged { @@ -348,8 +347,8 @@ impl<'a> From<&WryWindowEvent<'a>> for WindowEventWrapper { new_inner_size: PhysicalSizeWrapper(**new_inner_size).into(), }, #[cfg(any(target_os = "linux", target_os = "macos"))] - WryWindowEvent::Focused(focused) => WindowEvent::Focused(*focused), - WryWindowEvent::ThemeChanged(theme) => WindowEvent::ThemeChanged(map_theme(theme)), + TaoWindowEvent::Focused(focused) => WindowEvent::Focused(*focused), + TaoWindowEvent::ThemeChanged(theme) => WindowEvent::ThemeChanged(map_theme(theme)), _ => return Self(None), }; Self(Some(event)) @@ -378,7 +377,7 @@ impl From for Monitor { } } -pub struct PhysicalPositionWrapper(pub WryPhysicalPosition); +pub struct PhysicalPositionWrapper(pub TaoPhysicalPosition); impl From> for PhysicalPosition { fn from(position: PhysicalPositionWrapper) -> Self { @@ -391,25 +390,25 @@ impl From> for PhysicalPosition { impl From> for PhysicalPositionWrapper { fn from(position: PhysicalPosition) -> Self { - Self(WryPhysicalPosition { + Self(TaoPhysicalPosition { x: position.x, y: position.y, }) } } -struct LogicalPositionWrapper(WryLogicalPosition); +struct LogicalPositionWrapper(TaoLogicalPosition); impl From> for LogicalPositionWrapper { fn from(position: LogicalPosition) -> Self { - Self(WryLogicalPosition { + Self(TaoLogicalPosition { x: position.x, y: position.y, }) } } -pub struct PhysicalSizeWrapper(pub WryPhysicalSize); +pub struct PhysicalSizeWrapper(pub TaoPhysicalSize); impl From> for PhysicalSize { fn from(size: PhysicalSizeWrapper) -> Self { @@ -422,127 +421,127 @@ impl From> for PhysicalSize { impl From> for PhysicalSizeWrapper { fn from(size: PhysicalSize) -> Self { - Self(WryPhysicalSize { + Self(TaoPhysicalSize { width: size.width, height: size.height, }) } } -struct LogicalSizeWrapper(WryLogicalSize); +struct LogicalSizeWrapper(TaoLogicalSize); impl From> for LogicalSizeWrapper { fn from(size: LogicalSize) -> Self { - Self(WryLogicalSize { + Self(TaoLogicalSize { width: size.width, height: size.height, }) } } -pub struct SizeWrapper(pub WrySize); +pub struct SizeWrapper(pub TaoSize); impl From for SizeWrapper { fn from(size: Size) -> Self { match size { - Size::Logical(s) => Self(WrySize::Logical(LogicalSizeWrapper::from(s).0)), - Size::Physical(s) => Self(WrySize::Physical(PhysicalSizeWrapper::from(s).0)), + Size::Logical(s) => Self(TaoSize::Logical(LogicalSizeWrapper::from(s).0)), + Size::Physical(s) => Self(TaoSize::Physical(PhysicalSizeWrapper::from(s).0)), } } } -pub struct PositionWrapper(pub WryPosition); +pub struct PositionWrapper(pub TaoPosition); impl From for PositionWrapper { fn from(position: Position) -> Self { match position { - Position::Logical(s) => Self(WryPosition::Logical(LogicalPositionWrapper::from(s).0)), - Position::Physical(s) => Self(WryPosition::Physical(PhysicalPositionWrapper::from(s).0)), + Position::Logical(s) => Self(TaoPosition::Logical(LogicalPositionWrapper::from(s).0)), + Position::Physical(s) => Self(TaoPosition::Physical(PhysicalPositionWrapper::from(s).0)), } } } #[derive(Debug, Clone)] -pub struct UserAttentionTypeWrapper(pub WryUserAttentionType); +pub struct UserAttentionTypeWrapper(pub TaoUserAttentionType); impl From for UserAttentionTypeWrapper { fn from(request_type: UserAttentionType) -> Self { let o = match request_type { - UserAttentionType::Critical => WryUserAttentionType::Critical, - UserAttentionType::Informational => WryUserAttentionType::Informational, + UserAttentionType::Critical => TaoUserAttentionType::Critical, + UserAttentionType::Informational => TaoUserAttentionType::Informational, }; Self(o) } } #[derive(Debug)] -pub struct CursorIconWrapper(pub WryCursorIcon); +pub struct CursorIconWrapper(pub TaoCursorIcon); impl From for CursorIconWrapper { fn from(icon: CursorIcon) -> Self { use CursorIcon::*; let i = match icon { - Default => WryCursorIcon::Default, - Crosshair => WryCursorIcon::Crosshair, - Hand => WryCursorIcon::Hand, - Arrow => WryCursorIcon::Arrow, - Move => WryCursorIcon::Move, - Text => WryCursorIcon::Text, - Wait => WryCursorIcon::Wait, - Help => WryCursorIcon::Help, - Progress => WryCursorIcon::Progress, - NotAllowed => WryCursorIcon::NotAllowed, - ContextMenu => WryCursorIcon::ContextMenu, - Cell => WryCursorIcon::Cell, - VerticalText => WryCursorIcon::VerticalText, - Alias => WryCursorIcon::Alias, - Copy => WryCursorIcon::Copy, - NoDrop => WryCursorIcon::NoDrop, - Grab => WryCursorIcon::Grab, - Grabbing => WryCursorIcon::Grabbing, - AllScroll => WryCursorIcon::AllScroll, - ZoomIn => WryCursorIcon::ZoomIn, - ZoomOut => WryCursorIcon::ZoomOut, - EResize => WryCursorIcon::EResize, - NResize => WryCursorIcon::NResize, - NeResize => WryCursorIcon::NeResize, - NwResize => WryCursorIcon::NwResize, - SResize => WryCursorIcon::SResize, - SeResize => WryCursorIcon::SeResize, - SwResize => WryCursorIcon::SwResize, - WResize => WryCursorIcon::WResize, - EwResize => WryCursorIcon::EwResize, - NsResize => WryCursorIcon::NsResize, - NeswResize => WryCursorIcon::NeswResize, - NwseResize => WryCursorIcon::NwseResize, - ColResize => WryCursorIcon::ColResize, - RowResize => WryCursorIcon::RowResize, - _ => WryCursorIcon::Default, + Default => TaoCursorIcon::Default, + Crosshair => TaoCursorIcon::Crosshair, + Hand => TaoCursorIcon::Hand, + Arrow => TaoCursorIcon::Arrow, + Move => TaoCursorIcon::Move, + Text => TaoCursorIcon::Text, + Wait => TaoCursorIcon::Wait, + Help => TaoCursorIcon::Help, + Progress => TaoCursorIcon::Progress, + NotAllowed => TaoCursorIcon::NotAllowed, + ContextMenu => TaoCursorIcon::ContextMenu, + Cell => TaoCursorIcon::Cell, + VerticalText => TaoCursorIcon::VerticalText, + Alias => TaoCursorIcon::Alias, + Copy => TaoCursorIcon::Copy, + NoDrop => TaoCursorIcon::NoDrop, + Grab => TaoCursorIcon::Grab, + Grabbing => TaoCursorIcon::Grabbing, + AllScroll => TaoCursorIcon::AllScroll, + ZoomIn => TaoCursorIcon::ZoomIn, + ZoomOut => TaoCursorIcon::ZoomOut, + EResize => TaoCursorIcon::EResize, + NResize => TaoCursorIcon::NResize, + NeResize => TaoCursorIcon::NeResize, + NwResize => TaoCursorIcon::NwResize, + SResize => TaoCursorIcon::SResize, + SeResize => TaoCursorIcon::SeResize, + SwResize => TaoCursorIcon::SwResize, + WResize => TaoCursorIcon::WResize, + EwResize => TaoCursorIcon::EwResize, + NsResize => TaoCursorIcon::NsResize, + NeswResize => TaoCursorIcon::NeswResize, + NwseResize => TaoCursorIcon::NwseResize, + ColResize => TaoCursorIcon::ColResize, + RowResize => TaoCursorIcon::RowResize, + _ => TaoCursorIcon::Default, }; Self(i) } } -pub struct ProgressStateWrapper(pub WryProgressState); +pub struct ProgressStateWrapper(pub TaoProgressState); impl From for ProgressStateWrapper { fn from(status: ProgressBarStatus) -> Self { let state = match status { - ProgressBarStatus::None => WryProgressState::None, - ProgressBarStatus::Normal => WryProgressState::Normal, - ProgressBarStatus::Indeterminate => WryProgressState::Indeterminate, - ProgressBarStatus::Paused => WryProgressState::Paused, - ProgressBarStatus::Error => WryProgressState::Error, + ProgressBarStatus::None => TaoProgressState::None, + ProgressBarStatus::Normal => TaoProgressState::Normal, + ProgressBarStatus::Indeterminate => TaoProgressState::Indeterminate, + ProgressBarStatus::Paused => TaoProgressState::Paused, + ProgressBarStatus::Error => TaoProgressState::Error, }; Self(state) } } -pub struct ProgressBarStateWrapper(pub WryProgressBarState); +pub struct ProgressBarStateWrapper(pub TaoProgressBarState); impl From for ProgressBarStateWrapper { fn from(progress_state: ProgressBarState) -> Self { - Self(WryProgressBarState { + Self(TaoProgressBarState { progress: progress_state.progress, state: progress_state .status @@ -554,7 +553,7 @@ impl From for ProgressBarStateWrapper { #[derive(Clone, Default)] pub struct WindowBuilderWrapper { - inner: WryWindowBuilder, + inner: TaoWindowBuilder, center: bool, #[cfg(target_os = "macos")] tabbing_identifier: Option, @@ -659,28 +658,28 @@ impl WindowBuilder for WindowBuilderWrapper { } fn position(mut self, x: f64, y: f64) -> Self { - self.inner = self.inner.with_position(WryLogicalPosition::new(x, y)); + self.inner = self.inner.with_position(TaoLogicalPosition::new(x, y)); self } fn inner_size(mut self, width: f64, height: f64) -> Self { self.inner = self .inner - .with_inner_size(WryLogicalSize::new(width, height)); + .with_inner_size(TaoLogicalSize::new(width, height)); self } fn min_inner_size(mut self, min_width: f64, min_height: f64) -> Self { self.inner = self .inner - .with_min_inner_size(WryLogicalSize::new(min_width, min_height)); + .with_min_inner_size(TaoLogicalSize::new(min_width, min_height)); self } fn max_inner_size(mut self, max_width: f64, max_height: f64) -> Self { self.inner = self .inner - .with_max_inner_size(WryLogicalSize::new(max_width, max_height)); + .with_max_inner_size(TaoLogicalSize::new(max_width, max_height)); self } @@ -834,7 +833,7 @@ impl WindowBuilder for WindowBuilderWrapper { fn icon(mut self, icon: Icon) -> Result { self.inner = self .inner - .with_window_icon(Some(WryIcon::try_from(icon)?.0)); + .with_window_icon(Some(TaoIcon::try_from(icon)?.0)); Ok(self) } @@ -853,8 +852,8 @@ impl WindowBuilder for WindowBuilderWrapper { fn theme(mut self, theme: Option) -> Self { self.inner = self.inner.with_theme(if let Some(t) = theme { match t { - Theme::Dark => Some(WryTheme::Dark), - _ => Some(WryTheme::Light), + Theme::Dark => Some(TaoTheme::Dark), + _ => Some(TaoTheme::Light), } } else { None @@ -902,11 +901,11 @@ impl From for FileDropEvent { match event.0 { WryFileDropEvent::Hovered { paths, position } => FileDropEvent::Hovered { paths: paths.into_iter().map(decode_path).collect(), - position: PhysicalPositionWrapper(position).into(), + position: PhysicalPosition::new(position.0 as f64, position.1 as f64), }, WryFileDropEvent::Dropped { paths, position } => FileDropEvent::Dropped { paths: paths.into_iter().map(decode_path).collect(), - position: PhysicalPositionWrapper(position).into(), + position: PhysicalPosition::new(position.0 as f64, position.1 as f64), }, // default to cancelled // FIXME(maybe): Add `FileDropEvent::Unknown` event? @@ -1038,7 +1037,7 @@ pub enum WindowMessage { SetPosition(Position), SetFullscreen(bool), SetFocus, - SetIcon(WryWindowIcon), + SetIcon(TaoWindowIcon), SetSkipTaskbar(bool), SetCursorGrab(bool), SetCursorVisible(bool), @@ -1077,7 +1076,7 @@ pub enum Message { CreateWebview(WebviewId, CreateWebviewClosure), CreateWindow( WebviewId, - Box (String, WryWindowBuilder) + Send>, + Box (String, TaoWindowBuilder) + Send>, Sender>>, ), UserEvent(T), @@ -1093,7 +1092,7 @@ impl Clone for Message { } } -/// The Tauri [`Dispatch`] for [`Wry`]. +/// The Tauri [`Dispatch`] for [`Tao`]. #[derive(Debug, Clone)] pub struct WryDispatcher { window_id: WebviewId, @@ -1504,7 +1503,7 @@ impl Dispatch for WryDispatcher { &self.context, Message::Window( self.window_id, - WindowMessage::SetIcon(WryIcon::try_from(icon)?.0), + WindowMessage::SetIcon(TaoIcon::try_from(icon)?.0), ), ) } @@ -1585,6 +1584,7 @@ impl Dispatch for WryDispatcher { #[derive(Clone)] enum WindowHandle { Webview { + window: Arc, inner: Rc, context_store: WebContextStore, // the key of the WebContext if it's not shared @@ -1597,6 +1597,7 @@ impl Drop for WindowHandle { fn drop(&mut self) { if let Self::Webview { inner, + window: _, context_store, context_key, } = self @@ -1620,17 +1621,17 @@ impl Deref for WindowHandle { #[inline(always)] fn deref(&self) -> &Window { match self { - Self::Webview { inner, .. } => inner.window(), + Self::Webview { window, .. } => window, Self::Window(w) => w, } } } impl WindowHandle { - fn inner_size(&self) -> WryPhysicalSize { + fn inner_size(&self) -> TaoPhysicalSize { match self { WindowHandle::Window(w) => w.inner_size(), - WindowHandle::Webview { inner, .. } => inner.inner_size(), + WindowHandle::Webview { window, .. } => window.inner_size(), } } } @@ -1651,7 +1652,7 @@ impl fmt::Debug for WindowWrapper { } #[derive(Debug, Clone)] -pub struct EventProxy(WryEventLoopProxy>); +pub struct EventProxy(TaoEventLoopProxy>); #[cfg(target_os = "ios")] #[allow(clippy::non_send_fields_in_send_ty)] @@ -1676,7 +1677,7 @@ pub trait Plugin { &mut self, event: &Event>, event_loop: &EventLoopWindowTarget>, - proxy: &WryEventLoopProxy>, + proxy: &TaoEventLoopProxy>, control_flow: &mut ControlFlow, context: EventLoopIterationContext<'_, T>, web_context: &WebContextStore, @@ -1712,7 +1713,7 @@ unsafe impl Sync for WryHandle {} impl WryHandle { /// Creates a new tao window using a callback, and returns its window id. - pub fn create_tao_window (String, WryWindowBuilder) + Send + 'static>( + pub fn create_tao_window (String, TaoWindowBuilder) + Send + 'static>( &self, f: F, ) -> Result> { @@ -1845,7 +1846,7 @@ impl Wry { ) -> Result { #[cfg(windows)] if let Some(hook) = args.msg_hook { - use wry::application::platform::windows::EventLoopBuilderExtWindows; + use tao::platform::windows::EventLoopBuilderExtWindows; event_loop_builder.with_msg_hook(hook); } Self::init(event_loop_builder.build()) @@ -1897,7 +1898,7 @@ impl Runtime for Wry { target_os = "openbsd" ))] fn new_any_thread(args: RuntimeInitArgs) -> Result { - use wry::application::platform::unix::EventLoopBuilderExtUnix; + use tao::platform::unix::EventLoopBuilderExtUnix; let mut event_loop_builder = EventLoopBuilder::>::with_user_event(); event_loop_builder.with_any_thread(true); Self::init_with_builder(event_loop_builder, args) @@ -1905,7 +1906,7 @@ impl Runtime for Wry { #[cfg(windows)] fn new_any_thread(args: RuntimeInitArgs) -> Result { - use wry::application::platform::windows::EventLoopBuilderExtWindows; + use tao::platform::windows::EventLoopBuilderExtWindows; let mut event_loop_builder = EventLoopBuilder::>::with_user_event(); event_loop_builder.with_any_thread(true); Self::init_with_builder(event_loop_builder, args) @@ -1977,9 +1978,9 @@ impl Runtime for Wry { self .event_loop .set_activation_policy(match activation_policy { - ActivationPolicy::Regular => WryActivationPolicy::Regular, - ActivationPolicy::Accessory => WryActivationPolicy::Accessory, - ActivationPolicy::Prohibited => WryActivationPolicy::Prohibited, + ActivationPolicy::Regular => TaoActivationPolicy::Regular, + ActivationPolicy::Accessory => TaoActivationPolicy::Accessory, + ActivationPolicy::Prohibited => TaoActivationPolicy::Prohibited, _ => unimplemented!(), }); } @@ -2002,7 +2003,7 @@ impl Runtime for Wry { #[cfg(desktop)] fn run_iteration) + 'static>(&mut self, mut callback: F) -> RunIteration { - use wry::application::platform::run_return::EventLoopExtRunReturn; + use tao::platform::run_return::EventLoopExtRunReturn; let windows = self.context.main_thread.windows.clone(); let webview_id_map = self.context.webview_id_map.clone(); let web_context = &self.context.main_thread.web_context; @@ -2144,12 +2145,12 @@ fn handle_user_message( target_os = "openbsd" ))] { - use wry::webview::WebviewExtUnix; + use wry::WebViewExtUnix; f(w.webview()); } #[cfg(target_os = "macos")] { - use wry::webview::WebviewExtMacOS; + use wry::WebViewExtMacOS; f(Webview { webview: w.webview(), manager: w.manager(), @@ -2158,12 +2159,13 @@ fn handle_user_message( } #[cfg(target_os = "ios")] { - use wry::{application::platform::ios::WindowExtIOS, webview::WebviewExtIOS}; + use tao::platform::ios::WindowExtIOS; + use wry::WebViewExtIOS; f(Webview { webview: w.webview(), manager: w.manager(), - view_controller: w.window().ui_view_controller() as cocoa::base::id, + view_controller: window.ui_view_controller() as cocoa::base::id, }); } #[cfg(windows)] @@ -2508,22 +2510,22 @@ fn handle_event_loop( match event { #[cfg(windows)] - WryWindowEvent::ThemeChanged(theme) => { + TaoWindowEvent::ThemeChanged(theme) => { if let Some(window) = windows.borrow().get(&window_id) { if let Some(WindowHandle::Webview { inner, .. }) = &window.inner { let theme = match theme { - WryTheme::Dark => wry::webview::Theme::Dark, - WryTheme::Light => wry::webview::Theme::Light, - _ => wry::webview::Theme::Light, + TaoTheme::Dark => wry::Theme::Dark, + TaoTheme::Light => wry::Theme::Light, + _ => wry::Theme::Light, }; inner.set_theme(theme); } } } - WryWindowEvent::CloseRequested => { + TaoWindowEvent::CloseRequested => { on_close_requested(callback, window_id, windows.clone()); } - WryWindowEvent::Destroyed => { + TaoWindowEvent::Destroyed => { let removed = windows.borrow_mut().remove(&window_id).is_some(); if removed { let is_empty = windows.borrow().is_empty(); @@ -2611,13 +2613,13 @@ fn on_window_close(window_id: WebviewId, windows: Rc) -> Result<()> { +pub fn center_window(window: &Window, window_size: TaoPhysicalSize) -> Result<()> { if let Some(monitor) = window.current_monitor() { let screen_size = monitor.size(); let monitor_pos = monitor.position(); let x = (screen_size.width as i32 - window_size.width as i32) / 2; let y = (screen_size.height as i32 - window_size.height as i32) / 2; - window.set_outer_position(WryPhysicalPosition::new( + window.set_outer_position(TaoPhysicalPosition::new( monitor_pos.x + x, monitor_pos.y + y, )); @@ -2707,8 +2709,26 @@ fn create_webview( handler(raw); } - let mut webview_builder = WebViewBuilder::new(window) - .map_err(|e| Error::CreateWebview(Box::new(e)))? + #[cfg(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + ))] + let builder = WebViewBuilder::new(&window); + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + target_os = "android" + )))] + let builder = { + use wry::WebViewBuilderExtUnix; + let vbox = window.default_vbox().unwrap(); + WebViewBuilder::new_gtk(vbox) + }; + + let mut webview_builder = builder .with_focused(focused) .with_url(&url) .unwrap() // safe to unwrap because we validate the URL beforehand @@ -2732,8 +2752,8 @@ fn create_webview( page_load_handler( url, match event { - wry::webview::PageLoadEvent::Started => tauri_runtime::window::PageLoadEvent::Started, - wry::webview::PageLoadEvent::Finished => tauri_runtime::window::PageLoadEvent::Finished, + wry::PageLoadEvent::Started => tauri_runtime::window::PageLoadEvent::Started, + wry::PageLoadEvent::Finished => tauri_runtime::window::PageLoadEvent::Finished, }, ) }); @@ -2752,9 +2772,9 @@ fn create_webview( if let Some(theme) = window_theme { webview_builder = webview_builder.with_theme(match theme { - WryTheme::Dark => wry::webview::Theme::Dark, - WryTheme::Light => wry::webview::Theme::Light, - _ => wry::webview::Theme::Light, + TaoTheme::Dark => wry::Theme::Dark, + TaoTheme::Light => wry::Theme::Light, + _ => wry::Theme::Light, }); } } @@ -2765,8 +2785,12 @@ fn create_webview( } if let Some(handler) = ipc_handler { - webview_builder = - webview_builder.with_ipc_handler(create_ipc_handler(context.clone(), label.clone(), handler)); + webview_builder = webview_builder.with_ipc_handler(create_ipc_handler( + window_id, + context.clone(), + label.clone(), + handler, + )); } for (scheme, protocol) in uri_scheme_protocols { @@ -2810,11 +2834,11 @@ fn create_webview( }; if webview_attributes.clipboard { - webview_builder.webview.clipboard = true; + webview_builder.attrs.clipboard = true; } if webview_attributes.incognito { - webview_builder.webview.incognito = true; + webview_builder.attrs.incognito = true; } #[cfg(any(debug_assertions, feature = "devtools"))] @@ -2876,6 +2900,7 @@ fn create_webview( Ok(WindowWrapper { label, inner: Some(WindowHandle::Webview { + window: Arc::new(window), inner: Rc::new(webview), context_store: web_context_store.clone(), context_key: if automation_enabled { @@ -2890,12 +2915,12 @@ fn create_webview( /// Create a wry ipc handler from a tauri ipc handler. fn create_ipc_handler( + window_id: u32, context: Context, label: String, handler: WebviewIpcHandler>, ) -> Box { - Box::new(move |window, request| { - let window_id = context.webview_id_map.get(&window.id()).unwrap(); + Box::new(move |request| { handler( DetachedWindow { dispatcher: WryDispatcher { @@ -2911,7 +2936,7 @@ fn create_ipc_handler( /// Create a wry file drop handler. fn create_file_drop_handler(window_event_listeners: WindowEventListeners) -> Box { - Box::new(move |_window, event| { + Box::new(move |event| { let event: FileDropEvent = FileDropEventWrapper(event).into(); let window_event = WindowEvent::FileDrop(event); let listeners_map = window_event_listeners.lock().unwrap(); diff --git a/core/tauri-runtime-wry/src/webview.rs b/core/tauri-runtime-wry/src/webview.rs index 283c32fb5..fc01cdf2a 100644 --- a/core/tauri-runtime-wry/src/webview.rs +++ b/core/tauri-runtime-wry/src/webview.rs @@ -10,9 +10,7 @@ target_os = "openbsd" ))] mod imp { - use std::rc::Rc; - - pub type Webview = Rc; + pub type Webview = webkit2gtk::WebView; } #[cfg(target_os = "macos")] @@ -47,7 +45,7 @@ mod imp { #[cfg(target_os = "android")] mod imp { - use wry::webview::JniHandle; + use wry::JniHandle; pub type Webview = JniHandle; } diff --git a/core/tauri-runtime/Cargo.toml b/core/tauri-runtime/Cargo.toml index 715d0b816..122049547 100644 --- a/core/tauri-runtime/Cargo.toml +++ b/core/tauri-runtime/Cargo.toml @@ -35,7 +35,7 @@ raw-window-handle = "0.5" url = { version = "2" } [target."cfg(windows)".dependencies.windows] -version = "0.51" +version = "0.52" features = [ "Win32_Foundation" ] [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index 8a2fd2c68..7c7f95499 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -87,11 +87,11 @@ objc = "0.2" window-vibrancy = "0.4" [target."cfg(windows)".dependencies] -webview2-com = "0.27" +webview2-com = "0.28" window-vibrancy = "0.4" [target."cfg(windows)".dependencies.windows] - version = "0.51" + version = "0.52" features = [ "Win32_Foundation" ] [target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies] diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index 658b99c01..337c8843a 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -267,7 +267,7 @@ pub struct AppHandle { impl AppHandle { /// Create a new tao window using a callback. The event loop must be running at this point. pub fn create_tao_window< - F: FnOnce() -> (String, tauri_runtime_wry::WryWindowBuilder) + Send + 'static, + F: FnOnce() -> (String, tauri_runtime_wry::TaoWindowBuilder) + Send + 'static, >( &self, f: F, diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index 36eee36a3..bce7b7596 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -116,15 +116,30 @@ pub type Wry = tauri_runtime_wry::Wry; #[macro_export] macro_rules! android_binding { ($domain:ident, $package:ident, $main: ident, $wry: path) => { - ::tauri::wry::android_binding!($domain, $package, $main, $wry); - ::tauri::wry::application::android_fn!( + use $wry::{ + android_setup, + prelude::{JClass, JNIEnv, JString}, + }; + + ::tauri::wry::android_binding!($domain, $package, $wry); + + ::tauri::tao::android_binding!( + $domain, + $package, + WryActivity, + android_setup, + $main, + ::tauri::tao + ); + + ::tauri::tao::platform::android::prelude::android_fn!( app_tauri, plugin, PluginManager, handlePluginResponse, [i32, JString, JString], ); - ::tauri::wry::application::android_fn!( + ::tauri::tao::platform::android::prelude::android_fn!( app_tauri, plugin, PluginManager, @@ -157,7 +172,7 @@ macro_rules! android_binding { pub use plugin::mobile::{handle_android_plugin_response, send_channel_data}; #[cfg(all(feature = "wry", target_os = "android"))] #[doc(hidden)] -pub use tauri_runtime_wry::wry; +pub use tauri_runtime_wry::{tao, wry}; /// A task to run on the main thread. pub type SyncTask = Box; diff --git a/core/tauri/src/window/mod.rs b/core/tauri/src/window/mod.rs index 6ec2b8fe0..7cf5b386d 100644 --- a/core/tauri/src/window/mod.rs +++ b/core/tauri/src/window/mod.rs @@ -1108,7 +1108,7 @@ impl PlatformWebview { target_os = "openbsd" ))) )] - pub fn inner(&self) -> std::rc::Rc { + pub fn inner(&self) -> webkit2gtk::WebView { self.0.clone() } @@ -1159,7 +1159,7 @@ impl PlatformWebview { /// Returns handle for JNI execution. #[cfg(target_os = "android")] - pub fn jni_handle(&self) -> tauri_runtime_wry::wry::webview::JniHandle { + pub fn jni_handle(&self) -> tauri_runtime_wry::wry::JniHandle { self.0 } } @@ -2291,7 +2291,7 @@ impl Window { if let serde_json::Value::Object(map) = payload { for v in map.values() { if let serde_json::Value::String(s) = v { - crate::ipc::JavaScriptChannelId::from_str(s) + let _ = crate::ipc::JavaScriptChannelId::from_str(s) .map(|id| id.channel_on(window.clone())); } } diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index 5c6ee7bdb..cf83e747a 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,43 +1,43 @@ -var wr=Object.defineProperty;var kr=(t,e,n)=>e in t?wr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var _t=(t,e,n)=>(kr(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function n(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=n(s);fetch(s.href,u)}})();function ne(){}function $s(t){return t()}function ys(){return Object.create(null)}function Ce(t){t.forEach($s)}function xs(t){return typeof t=="function"}function je(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Di;function yr(t,e){return t===e?!0:(Di||(Di=document.createElement("a")),Di.href=e,t===Di.href)}function vr(t){return Object.keys(t).length===0}function Cr(t,...e){if(t==null){for(const l of e)l(void 0);return ne}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Sr(t,e,n){t.$$.on_destroy.push(Cr(e,n))}function i(t,e){t.appendChild(e)}function S(t,e,n){t.insertBefore(e,n||null)}function C(t){t.parentNode&&t.parentNode.removeChild(t)}function Je(t,e){for(let n=0;nt.removeEventListener(e,n,l)}function vs(t){return function(e){return e.preventDefault(),t.call(this,e)}}function a(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function X(t){return t===""?null:+t}function Lr(t){return Array.from(t.childNodes)}function se(t,e){e=""+e,t.data!==e&&(t.data=e)}function z(t,e){t.value=e??""}function $t(t,e,n,l){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,l?"important":"")}function Qe(t,e,n){for(let l=0;l{const s=t.$$.callbacks[e];if(s){const u=Pr(e,n,{cancelable:l});return s.slice().forEach(d=>{d.call(t,u)}),!u.defaultPrevented}return!0}}const tn=[],Tn=[];let nn=[];const Sl=[],Er=Promise.resolve();let Ml=!1;function Ir(){Ml||(Ml=!0,Er.then(ir))}function wt(t){nn.push(t)}function nr(t){Sl.push(t)}const wl=new Set;let xt=0;function ir(){if(xt!==0)return;const t=In;do{try{for(;xtt.indexOf(l)===-1?e.push(l):n.push(l)),n.forEach(l=>l()),nn=e}const Fi=new Set;let Tt;function Or(){Tt={r:0,c:[],p:Tt}}function Wr(){Tt.r||Ce(Tt.c),Tt=Tt.p}function sn(t,e){t&&t.i&&(Fi.delete(t),t.i(e))}function zn(t,e,n,l){if(t&&t.o){if(Fi.has(t))return;Fi.add(t),Tt.c.push(()=>{Fi.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function he(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function lr(t,e,n){const l=t.$$.props[e];l!==void 0&&(t.$$.bound[l]=n,n(t.$$.ctx[l]))}function On(t){t&&t.c()}function rn(t,e,n){const{fragment:l,after_update:s}=t.$$;l&&l.m(e,n),wt(()=>{const u=t.$$.on_mount.map($s).filter(xs);t.$$.on_destroy?t.$$.on_destroy.push(...u):Ce(u),t.$$.on_mount=[]}),s.forEach(wt)}function an(t,e){const n=t.$$;n.fragment!==null&&(zr(n.after_update),Ce(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Rr(t,e){t.$$.dirty[0]===-1&&(tn.push(t),Ir(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const P=_.length?_[0]:O;return h.ctx&&s(h.ctx[b],h.ctx[b]=P)&&(!h.skip_bound&&h.bound[b]&&h.bound[b](P),k&&Rr(t,b)),O}):[],h.update(),k=!0,Ce(h.before_update),h.fragment=l?l(h.ctx):!1,e.target){if(e.hydrate){const b=Lr(e.target);h.fragment&&h.fragment.l(b),b.forEach(C)}else h.fragment&&h.fragment.c();e.intro&&sn(t.$$.fragment),rn(t,e.target,e.anchor),ir()}En(c)}class $e{constructor(){_t(this,"$$");_t(this,"$$set")}$destroy(){an(this,1),this.$destroy=ne}$on(e,n){if(!xs(n))return ne;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const s=l.indexOf(n);s!==-1&&l.splice(s,1)}}$set(e){this.$$set&&!vr(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Dr="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Dr);const en=[];function Fr(t,e=ne){let n;const l=new Set;function s(o){if(je(t,o)&&(t=o,n)){const c=!en.length;for(const h of l)h[1](),en.push(h,t);if(c){for(let h=0;h{l.delete(h),l.size===0&&n&&(n(),n=null)}}return{set:s,update:u,subscribe:d}}function Wn(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)}function qi(t,e,n,l,s){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n}var An;function sr(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}class rr{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,An.set(this,()=>{}),this.id=sr(e=>{Wn(this,An,"f").call(this,e)})}set onmessage(e){qi(this,An,e,"f")}get onmessage(){return Wn(this,An,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}An=new WeakMap;async function m(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}async function Hr(){return m("plugin:app|version")}async function Ur(){return m("plugin:app|name")}async function Br(){return m("plugin:app|tauri_version")}async function Vr(){return m("plugin:app|app_show")}async function qr(){return m("plugin:app|app_hide")}function Nr(t){let e,n,l,s,u,d,o,c,h,k,b,O,_,P,v,E,V,D,L,W,A,I,R,Y;return{c(){e=r("div"),n=r("p"),n.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our +var br=Object.defineProperty;var wr=(t,e,n)=>e in t?br(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var _t=(t,e,n)=>(wr(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function n(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(s){if(s.ep)return;s.ep=!0;const u=n(s);fetch(s.href,u)}})();function ne(){}function lr(t){return t()}function Ms(){return Object.create(null)}function Ce(t){t.forEach(lr)}function sr(t){return typeof t=="function"}function je(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Vi;function kr(t,e){return t===e?!0:(Vi||(Vi=document.createElement("a")),Vi.href=e,t===Vi.href)}function yr(t){return Object.keys(t).length===0}function vr(t,...e){if(t==null){for(const l of e)l(void 0);return ne}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Cr(t,e,n){t.$$.on_destroy.push(vr(e,n))}function i(t,e){t.appendChild(e)}function L(t,e,n){t.insertBefore(e,n||null)}function S(t){t.parentNode&&t.parentNode.removeChild(t)}function Je(t,e){for(let n=0;nt.removeEventListener(e,n,l)}function Ps(t){return function(e){return e.preventDefault(),t.call(this,e)}}function a(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function X(t){return t===""?null:+t}function Lr(t){return Array.from(t.childNodes)}function se(t,e){e=""+e,t.data!==e&&(t.data=e)}function O(t,e){t.value=e??""}function xt(t,e,n,l){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,l?"important":"")}function Qe(t,e,n){for(let l=0;l{const s=t.$$.callbacks[e];if(s){const u=Ar(e,n,{cancelable:l});return s.slice().forEach(d=>{d.call(t,u)}),!u.defaultPrevented}return!0}}const tn=[],On=[];let nn=[];const El=[],Pr=Promise.resolve();let Tl=!1;function Er(){Tl||(Tl=!0,Pr.then(or))}function wt(t){nn.push(t)}function ur(t){El.push(t)}const Sl=new Set;let $t=0;function or(){if($t!==0)return;const t=zn;do{try{for(;$tt.indexOf(l)===-1?e.push(l):n.push(l)),n.forEach(l=>l()),nn=e}const qi=new Set;let zt;function Or(){zt={r:0,c:[],p:zt}}function Wr(){zt.r||Ce(zt.c),zt=zt.p}function sn(t,e){t&&t.i&&(qi.delete(t),t.i(e))}function Wn(t,e,n,l){if(t&&t.o){if(qi.has(t))return;qi.add(t),zt.c.push(()=>{qi.delete(t),l&&(n&&t.d(1),l())}),t.o(e)}else l&&l()}function he(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function cr(t,e,n){const l=t.$$.props[e];l!==void 0&&(t.$$.bound[l]=n,n(t.$$.ctx[l]))}function In(t){t&&t.c()}function rn(t,e,n){const{fragment:l,after_update:s}=t.$$;l&&l.m(e,n),wt(()=>{const u=t.$$.on_mount.map(lr).filter(sr);t.$$.on_destroy?t.$$.on_destroy.push(...u):Ce(u),t.$$.on_mount=[]}),s.forEach(wt)}function an(t,e){const n=t.$$;n.fragment!==null&&(zr(n.after_update),Ce(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Ir(t,e){t.$$.dirty[0]===-1&&(tn.push(t),Er(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const y=k.length?k[0]:W;return h.ctx&&s(h.ctx[_],h.ctx[_]=y)&&(!h.skip_bound&&h.bound[_]&&h.bound[_](y),w&&Ir(t,_)),W}):[],h.update(),w=!0,Ce(h.before_update),h.fragment=l?l(h.ctx):!1,e.target){if(e.hydrate){const _=Lr(e.target);h.fragment&&h.fragment.l(_),_.forEach(S)}else h.fragment&&h.fragment.c();e.intro&&sn(t.$$.fragment),rn(t,e.target,e.anchor),or()}Tn(c)}class xe{constructor(){_t(this,"$$");_t(this,"$$set")}$destroy(){an(this,1),this.$destroy=ne}$on(e,n){if(!sr(n))return ne;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(n),()=>{const s=l.indexOf(n);s!==-1&&l.splice(s,1)}}$set(e){this.$$set&&!yr(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Rr="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Rr);const en=[];function Dr(t,e=ne){let n;const l=new Set;function s(o){if(je(t,o)&&(t=o,n)){const c=!en.length;for(const h of l)h[1](),en.push(h,t);if(c){for(let h=0;h{l.delete(h),l.size===0&&n&&(n(),n=null)}}return{set:s,update:u,subscribe:d}}function Rn(t,e,n,l){if(n==="a"&&!l)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!l:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?l:n==="a"?l.call(t):l?l.value:e.get(t)}function Xi(t,e,n,l,s){if(l==="m")throw new TypeError("Private method is not writable");if(l==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return l==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n}var En;function dr(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}class Il{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,En.set(this,()=>{}),this.id=dr(e=>{Rn(this,En,"f").call(this,e)})}set onmessage(e){Xi(this,En,e,"f")}get onmessage(){return Rn(this,En,"f")}toJSON(){return`__CHANNEL__:${this.id}`}}En=new WeakMap;async function m(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}async function Fr(){return m("plugin:app|version")}async function Hr(){return m("plugin:app|name")}async function Ur(){return m("plugin:app|tauri_version")}async function Br(){return m("plugin:app|app_show")}async function Vr(){return m("plugin:app|app_hide")}function qr(t){let e,n,l,s,u,d,o,c,h,w,_,W,k,y,C,E,V,D,M,I,P,T,R,Y;return{c(){e=r("div"),n=r("p"),n.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our development process. In the future, this app will be used on Tauri's integration - tests.`,l=p(),s=r("br"),u=p(),d=r("br"),o=p(),c=r("pre"),h=w(" App name: "),k=r("code"),b=w(t[2]),O=w(` - App version: `),_=r("code"),P=w(t[0]),v=w(` - Tauri version: `),E=r("code"),V=w(t[1]),D=w(` - `),L=p(),W=r("br"),A=p(),I=r("button"),I.textContent="Context menu",a(I,"class","btn")},m(q,Q){S(q,e,Q),i(e,n),i(e,l),i(e,s),i(e,u),i(e,d),i(e,o),i(e,c),i(c,h),i(c,k),i(k,b),i(c,O),i(c,_),i(_,P),i(c,v),i(c,E),i(E,V),i(c,D),i(e,L),i(e,W),i(e,A),i(e,I),R||(Y=M(I,"click",t[3]),R=!0)},p(q,[Q]){Q&4&&se(b,q[2]),Q&1&&se(P,q[0]),Q&2&&se(V,q[1])},i:ne,o:ne,d(q){q&&C(e),R=!1,Y()}}}function jr(t,e,n){let l="1.0.0",s="1.0.0",u="Unknown";Ur().then(o=>{n(2,u=o)}),Hr().then(o=>{n(0,l=o)}),Br().then(o=>{n(1,s=o)});function d(){m("popup_context_menu")}return[l,s,u,d]}class Gr extends $e{constructor(e){super(),Ze(this,e,jr,Nr,je,{})}}var ze;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_FILE_DROP="tauri://file-drop",t.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",t.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"})(ze||(ze={}));async function ar(t,e){await m("plugin:event|unlisten",{event:t,eventId:e})}async function El(t,e,n){return m("plugin:event|listen",{event:t,windowLabel:n==null?void 0:n.target,handler:sr(e)}).then(l=>async()=>ar(t,l))}async function Kr(t,e,n){return El(t,l=>{e(l),ar(t,l.id).catch(()=>{})},n)}async function ur(t,e,n){await m("plugin:event|emit",{event:t,windowLabel:n==null?void 0:n.target,payload:e})}function Xr(t){let e,n,l,s,u,d,o,c;return{c(){e=r("div"),n=r("button"),n.textContent="Call Log API",l=p(),s=r("button"),s.textContent="Call Request (async) API",u=p(),d=r("button"),d.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(s,"class","btn"),a(s,"id","request"),a(d,"class","btn"),a(d,"id","event")},m(h,k){S(h,e,k),i(e,n),i(e,l),i(e,s),i(e,u),i(e,d),o||(c=[M(n,"click",t[0]),M(s,"click",t[1]),M(d,"click",t[2])],o=!0)},p:ne,i:ne,o:ne,d(h){h&&C(e),o=!1,Ce(c)}}}function Yr(t,e,n){let{onMessage:l}=e,s;Vi(async()=>{s=await El("rust-event",l)}),er(()=>{s&&s()});function u(){m("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function d(){m("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(l).catch(l)}function o(){ur("js-event","this is the payload string")}return t.$$set=c=>{"onMessage"in c&&n(3,l=c.onMessage)},[u,d,o,l]}class Qr extends $e{constructor(e){super(),Ze(this,e,Yr,Xr,je,{onMessage:3})}}class Ll{constructor(e,n){this.type="Logical",this.width=e,this.height=n}}class ln{constructor(e,n){this.type="Physical",this.width=e,this.height=n}toLogical(e){return new Ll(this.width/e,this.height/e)}}class Jr{constructor(e,n){this.type="Logical",this.x=e,this.y=n}}class it{constructor(e,n){this.type="Physical",this.x=e,this.y=n}toLogical(e){return new Jr(this.x/e,this.y/e)}}var Ni;(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(Ni||(Ni={}));class Zr{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}var ji;(function(t){t.None="none",t.Normal="normal",t.Indeterminate="indeterminate",t.Paused="paused",t.Error="error"})(ji||(ji={}));function or(){return new Rn(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function kl(){return window.__TAURI_INTERNALS__.metadata.windows.map(t=>new Rn(t.label,{skip:!0}))}const Ss=["tauri://created","tauri://error"];class Rn{constructor(e,n={}){this.label=e,this.listeners=Object.create(null),n!=null&&n.skip||m("plugin:window|create",{options:{...n,label:e}}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static getByLabel(e){return kl().some(n=>n.label===e)?new Rn(e,{skip:!0}):null}static getCurrent(){return or()}static getAll(){return kl()}static async getFocusedWindow(){for(const e of kl())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}):El(e,n,{target:this.label})}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}):Kr(e,n,{target:this.label})}async emit(e,n){if(Ss.includes(e)){for(const l of this.listeners[e]||[])l({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return ur(e,n,{target:this.label})}_handleTauriEvent(e,n){return Ss.includes(e)?(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0):!1}async scaleFactor(){return m("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return m("plugin:window|inner_position",{label:this.label}).then(({x:e,y:n})=>new it(e,n))}async outerPosition(){return m("plugin:window|outer_position",{label:this.label}).then(({x:e,y:n})=>new it(e,n))}async innerSize(){return m("plugin:window|inner_size",{label:this.label}).then(({width:e,height:n})=>new ln(e,n))}async outerSize(){return m("plugin:window|outer_size",{label:this.label}).then(({width:e,height:n})=>new ln(e,n))}async isFullscreen(){return m("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return m("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return m("plugin:window|is_maximized",{label:this.label})}async isFocused(){return m("plugin:window|is_focused",{label:this.label})}async isDecorated(){return m("plugin:window|is_decorated",{label:this.label})}async isResizable(){return m("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return m("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return m("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return m("plugin:window|is_closable",{label:this.label})}async isVisible(){return m("plugin:window|is_visible",{label:this.label})}async title(){return m("plugin:window|title",{label:this.label})}async theme(){return m("plugin:window|theme",{label:this.label})}async center(){return m("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(e===Ni.Critical?n={type:"Critical"}:n={type:"Informational"}),m("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return m("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return m("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return m("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return m("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return m("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return m("plugin:window|maximize",{label:this.label})}async unmaximize(){return m("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return m("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return m("plugin:window|minimize",{label:this.label})}async unminimize(){return m("plugin:window|unminimize",{label:this.label})}async show(){return m("plugin:window|show",{label:this.label})}async hide(){return m("plugin:window|hide",{label:this.label})}async close(){return m("plugin:window|close",{label:this.label})}async setDecorations(e){return m("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return m("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return m("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return m("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return m("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return m("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return m("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return m("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return m("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return m("plugin:window|set_focus",{label:this.label})}async setIcon(e){return m("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return m("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return m("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return m("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return m("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return m("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return m("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return m("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return m("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen(ze.WINDOW_RESIZED,n=>{n.payload=$r(n.payload),e(n)})}async onMoved(e){return this.listen(ze.WINDOW_MOVED,n=>{n.payload=yl(n.payload),e(n)})}async onCloseRequested(e){return this.listen(ze.WINDOW_CLOSE_REQUESTED,n=>{const l=new Zr(n);Promise.resolve(e(l)).then(()=>{if(!l.isPreventDefault())return this.close()})})}async onFocusChanged(e){const n=await this.listen(ze.WINDOW_FOCUS,s=>{e({...s,payload:!0})}),l=await this.listen(ze.WINDOW_BLUR,s=>{e({...s,payload:!1})});return()=>{n(),l()}}async onScaleChanged(e){return this.listen(ze.WINDOW_SCALE_FACTOR_CHANGED,e)}async onFileDropEvent(e){const n=await this.listen(ze.WINDOW_FILE_DROP,u=>{e({...u,payload:{type:"drop",paths:u.payload.paths,position:yl(u.payload.position)}})}),l=await this.listen(ze.WINDOW_FILE_DROP_HOVER,u=>{e({...u,payload:{type:"hover",paths:u.payload.paths,position:yl(u.payload.position)}})}),s=await this.listen(ze.WINDOW_FILE_DROP_CANCELLED,u=>{e({...u,payload:{type:"cancel"}})});return()=>{n(),l(),s()}}async onThemeChanged(e){return this.listen(ze.WINDOW_THEME_CHANGED,e)}}var Gi;(function(t){t.AppearanceBased="appearanceBased",t.Light="light",t.Dark="dark",t.MediumLight="mediumLight",t.UltraDark="ultraDark",t.Titlebar="titlebar",t.Selection="selection",t.Menu="menu",t.Popover="popover",t.Sidebar="sidebar",t.HeaderView="headerView",t.Sheet="sheet",t.WindowBackground="windowBackground",t.HudWindow="hudWindow",t.FullScreenUI="fullScreenUI",t.Tooltip="tooltip",t.ContentBackground="contentBackground",t.UnderWindowBackground="underWindowBackground",t.UnderPageBackground="underPageBackground",t.Mica="mica",t.Blur="blur",t.Acrylic="acrylic",t.Tabbed="tabbed",t.TabbedDark="tabbedDark",t.TabbedLight="tabbedLight"})(Gi||(Gi={}));var Ki;(function(t){t.FollowsWindowActiveState="followsWindowActiveState",t.Active="active",t.Inactive="inactive"})(Ki||(Ki={}));function yl(t){return new it(t.x,t.y)}function $r(t){return new ln(t.width,t.height)}function Ms(t,e,n){const l=t.slice();return l[105]=e[n],l}function Ls(t,e,n){const l=t.slice();return l[108]=e[n],l}function Ps(t,e,n){const l=t.slice();return l[111]=e[n],l}function As(t,e,n){const l=t.slice();return l[114]=e[n],l}function Es(t,e,n){const l=t.slice();return l[117]=e[n],l}function Is(t){let e,n,l,s,u,d,o=he(Object.keys(t[1])),c=[];for(let h=0;ht[59].call(l))},m(h,k){S(h,e,k),S(h,n,k),S(h,l,k),i(l,s);for(let b=0;bt[83].call(tt)),a(pt,"class","input"),a(pt,"type","number"),a(mt,"class","input"),a(mt,"type","number"),a(et,"class","flex gap-2"),a(gt,"class","input grow"),a(gt,"id","title"),a(Sn,"class","btn"),a(Sn,"type","submit"),a(Et,"class","flex gap-1"),a(Cn,"class","flex flex-col gap-1"),a(nt,"class","input"),t[26]===void 0&&wt(()=>t[87].call(nt)),a(Ye,"class","input"),a(Ye,"type","number"),a(Ye,"min","0"),a(Ye,"max","100"),a(Qt,"class","flex gap-2"),a(Mn,"class","flex flex-col gap-1")},m(f,g){S(f,e,g),S(f,n,g),S(f,l,g),i(l,s),i(l,u),i(l,d),i(d,o),z(o,t[43]),i(d,c),i(d,h),S(f,k,g),S(f,b,g),S(f,O,g),S(f,_,g),i(_,P),i(_,v),i(_,E),i(_,V),i(_,D),i(_,L),i(_,W),S(f,A,g),S(f,I,g),i(I,R),i(R,Y),i(R,q),q.checked=t[6],i(I,Q),i(I,ie),i(ie,ee),i(ie,y),y.checked=t[2],i(I,B),i(I,G),i(G,oe),i(G,Z),Z.checked=t[3],i(I,we),i(I,be),i(be,fe),i(be,ce),ce.checked=t[4],i(I,$),i(I,pe),i(pe,K),i(pe,le),le.checked=t[5],i(I,te),i(I,T),i(T,J),i(T,H),H.checked=t[7],i(I,re),i(I,Le),i(Le,ke),i(Le,me),me.checked=t[8],i(I,Oe),i(I,Pe),i(Pe,We),i(Pe,ge),ge.checked=t[9],i(I,_e),i(I,Se),i(Se,Ae),i(Se,de),de.checked=t[10],i(I,Me),i(I,ae),i(ae,Re),i(ae,De),De.checked=t[11],S(f,Ee,g),S(f,ue,g),S(f,F,g),S(f,x,g),i(x,U),i(U,Ie),i(Ie,Dn),i(Ie,Fe),z(Fe,t[18]),i(U,Fn),i(U,zt),i(zt,Hn),i(zt,He),z(He,t[19]),i(x,Un),i(x,lt),i(lt,Ot),i(Ot,Bn),i(Ot,Ue),z(Ue,t[12]),i(lt,Vn),i(lt,Wt),i(Wt,qn),i(Wt,Be),z(Be,t[13]),i(x,Nn),i(x,st),i(st,Rt),i(Rt,jn),i(Rt,Ge),z(Ge,t[14]),i(st,Gn),i(st,Dt),i(Dt,Kn),i(Dt,Ke),z(Ke,t[15]),i(x,Xn),i(x,rt),i(rt,Ft),i(Ft,Yn),i(Ft,Ve),z(Ve,t[16]),i(rt,Qn),i(rt,Ht),i(Ht,Jn),i(Ht,qe),z(qe,t[17]),S(f,cn,g),S(f,dn,g),S(f,hn,g),S(f,Te,g),i(Te,at),i(at,Xe),i(Xe,N),i(Xe,fn),i(Xe,kt),i(kt,pn),i(kt,Ut),i(Xe,mn),i(Xe,vt),i(vt,gn),i(vt,Bt),i(at,_n),i(at,Ne),i(Ne,St),i(Ne,bn),i(Ne,Mt),i(Mt,wn),i(Mt,Vt),i(Ne,kn),i(Ne,Pt),i(Pt,yn),i(Pt,qt),i(Te,Zn),i(Te,Nt),i(Nt,ut),i(ut,$n),i(ut,Tl),i(ut,xn),i(xn,zl),i(xn,Xi),i(ut,Ol),i(ut,ti),i(ti,Wl),i(ti,Yi),i(Nt,Rl),i(Nt,ot),i(ot,ii),i(ot,Dl),i(ot,li),i(li,Fl),i(li,Qi),i(ot,Hl),i(ot,ri),i(ri,Ul),i(ri,Ji),i(Te,Bl),i(Te,jt),i(jt,ct),i(ct,ui),i(ct,Vl),i(ct,oi),i(oi,ql),i(oi,Zi),i(ct,Nl),i(ct,di),i(di,jl),i(di,$i),i(jt,Gl),i(jt,dt),i(dt,fi),i(dt,Kl),i(dt,pi),i(pi,Xl),i(pi,xi),i(dt,Yl),i(dt,gi),i(gi,Ql),i(gi,el),i(Te,Jl),i(Te,Gt),i(Gt,ht),i(ht,bi),i(ht,Zl),i(ht,wi),i(wi,$l),i(wi,tl),i(ht,xl),i(ht,yi),i(yi,es),i(yi,nl),i(Gt,ts),i(Gt,ft),i(ft,Ci),i(ft,ns),i(ft,Si),i(Si,is),i(Si,il),i(ft,ls),i(ft,Li),i(Li,ss),i(Li,ll),S(f,sl,g),S(f,rl,g),S(f,al,g),S(f,vn,g),S(f,ul,g),S(f,xe,g),i(xe,Ai),i(Ai,Kt),Kt.checked=t[20],i(Ai,rs),i(xe,as),i(xe,Ei),i(Ei,Xt),Xt.checked=t[21],i(Ei,us),i(xe,os),i(xe,Ii),i(Ii,Yt),Yt.checked=t[25],i(Ii,cs),S(f,ol,g),S(f,et,g),i(et,Ti),i(Ti,ds),i(Ti,tt);for(let j=0;jt[89].call(u)),a(h,"class","input"),t[37]===void 0&&wt(()=>t[90].call(h)),a(_,"class","input"),a(_,"type","number"),a(n,"class","flex"),$t(L,"max-width","120px"),a(L,"class","input"),a(L,"type","number"),a(L,"placeholder","R"),$t(A,"max-width","120px"),a(A,"class","input"),a(A,"type","number"),a(A,"placeholder","G"),$t(R,"max-width","120px"),a(R,"class","input"),a(R,"type","number"),a(R,"placeholder","B"),$t(q,"max-width","120px"),a(q,"class","input"),a(q,"type","number"),a(q,"placeholder","A"),a(D,"class","flex"),a(v,"class","flex"),a(ee,"class","btn"),$t(ee,"width","80px"),a(ie,"class","flex"),a(fe,"class","btn"),$t(fe,"width","80px"),a(B,"class","flex"),a(e,"class","flex flex-col gap-1")},m(T,J){S(T,e,J),i(e,n),i(n,l),i(l,s),i(l,u);for(let H=0;H=1,k,b,O,_=h&&Is(t),P=t[1][t[0]]&&zs(t);return{c(){e=r("div"),n=r("div"),l=r("input"),s=p(),u=r("button"),u.textContent="New window",d=p(),o=r("br"),c=p(),_&&_.c(),k=p(),P&&P.c(),a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","New Window label.."),a(u,"class","btn"),a(n,"class","flex gap-1"),a(e,"class","flex flex-col children:grow gap-2")},m(v,E){S(v,e,E),i(e,n),i(n,l),z(l,t[28]),i(n,s),i(n,u),i(e,d),i(e,o),i(e,c),_&&_.m(e,null),i(e,k),P&&P.m(e,null),b||(O=[M(l,"input",t[58]),M(u,"click",t[53])],b=!0)},p(v,E){E[0]&268435456&&l.value!==v[28]&&z(l,v[28]),E[0]&2&&(h=Object.keys(v[1]).length>=1),h?_?_.p(v,E):(_=Is(v),_.c(),_.m(e,k)):_&&(_.d(1),_=null),v[1][v[0]]?P?P.p(v,E):(P=zs(v),P.c(),P.m(e,null)):P&&(P.d(1),P=null)},i:ne,o:ne,d(v){v&&C(e),_&&_.d(),P&&P.d(),b=!1,Ce(O)}}}function ta(t,e,n){const l=or();let s=l.label;const u={[l.label]:l},d=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"],o=["mica","blur","acrylic","tabbed","tabbedDark","tabbedLight"],c=navigator.appVersion.includes("Windows"),h=navigator.appVersion.includes("Macintosh");let k=c?o:Object.keys(Gi).map(N=>Gi[N]).filter(N=>!o.includes(N));const b=Object.keys(Ki).map(N=>Ki[N]),O=Object.keys(ji).map(N=>ji[N]);let{onMessage:_}=e;const P=document.querySelector("main");let v,E=!0,V=!0,D=!0,L=!0,W=!1,A=!0,I=!1,R=!1,Y=!0,q=!1,Q=null,ie=null,ee=null,y=null,B=null,G=null,oe=null,Z=null,we=1,be=new it(oe,Z),fe=new it(oe,Z),ce=new ln(Q,ie),$=new ln(Q,ie),pe,K,le=!1,te=!0,T=null,J=null,H="default",re=!1,Le="Awesome Tauri Example!",ke=[],me,Oe,Pe,We,ge,_e,Se,Ae="none",de=0,Me;function ae(){u[s].setTitle(Le)}function Re(){u[s].hide(),setTimeout(u[s].show,2e3)}function De(){u[s].minimize(),setTimeout(u[s].unminimize,2e3)}function Ee(){if(!v)return;const N=new Rn(v);n(1,u[v]=N,u),N.once("tauri://error",function(){_("Error creating new webview")})}function ue(){u[s].innerSize().then(N=>{n(32,ce=N),n(12,Q=ce.width),n(13,ie=ce.height)}),u[s].outerSize().then(N=>{n(33,$=N)})}function F(){u[s].innerPosition().then(N=>{n(30,be=N)}),u[s].outerPosition().then(N=>{n(31,fe=N),n(18,oe=fe.x),n(19,Z=fe.y)})}async function x(N){N&&(pe&&pe(),K&&K(),K=await N.listen("tauri://move",F),pe=await N.listen("tauri://resize",ue))}async function U(){await u[s].minimize(),await u[s].requestUserAttention(Ni.Critical),await new Promise(N=>setTimeout(N,3e3)),await u[s].requestUserAttention(null)}async function Ie(){ke.includes(me)||n(35,ke=[...ke,me]);const N={effects:ke,state:Oe,radius:Pe};Number.isInteger(We)&&Number.isInteger(ge)&&Number.isInteger(_e)&&Number.isInteger(Se)&&(N.color=[We,ge,_e,Se]),P.classList.remove("bg-primary"),P.classList.remove("dark:bg-darkPrimary"),await u[s].clearEffects(),await u[s].setEffects(N)}async function Dn(){n(35,ke=[]),await u[s].clearEffects(),P.classList.add("bg-primary"),P.classList.add("dark:bg-darkPrimary")}function Fe(){v=this.value,n(28,v)}function Fn(){s=Pn(this),n(0,s),n(1,u)}function zt(){Me=this.value,n(43,Me)}const Hn=()=>u[s].center();function He(){W=this.checked,n(6,W)}function Un(){E=this.checked,n(2,E)}function lt(){V=this.checked,n(3,V)}function Ot(){D=this.checked,n(4,D)}function Bn(){L=this.checked,n(5,L)}function Ue(){A=this.checked,n(7,A)}function Vn(){I=this.checked,n(8,I)}function Wt(){R=this.checked,n(9,R)}function qn(){Y=this.checked,n(10,Y)}function Be(){q=this.checked,n(11,q)}function Nn(){oe=X(this.value),n(18,oe)}function st(){Z=X(this.value),n(19,Z)}function Rt(){Q=X(this.value),n(12,Q)}function jn(){ie=X(this.value),n(13,ie)}function Ge(){ee=X(this.value),n(14,ee)}function Gn(){y=X(this.value),n(15,y)}function Dt(){B=X(this.value),n(16,B)}function Kn(){G=X(this.value),n(17,G)}function Ke(){le=this.checked,n(20,le)}function Xn(){te=this.checked,n(21,te)}function rt(){re=this.checked,n(25,re)}function Ft(){H=Pn(this),n(24,H),n(44,d)}function Yn(){T=X(this.value),n(22,T)}function Ve(){J=X(this.value),n(23,J)}function Qn(){Le=this.value,n(34,Le)}function Ht(){Ae=Pn(this),n(26,Ae),n(49,O)}function Jn(){de=X(this.value),n(27,de)}function qe(){me=Pn(this),n(36,me),n(47,k)}function cn(){Oe=Pn(this),n(37,Oe),n(48,b)}function dn(){Pe=X(this.value),n(38,Pe)}function hn(){We=X(this.value),n(39,We)}function Te(){ge=X(this.value),n(40,ge)}function at(){_e=X(this.value),n(41,_e)}function Xe(){Se=X(this.value),n(42,Se)}return t.$$set=N=>{"onMessage"in N&&n(57,_=N.onMessage)},t.$$.update=()=>{var N,fn,kt,pn,yt,Ut,mn,vt,gn,Ct,Bt,_n,Ne,St,bn,Mt,wn,Lt,Vt,kn,Pt,yn,At,qt;t.$$.dirty[0]&3&&(u[s],F(),ue()),t.$$.dirty[0]&7&&((N=u[s])==null||N.setResizable(E)),t.$$.dirty[0]&11&&((fn=u[s])==null||fn.setMaximizable(V)),t.$$.dirty[0]&19&&((kt=u[s])==null||kt.setMinimizable(D)),t.$$.dirty[0]&35&&((pn=u[s])==null||pn.setClosable(L)),t.$$.dirty[0]&67&&(W?(yt=u[s])==null||yt.maximize():(Ut=u[s])==null||Ut.unmaximize()),t.$$.dirty[0]&131&&((mn=u[s])==null||mn.setDecorations(A)),t.$$.dirty[0]&259&&((vt=u[s])==null||vt.setAlwaysOnTop(I)),t.$$.dirty[0]&515&&((gn=u[s])==null||gn.setAlwaysOnBottom(R)),t.$$.dirty[0]&1027&&((Ct=u[s])==null||Ct.setContentProtected(Y)),t.$$.dirty[0]&2051&&((Bt=u[s])==null||Bt.setFullscreen(q)),t.$$.dirty[0]&12291&&Q&&ie&&((_n=u[s])==null||_n.setSize(new ln(Q,ie))),t.$$.dirty[0]&49155&&(ee&&y?(Ne=u[s])==null||Ne.setMinSize(new Ll(ee,y)):(St=u[s])==null||St.setMinSize(null)),t.$$.dirty[0]&196611&&(B>800&&G>400?(bn=u[s])==null||bn.setMaxSize(new Ll(B,G)):(Mt=u[s])==null||Mt.setMaxSize(null)),t.$$.dirty[0]&786435&&oe!==null&&Z!==null&&((wn=u[s])==null||wn.setPosition(new it(oe,Z))),t.$$.dirty[0]&3&&((Lt=u[s])==null||Lt.scaleFactor().then(Zn=>n(29,we=Zn))),t.$$.dirty[0]&3&&x(u[s]),t.$$.dirty[0]&1048579&&((Vt=u[s])==null||Vt.setCursorGrab(le)),t.$$.dirty[0]&2097155&&((kn=u[s])==null||kn.setCursorVisible(te)),t.$$.dirty[0]&16777219&&((Pt=u[s])==null||Pt.setCursorIcon(H)),t.$$.dirty[0]&12582915&&T!==null&&J!==null&&((yn=u[s])==null||yn.setCursorPosition(new it(T,J))),t.$$.dirty[0]&33554435&&((At=u[s])==null||At.setIgnoreCursorEvents(re)),t.$$.dirty[0]&201326595&&((qt=u[s])==null||qt.setProgressBar({status:Ae,progress:de}))},[s,u,E,V,D,L,W,A,I,R,Y,q,Q,ie,ee,y,B,G,oe,Z,le,te,T,J,H,re,Ae,de,v,we,be,fe,ce,$,Le,ke,me,Oe,Pe,We,ge,_e,Se,Me,d,c,h,k,b,O,ae,Re,De,Ee,U,Ie,Dn,_,Fe,Fn,zt,Hn,He,Un,lt,Ot,Bn,Ue,Vn,Wt,qn,Be,Nn,st,Rt,jn,Ge,Gn,Dt,Kn,Ke,Xn,rt,Ft,Yn,Ve,Qn,Ht,Jn,qe,cn,dn,hn,Te,at,Xe]}class na extends $e{constructor(e){super(),Ze(this,e,ta,ea,je,{onMessage:57},null,[-1,-1,-1,-1])}}function ia(t){let e;return{c(){e=r("div"),e.innerHTML='
Not available for Linux
',a(e,"class","flex flex-col gap-2")},m(n,l){S(n,e,l)},p:ne,i:ne,o:ne,d(n){n&&C(e)}}}function la(t,e,n){let{onMessage:l}=e;const s=window.constraints={audio:!0,video:!0};function u(o){const c=document.querySelector("video"),h=o.getVideoTracks();l("Got stream with constraints:",s),l(`Using video device: ${h[0].label}`),window.stream=o,c.srcObject=o}function d(o){if(o.name==="ConstraintNotSatisfiedError"){const c=s.video;l(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else o.name==="PermissionDeniedError"&&l("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");l(`getUserMedia error: ${o.name}`,o)}return Vi(async()=>{try{const o=await navigator.mediaDevices.getUserMedia(s);u(o)}catch(o){d(o)}}),er(()=>{var o;(o=window.stream)==null||o.getTracks().forEach(function(c){c.stop()})}),t.$$set=o=>{"onMessage"in o&&n(0,l=o.onMessage)},[l]}class sa extends $e{constructor(e){super(),Ze(this,e,la,ia,je,{onMessage:0})}}function ra(t){let e,n,l,s,u,d;return{c(){e=r("div"),n=r("button"),n.textContent="Show",l=p(),s=r("button"),s.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(s,"class","btn"),a(s,"id","hide")},m(o,c){S(o,e,c),i(e,n),i(e,l),i(e,s),u||(d=[M(n,"click",t[0]),M(s,"click",t[1])],u=!0)},p:ne,i:ne,o:ne,d(o){o&&C(e),u=!1,Ce(d)}}}function aa(t,e,n){let{onMessage:l}=e;function s(){u().then(()=>{setTimeout(()=>{Vr().then(()=>l("Shown app")).catch(l)},2e3)}).catch(l)}function u(){return qr().then(()=>l("Hide app")).catch(l)}return t.$$set=d=>{"onMessage"in d&&n(2,l=d.onMessage)},[s,u,l]}class ua extends $e{constructor(e){super(),Ze(this,e,aa,ra,je,{onMessage:2})}}var Hi;class cr{get rid(){return Wn(this,Hi,"f")}constructor(e){Hi.set(this,void 0),qi(this,Hi,e,"f")}async close(){return m("plugin:resources|close",{rid:this.rid})}}Hi=new WeakMap;var Ui,Bi;async function un(t,e){const n=new rr;let l=null;return e&&typeof e=="object"&&("action"in e&&e.action&&(n.onmessage=e.action,delete e.action),"items"in e&&e.items&&(l=e.items.map(s=>[s.rid,s.kind]))),m("plugin:menu|new",{kind:t,options:e?{...e,items:l}:void 0,handler:n})}class on extends cr{get id(){return Wn(this,Ui,"f")}get kind(){return Wn(this,Bi,"f")}constructor(e,n,l){super(e),Ui.set(this,void 0),Bi.set(this,void 0),qi(this,Ui,n,"f"),qi(this,Bi,l,"f")}}Ui=new WeakMap,Bi=new WeakMap;function vl([t,e,n]){switch(n){case"Submenu":return new dr(t,e);case"Predefined":return new PredefinedMenuItem(t,e);case"Check":return new CheckMenuItem(t,e);case"Icon":return new IconMenuItem(t,e);case"MenuItem":default:return new MenuItem(t,e)}}let dr=class hr extends on{constructor(e,n){super(e,n,"Submenu")}static async new(e){return un("Submenu",e).then(([n,l])=>new hr(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async append(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>[n.rid,n.kind])})}async prepend(e){return m("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>[n.rid,n.kind])})}async insert(e,n){return m("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(l=>[l.rid,l.kind]),position:n})}async remove(e){return m("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return m("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(vl)}async items(){return m("plugin:menu|append",{rid:this.rid,kind:this.kind}).then(e=>e.map(vl))}async get(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,id:e}).then(n=>n?vl(n):null)}async popup(e,n){let l=null;return e&&(l={type:e instanceof it?"Physical":"Logical",data:e}),m("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(n==null?void 0:n.label)??null,at:l})}async setAsWindowsMenuForNSApp(){return m("plugin:menu|set_as_windows_menu_for_nsapp",{rid:this.rid})}async setAsHelpMenuForNSApp(){return m("plugin:menu|set_as_help_menu_for_nsapp",{rid:this.rid})}},oa=class fr extends on{constructor(e,n){super(e,n,"MenuItem")}static async new(e){return un("MenuItem",e).then(([n,l])=>new fr(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}};function Cl([t,e,n]){switch(n){case"Submenu":return new Submenu(t,e);case"Predefined":return new PredefinedMenuItem(t,e);case"Check":return new CheckMenuItem(t,e);case"Icon":return new IconMenuItem(t,e);case"MenuItem":default:return new MenuItem(t,e)}}class bt extends on{constructor(e,n){super(e,n,"Menu")}static async new(e){return un("Menu",e).then(([n,l])=>new bt(n,l))}static async default(){return m("plugin:menu|default").then(([e,n])=>new bt(e,n))}async append(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>[n.rid,n.kind])})}async prepend(e){return m("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>[n.rid,n.kind])})}async insert(e,n){return m("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(l=>[l.rid,l.kind]),position:n})}async remove(e){return m("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return m("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Cl)}async items(){return m("plugin:menu|append",{rid:this.rid,kind:this.kind}).then(e=>e.map(Cl))}async get(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,id:e}).then(n=>n?Cl(n):null)}async popup(e,n){let l=null;return e&&(l={type:e instanceof it?"Physical":"Logical",data:e}),m("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(n==null?void 0:n.label)??null,at:l})}async setAsAppMenu(){return m("plugin:menu|set_as_app_menu",{rid:this.rid}).then(e=>e?new bt(e[0],e[1]):null)}async setAsWindowMenu(e){return m("plugin:menu|set_as_window_menu",{rid:this.rid,window:(e==null?void 0:e.label)??null}).then(n=>n?new bt(n[0],n[1]):null)}}let pr=class mr extends on{constructor(e,n){super(e,n,"Check")}static async new(e){return un("Check",e).then(([n,l])=>new mr(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async isChecked(){return m("plugin:menu|is_checked",{rid:this.rid})}async setChecked(e){return m("plugin:menu|set_checked",{rid:this.rid,checked:e})}};var Fs;(function(t){t.Add="Add",t.Advanced="Advanced",t.Bluetooth="Bluetooth",t.Bookmarks="Bookmarks",t.Caution="Caution",t.ColorPanel="ColorPanel",t.ColumnView="ColumnView",t.Computer="Computer",t.EnterFullScreen="EnterFullScreen",t.Everyone="Everyone",t.ExitFullScreen="ExitFullScreen",t.FlowView="FlowView",t.Folder="Folder",t.FolderBurnable="FolderBurnable",t.FolderSmart="FolderSmart",t.FollowLinkFreestanding="FollowLinkFreestanding",t.FontPanel="FontPanel",t.GoLeft="GoLeft",t.GoRight="GoRight",t.Home="Home",t.IChatTheater="IChatTheater",t.IconView="IconView",t.Info="Info",t.InvalidDataFreestanding="InvalidDataFreestanding",t.LeftFacingTriangle="LeftFacingTriangle",t.ListView="ListView",t.LockLocked="LockLocked",t.LockUnlocked="LockUnlocked",t.MenuMixedState="MenuMixedState",t.MenuOnState="MenuOnState",t.MobileMe="MobileMe",t.MultipleDocuments="MultipleDocuments",t.Network="Network",t.Path="Path",t.PreferencesGeneral="PreferencesGeneral",t.QuickLook="QuickLook",t.RefreshFreestanding="RefreshFreestanding",t.Refresh="Refresh",t.Remove="Remove",t.RevealFreestanding="RevealFreestanding",t.RightFacingTriangle="RightFacingTriangle",t.Share="Share",t.Slideshow="Slideshow",t.SmartBadge="SmartBadge",t.StatusAvailable="StatusAvailable",t.StatusNone="StatusNone",t.StatusPartiallyAvailable="StatusPartiallyAvailable",t.StatusUnavailable="StatusUnavailable",t.StopProgressFreestanding="StopProgressFreestanding",t.StopProgress="StopProgress",t.TrashEmpty="TrashEmpty",t.TrashFull="TrashFull",t.User="User",t.UserAccounts="UserAccounts",t.UserGroup="UserGroup",t.UserGuest="UserGuest"})(Fs||(Fs={}));let ca=class gr extends on{constructor(e,n){super(e,n,"Icon")}static async new(e){return un("Icon",e).then(([n,l])=>new gr(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async setIcon(e){return m("plugin:menu|set_icon",{rid:this.rid,icon:e})}async setNativeIcon(e){return m("plugin:menu|set_native_icon",{rid:this.rid,icon:e})}},da=class _r extends on{constructor(e,n){super(e,n,"Predefined")}static async new(e){return un("Predefined",e).then(([n,l])=>new _r(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}};function Hs(t,e,n){const l=t.slice();return l[16]=e[n],l[17]=e,l[18]=n,l}function Us(t,e,n){const l=t.slice();return l[19]=e[n],l[20]=e,l[21]=n,l}function Bs(t){let e,n,l,s,u,d,o=t[19]+"",c,h,k,b,O;function _(){t[9].call(n,t[20],t[21])}return{c(){e=r("div"),n=r("input"),u=p(),d=r("label"),c=w(o),k=p(),a(n,"id",l=t[19]+"Input"),n.checked=s=t[0]===t[19],a(n,"type","radio"),a(n,"name","kind"),a(d,"for",h=t[19]+"Input"),a(e,"class","flex gap-1")},m(P,v){S(P,e,v),i(e,n),z(n,t[19]),i(e,u),i(e,d),i(d,c),i(e,k),b||(O=[M(n,"change",t[6]),M(n,"change",_)],b=!0)},p(P,v){t=P,v&16&&l!==(l=t[19]+"Input")&&a(n,"id",l),v&17&&s!==(s=t[0]===t[19])&&(n.checked=s),v&16&&z(n,t[19]),v&16&&o!==(o=t[19]+"")&&se(c,o),v&16&&h!==(h=t[19]+"Input")&&a(d,"for",h)},d(P){P&&C(e),b=!1,Ce(O)}}}function Vs(t){let e,n,l;return{c(){e=r("input"),a(e,"class","input"),a(e,"type","text"),a(e,"placeholder","Text")},m(s,u){S(s,e,u),z(e,t[1]),n||(l=M(e,"input",t[10]),n=!0)},p(s,u){u&2&&e.value!==s[1]&&z(e,s[1])},d(s){s&&C(e),n=!1,l()}}}function ha(t){let e,n=he(t[5]),l=[];for(let s=0;sl("itemClick",{id:I,text:A})},W=await oa.new(L);break;case"Icon":L={text:u,icon:d,action:I=>l("itemClick",{id:I,text:A})},W=await ca.new(L);break;case"Check":L={text:u,checked:c,action:I=>l("itemClick",{id:I,text:A})},W=await pr.new(L);break;case"Predefined":L={item:o},W=await da.new(L);break}l("new",{item:W,options:L}),n(1,u=""),o=""}function P(L,W){L[W]=this.value,n(4,h)}function v(){u=this.value,n(1,u)}function E(){d=this.value,n(2,d)}function V(){c=this.checked,n(3,c)}function D(L,W){L[W]=this.value,n(5,k)}return[s,u,d,c,h,k,b,O,_,P,v,E,V,D]}class _a extends $e{constructor(e){super(),Ze(this,e,ga,ma,je,{})}}function Ns(t,e,n){const l=t.slice();return l[5]=e[n],l}function js(t){let e,n,l,s,u,d=Gs(t[5])+"",o,c;return{c(){e=r("div"),n=r("div"),s=p(),u=r("p"),o=w(d),c=p(),a(n,"class",l=t[3](t[5])),a(e,"class","flex flex-row gap-1")},m(h,k){S(h,e,k),i(e,n),i(e,s),i(e,u),i(u,o),i(e,c)},p(h,k){k&1&&l!==(l=h[3](h[5]))&&a(n,"class",l),k&1&&d!==(d=Gs(h[5])+"")&&se(o,d)},d(h){h&&C(e)}}}function ba(t){let e,n,l,s,u;n=new _a({}),n.$on("new",t[1]),n.$on("itemClick",t[2]);let d=he(t[0]),o=[];for(let c=0;c{"items"in c&&n(0,l=c.items)},[l,u,d,o]}class br extends $e{constructor(e){super(),Ze(this,e,wa,ba,je,{items:0})}}function ka(t){let e,n,l,s,u,d,o,c,h,k;function b(_){t[5](_)}let O={};return t[0]!==void 0&&(O.items=t[0]),n=new br({props:O}),Tn.push(()=>lr(n,"items",b)),n.$on("itemClick",t[3]),{c(){e=r("div"),On(n.$$.fragment),s=p(),u=r("button"),u.textContent="Create menu",d=p(),o=r("button"),o.textContent="Popup",a(u,"class","btn"),a(o,"class","btn")},m(_,P){S(_,e,P),rn(n,e,null),i(e,s),i(e,u),i(e,d),i(e,o),c=!0,h||(k=[M(u,"click",t[1]),M(o,"click",t[2])],h=!0)},p(_,[P]){const v={};!l&&P&1&&(l=!0,v.items=_[0],nr(()=>l=!1)),n.$set(v)},i(_){c||(sn(n.$$.fragment,_),c=!0)},o(_){zn(n.$$.fragment,_),c=!1},d(_){_&&C(e),an(n),h=!1,Ce(k)}}}function ya(t,e,n){let{onMessage:l}=e,s=[],u=null,d=null,o=0;const c=navigator.userAgent.includes("Macintosh");async function h(){d=await dr.new({text:"app",items:s.map(_=>_.item)}),o=s.length,u=await bt.new({items:[d]}),await(c?u.setAsAppMenu():u.setAsWindowMenu())}async function k(){(!d||o!==s.length)&&await h(),(await bt.new({items:[d]})).popup()}function b(_){l(`Item ${_.detail.text} clicked`)}function O(_){s=_,n(0,s)}return t.$$set=_=>{"onMessage"in _&&n(4,l=_.onMessage)},[s,h,k,b,l,O]}class va extends $e{constructor(e){super(),Ze(this,e,ya,ka,je,{onMessage:4})}}class Il extends cr{constructor(e,n){super(e),this.id=n}static async new(e){e!=null&&e.menu&&(e.menu=[e.menu.rid,e.menu.kind]),e!=null&&e.icon&&(e.icon=typeof e.icon=="string"?e.icon:Array.from(e.icon));const n=new rr;return e!=null&&e.action&&(n.onmessage=e.action,delete e.action),m("plugin:tray|new",{options:e??{},handler:n}).then(([l,s])=>new Il(l,s))}async setIcon(e){let n=null;return e&&(n=typeof e=="string"?e:Array.from(e)),m("plugin:tray|set_icon",{rid:this.rid,icon:n})}async setMenu(e){return e&&(e=[e.rid,e.kind]),m("plugin:tray|set_menu",{rid:this.rid,menu:e})}async setTooltip(e){return m("plugin:tray|set_tooltip",{rid:this.rid,tooltip:e})}async setTitle(e){return m("plugin:tray|set_title",{rid:this.rid,title:e})}async setVisible(e){return m("plugin:tray|set_visible",{rid:this.rid,visible:e})}async setTempDirPath(e){return m("plugin:tray|set_temp_dir_path",{rid:this.rid,path:e})}async setIconAsTemplate(e){return m("plugin:tray|set_icon_as_template",{rid:this.rid,asTemplate:e})}async setMenuOnLeftClick(e){return m("plugin:tray|set_show_menu_on_left_click",{rid:this.rid,onLeft:e})}}function Ca(t){let e,n,l,s,u,d,o,c,h,k,b,O,_,P,v,E,V,D,L,W,A,I,R,Y,q,Q;function ie(y){t[14](y)}let ee={};return t[5]!==void 0&&(ee.items=t[5]),L=new br({props:ee}),Tn.push(()=>lr(L,"items",ie)),L.$on("itemClick",t[6]),{c(){e=r("div"),n=r("div"),l=r("input"),s=p(),u=r("input"),d=p(),o=r("label"),c=w(`Menu on left click - `),h=r("input"),k=p(),b=r("div"),O=r("input"),_=p(),P=r("label"),v=w(`Icon as template - `),E=r("input"),V=p(),D=r("div"),On(L.$$.fragment),A=p(),I=r("div"),R=r("button"),R.textContent="Create tray",a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","Title"),a(u,"class","input grow"),a(u,"type","text"),a(u,"placeholder","Tooltip"),a(h,"type","checkbox"),a(n,"class","flex gap-1"),a(O,"class","input grow"),a(O,"type","text"),a(O,"placeholder","Icon path"),a(E,"type","checkbox"),a(b,"class","flex gap-1"),a(D,"class","flex children:grow"),a(R,"class","btn"),a(R,"title","Creates the tray icon"),a(I,"class","flex"),a(e,"class","flex flex-col children:grow gap-2")},m(y,B){S(y,e,B),i(e,n),i(n,l),z(l,t[2]),i(n,s),i(n,u),z(u,t[1]),i(n,d),i(n,o),i(o,c),i(o,h),h.checked=t[4],i(e,k),i(e,b),i(b,O),z(O,t[0]),i(b,_),i(b,P),i(P,v),i(P,E),E.checked=t[3],i(e,V),i(e,D),rn(L,D,null),i(e,A),i(e,I),i(I,R),Y=!0,q||(Q=[M(l,"input",t[9]),M(u,"input",t[10]),M(h,"change",t[11]),M(O,"input",t[12]),M(E,"change",t[13]),M(R,"click",t[7])],q=!0)},p(y,[B]){B&4&&l.value!==y[2]&&z(l,y[2]),B&2&&u.value!==y[1]&&z(u,y[1]),B&16&&(h.checked=y[4]),B&1&&O.value!==y[0]&&z(O,y[0]),B&8&&(E.checked=y[3]);const G={};!W&&B&32&&(W=!0,G.items=y[5],nr(()=>W=!1)),L.$set(G)},i(y){Y||(sn(L.$$.fragment,y),Y=!0)},o(y){zn(L.$$.fragment,y),Y=!1},d(y){y&&C(e),an(L),q=!1,Ce(Q)}}}function Sa(t,e,n){let{onMessage:l}=e,s=null,u=null,d=null,o=!1,c=!0,h=[];function k(D){l(`Item ${D.detail.text} clicked`)}async function b(){Il.new({icon:s,tooltip:u,title:d,iconAsTemplate:o,menuOnLeftClick:c,menu:await bt.new({items:h.map(D=>D.item)}),action:D=>l(D)}).catch(l)}function O(){d=this.value,n(2,d)}function _(){u=this.value,n(1,u)}function P(){c=this.checked,n(4,c)}function v(){s=this.value,n(0,s)}function E(){o=this.checked,n(3,o)}function V(D){h=D,n(5,h)}return t.$$set=D=>{"onMessage"in D&&n(8,l=D.onMessage)},[s,u,d,o,c,h,k,b,l,O,_,P,v,E,V]}class Ma extends $e{constructor(e){super(),Ze(this,e,Sa,Ca,je,{onMessage:8})}}function Ks(t,e,n){const l=t.slice();return l[26]=e[n],l}function Xs(t,e,n){const l=t.slice();return l[29]=e[n],l}function La(t){let e;return{c(){e=r("span"),a(e,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,l){S(n,e,l)},d(n){n&&C(e)}}}function Pa(t){let e;return{c(){e=r("span"),a(e,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,l){S(n,e,l)},d(n){n&&C(e)}}}function Aa(t){let e,n;return{c(){e=w(`Switch to Dark mode - `),n=r("div"),a(n,"class","i-ph-moon")},m(l,s){S(l,e,s),S(l,n,s)},d(l){l&&(C(e),C(n))}}}function Ea(t){let e,n;return{c(){e=w(`Switch to Light mode - `),n=r("div"),a(n,"class","i-ph-sun")},m(l,s){S(l,e,s),S(l,n,s)},d(l){l&&(C(e),C(n))}}}function Ia(t){let e,n,l,s,u,d,o;function c(){return t[14](t[29])}return{c(){e=r("a"),n=r("div"),l=p(),s=r("p"),s.textContent=`${t[29].label}`,a(n,"class",t[29].icon+" mr-2"),a(e,"href","##"),a(e,"class",u="nv "+(t[1]===t[29]?"nv_selected":""))},m(h,k){S(h,e,k),i(e,n),i(e,l),i(e,s),d||(o=M(e,"click",c),d=!0)},p(h,k){t=h,k[0]&2&&u!==(u="nv "+(t[1]===t[29]?"nv_selected":""))&&a(e,"class",u)},d(h){h&&C(e),d=!1,o()}}}function Ys(t){let e,n=t[29]&&Ia(t);return{c(){n&&n.c(),e=Pl()},m(l,s){n&&n.m(l,s),S(l,e,s)},p(l,s){l[29]&&n.p(l,s)},d(l){l&&C(e),n&&n.d(l)}}}function Qs(t){let e,n=t[26].html+"",l;return{c(){e=new Ar(!1),l=Pl(),e.a=l},m(s,u){e.m(n,s,u),S(s,l,u)},p(s,u){u[0]&16&&n!==(n=s[26].html+"")&&e.p(n)},d(s){s&&(C(l),e.d())}}}function Ta(t){let e,n,l,s,u,d,o,c,h,k,b,O,_,P,v,E,V,D,L,W,A,I,R,Y,q,Q,ie,ee,y,B,G,oe,Z=t[1].label+"",we,be,fe,ce,$,pe,K,le,te,T,J,H,re,Le,ke,me,Oe,Pe;function We(F,x){return F[0]?Pa:La}let ge=We(t),_e=ge(t);function Se(F,x){return F[2]?Ea:Aa}let Ae=Se(t),de=Ae(t),Me=he(t[5]),ae=[];for(let F=0;F{n(2,u=o)}),Fr().then(o=>{n(0,l=o)}),Ur().then(o=>{n(1,s=o)});function d(){m("popup_context_menu")}return[l,s,u,d]}class jr extends xe{constructor(e){super(),Ze(this,e,Nr,qr,je,{})}}var Oe;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_FILE_DROP="tauri://file-drop",t.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",t.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled"})(Oe||(Oe={}));async function hr(t,e){await m("plugin:event|unlisten",{event:t,eventId:e})}async function Rl(t,e,n){return m("plugin:event|listen",{event:t,windowLabel:n==null?void 0:n.target,handler:dr(e)}).then(l=>async()=>hr(t,l))}async function Gr(t,e,n){return Rl(t,l=>{e(l),hr(t,l.id).catch(()=>{})},n)}async function fr(t,e,n){await m("plugin:event|emit",{event:t,windowLabel:n==null?void 0:n.target,payload:e})}function Kr(t){let e,n,l,s,u,d,o,c;return{c(){e=r("div"),n=r("button"),n.textContent="Call Log API",l=p(),s=r("button"),s.textContent="Call Request (async) API",u=p(),d=r("button"),d.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(s,"class","btn"),a(s,"id","request"),a(d,"class","btn"),a(d,"id","event")},m(h,w){L(h,e,w),i(e,n),i(e,l),i(e,s),i(e,u),i(e,d),o||(c=[A(n,"click",t[0]),A(s,"click",t[1]),A(d,"click",t[2])],o=!0)},p:ne,i:ne,o:ne,d(h){h&&S(e),o=!1,Ce(c)}}}function Xr(t,e,n){let{onMessage:l}=e,s;Ki(async()=>{s=await Rl("rust-event",l)}),rr(()=>{s&&s()});function u(){m("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function d(){m("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(l).catch(l)}function o(){fr("js-event","this is the payload string")}return t.$$set=c=>{"onMessage"in c&&n(3,l=c.onMessage)},[u,d,o,l]}class Yr extends xe{constructor(e){super(),Ze(this,e,Xr,Kr,je,{onMessage:3})}}class zl{constructor(e,n){this.type="Logical",this.width=e,this.height=n}}class ln{constructor(e,n){this.type="Physical",this.width=e,this.height=n}toLogical(e){return new zl(this.width/e,this.height/e)}}class Qr{constructor(e,n){this.type="Logical",this.x=e,this.y=n}}class it{constructor(e,n){this.type="Physical",this.x=e,this.y=n}toLogical(e){return new Qr(this.x/e,this.y/e)}}var Yi;(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(Yi||(Yi={}));class Jr{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}var Qi;(function(t){t.None="none",t.Normal="normal",t.Indeterminate="indeterminate",t.Paused="paused",t.Error="error"})(Qi||(Qi={}));function pr(){return new Dn(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function Ll(){return window.__TAURI_INTERNALS__.metadata.windows.map(t=>new Dn(t.label,{skip:!0}))}const Ts=["tauri://created","tauri://error"];class Dn{constructor(e,n={}){this.label=e,this.listeners=Object.create(null),n!=null&&n.skip||m("plugin:window|create",{options:{...n,label:e}}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static getByLabel(e){return Ll().some(n=>n.label===e)?new Dn(e,{skip:!0}):null}static getCurrent(){return pr()}static getAll(){return Ll()}static async getFocusedWindow(){for(const e of Ll())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}):Rl(e,n,{target:this.label})}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}):Gr(e,n,{target:this.label})}async emit(e,n){if(Ts.includes(e)){for(const l of this.listeners[e]||[])l({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return fr(e,n,{target:this.label})}_handleTauriEvent(e,n){return Ts.includes(e)?(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0):!1}async scaleFactor(){return m("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return m("plugin:window|inner_position",{label:this.label}).then(({x:e,y:n})=>new it(e,n))}async outerPosition(){return m("plugin:window|outer_position",{label:this.label}).then(({x:e,y:n})=>new it(e,n))}async innerSize(){return m("plugin:window|inner_size",{label:this.label}).then(({width:e,height:n})=>new ln(e,n))}async outerSize(){return m("plugin:window|outer_size",{label:this.label}).then(({width:e,height:n})=>new ln(e,n))}async isFullscreen(){return m("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return m("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return m("plugin:window|is_maximized",{label:this.label})}async isFocused(){return m("plugin:window|is_focused",{label:this.label})}async isDecorated(){return m("plugin:window|is_decorated",{label:this.label})}async isResizable(){return m("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return m("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return m("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return m("plugin:window|is_closable",{label:this.label})}async isVisible(){return m("plugin:window|is_visible",{label:this.label})}async title(){return m("plugin:window|title",{label:this.label})}async theme(){return m("plugin:window|theme",{label:this.label})}async center(){return m("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(e===Yi.Critical?n={type:"Critical"}:n={type:"Informational"}),m("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return m("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return m("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return m("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return m("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return m("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return m("plugin:window|maximize",{label:this.label})}async unmaximize(){return m("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return m("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return m("plugin:window|minimize",{label:this.label})}async unminimize(){return m("plugin:window|unminimize",{label:this.label})}async show(){return m("plugin:window|show",{label:this.label})}async hide(){return m("plugin:window|hide",{label:this.label})}async close(){return m("plugin:window|close",{label:this.label})}async setDecorations(e){return m("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return m("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return m("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return m("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return m("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return m("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return m("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return m("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return m("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return m("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return m("plugin:window|set_focus",{label:this.label})}async setIcon(e){return m("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return m("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return m("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return m("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return m("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return m("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return m("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return m("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return m("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen(Oe.WINDOW_RESIZED,n=>{n.payload=Zr(n.payload),e(n)})}async onMoved(e){return this.listen(Oe.WINDOW_MOVED,n=>{n.payload=Al(n.payload),e(n)})}async onCloseRequested(e){return this.listen(Oe.WINDOW_CLOSE_REQUESTED,n=>{const l=new Jr(n);Promise.resolve(e(l)).then(()=>{if(!l.isPreventDefault())return this.close()})})}async onFocusChanged(e){const n=await this.listen(Oe.WINDOW_FOCUS,s=>{e({...s,payload:!0})}),l=await this.listen(Oe.WINDOW_BLUR,s=>{e({...s,payload:!1})});return()=>{n(),l()}}async onScaleChanged(e){return this.listen(Oe.WINDOW_SCALE_FACTOR_CHANGED,e)}async onFileDropEvent(e){const n=await this.listen(Oe.WINDOW_FILE_DROP,u=>{e({...u,payload:{type:"drop",paths:u.payload.paths,position:Al(u.payload.position)}})}),l=await this.listen(Oe.WINDOW_FILE_DROP_HOVER,u=>{e({...u,payload:{type:"hover",paths:u.payload.paths,position:Al(u.payload.position)}})}),s=await this.listen(Oe.WINDOW_FILE_DROP_CANCELLED,u=>{e({...u,payload:{type:"cancel"}})});return()=>{n(),l(),s()}}async onThemeChanged(e){return this.listen(Oe.WINDOW_THEME_CHANGED,e)}}var Ji;(function(t){t.AppearanceBased="appearanceBased",t.Light="light",t.Dark="dark",t.MediumLight="mediumLight",t.UltraDark="ultraDark",t.Titlebar="titlebar",t.Selection="selection",t.Menu="menu",t.Popover="popover",t.Sidebar="sidebar",t.HeaderView="headerView",t.Sheet="sheet",t.WindowBackground="windowBackground",t.HudWindow="hudWindow",t.FullScreenUI="fullScreenUI",t.Tooltip="tooltip",t.ContentBackground="contentBackground",t.UnderWindowBackground="underWindowBackground",t.UnderPageBackground="underPageBackground",t.Mica="mica",t.Blur="blur",t.Acrylic="acrylic",t.Tabbed="tabbed",t.TabbedDark="tabbedDark",t.TabbedLight="tabbedLight"})(Ji||(Ji={}));var Zi;(function(t){t.FollowsWindowActiveState="followsWindowActiveState",t.Active="active",t.Inactive="inactive"})(Zi||(Zi={}));function Al(t){return new it(t.x,t.y)}function Zr(t){return new ln(t.width,t.height)}function zs(t,e,n){const l=t.slice();return l[105]=e[n],l}function Os(t,e,n){const l=t.slice();return l[108]=e[n],l}function Ws(t,e,n){const l=t.slice();return l[111]=e[n],l}function Is(t,e,n){const l=t.slice();return l[114]=e[n],l}function Rs(t,e,n){const l=t.slice();return l[117]=e[n],l}function Ds(t){let e,n,l,s,u,d,o=he(Object.keys(t[1])),c=[];for(let h=0;ht[59].call(l))},m(h,w){L(h,e,w),L(h,n,w),L(h,l,w),i(l,s);for(let _=0;_t[83].call(tt)),a(pt,"class","input"),a(pt,"type","number"),a(mt,"class","input"),a(mt,"type","number"),a(et,"class","flex gap-2"),a(gt,"class","input grow"),a(gt,"id","title"),a(Ln,"class","btn"),a(Ln,"type","submit"),a(Et,"class","flex gap-1"),a(Sn,"class","flex flex-col gap-1"),a(nt,"class","input"),t[26]===void 0&&wt(()=>t[87].call(nt)),a(Ye,"class","input"),a(Ye,"type","number"),a(Ye,"min","0"),a(Ye,"max","100"),a(Qt,"class","flex gap-2"),a(An,"class","flex flex-col gap-1")},m(f,g){L(f,e,g),L(f,n,g),L(f,l,g),i(l,s),i(l,u),i(l,d),i(d,o),O(o,t[43]),i(d,c),i(d,h),L(f,w,g),L(f,_,g),L(f,W,g),L(f,k,g),i(k,y),i(k,C),i(k,E),i(k,V),i(k,D),i(k,M),i(k,I),L(f,P,g),L(f,T,g),i(T,R),i(R,Y),i(R,q),q.checked=t[6],i(T,Q),i(T,ie),i(ie,ee),i(ie,v),v.checked=t[2],i(T,B),i(T,G),i(G,oe),i(G,Z),Z.checked=t[3],i(T,we),i(T,be),i(be,fe),i(be,ce),ce.checked=t[4],i(T,x),i(T,pe),i(pe,K),i(pe,le),le.checked=t[5],i(T,te),i(T,z),i(z,J),i(z,H),H.checked=t[7],i(T,re),i(T,Ae),i(Ae,ke),i(Ae,me),me.checked=t[8],i(T,We),i(T,Me),i(Me,Ie),i(Me,ge),ge.checked=t[9],i(T,_e),i(T,Se),i(Se,Pe),i(Se,de),de.checked=t[10],i(T,Le),i(T,ae),i(ae,Re),i(ae,De),De.checked=t[11],L(f,Ee,g),L(f,ue,g),L(f,F,g),L(f,$,g),i($,U),i(U,Te),i(Te,Vn),i(Te,Fe),O(Fe,t[18]),i(U,qn),i(U,Ot),i(Ot,Nn),i(Ot,He),O(He,t[19]),i($,jn),i($,lt),i(lt,Wt),i(Wt,Gn),i(Wt,Ue),O(Ue,t[12]),i(lt,Kn),i(lt,It),i(It,Xn),i(It,Be),O(Be,t[13]),i($,Yn),i($,st),i(st,Rt),i(Rt,Qn),i(Rt,Ge),O(Ge,t[14]),i(st,Jn),i(st,Dt),i(Dt,Zn),i(Dt,Ke),O(Ke,t[15]),i($,xn),i($,rt),i(rt,Ft),i(Ft,$n),i(Ft,Ve),O(Ve,t[16]),i(rt,ei),i(rt,Ht),i(Ht,ti),i(Ht,qe),O(qe,t[17]),L(f,dn,g),L(f,hn,g),L(f,fn,g),L(f,ze,g),i(ze,at),i(at,Xe),i(Xe,N),i(Xe,pn),i(Xe,kt),i(kt,mn),i(kt,Ut),i(Xe,gn),i(Xe,vt),i(vt,_n),i(vt,Bt),i(at,bn),i(at,Ne),i(Ne,St),i(Ne,wn),i(Ne,Lt),i(Lt,kn),i(Lt,Vt),i(Ne,yn),i(Ne,Mt),i(Mt,vn),i(Mt,qt),i(ze,ni),i(ze,Nt),i(Nt,ut),i(ut,ii),i(ut,Fl),i(ut,li),i(li,Hl),i(li,xi),i(ut,Ul),i(ut,ri),i(ri,Bl),i(ri,$i),i(Nt,Vl),i(Nt,ot),i(ot,ui),i(ot,ql),i(ot,oi),i(oi,Nl),i(oi,el),i(ot,jl),i(ot,di),i(di,Gl),i(di,tl),i(ze,Kl),i(ze,jt),i(jt,ct),i(ct,fi),i(ct,Xl),i(ct,pi),i(pi,Yl),i(pi,nl),i(ct,Ql),i(ct,gi),i(gi,Jl),i(gi,il),i(jt,Zl),i(jt,dt),i(dt,bi),i(dt,xl),i(dt,wi),i(wi,$l),i(wi,ll),i(dt,es),i(dt,yi),i(yi,ts),i(yi,sl),i(ze,ns),i(ze,Gt),i(Gt,ht),i(ht,Ci),i(ht,is),i(ht,Si),i(Si,ls),i(Si,rl),i(ht,ss),i(ht,Ai),i(Ai,rs),i(Ai,al),i(Gt,as),i(Gt,ft),i(ft,Pi),i(ft,us),i(ft,Ei),i(Ei,os),i(Ei,ul),i(ft,cs),i(ft,zi),i(zi,ds),i(zi,ol),L(f,cl,g),L(f,dl,g),L(f,hl,g),L(f,Cn,g),L(f,fl,g),L(f,$e,g),i($e,Wi),i(Wi,Kt),Kt.checked=t[20],i(Wi,hs),i($e,fs),i($e,Ii),i(Ii,Xt),Xt.checked=t[21],i(Ii,ps),i($e,ms),i($e,Ri),i(Ri,Yt),Yt.checked=t[25],i(Ri,gs),L(f,pl,g),L(f,et,g),i(et,Di),i(Di,_s),i(Di,tt);for(let j=0;jt[89].call(u)),a(h,"class","input"),t[37]===void 0&&wt(()=>t[90].call(h)),a(k,"class","input"),a(k,"type","number"),a(n,"class","flex"),xt(M,"max-width","120px"),a(M,"class","input"),a(M,"type","number"),a(M,"placeholder","R"),xt(P,"max-width","120px"),a(P,"class","input"),a(P,"type","number"),a(P,"placeholder","G"),xt(R,"max-width","120px"),a(R,"class","input"),a(R,"type","number"),a(R,"placeholder","B"),xt(q,"max-width","120px"),a(q,"class","input"),a(q,"type","number"),a(q,"placeholder","A"),a(D,"class","flex"),a(C,"class","flex"),a(ee,"class","btn"),xt(ee,"width","80px"),a(ie,"class","flex"),a(fe,"class","btn"),xt(fe,"width","80px"),a(B,"class","flex"),a(e,"class","flex flex-col gap-1")},m(z,J){L(z,e,J),i(e,n),i(n,l),i(l,s),i(l,u);for(let H=0;H=1,w,_,W,k=h&&Ds(t),y=t[1][t[0]]&&Hs(t);return{c(){e=r("div"),n=r("div"),l=r("input"),s=p(),u=r("button"),u.textContent="New window",d=p(),o=r("br"),c=p(),k&&k.c(),w=p(),y&&y.c(),a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","New Window label.."),a(u,"class","btn"),a(n,"class","flex gap-1"),a(e,"class","flex flex-col children:grow gap-2")},m(C,E){L(C,e,E),i(e,n),i(n,l),O(l,t[28]),i(n,s),i(n,u),i(e,d),i(e,o),i(e,c),k&&k.m(e,null),i(e,w),y&&y.m(e,null),_||(W=[A(l,"input",t[58]),A(u,"click",t[53])],_=!0)},p(C,E){E[0]&268435456&&l.value!==C[28]&&O(l,C[28]),E[0]&2&&(h=Object.keys(C[1]).length>=1),h?k?k.p(C,E):(k=Ds(C),k.c(),k.m(e,w)):k&&(k.d(1),k=null),C[1][C[0]]?y?y.p(C,E):(y=Hs(C),y.c(),y.m(e,null)):y&&(y.d(1),y=null)},i:ne,o:ne,d(C){C&&S(e),k&&k.d(),y&&y.d(),_=!1,Ce(W)}}}function ea(t,e,n){const l=pr();let s=l.label;const u={[l.label]:l},d=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"],o=["mica","blur","acrylic","tabbed","tabbedDark","tabbedLight"],c=navigator.appVersion.includes("Windows"),h=navigator.appVersion.includes("Macintosh");let w=c?o:Object.keys(Ji).map(N=>Ji[N]).filter(N=>!o.includes(N));const _=Object.keys(Zi).map(N=>Zi[N]),W=Object.keys(Qi).map(N=>Qi[N]);let{onMessage:k}=e;const y=document.querySelector("main");let C,E=!0,V=!0,D=!0,M=!0,I=!1,P=!0,T=!1,R=!1,Y=!0,q=!1,Q=null,ie=null,ee=null,v=null,B=null,G=null,oe=null,Z=null,we=1,be=new it(oe,Z),fe=new it(oe,Z),ce=new ln(Q,ie),x=new ln(Q,ie),pe,K,le=!1,te=!0,z=null,J=null,H="default",re=!1,Ae="Awesome Tauri Example!",ke=[],me,We,Me,Ie,ge,_e,Se,Pe="none",de=0,Le;function ae(){u[s].setTitle(Ae)}function Re(){u[s].hide(),setTimeout(u[s].show,2e3)}function De(){u[s].minimize(),setTimeout(u[s].unminimize,2e3)}function Ee(){if(!C)return;const N=new Dn(C);n(1,u[C]=N,u),N.once("tauri://error",function(){k("Error creating new webview")})}function ue(){u[s].innerSize().then(N=>{n(32,ce=N),n(12,Q=ce.width),n(13,ie=ce.height)}),u[s].outerSize().then(N=>{n(33,x=N)})}function F(){u[s].innerPosition().then(N=>{n(30,be=N)}),u[s].outerPosition().then(N=>{n(31,fe=N),n(18,oe=fe.x),n(19,Z=fe.y)})}async function $(N){N&&(pe&&pe(),K&&K(),K=await N.listen("tauri://move",F),pe=await N.listen("tauri://resize",ue))}async function U(){await u[s].minimize(),await u[s].requestUserAttention(Yi.Critical),await new Promise(N=>setTimeout(N,3e3)),await u[s].requestUserAttention(null)}async function Te(){ke.includes(me)||n(35,ke=[...ke,me]);const N={effects:ke,state:We,radius:Me};Number.isInteger(Ie)&&Number.isInteger(ge)&&Number.isInteger(_e)&&Number.isInteger(Se)&&(N.color=[Ie,ge,_e,Se]),y.classList.remove("bg-primary"),y.classList.remove("dark:bg-darkPrimary"),await u[s].clearEffects(),await u[s].setEffects(N)}async function Vn(){n(35,ke=[]),await u[s].clearEffects(),y.classList.add("bg-primary"),y.classList.add("dark:bg-darkPrimary")}function Fe(){C=this.value,n(28,C)}function qn(){s=Pn(this),n(0,s),n(1,u)}function Ot(){Le=this.value,n(43,Le)}const Nn=()=>u[s].center();function He(){I=this.checked,n(6,I)}function jn(){E=this.checked,n(2,E)}function lt(){V=this.checked,n(3,V)}function Wt(){D=this.checked,n(4,D)}function Gn(){M=this.checked,n(5,M)}function Ue(){P=this.checked,n(7,P)}function Kn(){T=this.checked,n(8,T)}function It(){R=this.checked,n(9,R)}function Xn(){Y=this.checked,n(10,Y)}function Be(){q=this.checked,n(11,q)}function Yn(){oe=X(this.value),n(18,oe)}function st(){Z=X(this.value),n(19,Z)}function Rt(){Q=X(this.value),n(12,Q)}function Qn(){ie=X(this.value),n(13,ie)}function Ge(){ee=X(this.value),n(14,ee)}function Jn(){v=X(this.value),n(15,v)}function Dt(){B=X(this.value),n(16,B)}function Zn(){G=X(this.value),n(17,G)}function Ke(){le=this.checked,n(20,le)}function xn(){te=this.checked,n(21,te)}function rt(){re=this.checked,n(25,re)}function Ft(){H=Pn(this),n(24,H),n(44,d)}function $n(){z=X(this.value),n(22,z)}function Ve(){J=X(this.value),n(23,J)}function ei(){Ae=this.value,n(34,Ae)}function Ht(){Pe=Pn(this),n(26,Pe),n(49,W)}function ti(){de=X(this.value),n(27,de)}function qe(){me=Pn(this),n(36,me),n(47,w)}function dn(){We=Pn(this),n(37,We),n(48,_)}function hn(){Me=X(this.value),n(38,Me)}function fn(){Ie=X(this.value),n(39,Ie)}function ze(){ge=X(this.value),n(40,ge)}function at(){_e=X(this.value),n(41,_e)}function Xe(){Se=X(this.value),n(42,Se)}return t.$$set=N=>{"onMessage"in N&&n(57,k=N.onMessage)},t.$$.update=()=>{var N,pn,kt,mn,yt,Ut,gn,vt,_n,Ct,Bt,bn,Ne,St,wn,Lt,kn,At,Vt,yn,Mt,vn,Pt,qt;t.$$.dirty[0]&3&&(u[s],F(),ue()),t.$$.dirty[0]&7&&((N=u[s])==null||N.setResizable(E)),t.$$.dirty[0]&11&&((pn=u[s])==null||pn.setMaximizable(V)),t.$$.dirty[0]&19&&((kt=u[s])==null||kt.setMinimizable(D)),t.$$.dirty[0]&35&&((mn=u[s])==null||mn.setClosable(M)),t.$$.dirty[0]&67&&(I?(yt=u[s])==null||yt.maximize():(Ut=u[s])==null||Ut.unmaximize()),t.$$.dirty[0]&131&&((gn=u[s])==null||gn.setDecorations(P)),t.$$.dirty[0]&259&&((vt=u[s])==null||vt.setAlwaysOnTop(T)),t.$$.dirty[0]&515&&((_n=u[s])==null||_n.setAlwaysOnBottom(R)),t.$$.dirty[0]&1027&&((Ct=u[s])==null||Ct.setContentProtected(Y)),t.$$.dirty[0]&2051&&((Bt=u[s])==null||Bt.setFullscreen(q)),t.$$.dirty[0]&12291&&Q&&ie&&((bn=u[s])==null||bn.setSize(new ln(Q,ie))),t.$$.dirty[0]&49155&&(ee&&v?(Ne=u[s])==null||Ne.setMinSize(new zl(ee,v)):(St=u[s])==null||St.setMinSize(null)),t.$$.dirty[0]&196611&&(B>800&&G>400?(wn=u[s])==null||wn.setMaxSize(new zl(B,G)):(Lt=u[s])==null||Lt.setMaxSize(null)),t.$$.dirty[0]&786435&&oe!==null&&Z!==null&&((kn=u[s])==null||kn.setPosition(new it(oe,Z))),t.$$.dirty[0]&3&&((At=u[s])==null||At.scaleFactor().then(ni=>n(29,we=ni))),t.$$.dirty[0]&3&&$(u[s]),t.$$.dirty[0]&1048579&&((Vt=u[s])==null||Vt.setCursorGrab(le)),t.$$.dirty[0]&2097155&&((yn=u[s])==null||yn.setCursorVisible(te)),t.$$.dirty[0]&16777219&&((Mt=u[s])==null||Mt.setCursorIcon(H)),t.$$.dirty[0]&12582915&&z!==null&&J!==null&&((vn=u[s])==null||vn.setCursorPosition(new it(z,J))),t.$$.dirty[0]&33554435&&((Pt=u[s])==null||Pt.setIgnoreCursorEvents(re)),t.$$.dirty[0]&201326595&&((qt=u[s])==null||qt.setProgressBar({status:Pe,progress:de}))},[s,u,E,V,D,M,I,P,T,R,Y,q,Q,ie,ee,v,B,G,oe,Z,le,te,z,J,H,re,Pe,de,C,we,be,fe,ce,x,Ae,ke,me,We,Me,Ie,ge,_e,Se,Le,d,c,h,w,_,W,ae,Re,De,Ee,U,Te,Vn,k,Fe,qn,Ot,Nn,He,jn,lt,Wt,Gn,Ue,Kn,It,Xn,Be,Yn,st,Rt,Qn,Ge,Jn,Dt,Zn,Ke,xn,rt,Ft,$n,Ve,ei,Ht,ti,qe,dn,hn,fn,ze,at,Xe]}class ta extends xe{constructor(e){super(),Ze(this,e,ea,$r,je,{onMessage:57},null,[-1,-1,-1,-1])}}function na(t){let e;return{c(){e=r("div"),e.innerHTML='
Not available for Linux
',a(e,"class","flex flex-col gap-2")},m(n,l){L(n,e,l)},p:ne,i:ne,o:ne,d(n){n&&S(e)}}}function ia(t,e,n){let{onMessage:l}=e;const s=window.constraints={audio:!0,video:!0};function u(o){const c=document.querySelector("video"),h=o.getVideoTracks();l("Got stream with constraints:",s),l(`Using video device: ${h[0].label}`),window.stream=o,c.srcObject=o}function d(o){if(o.name==="ConstraintNotSatisfiedError"){const c=s.video;l(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else o.name==="PermissionDeniedError"&&l("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");l(`getUserMedia error: ${o.name}`,o)}return Ki(async()=>{try{const o=await navigator.mediaDevices.getUserMedia(s);u(o)}catch(o){d(o)}}),rr(()=>{var o;(o=window.stream)==null||o.getTracks().forEach(function(c){c.stop()})}),t.$$set=o=>{"onMessage"in o&&n(0,l=o.onMessage)},[l]}class la extends xe{constructor(e){super(),Ze(this,e,ia,na,je,{onMessage:0})}}function sa(t){let e,n,l,s,u,d;return{c(){e=r("div"),n=r("button"),n.textContent="Show",l=p(),s=r("button"),s.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(s,"class","btn"),a(s,"id","hide")},m(o,c){L(o,e,c),i(e,n),i(e,l),i(e,s),u||(d=[A(n,"click",t[0]),A(s,"click",t[1])],u=!0)},p:ne,i:ne,o:ne,d(o){o&&S(e),u=!1,Ce(d)}}}function ra(t,e,n){let{onMessage:l}=e;function s(){u().then(()=>{setTimeout(()=>{Br().then(()=>l("Shown app")).catch(l)},2e3)}).catch(l)}function u(){return Vr().then(()=>l("Hide app")).catch(l)}return t.$$set=d=>{"onMessage"in d&&n(2,l=d.onMessage)},[s,u,l]}class aa extends xe{constructor(e){super(),Ze(this,e,ra,sa,je,{onMessage:2})}}var Ni;class mr{get rid(){return Rn(this,Ni,"f")}constructor(e){Ni.set(this,void 0),Xi(this,Ni,e,"f")}async close(){return m("plugin:resources|close",{rid:this.rid})}}Ni=new WeakMap;var ji,Gi;function gr(t){var e;if("items"in t)t.items=(e=t.items)==null?void 0:e.map(n=>"rid"in n?n:gr(n));else if("action"in t&&t.action){const n=new Il;return n.onmessage=t.action,delete t.action,{...t,handler:n}}return t}async function un(t,e){const n=new Il;let l=null;return e&&typeof e=="object"&&("action"in e&&e.action&&(n.onmessage=e.action,delete e.action),"items"in e&&e.items&&(l=e.items.map(s=>"rid"in s?[s.rid,s.kind]:gr(s)))),m("plugin:menu|new",{kind:t,options:e?{...e,items:l}:void 0,handler:n})}class on extends mr{get id(){return Rn(this,ji,"f")}get kind(){return Rn(this,Gi,"f")}constructor(e,n,l){super(e),ji.set(this,void 0),Gi.set(this,void 0),Xi(this,ji,n,"f"),Xi(this,Gi,l,"f")}}ji=new WeakMap,Gi=new WeakMap;class Fn extends on{constructor(e,n){super(e,n,"MenuItem")}static async new(e){return un("MenuItem",e).then(([n,l])=>new Fn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}}class cn extends on{constructor(e,n){super(e,n,"Check")}static async new(e){return un("Check",e).then(([n,l])=>new cn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async isChecked(){return m("plugin:menu|is_checked",{rid:this.rid})}async setChecked(e){return m("plugin:menu|set_checked",{rid:this.rid,checked:e})}}var Ns;(function(t){t.Add="Add",t.Advanced="Advanced",t.Bluetooth="Bluetooth",t.Bookmarks="Bookmarks",t.Caution="Caution",t.ColorPanel="ColorPanel",t.ColumnView="ColumnView",t.Computer="Computer",t.EnterFullScreen="EnterFullScreen",t.Everyone="Everyone",t.ExitFullScreen="ExitFullScreen",t.FlowView="FlowView",t.Folder="Folder",t.FolderBurnable="FolderBurnable",t.FolderSmart="FolderSmart",t.FollowLinkFreestanding="FollowLinkFreestanding",t.FontPanel="FontPanel",t.GoLeft="GoLeft",t.GoRight="GoRight",t.Home="Home",t.IChatTheater="IChatTheater",t.IconView="IconView",t.Info="Info",t.InvalidDataFreestanding="InvalidDataFreestanding",t.LeftFacingTriangle="LeftFacingTriangle",t.ListView="ListView",t.LockLocked="LockLocked",t.LockUnlocked="LockUnlocked",t.MenuMixedState="MenuMixedState",t.MenuOnState="MenuOnState",t.MobileMe="MobileMe",t.MultipleDocuments="MultipleDocuments",t.Network="Network",t.Path="Path",t.PreferencesGeneral="PreferencesGeneral",t.QuickLook="QuickLook",t.RefreshFreestanding="RefreshFreestanding",t.Refresh="Refresh",t.Remove="Remove",t.RevealFreestanding="RevealFreestanding",t.RightFacingTriangle="RightFacingTriangle",t.Share="Share",t.Slideshow="Slideshow",t.SmartBadge="SmartBadge",t.StatusAvailable="StatusAvailable",t.StatusNone="StatusNone",t.StatusPartiallyAvailable="StatusPartiallyAvailable",t.StatusUnavailable="StatusUnavailable",t.StopProgressFreestanding="StopProgressFreestanding",t.StopProgress="StopProgress",t.TrashEmpty="TrashEmpty",t.TrashFull="TrashFull",t.User="User",t.UserAccounts="UserAccounts",t.UserGroup="UserGroup",t.UserGuest="UserGuest"})(Ns||(Ns={}));class Hn extends on{constructor(e,n){super(e,n,"Icon")}static async new(e){return un("Icon",e).then(([n,l])=>new Hn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async setAccelerator(e){return m("plugin:menu|set_accelerator",{rid:this.rid,kind:this.kind,accelerator:e})}async setIcon(e){return m("plugin:menu|set_icon",{rid:this.rid,icon:e})}}class Un extends on{constructor(e,n){super(e,n,"Predefined")}static async new(e){return un("Predefined",e).then(([n,l])=>new Un(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}}function Ml([t,e,n]){switch(n){case"Submenu":return new Bn(t,e);case"Predefined":return new Un(t,e);case"Check":return new cn(t,e);case"Icon":return new Hn(t,e);case"MenuItem":default:return new Fn(t,e)}}class Bn extends on{constructor(e,n){super(e,n,"Submenu")}static async new(e){return un("Submenu",e).then(([n,l])=>new Bn(n,l))}async text(){return m("plugin:menu|text",{rid:this.rid,kind:this.kind})}async setText(e){return m("plugin:menu|set_text",{rid:this.rid,kind:this.kind,text:e})}async isEnabled(){return m("plugin:menu|is_enabled",{rid:this.rid,kind:this.kind})}async setEnabled(e){return m("plugin:menu|set_enabled",{rid:this.rid,kind:this.kind,enabled:e})}async append(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async prepend(e){return m("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async insert(e,n){return m("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(l=>"rid"in l?[l.rid,l.kind]:l),position:n})}async remove(e){return m("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return m("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Ml)}async items(){return m("plugin:menu|items",{rid:this.rid,kind:this.kind}).then(e=>e.map(Ml))}async get(e){return m("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then(n=>n?Ml(n):null)}async popup(e,n){let l=null;return e&&(l={type:e instanceof it?"Physical":"Logical",data:e}),m("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(n==null?void 0:n.label)??null,at:l})}async setAsWindowsMenuForNSApp(){return m("plugin:menu|set_as_windows_menu_for_nsapp",{rid:this.rid})}async setAsHelpMenuForNSApp(){return m("plugin:menu|set_as_help_menu_for_nsapp",{rid:this.rid})}}function Pl([t,e,n]){switch(n){case"Submenu":return new Bn(t,e);case"Predefined":return new Un(t,e);case"Check":return new cn(t,e);case"Icon":return new Hn(t,e);case"MenuItem":default:return new Fn(t,e)}}class bt extends on{constructor(e,n){super(e,n,"Menu")}static async new(e){return un("Menu",e).then(([n,l])=>new bt(n,l))}static async default(){return m("plugin:menu|default").then(([e,n])=>new bt(e,n))}async append(e){return m("plugin:menu|append",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async prepend(e){return m("plugin:menu|prepend",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(n=>"rid"in n?[n.rid,n.kind]:n)})}async insert(e,n){return m("plugin:menu|insert",{rid:this.rid,kind:this.kind,items:(Array.isArray(e)?e:[e]).map(l=>"rid"in l?[l.rid,l.kind]:l),position:n})}async remove(e){return m("plugin:menu|remove",{rid:this.rid,kind:this.kind,item:[e.rid,e.kind]})}async removeAt(e){return m("plugin:menu|remove_at",{rid:this.rid,kind:this.kind,position:e}).then(Pl)}async items(){return m("plugin:menu|items",{rid:this.rid,kind:this.kind}).then(e=>e.map(Pl))}async get(e){return m("plugin:menu|get",{rid:this.rid,kind:this.kind,id:e}).then(n=>n?Pl(n):null)}async popup(e,n){let l=null;return e&&(l={type:e instanceof it?"Physical":"Logical",data:e}),m("plugin:menu|popup",{rid:this.rid,kind:this.kind,window:(n==null?void 0:n.label)??null,at:l})}async setAsAppMenu(){return m("plugin:menu|set_as_app_menu",{rid:this.rid}).then(e=>e?new bt(e[0],e[1]):null)}async setAsWindowMenu(e){return m("plugin:menu|set_as_window_menu",{rid:this.rid,window:(e==null?void 0:e.label)??null}).then(n=>n?new bt(n[0],n[1]):null)}}function js(t,e,n){const l=t.slice();return l[16]=e[n],l[17]=e,l[18]=n,l}function Gs(t,e,n){const l=t.slice();return l[19]=e[n],l[20]=e,l[21]=n,l}function Ks(t){let e,n,l,s,u,d,o=t[19]+"",c,h,w,_,W;function k(){t[9].call(n,t[20],t[21])}return{c(){e=r("div"),n=r("input"),u=p(),d=r("label"),c=b(o),w=p(),a(n,"id",l=t[19]+"Input"),n.checked=s=t[0]===t[19],a(n,"type","radio"),a(n,"name","kind"),a(d,"for",h=t[19]+"Input"),a(e,"class","flex gap-1")},m(y,C){L(y,e,C),i(e,n),O(n,t[19]),i(e,u),i(e,d),i(d,c),i(e,w),_||(W=[A(n,"change",t[6]),A(n,"change",k)],_=!0)},p(y,C){t=y,C&16&&l!==(l=t[19]+"Input")&&a(n,"id",l),C&17&&s!==(s=t[0]===t[19])&&(n.checked=s),C&16&&O(n,t[19]),C&16&&o!==(o=t[19]+"")&&se(c,o),C&16&&h!==(h=t[19]+"Input")&&a(d,"for",h)},d(y){y&&S(e),_=!1,Ce(W)}}}function Xs(t){let e,n,l;return{c(){e=r("input"),a(e,"class","input"),a(e,"type","text"),a(e,"placeholder","Text")},m(s,u){L(s,e,u),O(e,t[1]),n||(l=A(e,"input",t[10]),n=!0)},p(s,u){u&2&&e.value!==s[1]&&O(e,s[1])},d(s){s&&S(e),n=!1,l()}}}function ua(t){let e,n=he(t[5]),l=[];for(let s=0;sl("itemClick",{id:T,text:P})},I=await Fn.new(M);break;case"Icon":M={text:u,icon:d,action:T=>l("itemClick",{id:T,text:P})},I=await Hn.new(M);break;case"Check":M={text:u,checked:c,action:T=>l("itemClick",{id:T,text:P})},I=await cn.new(M);break;case"Predefined":M={item:o},I=await Un.new(M);break}l("new",{item:I,options:M}),n(1,u=""),o=""}function y(M,I){M[I]=this.value,n(4,h)}function C(){u=this.value,n(1,u)}function E(){d=this.value,n(2,d)}function V(){c=this.checked,n(3,c)}function D(M,I){M[I]=this.value,n(5,w)}return[s,u,d,c,h,w,_,W,k,y,C,E,V,D]}class fa extends xe{constructor(e){super(),Ze(this,e,ha,da,je,{})}}function Qs(t,e,n){const l=t.slice();return l[5]=e[n],l}function Js(t){let e,n,l,s,u,d=Zs(t[5])+"",o,c;return{c(){e=r("div"),n=r("div"),s=p(),u=r("p"),o=b(d),c=p(),a(n,"class",l=t[3](t[5])),a(e,"class","flex flex-row gap-1")},m(h,w){L(h,e,w),i(e,n),i(e,s),i(e,u),i(u,o),i(e,c)},p(h,w){w&1&&l!==(l=h[3](h[5]))&&a(n,"class",l),w&1&&d!==(d=Zs(h[5])+"")&&se(o,d)},d(h){h&&S(e)}}}function pa(t){let e,n,l,s,u;n=new fa({}),n.$on("new",t[1]),n.$on("itemClick",t[2]);let d=he(t[0]),o=[];for(let c=0;c{"items"in c&&n(0,l=c.items)},[l,u,d,o]}class _r extends xe{constructor(e){super(),Ze(this,e,ma,pa,je,{items:0})}}function ga(t){let e,n,l,s,u,d,o,c,h,w;function _(k){t[5](k)}let W={};return t[0]!==void 0&&(W.items=t[0]),n=new _r({props:W}),On.push(()=>cr(n,"items",_)),n.$on("itemClick",t[3]),{c(){e=r("div"),In(n.$$.fragment),s=p(),u=r("button"),u.textContent="Create menu",d=p(),o=r("button"),o.textContent="Popup",a(u,"class","btn"),a(o,"class","btn")},m(k,y){L(k,e,y),rn(n,e,null),i(e,s),i(e,u),i(e,d),i(e,o),c=!0,h||(w=[A(u,"click",t[1]),A(o,"click",t[2])],h=!0)},p(k,[y]){const C={};!l&&y&1&&(l=!0,C.items=k[0],ur(()=>l=!1)),n.$set(C)},i(k){c||(sn(n.$$.fragment,k),c=!0)},o(k){Wn(n.$$.fragment,k),c=!1},d(k){k&&S(e),an(n),h=!1,Ce(w)}}}function _a(t,e,n){let{onMessage:l}=e,s=[],u=null,d=null,o=0;const c=navigator.userAgent.includes("Macintosh");async function h(){d=await Bn.new({text:"app",items:s.map(y=>y.item)})}async function w(){await h(),o=s.length,u=await bt.new({items:[d]}),await(c?u.setAsAppMenu():u.setAsWindowMenu())}async function _(){(!d||o!==s.length)&&await h(),(await bt.new({items:[d]})).popup()}function W(y){l(`Item ${y.detail.text} clicked`)}function k(y){s=y,n(0,s)}return t.$$set=y=>{"onMessage"in y&&n(4,l=y.onMessage)},[s,w,_,W,l,k]}class ba extends xe{constructor(e){super(),Ze(this,e,_a,ga,je,{onMessage:4})}}class Dl extends mr{constructor(e,n){super(e),this.id=n}static async new(e){e!=null&&e.menu&&(e.menu=[e.menu.rid,e.menu.kind]),e!=null&&e.icon&&(e.icon=typeof e.icon=="string"?e.icon:Array.from(e.icon));const n=new Il;return e!=null&&e.action&&(n.onmessage=e.action,delete e.action),m("plugin:tray|new",{options:e??{},handler:n}).then(([l,s])=>new Dl(l,s))}async setIcon(e){let n=null;return e&&(n=typeof e=="string"?e:Array.from(e)),m("plugin:tray|set_icon",{rid:this.rid,icon:n})}async setMenu(e){return e&&(e=[e.rid,e.kind]),m("plugin:tray|set_menu",{rid:this.rid,menu:e})}async setTooltip(e){return m("plugin:tray|set_tooltip",{rid:this.rid,tooltip:e})}async setTitle(e){return m("plugin:tray|set_title",{rid:this.rid,title:e})}async setVisible(e){return m("plugin:tray|set_visible",{rid:this.rid,visible:e})}async setTempDirPath(e){return m("plugin:tray|set_temp_dir_path",{rid:this.rid,path:e})}async setIconAsTemplate(e){return m("plugin:tray|set_icon_as_template",{rid:this.rid,asTemplate:e})}async setMenuOnLeftClick(e){return m("plugin:tray|set_show_menu_on_left_click",{rid:this.rid,onLeft:e})}}function wa(t){let e,n,l,s,u,d,o,c,h,w,_,W,k,y,C,E,V,D,M,I,P,T,R,Y,q,Q;function ie(v){t[14](v)}let ee={};return t[5]!==void 0&&(ee.items=t[5]),M=new _r({props:ee}),On.push(()=>cr(M,"items",ie)),M.$on("itemClick",t[6]),{c(){e=r("div"),n=r("div"),l=r("input"),s=p(),u=r("input"),d=p(),o=r("label"),c=b(`Menu on left click + `),h=r("input"),w=p(),_=r("div"),W=r("input"),k=p(),y=r("label"),C=b(`Icon as template + `),E=r("input"),V=p(),D=r("div"),In(M.$$.fragment),P=p(),T=r("div"),R=r("button"),R.textContent="Create tray",a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","Title"),a(u,"class","input grow"),a(u,"type","text"),a(u,"placeholder","Tooltip"),a(h,"type","checkbox"),a(n,"class","flex gap-1"),a(W,"class","input grow"),a(W,"type","text"),a(W,"placeholder","Icon path"),a(E,"type","checkbox"),a(_,"class","flex gap-1"),a(D,"class","flex children:grow"),a(R,"class","btn"),a(R,"title","Creates the tray icon"),a(T,"class","flex"),a(e,"class","flex flex-col children:grow gap-2")},m(v,B){L(v,e,B),i(e,n),i(n,l),O(l,t[2]),i(n,s),i(n,u),O(u,t[1]),i(n,d),i(n,o),i(o,c),i(o,h),h.checked=t[4],i(e,w),i(e,_),i(_,W),O(W,t[0]),i(_,k),i(_,y),i(y,C),i(y,E),E.checked=t[3],i(e,V),i(e,D),rn(M,D,null),i(e,P),i(e,T),i(T,R),Y=!0,q||(Q=[A(l,"input",t[9]),A(u,"input",t[10]),A(h,"change",t[11]),A(W,"input",t[12]),A(E,"change",t[13]),A(R,"click",t[7])],q=!0)},p(v,[B]){B&4&&l.value!==v[2]&&O(l,v[2]),B&2&&u.value!==v[1]&&O(u,v[1]),B&16&&(h.checked=v[4]),B&1&&W.value!==v[0]&&O(W,v[0]),B&8&&(E.checked=v[3]);const G={};!I&&B&32&&(I=!0,G.items=v[5],ur(()=>I=!1)),M.$set(G)},i(v){Y||(sn(M.$$.fragment,v),Y=!0)},o(v){Wn(M.$$.fragment,v),Y=!1},d(v){v&&S(e),an(M),q=!1,Ce(Q)}}}function ka(t,e,n){let{onMessage:l}=e,s=null,u=null,d=null,o=!1,c=!0,h=[];function w(D){l(`Item ${D.detail.text} clicked`)}async function _(){Dl.new({icon:s,tooltip:u,title:d,iconAsTemplate:o,menuOnLeftClick:c,menu:await bt.new({items:h.map(D=>D.item)}),action:D=>l(D)}).catch(l)}function W(){d=this.value,n(2,d)}function k(){u=this.value,n(1,u)}function y(){c=this.checked,n(4,c)}function C(){s=this.value,n(0,s)}function E(){o=this.checked,n(3,o)}function V(D){h=D,n(5,h)}return t.$$set=D=>{"onMessage"in D&&n(8,l=D.onMessage)},[s,u,d,o,c,h,w,_,l,W,k,y,C,E,V]}class ya extends xe{constructor(e){super(),Ze(this,e,ka,wa,je,{onMessage:8})}}function xs(t,e,n){const l=t.slice();return l[26]=e[n],l}function $s(t,e,n){const l=t.slice();return l[29]=e[n],l}function va(t){let e;return{c(){e=r("span"),a(e,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,l){L(n,e,l)},d(n){n&&S(e)}}}function Ca(t){let e;return{c(){e=r("span"),a(e,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,l){L(n,e,l)},d(n){n&&S(e)}}}function Sa(t){let e,n;return{c(){e=b(`Switch to Dark mode + `),n=r("div"),a(n,"class","i-ph-moon")},m(l,s){L(l,e,s),L(l,n,s)},d(l){l&&(S(e),S(n))}}}function La(t){let e,n;return{c(){e=b(`Switch to Light mode + `),n=r("div"),a(n,"class","i-ph-sun")},m(l,s){L(l,e,s),L(l,n,s)},d(l){l&&(S(e),S(n))}}}function Aa(t){let e,n,l,s,u,d,o;function c(){return t[14](t[29])}return{c(){e=r("a"),n=r("div"),l=p(),s=r("p"),s.textContent=`${t[29].label}`,a(n,"class",t[29].icon+" mr-2"),a(e,"href","##"),a(e,"class",u="nv "+(t[1]===t[29]?"nv_selected":""))},m(h,w){L(h,e,w),i(e,n),i(e,l),i(e,s),d||(o=A(e,"click",c),d=!0)},p(h,w){t=h,w[0]&2&&u!==(u="nv "+(t[1]===t[29]?"nv_selected":""))&&a(e,"class",u)},d(h){h&&S(e),d=!1,o()}}}function er(t){let e,n=t[29]&&Aa(t);return{c(){n&&n.c(),e=Ol()},m(l,s){n&&n.m(l,s),L(l,e,s)},p(l,s){l[29]&&n.p(l,s)},d(l){l&&S(e),n&&n.d(l)}}}function tr(t){let e,n=t[26].html+"",l;return{c(){e=new Mr(!1),l=Ol(),e.a=l},m(s,u){e.m(n,s,u),L(s,l,u)},p(s,u){u[0]&16&&n!==(n=s[26].html+"")&&e.p(n)},d(s){s&&(S(l),e.d())}}}function Ma(t){let e,n,l,s,u,d,o,c,h,w,_,W,k,y,C,E,V,D,M,I,P,T,R,Y,q,Q,ie,ee,v,B,G,oe,Z=t[1].label+"",we,be,fe,ce,x,pe,K,le,te,z,J,H,re,Ae,ke,me,We,Me;function Ie(F,$){return F[0]?Ca:va}let ge=Ie(t),_e=ge(t);function Se(F,$){return F[2]?La:Sa}let Pe=Se(t),de=Pe(t),Le=he(t[5]),ae=[];for(let F=0;F`,V=p(),D=r("a"),D.innerHTML=`GitHub - `,L=p(),W=r("a"),W.innerHTML=`Source - `,A=p(),I=r("br"),R=p(),Y=r("div"),q=p(),Q=r("br"),ie=p(),ee=r("div");for(let F=0;F',Le=p(),ke=r("div");for(let F=0;F{an(U,1)}),Wr()}Re?($=Cs(Re,De(F)),On($.$$.fragment),sn($.$$.fragment,1),rn($,ce,null)):$=null}if(x[0]&16){Ee=he(F[4]);let U;for(U=0;U{y.ctrlKey&&y.key==="b"&&m("toggle_menu")});const s=navigator.userAgent.toLowerCase(),u=s.includes("android")||s.includes("iphone"),d=[{label:"Welcome",component:Gr,icon:"i-ph-hand-waving"},{label:"Communication",component:Qr,icon:"i-codicon-radio-tower"},!u&&{label:"App",component:ua,icon:"i-codicon-hubot"},{label:"Window",component:na,icon:"i-codicon-window"},{label:"Menu",component:va,icon:"i-ph-list"},{label:"Tray",component:Ma,icon:"i-ph-tray"},{label:"WebRTC",component:sa,icon:"i-ph-broadcast"}];let o=d[0];function c(y){n(1,o=y)}let h;Vi(()=>{n(2,h=localStorage&&localStorage.getItem("theme")=="dark"),Zs(h)});function k(){n(2,h=!h),Zs(h)}let b=Fr([]);Sr(t,b,y=>n(4,l=y));function O(y){b.update(B=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof y=="string"?y:JSON.stringify(y,null,1))+"
"},...B])}function _(y){b.update(B=>[{html:`
[${new Date().toLocaleTimeString()}]: `+y+"
"},...B])}function P(){b.update(()=>[])}let v,E,V;function D(y){V=y.clientY;const B=window.getComputedStyle(v);E=parseInt(B.height,10);const G=Z=>{const we=Z.clientY-V,be=E-we;n(3,v.style.height=`${be{document.removeEventListener("mouseup",oe),document.removeEventListener("mousemove",G)};document.addEventListener("mouseup",oe),document.addEventListener("mousemove",G)}let L=!1,W,A,I=!1,R=0,Y=0;const q=(y,B,G)=>Math.min(Math.max(B,y),G);Vi(()=>{n(13,W=document.querySelector("#sidebar")),A=document.querySelector("#sidebarToggle"),document.addEventListener("click",y=>{A.contains(y.target)?n(0,L=!L):L&&!W.contains(y.target)&&n(0,L=!1)}),document.addEventListener("touchstart",y=>{if(A.contains(y.target))return;const B=y.touches[0].clientX;(0{if(I){const B=y.touches[0].clientX;Y=B;const G=(B-R)/10;W.style.setProperty("--translate-x",`-${q(0,L?0-G:18.75-G,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(I){const y=(Y-R)/10;n(0,L=L?y>-(18.75/2):y>18.75/2)}I=!1})});const Q=y=>{c(y),n(0,L=!1)},ie=y=>y.key==="Enter"?P():{};function ee(y){Tn[y?"unshift":"push"](()=>{v=y,n(3,v)})}return t.$$.update=()=>{if(t.$$.dirty[0]&1){const y=document.querySelector("#sidebar");y&&za(y,L)}},[L,o,h,v,l,d,c,k,b,O,_,P,D,W,Q,ie,ee]}class Wa extends $e{constructor(e){super(),Ze(this,e,Oa,Ta,je,{},null,[-1,-1])}}new Wa({target:document.querySelector("#app")}); + `,M=p(),I=r("a"),I.innerHTML=`Source + `,P=p(),T=r("br"),R=p(),Y=r("div"),q=p(),Q=r("br"),ie=p(),ee=r("div");for(let F=0;F',Ae=p(),ke=r("div");for(let F=0;F{an(U,1)}),Wr()}Re?(x=Es(Re,De(F)),In(x.$$.fragment),sn(x.$$.fragment,1),rn(x,ce,null)):x=null}if($[0]&16){Ee=he(F[4]);let U;for(U=0;U{v.ctrlKey&&v.key==="b"&&m("toggle_menu")});const s=navigator.userAgent.toLowerCase(),u=s.includes("android")||s.includes("iphone"),d=[{label:"Welcome",component:jr,icon:"i-ph-hand-waving"},{label:"Communication",component:Yr,icon:"i-codicon-radio-tower"},!u&&{label:"App",component:aa,icon:"i-codicon-hubot"},{label:"Window",component:ta,icon:"i-codicon-window"},{label:"Menu",component:ba,icon:"i-ph-list"},{label:"Tray",component:ya,icon:"i-ph-tray"},{label:"WebRTC",component:la,icon:"i-ph-broadcast"}];let o=d[0];function c(v){n(1,o=v)}let h;Ki(()=>{n(2,h=localStorage&&localStorage.getItem("theme")=="dark"),ir(h)});function w(){n(2,h=!h),ir(h)}let _=Dr([]);Cr(t,_,v=>n(4,l=v));function W(v){_.update(B=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof v=="string"?v:JSON.stringify(v,null,1))+"
"},...B])}function k(v){_.update(B=>[{html:`
[${new Date().toLocaleTimeString()}]: `+v+"
"},...B])}function y(){_.update(()=>[])}let C,E,V;function D(v){V=v.clientY;const B=window.getComputedStyle(C);E=parseInt(B.height,10);const G=Z=>{const we=Z.clientY-V,be=E-we;n(3,C.style.height=`${be{document.removeEventListener("mouseup",oe),document.removeEventListener("mousemove",G)};document.addEventListener("mouseup",oe),document.addEventListener("mousemove",G)}let M=!1,I,P,T=!1,R=0,Y=0;const q=(v,B,G)=>Math.min(Math.max(B,v),G);Ki(()=>{n(13,I=document.querySelector("#sidebar")),P=document.querySelector("#sidebarToggle"),document.addEventListener("click",v=>{P.contains(v.target)?n(0,M=!M):M&&!I.contains(v.target)&&n(0,M=!1)}),document.addEventListener("touchstart",v=>{if(P.contains(v.target))return;const B=v.touches[0].clientX;(0{if(T){const B=v.touches[0].clientX;Y=B;const G=(B-R)/10;I.style.setProperty("--translate-x",`-${q(0,M?0-G:18.75-G,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(T){const v=(Y-R)/10;n(0,M=M?v>-(18.75/2):v>18.75/2)}T=!1})});const Q=v=>{c(v),n(0,M=!1)},ie=v=>v.key==="Enter"?y():{};function ee(v){On[v?"unshift":"push"](()=>{C=v,n(3,C)})}return t.$$.update=()=>{if(t.$$.dirty[0]&1){const v=document.querySelector("#sidebar");v&&Pa(v,M)}},[M,o,h,C,l,d,c,w,_,W,k,y,D,I,Q,ie,ee]}class Ta extends xe{constructor(e){super(),Ze(this,e,Ea,Ma,je,{},null,[-1,-1])}}new Ta({target:document.querySelector("#app")}); diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index 5f4f44372..332f6bf0c 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -193,11 +193,11 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b0c4a4f319e45986f347ee47fef8bf5e81c9abc3f6f58dc2391439f30df65f0" dependencies = [ - "async-lock", + "async-lock 2.8.0", "async-task", "concurrent-queue", "fastrand 2.0.1", - "futures-lite", + "futures-lite 1.13.0", "slab", ] @@ -207,10 +207,10 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "blocking", - "futures-lite", + "futures-lite 1.13.0", ] [[package]] @@ -219,20 +219,40 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", - "polling", - "rustix 0.37.26", + "polling 2.8.0", + "rustix 0.37.27", "slab", "socket2 0.4.9", "waker-fn", ] +[[package]] +name = "async-io" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9d5715c2d329bf1b4da8d60455b99b187f27ba726df2883799af9af60997" +dependencies = [ + "async-lock 3.0.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.0.1", + "parking", + "polling 3.3.0", + "rustix 0.38.21", + "slab", + "tracing", + "waker-fn", + "windows-sys 0.48.0", +] + [[package]] name = "async-lock" version = "2.8.0" @@ -242,20 +262,31 @@ dependencies = [ "event-listener 2.5.3", ] +[[package]] +name = "async-lock" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45e900cdcd39bb94a14487d3f7ef92ca222162e6c7c3fe7cb3550ea75fb486ed" +dependencies = [ + "event-listener 3.0.1", + "event-listener-strategy", + "pin-project-lite", +] + [[package]] name = "async-process" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" dependencies = [ - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", "async-signal", "blocking", "cfg-if", - "event-listener 3.0.0", - "futures-lite", - "rustix 0.38.20", + "event-listener 3.0.1", + "futures-lite 1.13.0", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -272,17 +303,17 @@ dependencies = [ [[package]] name = "async-signal" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2a5415b7abcdc9cd7d63d6badba5288b2ca017e3fbd4173b8f405449f1a2399" +checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" dependencies = [ - "async-io", - "async-lock", + "async-io 2.2.0", + "async-lock 2.8.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.20", + "rustix 0.38.21", "signal-hook-registry", "slab", "windows-sys 0.48.0", @@ -398,11 +429,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c36a4d0d48574b3dd360b4b7d95cc651d2b6557b6402848a27d4b228a473e2a" dependencies = [ "async-channel", - "async-lock", + "async-lock 2.8.0", "async-task", "fastrand 2.0.1", "futures-io", - "futures-lite", + "futures-lite 1.13.0", "piper", "tracing", ] @@ -532,6 +563,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chrono" version = "0.4.31" @@ -1002,9 +1039,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" dependencies = [ "libc", "windows-sys 0.48.0", @@ -1018,15 +1055,25 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e56284f00d94c1bc7fd3c77027b4623c88c1f53d8d2394c6199f2921dea325" +checksum = "01cec0252c2afff729ee6f00e903d479fba81784c8e2bd77447673471fdfaea1" dependencies = [ "concurrent-queue", "parking", "pin-project-lite", ] +[[package]] +name = "event-listener-strategy" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96b852f1345da36d551b9473fa1e2b1eb5c5195585c6c018118bc92a8d91160" +dependencies = [ + "event-listener 3.0.1", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -1185,6 +1232,16 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3831c2651acb5177cbd83943f3d9c8912c5ad03c76afcc0e9511ba568ec5ebb" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "futures-macro" version = "0.3.28" @@ -1306,6 +1363,20 @@ dependencies = [ "system-deps", ] +[[package]] +name = "gdkx11" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2ea8a4909d530f79921290389cbd7c34cb9d623bfe970eaae65ca5f9cd9cce" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", +] + [[package]] name = "gdkx11-sys" version = "0.18.0" @@ -1666,7 +1737,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.51.1", ] [[package]] @@ -1948,9 +2019,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" @@ -2551,6 +2622,20 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "polling" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53b6af1f60f36f8c2ac2aad5459d75a5a9b4be1e8cdd40264f315d78193e531" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.21", + "tracing", + "windows-sys 0.48.0", +] + [[package]] name = "polyval" version = "0.6.1" @@ -2744,15 +2829,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -2871,9 +2947,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.26" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f3f8f960ed3b5a59055428714943298bf3fa2d4a1d53135084e0544829d995" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags 1.3.2", "errno", @@ -2885,14 +2961,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.20" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ "bitflags 2.4.1", "errno", "libc", - "linux-raw-sys 0.4.10", + "linux-raw-sys 0.4.11", "windows-sys 0.48.0", ] @@ -3326,26 +3402,19 @@ dependencies = [ [[package]] name = "tao" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f130523fee9820ad78141d443e6cef75043acade79107bc483872bc183928c0f" +checksum = "3c0dff18fed076d29cb5779e918ef4b8a5dbb756204e4a027794f0bce233d949" dependencies = [ "bitflags 1.3.2", - "cairo-rs", "cc", - "cocoa 0.24.1", + "cocoa 0.25.0", "core-foundation", - "core-graphics 0.22.3", + "core-graphics 0.23.1", "crossbeam-channel", "dispatch", - "gdk", - "gdk-pixbuf", - "gdk-sys", "gdkwayland-sys", "gdkx11-sys", - "gio", - "glib", - "glib-sys", "gtk", "image", "instant", @@ -3362,13 +3431,12 @@ dependencies = [ "png", "raw-window-handle", "scopeguard", - "serde", "tao-macros", "unicode-segmentation", "url", - "uuid", - "windows 0.51.1", + "windows 0.52.0", "windows-implement", + "windows-version", "x11-dl", "zbus", ] @@ -3392,7 +3460,7 @@ checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tauri" -version = "2.0.0-alpha.17" +version = "2.0.0-alpha.18" dependencies = [ "anyhow", "bytes", @@ -3438,12 +3506,12 @@ dependencies = [ "webkit2gtk", "webview2-com", "window-vibrancy", - "windows 0.51.1", + "windows 0.52.0", ] [[package]] name = "tauri-build" -version = "2.0.0-alpha.11" +version = "2.0.0-alpha.12" dependencies = [ "anyhow", "cargo_toml", @@ -3464,7 +3532,7 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.0-alpha.10" +version = "2.0.0-alpha.11" dependencies = [ "base64", "brotli", @@ -3488,7 +3556,7 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0-alpha.10" +version = "2.0.0-alpha.11" dependencies = [ "heck", "proc-macro2", @@ -3524,7 +3592,7 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "1.0.0-alpha.4" +version = "1.0.0-alpha.5" dependencies = [ "gtk", "http", @@ -3535,12 +3603,12 @@ dependencies = [ "tauri-utils", "thiserror", "url", - "windows 0.51.1", + "windows 0.52.0", ] [[package]] name = "tauri-runtime-wry" -version = "1.0.0-alpha.5" +version = "1.0.0-alpha.6" dependencies = [ "cocoa 0.24.1", "gtk", @@ -3548,17 +3616,18 @@ dependencies = [ "jni", "percent-encoding", "raw-window-handle", + "tao", "tauri-runtime", "tauri-utils", "webkit2gtk", "webview2-com", - "windows 0.51.1", + "windows 0.52.0", "wry", ] [[package]] name = "tauri-utils" -version = "2.0.0-alpha.10" +version = "2.0.0-alpha.11" dependencies = [ "aes-gcm", "brotli", @@ -3584,7 +3653,6 @@ dependencies = [ "thiserror", "url", "walkdir", - "windows-version", ] [[package]] @@ -3599,14 +3667,14 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand 2.0.1", - "redox_syscall 0.3.5", - "rustix 0.38.20", + "redox_syscall 0.4.1", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -4201,14 +4269,14 @@ dependencies = [ [[package]] name = "webview2-com" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd15556ff1d1d6bc850dbb362762bae86069773dd30177c90d3bfa917080dc73" +checksum = "e0ae9c7e420783826cf769d2c06ac9ba462f450eca5893bb8c6c6529a4e5dd33" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows 0.51.1", - "windows-core", + "windows 0.52.0", + "windows-core 0.52.0", "windows-implement", "windows-interface", ] @@ -4226,13 +4294,13 @@ dependencies = [ [[package]] name = "webview2-com-sys" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3775bb005c3170497ec411b36005708b57ad486bfa3d23864c92f5973858ce8d" +checksum = "d6ad85fceee6c42fa3d61239eba5a11401bf38407a849ed5ea1b407df08cca72" dependencies = [ "thiserror", - "windows 0.51.1", - "windows-core", + "windows 0.52.0", + "windows-core 0.52.0", ] [[package]] @@ -4301,14 +4369,14 @@ dependencies = [ [[package]] name = "windows" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core", + "windows-core 0.52.0", "windows-implement", "windows-interface", - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] @@ -4321,10 +4389,19 @@ dependencies = [ ] [[package]] -name = "windows-implement" -version = "0.51.1" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb2b158efec5af20d8846836622f50a87e6556b9153a42772fa047f773c0e555" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-implement" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12168c33176773b86799be25e2a2ba07c7aab9968b37541f1094dbd7a60c8946" dependencies = [ "proc-macro2", "quote", @@ -4333,9 +4410,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0546e63e1ce64c04403d2311fa0e3ab5ae3a367bd524b4a38d8d8d18c70cfa76" +checksum = "9d8dc32e0095a7eeccebd0e3f09e9509365ecb3fc6ac4d6f5f14a3f6392942d1" dependencies = [ "proc-macro2", "quote", @@ -4580,38 +4657,47 @@ dependencies = [ [[package]] name = "wry" -version = "0.34.2" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f1e29660f22d8eec141f41f59b7fef231e4113c370c89b90ae3a0db8dec1927" +checksum = "764ce8212721205a90c79f5fa04f5135af597bea9072f22a5e7f39dcd0669f2e" dependencies = [ "base64", "block", + "cfg_aliases", "cocoa 0.25.0", "core-graphics 0.23.1", "crossbeam-channel", "dunce", + "gdkx11", "gtk", "html5ever", "http", "javascriptcore-rs", + "jni", "kuchikiki", "libc", "log", + "ndk", + "ndk-context", + "ndk-sys", "objc", "objc_id", "once_cell", + "raw-window-handle", "serde", "serde_json", "sha2", "soup3", - "tao", + "tao-macros", "thiserror", "url", "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows 0.51.1", + "windows 0.52.0", "windows-implement", + "windows-version", + "x11-dl", ] [[package]] @@ -4654,8 +4740,8 @@ dependencies = [ "async-broadcast", "async-executor", "async-fs", - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", "async-process", "async-recursion", "async-task", diff --git a/examples/api/src-tauri/Cargo.toml b/examples/api/src-tauri/Cargo.toml index c83ce5c1c..050df8503 100644 --- a/examples/api/src-tauri/Cargo.toml +++ b/examples/api/src-tauri/Cargo.toml @@ -43,7 +43,7 @@ path = "../../../core/tauri" features = ["test"] [target."cfg(target_os = \"windows\")".dependencies] -window-shadows= "0.2" +window-shadows = "0.2" [features] custom-protocol = [ "tauri/custom-protocol" ] diff --git a/examples/api/src-tauri/src/lib.rs b/examples/api/src-tauri/src/lib.rs index 1eb026c40..1fff529f6 100644 --- a/examples/api/src-tauri/src/lib.rs +++ b/examples/api/src-tauri/src/lib.rs @@ -44,7 +44,7 @@ pub fn run_app) + Send + 'static>( #[cfg(desktop)] { let handle = app.handle(); - tray::create_tray(&handle)?; + tray::create_tray(handle)?; handle.plugin(tauri_plugin_cli::init())?; } @@ -68,7 +68,7 @@ pub fn run_app) + Send + 'static>( .inner_size(1000., 800.) .min_inner_size(600., 400.) .content_protected(true) - .menu(tauri::menu::Menu::default(&app.handle())?); + .menu(tauri::menu::Menu::default(app.handle())?); } let window = window_builder.build().unwrap(); diff --git a/examples/api/src/App.svelte b/examples/api/src/App.svelte index 5f9f3ede7..5576fbc39 100644 --- a/examples/api/src/App.svelte +++ b/examples/api/src/App.svelte @@ -84,7 +84,7 @@ let consoleTextEl; async function onMessage(value) { messages.update((r) => [ - ...r + ...r, { html: `
[${new Date().toLocaleTimeString()}]: ` +
@@ -100,7 +100,7 @@
   // we only use it with our own input data
   async function insecureRenderHtml(html) {
     messages.update((r) => [
-      ...r
+      ...r,
       {
         html:
           `
[${new Date().toLocaleTimeString()}]: ` +