1import{SERIALIZE_TO_IPC_FN as a,Resource as O,invoke as i}from"./core-DhEqZVGG.js";import{listen as S,once as L,emit as P,emitTo as k,TauriEvent as o}from"./event-CnyWr2tN.js";class x{constructor(...e){this.type="Logical",e.length===1?"Logical"in e[0]?(this.width=e[0].Logical.width,this.height=e[0].Logical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toPhysical(e){return new c(this.width*e,this.height*e)}[a](){return{width:this.width,height:this.height}}toJSON(){return this[a]()}}class c{constructor(...e){this.type="Physical",e.length===1?"Physical"in e[0]?(this.width=e[0].Physical.width,this.height=e[0].Physical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toLogical(e){return new x(this.width/e,this.height/e)}[a](){return{width:this.width,height:this.height}}toJSON(){return this[a]()}}class h{constructor(e){this.size=e}toLogical(e){return this.size instanceof x?this.size:this.size.toLogical(e)}toPhysical(e){return this.size instanceof c?this.size:this.size.toPhysical(e)}[a](){return{[`${this.size.type}`]:{width:this.size.width,height:this.size.height}}}toJSON(){return this[a]()}}class D{constructor(...e){this.type="Logical",e.length===1?"Logical"in e[0]?(this.x=e[0].Logical.x,this.y=e[0].Logical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toPhysical(e){return new u(this.x*e,this.y*e)}[a](){return{x:this.x,y:this.y}}toJSON(){return this[a]()}}class u{constructor(...e){this.type="Physical",e.length===1?"Physical"in e[0]?(this.x=e[0].Physical.x,this.y=e[0].Physical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toLogical(e){return new D(this.x/e,this.y/e)}[a](){return{x:this.x,y:this.y}}toJSON(){return this[a]()}}class w{constructor(e){this.position=e}toLogical(e){return this.position instanceof D?this.position:this.position.toLogical(e)}toPhysical(e){return this.position instanceof u?this.position:this.position.toPhysical(e)}[a](){return{[`${this.position.type}`]:{x:this.position.x,y:this.position.y}}}toJSON(){return this[a]()}}class d extends O{constructor(e){super(e)}static async new(e,n,l){return i("plugin:image|new",{rgba:b(e),width:n,height:l}).then(r=>new d(r))}static async fromBytes(e){return i("plugin:image|from_bytes",{bytes:b(e)}).then(n=>new d(n))}static async fromPath(e){return i("plugin:image|from_path",{path:e}).then(n=>new d(n))}async rgba(){return i("plugin:image|rgba",{rid:this.rid}).then(e=>new Uint8Array(e))}async size(){return i("plugin:image|size",{rid:this.rid})}}function b(t){return t==null?null:typeof t=="string"?t:t instanceof d?t.rid:t}var g;(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(g||(g={}));class T{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}var _;(function(t){t.None="none",t.Normal="normal",t.Indeterminate="indeterminate",t.Paused="paused",t.Error="error"})(_||(_={}));function A(){return new W(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}async function y(){return i("plugin:window|get_all_windows").then(t=>t.map(e=>new W(e,{skip:!0})))}const p=["tauri://created","tauri://error"];class W{constructor(e,n={}){var l;this.label=e,this.listeners=Object.create(null),n?.skip||i("plugin:window|create",{options:{...n,parent:typeof n.parent=="string"?n.parent:(l=n.parent)===null||l===void 0?void 0:l.label,label:e}}).then(async()=>
1this.emit("tauri://created")).catch(async r=>this.emit("tauri://error",r))}static async getByLabel(e){var n;return(n=(await y()).find(l=>l.label===e))!==null&&n!==void 0?n:null}static getCurrent(){return A()}static async getAll(){return y()}static async getFocusedWindow(){for(const e of await y())if(await e.isFocused())return e;return null}async listen(e,n){return this._handleTauriEvent(e,n)?()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}:S(e,n,{target:{kind:"Window",label:this.label}})}async once(e,n){return this._handleTauriEvent(e,n)?()=>{const l=this.listeners[e];l.splice(l.indexOf(n),1)}:L(e,n,{target:{kind:"Window",label:this.label}})}async emit(e,n){if(p.includes(e)){for(const l of this.listeners[e]||[])l({event:e,id:-1,payload:n});return}return P(e,n)}async emitTo(e,n,l){if(p.includes(n)){for(const r of this.listeners[n]||[])r({event:n,id:-1,payload:l});return}return k(e,n,l)}_handleTauriEvent(e,n){return p.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(e=>new u(e))}async outerPosition(){return i("plugin:window|outer_position",{label:this.label}).then(e=>new u(e))}async innerSize(){return i("plugin:window|inner_size",{label:this.label}).then(e=>new c(e))}async outerSize(){return i("plugin:window|outer_size",{label:this.label}).then(e=>new c(e))}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 isAlwaysOnTop(){return i("plugin:window|is_always_on_top",{label:this.label})}async center(){return i("plugin:window|center",{label:this.label})}async requestUserAttention(e){let n=null;return e&&(e===g.Critical?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 setEnabled(e){return i("plugin:window|set_enabled",{label:this.label,value:e})}async isEnabled(){return i("plugin:window|is_enabled",{label:this.label})}async setMaximizable(e){return i("plugin:window|set_maximizable",{label:this.label,value:e})}
1async 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 destroy(){return i("plugin:window|destroy",{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){return i("plugin:window|set_size",{label:this.label,value:e instanceof h?e:new h(e)})}async setMinSize(e){return i("plugin:window|set_min_size",{label:this.label,value:e instanceof h?e:e?new h(e):null})}async setMaxSize(e){return i("plugin:window|set_max_size",{label:this.label,value:e instanceof h?e:e?new h(e):null})}async setSizeConstraints(e){function n(l){return l?{Logical:l}:null}return i("plugin:window|set_size_constraints",{label:this.label,value:{minWidth:n(e?.minWidth),minHeight:n(e?.minHeight),maxWidth:n(e?.maxWidth),maxHeight:n(e?.maxHeight)}})}async setPosition(e){return i("plugin:window|set_position",{label:this.label,value:e instanceof w?e:new w(e)})}async setFullscreen(e){return i("plugin:window|set_fullscreen",{label:this.label,value:e})}async setSimpleFullscreen(e){return i("plugin:window|set_simple_fullscreen",{label:this.label,value:e})}async setFocus(){return i("plugin:window|set_focus",{label:this.label})}async setFocusable(e){return i("plugin:window|set_focusable",{label:this.label,value:e})}async setIcon(e){return i("plugin:window|set_icon",{label:this.label,value:b(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 setBackgroundColor(e){return i("plugin:window|set_background_color",{color:e})}async setCursorPosition(e){return i("plugin:window|set_cursor_position",{label:this.label,value:e instanceof w?e:new w(e)})}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 startResizeDragging(e){return i("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setBadgeCount(e){return i("plugin:window|set_badge_count",{label:this.label,value:e})}async setBadgeLabel(e){return i("plugin:window|set_badge_label",{label:this.label,value:e})}async setOverlayIcon(e){return i("plugin:window|set_overlay_icon",{label:this.label,value:e?b(e):void 0})}async setProgressBar(e){return i("plugin:window|set_progress_bar",{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return i("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:e})}async setTitleBarStyle(e){return i("plugin:window|set_title_bar_style",{label:this.label,value:e})}async setTheme(e){return i("plugin:window|set_theme",{label:this.label,value:e})}async onResized(e){return this.listen(o.WINDOW_RESIZED,n=>{n.payload=new c(n.payload),e(n)})}async onMoved(e){return this.listen(o.WINDOW_MOVED,n=>{n.payload=new u(n.payload),e(n)})}async onCloseRequested(e){return this.listen(o.WINDOW_CLOSE_REQUESTED,async n=>{const l=new T(n);await e(l),l.isPreventDefault()||await this.destroy()})}async onDragDropEvent(e){const n=await this.listen(o.DRAG_ENTER,s=>{e({...s,payload:{type:"enter",paths:s.payload.paths,position:new u(s.payload.position)}})}),l=await this.listen(o.DRAG_OVER,s=>{e({...s,payload:{type:"over",position:new u(s.payload.position)}})}),r=await this.listen(o.DRAG_DROP,s=>{e({...s,payload:{type:"drop",paths:s.payload.paths,position:new u(s.payload.position)}})}),C=await this.listen(o.DRAG_LEAVE,s=>{e({...s,payload:{type:"leave"}})});return()=>{n(),r(),l(),C()}}
1async onFocusChanged(e){const n=await this.listen(o.WINDOW_FOCUS,r=>{e({...r,payload:!0})}),l=await this.listen(o.WINDOW_BLUR,r=>{e({...r,payload:!1})});return()=>{n(),l()}}async onScaleChanged(e){return this.listen(o.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(o.WINDOW_THEME_CHANGED,e)}}var m;(function(t){t.Disabled="disabled",t.Throttle="throttle",t.Suspend="suspend"})(m||(m={}));var v;(function(t){t.Default="default",t.FluentOverlay="fluentOverlay"})(v||(v={}));var z;(function(t){t.AppearanceBased="appearanceBased",t.Light="light",t.Dark="dark",t.MediumLight="mediumLight",t.UltraDark="ultraDark",t.Titlebar="titlebar",t.Selection="selection",t.Menu="menu",t.Popover="popover",t.Sidebar="sidebar",t.HeaderView="headerView",t.Sheet="sheet",t.WindowBackground="windowBackground",t.HudWindow="hudWindow",t.FullScreenUI="fullScreenUI",t.Tooltip="tooltip",t.ContentBackground="contentBackground",t.UnderWindowBackground="underWindowBackground",t.UnderPageBackground="underPageBackground",t.Mica="mica",t.Blur="blur",t.Acrylic="acrylic",t.Tabbed="tabbed",t.TabbedDark="tabbedDark",t.TabbedLight="tabbedLight"})(z||(z={}));var f;(function(t){t.FollowsWindowActiveState="followsWindowActiveState",t.Active="active",t.Inactive="inactive"})(f||(f={}));export{T as CloseRequestedEvent,z as Effect,f as EffectState,D as LogicalPosition,x as LogicalSize,u as PhysicalPosition,c as PhysicalSize,_ as ProgressBarStatus,g as UserAttentionType,W as Window,y as getAllWindows,A as getCurrentWindow};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.