Files

1541 lines
184 KiB
JavaScript
Raw Permalink Normal View History

2024-03-20 10:30:14 +01:00
var __defProp = Object.defineProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
2024-03-20 10:30:14 +01:00
// desktop/@wailsio/runtime/src/index.js
var src_exports = {};
__export(src_exports, {
Application: () => application_exports,
Browser: () => browser_exports,
Call: () => calls_exports,
Clipboard: () => clipboard_exports,
Dialogs: () => dialogs_exports,
Events: () => events_exports,
Flags: () => flags_exports,
Screens: () => screens_exports,
System: () => system_exports,
WML: () => wml_exports,
Window: () => window_default
});
// desktop/@wailsio/runtime/src/wml.js
var wml_exports = {};
__export(wml_exports, {
Enable: () => Enable,
Reload: () => Reload
});
// desktop/@wailsio/runtime/src/browser.js
var browser_exports = {};
__export(browser_exports, {
OpenURL: () => OpenURL
});
// node_modules/nanoid/non-secure/index.js
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
var nanoid = (size = 21) => {
let id = "";
let i = size;
while (i--) {
id += urlAlphabet[Math.random() * 64 | 0];
}
2024-03-20 10:30:14 +01:00
return id;
};
2024-03-20 10:30:14 +01:00
// desktop/@wailsio/runtime/src/runtime.js
var runtimeURL = window.location.origin + "/wails/runtime";
var objectNames = {
Call: 0,
Clipboard: 1,
Application: 2,
Events: 3,
ContextMenu: 4,
Dialog: 5,
Window: 6,
Screens: 7,
System: 8,
Browser: 9,
CancelCall: 10
};
var clientId = nanoid();
function newRuntimeCallerWithID(object, windowName) {
return function(method, args = null) {
return runtimeCallWithID(object, method, windowName, args);
};
}
function runtimeCallWithID(objectID, method, windowName, args) {
let url = new URL(runtimeURL);
url.searchParams.append("object", objectID);
url.searchParams.append("method", method);
let fetchOptions = {
headers: {}
};
if (windowName) {
fetchOptions.headers["x-wails-window-name"] = windowName;
}
if (args) {
url.searchParams.append("args", JSON.stringify(args));
}
fetchOptions.headers["x-wails-client-id"] = clientId;
return new Promise((resolve, reject) => {
fetch(url, fetchOptions).then((response) => {
if (response.ok) {
if (response.headers.get("Content-Type") && response.headers.get("Content-Type").indexOf("application/json") !== -1) {
return response.json();
} else {
return response.text();
}
}
reject(Error(response.statusText));
}).then((data) => resolve(data)).catch((error) => reject(error));
});
2024-03-20 10:30:14 +01:00
}
2024-03-20 10:30:14 +01:00
// desktop/@wailsio/runtime/src/browser.js
var call = newRuntimeCallerWithID(objectNames.Browser, "");
var BrowserOpenURL = 0;
function OpenURL(url) {
return call(BrowserOpenURL, { url });
}
// desktop/@wailsio/runtime/src/dialogs.js
var dialogs_exports = {};
__export(dialogs_exports, {
Error: () => Error2,
Info: () => Info,
OpenFile: () => OpenFile,
Question: () => Question,
SaveFile: () => SaveFile,
Warning: () => Warning
});
window._wails = window._wails || {};
window._wails.dialogErrorCallback = dialogErrorCallback;
window._wails.dialogResultCallback = dialogResultCallback;
var DialogInfo = 0;
var DialogWarning = 1;
var DialogError = 2;
var DialogQuestion = 3;
var DialogOpenFile = 4;
var DialogSaveFile = 5;
var call2 = newRuntimeCallerWithID(objectNames.Dialog, "");
var dialogResponses = /* @__PURE__ */ new Map();
function generateID() {
let result;
do {
result = nanoid();
} while (dialogResponses.has(result));
return result;
}
function dialog(type, options = {}) {
const id = generateID();
options["dialog-id"] = id;
return new Promise((resolve, reject) => {
dialogResponses.set(id, { resolve, reject });
call2(type, options).catch((error) => {
reject(error);
dialogResponses.delete(id);
});
});
}
function dialogResultCallback(id, data, isJSON) {
let p = dialogResponses.get(id);
if (p) {
if (isJSON) {
p.resolve(JSON.parse(data));
} else {
p.resolve(data);
}
2024-03-20 10:30:14 +01:00
dialogResponses.delete(id);
}
}
function dialogErrorCallback(id, message) {
let p = dialogResponses.get(id);
if (p) {
p.reject(message);
dialogResponses.delete(id);
}
}
var Info = (options) => dialog(DialogInfo, options);
var Warning = (options) => dialog(DialogWarning, options);
var Error2 = (options) => dialog(DialogError, options);
var Question = (options) => dialog(DialogQuestion, options);
var OpenFile = (options) => dialog(DialogOpenFile, options);
var SaveFile = (options) => dialog(DialogSaveFile, options);
2024-03-20 10:30:14 +01:00
// desktop/@wailsio/runtime/src/events.js
var events_exports = {};
__export(events_exports, {
Emit: () => Emit,
Off: () => Off,
OffAll: () => OffAll,
On: () => On,
OnMultiple: () => OnMultiple,
Once: () => Once,
Types: () => Types,
WailsEvent: () => WailsEvent,
setup: () => setup
});
// desktop/@wailsio/runtime/src/event_types.js
var EventTypes = {
Windows: {
SystemThemeChanged: "windows:SystemThemeChanged",
APMPowerStatusChange: "windows:APMPowerStatusChange",
APMSuspend: "windows:APMSuspend",
APMResumeAutomatic: "windows:APMResumeAutomatic",
APMResumeSuspend: "windows:APMResumeSuspend",
APMPowerSettingChange: "windows:APMPowerSettingChange",
ApplicationStarted: "windows:ApplicationStarted",
WebViewNavigationCompleted: "windows:WebViewNavigationCompleted",
WindowInactive: "windows:WindowInactive",
WindowActive: "windows:WindowActive",
WindowClickActive: "windows:WindowClickActive",
WindowMaximise: "windows:WindowMaximise",
WindowUnMaximise: "windows:WindowUnMaximise",
WindowFullscreen: "windows:WindowFullscreen",
WindowUnFullscreen: "windows:WindowUnFullscreen",
WindowRestore: "windows:WindowRestore",
WindowMinimise: "windows:WindowMinimise",
WindowUnMinimise: "windows:WindowUnMinimise",
WindowClose: "windows:WindowClose",
WindowSetFocus: "windows:WindowSetFocus",
WindowKillFocus: "windows:WindowKillFocus",
WindowDragDrop: "windows:WindowDragDrop",
WindowDragEnter: "windows:WindowDragEnter",
WindowDragLeave: "windows:WindowDragLeave",
WindowDragOver: "windows:WindowDragOver"
},
Mac: {
ApplicationDidBecomeActive: "mac:ApplicationDidBecomeActive",
ApplicationDidChangeBackingProperties: "mac:ApplicationDidChangeBackingProperties",
ApplicationDidChangeEffectiveAppearance: "mac:ApplicationDidChangeEffectiveAppearance",
ApplicationDidChangeIcon: "mac:ApplicationDidChangeIcon",
ApplicationDidChangeOcclusionState: "mac:ApplicationDidChangeOcclusionState",
ApplicationDidChangeScreenParameters: "mac:ApplicationDidChangeScreenParameters",
ApplicationDidChangeStatusBarFrame: "mac:ApplicationDidChangeStatusBarFrame",
ApplicationDidChangeStatusBarOrientation: "mac:ApplicationDidChangeStatusBarOrientation",
ApplicationDidFinishLaunching: "mac:ApplicationDidFinishLaunching",
ApplicationDidHide: "mac:ApplicationDidHide",
ApplicationDidResignActiveNotification: "mac:ApplicationDidResignActiveNotification",
ApplicationDidUnhide: "mac:ApplicationDidUnhide",
ApplicationDidUpdate: "mac:ApplicationDidUpdate",
ApplicationWillBecomeActive: "mac:ApplicationWillBecomeActive",
ApplicationWillFinishLaunching: "mac:ApplicationWillFinishLaunching",
ApplicationWillHide: "mac:ApplicationWillHide",
ApplicationWillResignActive: "mac:ApplicationWillResignActive",
ApplicationWillTerminate: "mac:ApplicationWillTerminate",
ApplicationWillUnhide: "mac:ApplicationWillUnhide",
ApplicationWillUpdate: "mac:ApplicationWillUpdate",
ApplicationDidChangeTheme: "mac:ApplicationDidChangeTheme!",
ApplicationShouldHandleReopen: "mac:ApplicationShouldHandleReopen!",
WindowDidBecomeKey: "mac:WindowDidBecomeKey",
WindowDidBecomeMain: "mac:WindowDidBecomeMain",
WindowDidBeginSheet: "mac:WindowDidBeginSheet",
WindowDidChangeAlpha: "mac:WindowDidChangeAlpha",
WindowDidChangeBackingLocation: "mac:WindowDidChangeBackingLocation",
WindowDidChangeBackingProperties: "mac:WindowDidChangeBackingProperties",
WindowDidChangeCollectionBehavior: "mac:WindowDidChangeCollectionBehavior",
WindowDidChangeEffectiveAppearance: "mac:WindowDidChangeEffectiveAppearance",
WindowDidChangeOcclusionState: "mac:WindowDidChangeOcclusionState",
WindowDidChangeOrderingMode: "mac:WindowDidChangeOrderingMode",
WindowDidChangeScreen: "mac:WindowDidChangeScreen",
WindowDidChangeScreenParameters: "mac:WindowDidChangeScreenParameters",
WindowDidChangeScreenProfile: "mac:WindowDidChangeScreenProfile",
WindowDidChangeScreenSpace: "mac:WindowDidChangeScreenSpace",
WindowDidChangeScreenSpaceProperties: "mac:WindowDidChangeScreenSpaceProperties",
WindowDidChangeSharingType: "mac:WindowDidChangeSharingType",
WindowDidChangeSpace: "mac:WindowDidChangeSpace",
WindowDidChangeSpaceOrderingMode: "mac:WindowDidChangeSpaceOrderingMode",
WindowDidChangeTitle: "mac:WindowDidChangeTitle",
WindowDidChangeToolbar: "mac:WindowDidChangeToolbar",
WindowDidChangeVisibility: "mac:WindowDidChangeVisibility",
WindowDidDeminiaturize: "mac:WindowDidDeminiaturize",
WindowDidEndSheet: "mac:WindowDidEndSheet",
WindowDidEnterFullScreen: "mac:WindowDidEnterFullScreen",
WindowDidEnterVersionBrowser: "mac:WindowDidEnterVersionBrowser",
WindowDidExitFullScreen: "mac:WindowDidExitFullScreen",
WindowDidExitVersionBrowser: "mac:WindowDidExitVersionBrowser",
WindowDidExpose: "mac:WindowDidExpose",
WindowDidFocus: "mac:WindowDidFocus",
WindowDidMiniaturize: "mac:WindowDidMiniaturize",
WindowDidMove: "mac:WindowDidMove",
WindowDidOrderOffScreen: "mac:WindowDidOrderOffScreen",
WindowDidOrderOnScreen: "mac:WindowDidOrderOnScreen",
WindowDidResignKey: "mac:WindowDidResignKey",
WindowDidResignMain: "mac:WindowDidResignMain",
WindowDidResize: "mac:WindowDidResize",
WindowDidUpdate: "mac:WindowDidUpdate",
WindowDidUpdateAlpha: "mac:WindowDidUpdateAlpha",
WindowDidUpdateCollectionBehavior: "mac:WindowDidUpdateCollectionBehavior",
WindowDidUpdateCollectionProperties: "mac:WindowDidUpdateCollectionProperties",
WindowDidUpdateShadow: "mac:WindowDidUpdateShadow",
WindowDidUpdateTitle: "mac:WindowDidUpdateTitle",
WindowDidUpdateToolbar: "mac:WindowDidUpdateToolbar",
WindowDidUpdateVisibility: "mac:WindowDidUpdateVisibility",
WindowShouldClose: "mac:WindowShouldClose!",
WindowWillBecomeKey: "mac:WindowWillBecomeKey",
WindowWillBecomeMain: "mac:WindowWillBecomeMain",
WindowWillBeginSheet: "mac:WindowWillBeginSheet",
WindowWillChangeOrderingMode: "mac:WindowWillChangeOrderingMode",
WindowWillClose: "mac:WindowWillClose",
WindowWillDeminiaturize: "mac:WindowWillDeminiaturize",
WindowWillEnterFullScreen: "mac:WindowWillEnterFullScreen",
WindowWillEnterVersionBrowser: "mac:WindowWillEnterVersionBrowser",
WindowWillExitFullScreen: "mac:WindowWillExitFullScreen",
WindowWillExitVersionBrowser: "mac:WindowWillExitVersionBrowser",
WindowWillFocus: "mac:WindowWillFocus",
WindowWillMiniaturize: "mac:WindowWillMiniaturize",
WindowWillMove: "mac:WindowWillMove",
WindowWillOrderOffScreen: "mac:WindowWillOrderOffScreen",
WindowWillOrderOnScreen: "mac:WindowWillOrderOnScreen",
WindowWillResignMain: "mac:WindowWillResignMain",
WindowWillResize: "mac:WindowWillResize",
WindowWillUnfocus: "mac:WindowWillUnfocus",
WindowWillUpdate: "mac:WindowWillUpdate",
WindowWillUpdateAlpha: "mac:WindowWillUpdateAlpha",
WindowWillUpdateCollectionBehavior: "mac:WindowWillUpdateCollectionBehavior",
WindowWillUpdateCollectionProperties: "mac:WindowWillUpdateCollectionProperties",
WindowWillUpdateShadow: "mac:WindowWillUpdateShadow",
WindowWillUpdateTitle: "mac:WindowWillUpdateTitle",
WindowWillUpdateToolbar: "mac:WindowWillUpdateToolbar",
WindowWillUpdateVisibility: "mac:WindowWillUpdateVisibility",
WindowWillUseStandardFrame: "mac:WindowWillUseStandardFrame",
MenuWillOpen: "mac:MenuWillOpen",
MenuDidOpen: "mac:MenuDidOpen",
MenuDidClose: "mac:MenuDidClose",
MenuWillSendAction: "mac:MenuWillSendAction",
MenuDidSendAction: "mac:MenuDidSendAction",
MenuWillHighlightItem: "mac:MenuWillHighlightItem",
MenuDidHighlightItem: "mac:MenuDidHighlightItem",
MenuWillDisplayItem: "mac:MenuWillDisplayItem",
MenuDidDisplayItem: "mac:MenuDidDisplayItem",
MenuWillAddItem: "mac:MenuWillAddItem",
MenuDidAddItem: "mac:MenuDidAddItem",
MenuWillRemoveItem: "mac:MenuWillRemoveItem",
MenuDidRemoveItem: "mac:MenuDidRemoveItem",
MenuWillBeginTracking: "mac:MenuWillBeginTracking",
MenuDidBeginTracking: "mac:MenuDidBeginTracking",
MenuWillEndTracking: "mac:MenuWillEndTracking",
MenuDidEndTracking: "mac:MenuDidEndTracking",
MenuWillUpdate: "mac:MenuWillUpdate",
MenuDidUpdate: "mac:MenuDidUpdate",
MenuWillPopUp: "mac:MenuWillPopUp",
MenuDidPopUp: "mac:MenuDidPopUp",
MenuWillSendActionToItem: "mac:MenuWillSendActionToItem",
MenuDidSendActionToItem: "mac:MenuDidSendActionToItem",
WebViewDidStartProvisionalNavigation: "mac:WebViewDidStartProvisionalNavigation",
WebViewDidReceiveServerRedirectForProvisionalNavigation: "mac:WebViewDidReceiveServerRedirectForProvisionalNavigation",
WebViewDidFinishNavigation: "mac:WebViewDidFinishNavigation",
WebViewDidCommitNavigation: "mac:WebViewDidCommitNavigation",
WindowFileDraggingEntered: "mac:WindowFileDraggingEntered",
WindowFileDraggingPerformed: "mac:WindowFileDraggingPerformed",
WindowFileDraggingExited: "mac:WindowFileDraggingExited"
},
Linux: {
SystemThemeChanged: "linux:SystemThemeChanged",
WindowLoadChanged: "linux:WindowLoadChanged",
WindowDeleteEvent: "linux:WindowDeleteEvent",
WindowFocusIn: "linux:WindowFocusIn",
WindowFocusOut: "linux:WindowFocusOut",
ApplicationStartup: "linux:ApplicationStartup"
},
Common: {
ApplicationStarted: "common:ApplicationStarted",
WindowMaximise: "common:WindowMaximise",
WindowUnMaximise: "common:WindowUnMaximise",
WindowFullscreen: "common:WindowFullscreen",
WindowUnFullscreen: "common:WindowUnFullscreen",
WindowRestore: "common:WindowRestore",
WindowMinimise: "common:WindowMinimise",
WindowUnMinimise: "common:WindowUnMinimise",
WindowClosing: "common:WindowClosing",
WindowZoom: "common:WindowZoom",
WindowZoomIn: "common:WindowZoomIn",
WindowZoomOut: "common:WindowZoomOut",
WindowZoomReset: "common:WindowZoomReset",
WindowFocus: "common:WindowFocus",
WindowLostFocus: "common:WindowLostFocus",
WindowShow: "common:WindowShow",
WindowHide: "common:WindowHide",
WindowDPIChanged: "common:WindowDPIChanged",
WindowFilesDropped: "common:WindowFilesDropped",
WindowRuntimeReady: "common:WindowRuntimeReady",
ThemeChanged: "common:ThemeChanged"
}
};
// desktop/@wailsio/runtime/src/events.js
var Types = EventTypes;
window._wails = window._wails || {};
window._wails.dispatchWailsEvent = dispatchWailsEvent;
var call3 = newRuntimeCallerWithID(objectNames.Events, "");
var EmitMethod = 0;
var eventListeners = /* @__PURE__ */ new Map();
var Listener = class {
constructor(eventName, callback, maxCallbacks) {
this.eventName = eventName;
this.maxCallbacks = maxCallbacks || -1;
this.Callback = (data) => {
callback(data);
if (this.maxCallbacks === -1)
return false;
this.maxCallbacks -= 1;
return this.maxCallbacks === 0;
};
}
2024-03-20 10:30:14 +01:00
};
var WailsEvent = class {
constructor(name, data = null) {
this.name = name;
this.data = data;
}
};
function setup() {
}
function dispatchWailsEvent(event) {
let listeners = eventListeners.get(event.name);
if (listeners) {
let toRemove = listeners.filter((listener) => {
let remove = listener.Callback(event);
if (remove)
return true;
});
if (toRemove.length > 0) {
listeners = listeners.filter((l) => !toRemove.includes(l));
if (listeners.length === 0)
eventListeners.delete(event.name);
else
eventListeners.set(event.name, listeners);
}
2024-03-20 10:30:14 +01:00
}
}
function OnMultiple(eventName, callback, maxCallbacks) {
let listeners = eventListeners.get(eventName) || [];
const thisListener = new Listener(eventName, callback, maxCallbacks);
listeners.push(thisListener);
eventListeners.set(eventName, listeners);
return () => listenerOff(thisListener);
}
function On(eventName, callback) {
return OnMultiple(eventName, callback, -1);
}
function Once(eventName, callback) {
return OnMultiple(eventName, callback, 1);
}
function listenerOff(listener) {
const eventName = listener.eventName;
let listeners = eventListeners.get(eventName).filter((l) => l !== listener);
if (listeners.length === 0)
eventListeners.delete(eventName);
else
eventListeners.set(eventName, listeners);
}
function Off(eventName, ...additionalEventNames) {
let eventsToRemove = [eventName, ...additionalEventNames];
eventsToRemove.forEach((eventName2) => eventListeners.delete(eventName2));
}
function OffAll() {
eventListeners.clear();
}
function Emit(event) {
return call3(EmitMethod, event);
}
// desktop/@wailsio/runtime/src/utils.js
function debugLog(message) {
console.log(
"%c wails3 %c " + message + " ",
"background: #aa0000; color: #fff; border-radius: 3px 0px 0px 3px; padding: 1px; font-size: 0.7rem",
"background: #009900; color: #fff; border-radius: 0px 3px 3px 0px; padding: 1px; font-size: 0.7rem"
);
}
function canAbortListeners() {
if (!EventTarget || !AbortSignal || !AbortController)
return false;
let result = true;
const target = new EventTarget();
2024-03-24 06:42:41 +01:00
const controller2 = new AbortController();
2024-03-20 10:30:14 +01:00
target.addEventListener("test", () => {
result = false;
2024-03-24 06:42:41 +01:00
}, { signal: controller2.signal });
controller2.abort();
2024-03-20 10:30:14 +01:00
target.dispatchEvent(new CustomEvent("test"));
return result;
}
var isReady = false;
document.addEventListener("DOMContentLoaded", () => isReady = true);
function whenReady(callback) {
if (isReady || document.readyState === "complete") {
callback();
} else {
document.addEventListener("DOMContentLoaded", callback);
}
}
// desktop/@wailsio/runtime/src/window.js
var AbsolutePositionMethod = 0;
var CenterMethod = 1;
var CloseMethod = 2;
var DisableSizeConstraintsMethod = 3;
var EnableSizeConstraintsMethod = 4;
var FocusMethod = 5;
var ForceReloadMethod = 6;
var FullscreenMethod = 7;
var GetScreenMethod = 8;
var GetZoomMethod = 9;
var HeightMethod = 10;
var HideMethod = 11;
var IsFocusedMethod = 12;
var IsFullscreenMethod = 13;
var IsMaximisedMethod = 14;
var IsMinimisedMethod = 15;
var MaximiseMethod = 16;
var MinimiseMethod = 17;
var NameMethod = 18;
var OpenDevToolsMethod = 19;
var RelativePositionMethod = 20;
var ReloadMethod = 21;
var ResizableMethod = 22;
var RestoreMethod = 23;
var SetAbsolutePositionMethod = 24;
var SetAlwaysOnTopMethod = 25;
var SetBackgroundColourMethod = 26;
var SetFramelessMethod = 27;
var SetFullscreenButtonEnabledMethod = 28;
var SetMaxSizeMethod = 29;
var SetMinSizeMethod = 30;
var SetRelativePositionMethod = 31;
var SetResizableMethod = 32;
var SetSizeMethod = 33;
var SetTitleMethod = 34;
var SetZoomMethod = 35;
var ShowMethod = 36;
var SizeMethod = 37;
var ToggleFullscreenMethod = 38;
var ToggleMaximiseMethod = 39;
var UnFullscreenMethod = 40;
var UnMaximiseMethod = 41;
var UnMinimiseMethod = 42;
var WidthMethod = 43;
var ZoomMethod = 44;
var ZoomInMethod = 45;
var ZoomOutMethod = 46;
var ZoomResetMethod = 47;
2024-03-24 06:42:41 +01:00
var caller = Symbol();
2024-03-20 10:30:14 +01:00
var Window = class _Window {
/**
* Initialises a window object with the specified name.
*
* @private
* @param {string} name - The name of the target window.
*/
constructor(name = "") {
2024-03-24 06:42:41 +01:00
this[caller] = newRuntimeCallerWithID(objectNames.Window, name);
2024-03-20 10:30:14 +01:00
for (const method of Object.getOwnPropertyNames(_Window.prototype)) {
if (method !== "constructor" && typeof this[method] === "function") {
this[method] = this[method].bind(this);
}
}
2024-03-20 10:30:14 +01:00
}
/**
* Gets the specified window.
*
* @public
* @param {string} name - The name of the window to get.
* @return {Window} - The corresponding window object.
*/
Get(name) {
return new _Window(name);
}
/**
* Returns the absolute position of the window to the screen.
*
* @public
* @return {Promise<Position>} - The current absolute position of the window.
*/
AbsolutePosition() {
2024-03-24 06:42:41 +01:00
return this[caller](AbsolutePositionMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Centers the window on the screen.
*
* @public
* @return {Promise<void>}
*/
Center() {
2024-03-24 06:42:41 +01:00
return this[caller](CenterMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Closes the window.
*
* @public
* @return {Promise<void>}
*/
Close() {
2024-03-24 06:42:41 +01:00
return this[caller](CloseMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Disables min/max size constraints.
*
* @public
* @return {Promise<void>}
*/
DisableSizeConstraints() {
2024-03-24 06:42:41 +01:00
return this[caller](DisableSizeConstraintsMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Enables min/max size constraints.
*
* @public
* @return {Promise<void>}
*/
EnableSizeConstraints() {
2024-03-24 06:42:41 +01:00
return this[caller](EnableSizeConstraintsMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Focuses the window.
*
* @public
* @return {Promise<void>}
*/
Focus() {
2024-03-24 06:42:41 +01:00
return this[caller](FocusMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Forces the window to reload the page assets.
*
* @public
* @return {Promise<void>}
*/
ForceReload() {
2024-03-24 06:42:41 +01:00
return this[caller](ForceReloadMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Doc.
*
* @public
* @return {Promise<void>}
*/
Fullscreen() {
2024-03-24 06:42:41 +01:00
return this[caller](FullscreenMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Returns the screen that the window is on.
*
* @public
* @return {Promise<Screen>} - The screen the window is currently on
*/
GetScreen() {
2024-03-24 06:42:41 +01:00
return this[caller](GetScreenMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Returns the current zoom level of the window.
*
* @public
* @return {Promise<number>} - The current zoom level
*/
GetZoom() {
2024-03-24 06:42:41 +01:00
return this[caller](GetZoomMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Returns the height of the window.
*
* @public
* @return {Promise<number>} - The current height of the window
*/
Height() {
2024-03-24 06:42:41 +01:00
return this[caller](HeightMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Hides the window.
*
* @public
* @return {Promise<void>}
*/
Hide() {
2024-03-24 06:42:41 +01:00
return this[caller](HideMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Returns true if the window is focused.
*
* @public
* @return {Promise<boolean>} - Whether the window is currently focused
*/
IsFocused() {
2024-03-24 06:42:41 +01:00
return this[caller](IsFocusedMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Returns true if the window is fullscreen.
*
* @public
* @return {Promise<boolean>} - Whether the window is currently fullscreen
*/
IsFullscreen() {
2024-03-24 06:42:41 +01:00
return this[caller](IsFullscreenMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Returns true if the window is maximised.
*
* @public
* @return {Promise<boolean>} - Whether the window is currently maximised
*/
IsMaximised() {
2024-03-24 06:42:41 +01:00
return this[caller](IsMaximisedMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Returns true if the window is minimised.
*
* @public
* @return {Promise<boolean>} - Whether the window is currently minimised
*/
IsMinimised() {
2024-03-24 06:42:41 +01:00
return this[caller](IsMinimisedMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Maximises the window.
*
* @public
* @return {Promise<void>}
*/
Maximise() {
2024-03-24 06:42:41 +01:00
return this[caller](MaximiseMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Minimises the window.
*
* @public
* @return {Promise<void>}
*/
Minimise() {
2024-03-24 06:42:41 +01:00
return this[caller](MinimiseMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Returns the name of the window.
*
* @public
* @return {Promise<string>} - The name of the window
*/
Name() {
2024-03-24 06:42:41 +01:00
return this[caller](NameMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Opens the development tools pane.
*
* @public
* @return {Promise<void>}
*/
OpenDevTools() {
2024-03-24 06:42:41 +01:00
return this[caller](OpenDevToolsMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Returns the relative position of the window to the screen.
*
* @public
* @return {Promise<Position>} - The current relative position of the window
*/
RelativePosition() {
2024-03-24 06:42:41 +01:00
return this[caller](RelativePositionMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Reloads the page assets.
*
* @public
* @return {Promise<void>}
*/
Reload() {
2024-03-24 06:42:41 +01:00
return this[caller](ReloadMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Returns true if the window is resizable.
*
* @public
* @return {Promise<boolean>} - Whether the window is currently resizable
*/
Resizable() {
2024-03-24 06:42:41 +01:00
return this[caller](ResizableMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Restores the window to its previous state if it was previously minimised, maximised or fullscreen.
*
* @public
* @return {Promise<void>}
*/
Restore() {
2024-03-24 06:42:41 +01:00
return this[caller](RestoreMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Sets the absolute position of the window to the screen.
*
* @public
* @param {number} x - The desired horizontal absolute position of the window
* @param {number} y - The desired vertical absolute position of the window
* @return {Promise<void>}
*/
SetAbsolutePosition(x, y) {
2024-03-24 06:42:41 +01:00
return this[caller](SetAbsolutePositionMethod, { x, y });
2024-03-20 10:30:14 +01:00
}
/**
* Sets the window to be always on top.
*
* @public
* @param {boolean} alwaysOnTop - Whether the window should stay on top
* @return {Promise<void>}
*/
SetAlwaysOnTop(alwaysOnTop) {
2024-03-24 06:42:41 +01:00
return this[caller](SetAlwaysOnTopMethod, { alwaysOnTop });
2024-03-20 10:30:14 +01:00
}
/**
* Sets the background colour of the window.
*
* @public
* @param {number} r - The desired red component of the window background
* @param {number} g - The desired green component of the window background
* @param {number} b - The desired blue component of the window background
* @param {number} a - The desired alpha component of the window background
* @return {Promise<void>}
*/
SetBackgroundColour(r, g, b, a) {
2024-03-24 06:42:41 +01:00
return this[caller](SetBackgroundColourMethod, { r, g, b, a });
2024-03-20 10:30:14 +01:00
}
/**
* Removes the window frame and title bar.
*
* @public
* @param {boolean} frameless - Whether the window should be frameless
* @return {Promise<void>}
*/
SetFrameless(frameless) {
2024-03-24 06:42:41 +01:00
return this[caller](SetFramelessMethod, { frameless });
2024-03-20 10:30:14 +01:00
}
/**
* Disables the system fullscreen button.
*
* @public
* @param {boolean} enabled - Whether the fullscreen button should be enabled
* @return {Promise<void>}
*/
SetFullscreenButtonEnabled(enabled) {
2024-03-24 06:42:41 +01:00
return this[caller](SetFullscreenButtonEnabledMethod, { enabled });
2024-03-20 10:30:14 +01:00
}
/**
* Sets the maximum size of the window.
*
* @public
* @param {number} width - The desired maximum width of the window
* @param {number} height - The desired maximum height of the window
* @return {Promise<void>}
*/
SetMaxSize(width, height) {
2024-03-24 06:42:41 +01:00
return this[caller](SetMaxSizeMethod, { width, height });
2024-03-20 10:30:14 +01:00
}
/**
* Sets the minimum size of the window.
*
* @public
* @param {number} width - The desired minimum width of the window
* @param {number} height - The desired minimum height of the window
* @return {Promise<void>}
*/
SetMinSize(width, height) {
2024-03-24 06:42:41 +01:00
return this[caller](SetMinSizeMethod, { width, height });
2024-03-20 10:30:14 +01:00
}
/**
* Sets the relative position of the window to the screen.
*
* @public
* @param {number} x - The desired horizontal relative position of the window
* @param {number} y - The desired vertical relative position of the window
* @return {Promise<void>}
*/
SetRelativePosition(x, y) {
2024-03-24 06:42:41 +01:00
return this[caller](SetRelativePositionMethod, { x, y });
2024-03-20 10:30:14 +01:00
}
/**
* Sets whether the window is resizable.
*
* @public
* @param {boolean} resizable - Whether the window should be resizable
* @return {Promise<void>}
*/
SetResizable(resizable2) {
2024-03-24 06:42:41 +01:00
return this[caller](SetResizableMethod, { resizable: resizable2 });
2024-03-20 10:30:14 +01:00
}
/**
* Sets the size of the window.
*
* @public
* @param {number} width - The desired width of the window
* @param {number} height - The desired height of the window
* @return {Promise<void>}
*/
SetSize(width, height) {
2024-03-24 06:42:41 +01:00
return this[caller](SetSizeMethod, { width, height });
2024-03-20 10:30:14 +01:00
}
/**
* Sets the title of the window.
*
* @public
* @param {string} title - The desired title of the window
* @return {Promise<void>}
*/
SetTitle(title) {
2024-03-24 06:42:41 +01:00
return this[caller](SetTitleMethod, { title });
2024-03-20 10:30:14 +01:00
}
/**
* Sets the zoom level of the window.
*
* @public
* @param {number} zoom - The desired zoom level
* @return {Promise<void>}
*/
SetZoom(zoom) {
2024-03-24 06:42:41 +01:00
return this[caller](SetZoomMethod, { zoom });
2024-03-20 10:30:14 +01:00
}
/**
* Shows the window.
*
* @public
* @return {Promise<void>}
*/
Show() {
2024-03-24 06:42:41 +01:00
return this[caller](ShowMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Returns the size of the window.
*
* @public
* @return {Promise<Size>} - The current size of the window
*/
Size() {
2024-03-24 06:42:41 +01:00
return this[caller](SizeMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Toggles the window between fullscreen and normal.
*
* @public
* @return {Promise<void>}
*/
ToggleFullscreen() {
2024-03-24 06:42:41 +01:00
return this[caller](ToggleFullscreenMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Toggles the window between maximised and normal.
*
* @public
* @return {Promise<void>}
*/
ToggleMaximise() {
2024-03-24 06:42:41 +01:00
return this[caller](ToggleMaximiseMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Un-fullscreens the window.
*
* @public
* @return {Promise<void>}
*/
UnFullscreen() {
2024-03-24 06:42:41 +01:00
return this[caller](UnFullscreenMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Un-maximises the window.
*
* @public
* @return {Promise<void>}
*/
UnMaximise() {
2024-03-24 06:42:41 +01:00
return this[caller](UnMaximiseMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Un-minimises the window.
*
* @public
* @return {Promise<void>}
*/
UnMinimise() {
2024-03-24 06:42:41 +01:00
return this[caller](UnMinimiseMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Returns the width of the window.
*
* @public
* @return {Promise<number>} - The current width of the window
*/
Width() {
2024-03-24 06:42:41 +01:00
return this[caller](WidthMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Zooms the window.
*
* @public
* @return {Promise<void>}
*/
Zoom() {
2024-03-24 06:42:41 +01:00
return this[caller](ZoomMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Increases the zoom level of the webview content.
*
* @public
* @return {Promise<void>}
*/
ZoomIn() {
2024-03-24 06:42:41 +01:00
return this[caller](ZoomInMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Decreases the zoom level of the webview content.
*
* @public
* @return {Promise<void>}
*/
ZoomOut() {
2024-03-24 06:42:41 +01:00
return this[caller](ZoomOutMethod);
2024-03-20 10:30:14 +01:00
}
/**
* Resets the zoom level of the webview content.
*
* @public
* @return {Promise<void>}
*/
ZoomReset() {
2024-03-24 06:42:41 +01:00
return this[caller](ZoomResetMethod);
2024-03-20 10:30:14 +01:00
}
};
var thisWindow = new Window("");
var window_default = thisWindow;
// desktop/@wailsio/runtime/src/wml.js
function sendEvent(eventName, data = null) {
Emit(new WailsEvent(eventName, data));
}
function callWindowMethod(windowName, methodName) {
const targetWindow = window_default.Get(windowName);
const method = targetWindow[methodName];
if (typeof method !== "function") {
console.error(`Window method '${methodName}' not found`);
return;
}
try {
method.call(targetWindow);
} catch (e) {
console.error(`Error calling window method '${methodName}': `, e);
}
}
function onWMLTriggered(ev) {
const element = ev.currentTarget;
function runEffect(choice = "Yes") {
if (choice !== "Yes")
return;
const eventType = element.getAttribute("wml-event");
const targetWindow = element.getAttribute("wml-target-window") || "";
const windowMethod = element.getAttribute("wml-window");
const url = element.getAttribute("wml-openurl");
if (eventType !== null)
sendEvent(eventType);
if (windowMethod !== null)
callWindowMethod(targetWindow, windowMethod);
if (url !== null)
void OpenURL(url);
}
const confirm = element.getAttribute("wml-confirm");
if (confirm) {
Question({
Title: "Confirm",
Message: confirm,
Detached: false,
Buttons: [
{ Label: "Yes" },
{ Label: "No", IsDefault: true }
]
}).then(runEffect);
} else {
runEffect();
}
}
2024-03-24 06:42:41 +01:00
var controller = Symbol();
2024-03-20 10:30:14 +01:00
var AbortControllerRegistry = class {
constructor() {
2024-03-24 06:42:41 +01:00
this[controller] = new AbortController();
2024-03-20 10:30:14 +01:00
}
/**
* Returns an options object for addEventListener that ties the listener
* to the AbortSignal from the current AbortController.
*
* @param {HTMLElement} element An HTML element
* @param {string[]} triggers The list of active WML trigger events for the specified elements
* @returns {AddEventListenerOptions}
*/
set(element, triggers) {
2024-03-24 06:42:41 +01:00
return { signal: this[controller].signal };
2024-03-20 10:30:14 +01:00
}
/**
* Removes all registered event listeners.
*
* @returns {void}
*/
reset() {
2024-03-24 06:42:41 +01:00
this[controller].abort();
this[controller] = new AbortController();
2024-03-20 10:30:14 +01:00
}
};
2024-03-24 06:42:41 +01:00
var triggerMap = Symbol();
var elementCount = Symbol();
2024-03-20 10:30:14 +01:00
var WeakMapRegistry = class {
constructor() {
2024-03-24 06:42:41 +01:00
this[triggerMap] = /* @__PURE__ */ new WeakMap();
this[elementCount] = 0;
2024-03-20 10:30:14 +01:00
}
/**
* Sets the active triggers for the specified element.
*
* @param {HTMLElement} element An HTML element
* @param {string[]} triggers The list of active WML trigger events for the specified element
* @returns {AddEventListenerOptions}
*/
set(element, triggers) {
2024-03-24 06:42:41 +01:00
this[elementCount] += !this[triggerMap].has(element);
this[triggerMap].set(element, triggers);
2024-03-20 10:30:14 +01:00
return {};
}
/**
* Removes all registered event listeners.
*
* @returns {void}
*/
reset() {
2024-03-24 06:42:41 +01:00
if (this[elementCount] <= 0)
2024-03-20 10:30:14 +01:00
return;
for (const element of document.body.querySelectorAll("*")) {
2024-03-24 06:42:41 +01:00
if (this[elementCount] <= 0)
2024-03-20 10:30:14 +01:00
break;
2024-03-24 06:42:41 +01:00
const triggers = this[triggerMap].get(element);
this[elementCount] -= typeof triggers !== "undefined";
2024-03-20 10:30:14 +01:00
for (const trigger of triggers || [])
element.removeEventListener(trigger, onWMLTriggered);
}
2024-03-24 06:42:41 +01:00
this[triggerMap] = /* @__PURE__ */ new WeakMap();
this[elementCount] = 0;
2024-03-20 10:30:14 +01:00
}
};
var triggerRegistry = canAbortListeners() ? new AbortControllerRegistry() : new WeakMapRegistry();
function addWMLListeners(element) {
const triggerRegExp = /\S+/g;
const triggerAttr = element.getAttribute("wml-trigger") || "click";
const triggers = [];
let match;
while ((match = triggerRegExp.exec(triggerAttr)) !== null)
triggers.push(match[0]);
const options = triggerRegistry.set(element, triggers);
for (const trigger of triggers)
element.addEventListener(trigger, onWMLTriggered, options);
}
function Enable() {
whenReady(Reload);
}
function Reload() {
triggerRegistry.reset();
document.body.querySelectorAll("[wml-event], [wml-window], [wml-openurl]").forEach(addWMLListeners);
}
// desktop/compiled/main.js
window.wails = src_exports;
Enable();
if (true) {
debugLog("Wails Runtime Loaded");
}
// desktop/@wailsio/runtime/src/system.js
var system_exports = {};
__export(system_exports, {
Capabilities: () => Capabilities,
Environment: () => Environment,
IsAMD64: () => IsAMD64,
IsARM: () => IsARM,
IsARM64: () => IsARM64,
IsDarkMode: () => IsDarkMode,
IsDebug: () => IsDebug,
IsLinux: () => IsLinux,
IsMac: () => IsMac,
IsWindows: () => IsWindows,
invoke: () => invoke
});
var call4 = newRuntimeCallerWithID(objectNames.System, "");
var systemIsDarkMode = 0;
var environment = 1;
function invoke(msg) {
if (window.chrome) {
return window.chrome.webview.postMessage(msg);
}
return window.webkit.messageHandlers.external.postMessage(msg);
}
function IsDarkMode() {
return call4(systemIsDarkMode);
}
function Capabilities() {
let response = fetch("/wails/capabilities");
return response.json();
}
function Environment() {
return call4(environment);
}
function IsWindows() {
return window._wails.environment.OS === "windows";
}
function IsLinux() {
return window._wails.environment.OS === "linux";
}
function IsMac() {
return window._wails.environment.OS === "darwin";
}
function IsAMD64() {
return window._wails.environment.Arch === "amd64";
}
function IsARM() {
return window._wails.environment.Arch === "arm";
}
function IsARM64() {
return window._wails.environment.Arch === "arm64";
}
function IsDebug() {
return window._wails.environment.Debug === true;
}
// desktop/@wailsio/runtime/src/contextmenu.js
window.addEventListener("contextmenu", contextMenuHandler);
var call5 = newRuntimeCallerWithID(objectNames.ContextMenu, "");
var ContextMenuOpen = 0;
function openContextMenu(id, x, y, data) {
void call5(ContextMenuOpen, { id, x, y, data });
}
function contextMenuHandler(event) {
let element = event.target;
let customContextMenu = window.getComputedStyle(element).getPropertyValue("--custom-contextmenu");
customContextMenu = customContextMenu ? customContextMenu.trim() : "";
if (customContextMenu) {
event.preventDefault();
let customContextMenuData = window.getComputedStyle(element).getPropertyValue("--custom-contextmenu-data");
openContextMenu(customContextMenu, event.clientX, event.clientY, customContextMenuData);
return;
}
processDefaultContextMenu(event);
}
function processDefaultContextMenu(event) {
if (IsDebug()) {
return;
}
const element = event.target;
const computedStyle = window.getComputedStyle(element);
const defaultContextMenuAction = computedStyle.getPropertyValue("--default-contextmenu").trim();
switch (defaultContextMenuAction) {
case "show":
return;
case "hide":
event.preventDefault();
return;
default:
if (element.isContentEditable) {
return;
}
const selection = window.getSelection();
const hasSelection = selection.toString().length > 0;
if (hasSelection) {
for (let i = 0; i < selection.rangeCount; i++) {
const range = selection.getRangeAt(i);
const rects = range.getClientRects();
for (let j = 0; j < rects.length; j++) {
const rect = rects[j];
if (document.elementFromPoint(rect.left, rect.top) === element) {
return;
}
}
}
}
2024-03-20 10:30:14 +01:00
if (element.tagName === "INPUT" || element.tagName === "TEXTAREA") {
if (hasSelection || !element.readOnly && !element.disabled) {
return;
}
}
2024-03-20 10:30:14 +01:00
event.preventDefault();
}
2024-03-20 10:30:14 +01:00
}
2024-03-20 10:30:14 +01:00
// desktop/@wailsio/runtime/src/flags.js
var flags_exports = {};
__export(flags_exports, {
GetFlag: () => GetFlag
});
function GetFlag(keyString) {
try {
return window._wails.flags[keyString];
} catch (e) {
throw new Error("Unable to retrieve flag '" + keyString + "': " + e);
}
2024-03-20 10:30:14 +01:00
}
2024-03-20 10:30:14 +01:00
// desktop/@wailsio/runtime/src/drag.js
2024-04-11 20:43:13 +10:00
var shouldDrag = false;
var resizable = false;
var resizeEdge = null;
var defaultCursor = "auto";
2024-03-20 10:30:14 +01:00
window._wails = window._wails || {};
2024-04-11 20:43:13 +10:00
window._wails.setResizable = function(value) {
resizable = value;
};
window._wails.endDrag = function() {
document.body.style.cursor = "default";
shouldDrag = false;
};
2024-03-20 10:30:14 +01:00
window.addEventListener("mousedown", onMouseDown);
window.addEventListener("mousemove", onMouseMove);
window.addEventListener("mouseup", onMouseUp);
function dragTest(e) {
2024-04-11 20:43:13 +10:00
let val = window.getComputedStyle(e.target).getPropertyValue("--wails-draggable");
let mousePressed = e.buttons !== void 0 ? e.buttons : e.which;
if (!val || val === "" || val.trim() !== "drag" || mousePressed === 0) {
2024-03-20 10:30:14 +01:00
return false;
}
return e.detail === 1;
}
2024-04-11 20:43:13 +10:00
function onMouseDown(e) {
if (resizeEdge) {
invoke("resize:" + resizeEdge);
e.preventDefault();
return;
}
if (dragTest(e)) {
if (e.offsetX > e.target.clientWidth || e.offsetY > e.target.clientHeight) {
return;
}
shouldDrag = true;
} else {
shouldDrag = false;
}
2024-03-20 10:30:14 +01:00
}
2024-04-11 20:43:13 +10:00
function onMouseUp() {
2024-03-20 10:30:14 +01:00
shouldDrag = false;
}
2024-04-11 20:43:13 +10:00
function setResize(cursor) {
document.documentElement.style.cursor = cursor || defaultCursor;
2024-03-20 10:30:14 +01:00
resizeEdge = cursor;
}
function onMouseMove(e) {
2024-04-11 20:43:13 +10:00
if (shouldDrag) {
shouldDrag = false;
let mousePressed = e.buttons !== void 0 ? e.buttons : e.which;
if (mousePressed > 0) {
invoke("drag");
return;
}
2024-03-20 10:30:14 +01:00
}
2024-04-11 20:43:13 +10:00
if (!resizable || !IsWindows()) {
return;
}
if (defaultCursor == null) {
defaultCursor = document.documentElement.style.cursor;
2024-03-20 10:30:14 +01:00
}
let resizeHandleHeight = GetFlag("system.resizeHandleHeight") || 5;
let resizeHandleWidth = GetFlag("system.resizeHandleWidth") || 5;
let cornerExtra = GetFlag("resizeCornerExtra") || 10;
let rightBorder = window.outerWidth - e.clientX < resizeHandleWidth;
let leftBorder = e.clientX < resizeHandleWidth;
let topBorder = e.clientY < resizeHandleHeight;
let bottomBorder = window.outerHeight - e.clientY < resizeHandleHeight;
let rightCorner = window.outerWidth - e.clientX < resizeHandleWidth + cornerExtra;
let leftCorner = e.clientX < resizeHandleWidth + cornerExtra;
let topCorner = e.clientY < resizeHandleHeight + cornerExtra;
let bottomCorner = window.outerHeight - e.clientY < resizeHandleHeight + cornerExtra;
if (!leftBorder && !rightBorder && !topBorder && !bottomBorder && resizeEdge !== void 0) {
setResize();
} else if (rightCorner && bottomCorner)
setResize("se-resize");
else if (leftCorner && bottomCorner)
setResize("sw-resize");
else if (leftCorner && topCorner)
setResize("nw-resize");
else if (topCorner && rightCorner)
setResize("ne-resize");
else if (leftBorder)
setResize("w-resize");
else if (topBorder)
setResize("n-resize");
else if (bottomBorder)
setResize("s-resize");
else if (rightBorder)
setResize("e-resize");
}
// desktop/@wailsio/runtime/src/application.js
var application_exports = {};
__export(application_exports, {
Hide: () => Hide,
Quit: () => Quit,
Show: () => Show
});
var call6 = newRuntimeCallerWithID(objectNames.Application, "");
var HideMethod2 = 0;
var ShowMethod2 = 1;
var QuitMethod = 2;
function Hide() {
return call6(HideMethod2);
}
function Show() {
return call6(ShowMethod2);
}
function Quit() {
return call6(QuitMethod);
}
// desktop/@wailsio/runtime/src/calls.js
var calls_exports = {};
__export(calls_exports, {
ByID: () => ByID,
ByName: () => ByName,
Call: () => Call,
Plugin: () => Plugin
});
window._wails = window._wails || {};
window._wails.callResultHandler = resultHandler;
window._wails.callErrorHandler = errorHandler;
var CallBinding = 0;
var call7 = newRuntimeCallerWithID(objectNames.Call, "");
var cancelCall = newRuntimeCallerWithID(objectNames.CancelCall, "");
var callResponses = /* @__PURE__ */ new Map();
function generateID2() {
let result;
do {
result = nanoid();
} while (callResponses.has(result));
return result;
}
function resultHandler(id, data, isJSON) {
const promiseHandler = getAndDeleteResponse(id);
if (promiseHandler) {
promiseHandler.resolve(isJSON ? JSON.parse(data) : data);
}
}
function errorHandler(id, message) {
const promiseHandler = getAndDeleteResponse(id);
if (promiseHandler) {
promiseHandler.reject(message);
}
}
function getAndDeleteResponse(id) {
const response = callResponses.get(id);
callResponses.delete(id);
return response;
}
function callBinding(type, options = {}) {
const id = generateID2();
const doCancel = () => {
cancelCall(type, { "call-id": id });
};
var queuedCancel = false, callRunning = false;
var p = new Promise((resolve, reject) => {
options["call-id"] = id;
callResponses.set(id, { resolve, reject });
call7(type, options).then((_) => {
callRunning = true;
if (queuedCancel) {
doCancel();
}
}).catch((error) => {
reject(error);
callResponses.delete(id);
});
});
2024-03-20 10:30:14 +01:00
p.cancel = () => {
if (callRunning) {
doCancel();
} else {
2024-03-20 10:30:14 +01:00
queuedCancel = true;
}
2024-03-20 10:30:14 +01:00
};
return p;
}
function Call(options) {
return callBinding(CallBinding, options);
}
function ByName(name, ...args) {
if (typeof name !== "string" || name.split(".").length !== 3) {
throw new Error("CallByName requires a string in the format 'package.struct.method'");
}
2024-03-20 10:30:14 +01:00
let [packageName, structName, methodName] = name.split(".");
return callBinding(CallBinding, {
packageName,
structName,
methodName,
args
});
2024-03-20 10:30:14 +01:00
}
function ByID(methodID, ...args) {
return callBinding(CallBinding, {
methodID,
args
});
}
function Plugin(pluginName, methodName, ...args) {
return callBinding(CallBinding, {
packageName: "wails-plugins",
structName: pluginName,
methodName,
args
});
}
// desktop/@wailsio/runtime/src/clipboard.js
var clipboard_exports = {};
__export(clipboard_exports, {
SetText: () => SetText,
Text: () => Text
});
var call8 = newRuntimeCallerWithID(objectNames.Clipboard, "");
var ClipboardSetText = 0;
var ClipboardText = 1;
function SetText(text) {
return call8(ClipboardSetText, { text });
}
function Text() {
return call8(ClipboardText);
}
// desktop/@wailsio/runtime/src/screens.js
var screens_exports = {};
__export(screens_exports, {
GetAll: () => GetAll,
GetCurrent: () => GetCurrent,
GetPrimary: () => GetPrimary
});
var call9 = newRuntimeCallerWithID(objectNames.Screens, "");
var getAll = 0;
var getPrimary = 1;
var getCurrent = 2;
function GetAll() {
return call9(getAll);
}
function GetPrimary() {
return call9(getPrimary);
}
function GetCurrent() {
return call9(getCurrent);
}
// desktop/@wailsio/runtime/src/index.js
window._wails = window._wails || {};
window._wails.invoke = invoke;
invoke("wails:runtime:ready");
export {
application_exports as Application,
browser_exports as Browser,
calls_exports as Call,
clipboard_exports as Clipboard,
dialogs_exports as Dialogs,
events_exports as Events,
flags_exports as Flags,
screens_exports as Screens,
system_exports as System,
wml_exports as WML,
window_default as Window
};
2024-04-11 20:43:13 +10:00
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vcnVudGltZS9kZXNrdG9wL0B3YWlsc2lvL3J1bnRpbWUvc3JjL2luZGV4LmpzIiwgIi4uLy4uL3J1bn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