From c1ec0f155118527361dd5645d920becbc8afd569 Mon Sep 17 00:00:00 2001 From: Andre Lew Date: Wed, 18 Oct 2023 05:47:24 -0700 Subject: [PATCH] feat(core): expose `always_on_bottom`, closes #7847 (#7933) Co-authored-by: Lucas Nogueira --- .changes/always-on-bottom-api.md | 5 ++ .changes/always-on-bottom-config.md | 5 ++ .changes/always-on-bottom.md | 7 +++ core/tauri-config-schema/schema.json | 5 ++ core/tauri-runtime-wry/src/lib.rs | 20 +++++++ core/tauri-runtime/src/lib.rs | 3 ++ core/tauri-runtime/src/webview.rs | 4 ++ core/tauri-utils/src/config.rs | 6 +++ core/tauri/scripts/bundle.global.js | 2 +- core/tauri/src/test/mock_runtime.rs | 8 +++ core/tauri/src/window/mod.rs | 16 ++++++ core/tauri/src/window/plugin.rs | 2 + examples/api/dist/assets/index.js | 79 ++++++++++++++-------------- examples/api/src/views/Window.svelte | 6 +++ tooling/api/docs/js-api.json | 2 +- tooling/api/src/window.ts | 20 +++++++ tooling/cli/schema.json | 5 ++ 17 files changed, 154 insertions(+), 41 deletions(-) create mode 100644 .changes/always-on-bottom-api.md create mode 100644 .changes/always-on-bottom-config.md create mode 100644 .changes/always-on-bottom.md diff --git a/.changes/always-on-bottom-api.md b/.changes/always-on-bottom-api.md new file mode 100644 index 000000000000..b3cf2ee14327 --- /dev/null +++ b/.changes/always-on-bottom-api.md @@ -0,0 +1,5 @@ +--- +"@tauri-apps/api": patch:feat +--- + +Added `setAlwaysOnBottom` function on `Window` and the `alwaysOnBottom` option when creating a window. diff --git a/.changes/always-on-bottom-config.md b/.changes/always-on-bottom-config.md new file mode 100644 index 000000000000..6dea7d22a621 --- /dev/null +++ b/.changes/always-on-bottom-config.md @@ -0,0 +1,5 @@ +--- +'tauri-utils': 'minor:feat' +--- + +Added the `always_on_bottom` option to the window configuration. diff --git a/.changes/always-on-bottom.md b/.changes/always-on-bottom.md new file mode 100644 index 000000000000..ec7322638f17 --- /dev/null +++ b/.changes/always-on-bottom.md @@ -0,0 +1,7 @@ +--- +'tauri': 'minor:feat' +'tauri-runtime': 'minor:feat' +'tauri-runtime-wry': 'minor:feat' +--- + +Added `Window::set_always_on_bottom` and the `always_on_bottom` option when creating a window. diff --git a/core/tauri-config-schema/schema.json b/core/tauri-config-schema/schema.json index 9c977517a184..bfabbb01300f 100644 --- a/core/tauri-config-schema/schema.json +++ b/core/tauri-config-schema/schema.json @@ -440,6 +440,11 @@ "default": true, "type": "boolean" }, + "alwaysOnBottom": { + "description": "Whether the window should always be below other windows.", + "default": false, + "type": "boolean" + }, "alwaysOnTop": { "description": "Whether the window should always be on top of other windows.", "default": false, diff --git a/core/tauri-runtime-wry/src/lib.rs b/core/tauri-runtime-wry/src/lib.rs index b864ee888c89..0675bfc72acc 100644 --- a/core/tauri-runtime-wry/src/lib.rs +++ b/core/tauri-runtime-wry/src/lib.rs @@ -627,6 +627,7 @@ impl WindowBuilder for WindowBuilderWrapper { .fullscreen(config.fullscreen) .decorations(config.decorations) .maximized(config.maximized) + .always_on_bottom(config.always_on_bottom) .always_on_top(config.always_on_top) .visible_on_all_workspaces(config.visible_on_all_workspaces) .content_protected(config.content_protected) @@ -745,6 +746,11 @@ impl WindowBuilder for WindowBuilderWrapper { self } + fn always_on_bottom(mut self, always_on_bottom: bool) -> Self { + self.inner = self.inner.with_always_on_bottom(always_on_bottom); + self + } + fn always_on_top(mut self, always_on_top: bool) -> Self { self.inner = self.inner.with_always_on_top(always_on_top); self @@ -1022,6 +1028,7 @@ pub enum WindowMessage { Close, SetDecorations(bool), SetShadow(bool), + SetAlwaysOnBottom(bool), SetAlwaysOnTop(bool), SetVisibleOnAllWorkspaces(bool), SetContentProtected(bool), @@ -1413,6 +1420,16 @@ impl Dispatch for WryDispatcher { ) } + fn set_always_on_bottom(&self, always_on_bottom: bool) -> Result<()> { + send_user_message( + &self.context, + Message::Window( + self.window_id, + WindowMessage::SetAlwaysOnBottom(always_on_bottom), + ), + ) + } + fn set_always_on_top(&self, always_on_top: bool) -> Result<()> { send_user_message( &self.context, @@ -2289,6 +2306,9 @@ fn handle_user_message( #[cfg(target_os = "macos")] window.set_has_shadow(_enable); } + WindowMessage::SetAlwaysOnBottom(always_on_bottom) => { + window.set_always_on_bottom(always_on_bottom) + } WindowMessage::SetAlwaysOnTop(always_on_top) => window.set_always_on_top(always_on_top), WindowMessage::SetVisibleOnAllWorkspaces(visible_on_all_workspaces) => { window.set_visible_on_all_workspaces(visible_on_all_workspaces) diff --git a/core/tauri-runtime/src/lib.rs b/core/tauri-runtime/src/lib.rs index 8c7f3645e8bc..bf78aba2affe 100644 --- a/core/tauri-runtime/src/lib.rs +++ b/core/tauri-runtime/src/lib.rs @@ -531,6 +531,9 @@ pub trait Dispatch: Debug + Clone + Send + Sync + Sized + 'static /// Updates the shadow flag. fn set_shadow(&self, enable: bool) -> Result<()>; + /// Updates the window alwaysOnBottom flag. + fn set_always_on_bottom(&self, always_on_bottom: bool) -> Result<()>; + /// Updates the window alwaysOnTop flag. fn set_always_on_top(&self, always_on_top: bool) -> Result<()>; diff --git a/core/tauri-runtime/src/webview.rs b/core/tauri-runtime/src/webview.rs index 79814a4f8071..12a08b44bc85 100644 --- a/core/tauri-runtime/src/webview.rs +++ b/core/tauri-runtime/src/webview.rs @@ -240,6 +240,10 @@ pub trait WindowBuilder: WindowBuilderBase { #[must_use] fn decorations(self, decorations: bool) -> Self; + /// Whether the window should always be below other windows. + #[must_use] + fn always_on_bottom(self, always_on_bottom: bool) -> Self; + /// Whether the window should always be on top of other windows. #[must_use] fn always_on_top(self, always_on_top: bool) -> Self; diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index 5949e16b5082..1e74508d851f 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -965,6 +965,9 @@ pub struct WindowConfig { /// Whether the window should have borders and bars. #[serde(default = "default_true")] pub decorations: bool, + /// Whether the window should always be below other windows. + #[serde(default, alias = "always-on-bottom")] + pub always_on_bottom: bool, /// Whether the window should always be on top of other windows. #[serde(default, alias = "always-on-top")] pub always_on_top: bool, @@ -1057,6 +1060,7 @@ impl Default for WindowConfig { maximized: false, visible: true, decorations: true, + always_on_bottom: false, always_on_top: false, visible_on_all_workspaces: false, content_protected: false, @@ -2249,6 +2253,7 @@ mod build { let maximized = self.maximized; let visible = self.visible; let decorations = self.decorations; + let always_on_bottom = self.always_on_bottom; let always_on_top = self.always_on_top; let visible_on_all_workspaces = self.visible_on_all_workspaces; let content_protected = self.content_protected; @@ -2290,6 +2295,7 @@ mod build { maximized, visible, decorations, + always_on_bottom, always_on_top, visible_on_all_workspaces, content_protected, diff --git a/core/tauri/scripts/bundle.global.js b/core/tauri/scripts/bundle.global.js index 410fc0e266d4..8739c4756f87 100644 --- a/core/tauri/scripts/bundle.global.js +++ b/core/tauri/scripts/bundle.global.js @@ -1,2 +1,2 @@ -"use strict";var __TAURI_IIFE__=(()=>{var D=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var n in e)D(t,n,{get:e[n],enumerable:!0})},Y=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of J(e))!K.call(t,u)&&u!==n&&D(t,u,{get:()=>e[u],enumerable:!(o=Z(e,u))||o.enumerable});return t};var X=t=>Y(D({},"__esModule",{value:!0}),t);var N=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var C=(t,e,n)=>(N(t,e,"read from private field"),n?n.call(t):e.get(t)),O=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},x=(t,e,n,o)=>(N(t,e,"write to private field"),o?o.call(t,n):e.set(t,n),n);var Ve={};p(Ve,{app:()=>L,dpi:()=>k,event:()=>W,path:()=>A,primitives:()=>z,window:()=>S});var L={};p(L,{getName:()=>ne,getTauriVersion:()=>te,getVersion:()=>ie,hide:()=>oe,show:()=>re});var z={};p(z,{Channel:()=>y,PluginListener:()=>w,addPluginListener:()=>B,convertFileSrc:()=>ee,invoke:()=>i,transformCallback:()=>P});function P(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}var h,y=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;O(this,h,()=>{});this.id=P(e=>{C(this,h).call(this,e)})}set onmessage(e){x(this,h,e)}get onmessage(){return C(this,h)}toJSON(){return`__CHANNEL__:${this.id}`}};h=new WeakMap;var w=class{constructor(e,n,o){this.plugin=e,this.event=n,this.channelId=o}async unregister(){return i(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function B(t,e,n){let o=new y;return o.onmessage=n,i(`plugin:${t}|register_listener`,{event:e,handler:o}).then(()=>new w(t,e,o.id))}async function i(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}function ee(t,e="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(t,e)}async function ie(){return i("plugin:app|version")}async function ne(){return i("plugin:app|name")}async function te(){return i("plugin:app|tauri_version")}async function re(){return i("plugin:app|app_show")}async function oe(){return i("plugin:app|app_hide")}var W={};p(W,{TauriEvent:()=>I,emit:()=>T,listen:()=>v,once:()=>E});var I=(a=>(a.WINDOW_RESIZED="tauri://resize",a.WINDOW_MOVED="tauri://move",a.WINDOW_CLOSE_REQUESTED="tauri://close-requested",a.WINDOW_CREATED="tauri://window-created",a.WINDOW_DESTROYED="tauri://destroyed",a.WINDOW_FOCUS="tauri://focus",a.WINDOW_BLUR="tauri://blur",a.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",a.WINDOW_THEME_CHANGED="tauri://theme-changed",a.WINDOW_FILE_DROP="tauri://file-drop",a.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",a.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",a.MENU="tauri://menu",a))(I||{});async function F(t,e){await i("plugin:event|unlisten",{event:t,eventId:e})}async function v(t,e,n){return i("plugin:event|listen",{event:t,windowLabel:n?.target,handler:P(e)}).then(o=>async()=>F(t,o))}async function E(t,e,n){return v(t,o=>{e(o),F(t,o.id).catch(()=>{})},n)}async function T(t,e,n){await i("plugin:event|emit",{event:t,windowLabel:n?.target,payload:e})}var S={};p(S,{CloseRequestedEvent:()=>f,Effect:()=>G,EffectState:()=>q,LogicalPosition:()=>g,LogicalSize:()=>b,PhysicalPosition:()=>d,PhysicalSize:()=>c,ProgressBarStatus:()=>H,UserAttentionType:()=>M,Window:()=>m,availableMonitors:()=>ae,currentMonitor:()=>se,getAll:()=>_,getCurrent:()=>V,primaryMonitor:()=>le});var k={};p(k,{LogicalPosition:()=>g,LogicalSize:()=>b,PhysicalPosition:()=>d,PhysicalSize:()=>c});var b=class{constructor(e,n){this.type="Logical";this.width=e,this.height=n}},c=class{constructor(e,n){this.type="Physical";this.width=e,this.height=n}toLogical(e){return new b(this.width/e,this.height/e)}},g=class{constructor(e,n){this.type="Logical";this.x=e,this.y=n}},d=class{constructor(e,n){this.type="Physical";this.x=e,this.y=n}toLogical(e){return new g(this.x/e,this.y/e)}};var M=(n=>(n[n.Critical=1]="Critical",n[n.Informational=2]="Informational",n))(M||{}),f=class{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}},H=(l=>(l.None="none",l.Normal="normal",l.Indeterminate="indeterminate",l.Paused="paused",l.Error="error",l))(H||{});function V(){return new m(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function _(){return window.__TAURI_INTERNALS__.metadata.windows.map(t=>new m(t.label,{skip:!0}))}var U=["tauri://created","tauri://error"],m=class{constructor(e,n={}){this.label=e,this.listeners=Object.create(null),n?.skip||i("plugin:window|create",{options:{...n,label:e}}).then(async()=>this.emit("tauri://created")).catch(async o=>this.emit("tauri://error",o))}static getByLabel(e){return _().some(n=>n.label===e)?new m(e,{skip:!0}):null}static getCurrent(){return V()}static getAll(){return _()}static async getFocusedWindow(){for(let e of _())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{let o=this.listeners[e];o.splice(o.indexOf(n),1)}):v(e,n,{target:this.label})}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{let o=this.listeners[e];o.splice(o.indexOf(n),1)}):E(e,n,{target:this.label})}async emit(e,n){if(U.includes(e)){for(let o of this.listeners[e]||[])o({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return T(e,n,{target:this.label})}_handleTauriEvent(e,n){return U.includes(e)?(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0):!1}async scaleFactor(){return i("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return i("plugin:window|inner_position",{label:this.label}).then(({x:e,y:n})=>new d(e,n))}async outerPosition(){return i("plugin:window|outer_position",{label:this.label}).then(({x:e,y:n})=>new d(e,n))}async innerSize(){return i("plugin:window|inner_size",{label:this.label}).then(({width:e,height:n})=>new c(e,n))}async outerSize(){return i("plugin:window|outer_size",{label:this.label}).then(({width:e,height:n})=>new c(e,n))}async isFullscreen(){return i("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return i("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return i("plugin:window|is_maximized",{label:this.label})}async isFocused(){return i("plugin:window|is_focused",{label:this.label})}async isDecorated(){return i("plugin:window|is_decorated",{label:this.label})}async isResizable(){return i("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return i("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return i("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return i("plugin:window|is_closable",{label:this.label})}async isVisible(){return i("plugin:window|is_visible",{label:this.label})}async title(){return i("plugin:window|title",{label:this.label})}async theme(){return i("plugin:window|theme",{label:this.label})}async center(){return i("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(e===1?n={type:"Critical"}:n={type:"Informational"}),i("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return i("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return i("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return i("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return i("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return i("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return i("plugin:window|maximize",{label:this.label})}async unmaximize(){return i("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return i("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return i("plugin:window|minimize",{label:this.label})}async unminimize(){return i("plugin:window|unminimize",{label:this.label})}async show(){return i("plugin:window|show",{label:this.label})}async hide(){return i("plugin:window|hide",{label:this.label})}async close(){return i("plugin:window|close",{label:this.label})}async setDecorations(e){return i("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return i("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return i("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return i("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return i("plugin:window|set_always_on_top",{label:this.label,value:e})}async setContentProtected(e){return i("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 i("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 i("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 i("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 i("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return i("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return i("plugin:window|set_focus",{label:this.label})}async setIcon(e){return i("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return i("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return i("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return i("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return i("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 i("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return i("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return i("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return i("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen("tauri://resize",n=>{n.payload=j(n.payload),e(n)})}async onMoved(e){return this.listen("tauri://move",n=>{n.payload=$(n.payload),e(n)})}async onCloseRequested(e){return this.listen("tauri://close-requested",n=>{let o=new f(n);Promise.resolve(e(o)).then(()=>{if(!o.isPreventDefault())return this.close()})})}async onFocusChanged(e){let n=await this.listen("tauri://focus",u=>{e({...u,payload:!0})}),o=await this.listen("tauri://blur",u=>{e({...u,payload:!1})});return()=>{n(),o()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let n=await this.listen("tauri://file-drop",l=>{e({...l,payload:{type:"drop",paths:l.payload}})}),o=await this.listen("tauri://file-drop-hover",l=>{e({...l,payload:{type:"hover",paths:l.payload}})}),u=await this.listen("tauri://file-drop-cancelled",l=>{e({...l,payload:{type:"cancel"}})});return()=>{n(),o(),u()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},G=(s=>(s.AppearanceBased="appearanceBased",s.Light="light",s.Dark="dark",s.MediumLight="mediumLight",s.UltraDark="ultraDark",s.Titlebar="titlebar",s.Selection="selection",s.Menu="menu",s.Popover="popover",s.Sidebar="sidebar",s.HeaderView="headerView",s.Sheet="sheet",s.WindowBackground="windowBackground",s.HudWindow="hudWindow",s.FullScreenUI="fullScreenUI",s.Tooltip="tooltip",s.ContentBackground="contentBackground",s.UnderWindowBackground="underWindowBackground",s.UnderPageBackground="underPageBackground",s.Mica="mica",s.Blur="blur",s.Acrylic="acrylic",s.Tabbed="tabbed",s.TabbedDark="tabbedDark",s.TabbedLight="tabbedLight",s))(G||{}),q=(o=>(o.FollowsWindowActiveState="followsWindowActiveState",o.Active="active",o.Inactive="inactive",o))(q||{});function R(t){return t===null?null:{name:t.name,scaleFactor:t.scaleFactor,position:$(t.position),size:j(t.size)}}function $(t){return new d(t.x,t.y)}function j(t){return new c(t.width,t.height)}async function se(){return i("plugin:window|current_monitor").then(R)}async function le(){return i("plugin:window|primary_monitor").then(R)}async function ae(){return i("plugin:window|available_monitors").then(t=>t.map(R))}var A={};p(A,{BaseDirectory:()=>Q,appCacheDir:()=>pe,appConfigDir:()=>ue,appDataDir:()=>ce,appLocalDataDir:()=>de,appLogDir:()=>ke,audioDir:()=>me,basename:()=>Me,cacheDir:()=>he,configDir:()=>be,dataDir:()=>ge,delimiter:()=>Ae,desktopDir:()=>ye,dirname:()=>Fe,documentDir:()=>we,downloadDir:()=>Pe,executableDir:()=>ve,extname:()=>Ue,fontDir:()=>_e,homeDir:()=>fe,isAbsolute:()=>He,join:()=>xe,localDataDir:()=>De,normalize:()=>Oe,pictureDir:()=>Ce,publicDir:()=>ze,resolve:()=>Ne,resolveResource:()=>Ie,resourceDir:()=>Le,runtimeDir:()=>Ee,sep:()=>Se,tempDir:()=>Re,templateDir:()=>Te,videoDir:()=>We});var Q=(r=>(r[r.Audio=1]="Audio",r[r.Cache=2]="Cache",r[r.Config=3]="Config",r[r.Data=4]="Data",r[r.LocalData=5]="LocalData",r[r.Document=6]="Document",r[r.Download=7]="Download",r[r.Picture=8]="Picture",r[r.Public=9]="Public",r[r.Video=10]="Video",r[r.Resource=11]="Resource",r[r.Temp=12]="Temp",r[r.AppConfig=13]="AppConfig",r[r.AppData=14]="AppData",r[r.AppLocalData=15]="AppLocalData",r[r.AppCache=16]="AppCache",r[r.AppLog=17]="AppLog",r[r.Desktop=18]="Desktop",r[r.Executable=19]="Executable",r[r.Font=20]="Font",r[r.Home=21]="Home",r[r.Runtime=22]="Runtime",r[r.Template=23]="Template",r))(Q||{});async function ue(){return i("plugin:path|resolve_directory",{directory:13})}async function ce(){return i("plugin:path|resolve_directory",{directory:14})}async function de(){return i("plugin:path|resolve_directory",{directory:15})}async function pe(){return i("plugin:path|resolve_directory",{directory:16})}async function me(){return i("plugin:path|resolve_directory",{directory:1})}async function he(){return i("plugin:path|resolve_directory",{directory:2})}async function be(){return i("plugin:path|resolve_directory",{directory:3})}async function ge(){return i("plugin:path|resolve_directory",{directory:4})}async function ye(){return i("plugin:path|resolve_directory",{directory:18})}async function we(){return i("plugin:path|resolve_directory",{directory:6})}async function Pe(){return i("plugin:path|resolve_directory",{directory:7})}async function ve(){return i("plugin:path|resolve_directory",{directory:19})}async function _e(){return i("plugin:path|resolve_directory",{directory:20})}async function fe(){return i("plugin:path|resolve_directory",{directory:21})}async function De(){return i("plugin:path|resolve_directory",{directory:5})}async function Ce(){return i("plugin:path|resolve_directory",{directory:8})}async function ze(){return i("plugin:path|resolve_directory",{directory:9})}async function Le(){return i("plugin:path|resolve_directory",{directory:11})}async function Ie(t){return i("plugin:path|resolve_directory",{directory:11,path:t})}async function Ee(){return i("plugin:path|resolve_directory",{directory:22})}async function Te(){return i("plugin:path|resolve_directory",{directory:23})}async function We(){return i("plugin:path|resolve_directory",{directory:10})}async function ke(){return i("plugin:path|resolve_directory",{directory:17})}async function Re(t){return i("plugin:path|resolve_directory",{directory:12})}function Se(){return window.__TAURI_INTERNALS__.plugins.path.sep}function Ae(){return window.__TAURI_INTERNALS__.plugins.path.delimiter}async function Ne(...t){return i("plugin:path|resolve",{paths:t})}async function Oe(t){return i("plugin:path|normalize",{path:t})}async function xe(...t){return i("plugin:path|join",{paths:t})}async function Fe(t){return i("plugin:path|dirname",{path:t})}async function Ue(t){return i("plugin:path|extname",{path:t})}async function Me(t,e){return i("plugin:path|basename",{path:t,ext:e})}async function He(t){return i("plugin:path|isAbsolute",{path:t})}return X(Ve);})(); +"use strict";var __TAURI_IIFE__=(()=>{var D=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var n in e)D(t,n,{get:e[n],enumerable:!0})},Y=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of J(e))!K.call(t,u)&&u!==n&&D(t,u,{get:()=>e[u],enumerable:!(o=Z(e,u))||o.enumerable});return t};var X=t=>Y(D({},"__esModule",{value:!0}),t);var N=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var C=(t,e,n)=>(N(t,e,"read from private field"),n?n.call(t):e.get(t)),O=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},x=(t,e,n,o)=>(N(t,e,"write to private field"),o?o.call(t,n):e.set(t,n),n);var Ve={};p(Ve,{app:()=>L,dpi:()=>k,event:()=>W,path:()=>A,primitives:()=>z,window:()=>S});var L={};p(L,{getName:()=>ne,getTauriVersion:()=>te,getVersion:()=>ie,hide:()=>oe,show:()=>re});var z={};p(z,{Channel:()=>y,PluginListener:()=>w,addPluginListener:()=>B,convertFileSrc:()=>ee,invoke:()=>i,transformCallback:()=>P});function P(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}var h,y=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;O(this,h,()=>{});this.id=P(e=>{C(this,h).call(this,e)})}set onmessage(e){x(this,h,e)}get onmessage(){return C(this,h)}toJSON(){return`__CHANNEL__:${this.id}`}};h=new WeakMap;var w=class{constructor(e,n,o){this.plugin=e,this.event=n,this.channelId=o}async unregister(){return i(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function B(t,e,n){let o=new y;return o.onmessage=n,i(`plugin:${t}|register_listener`,{event:e,handler:o}).then(()=>new w(t,e,o.id))}async function i(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}function ee(t,e="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(t,e)}async function ie(){return i("plugin:app|version")}async function ne(){return i("plugin:app|name")}async function te(){return i("plugin:app|tauri_version")}async function re(){return i("plugin:app|app_show")}async function oe(){return i("plugin:app|app_hide")}var W={};p(W,{TauriEvent:()=>I,emit:()=>T,listen:()=>v,once:()=>E});var I=(a=>(a.WINDOW_RESIZED="tauri://resize",a.WINDOW_MOVED="tauri://move",a.WINDOW_CLOSE_REQUESTED="tauri://close-requested",a.WINDOW_CREATED="tauri://window-created",a.WINDOW_DESTROYED="tauri://destroyed",a.WINDOW_FOCUS="tauri://focus",a.WINDOW_BLUR="tauri://blur",a.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",a.WINDOW_THEME_CHANGED="tauri://theme-changed",a.WINDOW_FILE_DROP="tauri://file-drop",a.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",a.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",a.MENU="tauri://menu",a))(I||{});async function F(t,e){await i("plugin:event|unlisten",{event:t,eventId:e})}async function v(t,e,n){return i("plugin:event|listen",{event:t,windowLabel:n?.target,handler:P(e)}).then(o=>async()=>F(t,o))}async function E(t,e,n){return v(t,o=>{e(o),F(t,o.id).catch(()=>{})},n)}async function T(t,e,n){await i("plugin:event|emit",{event:t,windowLabel:n?.target,payload:e})}var S={};p(S,{CloseRequestedEvent:()=>f,Effect:()=>G,EffectState:()=>q,LogicalPosition:()=>g,LogicalSize:()=>b,PhysicalPosition:()=>d,PhysicalSize:()=>c,ProgressBarStatus:()=>H,UserAttentionType:()=>M,Window:()=>m,availableMonitors:()=>ae,currentMonitor:()=>se,getAll:()=>_,getCurrent:()=>V,primaryMonitor:()=>le});var k={};p(k,{LogicalPosition:()=>g,LogicalSize:()=>b,PhysicalPosition:()=>d,PhysicalSize:()=>c});var b=class{constructor(e,n){this.type="Logical";this.width=e,this.height=n}},c=class{constructor(e,n){this.type="Physical";this.width=e,this.height=n}toLogical(e){return new b(this.width/e,this.height/e)}},g=class{constructor(e,n){this.type="Logical";this.x=e,this.y=n}},d=class{constructor(e,n){this.type="Physical";this.x=e,this.y=n}toLogical(e){return new g(this.x/e,this.y/e)}};var M=(n=>(n[n.Critical=1]="Critical",n[n.Informational=2]="Informational",n))(M||{}),f=class{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}},H=(l=>(l.None="none",l.Normal="normal",l.Indeterminate="indeterminate",l.Paused="paused",l.Error="error",l))(H||{});function V(){return new m(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function _(){return window.__TAURI_INTERNALS__.metadata.windows.map(t=>new m(t.label,{skip:!0}))}var U=["tauri://created","tauri://error"],m=class{constructor(e,n={}){this.label=e,this.listeners=Object.create(null),n?.skip||i("plugin:window|create",{options:{...n,label:e}}).then(async()=>this.emit("tauri://created")).catch(async o=>this.emit("tauri://error",o))}static getByLabel(e){return _().some(n=>n.label===e)?new m(e,{skip:!0}):null}static getCurrent(){return V()}static getAll(){return _()}static async getFocusedWindow(){for(let e of _())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{let o=this.listeners[e];o.splice(o.indexOf(n),1)}):v(e,n,{target:this.label})}async once(e,n){return this._handleTauriEvent(e,n)?Promise.resolve(()=>{let o=this.listeners[e];o.splice(o.indexOf(n),1)}):E(e,n,{target:this.label})}async emit(e,n){if(U.includes(e)){for(let o of this.listeners[e]||[])o({event:e,id:-1,windowLabel:this.label,payload:n});return Promise.resolve()}return T(e,n,{target:this.label})}_handleTauriEvent(e,n){return U.includes(e)?(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0):!1}async scaleFactor(){return i("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return i("plugin:window|inner_position",{label:this.label}).then(({x:e,y:n})=>new d(e,n))}async outerPosition(){return i("plugin:window|outer_position",{label:this.label}).then(({x:e,y:n})=>new d(e,n))}async innerSize(){return i("plugin:window|inner_size",{label:this.label}).then(({width:e,height:n})=>new c(e,n))}async outerSize(){return i("plugin:window|outer_size",{label:this.label}).then(({width:e,height:n})=>new c(e,n))}async isFullscreen(){return i("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return i("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return i("plugin:window|is_maximized",{label:this.label})}async isFocused(){return i("plugin:window|is_focused",{label:this.label})}async isDecorated(){return i("plugin:window|is_decorated",{label:this.label})}async isResizable(){return i("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return i("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return i("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return i("plugin:window|is_closable",{label:this.label})}async isVisible(){return i("plugin:window|is_visible",{label:this.label})}async title(){return i("plugin:window|title",{label:this.label})}async theme(){return i("plugin:window|theme",{label:this.label})}async center(){return i("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(e===1?n={type:"Critical"}:n={type:"Informational"}),i("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return i("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return i("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return i("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return i("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return i("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return i("plugin:window|maximize",{label:this.label})}async unmaximize(){return i("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return i("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return i("plugin:window|minimize",{label:this.label})}async unminimize(){return i("plugin:window|unminimize",{label:this.label})}async show(){return i("plugin:window|show",{label:this.label})}async hide(){return i("plugin:window|hide",{label:this.label})}async close(){return i("plugin:window|close",{label:this.label})}async setDecorations(e){return i("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return i("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return i("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return i("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return i("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return i("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return i("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 i("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 i("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 i("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 i("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return i("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return i("plugin:window|set_focus",{label:this.label})}async setIcon(e){return i("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return i("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return i("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return i("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return i("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 i("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return i("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return i("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return i("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen("tauri://resize",n=>{n.payload=j(n.payload),e(n)})}async onMoved(e){return this.listen("tauri://move",n=>{n.payload=$(n.payload),e(n)})}async onCloseRequested(e){return this.listen("tauri://close-requested",n=>{let o=new f(n);Promise.resolve(e(o)).then(()=>{if(!o.isPreventDefault())return this.close()})})}async onFocusChanged(e){let n=await this.listen("tauri://focus",u=>{e({...u,payload:!0})}),o=await this.listen("tauri://blur",u=>{e({...u,payload:!1})});return()=>{n(),o()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let n=await this.listen("tauri://file-drop",l=>{e({...l,payload:{type:"drop",paths:l.payload}})}),o=await this.listen("tauri://file-drop-hover",l=>{e({...l,payload:{type:"hover",paths:l.payload}})}),u=await this.listen("tauri://file-drop-cancelled",l=>{e({...l,payload:{type:"cancel"}})});return()=>{n(),o(),u()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},G=(s=>(s.AppearanceBased="appearanceBased",s.Light="light",s.Dark="dark",s.MediumLight="mediumLight",s.UltraDark="ultraDark",s.Titlebar="titlebar",s.Selection="selection",s.Menu="menu",s.Popover="popover",s.Sidebar="sidebar",s.HeaderView="headerView",s.Sheet="sheet",s.WindowBackground="windowBackground",s.HudWindow="hudWindow",s.FullScreenUI="fullScreenUI",s.Tooltip="tooltip",s.ContentBackground="contentBackground",s.UnderWindowBackground="underWindowBackground",s.UnderPageBackground="underPageBackground",s.Mica="mica",s.Blur="blur",s.Acrylic="acrylic",s.Tabbed="tabbed",s.TabbedDark="tabbedDark",s.TabbedLight="tabbedLight",s))(G||{}),q=(o=>(o.FollowsWindowActiveState="followsWindowActiveState",o.Active="active",o.Inactive="inactive",o))(q||{});function R(t){return t===null?null:{name:t.name,scaleFactor:t.scaleFactor,position:$(t.position),size:j(t.size)}}function $(t){return new d(t.x,t.y)}function j(t){return new c(t.width,t.height)}async function se(){return i("plugin:window|current_monitor").then(R)}async function le(){return i("plugin:window|primary_monitor").then(R)}async function ae(){return i("plugin:window|available_monitors").then(t=>t.map(R))}var A={};p(A,{BaseDirectory:()=>Q,appCacheDir:()=>pe,appConfigDir:()=>ue,appDataDir:()=>ce,appLocalDataDir:()=>de,appLogDir:()=>ke,audioDir:()=>me,basename:()=>Me,cacheDir:()=>he,configDir:()=>be,dataDir:()=>ge,delimiter:()=>Ae,desktopDir:()=>ye,dirname:()=>Fe,documentDir:()=>we,downloadDir:()=>Pe,executableDir:()=>ve,extname:()=>Ue,fontDir:()=>_e,homeDir:()=>fe,isAbsolute:()=>He,join:()=>xe,localDataDir:()=>De,normalize:()=>Oe,pictureDir:()=>Ce,publicDir:()=>ze,resolve:()=>Ne,resolveResource:()=>Ie,resourceDir:()=>Le,runtimeDir:()=>Ee,sep:()=>Se,tempDir:()=>Re,templateDir:()=>Te,videoDir:()=>We});var Q=(r=>(r[r.Audio=1]="Audio",r[r.Cache=2]="Cache",r[r.Config=3]="Config",r[r.Data=4]="Data",r[r.LocalData=5]="LocalData",r[r.Document=6]="Document",r[r.Download=7]="Download",r[r.Picture=8]="Picture",r[r.Public=9]="Public",r[r.Video=10]="Video",r[r.Resource=11]="Resource",r[r.Temp=12]="Temp",r[r.AppConfig=13]="AppConfig",r[r.AppData=14]="AppData",r[r.AppLocalData=15]="AppLocalData",r[r.AppCache=16]="AppCache",r[r.AppLog=17]="AppLog",r[r.Desktop=18]="Desktop",r[r.Executable=19]="Executable",r[r.Font=20]="Font",r[r.Home=21]="Home",r[r.Runtime=22]="Runtime",r[r.Template=23]="Template",r))(Q||{});async function ue(){return i("plugin:path|resolve_directory",{directory:13})}async function ce(){return i("plugin:path|resolve_directory",{directory:14})}async function de(){return i("plugin:path|resolve_directory",{directory:15})}async function pe(){return i("plugin:path|resolve_directory",{directory:16})}async function me(){return i("plugin:path|resolve_directory",{directory:1})}async function he(){return i("plugin:path|resolve_directory",{directory:2})}async function be(){return i("plugin:path|resolve_directory",{directory:3})}async function ge(){return i("plugin:path|resolve_directory",{directory:4})}async function ye(){return i("plugin:path|resolve_directory",{directory:18})}async function we(){return i("plugin:path|resolve_directory",{directory:6})}async function Pe(){return i("plugin:path|resolve_directory",{directory:7})}async function ve(){return i("plugin:path|resolve_directory",{directory:19})}async function _e(){return i("plugin:path|resolve_directory",{directory:20})}async function fe(){return i("plugin:path|resolve_directory",{directory:21})}async function De(){return i("plugin:path|resolve_directory",{directory:5})}async function Ce(){return i("plugin:path|resolve_directory",{directory:8})}async function ze(){return i("plugin:path|resolve_directory",{directory:9})}async function Le(){return i("plugin:path|resolve_directory",{directory:11})}async function Ie(t){return i("plugin:path|resolve_directory",{directory:11,path:t})}async function Ee(){return i("plugin:path|resolve_directory",{directory:22})}async function Te(){return i("plugin:path|resolve_directory",{directory:23})}async function We(){return i("plugin:path|resolve_directory",{directory:10})}async function ke(){return i("plugin:path|resolve_directory",{directory:17})}async function Re(t){return i("plugin:path|resolve_directory",{directory:12})}function Se(){return window.__TAURI_INTERNALS__.plugins.path.sep}function Ae(){return window.__TAURI_INTERNALS__.plugins.path.delimiter}async function Ne(...t){return i("plugin:path|resolve",{paths:t})}async function Oe(t){return i("plugin:path|normalize",{path:t})}async function xe(...t){return i("plugin:path|join",{paths:t})}async function Fe(t){return i("plugin:path|dirname",{path:t})}async function Ue(t){return i("plugin:path|extname",{path:t})}async function Me(t,e){return i("plugin:path|basename",{path:t,ext:e})}async function He(t){return i("plugin:path|isAbsolute",{path:t})}return X(Ve);})(); window.__TAURI__ = __TAURI_IIFE__ diff --git a/core/tauri/src/test/mock_runtime.rs b/core/tauri/src/test/mock_runtime.rs index adfe8228bfd3..d704a47368ee 100644 --- a/core/tauri/src/test/mock_runtime.rs +++ b/core/tauri/src/test/mock_runtime.rs @@ -283,6 +283,10 @@ impl WindowBuilder for MockWindowBuilder { self } + fn always_on_bottom(self, always_on_bottom: bool) -> Self { + self + } + fn always_on_top(self, always_on_top: bool) -> Self { self } @@ -600,6 +604,10 @@ impl Dispatch for MockDispatcher { Ok(()) } + fn set_always_on_bottom(&self, always_on_bottom: bool) -> Result<()> { + Ok(()) + } + fn set_always_on_top(&self, always_on_top: bool) -> Result<()> { Ok(()) } diff --git a/core/tauri/src/window/mod.rs b/core/tauri/src/window/mod.rs index 8a358c012901..a2e8bb4cc362 100644 --- a/core/tauri/src/window/mod.rs +++ b/core/tauri/src/window/mod.rs @@ -614,6 +614,13 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> { self } + /// Whether the window should always be below other windows. + #[must_use] + pub fn always_on_bottom(mut self, always_on_bottom: bool) -> Self { + self.window_builder = self.window_builder.always_on_bottom(always_on_bottom); + self + } + /// Whether the window should always be on top of other windows. #[must_use] pub fn always_on_top(mut self, always_on_top: bool) -> Self { @@ -1880,6 +1887,15 @@ impl Window { }) } + /// Determines if this window should always be below other windows. + pub fn set_always_on_bottom(&self, always_on_bottom: bool) -> crate::Result<()> { + self + .window + .dispatcher + .set_always_on_bottom(always_on_bottom) + .map_err(Into::into) + } + /// Determines if this window should always be on top of other windows. pub fn set_always_on_top(&self, always_on_top: bool) -> crate::Result<()> { self diff --git a/core/tauri/src/window/plugin.rs b/core/tauri/src/window/plugin.rs index f9c56d4665b7..705f083e5b9e 100644 --- a/core/tauri/src/window/plugin.rs +++ b/core/tauri/src/window/plugin.rs @@ -140,6 +140,7 @@ mod desktop_commands { setter!(set_shadow, bool); setter!(set_effects, Option); setter!(set_always_on_top, bool); + setter!(set_always_on_bottom, bool); setter!(set_content_protected, bool); setter!(set_size, Size); setter!(set_min_size, Option); @@ -290,6 +291,7 @@ pub fn init() -> TauriPlugin { desktop_commands::set_shadow, desktop_commands::set_effects, desktop_commands::set_always_on_top, + desktop_commands::set_always_on_bottom, desktop_commands::set_content_protected, desktop_commands::set_size, desktop_commands::set_min_size, diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index c77ff47b7794..0857d7393fe4 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,40 +1,41 @@ -var Zs=Object.defineProperty;var xs=(e,t,i)=>t in e?Zs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var ft=(e,t,i)=>(xs(e,typeof t!="symbol"?t+"":t,i),i);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const _ of r.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&l(_)}).observe(document,{childList:!0,subtree:!0});function i(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function l(s){if(s.ep)return;s.ep=!0;const r=i(s);fetch(s.href,r)}})();function $(){}function Is(e){return e()}function os(){return Object.create(null)}function Fe(e){e.forEach(Is)}function Os(e){return typeof e=="function"}function Ct(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Li;function $s(e,t){return e===t?!0:(Li||(Li=document.createElement("a")),Li.href=t,e===Li.href)}function eo(e){return Object.keys(e).length===0}function to(e,...t){if(e==null){for(const l of t)l(void 0);return $}const i=e.subscribe(...t);return i.unsubscribe?()=>i.unsubscribe():i}function no(e,t,i){e.$$.on_destroy.push(to(t,i))}function n(e,t){e.appendChild(t)}function w(e,t,i){e.insertBefore(t,i||null)}function m(e){e.parentNode&&e.parentNode.removeChild(e)}function St(e,t){for(let i=0;ie.removeEventListener(t,i,l)}function as(e){return function(t){return t.preventDefault(),e.call(this,t)}}function a(e,t,i){i==null?e.removeAttribute(t):e.getAttribute(t)!==i&&e.setAttribute(t,i)}function F(e){return e===""?null:+e}function lo(e){return Array.from(e.childNodes)}function ne(e,t){t=""+t,e.data!==t&&(e.data=t)}function C(e,t){e.value=t??""}function Yt(e,t,i,l){i==null?e.style.removeProperty(t):e.style.setProperty(t,i,l?"important":"")}function Xe(e,t,i){for(let l=0;le.indexOf(l)===-1?t.push(l):i.push(l)),i.forEach(l=>l()),Zt=t}const Ei=new Set;let Et;function co(){Et={r:0,c:[],p:Et}}function fo(){Et.r||Fe(Et.c),Et=Et.p}function ol(e,t){e&&e.i&&(Ei.delete(e),e.i(t))}function cs(e,t,i,l){if(e&&e.o){if(Ei.has(e))return;Ei.add(e),Et.c.push(()=>{Ei.delete(e),l&&(i&&e.d(1),l())}),e.o(t)}else l&&l()}function Ee(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function ds(e){e&&e.c()}function al(e,t,i){const{fragment:l,after_update:s}=e.$$;l&&l.m(t,i),pt(()=>{const r=e.$$.on_mount.map(Is).filter(Os);e.$$.on_destroy?e.$$.on_destroy.push(...r):Fe(r),e.$$.on_mount=[]}),s.forEach(pt)}function rl(e,t){const i=e.$$;i.fragment!==null&&(uo(i.after_update),Fe(i.on_destroy),i.fragment&&i.fragment.d(t),i.on_destroy=i.fragment=null,i.ctx=[])}function ho(e,t){e.$$.dirty[0]===-1&&(Qt.push(e),ao(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const M=E.length?E[0]:K;return d.ctx&&s(d.ctx[k],d.ctx[k]=M)&&(!d.skip_bound&&d.bound[k]&&d.bound[k](M),I&&ho(e,k)),K}):[],d.update(),I=!0,Fe(d.before_update),d.fragment=l?l(d.ctx):!1,t.target){if(t.hydrate){const k=lo(t.target);d.fragment&&d.fragment.l(k),k.forEach(m)}else d.fragment&&d.fragment.c();t.intro&&ol(e.$$.fragment),al(e,t.target,t.anchor),Rs()}vn(b)}class $t{constructor(){ft(this,"$$");ft(this,"$$set")}$destroy(){rl(this,1),this.$destroy=$}$on(t,i){if(!Os(i))return $;const l=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return l.push(i),()=>{const s=l.indexOf(i);s!==-1&&l.splice(s,1)}}$set(t){this.$$set&&!eo(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const po="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(po);const Jt=[];function bo(e,t=$){let i;const l=new Set;function s(h){if(Ct(e,h)&&(e=h,i)){const b=!Jt.length;for(const d of l)d[1](),Jt.push(d,e);if(b){for(let d=0;d{l.delete(d),l.size===0&&i&&(i(),i=null)}}return{set:s,update:r,subscribe:_}}var go=Object.defineProperty,Ln=(e,t)=>{for(var i in t)go(e,i,{get:t[i],enumerable:!0})},Ds=(e,t,i)=>{if(!t.has(e))throw TypeError("Cannot "+i)},fs=(e,t,i)=>(Ds(e,t,"read from private field"),i?i.call(e):t.get(e)),_o=(e,t,i)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,i)},mo=(e,t,i,l)=>(Ds(e,t,"write to private field"),l?l.call(e,i):t.set(e,i),i),wo={};Ln(wo,{Channel:()=>Hs,PluginListener:()=>Us,addPluginListener:()=>vo,convertFileSrc:()=>yo,invoke:()=>g,transformCallback:()=>cl});function cl(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}var wn,Hs=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,_o(this,wn,()=>{}),this.id=cl(t=>{fs(this,wn).call(this,t)})}set onmessage(t){mo(this,wn,t)}get onmessage(){return fs(this,wn)}toJSON(){return`__CHANNEL__:${this.id}`}};wn=new WeakMap;var Us=class{constructor(t,i,l){this.plugin=t,this.event=i,this.channelId=l}async unregister(){return g(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function vo(e,t,i){let l=new Hs;return l.onmessage=i,g(`plugin:${e}|register_listener`,{event:t,handler:l}).then(()=>new Us(e,t,l.id))}async function g(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}function yo(e,t="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,t)}var ko={};Ln(ko,{getName:()=>Fs,getTauriVersion:()=>js,getVersion:()=>qs,hide:()=>Vs,show:()=>Bs});async function qs(){return g("plugin:app|version")}async function Fs(){return g("plugin:app|name")}async function js(){return g("plugin:app|tauri_version")}async function Bs(){return g("plugin:app|app_show")}async function Vs(){return g("plugin:app|app_hide")}function zo(e){let t,i,l,s,r,_,h,b,d,I,k,K,E,M,A,W,se,H,R,V,G,P,j,oe;return{c(){t=o("div"),i=o("p"),i.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 to=Object.defineProperty;var no=(e,t,l)=>t in e?to(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l;var ft=(e,t,l)=>(no(e,typeof t!="symbol"?t+"":t,l),l);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const _ of r.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&i(_)}).observe(document,{childList:!0,subtree:!0});function l(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=l(s);fetch(s.href,r)}})();function ee(){}function Rs(e){return e()}function cs(){return Object.create(null)}function Fe(e){e.forEach(Rs)}function Ds(e){return typeof e=="function"}function Pt(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Cl;function lo(e,t){return e===t?!0:(Cl||(Cl=document.createElement("a")),Cl.href=t,e===Cl.href)}function io(e){return Object.keys(e).length===0}function so(e,...t){if(e==null){for(const i of t)i(void 0);return ee}const l=e.subscribe(...t);return l.unsubscribe?()=>l.unsubscribe():l}function oo(e,t,l){e.$$.on_destroy.push(so(t,l))}function n(e,t){e.appendChild(t)}function w(e,t,l){e.insertBefore(t,l||null)}function m(e){e.parentNode&&e.parentNode.removeChild(e)}function Ct(e,t){for(let l=0;le.removeEventListener(t,l,i)}function ds(e){return function(t){return t.preventDefault(),e.call(this,t)}}function a(e,t,l){l==null?e.removeAttribute(t):e.getAttribute(t)!==l&&e.setAttribute(t,l)}function B(e){return e===""?null:+e}function ro(e){return Array.from(e.childNodes)}function se(e,t){t=""+t,e.data!==t&&(e.data=t)}function T(e,t){e.value=t??""}function Jt(e,t,l,i){l==null?e.style.removeProperty(t):e.style.setProperty(t,l,i?"important":"")}function Ye(e,t,l){for(let i=0;ie.indexOf(i)===-1?t.push(i):l.push(i)),l.forEach(i=>i()),$t=t}const Pl=new Set;let St;function bo(){St={r:0,c:[],p:St}}function go(){St.r||Fe(St.c),St=St.p}function ci(e,t){e&&e.i&&(Pl.delete(e),e.i(t))}function ps(e,t,l,i){if(e&&e.o){if(Pl.has(e))return;Pl.add(e),St.c.push(()=>{Pl.delete(e),i&&(l&&e.d(1),i())}),e.o(t)}else i&&i()}function ye(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function bs(e){e&&e.c()}function di(e,t,l){const{fragment:i,after_update:s}=e.$$;i&&i.m(t,l),pt(()=>{const r=e.$$.on_mount.map(Rs).filter(Ds);e.$$.on_destroy?e.$$.on_destroy.push(...r):Fe(r),e.$$.on_mount=[]}),s.forEach(pt)}function fi(e,t){const l=e.$$;l.fragment!==null&&(po(l.after_update),Fe(l.on_destroy),l.fragment&&l.fragment.d(t),l.on_destroy=l.fragment=null,l.ctx=[])}function _o(e,t){e.$$.dirty[0]===-1&&(xt.push(e),fo(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const A=E.length?E[0]:Y;return d.ctx&&s(d.ctx[z],d.ctx[z]=A)&&(!d.skip_bound&&d.bound[z]&&d.bound[z](A),I&&_o(e,z)),Y}):[],d.update(),I=!0,Fe(d.before_update),d.fragment=i?i(d.ctx):!1,t.target){if(t.hydrate){const z=ro(t.target);d.fragment&&d.fragment.l(z),z.forEach(m)}else d.fragment&&d.fragment.c();t.intro&&ci(e.$$.fragment),di(e,t.target,t.anchor),qs()}kn(g)}class tn{constructor(){ft(this,"$$");ft(this,"$$set")}$destroy(){fi(this,1),this.$destroy=ee}$on(t,l){if(!Ds(l))return ee;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(l),()=>{const s=i.indexOf(l);s!==-1&&i.splice(s,1)}}$set(t){this.$$set&&!io(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const mo="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(mo);const Zt=[];function wo(e,t=ee){let l;const i=new Set;function s(h){if(Pt(e,h)&&(e=h,l)){const g=!Zt.length;for(const d of i)d[1](),Zt.push(d,e);if(g){for(let d=0;d{i.delete(d),i.size===0&&l&&(l(),l=null)}}return{set:s,update:r,subscribe:_}}var vo=Object.defineProperty,En=(e,t)=>{for(var l in t)vo(e,l,{get:t[l],enumerable:!0})},Bs=(e,t,l)=>{if(!t.has(e))throw TypeError("Cannot "+l)},gs=(e,t,l)=>(Bs(e,t,"read from private field"),l?l.call(e):t.get(e)),yo=(e,t,l)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,l)},ko=(e,t,l,i)=>(Bs(e,t,"write to private field"),i?i.call(e,l):t.set(e,l),l),zo={};En(zo,{Channel:()=>Fs,PluginListener:()=>js,addPluginListener:()=>Lo,convertFileSrc:()=>Eo,invoke:()=>b,transformCallback:()=>pi});function pi(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}var yn,Fs=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,yo(this,yn,()=>{}),this.id=pi(t=>{gs(this,yn).call(this,t)})}set onmessage(t){ko(this,yn,t)}get onmessage(){return gs(this,yn)}toJSON(){return`__CHANNEL__:${this.id}`}};yn=new WeakMap;var js=class{constructor(t,l,i){this.plugin=t,this.event=l,this.channelId=i}async unregister(){return b(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function Lo(e,t,l){let i=new Fs;return i.onmessage=l,b(`plugin:${e}|register_listener`,{event:t,handler:i}).then(()=>new js(e,t,i.id))}async function b(e,t={},l){return window.__TAURI_INTERNALS__.invoke(e,t,l)}function Eo(e,t="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,t)}var So={};En(So,{getName:()=>Gs,getTauriVersion:()=>Xs,getVersion:()=>Vs,hide:()=>Ks,show:()=>Ys});async function Vs(){return b("plugin:app|version")}async function Gs(){return b("plugin:app|name")}async function Xs(){return b("plugin:app|tauri_version")}async function Ys(){return b("plugin:app|app_show")}async function Ks(){return b("plugin:app|app_hide")}function Co(e){let t,l,i,s,r,_,h,g,d,I,z,Y,E,A,M,N,ae,H,W,V,G,P,F,re;return{c(){t=o("div"),l=o("p"),l.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=c(),s=o("br"),r=c(),_=o("br"),h=c(),b=o("pre"),d=p(" App name: "),I=o("code"),k=p(e[2]),K=p(` - App version: `),E=o("code"),M=p(e[0]),A=p(` - Tauri version: `),W=o("code"),se=p(e[1]),H=p(` - `),R=c(),V=o("br"),G=c(),P=o("button"),P.textContent="Context menu",a(P,"class","btn")},m(O,Z){w(O,t,Z),n(t,i),n(t,l),n(t,s),n(t,r),n(t,_),n(t,h),n(t,b),n(b,d),n(b,I),n(I,k),n(b,K),n(b,E),n(E,M),n(b,A),n(b,W),n(W,se),n(b,H),n(t,R),n(t,V),n(t,G),n(t,P),j||(oe=z(P,"click",e[3]),j=!0)},p(O,[Z]){Z&4&&ne(k,O[2]),Z&1&&ne(M,O[0]),Z&2&&ne(se,O[1])},i:$,o:$,d(O){O&&m(t),j=!1,oe()}}}function Lo(e,t,i){let l="1.0.0",s="1.0.0",r="Unknown";Fs().then(h=>{i(2,r=h)}),qs().then(h=>{i(0,l=h)}),js().then(h=>{i(1,s=h)});function _(){g("popup_context_menu")}return[l,s,r,_]}class Eo extends $t{constructor(t){super(),xt(this,t,Lo,zo,Ct,{})}}var So={};Ln(So,{TauriEvent:()=>Gs,emit:()=>dl,listen:()=>Mi,once:()=>Ys});var Gs=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e))(Gs||{});async function Xs(e,t){await g("plugin:event|unlisten",{event:e,eventId:t})}async function Mi(e,t,i){return g("plugin:event|listen",{event:e,windowLabel:i==null?void 0:i.target,handler:cl(t)}).then(l=>async()=>Xs(e,l))}async function Ys(e,t,i){return Mi(e,l=>{t(l),Xs(e,l.id).catch(()=>{})},i)}async function dl(e,t,i){await g("plugin:event|emit",{event:e,windowLabel:i==null?void 0:i.target,payload:t})}function Co(e){let t,i,l,s,r,_,h,b;return{c(){t=o("div"),i=o("button"),i.textContent="Call Log API",l=c(),s=o("button"),s.textContent="Call Request (async) API",r=c(),_=o("button"),_.textContent="Send event to Rust",a(i,"class","btn"),a(i,"id","log"),a(s,"class","btn"),a(s,"id","request"),a(_,"class","btn"),a(_,"id","event")},m(d,I){w(d,t,I),n(t,i),n(t,l),n(t,s),n(t,r),n(t,_),h||(b=[z(i,"click",e[0]),z(s,"click",e[1]),z(_,"click",e[2])],h=!0)},p:$,i:$,o:$,d(d){d&&m(t),h=!1,Fe(b)}}}function Po(e,t,i){let{onMessage:l}=t,s;Ci(async()=>{s=await Mi("rust-event",l)}),Ws(()=>{s&&s()});function r(){g("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function _(){g("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(l).catch(l)}function h(){dl("js-event","this is the payload string")}return e.$$set=b=>{"onMessage"in b&&i(3,l=b.onMessage)},[r,_,h,l]}class To extends $t{constructor(t){super(),xt(this,t,Po,Co,Ct,{onMessage:3})}}var Mo={};Ln(Mo,{LogicalPosition:()=>fl,LogicalSize:()=>zn,PhysicalPosition:()=>Ze,PhysicalSize:()=>ht});var zn=class{constructor(e,t){this.type="Logical",this.width=e,this.height=t}},ht=class{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new zn(this.width/e,this.height/e)}},fl=class{constructor(t,i){this.type="Logical",this.x=t,this.y=i}},Ze=class{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new fl(this.x/e,this.y/e)}},Ao={};Ln(Ao,{CloseRequestedEvent:()=>Ks,Effect:()=>Pi,EffectState:()=>Ti,LogicalPosition:()=>fl,LogicalSize:()=>zn,PhysicalPosition:()=>Ze,PhysicalSize:()=>ht,ProgressBarStatus:()=>yn,UserAttentionType:()=>hl,Window:()=>En,availableMonitors:()=>No,currentMonitor:()=>Io,getAll:()=>Si,getCurrent:()=>pl,primaryMonitor:()=>Oo});var hl=(e=>(e[e.Critical=1]="Critical",e[e.Informational=2]="Informational",e))(hl||{}),Ks=class{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}},yn=(e=>(e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error",e))(yn||{});function pl(){return new En(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function Si(){return window.__TAURI_INTERNALS__.metadata.windows.map(e=>new En(e.label,{skip:!0}))}var hs=["tauri://created","tauri://error"],En=class{constructor(e,t={}){this.label=e,this.listeners=Object.create(null),t!=null&&t.skip||g("plugin:window|create",{options:{...t,label:e}}).then(async()=>this.emit("tauri://created")).catch(async i=>this.emit("tauri://error",i))}static getByLabel(e){return Si().some(t=>t.label===e)?new En(e,{skip:!0}):null}static getCurrent(){return pl()}static getAll(){return Si()}static async getFocusedWindow(){for(let e of Si())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let i=this.listeners[e];i.splice(i.indexOf(t),1)}):Mi(e,t,{target:this.label})}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let i=this.listeners[e];i.splice(i.indexOf(t),1)}):Ys(e,t,{target:this.label})}async emit(e,t){if(hs.includes(e)){for(let i of this.listeners[e]||[])i({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return dl(e,t,{target:this.label})}_handleTauriEvent(e,t){return hs.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}async scaleFactor(){return g("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return g("plugin:window|inner_position",{label:this.label}).then(({x:e,y:t})=>new Ze(e,t))}async outerPosition(){return g("plugin:window|outer_position",{label:this.label}).then(({x:e,y:t})=>new Ze(e,t))}async innerSize(){return g("plugin:window|inner_size",{label:this.label}).then(({width:e,height:t})=>new ht(e,t))}async outerSize(){return g("plugin:window|outer_size",{label:this.label}).then(({width:e,height:t})=>new ht(e,t))}async isFullscreen(){return g("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return g("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return g("plugin:window|is_maximized",{label:this.label})}async isFocused(){return g("plugin:window|is_focused",{label:this.label})}async isDecorated(){return g("plugin:window|is_decorated",{label:this.label})}async isResizable(){return g("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return g("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return g("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return g("plugin:window|is_closable",{label:this.label})}async isVisible(){return g("plugin:window|is_visible",{label:this.label})}async title(){return g("plugin:window|title",{label:this.label})}async theme(){return g("plugin:window|theme",{label:this.label})}async center(){return g("plugin:window|center",{label:this.label})}async requestUserAttention(e){let t=null;return e&&(e===1?t={type:"Critical"}:t={type:"Informational"}),g("plugin:window|request_user_attention",{label:this.label,value:t})}async setResizable(e){return g("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return g("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return g("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return g("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return g("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return g("plugin:window|maximize",{label:this.label})}async unmaximize(){return g("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return g("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return g("plugin:window|minimize",{label:this.label})}async unminimize(){return g("plugin:window|unminimize",{label:this.label})}async show(){return g("plugin:window|show",{label:this.label})}async hide(){return g("plugin:window|hide",{label:this.label})}async close(){return g("plugin:window|close",{label:this.label})}async setDecorations(e){return g("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return g("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return g("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return g("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return g("plugin:window|set_always_on_top",{label:this.label,value:e})}async setContentProtected(e){return g("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 g("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 g("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 g("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 g("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return g("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return g("plugin:window|set_focus",{label:this.label})}async setIcon(e){return g("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return g("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return g("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return g("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return g("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 g("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return g("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return g("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return g("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen("tauri://resize",t=>{t.payload=Qs(t.payload),e(t)})}async onMoved(e){return this.listen("tauri://move",t=>{t.payload=Js(t.payload),e(t)})}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let i=new Ks(t);Promise.resolve(e(i)).then(()=>{if(!i.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",l=>{e({...l,payload:!0})}),i=await this.listen("tauri://blur",l=>{e({...l,payload:!1})});return()=>{t(),i()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",s=>{e({...s,payload:{type:"drop",paths:s.payload}})}),i=await this.listen("tauri://file-drop-hover",s=>{e({...s,payload:{type:"hover",paths:s.payload}})}),l=await this.listen("tauri://file-drop-cancelled",s=>{e({...s,payload:{type:"cancel"}})});return()=>{t(),i(),l()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},Pi=(e=>(e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight",e))(Pi||{}),Ti=(e=>(e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive",e))(Ti||{});function bl(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:Js(e.position),size:Qs(e.size)}}function Js(e){return new Ze(e.x,e.y)}function Qs(e){return new ht(e.width,e.height)}async function Io(){return g("plugin:window|current_monitor").then(bl)}async function Oo(){return g("plugin:window|primary_monitor").then(bl)}async function No(){return g("plugin:window|available_monitors").then(e=>e.map(bl))}function ps(e,t,i){const l=e.slice();return l[103]=t[i],l}function bs(e,t,i){const l=e.slice();return l[106]=t[i],l}function gs(e,t,i){const l=e.slice();return l[109]=t[i],l}function _s(e,t,i){const l=e.slice();return l[112]=t[i],l}function ms(e,t,i){const l=e.slice();return l[115]=t[i],l}function ws(e){let t,i,l,s,r,_,h=Ee(Object.keys(e[1])),b=[];for(let d=0;de[58].call(l))},m(d,I){w(d,t,I),w(d,i,I),w(d,l,I),n(l,s);for(let k=0;ke[81].call(Je)),a(ut,"class","input"),a(ut,"type","number"),a(ct,"class","input"),a(ct,"type","number"),a(Ke,"class","flex gap-2"),a(dt,"class","input grow"),a(dt,"id","title"),a(bn,"class","btn"),a(bn,"type","submit"),a(zt,"class","flex gap-1"),a(pn,"class","flex flex-col gap-1"),a(Qe,"class","input"),e[25]===void 0&&pt(()=>e[85].call(Qe)),a(Ge,"class","input"),a(Ge,"type","number"),a(Ge,"min","0"),a(Ge,"max","100"),a(Vt,"class","flex gap-2"),a(gn,"class","flex flex-col gap-1")},m(u,f){w(u,t,f),w(u,i,f),w(u,l,f),n(l,s),n(l,r),n(l,_),n(_,h),C(h,e[42]),n(_,b),n(_,d),w(u,I,f),w(u,k,f),w(u,K,f),w(u,E,f),n(E,M),n(E,A),n(E,W),n(E,se),n(E,H),n(E,R),n(E,V),w(u,G,f),w(u,P,f),n(P,j),n(j,oe),n(j,O),O.checked=e[6],n(P,Z),n(P,ae),n(ae,y),n(ae,q),q.checked=e[2],n(P,B),n(P,X),n(X,re),n(X,ie),ie.checked=e[3],n(P,_e),n(P,ve),n(ve,ue),n(ve,ce),ce.checked=e[4],n(P,Y),n(P,he),n(he,U),n(he,ee),ee.checked=e[5],n(P,J),n(P,v),n(v,Q),n(v,S),S.checked=e[7],n(P,de),n(P,ze),n(ze,Le),n(ze,pe),pe.checked=e[8],n(P,Oe),n(P,Se),n(Se,Ne),n(Se,be),be.checked=e[9],n(P,ge),n(P,Ce),n(Ce,Pe),n(Ce,fe),fe.checked=e[10],w(u,Te,f),w(u,le,f),w(u,Me,f),w(u,me,f),n(me,we),n(we,te),n(te,L),n(te,x),C(x,e[17]),n(we,T),n(we,Ae),n(Ae,Sn),n(Ae,We),C(We,e[18]),n(me,Cn),n(me,xe),n(xe,Pt),n(Pt,Pn),n(Pt,Re),C(Re,e[11]),n(xe,Tn),n(xe,Tt),n(Tt,Mn),n(Tt,De),C(De,e[12]),n(me,An),n(me,$e),n($e,Mt),n(Mt,In),n(Mt,je),C(je,e[13]),n($e,On),n($e,At),n(At,Nn),n(At,Be),C(Be,e[14]),n(me,Wn),n(me,et),n(et,It),n(It,Rn),n(It,He),C(He,e[15]),n(et,Dn),n(et,Ot),n(Ot,Hn),n(Ot,Ue),C(Ue,e[16]),w(u,en,f),w(u,tn,f),w(u,nn,f),w(u,Ie,f),n(Ie,tt),n(tt,Ve),n(Ve,Nt),n(Ve,Un),n(Ve,N),n(N,ln),n(N,Wt),n(Ve,sn),n(Ve,gt),n(gt,on),n(gt,Rt),n(tt,an),n(tt,qe),n(qe,mt),n(qe,rn),n(qe,wt),n(wt,un),n(wt,Dt),n(qe,cn),n(qe,yt),n(yt,dn),n(yt,Ht),n(Ie,fn),n(Ie,nt),n(nt,it),n(it,qn),n(it,gl),n(it,Fn),n(Fn,_l),n(Fn,Ai),n(it,ml),n(it,Bn),n(Bn,wl),n(Bn,Ii),n(nt,vl),n(nt,lt),n(lt,Gn),n(lt,yl),n(lt,Xn),n(Xn,kl),n(Xn,Oi),n(lt,zl),n(lt,Kn),n(Kn,Ll),n(Kn,Ni),n(Ie,El),n(Ie,Ut),n(Ut,st),n(st,Qn),n(st,Sl),n(st,Zn),n(Zn,Cl),n(Zn,Wi),n(st,Pl),n(st,$n),n($n,Tl),n($n,Ri),n(Ut,Ml),n(Ut,ot),n(ot,ti),n(ot,Al),n(ot,ni),n(ni,Il),n(ni,Di),n(ot,Ol),n(ot,li),n(li,Nl),n(li,Hi),n(Ie,Wl),n(Ie,qt),n(qt,at),n(at,oi),n(at,Rl),n(at,ai),n(ai,Dl),n(ai,Ui),n(at,Hl),n(at,ui),n(ui,Ul),n(ui,qi),n(qt,ql),n(qt,rt),n(rt,di),n(rt,Fl),n(rt,fi),n(fi,jl),n(fi,Fi),n(rt,Bl),n(rt,pi),n(pi,Vl),n(pi,ji),w(u,Bi,f),w(u,Vi,f),w(u,Gi,f),w(u,hn,f),w(u,Xi,f),w(u,Ye,f),n(Ye,gi),n(gi,Ft),Ft.checked=e[19],n(gi,Gl),n(Ye,Xl),n(Ye,_i),n(_i,jt),jt.checked=e[20],n(_i,Yl),n(Ye,Kl),n(Ye,mi),n(mi,Bt),Bt.checked=e[24],n(mi,Jl),w(u,Yi,f),w(u,Ke,f),n(Ke,wi),n(wi,Ql),n(wi,Je);for(let D=0;De[87].call(r)),a(d,"class","input"),e[36]===void 0&&pt(()=>e[88].call(d)),a(E,"class","input"),a(E,"type","number"),a(i,"class","flex"),Yt(R,"max-width","120px"),a(R,"class","input"),a(R,"type","number"),a(R,"placeholder","R"),Yt(G,"max-width","120px"),a(G,"class","input"),a(G,"type","number"),a(G,"placeholder","G"),Yt(j,"max-width","120px"),a(j,"class","input"),a(j,"type","number"),a(j,"placeholder","B"),Yt(O,"max-width","120px"),a(O,"class","input"),a(O,"type","number"),a(O,"placeholder","A"),a(H,"class","flex"),a(A,"class","flex"),a(y,"class","btn"),Yt(y,"width","80px"),a(ae,"class","flex"),a(ue,"class","btn"),Yt(ue,"width","80px"),a(B,"class","flex"),a(t,"class","flex flex-col gap-1")},m(v,Q){w(v,t,Q),n(t,i),n(i,l),n(l,s),n(l,r);for(let S=0;S=1,I,k,K,E=d&&ws(e),M=e[1][e[0]]&&ys(e);return{c(){t=o("div"),i=o("div"),l=o("input"),s=c(),r=o("button"),r.textContent="New window",_=c(),h=o("br"),b=c(),E&&E.c(),I=c(),M&&M.c(),a(l,"class","input grow"),a(l,"type","text"),a(l,"placeholder","New Window label.."),a(r,"class","btn"),a(i,"class","flex gap-1"),a(t,"class","flex flex-col children:grow gap-2")},m(A,W){w(A,t,W),n(t,i),n(i,l),C(l,e[27]),n(i,s),n(i,r),n(t,_),n(t,h),n(t,b),E&&E.m(t,null),n(t,I),M&&M.m(t,null),k||(K=[z(l,"input",e[57]),z(r,"click",e[52])],k=!0)},p(A,W){W[0]&134217728&&l.value!==A[27]&&C(l,A[27]),W[0]&2&&(d=Object.keys(A[1]).length>=1),d?E?E.p(A,W):(E=ws(A),E.c(),E.m(t,I)):E&&(E.d(1),E=null),A[1][A[0]]?M?M.p(A,W):(M=ys(A),M.c(),M.m(t,null)):M&&(M.d(1),M=null)},i:$,o:$,d(A){A&&m(t),E&&E.d(),M&&M.d(),k=!1,Fe(K)}}}function Do(e,t,i){const l=pl();let s=l.label;const r={[l.label]:l},_=["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"],h=["mica","blur","acrylic","tabbed","tabbedDark","tabbedLight"],b=navigator.appVersion.includes("Windows"),d=navigator.appVersion.includes("Macintosh");let I=b?h:Object.keys(Pi).map(N=>Pi[N]).filter(N=>!h.includes(N));const k=Object.keys(Ti).map(N=>Ti[N]),K=Object.keys(yn).map(N=>yn[N]);let{onMessage:E}=t;const M=document.querySelector("main");let A,W=!0,se=!0,H=!0,R=!0,V=!1,G=!0,P=!1,j=!0,oe=!1,O=null,Z=null,ae=null,y=null,q=null,B=null,X=null,re=null,ie=1,_e=new Ze(X,re),ve=new Ze(X,re),ue=new ht(O,Z),ce=new ht(O,Z),Y,he,U=!1,ee=!0,J=null,v=null,Q="default",S=!1,de="Awesome Tauri Example!",ze=[],Le,pe,Oe,Se,Ne,be,ge,Ce="none",Pe=0,fe;function Te(){r[s].setTitle(de)}function le(){r[s].hide(),setTimeout(r[s].show,2e3)}function Me(){r[s].minimize(),setTimeout(r[s].unminimize,2e3)}function me(){if(!A)return;const N=new En(A);i(1,r[A]=N,r),N.once("tauri://error",function(){E("Error creating new webview")})}function we(){r[s].innerSize().then(N=>{i(31,ue=N),i(11,O=ue.width),i(12,Z=ue.height)}),r[s].outerSize().then(N=>{i(32,ce=N)})}function te(){r[s].innerPosition().then(N=>{i(29,_e=N)}),r[s].outerPosition().then(N=>{i(30,ve=N),i(17,X=ve.x),i(18,re=ve.y)})}async function L(N){N&&(Y&&Y(),he&&he(),he=await N.listen("tauri://move",te),Y=await N.listen("tauri://resize",we))}async function x(){await r[s].minimize(),await r[s].requestUserAttention(hl.Critical),await new Promise(N=>setTimeout(N,3e3)),await r[s].requestUserAttention(null)}async function T(){ze.includes(Le)||i(34,ze=[...ze,Le]);const N={effects:ze,state:pe,radius:Oe};Number.isInteger(Se)&&Number.isInteger(Ne)&&Number.isInteger(be)&&Number.isInteger(ge)&&(N.color=[Se,Ne,be,ge]),M.classList.remove("bg-primary"),M.classList.remove("dark:bg-darkPrimary"),await r[s].clearEffects(),await r[s].setEffects(N)}async function Ae(){i(34,ze=[]),await r[s].clearEffects(),M.classList.add("bg-primary"),M.classList.add("dark:bg-darkPrimary")}function Sn(){A=this.value,i(27,A)}function We(){s=mn(this),i(0,s),i(1,r)}function Cn(){fe=this.value,i(42,fe)}const xe=()=>r[s].center();function Pt(){V=this.checked,i(6,V)}function Pn(){W=this.checked,i(2,W)}function Re(){se=this.checked,i(3,se)}function Tn(){H=this.checked,i(4,H)}function Tt(){R=this.checked,i(5,R)}function Mn(){G=this.checked,i(7,G)}function De(){P=this.checked,i(8,P)}function An(){j=this.checked,i(9,j)}function $e(){oe=this.checked,i(10,oe)}function Mt(){X=F(this.value),i(17,X)}function In(){re=F(this.value),i(18,re)}function je(){O=F(this.value),i(11,O)}function On(){Z=F(this.value),i(12,Z)}function At(){ae=F(this.value),i(13,ae)}function Nn(){y=F(this.value),i(14,y)}function Be(){q=F(this.value),i(15,q)}function Wn(){B=F(this.value),i(16,B)}function et(){U=this.checked,i(19,U)}function It(){ee=this.checked,i(20,ee)}function Rn(){S=this.checked,i(24,S)}function He(){Q=mn(this),i(23,Q),i(43,_)}function Dn(){J=F(this.value),i(21,J)}function Ot(){v=F(this.value),i(22,v)}function Hn(){de=this.value,i(33,de)}function Ue(){Ce=mn(this),i(25,Ce),i(48,K)}function en(){Pe=F(this.value),i(26,Pe)}function tn(){Le=mn(this),i(35,Le),i(46,I)}function nn(){pe=mn(this),i(36,pe),i(47,k)}function Ie(){Oe=F(this.value),i(37,Oe)}function tt(){Se=F(this.value),i(38,Se)}function Ve(){Ne=F(this.value),i(39,Ne)}function Nt(){be=F(this.value),i(40,be)}function Un(){ge=F(this.value),i(41,ge)}return e.$$set=N=>{"onMessage"in N&&i(56,E=N.onMessage)},e.$$.update=()=>{var N,ln,bt,Wt,sn,gt,on,_t,Rt,an,qe,mt,rn,wt,un,vt,Dt,cn,yt,dn,kt,Ht,fn;e.$$.dirty[0]&3&&(r[s],te(),we()),e.$$.dirty[0]&7&&((N=r[s])==null||N.setResizable(W)),e.$$.dirty[0]&11&&((ln=r[s])==null||ln.setMaximizable(se)),e.$$.dirty[0]&19&&((bt=r[s])==null||bt.setMinimizable(H)),e.$$.dirty[0]&35&&((Wt=r[s])==null||Wt.setClosable(R)),e.$$.dirty[0]&67&&(V?(sn=r[s])==null||sn.maximize():(gt=r[s])==null||gt.unmaximize()),e.$$.dirty[0]&131&&((on=r[s])==null||on.setDecorations(G)),e.$$.dirty[0]&259&&((_t=r[s])==null||_t.setAlwaysOnTop(P)),e.$$.dirty[0]&515&&((Rt=r[s])==null||Rt.setContentProtected(j)),e.$$.dirty[0]&1027&&((an=r[s])==null||an.setFullscreen(oe)),e.$$.dirty[0]&6147&&O&&Z&&((qe=r[s])==null||qe.setSize(new ht(O,Z))),e.$$.dirty[0]&24579&&(ae&&y?(mt=r[s])==null||mt.setMinSize(new zn(ae,y)):(rn=r[s])==null||rn.setMinSize(null)),e.$$.dirty[0]&98307&&(q>800&&B>400?(wt=r[s])==null||wt.setMaxSize(new zn(q,B)):(un=r[s])==null||un.setMaxSize(null)),e.$$.dirty[0]&393219&&X!==null&&re!==null&&((vt=r[s])==null||vt.setPosition(new Ze(X,re))),e.$$.dirty[0]&3&&((Dt=r[s])==null||Dt.scaleFactor().then(nt=>i(28,ie=nt))),e.$$.dirty[0]&3&&L(r[s]),e.$$.dirty[0]&524291&&((cn=r[s])==null||cn.setCursorGrab(U)),e.$$.dirty[0]&1048579&&((yt=r[s])==null||yt.setCursorVisible(ee)),e.$$.dirty[0]&8388611&&((dn=r[s])==null||dn.setCursorIcon(Q)),e.$$.dirty[0]&6291459&&J!==null&&v!==null&&((kt=r[s])==null||kt.setCursorPosition(new Ze(J,v))),e.$$.dirty[0]&16777219&&((Ht=r[s])==null||Ht.setIgnoreCursorEvents(S)),e.$$.dirty[0]&100663299&&((fn=r[s])==null||fn.setProgressBar({status:yn[Ce],progress:Pe}))},[s,r,W,se,H,R,V,G,P,j,oe,O,Z,ae,y,q,B,X,re,U,ee,J,v,Q,S,Ce,Pe,A,ie,_e,ve,ue,ce,de,ze,Le,pe,Oe,Se,Ne,be,ge,fe,_,b,d,I,k,K,Te,le,Me,me,x,T,Ae,E,Sn,We,Cn,xe,Pt,Pn,Re,Tn,Tt,Mn,De,An,$e,Mt,In,je,On,At,Nn,Be,Wn,et,It,Rn,He,Dn,Ot,Hn,Ue,en,tn,nn,Ie,tt,Ve,Nt,Un]}class Ho extends $t{constructor(t){super(),xt(this,t,Do,Ro,Ct,{onMessage:56},null,[-1,-1,-1,-1])}}function Uo(e){let t;return{c(){t=o("div"),t.innerHTML='
Not available for Linux
',a(t,"class","flex flex-col gap-2")},m(i,l){w(i,t,l)},p:$,i:$,o:$,d(i){i&&m(t)}}}function qo(e,t,i){let{onMessage:l}=t;const s=window.constraints={audio:!0,video:!0};function r(h){const b=document.querySelector("video"),d=h.getVideoTracks();l("Got stream with constraints:",s),l(`Using video device: ${d[0].label}`),window.stream=h,b.srcObject=h}function _(h){if(h.name==="ConstraintNotSatisfiedError"){const b=s.video;l(`The resolution ${b.width.exact}x${b.height.exact} px is not supported by your device.`)}else h.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: ${h.name}`,h)}return Ci(async()=>{try{const h=await navigator.mediaDevices.getUserMedia(s);r(h)}catch(h){_(h)}}),Ws(()=>{window.stream.getTracks().forEach(function(h){h.stop()})}),e.$$set=h=>{"onMessage"in h&&i(0,l=h.onMessage)},[l]}class Fo extends $t{constructor(t){super(),xt(this,t,qo,Uo,Ct,{onMessage:0})}}function jo(e){let t,i,l,s,r,_;return{c(){t=o("div"),i=o("button"),i.textContent="Show",l=c(),s=o("button"),s.textContent="Hide",a(i,"class","btn"),a(i,"id","show"),a(i,"title","Hides and shows the app after 2 seconds"),a(s,"class","btn"),a(s,"id","hide")},m(h,b){w(h,t,b),n(t,i),n(t,l),n(t,s),r||(_=[z(i,"click",e[0]),z(s,"click",e[1])],r=!0)},p:$,i:$,o:$,d(h){h&&m(t),r=!1,Fe(_)}}}function Bo(e,t,i){let{onMessage:l}=t;function s(){r().then(()=>{setTimeout(()=>{Bs().then(()=>l("Shown app")).catch(l)},2e3)}).catch(l)}function r(){return Vs().then(()=>l("Hide app")).catch(l)}return e.$$set=_=>{"onMessage"in _&&i(2,l=_.onMessage)},[s,r,l]}class Vo extends $t{constructor(t){super(),xt(this,t,Bo,jo,Ct,{onMessage:2})}}function Ss(e,t,i){const l=e.slice();return l[25]=t[i],l}function Cs(e,t,i){const l=e.slice();return l[28]=t[i],l}function Go(e){let t;return{c(){t=o("span"),a(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(i,l){w(i,t,l)},d(i){i&&m(t)}}}function Xo(e){let t;return{c(){t=o("span"),a(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(i,l){w(i,t,l)},d(i){i&&m(t)}}}function Yo(e){let t,i;return{c(){t=p(`Switch to Dark mode - `),i=o("div"),a(i,"class","i-ph-moon")},m(l,s){w(l,t,s),w(l,i,s)},d(l){l&&(m(t),m(i))}}}function Ko(e){let t,i;return{c(){t=p(`Switch to Light mode - `),i=o("div"),a(i,"class","i-ph-sun")},m(l,s){w(l,t,s),w(l,i,s)},d(l){l&&(m(t),m(i))}}}function Jo(e){let t,i,l,s,r,_,h;function b(){return e[14](e[28])}return{c(){t=o("a"),i=o("div"),l=c(),s=o("p"),s.textContent=`${e[28].label}`,a(i,"class",e[28].icon+" mr-2"),a(t,"href","##"),a(t,"class",r="nv "+(e[1]===e[28]?"nv_selected":""))},m(d,I){w(d,t,I),n(t,i),n(t,l),n(t,s),_||(h=z(t,"click",b),_=!0)},p(d,I){e=d,I&2&&r!==(r="nv "+(e[1]===e[28]?"nv_selected":""))&&a(t,"class",r)},d(d){d&&m(t),_=!1,h()}}}function Ps(e){let t,i=e[28]&&Jo(e);return{c(){i&&i.c(),t=ul()},m(l,s){i&&i.m(l,s),w(l,t,s)},p(l,s){l[28]&&i.p(l,s)},d(l){l&&m(t),i&&i.d(l)}}}function Ts(e){let t,i=e[25].html+"",l;return{c(){t=new so(!1),l=ul(),t.a=l},m(s,r){t.m(i,s,r),w(s,l,r)},p(s,r){r&16&&i!==(i=s[25].html+"")&&t.p(i)},d(s){s&&(m(l),t.d())}}}function Qo(e){let t,i,l,s,r,_,h,b,d,I,k,K,E,M,A,W,se,H,R,V,G,P,j,oe,O,Z,ae,y,q,B,X,re,ie=e[1].label+"",_e,ve,ue,ce,Y,he,U,ee,J,v,Q,S,de,ze,Le,pe,Oe,Se;function Ne(L,x){return L[0]?Xo:Go}let be=Ne(e),ge=be(e);function Ce(L,x){return L[2]?Ko:Yo}let Pe=Ce(e),fe=Pe(e),Te=Ee(e[5]),le=[];for(let L=0;L`,se=c(),H=o("a"),H.innerHTML=`GitHub - `,R=c(),V=o("a"),V.innerHTML=`Source - `,G=c(),P=o("br"),j=c(),oe=o("div"),O=c(),Z=o("br"),ae=c(),y=o("div");for(let L=0;L',ze=c(),Le=o("div");for(let L=0;L{rl(T,1)}),fo()}Me?(Y=rs(Me,me(L)),ds(Y.$$.fragment),ol(Y.$$.fragment,1),al(Y,ce,null)):Y=null}if(x&16){we=Ee(L[4]);let T;for(T=0;T{y.ctrlKey&&y.key==="b"&&g("toggle_menu")});const s=navigator.userAgent.toLowerCase(),r=s.includes("android")||s.includes("iphone"),_=[{label:"Welcome",component:Eo,icon:"i-ph-hand-waving"},{label:"Communication",component:To,icon:"i-codicon-radio-tower"},!r&&{label:"App",component:Vo,icon:"i-codicon-hubot"},{label:"Window",component:Ho,icon:"i-codicon-window"},{label:"WebRTC",component:Fo,icon:"i-ph-broadcast"}];let h=_[0];function b(y){i(1,h=y)}let d;Ci(()=>{i(2,d=localStorage&&localStorage.getItem("theme")=="dark"),As(d)});function I(){i(2,d=!d),As(d)}let k=bo([]);no(e,k,y=>i(4,l=y));function K(y){k.update(q=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof y=="string"?y:JSON.stringify(y,null,1))+"
"},...q])}function E(y){k.update(q=>[{html:`
[${new Date().toLocaleTimeString()}]: `+y+"
"},...q])}function M(){k.update(()=>[])}let A,W,se;function H(y){se=y.clientY;const q=window.getComputedStyle(A);W=parseInt(q.height,10);const B=re=>{const ie=re.clientY-se,_e=W-ie;i(3,A.style.height=`${_e{document.removeEventListener("mouseup",X),document.removeEventListener("mousemove",B)};document.addEventListener("mouseup",X),document.addEventListener("mousemove",B)}let R=!1,V,G,P=!1,j=0,oe=0;const O=(y,q,B)=>Math.min(Math.max(q,y),B);Ci(()=>{i(13,V=document.querySelector("#sidebar")),G=document.querySelector("#sidebarToggle"),document.addEventListener("click",y=>{G.contains(y.target)?i(0,R=!R):R&&!V.contains(y.target)&&i(0,R=!1)}),document.addEventListener("touchstart",y=>{if(G.contains(y.target))return;const q=y.touches[0].clientX;(0{if(P){const q=y.touches[0].clientX;oe=q;const B=(q-j)/10;V.style.setProperty("--translate-x",`-${O(0,R?0-B:18.75-B,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(P){const y=(oe-j)/10;i(0,R=R?y>-(18.75/2):y>18.75/2)}P=!1})});const Z=y=>{b(y),i(0,R=!1)};function ae(y){ll[y?"unshift":"push"](()=>{A=y,i(3,A)})}return e.$$.update=()=>{if(e.$$.dirty&1){const y=document.querySelector("#sidebar");y&&Zo(y,R)}},[R,h,d,A,l,_,b,I,k,K,E,M,H,V,Z,ae]}class $o extends $t{constructor(t){super(),xt(this,t,xo,Qo,Ct,{})}}new $o({target:document.querySelector("#app")}); + tests.`,i=c(),s=o("br"),r=c(),_=o("br"),h=c(),g=o("pre"),d=p(" App name: "),I=o("code"),z=p(e[2]),Y=p(` + App version: `),E=o("code"),A=p(e[0]),M=p(` + Tauri version: `),N=o("code"),ae=p(e[1]),H=p(` + `),W=c(),V=o("br"),G=c(),P=o("button"),P.textContent="Context menu",a(P,"class","btn")},m(R,x){w(R,t,x),n(t,l),n(t,i),n(t,s),n(t,r),n(t,_),n(t,h),n(t,g),n(g,d),n(g,I),n(I,z),n(g,Y),n(g,E),n(E,A),n(g,M),n(g,N),n(N,ae),n(g,H),n(t,W),n(t,V),n(t,G),n(t,P),F||(re=k(P,"click",e[3]),F=!0)},p(R,[x]){x&4&&se(z,R[2]),x&1&&se(A,R[0]),x&2&&se(ae,R[1])},i:ee,o:ee,d(R){R&&m(t),F=!1,re()}}}function Po(e,t,l){let i="1.0.0",s="1.0.0",r="Unknown";Gs().then(h=>{l(2,r=h)}),Vs().then(h=>{l(0,i=h)}),Xs().then(h=>{l(1,s=h)});function _(){b("popup_context_menu")}return[i,s,r,_]}class To extends tn{constructor(t){super(),en(this,t,Po,Co,Pt,{})}}var Ao={};En(Ao,{TauriEvent:()=>Js,emit:()=>bi,listen:()=>Nl,once:()=>Zs});var Js=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e))(Js||{});async function Qs(e,t){await b("plugin:event|unlisten",{event:e,eventId:t})}async function Nl(e,t,l){return b("plugin:event|listen",{event:e,windowLabel:l==null?void 0:l.target,handler:pi(t)}).then(i=>async()=>Qs(e,i))}async function Zs(e,t,l){return Nl(e,i=>{t(i),Qs(e,i.id).catch(()=>{})},l)}async function bi(e,t,l){await b("plugin:event|emit",{event:e,windowLabel:l==null?void 0:l.target,payload:t})}function Mo(e){let t,l,i,s,r,_,h,g;return{c(){t=o("div"),l=o("button"),l.textContent="Call Log API",i=c(),s=o("button"),s.textContent="Call Request (async) API",r=c(),_=o("button"),_.textContent="Send event to Rust",a(l,"class","btn"),a(l,"id","log"),a(s,"class","btn"),a(s,"id","request"),a(_,"class","btn"),a(_,"id","event")},m(d,I){w(d,t,I),n(t,l),n(t,i),n(t,s),n(t,r),n(t,_),h||(g=[k(l,"click",e[0]),k(s,"click",e[1]),k(_,"click",e[2])],h=!0)},p:ee,i:ee,o:ee,d(d){d&&m(t),h=!1,Fe(g)}}}function Io(e,t,l){let{onMessage:i}=t,s;Al(async()=>{s=await Nl("rust-event",i)}),Us(()=>{s&&s()});function r(){b("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function _(){b("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function h(){bi("js-event","this is the payload string")}return e.$$set=g=>{"onMessage"in g&&l(3,i=g.onMessage)},[r,_,h,i]}class Oo extends tn{constructor(t){super(),en(this,t,Io,Mo,Pt,{onMessage:3})}}var No={};En(No,{LogicalPosition:()=>gi,LogicalSize:()=>Ln,PhysicalPosition:()=>xe,PhysicalSize:()=>ht});var Ln=class{constructor(e,t){this.type="Logical",this.width=e,this.height=t}},ht=class{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new Ln(this.width/e,this.height/e)}},gi=class{constructor(t,l){this.type="Logical",this.x=t,this.y=l}},xe=class{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new gi(this.x/e,this.y/e)}},Wo={};En(Wo,{CloseRequestedEvent:()=>xs,Effect:()=>Il,EffectState:()=>Ol,LogicalPosition:()=>gi,LogicalSize:()=>Ln,PhysicalPosition:()=>xe,PhysicalSize:()=>ht,ProgressBarStatus:()=>Ml,UserAttentionType:()=>_i,Window:()=>Sn,availableMonitors:()=>Ho,currentMonitor:()=>Ro,getAll:()=>Tl,getCurrent:()=>mi,primaryMonitor:()=>Do});var _i=(e=>(e[e.Critical=1]="Critical",e[e.Informational=2]="Informational",e))(_i||{}),xs=class{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}},Ml=(e=>(e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error",e))(Ml||{});function mi(){return new Sn(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}function Tl(){return window.__TAURI_INTERNALS__.metadata.windows.map(e=>new Sn(e.label,{skip:!0}))}var _s=["tauri://created","tauri://error"],Sn=class{constructor(e,t={}){this.label=e,this.listeners=Object.create(null),t!=null&&t.skip||b("plugin:window|create",{options:{...t,label:e}}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static getByLabel(e){return Tl().some(t=>t.label===e)?new Sn(e,{skip:!0}):null}static getCurrent(){return mi()}static getAll(){return Tl()}static async getFocusedWindow(){for(let e of Tl())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let l=this.listeners[e];l.splice(l.indexOf(t),1)}):Nl(e,t,{target:this.label})}async once(e,t){return this._handleTauriEvent(e,t)?Promise.resolve(()=>{let l=this.listeners[e];l.splice(l.indexOf(t),1)}):Zs(e,t,{target:this.label})}async emit(e,t){if(_s.includes(e)){for(let l of this.listeners[e]||[])l({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return bi(e,t,{target:this.label})}_handleTauriEvent(e,t){return _s.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}async scaleFactor(){return b("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return b("plugin:window|inner_position",{label:this.label}).then(({x:e,y:t})=>new xe(e,t))}async outerPosition(){return b("plugin:window|outer_position",{label:this.label}).then(({x:e,y:t})=>new xe(e,t))}async innerSize(){return b("plugin:window|inner_size",{label:this.label}).then(({width:e,height:t})=>new ht(e,t))}async outerSize(){return b("plugin:window|outer_size",{label:this.label}).then(({width:e,height:t})=>new ht(e,t))}async isFullscreen(){return b("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return b("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return b("plugin:window|is_maximized",{label:this.label})}async isFocused(){return b("plugin:window|is_focused",{label:this.label})}async isDecorated(){return b("plugin:window|is_decorated",{label:this.label})}async isResizable(){return b("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return b("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return b("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return b("plugin:window|is_closable",{label:this.label})}async isVisible(){return b("plugin:window|is_visible",{label:this.label})}async title(){return b("plugin:window|title",{label:this.label})}async theme(){return b("plugin:window|theme",{label:this.label})}async center(){return b("plugin:window|center",{label:this.label})}async requestUserAttention(e){let t=null;return e&&(e===1?t={type:"Critical"}:t={type:"Informational"}),b("plugin:window|request_user_attention",{label:this.label,value:t})}async setResizable(e){return b("plugin:window|set_resizable",{label:this.label,value:e})}async setMaximizable(e){return b("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return b("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return b("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return b("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return b("plugin:window|maximize",{label:this.label})}async unmaximize(){return b("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return b("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return b("plugin:window|minimize",{label:this.label})}async unminimize(){return b("plugin:window|unminimize",{label:this.label})}async show(){return b("plugin:window|show",{label:this.label})}async hide(){return b("plugin:window|hide",{label:this.label})}async close(){return b("plugin:window|close",{label:this.label})}async setDecorations(e){return b("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return b("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return b("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return b("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return b("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return b("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return b("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 b("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 b("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 b("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 b("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return b("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return b("plugin:window|set_focus",{label:this.label})}async setIcon(e){return b("plugin:window|set_icon",{label:this.label,value:typeof e=="string"?e:Array.from(e)})}async setSkipTaskbar(e){return b("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return b("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return b("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return b("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 b("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return b("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return b("plugin:window|start_dragging",{label:this.label})}async setProgressBar(e){return b("plugin:window|set_progress_bar",{label:this.label,value:e})}async onResized(e){return this.listen("tauri://resize",t=>{t.payload=eo(t.payload),e(t)})}async onMoved(e){return this.listen("tauri://move",t=>{t.payload=$s(t.payload),e(t)})}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let l=new xs(t);Promise.resolve(e(l)).then(()=>{if(!l.isPreventDefault())return this.close()})})}async onFocusChanged(e){let t=await this.listen("tauri://focus",i=>{e({...i,payload:!0})}),l=await this.listen("tauri://blur",i=>{e({...i,payload:!1})});return()=>{t(),l()}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let t=await this.listen("tauri://file-drop",s=>{e({...s,payload:{type:"drop",paths:s.payload}})}),l=await this.listen("tauri://file-drop-hover",s=>{e({...s,payload:{type:"hover",paths:s.payload}})}),i=await this.listen("tauri://file-drop-cancelled",s=>{e({...s,payload:{type:"cancel"}})});return()=>{t(),l(),i()}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},Il=(e=>(e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight",e))(Il||{}),Ol=(e=>(e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive",e))(Ol||{});function wi(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:$s(e.position),size:eo(e.size)}}function $s(e){return new xe(e.x,e.y)}function eo(e){return new ht(e.width,e.height)}async function Ro(){return b("plugin:window|current_monitor").then(wi)}async function Do(){return b("plugin:window|primary_monitor").then(wi)}async function Ho(){return b("plugin:window|available_monitors").then(e=>e.map(wi))}function ms(e,t,l){const i=e.slice();return i[105]=t[l],i}function ws(e,t,l){const i=e.slice();return i[108]=t[l],i}function vs(e,t,l){const i=e.slice();return i[111]=t[l],i}function ys(e,t,l){const i=e.slice();return i[114]=t[l],i}function ks(e,t,l){const i=e.slice();return i[117]=t[l],i}function zs(e){let t,l,i,s,r,_,h=ye(Object.keys(e[1])),g=[];for(let d=0;de[59].call(i))},m(d,I){w(d,t,I),w(d,l,I),w(d,i,I),n(i,s);for(let z=0;ze[83].call(Qe)),a(ut,"class","input"),a(ut,"type","number"),a(ct,"class","input"),a(ct,"type","number"),a(Je,"class","flex gap-2"),a(dt,"class","input grow"),a(dt,"id","title"),a(_n,"class","btn"),a(_n,"type","submit"),a(Lt,"class","flex gap-1"),a(gn,"class","flex flex-col gap-1"),a(Ze,"class","input"),e[26]===void 0&&pt(()=>e[87].call(Ze)),a(Xe,"class","input"),a(Xe,"type","number"),a(Xe,"min","0"),a(Xe,"max","100"),a(Xt,"class","flex gap-2"),a(mn,"class","flex flex-col gap-1")},m(u,f){w(u,t,f),w(u,l,f),w(u,i,f),n(i,s),n(i,r),n(i,_),n(_,h),T(h,e[43]),n(_,g),n(_,d),w(u,I,f),w(u,z,f),w(u,Y,f),w(u,E,f),n(E,A),n(E,M),n(E,N),n(E,ae),n(E,H),n(E,W),n(E,V),w(u,G,f),w(u,P,f),n(P,F),n(F,re),n(F,R),R.checked=e[6],n(P,x),n(P,te),n(te,y),n(te,U),U.checked=e[2],n(P,j),n(P,$),n($,ue),n($,K),K.checked=e[3],n(P,_e),n(P,ke),n(ke,de),n(ke,oe),oe.checked=e[4],n(P,J),n(P,he),n(he,q),n(he,ne),ne.checked=e[5],n(P,Z),n(P,v),n(v,X),n(v,S),S.checked=e[7],n(P,fe),n(P,Ee),n(Ee,me),n(Ee,pe),pe.checked=e[8],n(P,Me),n(P,Se),n(Se,Ie),n(Se,be),be.checked=e[9],n(P,ge),n(P,ze),n(ze,Ce),n(ze,ce),ce.checked=e[10],n(P,Le),n(P,le),n(le,Oe),n(le,Ne),Ne.checked=e[11],w(u,Pe,f),w(u,ie,f),w(u,L,f),w(u,Q,f),n(Q,C),n(C,Te),n(Te,Cn),n(Te,We),T(We,e[18]),n(C,Pn),n(C,Tt),n(Tt,Tn),n(Tt,Re),T(Re,e[19]),n(Q,An),n(Q,$e),n($e,At),n(At,Mn),n(At,De),T(De,e[12]),n($e,In),n($e,Mt),n(Mt,On),n(Mt,He),T(He,e[13]),n(Q,Nn),n(Q,et),n(et,It),n(It,Wn),n(It,je),T(je,e[14]),n(et,Rn),n(et,Ot),n(Ot,Dn),n(Ot,Ve),T(Ve,e[15]),n(Q,Hn),n(Q,tt),n(tt,Nt),n(Nt,Un),n(Nt,Ue),T(Ue,e[16]),n(tt,qn),n(tt,Wt),n(Wt,Bn),n(Wt,qe),T(qe,e[17]),w(u,nn,f),w(u,ln,f),w(u,sn,f),w(u,Ae,f),n(Ae,nt),n(nt,Ge),n(Ge,O),n(Ge,on),n(Ge,bt),n(bt,an),n(bt,Rt),n(Ge,rn),n(Ge,_t),n(_t,un),n(_t,Dt),n(nt,cn),n(nt,Be),n(Be,wt),n(Be,dn),n(Be,vt),n(vt,fn),n(vt,Ht),n(Be,hn),n(Be,kt),n(kt,pn),n(kt,Ut),n(Ae,Fn),n(Ae,qt),n(qt,lt),n(lt,jn),n(lt,vi),n(lt,Vn),n(Vn,yi),n(Vn,Wl),n(lt,ki),n(lt,Xn),n(Xn,zi),n(Xn,Rl),n(qt,Li),n(qt,it),n(it,Kn),n(it,Ei),n(it,Jn),n(Jn,Si),n(Jn,Dl),n(it,Ci),n(it,Zn),n(Zn,Pi),n(Zn,Hl),n(Ae,Ti),n(Ae,Bt),n(Bt,st),n(st,$n),n(st,Ai),n(st,el),n(el,Mi),n(el,Ul),n(st,Ii),n(st,nl),n(nl,Oi),n(nl,ql),n(Bt,Ni),n(Bt,ot),n(ot,il),n(ot,Wi),n(ot,sl),n(sl,Ri),n(sl,Bl),n(ot,Di),n(ot,al),n(al,Hi),n(al,Fl),n(Ae,Ui),n(Ae,Ft),n(Ft,at),n(at,ul),n(at,qi),n(at,cl),n(cl,Bi),n(cl,jl),n(at,Fi),n(at,fl),n(fl,ji),n(fl,Vl),n(Ft,Vi),n(Ft,rt),n(rt,pl),n(rt,Gi),n(rt,bl),n(bl,Xi),n(bl,Gl),n(rt,Yi),n(rt,_l),n(_l,Ki),n(_l,Xl),w(u,Yl,f),w(u,Kl,f),w(u,Jl,f),w(u,bn,f),w(u,Ql,f),w(u,Ke,f),n(Ke,wl),n(wl,jt),jt.checked=e[20],n(wl,Ji),n(Ke,Qi),n(Ke,vl),n(vl,Vt),Vt.checked=e[21],n(vl,Zi),n(Ke,xi),n(Ke,yl),n(yl,Gt),Gt.checked=e[25],n(yl,$i),w(u,Zl,f),w(u,Je,f),n(Je,kl),n(kl,es),n(kl,Qe);for(let D=0;De[89].call(r)),a(d,"class","input"),e[37]===void 0&&pt(()=>e[90].call(d)),a(E,"class","input"),a(E,"type","number"),a(l,"class","flex"),Jt(W,"max-width","120px"),a(W,"class","input"),a(W,"type","number"),a(W,"placeholder","R"),Jt(G,"max-width","120px"),a(G,"class","input"),a(G,"type","number"),a(G,"placeholder","G"),Jt(F,"max-width","120px"),a(F,"class","input"),a(F,"type","number"),a(F,"placeholder","B"),Jt(R,"max-width","120px"),a(R,"class","input"),a(R,"type","number"),a(R,"placeholder","A"),a(H,"class","flex"),a(M,"class","flex"),a(y,"class","btn"),Jt(y,"width","80px"),a(te,"class","flex"),a(de,"class","btn"),Jt(de,"width","80px"),a(j,"class","flex"),a(t,"class","flex flex-col gap-1")},m(v,X){w(v,t,X),n(t,l),n(l,i),n(i,s),n(i,r);for(let S=0;S=1,I,z,Y,E=d&&zs(e),A=e[1][e[0]]&&Es(e);return{c(){t=o("div"),l=o("div"),i=o("input"),s=c(),r=o("button"),r.textContent="New window",_=c(),h=o("br"),g=c(),E&&E.c(),I=c(),A&&A.c(),a(i,"class","input grow"),a(i,"type","text"),a(i,"placeholder","New Window label.."),a(r,"class","btn"),a(l,"class","flex gap-1"),a(t,"class","flex flex-col children:grow gap-2")},m(M,N){w(M,t,N),n(t,l),n(l,i),T(i,e[28]),n(l,s),n(l,r),n(t,_),n(t,h),n(t,g),E&&E.m(t,null),n(t,I),A&&A.m(t,null),z||(Y=[k(i,"input",e[58]),k(r,"click",e[53])],z=!0)},p(M,N){N[0]&268435456&&i.value!==M[28]&&T(i,M[28]),N[0]&2&&(d=Object.keys(M[1]).length>=1),d?E?E.p(M,N):(E=zs(M),E.c(),E.m(t,I)):E&&(E.d(1),E=null),M[1][M[0]]?A?A.p(M,N):(A=Es(M),A.c(),A.m(t,null)):A&&(A.d(1),A=null)},i:ee,o:ee,d(M){M&&m(t),E&&E.d(),A&&A.d(),z=!1,Fe(Y)}}}function Bo(e,t,l){const i=mi();let s=i.label;const r={[i.label]:i},_=["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"],h=["mica","blur","acrylic","tabbed","tabbedDark","tabbedLight"],g=navigator.appVersion.includes("Windows"),d=navigator.appVersion.includes("Macintosh");let I=g?h:Object.keys(Il).map(O=>Il[O]).filter(O=>!h.includes(O));const z=Object.keys(Ol).map(O=>Ol[O]),Y=Object.keys(Ml).map(O=>Ml[O]);let{onMessage:E}=t;const A=document.querySelector("main");let M,N=!0,ae=!0,H=!0,W=!0,V=!1,G=!0,P=!1,F=!1,re=!0,R=!1,x=null,te=null,y=null,U=null,j=null,$=null,ue=null,K=null,_e=1,ke=new xe(ue,K),de=new xe(ue,K),oe=new ht(x,te),J=new ht(x,te),he,q,ne=!1,Z=!0,v=null,X=null,S="default",fe=!1,Ee="Awesome Tauri Example!",me=[],pe,Me,Se,Ie,be,ge,ze,Ce="none",ce=0,Le;function le(){r[s].setTitle(Ee)}function Oe(){r[s].hide(),setTimeout(r[s].show,2e3)}function Ne(){r[s].minimize(),setTimeout(r[s].unminimize,2e3)}function Pe(){if(!M)return;const O=new Sn(M);l(1,r[M]=O,r),O.once("tauri://error",function(){E("Error creating new webview")})}function ie(){r[s].innerSize().then(O=>{l(32,oe=O),l(12,x=oe.width),l(13,te=oe.height)}),r[s].outerSize().then(O=>{l(33,J=O)})}function L(){r[s].innerPosition().then(O=>{l(30,ke=O)}),r[s].outerPosition().then(O=>{l(31,de=O),l(18,ue=de.x),l(19,K=de.y)})}async function Q(O){O&&(he&&he(),q&&q(),q=await O.listen("tauri://move",L),he=await O.listen("tauri://resize",ie))}async function C(){await r[s].minimize(),await r[s].requestUserAttention(_i.Critical),await new Promise(O=>setTimeout(O,3e3)),await r[s].requestUserAttention(null)}async function Te(){me.includes(pe)||l(35,me=[...me,pe]);const O={effects:me,state:Me,radius:Se};Number.isInteger(Ie)&&Number.isInteger(be)&&Number.isInteger(ge)&&Number.isInteger(ze)&&(O.color=[Ie,be,ge,ze]),A.classList.remove("bg-primary"),A.classList.remove("dark:bg-darkPrimary"),await r[s].clearEffects(),await r[s].setEffects(O)}async function Cn(){l(35,me=[]),await r[s].clearEffects(),A.classList.add("bg-primary"),A.classList.add("dark:bg-darkPrimary")}function We(){M=this.value,l(28,M)}function Pn(){s=vn(this),l(0,s),l(1,r)}function Tt(){Le=this.value,l(43,Le)}const Tn=()=>r[s].center();function Re(){V=this.checked,l(6,V)}function An(){N=this.checked,l(2,N)}function $e(){ae=this.checked,l(3,ae)}function At(){H=this.checked,l(4,H)}function Mn(){W=this.checked,l(5,W)}function De(){G=this.checked,l(7,G)}function In(){P=this.checked,l(8,P)}function Mt(){F=this.checked,l(9,F)}function On(){re=this.checked,l(10,re)}function He(){R=this.checked,l(11,R)}function Nn(){ue=B(this.value),l(18,ue)}function et(){K=B(this.value),l(19,K)}function It(){x=B(this.value),l(12,x)}function Wn(){te=B(this.value),l(13,te)}function je(){y=B(this.value),l(14,y)}function Rn(){U=B(this.value),l(15,U)}function Ot(){j=B(this.value),l(16,j)}function Dn(){$=B(this.value),l(17,$)}function Ve(){ne=this.checked,l(20,ne)}function Hn(){Z=this.checked,l(21,Z)}function tt(){fe=this.checked,l(25,fe)}function Nt(){S=vn(this),l(24,S),l(44,_)}function Un(){v=B(this.value),l(22,v)}function Ue(){X=B(this.value),l(23,X)}function qn(){Ee=this.value,l(34,Ee)}function Wt(){Ce=vn(this),l(26,Ce),l(49,Y)}function Bn(){ce=B(this.value),l(27,ce)}function qe(){pe=vn(this),l(36,pe),l(47,I)}function nn(){Me=vn(this),l(37,Me),l(48,z)}function ln(){Se=B(this.value),l(38,Se)}function sn(){Ie=B(this.value),l(39,Ie)}function Ae(){be=B(this.value),l(40,be)}function nt(){ge=B(this.value),l(41,ge)}function Ge(){ze=B(this.value),l(42,ze)}return e.$$set=O=>{"onMessage"in O&&l(57,E=O.onMessage)},e.$$.update=()=>{var O,on,bt,an,gt,Rt,rn,_t,un,mt,Dt,cn,Be,wt,dn,vt,fn,yt,Ht,hn,kt,pn,zt,Ut;e.$$.dirty[0]&3&&(r[s],L(),ie()),e.$$.dirty[0]&7&&((O=r[s])==null||O.setResizable(N)),e.$$.dirty[0]&11&&((on=r[s])==null||on.setMaximizable(ae)),e.$$.dirty[0]&19&&((bt=r[s])==null||bt.setMinimizable(H)),e.$$.dirty[0]&35&&((an=r[s])==null||an.setClosable(W)),e.$$.dirty[0]&67&&(V?(gt=r[s])==null||gt.maximize():(Rt=r[s])==null||Rt.unmaximize()),e.$$.dirty[0]&131&&((rn=r[s])==null||rn.setDecorations(G)),e.$$.dirty[0]&259&&((_t=r[s])==null||_t.setAlwaysOnTop(P)),e.$$.dirty[0]&515&&((un=r[s])==null||un.setAlwaysOnBottom(F)),e.$$.dirty[0]&1027&&((mt=r[s])==null||mt.setContentProtected(re)),e.$$.dirty[0]&2051&&((Dt=r[s])==null||Dt.setFullscreen(R)),e.$$.dirty[0]&12291&&x&&te&&((cn=r[s])==null||cn.setSize(new ht(x,te))),e.$$.dirty[0]&49155&&(y&&U?(Be=r[s])==null||Be.setMinSize(new Ln(y,U)):(wt=r[s])==null||wt.setMinSize(null)),e.$$.dirty[0]&196611&&(j>800&&$>400?(dn=r[s])==null||dn.setMaxSize(new Ln(j,$)):(vt=r[s])==null||vt.setMaxSize(null)),e.$$.dirty[0]&786435&&ue!==null&&K!==null&&((fn=r[s])==null||fn.setPosition(new xe(ue,K))),e.$$.dirty[0]&3&&((yt=r[s])==null||yt.scaleFactor().then(Fn=>l(29,_e=Fn))),e.$$.dirty[0]&3&&Q(r[s]),e.$$.dirty[0]&1048579&&((Ht=r[s])==null||Ht.setCursorGrab(ne)),e.$$.dirty[0]&2097155&&((hn=r[s])==null||hn.setCursorVisible(Z)),e.$$.dirty[0]&16777219&&((kt=r[s])==null||kt.setCursorIcon(S)),e.$$.dirty[0]&12582915&&v!==null&&X!==null&&((pn=r[s])==null||pn.setCursorPosition(new xe(v,X))),e.$$.dirty[0]&33554435&&((zt=r[s])==null||zt.setIgnoreCursorEvents(fe)),e.$$.dirty[0]&201326595&&((Ut=r[s])==null||Ut.setProgressBar({status:Ce,progress:ce}))},[s,r,N,ae,H,W,V,G,P,F,re,R,x,te,y,U,j,$,ue,K,ne,Z,v,X,S,fe,Ce,ce,M,_e,ke,de,oe,J,Ee,me,pe,Me,Se,Ie,be,ge,ze,Le,_,g,d,I,z,Y,le,Oe,Ne,Pe,C,Te,Cn,E,We,Pn,Tt,Tn,Re,An,$e,At,Mn,De,In,Mt,On,He,Nn,et,It,Wn,je,Rn,Ot,Dn,Ve,Hn,tt,Nt,Un,Ue,qn,Wt,Bn,qe,nn,ln,sn,Ae,nt,Ge]}class Fo extends tn{constructor(t){super(),en(this,t,Bo,qo,Pt,{onMessage:57},null,[-1,-1,-1,-1])}}function jo(e){let t;return{c(){t=o("div"),t.innerHTML='
Not available for Linux
',a(t,"class","flex flex-col gap-2")},m(l,i){w(l,t,i)},p:ee,i:ee,o:ee,d(l){l&&m(t)}}}function Vo(e,t,l){let{onMessage:i}=t;const s=window.constraints={audio:!0,video:!0};function r(h){const g=document.querySelector("video"),d=h.getVideoTracks();i("Got stream with constraints:",s),i(`Using video device: ${d[0].label}`),window.stream=h,g.srcObject=h}function _(h){if(h.name==="ConstraintNotSatisfiedError"){const g=s.video;i(`The resolution ${g.width.exact}x${g.height.exact} px is not supported by your device.`)}else h.name==="PermissionDeniedError"&&i("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.");i(`getUserMedia error: ${h.name}`,h)}return Al(async()=>{try{const h=await navigator.mediaDevices.getUserMedia(s);r(h)}catch(h){_(h)}}),Us(()=>{window.stream.getTracks().forEach(function(h){h.stop()})}),e.$$set=h=>{"onMessage"in h&&l(0,i=h.onMessage)},[i]}class Go extends tn{constructor(t){super(),en(this,t,Vo,jo,Pt,{onMessage:0})}}function Xo(e){let t,l,i,s,r,_;return{c(){t=o("div"),l=o("button"),l.textContent="Show",i=c(),s=o("button"),s.textContent="Hide",a(l,"class","btn"),a(l,"id","show"),a(l,"title","Hides and shows the app after 2 seconds"),a(s,"class","btn"),a(s,"id","hide")},m(h,g){w(h,t,g),n(t,l),n(t,i),n(t,s),r||(_=[k(l,"click",e[0]),k(s,"click",e[1])],r=!0)},p:ee,i:ee,o:ee,d(h){h&&m(t),r=!1,Fe(_)}}}function Yo(e,t,l){let{onMessage:i}=t;function s(){r().then(()=>{setTimeout(()=>{Ys().then(()=>i("Shown app")).catch(i)},2e3)}).catch(i)}function r(){return Ks().then(()=>i("Hide app")).catch(i)}return e.$$set=_=>{"onMessage"in _&&l(2,i=_.onMessage)},[s,r,i]}class Ko extends tn{constructor(t){super(),en(this,t,Yo,Xo,Pt,{onMessage:2})}}function As(e,t,l){const i=e.slice();return i[25]=t[l],i}function Ms(e,t,l){const i=e.slice();return i[28]=t[l],i}function Jo(e){let t;return{c(){t=o("span"),a(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(l,i){w(l,t,i)},d(l){l&&m(t)}}}function Qo(e){let t;return{c(){t=o("span"),a(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(l,i){w(l,t,i)},d(l){l&&m(t)}}}function Zo(e){let t,l;return{c(){t=p(`Switch to Dark mode + `),l=o("div"),a(l,"class","i-ph-moon")},m(i,s){w(i,t,s),w(i,l,s)},d(i){i&&(m(t),m(l))}}}function xo(e){let t,l;return{c(){t=p(`Switch to Light mode + `),l=o("div"),a(l,"class","i-ph-sun")},m(i,s){w(i,t,s),w(i,l,s)},d(i){i&&(m(t),m(l))}}}function $o(e){let t,l,i,s,r,_,h;function g(){return e[14](e[28])}return{c(){t=o("a"),l=o("div"),i=c(),s=o("p"),s.textContent=`${e[28].label}`,a(l,"class",e[28].icon+" mr-2"),a(t,"href","##"),a(t,"class",r="nv "+(e[1]===e[28]?"nv_selected":""))},m(d,I){w(d,t,I),n(t,l),n(t,i),n(t,s),_||(h=k(t,"click",g),_=!0)},p(d,I){e=d,I&2&&r!==(r="nv "+(e[1]===e[28]?"nv_selected":""))&&a(t,"class",r)},d(d){d&&m(t),_=!1,h()}}}function Is(e){let t,l=e[28]&&$o(e);return{c(){l&&l.c(),t=hi()},m(i,s){l&&l.m(i,s),w(i,t,s)},p(i,s){i[28]&&l.p(i,s)},d(i){i&&m(t),l&&l.d(i)}}}function Os(e){let t,l=e[25].html+"",i;return{c(){t=new uo(!1),i=hi(),t.a=i},m(s,r){t.m(l,s,r),w(s,i,r)},p(s,r){r&16&&l!==(l=s[25].html+"")&&t.p(l)},d(s){s&&(m(i),t.d())}}}function ea(e){let t,l,i,s,r,_,h,g,d,I,z,Y,E,A,M,N,ae,H,W,V,G,P,F,re,R,x,te,y,U,j,$,ue,K=e[1].label+"",_e,ke,de,oe,J,he,q,ne,Z,v,X,S,fe,Ee,me,pe,Me,Se;function Ie(L,Q){return L[0]?Qo:Jo}let be=Ie(e),ge=be(e);function ze(L,Q){return L[2]?xo:Zo}let Ce=ze(e),ce=Ce(e),Le=ye(e[5]),le=[];for(let L=0;L`,ae=c(),H=o("a"),H.innerHTML=`GitHub + `,W=c(),V=o("a"),V.innerHTML=`Source + `,G=c(),P=o("br"),F=c(),re=o("div"),R=c(),x=o("br"),te=c(),y=o("div");for(let L=0;L',Ee=c(),me=o("div");for(let L=0;L{fi(C,1)}),go()}Oe?(J=fs(Oe,Ne(L)),bs(J.$$.fragment),ci(J.$$.fragment,1),di(J,oe,null)):J=null}if(Q&16){Pe=ye(L[4]);let C;for(C=0;C{y.ctrlKey&&y.key==="b"&&b("toggle_menu")});const s=navigator.userAgent.toLowerCase(),r=s.includes("android")||s.includes("iphone"),_=[{label:"Welcome",component:To,icon:"i-ph-hand-waving"},{label:"Communication",component:Oo,icon:"i-codicon-radio-tower"},!r&&{label:"App",component:Ko,icon:"i-codicon-hubot"},{label:"Window",component:Fo,icon:"i-codicon-window"},{label:"WebRTC",component:Go,icon:"i-ph-broadcast"}];let h=_[0];function g(y){l(1,h=y)}let d;Al(()=>{l(2,d=localStorage&&localStorage.getItem("theme")=="dark"),Ws(d)});function I(){l(2,d=!d),Ws(d)}let z=wo([]);oo(e,z,y=>l(4,i=y));function Y(y){z.update(U=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof y=="string"?y:JSON.stringify(y,null,1))+"
"},...U])}function E(y){z.update(U=>[{html:`
[${new Date().toLocaleTimeString()}]: `+y+"
"},...U])}function A(){z.update(()=>[])}let M,N,ae;function H(y){ae=y.clientY;const U=window.getComputedStyle(M);N=parseInt(U.height,10);const j=ue=>{const K=ue.clientY-ae,_e=N-K;l(3,M.style.height=`${_e{document.removeEventListener("mouseup",$),document.removeEventListener("mousemove",j)};document.addEventListener("mouseup",$),document.addEventListener("mousemove",j)}let W=!1,V,G,P=!1,F=0,re=0;const R=(y,U,j)=>Math.min(Math.max(U,y),j);Al(()=>{l(13,V=document.querySelector("#sidebar")),G=document.querySelector("#sidebarToggle"),document.addEventListener("click",y=>{G.contains(y.target)?l(0,W=!W):W&&!V.contains(y.target)&&l(0,W=!1)}),document.addEventListener("touchstart",y=>{if(G.contains(y.target))return;const U=y.touches[0].clientX;(0{if(P){const U=y.touches[0].clientX;re=U;const j=(U-F)/10;V.style.setProperty("--translate-x",`-${R(0,W?0-j:18.75-j,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(P){const y=(re-F)/10;l(0,W=W?y>-(18.75/2):y>18.75/2)}P=!1})});const x=y=>{g(y),l(0,W=!1)};function te(y){ri[y?"unshift":"push"](()=>{M=y,l(3,M)})}return e.$$.update=()=>{if(e.$$.dirty&1){const y=document.querySelector("#sidebar");y&&ta(y,W)}},[W,h,d,M,i,_,g,I,z,Y,E,A,H,V,x,te]}class la extends tn{constructor(t){super(),en(this,t,na,ea,Pt,{})}}new la({target:document.querySelector("#app")}); diff --git a/examples/api/src/views/Window.svelte b/examples/api/src/views/Window.svelte index 646d238800e9..e07954149718 100644 --- a/examples/api/src/views/Window.svelte +++ b/examples/api/src/views/Window.svelte @@ -95,6 +95,7 @@ let maximized = false let decorations = true let alwaysOnTop = false + let alwaysOnBottom = false let contentProtected = true let fullscreen = false let width = null @@ -248,6 +249,7 @@ : windowMap[selectedWindow]?.unmaximize() $: windowMap[selectedWindow]?.setDecorations(decorations) $: windowMap[selectedWindow]?.setAlwaysOnTop(alwaysOnTop) + $: windowMap[selectedWindow]?.setAlwaysOnBottom(alwaysOnBottom) $: windowMap[selectedWindow]?.setContentProtected(contentProtected) $: windowMap[selectedWindow]?.setFullscreen(fullscreen) @@ -373,6 +375,10 @@ Always on top +