From 3c62dbc902c904d35a7472ce72a969084c95fbbe Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Thu, 15 Sep 2022 16:28:52 +0200 Subject: [PATCH] feat(api): Add `exists` function to the fs module. (#5060) Co-authored-by: Amr Bashir Co-authored-by: Lucas Fernandes Nogueira --- .changes/feat-exists-api.md | 6 ++ core/tauri-utils/src/config.rs | 5 ++ core/tauri/Cargo.toml | 2 + core/tauri/build.rs | 1 + core/tauri/scripts/bundle.js | 2 +- core/tauri/src/endpoints/file_system.rs | 29 ++++++++++ core/tauri/src/lib.rs | 1 + examples/api/dist/assets/index.js | 74 ++++++++++++------------- tooling/api/src/fs.ts | 28 +++++++++- tooling/cli/schema.json | 8 +++ 10 files changed, 116 insertions(+), 40 deletions(-) create mode 100644 .changes/feat-exists-api.md diff --git a/.changes/feat-exists-api.md b/.changes/feat-exists-api.md new file mode 100644 index 00000000000..9b2c0af6002 --- /dev/null +++ b/.changes/feat-exists-api.md @@ -0,0 +1,6 @@ +--- +"api": minor +"tauri": minor +--- + +Add `exists` function to the fs module. \ No newline at end of file diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index 2a2098fa6fa..664d76ba84a 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -1204,6 +1204,9 @@ pub struct FsAllowlistConfig { /// Rename file from local filesystem. #[serde(default, alias = "rename-file")] pub rename_file: bool, + /// Check if path exists on the local filesystem. + #[serde(default)] + pub exists: bool, } impl Allowlist for FsAllowlistConfig { @@ -1219,6 +1222,7 @@ impl Allowlist for FsAllowlistConfig { remove_dir: true, remove_file: true, rename_file: true, + exists: true, }; let mut features = allowlist.to_features(); features.push("fs-all"); @@ -1238,6 +1242,7 @@ impl Allowlist for FsAllowlistConfig { check_feature!(self, features, remove_dir, "fs-remove-dir"); check_feature!(self, features, remove_file, "fs-remove-file"); check_feature!(self, features, rename_file, "fs-rename-file"); + check_feature!(self, features, exists, "fs-exists"); features } } diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index d1a4752ae98..bdce806d305 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -195,6 +195,7 @@ dialog-save = [ "dialog" ] fs-all = [ "fs-copy-file", "fs-create-dir", + "fs-exists", "fs-read-file", "fs-read-dir", "fs-remove-dir", @@ -204,6 +205,7 @@ fs-all = [ ] fs-copy-file = [ ] fs-create-dir = [ ] +fs-exists = [ ] fs-read-file = [ ] fs-read-dir = [ ] fs-remove-dir = [ ] diff --git a/core/tauri/build.rs b/core/tauri/build.rs index e6fbb821081..c1093e2f22a 100644 --- a/core/tauri/build.rs +++ b/core/tauri/build.rs @@ -59,6 +59,7 @@ fn main() { "remove-dir", "remove-file", "rename-file", + "exists", ], api_all, ); diff --git a/core/tauri/scripts/bundle.js b/core/tauri/scripts/bundle.js index d97008fb752..52bd739e62e 100644 --- a/core/tauri/scripts/bundle.js +++ b/core/tauri/scripts/bundle.js @@ -1 +1 @@ -function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;R(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}("object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports:{});try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}function r(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]&&arguments[1],a=n(),o="_".concat(a);return Object.defineProperty(window,o,{value:function(n){return t&&Reflect.deleteProperty(window,o),r([e,"optionalCall",function(e){return e(n)}])},writable:!1,configurable:!0}),a}function o(e){return i.apply(this,arguments)}function i(){return i=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=a((function(t){e(t),Reflect.deleteProperty(window,"_".concat(i))}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,"_".concat(o))}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)}))),i.apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asset",r=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?"https://".concat(t,".localhost/").concat(r):"".concat(t,"://").concat(r)}});function s(e){return c.apply(this,arguments)}function c(){return(c=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o("tauri",t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppName"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getTauriVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var h=Object.freeze({__proto__:null,getName:function(){return l.apply(this,arguments)},getVersion:function(){return p.apply(this,arguments)},getTauriVersion:function(){return f.apply(this,arguments)}});function d(){return(d=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Cli",message:{cmd:"cliMatches"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var m=Object.freeze({__proto__:null,getMatches:function(){return d.apply(this,arguments)}});function _(){return(_=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(){return(y=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var g=Object.freeze({__proto__:null,writeText:function(e){return _.apply(this,arguments)},readText:function(){return y.apply(this,arguments)}});function v(e){for(var t=void 0,r=e[0],n=1;n0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)}))),w.apply(this,arguments)}function b(){return b=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}}));case 3:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}function R(){return R=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:v([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:v([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)}))),R.apply(this,arguments)}function k(){return k=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:v([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:v([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)}))),k.apply(this,arguments)}function x(){return x=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:v([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:v([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}var T,G=Object.freeze({__proto__:null,open:function(){return w.apply(this,arguments)},save:function(){return b.apply(this,arguments)},message:function(e,t){return R.apply(this,arguments)},ask:function(e,t){return k.apply(this,arguments)},confirm:function(e,t){return x.apply(this,arguments)}});function P(e,t){return O.apply(this,arguments)}function O(){return O=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:r}}));case 1:case"end":return e.stop()}}),e)}))),O.apply(this,arguments)}function M(e,t,r){return A.apply(this,arguments)}function A(){return A=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:r,payload:"string"==typeof n?n:JSON.stringify(n)}});case 2:case"end":return e.stop()}}),e)}))),A.apply(this,arguments)}function E(e,t,r){return L.apply(this,arguments)}function L(){return L=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:r,handler:a(n)}}).then((function(e){return _asyncToGenerator(_regeneratorRuntime().mark((function r(){return _regeneratorRuntime().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",P(t,e));case 1:case"end":return r.stop()}}),r)})))})));case 1:case"end":return e.stop()}}),e)}))),L.apply(this,arguments)}function D(e,t,r){return C.apply(this,arguments)}function C(){return C=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",E(t,r,(function(e){n(e),P(t,e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)}))),C.apply(this,arguments)}function S(e,t){return j.apply(this,arguments)}function j(){return j=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",E(t,null,r));case 1:case"end":return e.stop()}}),e)}))),j.apply(this,arguments)}function W(e,t){return N.apply(this,arguments)}function N(){return N=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",D(t,null,r));case 1:case"end":return e.stop()}}),e)}))),N.apply(this,arguments)}function I(e,t){return z.apply(this,arguments)}function z(){return z=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M(t,void 0,r));case 1:case"end":return e.stop()}}),e)}))),z.apply(this,arguments)}!function(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.CHECK_UPDATE="tauri://update";e.UPDATE_AVAILABLE="tauri://update-available";e.INSTALL_UPDATE="tauri://update-install";e.STATUS_UPDATE="tauri://update-status";e.DOWNLOAD_PROGRESS="tauri://update-download-progress"}(T||(T={}));var F,U=Object.freeze({__proto__:null,listen:S,once:W,emit:I});function H(e,t){return null!=e?e:t()}function V(){return V=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),V.apply(this,arguments)}function B(){return B=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}});case 3:return n=e.sent,e.abrupt("return",Uint8Array.from(n));case 5:case"end":return e.stop()}}),e)}))),B.apply(this,arguments)}function q(e,t,r){return J.apply(this,arguments)}function J(){return J=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var a,o;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(n)&&Object.freeze(n),"object"===_typeof(t)&&Object.freeze(t),a={path:"",contents:""},o=n,"string"==typeof t?a.path=t:(a.path=t.path,a.contents=t.contents),"string"==typeof r?a.contents=H(r,(function(){return""})):o=r,e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:a.path,contents:Array.from((new TextEncoder).encode(a.contents)),options:o}}));case 7:case"end":return e.stop()}}),e)}))),J.apply(this,arguments)}function K(){return K=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var a,o;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(n)&&Object.freeze(n),"object"===_typeof(t)&&Object.freeze(t),a={path:"",contents:[]},o=n,"string"==typeof t?a.path=t:(a.path=t.path,a.contents=t.contents),r&&"dir"in r?o=r:"string"==typeof t&&(a.contents=H(r,(function(){return[]}))),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:a.path,contents:Array.from(a.contents instanceof ArrayBuffer?new Uint8Array(a.contents):a.contents),options:o}}));case 7:case"end":return e.stop()}}),e)}))),K.apply(this,arguments)}function Y(){return Y=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Y.apply(this,arguments)}function Q(){return Q=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Q.apply(this,arguments)}function Z(){return Z=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Z.apply(this,arguments)}function $(){return $=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:r,options:n}}));case 2:case"end":return e.stop()}}),e)}))),$.apply(this,arguments)}function X(){return X=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),X.apply(this,arguments)}function ee(){return ee=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:r,options:n}}));case 2:case"end":return e.stop()}}),e)}))),ee.apply(this,arguments)}!function(e){e[e.Audio=1]="Audio";e[e.Cache=2]="Cache";e[e.Config=3]="Config";e[e.Data=4]="Data";e[e.LocalData=5]="LocalData";e[e.Desktop=6]="Desktop";e[e.Document=7]="Document";e[e.Download=8]="Download";e[e.Executable=9]="Executable";e[e.Font=10]="Font";e[e.Home=11]="Home";e[e.Picture=12]="Picture";e[e.Public=13]="Public";e[e.Runtime=14]="Runtime";e[e.Template=15]="Template";e[e.Video=16]="Video";e[e.Resource=17]="Resource";e[e.App=18]="App";e[e.Log=19]="Log";e[e.Temp=20]="Temp"}(F||(F={}));var te=Object.freeze({__proto__:null,get BaseDirectory(){return F},get Dir(){return F},readTextFile:function(e){return V.apply(this,arguments)},readBinaryFile:function(e){return B.apply(this,arguments)},writeTextFile:q,writeFile:q,writeBinaryFile:function(e,t,r){return K.apply(this,arguments)},readDir:function(e){return Y.apply(this,arguments)},createDir:function(e){return Q.apply(this,arguments)},removeDir:function(e){return Z.apply(this,arguments)},copyFile:function(e,t){return $.apply(this,arguments)},removeFile:function(e){return X.apply(this,arguments)},renameFile:function(e,t){return ee.apply(this,arguments)}});function re(){return(re=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ne(){return(ne=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ae(){return(ae=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oe(){return(oe=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ie(){return(ie=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ue,se=Object.freeze({__proto__:null,register:function(e,t){return re.apply(this,arguments)},registerAll:function(e,t){return ne.apply(this,arguments)},isRegistered:function(e){return ae.apply(this,arguments)},unregister:function(e){return oe.apply(this,arguments)},unregisterAll:function(){return ie.apply(this,arguments)}});function ce(e,t){return null!=e?e:t()}function pe(e){for(var t=void 0,r=e[0],n=1;n=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data})),he=function(){function e(t){_classCallCheck(this,e),this.id=t}var t,r,n,a,o,i,u;return _createClass(e,[{key:"drop",value:(u=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"request",value:(i=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=!t.responseType||t.responseType===ue.JSON)&&(t.responseType=ue.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new fe(e);if(r){try{t.data=JSON.parse(t.data)}catch(e){if(t.ok&&""===t.data)t.data={};else if(t.ok)throw Error("Failed to parse response `".concat(t.data,"` as JSON: ").concat(e,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return t}return t})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"get",value:(o=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"GET",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"post",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"POST",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"put",value:(n=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PUT",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PATCH",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"delete",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"DELETE",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function de(e){return me.apply(this,arguments)}function me(){return(me=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(e){return new he(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _e=null;function ye(){return(ye=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==_e){e.next=4;break}return e.next=3,de();case 3:_e=e.sent;case 4:return e.abrupt("return",_e.request(_objectSpread({url:t,method:ce(pe([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ge=Object.freeze({__proto__:null,getClient:de,fetch:function(e,t){return ye.apply(this,arguments)},Body:le,Client:he,Response:fe,get ResponseType(){return ue}});function ve(){return(ve=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("default"===window.Notification.permission){e.next=2;break}return e.abrupt("return",Promise.resolve("granted"===window.Notification.permission));case 2:return e.abrupt("return",s({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function we(){return(we=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var be=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return we.apply(this,arguments)},isPermissionGranted:function(){return ve.apply(this,arguments)}});function Re(){return navigator.appVersion.includes("Win")}function ke(){return(ke=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xe(){return(xe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Audio}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return(Te=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(){return(Ge=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Config}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){return(Pe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Desktop}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(){return(Me=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(){return(Ae=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return(Ee=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Executable}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(){return(Le=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Font}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Home}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(){return(Ce=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.LocalData}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Picture}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(){return(je=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Public}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(){return(We=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ne(){return(Ne=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:t,directory:F.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ie(){return(Ie=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Runtime}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){return(ze=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Template}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fe(){return(Fe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Video}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ue(){return(Ue=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var He=Re()?"\\":"/",Ve=Re()?";":":";function Be(){return Be=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,r=new Array(t),n=0;n0&&void 0!==r[0]?r[0]:0,e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}}));case 2:case"end":return e.stop()}}),e)}))),Xe.apply(this,arguments)}function et(){return(et=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var tt=Object.freeze({__proto__:null,exit:function(){return Xe.apply(this,arguments)},relaunch:function(){return et.apply(this,arguments)}});function rt(e,t){return null!=e?e:t()}function nt(e,t){return at.apply(this,arguments)}function at(){return at=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,o,i=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3?i[3]:void 0,"object"===_typeof(n)&&Object.freeze(n),e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"execute",program:r,args:n,options:o,onEventFn:a(t)}}));case 4:case"end":return e.stop()}}),e)}))),at.apply(this,arguments)}var ot=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addListener",value:function(e,t){return this.on(e,t)}},{key:"removeListener",value:function(e,t){return this.off(e,t)}},{key:"on",value:function(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}},{key:"once",value:function(e,t){var r=this;return this.addListener(e,(function n(){r.removeListener(e,n),t.apply(void 0,arguments)}))}},{key:"off",value:function(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((function(e){return e!==t}))),this}},{key:"removeAllListeners",value:function(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}},{key:"emit",value:function(e){if(e in this.eventListeners){for(var t=this.eventListeners[e],r=arguments.length,n=new Array(r>1?r-1:0),a=1;a1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;return _classCallCheck(this,a),t=n.call(this),a.prototype.__init2.call(_assertThisInitialized(t)),a.prototype.__init3.call(_assertThisInitialized(t)),t.program=e,t.args="string"==typeof r?[r]:r,t.options=rt(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new ot}},{key:"__init3",value:function(){this.stderr=new ot}},{key:"spawn",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",nt((function(e){switch(e.event){case"Error":t.emit("error",e.payload);break;case"Terminated":t.emit("close",e.payload);break;case"Stdout":t.stdout.emit("data",e.payload);break;case"Stderr":t.stderr.emit("data",e.payload)}}),this.program,this.args,this.options).then((function(e){return new it(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"execute",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){t.on("error",r);var n=[],a=[];t.stdout.on("data",(function(e){n.push(e)})),t.stderr.on("data",(function(e){a.push(e)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:n.join("\n"),stderr:a.join("\n")})})),t.spawn().catch(r)})));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}],[{key:"sidecar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=new a(e,t,r);return n.options.sidecar=!0,n}}]),a}(ot);function st(){return st=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"open",path:t,with:r}}));case 1:case"end":return e.stop()}}),e)}))),st.apply(this,arguments)}var ct=Object.freeze({__proto__:null,Command:ut,Child:it,EventEmitter:ot,open:function(e,t){return st.apply(this,arguments)}});function pt(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,r),n=t.call(this,e),_t([a,"optionalAccess",function(e){return e.skip}])||s({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:_objectSpread({label:e},a)}}}).then(_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://created"));case 1:case"end":return e.stop()}}),e)})))).catch(function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://error",t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n}return _createClass(r,null,[{key:"getByLabel",value:function(e){return Rt().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(Gt);function Mt(){return(Mt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function At(){return(At=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Et(){return(Et=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"__TAURI_METADATA__"in window?kt=new Ot(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),kt=new Ot("main",{skip:!0}));var Lt=Object.freeze({__proto__:null,WebviewWindow:Ot,WebviewWindowHandle:Tt,WindowManager:Gt,CloseRequestedEvent:Pt,getCurrent:function(){return new Ot(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},getAll:Rt,get appWindow(){return kt},LogicalSize:gt,PhysicalSize:vt,LogicalPosition:wt,PhysicalPosition:bt,get UserAttentionType(){return yt},currentMonitor:function(){return Mt.apply(this,arguments)},primaryMonitor:function(){return At.apply(this,arguments)},availableMonitors:function(){return Et.apply(this,arguments)}}),Dt=Re()?"\r\n":"\n";function Ct(){return(Ct=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"platform"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function St(){return(St=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"version"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jt(){return(jt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"osType"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wt(){return(Wt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nt(){return(Nt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"tempdir"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var It=Object.freeze({__proto__:null,EOL:Dt,platform:function(){return Ct.apply(this,arguments)},version:function(){return St.apply(this,arguments)},type:function(){return jt.apply(this,arguments)},arch:function(){return Wt.apply(this,arguments)},tempdir:function(){return Nt.apply(this,arguments)}}),zt=o;e.app=h,e.cli=m,e.clipboard=g,e.dialog=G,e.event=U,e.fs=te,e.globalShortcut=se,e.http=ge,e.invoke=zt,e.notification=be,e.os=It,e.path=$e,e.process=tt,e.shell=ct,e.tauri=u,e.updater=mt,e.window=Lt,Object.defineProperty(e,"__esModule",{value:!0})})); +function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;R(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}("object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports:{});try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}function r(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]&&arguments[1],a=n(),o="_".concat(a);return Object.defineProperty(window,o,{value:function(n){return t&&Reflect.deleteProperty(window,o),r([e,"optionalCall",function(e){return e(n)}])},writable:!1,configurable:!0}),a}function o(e){return i.apply(this,arguments)}function i(){return i=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=a((function(t){e(t),Reflect.deleteProperty(window,"_".concat(i))}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,"_".concat(o))}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)}))),i.apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asset",r=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?"https://".concat(t,".localhost/").concat(r):"".concat(t,"://").concat(r)}});function s(e){return c.apply(this,arguments)}function c(){return(c=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",o("tauri",t));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getAppName"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(){return(f=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"App",message:{cmd:"getTauriVersion"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var h=Object.freeze({__proto__:null,getName:function(){return l.apply(this,arguments)},getVersion:function(){return p.apply(this,arguments)},getTauriVersion:function(){return f.apply(this,arguments)}});function d(){return(d=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Cli",message:{cmd:"cliMatches"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var m=Object.freeze({__proto__:null,getMatches:function(){return d.apply(this,arguments)}});function _(){return(_=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(){return(y=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var g=Object.freeze({__proto__:null,writeText:function(e){return _.apply(this,arguments)},readText:function(){return y.apply(this,arguments)}});function v(e){for(var t=void 0,r=e[0],n=1;n0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)}))),w.apply(this,arguments)}function b(){return b=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(t=r.length>0&&void 0!==r[0]?r[0]:{})&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}}));case 3:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}function R(){return R=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:v([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:v([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)}))),R.apply(this,arguments)}function k(){return k=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:v([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:v([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)}))),k.apply(this,arguments)}function x(){return x=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="string"==typeof r?{title:r}:r,e.abrupt("return",s({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:v([n,"optionalAccess",function(e){return e.title},"optionalAccess",function(e){return e.toString},"call",function(e){return e()}]),type:v([n,"optionalAccess",function(e){return e.type}])}}));case 2:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}var T,G=Object.freeze({__proto__:null,open:function(){return w.apply(this,arguments)},save:function(){return b.apply(this,arguments)},message:function(e,t){return R.apply(this,arguments)},ask:function(e,t){return k.apply(this,arguments)},confirm:function(e,t){return x.apply(this,arguments)}});function P(e,t){return O.apply(this,arguments)}function O(){return O=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:r}}));case 1:case"end":return e.stop()}}),e)}))),O.apply(this,arguments)}function M(e,t,r){return E.apply(this,arguments)}function E(){return E=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:r,payload:"string"==typeof n?n:JSON.stringify(n)}});case 2:case"end":return e.stop()}}),e)}))),E.apply(this,arguments)}function A(e,t,r){return L.apply(this,arguments)}function L(){return L=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:r,handler:a(n)}}).then((function(e){return _asyncToGenerator(_regeneratorRuntime().mark((function r(){return _regeneratorRuntime().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",P(t,e));case 1:case"end":return r.stop()}}),r)})))})));case 1:case"end":return e.stop()}}),e)}))),L.apply(this,arguments)}function D(e,t,r){return C.apply(this,arguments)}function C(){return C=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",A(t,r,(function(e){n(e),P(t,e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)}))),C.apply(this,arguments)}function S(e,t){return j.apply(this,arguments)}function j(){return j=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",A(t,null,r));case 1:case"end":return e.stop()}}),e)}))),j.apply(this,arguments)}function W(e,t){return N.apply(this,arguments)}function N(){return N=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",D(t,null,r));case 1:case"end":return e.stop()}}),e)}))),N.apply(this,arguments)}function I(e,t){return z.apply(this,arguments)}function z(){return z=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M(t,void 0,r));case 1:case"end":return e.stop()}}),e)}))),z.apply(this,arguments)}!function(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.CHECK_UPDATE="tauri://update";e.UPDATE_AVAILABLE="tauri://update-available";e.INSTALL_UPDATE="tauri://update-install";e.STATUS_UPDATE="tauri://update-status";e.DOWNLOAD_PROGRESS="tauri://update-download-progress"}(T||(T={}));var F,U=Object.freeze({__proto__:null,get TauriEvent(){return T},listen:S,once:W,emit:I});function H(e,t){return null!=e?e:t()}function V(){return V=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),V.apply(this,arguments)}function B(){return B=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,s({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:r}});case 3:return n=e.sent,e.abrupt("return",Uint8Array.from(n));case 5:case"end":return e.stop()}}),e)}))),B.apply(this,arguments)}function q(e,t,r){return J.apply(this,arguments)}function J(){return J=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var a,o;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(n)&&Object.freeze(n),"object"===_typeof(t)&&Object.freeze(t),a={path:"",contents:""},o=n,"string"==typeof t?a.path=t:(a.path=t.path,a.contents=t.contents),"string"==typeof r?a.contents=H(r,(function(){return""})):o=r,e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:a.path,contents:Array.from((new TextEncoder).encode(a.contents)),options:o}}));case 7:case"end":return e.stop()}}),e)}))),J.apply(this,arguments)}function K(){return K=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){var a,o;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(n)&&Object.freeze(n),"object"===_typeof(t)&&Object.freeze(t),a={path:"",contents:[]},o=n,"string"==typeof t?a.path=t:(a.path=t.path,a.contents=t.contents),r&&"dir"in r?o=r:"string"==typeof t&&(a.contents=H(r,(function(){return[]}))),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:a.path,contents:Array.from(a.contents instanceof ArrayBuffer?new Uint8Array(a.contents):a.contents),options:o}}));case 7:case"end":return e.stop()}}),e)}))),K.apply(this,arguments)}function Y(){return Y=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Y.apply(this,arguments)}function Q(){return Q=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Q.apply(this,arguments)}function Z(){return Z=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),Z.apply(this,arguments)}function $(){return $=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:r,options:n}}));case 2:case"end":return e.stop()}}),e)}))),$.apply(this,arguments)}function X(){return X=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),X.apply(this,arguments)}function ee(){return ee=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:r,options:n}}));case 2:case"end":return e.stop()}}),e)}))),ee.apply(this,arguments)}function te(){return te=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"exists",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)}))),te.apply(this,arguments)}!function(e){e[e.Audio=1]="Audio";e[e.Cache=2]="Cache";e[e.Config=3]="Config";e[e.Data=4]="Data";e[e.LocalData=5]="LocalData";e[e.Desktop=6]="Desktop";e[e.Document=7]="Document";e[e.Download=8]="Download";e[e.Executable=9]="Executable";e[e.Font=10]="Font";e[e.Home=11]="Home";e[e.Picture=12]="Picture";e[e.Public=13]="Public";e[e.Runtime=14]="Runtime";e[e.Template=15]="Template";e[e.Video=16]="Video";e[e.Resource=17]="Resource";e[e.App=18]="App";e[e.Log=19]="Log";e[e.Temp=20]="Temp"}(F||(F={}));var re=Object.freeze({__proto__:null,get BaseDirectory(){return F},get Dir(){return F},readTextFile:function(e){return V.apply(this,arguments)},readBinaryFile:function(e){return B.apply(this,arguments)},writeTextFile:q,writeFile:q,writeBinaryFile:function(e,t,r){return K.apply(this,arguments)},readDir:function(e){return Y.apply(this,arguments)},createDir:function(e){return Q.apply(this,arguments)},removeDir:function(e){return Z.apply(this,arguments)},copyFile:function(e,t){return $.apply(this,arguments)},removeFile:function(e){return X.apply(this,arguments)},renameFile:function(e,t){return ee.apply(this,arguments)},exists:function(e){return te.apply(this,arguments)}});function ne(){return(ne=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ae(){return(ae=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:a(r)}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oe(){return(oe=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ie(){return(ie=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ue(){return(ue=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var se,ce=Object.freeze({__proto__:null,register:function(e,t){return ne.apply(this,arguments)},registerAll:function(e,t){return ae.apply(this,arguments)},isRegistered:function(e){return oe.apply(this,arguments)},unregister:function(e){return ie.apply(this,arguments)},unregisterAll:function(){return ue.apply(this,arguments)}});function pe(e,t){return null!=e?e:t()}function le(e){for(var t=void 0,r=e[0],n=1;n=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data})),de=function(){function e(t){_classCallCheck(this,e),this.id=t}var t,r,n,a,o,i,u;return _createClass(e,[{key:"drop",value:(u=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"request",value:(i=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=!t.responseType||t.responseType===se.JSON)&&(t.responseType=se.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new he(e);if(r){try{t.data=JSON.parse(t.data)}catch(e){if(t.ok&&""===t.data)t.data={};else if(t.ok)throw Error("Failed to parse response `".concat(t.data,"` as JSON: ").concat(e,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return t}return t})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"get",value:(o=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"GET",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"post",value:(a=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"POST",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return a.apply(this,arguments)})},{key:"put",value:(n=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r,n){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PUT",url:t,body:r},n)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"patch",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"PATCH",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"delete",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.request(_objectSpread({method:"DELETE",url:t},r)));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function me(e){return _e.apply(this,arguments)}function _e(){return(_e=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(e){return new de(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ye=null;function ge(){return(ge=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==ye){e.next=4;break}return e.next=3,me();case 3:ye=e.sent;case 4:return e.abrupt("return",ye.request(_objectSpread({url:t,method:pe(le([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ve=Object.freeze({__proto__:null,getClient:me,fetch:function(e,t){return ge.apply(this,arguments)},Body:fe,Client:de,Response:he,get ResponseType(){return se}});function we(){return(we=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("default"===window.Notification.permission){e.next=2;break}return e.abrupt("return",Promise.resolve("granted"===window.Notification.permission));case 2:return e.abrupt("return",s({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(){return(be=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Re=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return be.apply(this,arguments)},isPermissionGranted:function(){return we.apply(this,arguments)}});function ke(){return navigator.appVersion.includes("Win")}function xe(){return(xe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Te(){return(Te=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Audio}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ge(){return(Ge=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){return(Pe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Config}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(){return(Me=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Desktop}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return(Ee=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ae(){return(Ae=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Le(){return(Le=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Executable}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function De(){return(De=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Font}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(){return(Ce=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Home}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Se(){return(Se=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.LocalData}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function je(){return(je=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Picture}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function We(){return(We=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Public}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ne(){return(Ne=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ie(){return(Ie=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:t,directory:F.Resource}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){return(ze=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Runtime}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fe(){return(Fe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Template}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ue(){return(Ue=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Video}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function He(){return(He=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:F.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ve=ke()?"\\":"/",Be=ke()?";":":";function qe(){return qe=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t,r,n,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,r=new Array(t),n=0;n0&&void 0!==r[0]?r[0]:0,e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}}));case 2:case"end":return e.stop()}}),e)}))),et.apply(this,arguments)}function tt(){return(tt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var rt=Object.freeze({__proto__:null,exit:function(){return et.apply(this,arguments)},relaunch:function(){return tt.apply(this,arguments)}});function nt(e,t){return null!=e?e:t()}function at(e,t){return ot.apply(this,arguments)}function ot(){return ot=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){var n,o,i=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3?i[3]:void 0,"object"===_typeof(n)&&Object.freeze(n),e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"execute",program:r,args:n,options:o,onEventFn:a(t)}}));case 4:case"end":return e.stop()}}),e)}))),ot.apply(this,arguments)}var it=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addListener",value:function(e,t){return this.on(e,t)}},{key:"removeListener",value:function(e,t){return this.off(e,t)}},{key:"on",value:function(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}},{key:"once",value:function(e,t){var r=this;return this.addListener(e,(function n(){r.removeListener(e,n),t.apply(void 0,arguments)}))}},{key:"off",value:function(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((function(e){return e!==t}))),this}},{key:"removeAllListeners",value:function(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}},{key:"emit",value:function(e){if(e in this.eventListeners){for(var t=this.eventListeners[e],r=arguments.length,n=new Array(r>1?r-1:0),a=1;a1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0;return _classCallCheck(this,a),t=n.call(this),a.prototype.__init2.call(_assertThisInitialized(t)),a.prototype.__init3.call(_assertThisInitialized(t)),t.program=e,t.args="string"==typeof r?[r]:r,t.options=nt(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new it}},{key:"__init3",value:function(){this.stderr=new it}},{key:"spawn",value:(r=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",at((function(e){switch(e.event){case"Error":t.emit("error",e.payload);break;case"Terminated":t.emit("close",e.payload);break;case"Stdout":t.stdout.emit("data",e.payload);break;case"Stderr":t.stderr.emit("data",e.payload)}}),this.program,this.args,this.options).then((function(e){return new ut(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"execute",value:(t=_asyncToGenerator(_regeneratorRuntime().mark((function e(){var t=this;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){t.on("error",r);var n=[],a=[];t.stdout.on("data",(function(e){n.push(e)})),t.stderr.on("data",(function(e){a.push(e)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:n.join("\n"),stderr:a.join("\n")})})),t.spawn().catch(r)})));case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})}],[{key:"sidecar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=new a(e,t,r);return n.options.sidecar=!0,n}}]),a}(it);function ct(){return ct=_asyncToGenerator(_regeneratorRuntime().mark((function e(t,r){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"open",path:t,with:r}}));case 1:case"end":return e.stop()}}),e)}))),ct.apply(this,arguments)}var pt=Object.freeze({__proto__:null,Command:st,Child:ut,EventEmitter:it,open:function(e,t){return ct.apply(this,arguments)}});function lt(e){for(var t=void 0,r=e[0],n=1;n1&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,r),n=t.call(this,e),yt([a,"optionalAccess",function(e){return e.skip}])||s({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:_objectSpread({label:e},a)}}}).then(_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://created"));case 1:case"end":return e.stop()}}),e)})))).catch(function(){var e=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n.emit("tauri://error",t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),n}return _createClass(r,null,[{key:"getByLabel",value:function(e){return kt().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(Pt);function Et(){return(Et=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function At(){return(At=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lt(){return(Lt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}"__TAURI_METADATA__"in window?xt=new Mt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),xt=new Mt("main",{skip:!0}));var Dt=Object.freeze({__proto__:null,WebviewWindow:Mt,WebviewWindowHandle:Gt,WindowManager:Pt,CloseRequestedEvent:Ot,getCurrent:function(){return new Mt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},getAll:kt,get appWindow(){return xt},LogicalSize:vt,PhysicalSize:wt,LogicalPosition:bt,PhysicalPosition:Rt,get UserAttentionType(){return gt},currentMonitor:function(){return Et.apply(this,arguments)},primaryMonitor:function(){return At.apply(this,arguments)},availableMonitors:function(){return Lt.apply(this,arguments)}}),Ct=ke()?"\r\n":"\n";function St(){return(St=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"platform"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jt(){return(jt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"version"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wt(){return(Wt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"osType"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Nt(){return(Nt=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function It(){return(It=_asyncToGenerator(_regeneratorRuntime().mark((function e(){return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Os",message:{cmd:"tempdir"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var zt=Object.freeze({__proto__:null,EOL:Ct,platform:function(){return St.apply(this,arguments)},version:function(){return jt.apply(this,arguments)},type:function(){return Wt.apply(this,arguments)},arch:function(){return Nt.apply(this,arguments)},tempdir:function(){return It.apply(this,arguments)}}),Ft=o;e.app=h,e.cli=m,e.clipboard=g,e.dialog=G,e.event=U,e.fs=re,e.globalShortcut=ce,e.http=ve,e.invoke=Ft,e.notification=Re,e.os=zt,e.path=Xe,e.process=rt,e.shell=pt,e.tauri=u,e.updater=_t,e.window=Dt,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/core/tauri/src/endpoints/file_system.rs b/core/tauri/src/endpoints/file_system.rs index fa8e4a1e838..23efbf09da2 100644 --- a/core/tauri/src/endpoints/file_system.rs +++ b/core/tauri/src/endpoints/file_system.rs @@ -114,6 +114,12 @@ pub(crate) enum Cmd { new_path: SafePathBuf, options: Option, }, + /// The exists API. + #[cmd(fs_exists, "fs > exists")] + Exists { + path: SafePathBuf, + options: Option, + }, } impl Cmd { @@ -339,6 +345,22 @@ impl Cmd { .with_context(|| format!("old: {}, new: {}", old.display(), new.display())) .map_err(Into::into) } + + #[module_command_handler(fs_exists)] + fn exists( + context: InvokeContext, + path: SafePathBuf, + options: Option, + ) -> super::Result { + let resolved_path = resolve_path( + &context.config, + &context.package_info, + &context.window, + path, + options.and_then(|o| o.dir), + )?; + Ok(resolved_path.as_ref().exists()) + } } #[allow(dead_code)] @@ -474,4 +496,11 @@ mod tests { ); crate::test_utils::assert_not_allowlist_error(res); } + + #[tauri_macros::module_command_test(fs_exists, "fs > exists")] + #[quickcheck_macros::quickcheck] + fn exists(path: SafePathBuf, options: Option) { + let res = super::Cmd::exists(crate::test::mock_invoke_context(), path, options); + crate::test_utils::assert_not_allowlist_error(res); + } } diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index 81dc666f12a..06e690d0df3 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -69,6 +69,7 @@ //! - **fs-all**: Enables all [Filesystem APIs](https://tauri.app/en/docs/api/js/modules/fs). //! - **fs-copy-file**: Enables the [`copyFile` API](https://tauri.app/en/docs/api/js/modules/fs#copyfile). //! - **fs-create-dir**: Enables the [`createDir` API](https://tauri.app/en/docs/api/js/modules/fs#createdir). +//! - **fs-exists**: Enables the [`exists` API](https://tauri.app/en/docs/api/js/modules/fs#exists). //! - **fs-read-dir**: Enables the [`readDir` API](https://tauri.app/en/docs/api/js/modules/fs#readdir). //! - **fs-read-file**: Enables the [`readTextFile` API](https://tauri.app/en/docs/api/js/modules/fs#readtextfile) and the [`readBinaryFile` API](https://tauri.app/en/docs/api/js/modules/fs#readbinaryfile). //! - **fs-remove-dir**: Enables the [`removeDir` API](https://tauri.app/en/docs/api/js/modules/fs#removedir). diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index 7ed23367835..5ccf516db42 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,44 +1,44 @@ -const Zl=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerpolicy&&(l.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?l.credentials="include":o.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}};Zl();function J(){}function vl(t){return t()}function Io(){return Object.create(null)}function pe(t){t.forEach(vl)}function $l(t){return typeof t=="function"}function ke(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Un;function er(t,e){return Un||(Un=document.createElement("a")),Un.href=e,t===Un.href}function tr(t){return Object.keys(t).length===0}function nr(t,...e){if(t==null)return J;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function _l(t,e,n){t.$$.on_destroy.push(nr(e,n))}function r(t,e){t.appendChild(e)}function m(t,e,n){t.insertBefore(e,n||null)}function h(t){t.parentNode.removeChild(t)}function dt(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function Xn(t){return function(e){return e.preventDefault(),t.call(this,e)}}function a(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function se(t){return t===""?null:+t}function or(t){return Array.from(t.childNodes)}function Z(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function G(t,e){t.value=e==null?"":e}function zt(t,e){for(let n=0;n{Vn.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}function Kn(t){t&&t.c()}function Vt(t,e,n,i){const{fragment:o,on_mount:l,on_destroy:u,after_update:f}=t.$$;o&&o.m(e,n),i||Lt(()=>{const c=l.map(vl).filter($l);u?u.push(...c):pe(c),t.$$.on_mount=[]}),f.forEach(Lt)}function Gt(t,e){const n=t.$$;n.fragment!==null&&(pe(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ar(t,e){t.$$.dirty[0]===-1&&(Ut.push(t),sr(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=y.length?y[0]:_;return p.ctx&&o(p.ctx[k],p.ctx[k]=g)&&(!p.skip_bound&&p.bound[k]&&p.bound[k](g),d&&ar(t,k)),_}):[],p.update(),d=!0,pe(p.before_update),p.fragment=i?i(p.ctx):!1,e.target){if(e.hydrate){const k=or(e.target);p.fragment&&p.fragment.l(k),k.forEach(h)}else p.fragment&&p.fragment.c();e.intro&&Ee(t.$$.fragment),Vt(t,e.target,e.anchor,e.customElement),gl()}qt(c)}class Se{$destroy(){Gt(this,1),this.$destroy=J}$on(e,n){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!tr(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ct=[];function yl(t,e=J){let n;const i=new Set;function o(f){if(ke(t,f)&&(t=f,n)){const c=!Ct.length;for(const p of i)p[1](),Ct.push(p,t);if(c){for(let p=0;p{i.delete(p),i.size===0&&(n(),n=null)}}return{set:o,update:l,subscribe:u}}var Ei=function(t,e){return Ei=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},Ei(t,e)};function ji(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ei(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var ue=function(){return ue=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){u=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerpolicy&&(l.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?l.credentials="include":o.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}};$l();function J(){}function _l(t){return t()}function Uo(){return Object.create(null)}function pe(t){t.forEach(_l)}function er(t){return typeof t=="function"}function Me(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Fn;function tr(t,e){return Fn||(Fn=document.createElement("a")),Fn.href=e,t===Fn.href}function nr(t){return Object.keys(t).length===0}function ir(t,...e){if(t==null)return J;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function bl(t,e,n){t.$$.on_destroy.push(ir(e,n))}function r(t,e){t.appendChild(e)}function m(t,e,n){t.insertBefore(e,n||null)}function h(t){t.parentNode.removeChild(t)}function pt(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function Yn(t){return function(e){return e.preventDefault(),t.call(this,e)}}function a(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function se(t){return t===""?null:+t}function lr(t){return Array.from(t.childNodes)}function Z(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function G(t,e){t.value=e==null?"":e}function Ot(t,e){for(let n=0;n{Gn.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}function xn(t){t&&t.c()}function Gt(t,e,n,i){const{fragment:o,on_mount:l,on_destroy:u,after_update:f}=t.$$;o&&o.m(e,n),i||At(()=>{const c=l.map(_l).filter(er);u?u.push(...c):pe(c),t.$$.on_mount=[]}),f.forEach(At)}function Jt(t,e){const n=t.$$;n.fragment!==null&&(pe(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function cr(t,e){t.$$.dirty[0]===-1&&(Ft.push(t),ur(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=y.length?y[0]:_;return p.ctx&&o(p.ctx[k],p.ctx[k]=g)&&(!p.skip_bound&&p.bound[k]&&p.bound[k](g),d&&cr(t,k)),_}):[],p.update(),d=!0,pe(p.before_update),p.fragment=i?i(p.ctx):!1,e.target){if(e.hydrate){const k=lr(e.target);p.fragment&&p.fragment.l(k),k.forEach(h)}else p.fragment&&p.fragment.c();e.intro&&We(t.$$.fragment),Gt(t,e.target,e.anchor,e.customElement),yl()}Bt(c)}class Se{$destroy(){Jt(this,1),this.$destroy=J}$on(e,n){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!nr(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Lt=[];function wl(t,e=J){let n;const i=new Set;function o(f){if(Me(t,f)&&(t=f,n)){const c=!Lt.length;for(const p of i)p[1](),Lt.push(p,t);if(c){for(let p=0;p{i.delete(p),i.size===0&&(n(),n=null)}}return{set:o,update:l,subscribe:u}}var Wi=function(t,e){return Wi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},Wi(t,e)};function Ii(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Wi(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var ue=function(){return ue=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){u=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]@tauri-apps/api package. It's used as the main validation app, serving as the test bed of our +`;function Pl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,A({__tauriModule:"Os",message:{cmd:"platform"}})]})})}function _r(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,A({__tauriModule:"Os",message:{cmd:"version"}})]})})}function br(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,A({__tauriModule:"Os",message:{cmd:"osType"}})]})})}function gr(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,A({__tauriModule:"Os",message:{cmd:"arch"}})]})})}function yr(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,A({__tauriModule:"Os",message:{cmd:"tempdir"}})]})})}Object.freeze({__proto__:null,EOL:vr,platform:Pl,version:_r,type:br,arch:gr,tempdir:yr});function Rl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,A({__tauriModule:"App",message:{cmd:"getAppVersion"}})]})})}function Il(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,A({__tauriModule:"App",message:{cmd:"getAppName"}})]})})}function Nl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,A({__tauriModule:"App",message:{cmd:"getTauriVersion"}})]})})}Object.freeze({__proto__:null,getName:Il,getVersion:Rl,getTauriVersion:Nl});function jl(t){return t===void 0&&(t=0),M(this,void 0,void 0,function(){return T(this,function(e){return[2,A({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}})]})})}function Hi(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,A({__tauriModule:"Process",message:{cmd:"relaunch"}})]})})}Object.freeze({__proto__:null,exit:jl,relaunch:Hi});function wr(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,O,W,U,R,q,E,L,S,P,C,F;return{c(){e=s("p"),e.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.`,n=v(),i=s("br"),o=v(),l=s("br"),u=v(),f=s("pre"),c=E("App name: "),p=s("code"),d=E(t[2]),k=E(` -App version: `),_=s("code"),y=E(t[0]),g=E(` -Tauri version: `),b=s("code"),L=E(t[1]),W=E(` -`),U=v(),j=s("br"),q=v(),A=s("div"),S=s("button"),S.textContent="Close application",z=v(),D=s("button"),D.textContent="Relaunch application",a(S,"class","btn"),a(D,"class","btn"),a(A,"class","flex flex-wrap gap-1 shadow-")},m(B,Y){m(B,e,Y),m(B,n,Y),m(B,i,Y),m(B,o,Y),m(B,l,Y),m(B,u,Y),m(B,f,Y),r(f,c),r(f,p),r(p,d),r(f,k),r(f,_),r(_,y),r(f,g),r(f,b),r(b,L),r(f,W),m(B,U,Y),m(B,j,Y),m(B,q,Y),m(B,A,Y),r(A,S),r(A,z),r(A,D),C||(N=[O(S,"click",t[3]),O(D,"click",t[4])],C=!0)},p(B,[Y]){Y&4&&Z(d,B[2]),Y&1&&Z(y,B[0]),Y&2&&Z(L,B[1])},i:J,o:J,d(B){B&&h(e),B&&h(n),B&&h(i),B&&h(o),B&&h(l),B&&h(u),B&&h(f),B&&h(U),B&&h(j),B&&h(q),B&&h(A),C=!1,pe(N)}}}function wr(t,e,n){let i="0.0.0",o="0.0.0",l="Unknown";Dl().then(c=>{n(2,l=c)}),Wl().then(c=>{n(0,i=c)}),jl().then(c=>{n(1,o=c)});async function u(){await Rl()}async function f(){await Fi()}return[i,o,l,u,f]}class kr extends Se{constructor(e){super(),Ce(this,e,wr,yr,ke,{})}}function Hl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]})})}Object.freeze({__proto__:null,getMatches:Hl});function Mr(t){let e,n,i,o,l,u,f,c,p,d,k,_,y;return{c(){e=s("p"),e.innerHTML=`This binary can be run from the terminal and takes the following arguments: + tests.`,n=v(),i=s("br"),o=v(),l=s("br"),u=v(),f=s("pre"),c=z("App name: "),p=s("code"),d=z(t[2]),k=z(` +App version: `),_=s("code"),y=z(t[0]),g=z(` +Tauri version: `),b=s("code"),O=z(t[1]),W=z(` +`),U=v(),R=s("br"),q=v(),E=s("div"),L=s("button"),L.textContent="Close application",S=v(),P=s("button"),P.textContent="Relaunch application",a(L,"class","btn"),a(P,"class","btn"),a(E,"class","flex flex-wrap gap-1 shadow-")},m(B,Y){m(B,e,Y),m(B,n,Y),m(B,i,Y),m(B,o,Y),m(B,l,Y),m(B,u,Y),m(B,f,Y),r(f,c),r(f,p),r(p,d),r(f,k),r(f,_),r(_,y),r(f,g),r(f,b),r(b,O),r(f,W),m(B,U,Y),m(B,R,Y),m(B,q,Y),m(B,E,Y),r(E,L),r(E,S),r(E,P),C||(F=[D(L,"click",t[3]),D(P,"click",t[4])],C=!0)},p(B,[Y]){Y&4&&Z(d,B[2]),Y&1&&Z(y,B[0]),Y&2&&Z(O,B[1])},i:J,o:J,d(B){B&&h(e),B&&h(n),B&&h(i),B&&h(o),B&&h(l),B&&h(u),B&&h(f),B&&h(U),B&&h(R),B&&h(q),B&&h(E),C=!1,pe(F)}}}function kr(t,e,n){let i="0.0.0",o="0.0.0",l="Unknown";Il().then(c=>{n(2,l=c)}),Rl().then(c=>{n(0,i=c)}),Nl().then(c=>{n(1,o=c)});async function u(){await jl()}async function f(){await Hi()}return[i,o,l,u,f]}class Mr extends Se{constructor(e){super(),Le(this,e,kr,wr,Me,{})}}function Hl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,A({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]})})}Object.freeze({__proto__:null,getMatches:Hl});function Tr(t){let e,n,i,o,l,u,f,c,p,d,k,_,y;return{c(){e=s("p"),e.innerHTML=`This binary can be run from the terminal and takes the following arguments:
  --config <PATH>
   --theme <light|dark|system>
   --verbose
- Additionally, it has a update --background subcommand.`,n=v(),i=s("br"),o=v(),l=s("div"),l.textContent="Note that the arguments are only parsed, not implemented.",u=v(),f=s("br"),c=v(),p=s("br"),d=v(),k=s("button"),k.textContent="Get matches",a(l,"class","note"),a(k,"class","btn"),a(k,"id","cli-matches")},m(g,b){m(g,e,b),m(g,n,b),m(g,i,b),m(g,o,b),m(g,l,b),m(g,u,b),m(g,f,b),m(g,c,b),m(g,p,b),m(g,d,b),m(g,k,b),_||(y=O(k,"click",t[0]),_=!0)},p:J,i:J,o:J,d(g){g&&h(e),g&&h(n),g&&h(i),g&&h(o),g&&h(l),g&&h(u),g&&h(f),g&&h(c),g&&h(p),g&&h(d),g&&h(k),_=!1,y()}}}function Tr(t,e,n){let{onMessage:i}=e;function o(){Hl().then(i).catch(i)}return t.$$set=l=>{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class Cr extends Se{constructor(e){super(),Ce(this,e,Tr,Mr,ke,{onMessage:1})}}function Xt(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,Hi(t,null,e)]})})}function Fl(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,Sl(t,null,e)]})})}function ni(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,Cl(t,void 0,e)]})})}Object.freeze({__proto__:null,listen:Xt,once:Fl,emit:ni});function Sr(t){let e,n,i,o,l,u,f,c;return{c(){e=s("div"),n=s("button"),n.textContent="Call Log API",i=v(),o=s("button"),o.textContent="Call Request (async) API",l=v(),u=s("button"),u.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(o,"class","btn"),a(o,"id","request"),a(u,"class","btn"),a(u,"id","event")},m(p,d){m(p,e,d),r(e,n),r(e,i),r(e,o),r(e,l),r(e,u),f||(c=[O(n,"click",t[0]),O(o,"click",t[1]),O(u,"click",t[2])],f=!0)},p:J,i:J,o:J,d(p){p&&h(e),f=!1,pe(c)}}}function zr(t,e,n){let{onMessage:i}=e,o;at(async()=>{o=await Xt("rust-event",i)}),Di(()=>{o&&o()});function l(){xn("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){xn("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function f(){ni("js-event","this is the payload string")}return t.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[l,u,f,i]}class Lr extends Se{constructor(e){super(),Ce(this,e,zr,Sr,ke,{onMessage:3})}}function Ii(t){return t===void 0&&(t={}),M(this,void 0,void 0,function(){return T(this,function(e){return typeof t=="object"&&Object.freeze(t),[2,P({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}})]})})}function Il(t){return t===void 0&&(t={}),M(this,void 0,void 0,function(){return T(this,function(e){return typeof t=="object"&&Object.freeze(t),[2,P({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}})]})})}function Ar(t,e){var n;return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,P({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}function Ul(t,e){var n;return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,P({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}function Pr(t,e){var n;return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,P({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}Object.freeze({__proto__:null,open:Ii,save:Il,message:Ar,ask:Ul,confirm:Pr});var Pt;function Or(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})]})})}function Ui(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){var n;return T(this,function(i){switch(i.label){case 0:return[4,P({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:e}})];case 1:return n=i.sent(),[2,Uint8Array.from(n)]}})})}function Wi(t,e,n){return M(this,void 0,void 0,function(){var i,o;return T(this,function(l){return typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t),i={path:"",contents:""},o=n,typeof t=="string"?i.path=t:(i.path=t.path,i.contents=t.contents),typeof e=="string"?i.contents=e!=null?e:"":o=e,[2,P({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:o}})]})})}function Er(t,e,n){return M(this,void 0,void 0,function(){var i,o;return T(this,function(l){return typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t),i={path:"",contents:[]},o=n,typeof t=="string"?i.path=t:(i.path=t.path,i.contents=t.contents),e&&"dir"in e?o=e:typeof t=="string"&&(i.contents=e!=null?e:[]),[2,P({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:o}})]})})}function Nl(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:e}})]})})}function Wr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})]})})}function Dr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})]})})}function jr(t,e,n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return T(this,function(i){return[2,P({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:n}})]})})}function Rr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})]})})}function Hr(t,e,n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return T(this,function(i){return[2,P({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:n}})]})})}(function(t){t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Desktop=6]="Desktop",t[t.Document=7]="Document",t[t.Download=8]="Download",t[t.Executable=9]="Executable",t[t.Font=10]="Font",t[t.Home=11]="Home",t[t.Picture=12]="Picture",t[t.Public=13]="Public",t[t.Runtime=14]="Runtime",t[t.Template=15]="Template",t[t.Video=16]="Video",t[t.Resource=17]="Resource",t[t.App=18]="App",t[t.Log=19]="Log",t[t.Temp=20]="Temp"})(Pt||(Pt={}));Object.freeze({__proto__:null,get BaseDirectory(){return Pt},get Dir(){return Pt},readTextFile:Or,readBinaryFile:Ui,writeTextFile:Wi,writeFile:Wi,writeBinaryFile:Er,readDir:Nl,createDir:Wr,removeDir:Dr,copyFile:jr,removeFile:Rr,renameFile:Hr});function Fr(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,L,W,U,j,q,A,S,z,D;return{c(){e=s("div"),n=s("input"),i=v(),o=s("input"),l=v(),u=s("br"),f=v(),c=s("div"),p=s("input"),d=v(),k=s("label"),k.textContent="Multiple",_=v(),y=s("div"),g=s("input"),b=v(),L=s("label"),L.textContent="Directory",W=v(),U=s("br"),j=v(),q=s("button"),q.textContent="Open dialog",A=v(),S=s("button"),S.textContent="Open save dialog",a(n,"class","input"),a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(o,"class","input"),a(o,"id","dialog-filter"),a(o,"placeholder","Extensions filter, comma-separated"),a(e,"class","flex gap-2 children:grow"),a(p,"type","checkbox"),a(p,"id","dialog-multiple"),a(k,"for","dialog-multiple"),a(g,"type","checkbox"),a(g,"id","dialog-directory"),a(L,"for","dialog-directory"),a(q,"class","btn"),a(q,"id","open-dialog"),a(S,"class","btn"),a(S,"id","save-dialog")},m(C,N){m(C,e,N),r(e,n),G(n,t[0]),r(e,i),r(e,o),G(o,t[1]),m(C,l,N),m(C,u,N),m(C,f,N),m(C,c,N),r(c,p),p.checked=t[2],r(c,d),r(c,k),m(C,_,N),m(C,y,N),r(y,g),g.checked=t[3],r(y,b),r(y,L),m(C,W,N),m(C,U,N),m(C,j,N),m(C,q,N),m(C,A,N),m(C,S,N),z||(D=[O(n,"input",t[8]),O(o,"input",t[9]),O(p,"change",t[10]),O(g,"change",t[11]),O(q,"click",t[4]),O(S,"click",t[5])],z=!0)},p(C,[N]){N&1&&n.value!==C[0]&&G(n,C[0]),N&2&&o.value!==C[1]&&G(o,C[1]),N&4&&(p.checked=C[2]),N&8&&(g.checked=C[3])},i:J,o:J,d(C){C&&h(e),C&&h(l),C&&h(u),C&&h(f),C&&h(c),C&&h(_),C&&h(y),C&&h(W),C&&h(U),C&&h(j),C&&h(q),C&&h(A),C&&h(S),z=!1,pe(D)}}}function Ir(t,e){var n=new Blob([t],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){var l=o.target.result;e(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function Ur(t,e,n){let{onMessage:i}=e,{insecureRenderHtml:o}=e,l=null,u=null,f=!1,c=!1;function p(){Ii({title:"My wonderful open dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[],multiple:f,directory:c}).then(function(b){if(Array.isArray(b))i(b);else{var L=b,W=L.match(/\S+\.\S+$/g);Ui(L).then(function(U){W&&(L.includes(".png")||L.includes(".jpg"))?Ir(new Uint8Array(U),function(j){var q="data:image/png;base64,"+j;o('')}):i(b)}).catch(i(b))}}).catch(i)}function d(){Il({title:"My wonderful save dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function k(){l=this.value,n(0,l)}function _(){u=this.value,n(1,u)}function y(){f=this.checked,n(2,f)}function g(){c=this.checked,n(3,c)}return t.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,o=b.insecureRenderHtml)},[l,u,f,c,p,d,i,o,k,_,y,g]}class Nr extends Se{constructor(e){super(),Ce(this,e,Ur,Fr,ke,{onMessage:6,insecureRenderHtml:7})}}function qo(t,e,n){const i=t.slice();return i[9]=e[n],i}function Bo(t){let e,n=t[9][0]+"",i,o;return{c(){e=s("option"),i=E(n),e.__value=o=t[9][1],e.value=e.__value},m(l,u){m(l,e,u),r(e,i)},p:J,d(l){l&&h(e)}}}function qr(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,L,W,U,j,q=t[2],A=[];for(let S=0;SisNaN(parseInt(_))).map(_=>[_,Pt[_]]);function c(){const _=l.match(/\S+\.\S+$/g),y={dir:Vo()};(_?Ui(l,y):Nl(l,y)).then(function(b){if(_)if(l.includes(".png")||l.includes(".jpg"))Br(new Uint8Array(b),function(L){const W="data:image/png;base64,"+L;o('')});else{const L=String.fromCharCode.apply(null,b);o(''),setTimeout(()=>{const W=document.getElementById("file-response");W.value=L,document.getElementById("file-save").addEventListener("click",function(){Wi(l,W.value,{dir:Vo()}).catch(i)})})}else i(b)}).catch(i)}function p(){n(1,u.src=wl(l),u)}function d(){l=this.value,n(0,l)}function k(_){Yn[_?"unshift":"push"](()=>{u=_,n(1,u)})}return t.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage),"insecureRenderHtml"in _&&n(6,o=_.insecureRenderHtml)},[l,u,f,c,p,i,o,d,k]}class Gr extends Se{constructor(e){super(),Ce(this,e,Vr,qr,ke,{onMessage:5,insecureRenderHtml:6})}}var Ot;(function(t){t[t.JSON=1]="JSON",t[t.Text=2]="Text",t[t.Binary=3]="Binary"})(Ot||(Ot={}));var Jn=function(){function t(e,n){this.type=e,this.payload=n}return t.form=function(e){var n={};for(var i in e){var o=e[i],l=void 0;l=typeof o=="string"?o:o instanceof Uint8Array||Array.isArray(o)?Array.from(o):typeof o.file=="string"?{file:o.file,mime:o.mime,fileName:o.fileName}:{file:Array.from(o.file),mime:o.mime,fileName:o.fileName},n[i]=l}return new t("Form",n)},t.json=function(e){return new t("Json",e)},t.text=function(e){return new t("Text",e)},t.bytes=function(e){return new t("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))},t}(),ql=function(t){this.url=t.url,this.status=t.status,this.ok=this.status>=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data},Bl=function(){function t(e){this.id=e}return t.prototype.drop=function(){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,P({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},t.prototype.request=function(e){return M(this,void 0,void 0,function(){var n;return T(this,function(i){return(n=!e.responseType||e.responseType===Ot.JSON)&&(e.responseType=Ot.Text),[2,P({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(function(o){var l=new ql(o);if(n){try{l.data=JSON.parse(l.data)}catch(u){if(l.ok&&l.data==="")l.data={};else if(l.ok)throw Error("Failed to parse response `".concat(l.data,"` as JSON: ").concat(u,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return l}return l})]})})},t.prototype.get=function(e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.request(ue({method:"GET",url:e},n))]})})},t.prototype.post=function(e,n,i){return M(this,void 0,void 0,function(){return T(this,function(o){return[2,this.request(ue({method:"POST",url:e,body:n},i))]})})},t.prototype.put=function(e,n,i){return M(this,void 0,void 0,function(){return T(this,function(o){return[2,this.request(ue({method:"PUT",url:e,body:n},i))]})})},t.prototype.patch=function(e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.request(ue({method:"PATCH",url:e},n))]})})},t.prototype.delete=function(e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.request(ue({method:"DELETE",url:e},n))]})})},t}();function Zn(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,P({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then(function(n){return new Bl(n)})]})})}var Ai=null;function Jr(t,e){var n;return M(this,void 0,void 0,function(){return T(this,function(i){switch(i.label){case 0:return Ai!==null?[3,2]:[4,Zn()];case 1:Ai=i.sent(),i.label=2;case 2:return[2,Ai.request(ue({url:t,method:(n=e==null?void 0:e.method)!==null&&n!==void 0?n:"GET"},e))]}})})}Object.freeze({__proto__:null,getClient:Zn,fetch:Jr,Body:Jn,Client:Bl,Response:ql,get ResponseType(){return Ot}});function Go(t,e,n){const i=t.slice();return i[12]=e[n],i[14]=n,i}function Jo(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,L,W,U=t[5],j=[];for(let z=0;zFe(j[z],1,1,()=>{j[z]=null});let A=!t[3]&&xo(),S=!t[3]&&t[8]&&Qo();return{c(){e=s("span"),n=s("span"),i=E(t[6]),o=v(),l=s("ul");for(let z=0;z{d[g]=null}),ti(),l=d[o],l?l.p(_,y):(l=d[o]=p[o](_),l.c()),Ee(l,1),l.m(e,u))},i(_){f||(Ee(l),f=!0)},o(_){Fe(l),f=!1},d(_){_&&h(e),c&&c.d(),d[o].d()}}}function xo(t){let e;return{c(){e=s("span"),e.textContent=",",a(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Qo(t){let e;return{c(){e=s("span"),e.textContent=",",a(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Kr(t){let e,n,i=t[5].length&&Jo(t);return{c(){i&&i.c(),e=$n()},m(o,l){i&&i.m(o,l),m(o,e,l),n=!0},p(o,[l]){o[5].length?i?(i.p(o,l),l&32&&Ee(i,1)):(i=Jo(o),i.c(),Ee(i,1),i.m(e.parentNode,e)):i&&(ei(),Fe(i,1,1,()=>{i=null}),ti())},i(o){n||(Ee(i),n=!0)},o(o){Fe(i),n=!1},d(o){i&&i.d(o),o&&h(e)}}}const xr="...";function Qr(t,e,n){let{json:i}=e,{depth:o=1/0}=e,{_lvl:l=0}=e,{_last:u=!0}=e;const f=b=>b===null?"null":typeof b;let c,p,d,k,_;const y=b=>{switch(f(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},g=()=>{n(8,_=!_)};return t.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,o=b.depth),"_lvl"in b&&n(2,l=b._lvl),"_last"in b&&n(3,u=b._last)},t.$$.update=()=>{t.$$.dirty&17&&(n(5,c=f(i)==="object"?Object.keys(i):[]),n(4,p=Array.isArray(i)),n(6,d=p?"[":"{"),n(7,k=p?"]":"}")),t.$$.dirty&6&&n(8,_=ot[9].call(n)),a(k,"class","input h-auto w-100%"),a(k,"id","request-body"),a(k,"placeholder","Request body"),a(k,"rows","5"),a(b,"class","btn"),a(b,"id","make-request"),a(S,"class","input"),a(D,"class","input"),a(A,"class","flex gap-2 children:grow"),a($,"type","checkbox"),a(x,"class","btn"),a(x,"type","button")},m(R,V){m(R,e,V),r(e,n),r(n,i),r(n,o),r(n,l),r(n,u),r(n,f),zt(n,t[0]),r(e,c),r(e,p),r(e,d),r(e,k),G(k,t[1]),r(e,_),r(e,y),r(e,g),r(e,b),m(R,L,V),m(R,W,V),m(R,U,V),m(R,j,V),m(R,q,V),m(R,A,V),r(A,S),G(S,t[2]),r(A,z),r(A,D),G(D,t[3]),m(R,C,V),m(R,N,V),m(R,B,V),m(R,Y,V),r(Y,$),$.checked=t[5],r(Y,_e),m(R,te,V),m(R,oe,V),m(R,K,V),m(R,be,V),m(R,H,V),m(R,x,V),m(R,le,V),m(R,ae,V),m(R,ee,V),m(R,ve,V),m(R,re,V),Vt(ge,R,V),ne=!0,Me||(Le=[O(n,"change",t[9]),O(k,"input",t[10]),O(e,"submit",Xn(t[6])),O(S,"input",t[11]),O(D,"input",t[12]),O($,"change",t[13]),O(x,"click",t[7])],Me=!0)},p(R,[V]){V&1&&zt(n,R[0]),V&2&&G(k,R[1]),V&4&&S.value!==R[2]&&G(S,R[2]),V&8&&D.value!==R[3]&&G(D,R[3]),V&32&&($.checked=R[5]);const Re={};V&16&&(Re.json=R[4]),ge.$set(Re)},i(R){ne||(Ee(ge.$$.fragment,R),ne=!0)},o(R){Fe(ge.$$.fragment,R),ne=!1},d(R){R&&h(e),R&&h(L),R&&h(W),R&&h(U),R&&h(j),R&&h(q),R&&h(A),R&&h(C),R&&h(N),R&&h(B),R&&h(Y),R&&h(te),R&&h(oe),R&&h(K),R&&h(be),R&&h(H),R&&h(x),R&&h(le),R&&h(ae),R&&h(ee),R&&h(ve),R&&h(re),Gt(ge,R),Me=!1,pe(Le)}}}function $r(t,e,n){let i="GET",o="",{onMessage:l}=e;async function u(){const W=await Zn().catch(q=>{throw l(q),q}),j={url:"http://localhost:3003",method:i||"GET"||"GET"};o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]")?j.body=Jn.json(JSON.parse(o)):o!==""&&(j.body=Jn.text(o)),W.request(j).then(l).catch(l)}let f="baz",c="qux",p=null,d=!0;async function k(){const W=await Zn().catch(U=>{throw l(U),U});n(4,p=await W.request({url:"http://localhost:3003",method:"POST",body:Jn.form({foo:f,bar:c}),headers:d?{"Content-Type":"multipart/form-data"}:void 0,responseType:Ot.Text}))}function _(){i=Pi(this),n(0,i)}function y(){o=this.value,n(1,o)}function g(){f=this.value,n(2,f)}function b(){c=this.value,n(3,c)}function L(){d=this.checked,n(5,d)}return t.$$set=W=>{"onMessage"in W&&n(8,l=W.onMessage)},[i,o,f,c,p,d,u,k,l,_,y,g,b,L]}class es extends Se{constructor(e){super(),Ce(this,e,$r,Zr,ke,{onMessage:8})}}function ts(t){let e,n,i;return{c(){e=s("button"),e.textContent="Send test notification",a(e,"class","btn"),a(e,"id","notification")},m(o,l){m(o,e,l),n||(i=O(e,"click",ns),n=!0)},p:J,i:J,o:J,d(o){o&&h(e),n=!1,i()}}}function ns(){new Notification("Notification title",{body:"This is the notification body"})}function is(t,e,n){let{onMessage:i}=e;return t.$$set=o=>{"onMessage"in o&&n(0,i=o.onMessage)},[i]}class os extends Se{constructor(e){super(),Ce(this,e,is,ts,ke,{onMessage:0})}}function Zo(t,e,n){const i=t.slice();return i[65]=e[n],i}function $o(t,e,n){const i=t.slice();return i[68]=e[n],i}function el(t){let e,n,i,o,l,u,f=Object.keys(t[1]),c=[];for(let p=0;pt[38].call(i))},m(p,d){m(p,e,d),m(p,n,d),m(p,i,d),r(i,o);for(let k=0;kt[55].call(Ne)),a(Qe,"class","input"),a(Qe,"type","number"),a(Ze,"class","input"),a(Ze,"type","number"),a(Ue,"class","flex gap-2"),a($e,"class","input grow"),a($e,"id","title"),a(Ft,"class","btn"),a(Ft,"type","submit"),a(st,"class","flex gap-1"),a(et,"class","input grow"),a(et,"id","url"),a(It,"class","btn"),a(It,"id","open-url"),a(ut,"class","flex gap-1"),a(rt,"class","flex flex-col gap-1")},m(w,I){m(w,e,I),m(w,n,I),m(w,i,I),r(i,o),r(i,l),r(i,u),r(i,f),r(i,c),r(i,p),r(i,d),r(i,k),r(i,_),m(w,y,I),m(w,g,I),m(w,b,I),m(w,L,I),r(L,W),r(W,U),r(W,j),j.checked=t[3],r(L,q),r(L,A),r(A,S),r(A,z),z.checked=t[2],r(L,D),r(L,C),r(C,N),r(C,B),B.checked=t[4],r(L,Y),r(L,$),r($,_e),r($,te),te.checked=t[5],r(L,oe),r(L,K),r(K,be),r(K,H),H.checked=t[6],m(w,x,I),m(w,le,I),m(w,ae,I),m(w,ee,I),r(ee,ve),r(ve,re),r(re,ge),r(re,ne),G(ne,t[13]),r(ve,Me),r(ve,Le),r(Le,R),r(Le,V),G(V,t[14]),r(ee,Re),r(ee,Ae),r(Ae,Te),r(Te,ce),r(Te,he),G(he,t[7]),r(Ae,fe),r(Ae,Pe),r(Pe,tt),r(Pe,me),G(me,t[8]),r(ee,de),r(ee,F),r(F,ie),r(ie,X),r(ie,ye),G(ye,t[9]),r(F,Yt),r(F,ht),r(ht,Kt),r(ht,He),G(He,t[10]),r(ee,xt),r(ee,Be),r(Be,Q),r(Q,Et),r(Q,We),G(We,t[11]),r(Be,Wt),r(Be,nt),r(nt,Dt),r(nt,De),G(De,t[12]),m(w,mt,I),m(w,vt,I),m(w,_t,I),m(w,Oe,I),r(Oe,Ie),r(Ie,je),r(je,it),r(je,jt),r(je,ot),r(ot,Rt),r(ot,ii),r(je,qi),r(je,Qt),r(Qt,Bi),r(Qt,oi),r(Ie,Vi),r(Ie,Ve),r(Ve,$t),r(Ve,Gi),r(Ve,en),r(en,Ji),r(en,li),r(Ve,Xi),r(Ve,nn),r(nn,Yi),r(nn,ri),r(Oe,Ki),r(Oe,gt),r(gt,Ge),r(Ge,ln),r(Ge,xi),r(Ge,rn),r(rn,Qi),r(rn,si),r(Ge,Zi),r(Ge,un),r(un,$i),r(un,ui),r(gt,eo),r(gt,Je),r(Je,cn),r(Je,to),r(Je,fn),r(fn,no),r(fn,ai),r(Je,io),r(Je,pn),r(pn,oo),r(pn,ci),r(Oe,lo),r(Oe,yt),r(yt,Xe),r(Xe,mn),r(Xe,ro),r(Xe,vn),r(vn,so),r(vn,fi),r(Xe,uo),r(Xe,bn),r(bn,ao),r(bn,di),r(yt,co),r(yt,Ye),r(Ye,yn),r(Ye,fo),r(Ye,wn),r(wn,po),r(wn,pi),r(Ye,ho),r(Ye,Mn),r(Mn,mo),r(Mn,hi),r(Oe,vo),r(Oe,wt),r(wt,Ke),r(Ke,Cn),r(Ke,_o),r(Ke,Sn),r(Sn,bo),r(Sn,mi),r(Ke,go),r(Ke,Ln),r(Ln,yo),r(Ln,vi),r(wt,wo),r(wt,xe),r(xe,Pn),r(xe,ko),r(xe,On),r(On,Mo),r(On,_i),r(xe,To),r(xe,Wn),r(Wn,Co),r(Wn,bi),m(w,gi,I),m(w,yi,I),m(w,wi,I),m(w,Ht,I),m(w,ki,I),m(w,lt,I),r(lt,jn),r(jn,kt),kt.checked=t[15],r(jn,So),r(lt,zo),r(lt,Rn),r(Rn,Mt),Mt.checked=t[16],r(Rn,Lo),m(w,Mi,I),m(w,Ue,I),r(Ue,Hn),r(Hn,Ao),r(Hn,Ne);for(let we=0;we=1,d,k,_,y=p&&el(t),g=t[1][t[0]]&&nl(t);return{c(){e=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="New window",u=v(),f=s("br"),c=v(),y&&y.c(),d=v(),g&&g.c(),a(i,"class","input grow"),a(i,"type","text"),a(i,"placeholder","New Window label.."),a(l,"class","btn"),a(n,"class","flex gap-1"),a(e,"class","flex flex-col children:grow gap-2")},m(b,L){m(b,e,L),r(e,n),r(n,i),G(i,t[20]),r(n,o),r(n,l),r(e,u),r(e,f),r(e,c),y&&y.m(e,null),r(e,d),g&&g.m(e,null),k||(_=[O(i,"input",t[37]),O(l,"click",t[34])],k=!0)},p(b,L){L[0]&1048576&&i.value!==b[20]&&G(i,b[20]),L[0]&2&&(p=Object.keys(b[1]).length>=1),p?y?y.p(b,L):(y=el(b),y.c(),y.m(e,d)):y&&(y.d(1),y=null),b[1][b[0]]?g?g.p(b,L):(g=nl(b),g.c(),g.m(e,null)):g&&(g.d(1),g=null)},i:J,o:J,d(b){b&&h(e),y&&y.d(),g&&g.d(),k=!1,pe(_)}}}function rs(t,e,n){let i=qe.label;const o={[qe.label]:qe},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"];let{onMessage:u}=e,f,c="https://tauri.app",p=!0,d=!1,k=!0,_=!1,y=!1,g=null,b=null,L=null,W=null,U=null,j=null,q=null,A=null,S=1,z=new ft(q,A),D=new ft(q,A),C=new St(g,b),N=new St(g,b),B,Y,$=!1,_e=!0,te=null,oe=null,K="default",be="Awesome Tauri Example!";function H(){Ri(c)}function x(){o[i].setTitle(be)}function le(){o[i].hide(),setTimeout(o[i].show,2e3)}function ae(){o[i].minimize(),setTimeout(o[i].unminimize,2e3)}function ee(){Ii({multiple:!1}).then(Q=>{typeof Q=="string"&&o[i].setIcon(Q)})}function ve(){if(!f)return;const Q=new At(f);n(1,o[f]=Q,o),Q.once("tauri://error",function(){u("Error creating new webview")})}function re(){o[i].innerSize().then(Q=>{n(25,C=Q),n(7,g=C.width),n(8,b=C.height)}),o[i].outerSize().then(Q=>{n(26,N=Q)})}function ge(){o[i].innerPosition().then(Q=>{n(23,z=Q)}),o[i].outerPosition().then(Q=>{n(24,D=Q),n(13,q=D.x),n(14,A=D.y)})}async function ne(Q){!Q||(B&&B(),Y&&Y(),Y=await Q.listen("tauri://move",ge),B=await Q.listen("tauri://resize",re))}async function Me(){await o[i].minimize(),await o[i].requestUserAttention(Jt.Critical),await new Promise(Q=>setTimeout(Q,3e3)),await o[i].requestUserAttention(null)}function Le(){f=this.value,n(20,f)}function R(){i=Pi(this),n(0,i),n(1,o)}const V=()=>o[i].center();function Re(){d=this.checked,n(3,d)}function Ae(){p=this.checked,n(2,p)}function Te(){k=this.checked,n(4,k)}function ce(){_=this.checked,n(5,_)}function he(){y=this.checked,n(6,y)}function fe(){q=se(this.value),n(13,q)}function Pe(){A=se(this.value),n(14,A)}function tt(){g=se(this.value),n(7,g)}function me(){b=se(this.value),n(8,b)}function de(){L=se(this.value),n(9,L)}function F(){W=se(this.value),n(10,W)}function ie(){U=se(this.value),n(11,U)}function X(){j=se(this.value),n(12,j)}function ye(){$=this.checked,n(15,$)}function Yt(){_e=this.checked,n(16,_e)}function ht(){K=Pi(this),n(19,K),n(28,l)}function Kt(){te=se(this.value),n(17,te)}function He(){oe=se(this.value),n(18,oe)}function xt(){be=this.value,n(27,be)}function Be(){c=this.value,n(21,c)}return t.$$set=Q=>{"onMessage"in Q&&n(36,u=Q.onMessage)},t.$$.update=()=>{var Q,Et,We,Wt,nt,Dt,De,mt,vt,_t,Oe,Ie,je,it,jt,ot,Rt;t.$$.dirty[0]&3&&(o[i],ge(),re()),t.$$.dirty[0]&7&&((Q=o[i])==null||Q.setResizable(p)),t.$$.dirty[0]&11&&(d?(Et=o[i])==null||Et.maximize():(We=o[i])==null||We.unmaximize()),t.$$.dirty[0]&19&&((Wt=o[i])==null||Wt.setDecorations(k)),t.$$.dirty[0]&35&&((nt=o[i])==null||nt.setAlwaysOnTop(_)),t.$$.dirty[0]&67&&((Dt=o[i])==null||Dt.setFullscreen(y)),t.$$.dirty[0]&387&&g&&b&&((De=o[i])==null||De.setSize(new St(g,b))),t.$$.dirty[0]&1539&&(L&&W?(mt=o[i])==null||mt.setMinSize(new Qn(L,W)):(vt=o[i])==null||vt.setMinSize(null)),t.$$.dirty[0]&6147&&(U>800&&j>400?(_t=o[i])==null||_t.setMaxSize(new Qn(U,j)):(Oe=o[i])==null||Oe.setMaxSize(null)),t.$$.dirty[0]&24579&&q!==null&&A!==null&&((Ie=o[i])==null||Ie.setPosition(new ft(q,A))),t.$$.dirty[0]&3&&((je=o[i])==null||je.scaleFactor().then(bt=>n(22,S=bt))),t.$$.dirty[0]&3&&ne(o[i]),t.$$.dirty[0]&32771&&((it=o[i])==null||it.setCursorGrab($)),t.$$.dirty[0]&65539&&((jt=o[i])==null||jt.setCursorVisible(_e)),t.$$.dirty[0]&524291&&((ot=o[i])==null||ot.setCursorIcon(K)),t.$$.dirty[0]&393219&&te!==null&&oe!==null&&((Rt=o[i])==null||Rt.setCursorPosition(new ft(te,oe)))},[i,o,p,d,k,_,y,g,b,L,W,U,j,q,A,$,_e,te,oe,K,f,c,S,z,D,C,N,be,l,H,x,le,ae,ee,ve,Me,u,Le,R,V,Re,Ae,Te,ce,he,fe,Pe,tt,me,de,F,ie,X,ye,Yt,ht,Kt,He,xt,Be]}class ss extends Se{constructor(e){super(),Ce(this,e,rs,ls,ke,{onMessage:36},null,[-1,-1,-1])}}function Gl(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:pt(e)}})]})})}function us(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,P({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:pt(e)}})]})})}function as(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,P({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]})})}function Jl(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,P({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]})})}function Xl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:Gl,registerAll:us,isRegistered:as,unregister:Jl,unregisterAll:Xl});function ol(t,e,n){const i=t.slice();return i[9]=e[n],i}function ll(t){let e,n=t[9]+"",i,o,l,u,f;function c(){return t[8](t[9])}return{c(){e=s("div"),i=E(n),o=v(),l=s("button"),l.textContent="Unregister",a(l,"class","btn"),a(l,"type","button"),a(e,"class","flex justify-between")},m(p,d){m(p,e,d),r(e,i),r(e,o),r(e,l),u||(f=O(l,"click",c),u=!0)},p(p,d){t=p,d&2&&n!==(n=t[9]+"")&&Z(i,n)},d(p){p&&h(e),u=!1,f()}}}function rl(t){let e,n,i,o,l;return{c(){e=s("br"),n=v(),i=s("button"),i.textContent="Unregister all",a(i,"class","btn"),a(i,"type","button")},m(u,f){m(u,e,f),m(u,n,f),m(u,i,f),o||(l=O(i,"click",t[5]),o=!0)},p:J,d(u){u&&h(e),u&&h(n),u&&h(i),o=!1,l()}}}function cs(t){let e,n,i,o,l,u,f,c,p,d,k,_=t[1],y=[];for(let b=0;b<_.length;b+=1)y[b]=ll(ol(t,_,b));let g=t[1].length>1&&rl(t);return{c(){e=s("div"),n=s("input"),i=v(),o=s("button"),o.textContent="Register",l=v(),u=s("br"),f=v(),c=s("div");for(let b=0;b1?g?g.p(b,L):(g=rl(b),g.c(),g.m(c,null)):g&&(g.d(1),g=null)},i:J,o:J,d(b){b&&h(e),b&&h(l),b&&h(u),b&&h(f),b&&h(c),dt(y,b),g&&g.d(),d=!1,pe(k)}}}function fs(t,e,n){let i,{onMessage:o}=e;const l=yl([]);_l(t,l,_=>n(1,i=_));let u="CmdOrControl+X";function f(){const _=u;Gl(_,()=>{o(`Shortcut ${_} triggered`)}).then(()=>{l.update(y=>[...y,_]),o(`Shortcut ${_} registered successfully`)}).catch(o)}function c(_){const y=_;Jl(y).then(()=>{l.update(g=>g.filter(b=>b!==y)),o(`Shortcut ${y} unregistered`)}).catch(o)}function p(){Xl().then(()=>{l.update(()=>[]),o("Unregistered all shortcuts")}).catch(o)}function d(){u=this.value,n(0,u)}const k=_=>c(_);return t.$$set=_=>{"onMessage"in _&&n(6,o=_.onMessage)},[u,i,l,f,c,p,o,d,k]}class ds extends Se{constructor(e){super(),Ce(this,e,fs,cs,ke,{onMessage:6})}}function sl(t){let e,n,i,o,l,u,f;return{c(){e=s("br"),n=v(),i=s("input"),o=v(),l=s("button"),l.textContent="Write",a(i,"class","input"),a(i,"placeholder","write to stdin"),a(l,"class","btn")},m(c,p){m(c,e,p),m(c,n,p),m(c,i,p),G(i,t[4]),m(c,o,p),m(c,l,p),u||(f=[O(i,"input",t[14]),O(l,"click",t[8])],u=!0)},p(c,p){p&16&&i.value!==c[4]&&G(i,c[4])},d(c){c&&h(e),c&&h(n),c&&h(i),c&&h(o),c&&h(l),u=!1,pe(f)}}}function ps(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,L,W,U,j,q,A,S,z,D,C=t[5]&&sl(t);return{c(){e=s("div"),n=s("div"),i=E(`Script: - `),o=s("input"),l=v(),u=s("div"),f=E(`Encoding: - `),c=s("input"),p=v(),d=s("div"),k=E(`Working directory: - `),_=s("input"),y=v(),g=s("div"),b=E(`Arguments: - `),L=s("input"),W=v(),U=s("div"),j=s("button"),j.textContent="Run",q=v(),A=s("button"),A.textContent="Kill",S=v(),C&&C.c(),a(o,"class","grow input"),a(n,"class","flex items-center gap-1"),a(c,"class","grow input"),a(u,"class","flex items-center gap-1"),a(_,"class","grow input"),a(_,"placeholder","Working directory"),a(d,"class","flex items-center gap-1"),a(L,"class","grow input"),a(L,"placeholder","Environment variables"),a(g,"class","flex items-center gap-1"),a(j,"class","btn"),a(A,"class","btn"),a(U,"class","flex children:grow gap-1"),a(e,"class","flex flex-col childre:grow gap-1")},m(N,B){m(N,e,B),r(e,n),r(n,i),r(n,o),G(o,t[0]),r(e,l),r(e,u),r(u,f),r(u,c),G(c,t[3]),r(e,p),r(e,d),r(d,k),r(d,_),G(_,t[1]),r(e,y),r(e,g),r(g,b),r(g,L),G(L,t[2]),r(e,W),r(e,U),r(U,j),r(U,q),r(U,A),r(e,S),C&&C.m(e,null),z||(D=[O(o,"input",t[10]),O(c,"input",t[11]),O(_,"input",t[12]),O(L,"input",t[13]),O(j,"click",t[6]),O(A,"click",t[7])],z=!0)},p(N,[B]){B&1&&o.value!==N[0]&&G(o,N[0]),B&8&&c.value!==N[3]&&G(c,N[3]),B&2&&_.value!==N[1]&&G(_,N[1]),B&4&&L.value!==N[2]&&G(L,N[2]),N[5]?C?C.p(N,B):(C=sl(N),C.c(),C.m(e,null)):C&&(C.d(1),C=null)},i:J,o:J,d(N){N&&h(e),C&&C.d(),z=!1,pe(D)}}}function hs(t,e,n){const i=navigator.userAgent.includes("Windows");let o=i?"cmd":"sh",l=i?["/C"]:["-c"],{onMessage:u}=e,f='echo "hello world"',c=null,p="SOMETHING=value ANOTHER=2",d="",k="",_;function y(){return p.split(" ").reduce((S,z)=>{let[D,C]=z.split("=");return{...S,[D]:C}},{})}function g(){n(5,_=null);const S=new Ml(o,[...l,f],{cwd:c||null,env:y(),encoding:d});S.on("close",z=>{u(`command finished with code ${z.code} and signal ${z.signal}`),n(5,_=null)}),S.on("error",z=>u(`command error: "${z}"`)),S.stdout.on("data",z=>u(`command stdout: "${z}"`)),S.stderr.on("data",z=>u(`command stderr: "${z}"`)),S.spawn().then(z=>{n(5,_=z)}).catch(u)}function b(){_.kill().then(()=>u("killed child process")).catch(u)}function L(){_.write(k).catch(u)}function W(){f=this.value,n(0,f)}function U(){d=this.value,n(3,d)}function j(){c=this.value,n(1,c)}function q(){p=this.value,n(2,p)}function A(){k=this.value,n(4,k)}return t.$$set=S=>{"onMessage"in S&&n(9,u=S.onMessage)},[f,c,p,d,k,_,g,b,L,u,W,U,j,q,A]}class ms extends Se{constructor(e){super(),Ce(this,e,hs,ps,ke,{onMessage:9})}}function Ni(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,Xt("tauri://update-status",function(n){t(n==null?void 0:n.payload)})]})})}function Yl(){return M(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return T(this,function(n){return[2,new Promise(function(i,o){Ni(function(l){return l.error?(t(),o(l.error)):l.status==="DONE"?(t(),i()):void 0}).then(function(l){e=l}).catch(function(l){throw t(),l}),ni("tauri://update-install").catch(function(l){throw t(),l})})]})})}function Kl(){return M(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return T(this,function(n){return[2,new Promise(function(i,o){Fl("tauri://update-available",function(l){var u;u=l==null?void 0:l.payload,t(),i({manifest:u,shouldUpdate:!0})}).catch(function(l){throw t(),l}),Ni(function(l){return l.error?(t(),o(l.error)):l.status==="UPTODATE"?(t(),i({shouldUpdate:!1})):void 0}).then(function(l){e=l}).catch(function(l){throw t(),l}),ni("tauri://update").catch(function(l){throw t(),l})})]})})}Object.freeze({__proto__:null,onUpdaterEvent:Ni,installUpdate:Yl,checkUpdate:Kl});function vs(t){let e;return{c(){e=s("button"),e.innerHTML='
',a(e,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){m(n,e,i)},p:J,d(n){n&&h(e)}}}function _s(t){let e,n,i;return{c(){e=s("button"),e.textContent="Install update",a(e,"class","btn")},m(o,l){m(o,e,l),n||(i=O(e,"click",t[4]),n=!0)},p:J,d(o){o&&h(e),n=!1,i()}}}function bs(t){let e,n,i;return{c(){e=s("button"),e.textContent="Check update",a(e,"class","btn")},m(o,l){m(o,e,l),n||(i=O(e,"click",t[3]),n=!0)},p:J,d(o){o&&h(e),n=!1,i()}}}function gs(t){let e;function n(l,u){return!l[0]&&!l[2]?bs:!l[1]&&l[2]?_s:vs}let i=n(t),o=i(t);return{c(){e=s("div"),o.c(),a(e,"class","flex children:grow children:h10")},m(l,u){m(l,e,u),o.m(e,null)},p(l,[u]){i===(i=n(l))&&o?o.p(l,u):(o.d(1),o=i(l),o&&(o.c(),o.m(e,null)))},i:J,o:J,d(l){l&&h(e),o.d()}}}function ys(t,e,n){let{onMessage:i}=e,o;at(async()=>{o=await Xt("tauri://update-status",i)}),Di(()=>{o&&o()});let l,u,f;async function c(){n(0,l=!0);try{const{shouldUpdate:d,manifest:k}=await Kl();i(`Should update: ${d}`),i(k),n(2,f=d)}catch(d){i(d)}finally{n(0,l=!1)}}async function p(){n(1,u=!0);try{await Yl(),i("Installation complete, restart required."),await Fi()}catch(d){i(d)}finally{n(1,u=!1)}}return t.$$set=d=>{"onMessage"in d&&n(5,i=d.onMessage)},[l,u,f,c,p,i]}class ws extends Se{constructor(e){super(),Ce(this,e,ys,gs,ke,{onMessage:5})}}function xl(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,P({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}})]})})}function Ql(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,P({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})]})})}Object.freeze({__proto__:null,writeText:xl,readText:Ql});function ks(t){let e,n,i,o,l,u,f,c;return{c(){e=s("div"),n=s("input"),i=v(),o=s("button"),o.textContent="Write",l=v(),u=s("button"),u.textContent="Read",a(n,"class","grow input"),a(n,"placeholder","Text to write to the clipboard"),a(o,"class","btn"),a(o,"type","button"),a(u,"class","btn"),a(u,"type","button"),a(e,"class","flex gap-1")},m(p,d){m(p,e,d),r(e,n),G(n,t[0]),r(e,i),r(e,o),r(e,l),r(e,u),f||(c=[O(n,"input",t[4]),O(o,"click",t[1]),O(u,"click",t[2])],f=!0)},p(p,[d]){d&1&&n.value!==p[0]&&G(n,p[0])},i:J,o:J,d(p){p&&h(e),f=!1,pe(c)}}}function Ms(t,e,n){let{onMessage:i}=e,o="clipboard message";function l(){xl(o).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){Ql().then(c=>{i(`Clipboard contents: ${c}`)}).catch(i)}function f(){o=this.value,n(0,o)}return t.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,l,u,i,f]}class Ts extends Se{constructor(e){super(),Ce(this,e,Ms,ks,ke,{onMessage:3})}}function Cs(t){let e;return{c(){e=s("div"),e.innerHTML=`
Not available for Linux
- `,a(e,"class","flex flex-col gap-2")},m(n,i){m(n,e,i)},p:J,i:J,o:J,d(n){n&&h(e)}}}function Ss(t,e,n){let{onMessage:i}=e;const o=window.constraints={audio:!0,video:!0};function l(f){const c=document.querySelector("video"),p=f.getVideoTracks();i("Got stream with constraints:",o),i(`Using video device: ${p[0].label}`),window.stream=f,c.srcObject=f}function u(f){if(f.name==="ConstraintNotSatisfiedError"){const c=o.video;i(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else f.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: ${f.name}`,f)}return at(async()=>{try{const f=await navigator.mediaDevices.getUserMedia(o);l(f)}catch(f){u(f)}}),Di(()=>{window.stream.getTracks().forEach(function(f){f.stop()})}),t.$$set=f=>{"onMessage"in f&&n(0,i=f.onMessage)},[i]}class zs extends Se{constructor(e){super(),Ce(this,e,Ss,Cs,ke,{onMessage:0})}}function ul(t,e,n){const i=t.slice();return i[32]=e[n],i}function al(t,e,n){const i=t.slice();return i[35]=e[n],i}function cl(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b;function L(S,z){return S[3]?As:Ls}let W=L(t),U=W(t);function j(S,z){return S[2]?Os:Ps}let q=j(t),A=q(t);return{c(){e=s("div"),n=s("span"),n.textContent="Tauri API Validation",i=v(),o=s("span"),l=s("span"),U.c(),f=v(),c=s("span"),c.innerHTML='
',p=v(),d=s("span"),A.c(),_=v(),y=s("span"),y.innerHTML='
',a(n,"class","lt-sm:pl-10 text-darkPrimaryText"),a(l,"title",u=t[3]?"Switch to Light mode":"Switch to Dark mode"),a(l,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(c,"title","Minimize"),a(c,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(d,"title",k=t[2]?"Restore":"Maximize"),a(d,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(y,"title","Close"),a(y,"class","hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText "),a(o,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),a(e,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),a(e,"data-tauri-drag-region","")},m(S,z){m(S,e,z),r(e,n),r(e,i),r(e,o),r(o,l),U.m(l,null),r(o,f),r(o,c),r(o,p),r(o,d),A.m(d,null),r(o,_),r(o,y),g||(b=[O(l,"click",t[12]),O(c,"click",t[9]),O(d,"click",t[10]),O(y,"click",t[11])],g=!0)},p(S,z){W!==(W=L(S))&&(U.d(1),U=W(S),U&&(U.c(),U.m(l,null))),z[0]&8&&u!==(u=S[3]?"Switch to Light mode":"Switch to Dark mode")&&a(l,"title",u),q!==(q=j(S))&&(A.d(1),A=q(S),A&&(A.c(),A.m(d,null))),z[0]&4&&k!==(k=S[2]?"Restore":"Maximize")&&a(d,"title",k)},d(S){S&&h(e),U.d(),A.d(),g=!1,pe(b)}}}function Ls(t){let e;return{c(){e=s("div"),a(e,"class","i-ph-moon")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function As(t){let e;return{c(){e=s("div"),a(e,"class","i-ph-sun")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Ps(t){let e;return{c(){e=s("div"),a(e,"class","i-codicon-chrome-maximize")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Os(t){let e;return{c(){e=s("div"),a(e,"class","i-codicon-chrome-restore")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Es(t){let e;return{c(){e=s("span"),a(e,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Ws(t){let e;return{c(){e=s("span"),a(e,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function fl(t){let e,n,i,o,l,u,f,c,p;function d(y,g){return y[3]?js:Ds}let k=d(t),_=k(t);return{c(){e=s("a"),_.c(),n=v(),i=s("br"),o=v(),l=s("div"),u=v(),f=s("br"),a(e,"href","##"),a(e,"class","nv justify-between h-8"),a(l,"class","bg-white/5 h-2px")},m(y,g){m(y,e,g),_.m(e,null),m(y,n,g),m(y,i,g),m(y,o,g),m(y,l,g),m(y,u,g),m(y,f,g),c||(p=O(e,"click",t[12]),c=!0)},p(y,g){k!==(k=d(y))&&(_.d(1),_=k(y),_&&(_.c(),_.m(e,null)))},d(y){y&&h(e),_.d(),y&&h(n),y&&h(i),y&&h(o),y&&h(l),y&&h(u),y&&h(f),c=!1,p()}}}function Ds(t){let e,n;return{c(){e=E(`Switch to Dark mode - `),n=s("div"),a(n,"class","i-ph-moon")},m(i,o){m(i,e,o),m(i,n,o)},d(i){i&&h(e),i&&h(n)}}}function js(t){let e,n;return{c(){e=E(`Switch to Light mode - `),n=s("div"),a(n,"class","i-ph-sun")},m(i,o){m(i,e,o),m(i,n,o)},d(i){i&&h(e),i&&h(n)}}}function Rs(t){let e,n,i,o,l,u=t[35].label+"",f,c,p,d;function k(){return t[20](t[35])}return{c(){e=s("a"),n=s("div"),o=v(),l=s("p"),f=E(u),a(n,"class",i=t[35].icon+" mr-2"),a(e,"href","##"),a(e,"class",c="nv "+(t[1]===t[35]?"nv_selected":""))},m(_,y){m(_,e,y),r(e,n),r(e,o),r(e,l),r(l,f),p||(d=O(e,"click",k),p=!0)},p(_,y){t=_,y[0]&2&&c!==(c="nv "+(t[1]===t[35]?"nv_selected":""))&&a(e,"class",c)},d(_){_&&h(e),p=!1,d()}}}function dl(t){let e,n=t[35]&&Rs(t);return{c(){n&&n.c(),e=$n()},m(i,o){n&&n.m(i,o),m(i,e,o)},p(i,o){i[35]&&n.p(i,o)},d(i){n&&n.d(i),i&&h(e)}}}function pl(t){let e,n=t[32].html+"",i;return{c(){e=new lr(!1),i=$n(),e.a=i},m(o,l){e.m(n,o,l),m(o,i,l)},p(o,l){l[0]&64&&n!==(n=o[32].html+"")&&e.p(n)},d(o){o&&h(i),o&&e.d()}}}function Hs(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,L,W,U,j,q,A,S,z,D,C,N,B,Y=t[1].label+"",$,_e,te,oe,K,be,H,x,le,ae,ee,ve,re,ge,ne,Me,Le,R,V=t[5]&&cl(t);function Re(F,ie){return F[0]?Ws:Es}let Ae=Re(t),Te=Ae(t),ce=!t[5]&&fl(t),he=t[7],fe=[];for(let F=0;F`,k=v(),_=s("a"),_.innerHTML=`Github + Additionally, it has a update --background subcommand.`,n=v(),i=s("br"),o=v(),l=s("div"),l.textContent="Note that the arguments are only parsed, not implemented.",u=v(),f=s("br"),c=v(),p=s("br"),d=v(),k=s("button"),k.textContent="Get matches",a(l,"class","note"),a(k,"class","btn"),a(k,"id","cli-matches")},m(g,b){m(g,e,b),m(g,n,b),m(g,i,b),m(g,o,b),m(g,l,b),m(g,u,b),m(g,f,b),m(g,c,b),m(g,p,b),m(g,d,b),m(g,k,b),_||(y=D(k,"click",t[0]),_=!0)},p:J,i:J,o:J,d(g){g&&h(e),g&&h(n),g&&h(i),g&&h(o),g&&h(l),g&&h(u),g&&h(f),g&&h(c),g&&h(p),g&&h(d),g&&h(k),_=!1,y()}}}function Cr(t,e,n){let{onMessage:i}=e;function o(){Hl().then(i).catch(i)}return t.$$set=l=>{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class Lr extends Se{constructor(e){super(),Le(this,e,Cr,Tr,Me,{onMessage:1})}}function Sr(t){let e,n,i,o,l,u,f,c;return{c(){e=s("div"),n=s("button"),n.textContent="Call Log API",i=v(),o=s("button"),o.textContent="Call Request (async) API",l=v(),u=s("button"),u.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(o,"class","btn"),a(o,"id","request"),a(u,"class","btn"),a(u,"id","event")},m(p,d){m(p,e,d),r(e,n),r(e,i),r(e,o),r(e,l),r(e,u),f||(c=[D(n,"click",t[0]),D(o,"click",t[1]),D(u,"click",t[2])],f=!0)},p:J,i:J,o:J,d(p){p&&h(e),f=!1,pe(c)}}}function Or(t,e,n){let{onMessage:i}=e,o;ct(async()=>{o=await Yt("rust-event",i)}),Ri(()=>{o&&o()});function l(){Qn("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){Qn("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function f(){ii("js-event","this is the payload string")}return t.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[l,u,f,i]}class Ar extends Se{constructor(e){super(),Le(this,e,Or,Sr,Me,{onMessage:3})}}function Ui(t){return t===void 0&&(t={}),M(this,void 0,void 0,function(){return T(this,function(e){return typeof t=="object"&&Object.freeze(t),[2,A({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}})]})})}function Ul(t){return t===void 0&&(t={}),M(this,void 0,void 0,function(){return T(this,function(e){return typeof t=="object"&&Object.freeze(t),[2,A({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}})]})})}function Er(t,e){var n;return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,A({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}function Fl(t,e){var n;return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,A({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}function Dr(t,e){var n;return M(this,void 0,void 0,function(){var i;return T(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,A({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}Object.freeze({__proto__:null,open:Ui,save:Ul,message:Er,ask:Fl,confirm:Dr});var Dt;function zr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,A({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})]})})}function Fi(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){var n;return T(this,function(i){switch(i.label){case 0:return[4,A({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:e}})];case 1:return n=i.sent(),[2,Uint8Array.from(n)]}})})}function Pi(t,e,n){return M(this,void 0,void 0,function(){var i,o;return T(this,function(l){return typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t),i={path:"",contents:""},o=n,typeof t=="string"?i.path=t:(i.path=t.path,i.contents=t.contents),typeof e=="string"?i.contents=e!=null?e:"":o=e,[2,A({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:o}})]})})}function Wr(t,e,n){return M(this,void 0,void 0,function(){var i,o;return T(this,function(l){return typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t),i={path:"",contents:[]},o=n,typeof t=="string"?i.path=t:(i.path=t.path,i.contents=t.contents),e&&"dir"in e?o=e:typeof t=="string"&&(i.contents=e!=null?e:[]),[2,A({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:o}})]})})}function ql(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,A({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:e}})]})})}function Pr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,A({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})]})})}function Rr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,A({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})]})})}function Ir(t,e,n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return T(this,function(i){return[2,A({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:n}})]})})}function Nr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,A({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})]})})}function jr(t,e,n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return T(this,function(i){return[2,A({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:n}})]})})}function Hr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return T(this,function(n){return[2,A({__tauriModule:"Fs",message:{cmd:"exists",path:t,options:e}})]})})}(function(t){t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Desktop=6]="Desktop",t[t.Document=7]="Document",t[t.Download=8]="Download",t[t.Executable=9]="Executable",t[t.Font=10]="Font",t[t.Home=11]="Home",t[t.Picture=12]="Picture",t[t.Public=13]="Public",t[t.Runtime=14]="Runtime",t[t.Template=15]="Template",t[t.Video=16]="Video",t[t.Resource=17]="Resource",t[t.App=18]="App",t[t.Log=19]="Log",t[t.Temp=20]="Temp"})(Dt||(Dt={}));Object.freeze({__proto__:null,get BaseDirectory(){return Dt},get Dir(){return Dt},readTextFile:zr,readBinaryFile:Fi,writeTextFile:Pi,writeFile:Pi,writeBinaryFile:Wr,readDir:ql,createDir:Pr,removeDir:Rr,copyFile:Ir,removeFile:Nr,renameFile:jr,exists:Hr});function Ur(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,O,W,U,R,q,E,L,S,P;return{c(){e=s("div"),n=s("input"),i=v(),o=s("input"),l=v(),u=s("br"),f=v(),c=s("div"),p=s("input"),d=v(),k=s("label"),k.textContent="Multiple",_=v(),y=s("div"),g=s("input"),b=v(),O=s("label"),O.textContent="Directory",W=v(),U=s("br"),R=v(),q=s("button"),q.textContent="Open dialog",E=v(),L=s("button"),L.textContent="Open save dialog",a(n,"class","input"),a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(o,"class","input"),a(o,"id","dialog-filter"),a(o,"placeholder","Extensions filter, comma-separated"),a(e,"class","flex gap-2 children:grow"),a(p,"type","checkbox"),a(p,"id","dialog-multiple"),a(k,"for","dialog-multiple"),a(g,"type","checkbox"),a(g,"id","dialog-directory"),a(O,"for","dialog-directory"),a(q,"class","btn"),a(q,"id","open-dialog"),a(L,"class","btn"),a(L,"id","save-dialog")},m(C,F){m(C,e,F),r(e,n),G(n,t[0]),r(e,i),r(e,o),G(o,t[1]),m(C,l,F),m(C,u,F),m(C,f,F),m(C,c,F),r(c,p),p.checked=t[2],r(c,d),r(c,k),m(C,_,F),m(C,y,F),r(y,g),g.checked=t[3],r(y,b),r(y,O),m(C,W,F),m(C,U,F),m(C,R,F),m(C,q,F),m(C,E,F),m(C,L,F),S||(P=[D(n,"input",t[8]),D(o,"input",t[9]),D(p,"change",t[10]),D(g,"change",t[11]),D(q,"click",t[4]),D(L,"click",t[5])],S=!0)},p(C,[F]){F&1&&n.value!==C[0]&&G(n,C[0]),F&2&&o.value!==C[1]&&G(o,C[1]),F&4&&(p.checked=C[2]),F&8&&(g.checked=C[3])},i:J,o:J,d(C){C&&h(e),C&&h(l),C&&h(u),C&&h(f),C&&h(c),C&&h(_),C&&h(y),C&&h(W),C&&h(U),C&&h(R),C&&h(q),C&&h(E),C&&h(L),S=!1,pe(P)}}}function Fr(t,e){var n=new Blob([t],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){var l=o.target.result;e(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function qr(t,e,n){let{onMessage:i}=e,{insecureRenderHtml:o}=e,l=null,u=null,f=!1,c=!1;function p(){Ui({title:"My wonderful open dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[],multiple:f,directory:c}).then(function(b){if(Array.isArray(b))i(b);else{var O=b,W=O.match(/\S+\.\S+$/g);Fi(O).then(function(U){W&&(O.includes(".png")||O.includes(".jpg"))?Fr(new Uint8Array(U),function(R){var q="data:image/png;base64,"+R;o('')}):i(b)}).catch(i(b))}}).catch(i)}function d(){Ul({title:"My wonderful save dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function k(){l=this.value,n(0,l)}function _(){u=this.value,n(1,u)}function y(){f=this.checked,n(2,f)}function g(){c=this.checked,n(3,c)}return t.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,o=b.insecureRenderHtml)},[l,u,f,c,p,d,i,o,k,_,y,g]}class Br extends Se{constructor(e){super(),Le(this,e,qr,Ur,Me,{onMessage:6,insecureRenderHtml:7})}}function Bo(t,e,n){const i=t.slice();return i[9]=e[n],i}function Vo(t){let e,n=t[9][0]+"",i,o;return{c(){e=s("option"),i=z(n),e.__value=o=t[9][1],e.value=e.__value},m(l,u){m(l,e,u),r(e,i)},p:J,d(l){l&&h(e)}}}function Vr(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,O,W,U,R,q=t[2],E=[];for(let L=0;LisNaN(parseInt(_))).map(_=>[_,Dt[_]]);function c(){const _=l.match(/\S+\.\S+$/g),y={dir:Go()};(_?Fi(l,y):ql(l,y)).then(function(b){if(_)if(l.includes(".png")||l.includes(".jpg"))Gr(new Uint8Array(b),function(O){const W="data:image/png;base64,"+O;o('')});else{const O=String.fromCharCode.apply(null,b);o(''),setTimeout(()=>{const W=document.getElementById("file-response");W.value=O,document.getElementById("file-save").addEventListener("click",function(){Pi(l,W.value,{dir:Go()}).catch(i)})})}else i(b)}).catch(i)}function p(){n(1,u.src=kl(l),u)}function d(){l=this.value,n(0,l)}function k(_){Kn[_?"unshift":"push"](()=>{u=_,n(1,u)})}return t.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage),"insecureRenderHtml"in _&&n(6,o=_.insecureRenderHtml)},[l,u,f,c,p,i,o,d,k]}class Xr extends Se{constructor(e){super(),Le(this,e,Jr,Vr,Me,{onMessage:5,insecureRenderHtml:6})}}var zt;(function(t){t[t.JSON=1]="JSON",t[t.Text=2]="Text",t[t.Binary=3]="Binary"})(zt||(zt={}));var Xn=function(){function t(e,n){this.type=e,this.payload=n}return t.form=function(e){var n={};for(var i in e){var o=e[i],l=void 0;l=typeof o=="string"?o:o instanceof Uint8Array||Array.isArray(o)?Array.from(o):typeof o.file=="string"?{file:o.file,mime:o.mime,fileName:o.fileName}:{file:Array.from(o.file),mime:o.mime,fileName:o.fileName},n[i]=l}return new t("Form",n)},t.json=function(e){return new t("Json",e)},t.text=function(e){return new t("Text",e)},t.bytes=function(e){return new t("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))},t}(),Bl=function(t){this.url=t.url,this.status=t.status,this.ok=this.status>=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data},Vl=function(){function t(e){this.id=e}return t.prototype.drop=function(){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,A({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},t.prototype.request=function(e){return M(this,void 0,void 0,function(){var n;return T(this,function(i){return(n=!e.responseType||e.responseType===zt.JSON)&&(e.responseType=zt.Text),[2,A({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(function(o){var l=new Bl(o);if(n){try{l.data=JSON.parse(l.data)}catch(u){if(l.ok&&l.data==="")l.data={};else if(l.ok)throw Error("Failed to parse response `".concat(l.data,"` as JSON: ").concat(u,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return l}return l})]})})},t.prototype.get=function(e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.request(ue({method:"GET",url:e},n))]})})},t.prototype.post=function(e,n,i){return M(this,void 0,void 0,function(){return T(this,function(o){return[2,this.request(ue({method:"POST",url:e,body:n},i))]})})},t.prototype.put=function(e,n,i){return M(this,void 0,void 0,function(){return T(this,function(o){return[2,this.request(ue({method:"PUT",url:e,body:n},i))]})})},t.prototype.patch=function(e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.request(ue({method:"PATCH",url:e},n))]})})},t.prototype.delete=function(e,n){return M(this,void 0,void 0,function(){return T(this,function(i){return[2,this.request(ue({method:"DELETE",url:e},n))]})})},t}();function $n(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,A({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then(function(n){return new Vl(n)})]})})}var Ei=null;function Yr(t,e){var n;return M(this,void 0,void 0,function(){return T(this,function(i){switch(i.label){case 0:return Ei!==null?[3,2]:[4,$n()];case 1:Ei=i.sent(),i.label=2;case 2:return[2,Ei.request(ue({url:t,method:(n=e==null?void 0:e.method)!==null&&n!==void 0?n:"GET"},e))]}})})}Object.freeze({__proto__:null,getClient:$n,fetch:Yr,Body:Xn,Client:Vl,Response:Bl,get ResponseType(){return zt}});function Jo(t,e,n){const i=t.slice();return i[12]=e[n],i[14]=n,i}function Xo(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,O,W,U=t[5],R=[];for(let S=0;SHe(R[S],1,1,()=>{R[S]=null});let E=!t[3]&&Qo(),L=!t[3]&&t[8]&&Zo();return{c(){e=s("span"),n=s("span"),i=z(t[6]),o=v(),l=s("ul");for(let S=0;S{d[g]=null}),ni(),l=d[o],l?l.p(_,y):(l=d[o]=p[o](_),l.c()),We(l,1),l.m(e,u))},i(_){f||(We(l),f=!0)},o(_){He(l),f=!1},d(_){_&&h(e),c&&c.d(),d[o].d()}}}function Qo(t){let e;return{c(){e=s("span"),e.textContent=",",a(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Zo(t){let e;return{c(){e=s("span"),e.textContent=",",a(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Qr(t){let e,n,i=t[5].length&&Xo(t);return{c(){i&&i.c(),e=ei()},m(o,l){i&&i.m(o,l),m(o,e,l),n=!0},p(o,[l]){o[5].length?i?(i.p(o,l),l&32&&We(i,1)):(i=Xo(o),i.c(),We(i,1),i.m(e.parentNode,e)):i&&(ti(),He(i,1,1,()=>{i=null}),ni())},i(o){n||(We(i),n=!0)},o(o){He(i),n=!1},d(o){i&&i.d(o),o&&h(e)}}}const Zr="...";function $r(t,e,n){let{json:i}=e,{depth:o=1/0}=e,{_lvl:l=0}=e,{_last:u=!0}=e;const f=b=>b===null?"null":typeof b;let c,p,d,k,_;const y=b=>{switch(f(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},g=()=>{n(8,_=!_)};return t.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,o=b.depth),"_lvl"in b&&n(2,l=b._lvl),"_last"in b&&n(3,u=b._last)},t.$$.update=()=>{t.$$.dirty&17&&(n(5,c=f(i)==="object"?Object.keys(i):[]),n(4,p=Array.isArray(i)),n(6,d=p?"[":"{"),n(7,k=p?"]":"}")),t.$$.dirty&6&&n(8,_=ot[9].call(n)),a(k,"class","input h-auto w-100%"),a(k,"id","request-body"),a(k,"placeholder","Request body"),a(k,"rows","5"),a(b,"class","btn"),a(b,"id","make-request"),a(L,"class","input"),a(P,"class","input"),a(E,"class","flex gap-2 children:grow"),a($,"type","checkbox"),a(x,"class","btn"),a(x,"type","button")},m(I,V){m(I,e,V),r(e,n),r(n,i),r(n,o),r(n,l),r(n,u),r(n,f),Ot(n,t[0]),r(e,c),r(e,p),r(e,d),r(e,k),G(k,t[1]),r(e,_),r(e,y),r(e,g),r(e,b),m(I,O,V),m(I,W,V),m(I,U,V),m(I,R,V),m(I,q,V),m(I,E,V),r(E,L),G(L,t[2]),r(E,S),r(E,P),G(P,t[3]),m(I,C,V),m(I,F,V),m(I,B,V),m(I,Y,V),r(Y,$),$.checked=t[5],r(Y,be),m(I,te,V),m(I,oe,V),m(I,K,V),m(I,ge,V),m(I,N,V),m(I,x,V),m(I,le,V),m(I,ae,V),m(I,ee,V),m(I,_e,V),m(I,re,V),Gt(ye,I,V),ne=!0,Te||(Ae=[D(n,"change",t[9]),D(k,"input",t[10]),D(e,"submit",Yn(t[6])),D(L,"input",t[11]),D(P,"input",t[12]),D($,"change",t[13]),D(x,"click",t[7])],Te=!0)},p(I,[V]){V&1&&Ot(n,I[0]),V&2&&G(k,I[1]),V&4&&L.value!==I[2]&&G(L,I[2]),V&8&&P.value!==I[3]&&G(P,I[3]),V&32&&($.checked=I[5]);const Ne={};V&16&&(Ne.json=I[4]),ye.$set(Ne)},i(I){ne||(We(ye.$$.fragment,I),ne=!0)},o(I){He(ye.$$.fragment,I),ne=!1},d(I){I&&h(e),I&&h(O),I&&h(W),I&&h(U),I&&h(R),I&&h(q),I&&h(E),I&&h(C),I&&h(F),I&&h(B),I&&h(Y),I&&h(te),I&&h(oe),I&&h(K),I&&h(ge),I&&h(N),I&&h(x),I&&h(le),I&&h(ae),I&&h(ee),I&&h(_e),I&&h(re),Jt(ye,I),Te=!1,pe(Ae)}}}function ts(t,e,n){let i="GET",o="",{onMessage:l}=e;async function u(){const W=await $n().catch(q=>{throw l(q),q}),R={url:"http://localhost:3003",method:i||"GET"||"GET"};o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]")?R.body=Xn.json(JSON.parse(o)):o!==""&&(R.body=Xn.text(o)),W.request(R).then(l).catch(l)}let f="baz",c="qux",p=null,d=!0;async function k(){const W=await $n().catch(U=>{throw l(U),U});n(4,p=await W.request({url:"http://localhost:3003",method:"POST",body:Xn.form({foo:f,bar:c}),headers:d?{"Content-Type":"multipart/form-data"}:void 0,responseType:zt.Text}))}function _(){i=Di(this),n(0,i)}function y(){o=this.value,n(1,o)}function g(){f=this.value,n(2,f)}function b(){c=this.value,n(3,c)}function O(){d=this.checked,n(5,d)}return t.$$set=W=>{"onMessage"in W&&n(8,l=W.onMessage)},[i,o,f,c,p,d,u,k,l,_,y,g,b,O]}class ns extends Se{constructor(e){super(),Le(this,e,ts,es,Me,{onMessage:8})}}function is(t){let e,n,i;return{c(){e=s("button"),e.textContent="Send test notification",a(e,"class","btn"),a(e,"id","notification")},m(o,l){m(o,e,l),n||(i=D(e,"click",os),n=!0)},p:J,i:J,o:J,d(o){o&&h(e),n=!1,i()}}}function os(){new Notification("Notification title",{body:"This is the notification body"})}function ls(t,e,n){let{onMessage:i}=e;return t.$$set=o=>{"onMessage"in o&&n(0,i=o.onMessage)},[i]}class rs extends Se{constructor(e){super(),Le(this,e,ls,is,Me,{onMessage:0})}}function $o(t,e,n){const i=t.slice();return i[65]=e[n],i}function el(t,e,n){const i=t.slice();return i[68]=e[n],i}function tl(t){let e,n,i,o,l,u,f=Object.keys(t[1]),c=[];for(let p=0;pt[38].call(i))},m(p,d){m(p,e,d),m(p,n,d),m(p,i,d),r(i,o);for(let k=0;kt[55].call(qe)),a(Ze,"class","input"),a(Ze,"type","number"),a($e,"class","input"),a($e,"type","number"),a(Fe,"class","flex gap-2"),a(et,"class","input grow"),a(et,"id","title"),a(Ht,"class","btn"),a(Ht,"type","submit"),a(ut,"class","flex gap-1"),a(tt,"class","input grow"),a(tt,"id","url"),a(Ut,"class","btn"),a(Ut,"id","open-url"),a(at,"class","flex gap-1"),a(st,"class","flex flex-col gap-1")},m(w,H){m(w,e,H),m(w,n,H),m(w,i,H),r(i,o),r(i,l),r(i,u),r(i,f),r(i,c),r(i,p),r(i,d),r(i,k),r(i,_),m(w,y,H),m(w,g,H),m(w,b,H),m(w,O,H),r(O,W),r(W,U),r(W,R),R.checked=t[3],r(O,q),r(O,E),r(E,L),r(E,S),S.checked=t[2],r(O,P),r(O,C),r(C,F),r(C,B),B.checked=t[4],r(O,Y),r(O,$),r($,be),r($,te),te.checked=t[5],r(O,oe),r(O,K),r(K,ge),r(K,N),N.checked=t[6],m(w,x,H),m(w,le,H),m(w,ae,H),m(w,ee,H),r(ee,_e),r(_e,re),r(re,ye),r(re,ne),G(ne,t[13]),r(_e,Te),r(_e,Ae),r(Ae,I),r(Ae,V),G(V,t[14]),r(ee,Ne),r(ee,Ee),r(Ee,Ce),r(Ce,ce),r(Ce,he),G(he,t[7]),r(Ee,fe),r(Ee,De),r(De,nt),r(De,me),G(me,t[8]),r(ee,de),r(ee,j),r(j,ie),r(ie,X),r(ie,we),G(we,t[9]),r(j,Kt),r(j,mt),r(mt,xt),r(mt,je),G(je,t[10]),r(ee,Qt),r(ee,Ve),r(Ve,Q),r(Q,Wt),r(Q,Pe),G(Pe,t[11]),r(Ve,Pt),r(Ve,it),r(it,Rt),r(it,Re),G(Re,t[12]),m(w,vt,H),m(w,_t,H),m(w,bt,H),m(w,ze,H),r(ze,Ue),r(Ue,Ie),r(Ie,ot),r(Ie,It),r(Ie,lt),r(lt,Nt),r(lt,oi),r(Ie,Bi),r(Ie,Zt),r(Zt,Vi),r(Zt,li),r(Ue,Gi),r(Ue,Ge),r(Ge,en),r(Ge,Ji),r(Ge,tn),r(tn,Xi),r(tn,ri),r(Ge,Yi),r(Ge,on),r(on,Ki),r(on,si),r(ze,xi),r(ze,yt),r(yt,Je),r(Je,rn),r(Je,Qi),r(Je,sn),r(sn,Zi),r(sn,ui),r(Je,$i),r(Je,an),r(an,eo),r(an,ai),r(yt,to),r(yt,Xe),r(Xe,fn),r(Xe,no),r(Xe,dn),r(dn,io),r(dn,ci),r(Xe,oo),r(Xe,hn),r(hn,lo),r(hn,fi),r(ze,ro),r(ze,wt),r(wt,Ye),r(Ye,vn),r(Ye,so),r(Ye,_n),r(_n,uo),r(_n,di),r(Ye,ao),r(Ye,gn),r(gn,co),r(gn,pi),r(wt,fo),r(wt,Ke),r(Ke,wn),r(Ke,po),r(Ke,kn),r(kn,ho),r(kn,hi),r(Ke,mo),r(Ke,Tn),r(Tn,vo),r(Tn,mi),r(ze,_o),r(ze,kt),r(kt,xe),r(xe,Ln),r(xe,bo),r(xe,Sn),r(Sn,go),r(Sn,vi),r(xe,yo),r(xe,An),r(An,wo),r(An,_i),r(kt,ko),r(kt,Qe),r(Qe,Dn),r(Qe,Mo),r(Qe,zn),r(zn,To),r(zn,bi),r(Qe,Co),r(Qe,Pn),r(Pn,Lo),r(Pn,gi),m(w,yi,H),m(w,wi,H),m(w,ki,H),m(w,jt,H),m(w,Mi,H),m(w,rt,H),r(rt,In),r(In,Mt),Mt.checked=t[15],r(In,So),r(rt,Oo),r(rt,Nn),r(Nn,Tt),Tt.checked=t[16],r(Nn,Ao),m(w,Ti,H),m(w,Fe,H),r(Fe,jn),r(jn,Eo),r(jn,qe);for(let ke=0;ke=1,d,k,_,y=p&&tl(t),g=t[1][t[0]]&&il(t);return{c(){e=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="New window",u=v(),f=s("br"),c=v(),y&&y.c(),d=v(),g&&g.c(),a(i,"class","input grow"),a(i,"type","text"),a(i,"placeholder","New Window label.."),a(l,"class","btn"),a(n,"class","flex gap-1"),a(e,"class","flex flex-col children:grow gap-2")},m(b,O){m(b,e,O),r(e,n),r(n,i),G(i,t[20]),r(n,o),r(n,l),r(e,u),r(e,f),r(e,c),y&&y.m(e,null),r(e,d),g&&g.m(e,null),k||(_=[D(i,"input",t[37]),D(l,"click",t[34])],k=!0)},p(b,O){O[0]&1048576&&i.value!==b[20]&&G(i,b[20]),O[0]&2&&(p=Object.keys(b[1]).length>=1),p?y?y.p(b,O):(y=tl(b),y.c(),y.m(e,d)):y&&(y.d(1),y=null),b[1][b[0]]?g?g.p(b,O):(g=il(b),g.c(),g.m(e,null)):g&&(g.d(1),g=null)},i:J,o:J,d(b){b&&h(e),y&&y.d(),g&&g.d(),k=!1,pe(_)}}}function us(t,e,n){let i=Be.label;const o={[Be.label]:Be},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"];let{onMessage:u}=e,f,c="https://tauri.app",p=!0,d=!1,k=!0,_=!1,y=!1,g=null,b=null,O=null,W=null,U=null,R=null,q=null,E=null,L=1,S=new dt(q,E),P=new dt(q,E),C=new St(g,b),F=new St(g,b),B,Y,$=!1,be=!0,te=null,oe=null,K="default",ge="Awesome Tauri Example!";function N(){Ni(c)}function x(){o[i].setTitle(ge)}function le(){o[i].hide(),setTimeout(o[i].show,2e3)}function ae(){o[i].minimize(),setTimeout(o[i].unminimize,2e3)}function ee(){Ui({multiple:!1}).then(Q=>{typeof Q=="string"&&o[i].setIcon(Q)})}function _e(){if(!f)return;const Q=new Et(f);n(1,o[f]=Q,o),Q.once("tauri://error",function(){u("Error creating new webview")})}function re(){o[i].innerSize().then(Q=>{n(25,C=Q),n(7,g=C.width),n(8,b=C.height)}),o[i].outerSize().then(Q=>{n(26,F=Q)})}function ye(){o[i].innerPosition().then(Q=>{n(23,S=Q)}),o[i].outerPosition().then(Q=>{n(24,P=Q),n(13,q=P.x),n(14,E=P.y)})}async function ne(Q){!Q||(B&&B(),Y&&Y(),Y=await Q.listen("tauri://move",ye),B=await Q.listen("tauri://resize",re))}async function Te(){await o[i].minimize(),await o[i].requestUserAttention(Xt.Critical),await new Promise(Q=>setTimeout(Q,3e3)),await o[i].requestUserAttention(null)}function Ae(){f=this.value,n(20,f)}function I(){i=Di(this),n(0,i),n(1,o)}const V=()=>o[i].center();function Ne(){d=this.checked,n(3,d)}function Ee(){p=this.checked,n(2,p)}function Ce(){k=this.checked,n(4,k)}function ce(){_=this.checked,n(5,_)}function he(){y=this.checked,n(6,y)}function fe(){q=se(this.value),n(13,q)}function De(){E=se(this.value),n(14,E)}function nt(){g=se(this.value),n(7,g)}function me(){b=se(this.value),n(8,b)}function de(){O=se(this.value),n(9,O)}function j(){W=se(this.value),n(10,W)}function ie(){U=se(this.value),n(11,U)}function X(){R=se(this.value),n(12,R)}function we(){$=this.checked,n(15,$)}function Kt(){be=this.checked,n(16,be)}function mt(){K=Di(this),n(19,K),n(28,l)}function xt(){te=se(this.value),n(17,te)}function je(){oe=se(this.value),n(18,oe)}function Qt(){ge=this.value,n(27,ge)}function Ve(){c=this.value,n(21,c)}return t.$$set=Q=>{"onMessage"in Q&&n(36,u=Q.onMessage)},t.$$.update=()=>{var Q,Wt,Pe,Pt,it,Rt,Re,vt,_t,bt,ze,Ue,Ie,ot,It,lt,Nt;t.$$.dirty[0]&3&&(o[i],ye(),re()),t.$$.dirty[0]&7&&((Q=o[i])==null||Q.setResizable(p)),t.$$.dirty[0]&11&&(d?(Wt=o[i])==null||Wt.maximize():(Pe=o[i])==null||Pe.unmaximize()),t.$$.dirty[0]&19&&((Pt=o[i])==null||Pt.setDecorations(k)),t.$$.dirty[0]&35&&((it=o[i])==null||it.setAlwaysOnTop(_)),t.$$.dirty[0]&67&&((Rt=o[i])==null||Rt.setFullscreen(y)),t.$$.dirty[0]&387&&g&&b&&((Re=o[i])==null||Re.setSize(new St(g,b))),t.$$.dirty[0]&1539&&(O&&W?(vt=o[i])==null||vt.setMinSize(new Zn(O,W)):(_t=o[i])==null||_t.setMinSize(null)),t.$$.dirty[0]&6147&&(U>800&&R>400?(bt=o[i])==null||bt.setMaxSize(new Zn(U,R)):(ze=o[i])==null||ze.setMaxSize(null)),t.$$.dirty[0]&24579&&q!==null&&E!==null&&((Ue=o[i])==null||Ue.setPosition(new dt(q,E))),t.$$.dirty[0]&3&&((Ie=o[i])==null||Ie.scaleFactor().then(gt=>n(22,L=gt))),t.$$.dirty[0]&3&&ne(o[i]),t.$$.dirty[0]&32771&&((ot=o[i])==null||ot.setCursorGrab($)),t.$$.dirty[0]&65539&&((It=o[i])==null||It.setCursorVisible(be)),t.$$.dirty[0]&524291&&((lt=o[i])==null||lt.setCursorIcon(K)),t.$$.dirty[0]&393219&&te!==null&&oe!==null&&((Nt=o[i])==null||Nt.setCursorPosition(new dt(te,oe)))},[i,o,p,d,k,_,y,g,b,O,W,U,R,q,E,$,be,te,oe,K,f,c,L,S,P,C,F,ge,l,N,x,le,ae,ee,_e,Te,u,Ae,I,V,Ne,Ee,Ce,ce,he,fe,De,nt,me,de,j,ie,X,we,Kt,mt,xt,je,Qt,Ve]}class as extends Se{constructor(e){super(),Le(this,e,us,ss,Me,{onMessage:36},null,[-1,-1,-1])}}function Jl(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,A({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:ht(e)}})]})})}function cs(t,e){return M(this,void 0,void 0,function(){return T(this,function(n){return[2,A({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:ht(e)}})]})})}function fs(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,A({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]})})}function Xl(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,A({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]})})}function Yl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,A({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:Jl,registerAll:cs,isRegistered:fs,unregister:Xl,unregisterAll:Yl});function ll(t,e,n){const i=t.slice();return i[9]=e[n],i}function rl(t){let e,n=t[9]+"",i,o,l,u,f;function c(){return t[8](t[9])}return{c(){e=s("div"),i=z(n),o=v(),l=s("button"),l.textContent="Unregister",a(l,"class","btn"),a(l,"type","button"),a(e,"class","flex justify-between")},m(p,d){m(p,e,d),r(e,i),r(e,o),r(e,l),u||(f=D(l,"click",c),u=!0)},p(p,d){t=p,d&2&&n!==(n=t[9]+"")&&Z(i,n)},d(p){p&&h(e),u=!1,f()}}}function sl(t){let e,n,i,o,l;return{c(){e=s("br"),n=v(),i=s("button"),i.textContent="Unregister all",a(i,"class","btn"),a(i,"type","button")},m(u,f){m(u,e,f),m(u,n,f),m(u,i,f),o||(l=D(i,"click",t[5]),o=!0)},p:J,d(u){u&&h(e),u&&h(n),u&&h(i),o=!1,l()}}}function ds(t){let e,n,i,o,l,u,f,c,p,d,k,_=t[1],y=[];for(let b=0;b<_.length;b+=1)y[b]=rl(ll(t,_,b));let g=t[1].length>1&&sl(t);return{c(){e=s("div"),n=s("input"),i=v(),o=s("button"),o.textContent="Register",l=v(),u=s("br"),f=v(),c=s("div");for(let b=0;b1?g?g.p(b,O):(g=sl(b),g.c(),g.m(c,null)):g&&(g.d(1),g=null)},i:J,o:J,d(b){b&&h(e),b&&h(l),b&&h(u),b&&h(f),b&&h(c),pt(y,b),g&&g.d(),d=!1,pe(k)}}}function ps(t,e,n){let i,{onMessage:o}=e;const l=wl([]);bl(t,l,_=>n(1,i=_));let u="CmdOrControl+X";function f(){const _=u;Jl(_,()=>{o(`Shortcut ${_} triggered`)}).then(()=>{l.update(y=>[...y,_]),o(`Shortcut ${_} registered successfully`)}).catch(o)}function c(_){const y=_;Xl(y).then(()=>{l.update(g=>g.filter(b=>b!==y)),o(`Shortcut ${y} unregistered`)}).catch(o)}function p(){Yl().then(()=>{l.update(()=>[]),o("Unregistered all shortcuts")}).catch(o)}function d(){u=this.value,n(0,u)}const k=_=>c(_);return t.$$set=_=>{"onMessage"in _&&n(6,o=_.onMessage)},[u,i,l,f,c,p,o,d,k]}class hs extends Se{constructor(e){super(),Le(this,e,ps,ds,Me,{onMessage:6})}}function ul(t){let e,n,i,o,l,u,f;return{c(){e=s("br"),n=v(),i=s("input"),o=v(),l=s("button"),l.textContent="Write",a(i,"class","input"),a(i,"placeholder","write to stdin"),a(l,"class","btn")},m(c,p){m(c,e,p),m(c,n,p),m(c,i,p),G(i,t[4]),m(c,o,p),m(c,l,p),u||(f=[D(i,"input",t[14]),D(l,"click",t[8])],u=!0)},p(c,p){p&16&&i.value!==c[4]&&G(i,c[4])},d(c){c&&h(e),c&&h(n),c&&h(i),c&&h(o),c&&h(l),u=!1,pe(f)}}}function ms(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,O,W,U,R,q,E,L,S,P,C=t[5]&&ul(t);return{c(){e=s("div"),n=s("div"),i=z(`Script: + `),o=s("input"),l=v(),u=s("div"),f=z(`Encoding: + `),c=s("input"),p=v(),d=s("div"),k=z(`Working directory: + `),_=s("input"),y=v(),g=s("div"),b=z(`Arguments: + `),O=s("input"),W=v(),U=s("div"),R=s("button"),R.textContent="Run",q=v(),E=s("button"),E.textContent="Kill",L=v(),C&&C.c(),a(o,"class","grow input"),a(n,"class","flex items-center gap-1"),a(c,"class","grow input"),a(u,"class","flex items-center gap-1"),a(_,"class","grow input"),a(_,"placeholder","Working directory"),a(d,"class","flex items-center gap-1"),a(O,"class","grow input"),a(O,"placeholder","Environment variables"),a(g,"class","flex items-center gap-1"),a(R,"class","btn"),a(E,"class","btn"),a(U,"class","flex children:grow gap-1"),a(e,"class","flex flex-col childre:grow gap-1")},m(F,B){m(F,e,B),r(e,n),r(n,i),r(n,o),G(o,t[0]),r(e,l),r(e,u),r(u,f),r(u,c),G(c,t[3]),r(e,p),r(e,d),r(d,k),r(d,_),G(_,t[1]),r(e,y),r(e,g),r(g,b),r(g,O),G(O,t[2]),r(e,W),r(e,U),r(U,R),r(U,q),r(U,E),r(e,L),C&&C.m(e,null),S||(P=[D(o,"input",t[10]),D(c,"input",t[11]),D(_,"input",t[12]),D(O,"input",t[13]),D(R,"click",t[6]),D(E,"click",t[7])],S=!0)},p(F,[B]){B&1&&o.value!==F[0]&&G(o,F[0]),B&8&&c.value!==F[3]&&G(c,F[3]),B&2&&_.value!==F[1]&&G(_,F[1]),B&4&&O.value!==F[2]&&G(O,F[2]),F[5]?C?C.p(F,B):(C=ul(F),C.c(),C.m(e,null)):C&&(C.d(1),C=null)},i:J,o:J,d(F){F&&h(e),C&&C.d(),S=!1,pe(P)}}}function vs(t,e,n){const i=navigator.userAgent.includes("Windows");let o=i?"cmd":"sh",l=i?["/C"]:["-c"],{onMessage:u}=e,f='echo "hello world"',c=null,p="SOMETHING=value ANOTHER=2",d="",k="",_;function y(){return p.split(" ").reduce((L,S)=>{let[P,C]=S.split("=");return{...L,[P]:C}},{})}function g(){n(5,_=null);const L=new Tl(o,[...l,f],{cwd:c||null,env:y(),encoding:d});L.on("close",S=>{u(`command finished with code ${S.code} and signal ${S.signal}`),n(5,_=null)}),L.on("error",S=>u(`command error: "${S}"`)),L.stdout.on("data",S=>u(`command stdout: "${S}"`)),L.stderr.on("data",S=>u(`command stderr: "${S}"`)),L.spawn().then(S=>{n(5,_=S)}).catch(u)}function b(){_.kill().then(()=>u("killed child process")).catch(u)}function O(){_.write(k).catch(u)}function W(){f=this.value,n(0,f)}function U(){d=this.value,n(3,d)}function R(){c=this.value,n(1,c)}function q(){p=this.value,n(2,p)}function E(){k=this.value,n(4,k)}return t.$$set=L=>{"onMessage"in L&&n(9,u=L.onMessage)},[f,c,p,d,k,_,g,b,O,u,W,U,R,q,E]}class _s extends Se{constructor(e){super(),Le(this,e,vs,ms,Me,{onMessage:9})}}function qi(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,Yt(ve.STATUS_UPDATE,function(n){t(n==null?void 0:n.payload)})]})})}function Kl(){return M(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return T(this,function(n){return[2,new Promise(function(i,o){qi(function(l){return l.error?(t(),o(l.error)):l.status==="DONE"?(t(),i()):void 0}).then(function(l){e=l}).catch(function(l){throw t(),l}),ii(ve.INSTALL_UPDATE).catch(function(l){throw t(),l})})]})})}function xl(){return M(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return T(this,function(n){return[2,new Promise(function(i,o){Ol(ve.UPDATE_AVAILABLE,function(l){var u;u=l==null?void 0:l.payload,t(),i({manifest:u,shouldUpdate:!0})}).catch(function(l){throw t(),l}),qi(function(l){return l.error?(t(),o(l.error)):l.status==="UPTODATE"?(t(),i({shouldUpdate:!1})):void 0}).then(function(l){e=l}).catch(function(l){throw t(),l}),ii(ve.CHECK_UPDATE).catch(function(l){throw t(),l})})]})})}Object.freeze({__proto__:null,onUpdaterEvent:qi,installUpdate:Kl,checkUpdate:xl});function bs(t){let e;return{c(){e=s("button"),e.innerHTML='
',a(e,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){m(n,e,i)},p:J,d(n){n&&h(e)}}}function gs(t){let e,n,i;return{c(){e=s("button"),e.textContent="Install update",a(e,"class","btn")},m(o,l){m(o,e,l),n||(i=D(e,"click",t[4]),n=!0)},p:J,d(o){o&&h(e),n=!1,i()}}}function ys(t){let e,n,i;return{c(){e=s("button"),e.textContent="Check update",a(e,"class","btn")},m(o,l){m(o,e,l),n||(i=D(e,"click",t[3]),n=!0)},p:J,d(o){o&&h(e),n=!1,i()}}}function ws(t){let e;function n(l,u){return!l[0]&&!l[2]?ys:!l[1]&&l[2]?gs:bs}let i=n(t),o=i(t);return{c(){e=s("div"),o.c(),a(e,"class","flex children:grow children:h10")},m(l,u){m(l,e,u),o.m(e,null)},p(l,[u]){i===(i=n(l))&&o?o.p(l,u):(o.d(1),o=i(l),o&&(o.c(),o.m(e,null)))},i:J,o:J,d(l){l&&h(e),o.d()}}}function ks(t,e,n){let{onMessage:i}=e,o;ct(async()=>{o=await Yt("tauri://update-status",i)}),Ri(()=>{o&&o()});let l,u,f;async function c(){n(0,l=!0);try{const{shouldUpdate:d,manifest:k}=await xl();i(`Should update: ${d}`),i(k),n(2,f=d)}catch(d){i(d)}finally{n(0,l=!1)}}async function p(){n(1,u=!0);try{await Kl(),i("Installation complete, restart required."),await Hi()}catch(d){i(d)}finally{n(1,u=!1)}}return t.$$set=d=>{"onMessage"in d&&n(5,i=d.onMessage)},[l,u,f,c,p,i]}class Ms extends Se{constructor(e){super(),Le(this,e,ks,ws,Me,{onMessage:5})}}function Ql(t){return M(this,void 0,void 0,function(){return T(this,function(e){return[2,A({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}})]})})}function Zl(){return M(this,void 0,void 0,function(){return T(this,function(t){return[2,A({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})]})})}Object.freeze({__proto__:null,writeText:Ql,readText:Zl});function Ts(t){let e,n,i,o,l,u,f,c;return{c(){e=s("div"),n=s("input"),i=v(),o=s("button"),o.textContent="Write",l=v(),u=s("button"),u.textContent="Read",a(n,"class","grow input"),a(n,"placeholder","Text to write to the clipboard"),a(o,"class","btn"),a(o,"type","button"),a(u,"class","btn"),a(u,"type","button"),a(e,"class","flex gap-1")},m(p,d){m(p,e,d),r(e,n),G(n,t[0]),r(e,i),r(e,o),r(e,l),r(e,u),f||(c=[D(n,"input",t[4]),D(o,"click",t[1]),D(u,"click",t[2])],f=!0)},p(p,[d]){d&1&&n.value!==p[0]&&G(n,p[0])},i:J,o:J,d(p){p&&h(e),f=!1,pe(c)}}}function Cs(t,e,n){let{onMessage:i}=e,o="clipboard message";function l(){Ql(o).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){Zl().then(c=>{i(`Clipboard contents: ${c}`)}).catch(i)}function f(){o=this.value,n(0,o)}return t.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,l,u,i,f]}class Ls extends Se{constructor(e){super(),Le(this,e,Cs,Ts,Me,{onMessage:3})}}function Ss(t){let e;return{c(){e=s("div"),e.innerHTML=`
Not available for Linux
+ `,a(e,"class","flex flex-col gap-2")},m(n,i){m(n,e,i)},p:J,i:J,o:J,d(n){n&&h(e)}}}function Os(t,e,n){let{onMessage:i}=e;const o=window.constraints={audio:!0,video:!0};function l(f){const c=document.querySelector("video"),p=f.getVideoTracks();i("Got stream with constraints:",o),i(`Using video device: ${p[0].label}`),window.stream=f,c.srcObject=f}function u(f){if(f.name==="ConstraintNotSatisfiedError"){const c=o.video;i(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else f.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: ${f.name}`,f)}return ct(async()=>{try{const f=await navigator.mediaDevices.getUserMedia(o);l(f)}catch(f){u(f)}}),Ri(()=>{window.stream.getTracks().forEach(function(f){f.stop()})}),t.$$set=f=>{"onMessage"in f&&n(0,i=f.onMessage)},[i]}class As extends Se{constructor(e){super(),Le(this,e,Os,Ss,Me,{onMessage:0})}}function al(t,e,n){const i=t.slice();return i[32]=e[n],i}function cl(t,e,n){const i=t.slice();return i[35]=e[n],i}function fl(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b;function O(L,S){return L[3]?Ds:Es}let W=O(t),U=W(t);function R(L,S){return L[2]?Ws:zs}let q=R(t),E=q(t);return{c(){e=s("div"),n=s("span"),n.textContent="Tauri API Validation",i=v(),o=s("span"),l=s("span"),U.c(),f=v(),c=s("span"),c.innerHTML='
',p=v(),d=s("span"),E.c(),_=v(),y=s("span"),y.innerHTML='
',a(n,"class","lt-sm:pl-10 text-darkPrimaryText"),a(l,"title",u=t[3]?"Switch to Light mode":"Switch to Dark mode"),a(l,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(c,"title","Minimize"),a(c,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(d,"title",k=t[2]?"Restore":"Maximize"),a(d,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(y,"title","Close"),a(y,"class","hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText "),a(o,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),a(e,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),a(e,"data-tauri-drag-region","")},m(L,S){m(L,e,S),r(e,n),r(e,i),r(e,o),r(o,l),U.m(l,null),r(o,f),r(o,c),r(o,p),r(o,d),E.m(d,null),r(o,_),r(o,y),g||(b=[D(l,"click",t[12]),D(c,"click",t[9]),D(d,"click",t[10]),D(y,"click",t[11])],g=!0)},p(L,S){W!==(W=O(L))&&(U.d(1),U=W(L),U&&(U.c(),U.m(l,null))),S[0]&8&&u!==(u=L[3]?"Switch to Light mode":"Switch to Dark mode")&&a(l,"title",u),q!==(q=R(L))&&(E.d(1),E=q(L),E&&(E.c(),E.m(d,null))),S[0]&4&&k!==(k=L[2]?"Restore":"Maximize")&&a(d,"title",k)},d(L){L&&h(e),U.d(),E.d(),g=!1,pe(b)}}}function Es(t){let e;return{c(){e=s("div"),a(e,"class","i-ph-moon")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Ds(t){let e;return{c(){e=s("div"),a(e,"class","i-ph-sun")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function zs(t){let e;return{c(){e=s("div"),a(e,"class","i-codicon-chrome-maximize")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Ws(t){let e;return{c(){e=s("div"),a(e,"class","i-codicon-chrome-restore")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Ps(t){let e;return{c(){e=s("span"),a(e,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Rs(t){let e;return{c(){e=s("span"),a(e,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function dl(t){let e,n,i,o,l,u,f,c,p;function d(y,g){return y[3]?Ns:Is}let k=d(t),_=k(t);return{c(){e=s("a"),_.c(),n=v(),i=s("br"),o=v(),l=s("div"),u=v(),f=s("br"),a(e,"href","##"),a(e,"class","nv justify-between h-8"),a(l,"class","bg-white/5 h-2px")},m(y,g){m(y,e,g),_.m(e,null),m(y,n,g),m(y,i,g),m(y,o,g),m(y,l,g),m(y,u,g),m(y,f,g),c||(p=D(e,"click",t[12]),c=!0)},p(y,g){k!==(k=d(y))&&(_.d(1),_=k(y),_&&(_.c(),_.m(e,null)))},d(y){y&&h(e),_.d(),y&&h(n),y&&h(i),y&&h(o),y&&h(l),y&&h(u),y&&h(f),c=!1,p()}}}function Is(t){let e,n;return{c(){e=z(`Switch to Dark mode + `),n=s("div"),a(n,"class","i-ph-moon")},m(i,o){m(i,e,o),m(i,n,o)},d(i){i&&h(e),i&&h(n)}}}function Ns(t){let e,n;return{c(){e=z(`Switch to Light mode + `),n=s("div"),a(n,"class","i-ph-sun")},m(i,o){m(i,e,o),m(i,n,o)},d(i){i&&h(e),i&&h(n)}}}function js(t){let e,n,i,o,l,u=t[35].label+"",f,c,p,d;function k(){return t[20](t[35])}return{c(){e=s("a"),n=s("div"),o=v(),l=s("p"),f=z(u),a(n,"class",i=t[35].icon+" mr-2"),a(e,"href","##"),a(e,"class",c="nv "+(t[1]===t[35]?"nv_selected":""))},m(_,y){m(_,e,y),r(e,n),r(e,o),r(e,l),r(l,f),p||(d=D(e,"click",k),p=!0)},p(_,y){t=_,y[0]&2&&c!==(c="nv "+(t[1]===t[35]?"nv_selected":""))&&a(e,"class",c)},d(_){_&&h(e),p=!1,d()}}}function pl(t){let e,n=t[35]&&js(t);return{c(){n&&n.c(),e=ei()},m(i,o){n&&n.m(i,o),m(i,e,o)},p(i,o){i[35]&&n.p(i,o)},d(i){n&&n.d(i),i&&h(e)}}}function hl(t){let e,n=t[32].html+"",i;return{c(){e=new rr(!1),i=ei(),e.a=i},m(o,l){e.m(n,o,l),m(o,i,l)},p(o,l){l[0]&64&&n!==(n=o[32].html+"")&&e.p(n)},d(o){o&&h(i),o&&e.d()}}}function Hs(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,O,W,U,R,q,E,L,S,P,C,F,B,Y=t[1].label+"",$,be,te,oe,K,ge,N,x,le,ae,ee,_e,re,ye,ne,Te,Ae,I,V=t[5]&&fl(t);function Ne(j,ie){return j[0]?Rs:Ps}let Ee=Ne(t),Ce=Ee(t),ce=!t[5]&&dl(t),he=t[7],fe=[];for(let j=0;j`,k=v(),_=s("a"),_.innerHTML=`GitHub `,y=v(),g=s("a"),g.innerHTML=`Source - `,b=v(),L=s("br"),W=v(),U=s("div"),j=v(),q=s("br"),A=v(),S=s("div");for(let F=0;F',ge=v(),ne=s("div");for(let F=0;F{Gt(X,1)}),ti()}Pe?(K=new Pe(tt(F)),Kn(K.$$.fragment),Ee(K.$$.fragment,1),Vt(K,oe,null)):K=null}if(ie[0]&64){me=F[6];let X;for(X=0;X{await confirm("Are you sure?")||H.preventDefault()}),qe.onFileDropEvent(H=>{W(`File drop: ${JSON.stringify(H.payload)}`)});const o=navigator.userAgent.toLowerCase(),l=o.includes("android")||o.includes("iphone"),u=[{label:"Welcome",component:kr,icon:"i-ph-hand-waving"},{label:"Communication",component:Lr,icon:"i-codicon-radio-tower"},!l&&{label:"CLI",component:Cr,icon:"i-codicon-terminal"},!l&&{label:"Dialog",component:Nr,icon:"i-codicon-multiple-windows"},{label:"File system",component:Gr,icon:"i-codicon-files"},{label:"HTTP",component:es,icon:"i-ph-globe-hemisphere-west"},!l&&{label:"Notifications",component:os,icon:"i-codicon-bell-dot"},!l&&{label:"Window",component:ss,icon:"i-codicon-window"},!l&&{label:"Shortcuts",component:ds,icon:"i-codicon-record-keys"},{label:"Shell",component:ms,icon:"i-codicon-terminal-bash"},!l&&{label:"Updater",component:ws,icon:"i-codicon-cloud-download"},!l&&{label:"Clipboard",component:Ts,icon:"i-codicon-clippy"},{label:"WebRTC",component:zs,icon:"i-ph-broadcast"}];let f=u[0];function c(H){n(1,f=H)}let p;at(async()=>{const H=Nt();n(2,p=await H.isMaximized()),Xt("tauri://resize",async()=>{n(2,p=await H.isMaximized())})});function d(){Nt().minimize()}async function k(){const H=Nt();await H.isMaximized()?H.unmaximize():H.maximize()}let _=!1;async function y(){_||(_=await Ul("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&Nt().close())}let g;at(()=>{n(3,g=localStorage&&localStorage.getItem("theme")=="dark"),ml(g)});function b(){n(3,g=!g),ml(g)}let L=yl([]);_l(t,L,H=>n(6,i=H));function W(H){L.update(x=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof H=="string"?H:JSON.stringify(H,null,1))+"
"},...x])}function U(H){L.update(x=>[{html:`
[${new Date().toLocaleTimeString()}]: `+H+"
"},...x])}function j(){L.update(()=>[])}let q,A,S;function z(H){S=H.clientY;const x=window.getComputedStyle(q);A=parseInt(x.height,10);const le=ee=>{const ve=ee.clientY-S,re=A-ve;n(4,q.style.height=`${re{document.removeEventListener("mouseup",ae),document.removeEventListener("mousemove",le)};document.addEventListener("mouseup",ae),document.addEventListener("mousemove",le)}let D;at(async()=>{n(5,D=await El()==="win32")});let C=!1,N,B,Y=!1,$=0,_e=0;const te=(H,x,le)=>Math.min(Math.max(x,H),le);at(()=>{n(18,N=document.querySelector("#sidebar")),B=document.querySelector("#sidebarToggle"),document.addEventListener("click",H=>{B.contains(H.target)?n(0,C=!C):C&&!N.contains(H.target)&&n(0,C=!1)}),document.addEventListener("touchstart",H=>{if(B.contains(H.target))return;const x=H.touches[0].clientX;(0{if(Y){const x=H.touches[0].clientX;_e=x;const le=(x-$)/10;N.style.setProperty("--translate-x",`-${te(0,C?0-le:18.75-le,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(Y){const H=(_e-$)/10;n(0,C=C?H>-(18.75/2):H>18.75/2)}Y=!1})});const oe=()=>Ri("https://tauri.app/"),K=H=>{c(H),n(0,C=!1)};function be(H){Yn[H?"unshift":"push"](()=>{q=H,n(4,q)})}return t.$$.update=()=>{if(t.$$.dirty[0]&1){const H=document.querySelector("#sidebar");H&&Fs(H,C)}},[C,f,p,g,q,D,i,u,c,d,k,y,b,L,W,U,j,z,N,oe,K,be]}class Us extends Se{constructor(e){super(),Ce(this,e,Is,Hs,ke,{},null,[-1,-1])}}new Us({target:document.querySelector("#app")}); + `,b=v(),O=s("br"),W=v(),U=s("div"),R=v(),q=s("br"),E=v(),L=s("div");for(let j=0;j',ye=v(),ne=s("div");for(let j=0;j{Jt(X,1)}),ni()}De?(K=new De(nt(j)),xn(K.$$.fragment),We(K.$$.fragment,1),Gt(K,oe,null)):K=null}if(ie[0]&64){me=j[6];let X;for(X=0;X{await confirm("Are you sure?")||N.preventDefault()}),Be.onFileDropEvent(N=>{W(`File drop: ${JSON.stringify(N.payload)}`)});const o=navigator.userAgent.toLowerCase(),l=o.includes("android")||o.includes("iphone"),u=[{label:"Welcome",component:Mr,icon:"i-ph-hand-waving"},{label:"Communication",component:Ar,icon:"i-codicon-radio-tower"},!l&&{label:"CLI",component:Lr,icon:"i-codicon-terminal"},!l&&{label:"Dialog",component:Br,icon:"i-codicon-multiple-windows"},{label:"File system",component:Xr,icon:"i-codicon-files"},{label:"HTTP",component:ns,icon:"i-ph-globe-hemisphere-west"},!l&&{label:"Notifications",component:rs,icon:"i-codicon-bell-dot"},!l&&{label:"Window",component:as,icon:"i-codicon-window"},!l&&{label:"Shortcuts",component:hs,icon:"i-codicon-record-keys"},{label:"Shell",component:_s,icon:"i-codicon-terminal-bash"},!l&&{label:"Updater",component:Ms,icon:"i-codicon-cloud-download"},!l&&{label:"Clipboard",component:Ls,icon:"i-codicon-clippy"},{label:"WebRTC",component:As,icon:"i-ph-broadcast"}];let f=u[0];function c(N){n(1,f=N)}let p;ct(async()=>{const N=qt();n(2,p=await N.isMaximized()),Yt("tauri://resize",async()=>{n(2,p=await N.isMaximized())})});function d(){qt().minimize()}async function k(){const N=qt();await N.isMaximized()?N.unmaximize():N.maximize()}let _=!1;async function y(){_||(_=await Fl("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&qt().close())}let g;ct(()=>{n(3,g=localStorage&&localStorage.getItem("theme")=="dark"),vl(g)});function b(){n(3,g=!g),vl(g)}let O=wl([]);bl(t,O,N=>n(6,i=N));function W(N){O.update(x=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof N=="string"?N:JSON.stringify(N,null,1))+"
"},...x])}function U(N){O.update(x=>[{html:`
[${new Date().toLocaleTimeString()}]: `+N+"
"},...x])}function R(){O.update(()=>[])}let q,E,L;function S(N){L=N.clientY;const x=window.getComputedStyle(q);E=parseInt(x.height,10);const le=ee=>{const _e=ee.clientY-L,re=E-_e;n(4,q.style.height=`${re{document.removeEventListener("mouseup",ae),document.removeEventListener("mousemove",le)};document.addEventListener("mouseup",ae),document.addEventListener("mousemove",le)}let P;ct(async()=>{n(5,P=await Pl()==="win32")});let C=!1,F,B,Y=!1,$=0,be=0;const te=(N,x,le)=>Math.min(Math.max(x,N),le);ct(()=>{n(18,F=document.querySelector("#sidebar")),B=document.querySelector("#sidebarToggle"),document.addEventListener("click",N=>{B.contains(N.target)?n(0,C=!C):C&&!F.contains(N.target)&&n(0,C=!1)}),document.addEventListener("touchstart",N=>{if(B.contains(N.target))return;const x=N.touches[0].clientX;(0{if(Y){const x=N.touches[0].clientX;be=x;const le=(x-$)/10;F.style.setProperty("--translate-x",`-${te(0,C?0-le:18.75-le,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(Y){const N=(be-$)/10;n(0,C=C?N>-(18.75/2):N>18.75/2)}Y=!1})});const oe=()=>Ni("https://tauri.app/"),K=N=>{c(N),n(0,C=!1)};function ge(N){Kn[N?"unshift":"push"](()=>{q=N,n(4,q)})}return t.$$.update=()=>{if(t.$$.dirty[0]&1){const N=document.querySelector("#sidebar");N&&Us(N,C)}},[C,f,p,g,q,P,i,u,c,d,k,y,b,O,W,U,R,S,F,oe,K,ge]}class qs extends Se{constructor(e){super(),Le(this,e,Fs,Hs,Me,{},null,[-1,-1])}}new qs({target:document.querySelector("#app")}); diff --git a/tooling/api/src/fs.ts b/tooling/api/src/fs.ts index 82353aeb1d5..9187763a699 100644 --- a/tooling/api/src/fs.ts +++ b/tooling/api/src/fs.ts @@ -21,7 +21,8 @@ * "createDir": true, * "removeDir": true, * "removeFile": true, - * "renameFile": true + * "renameFile": true, + * "exists": true * } * } * } @@ -550,6 +551,28 @@ async function renameFile( }) } +/** + * Check if a path exists. + * @example + * ```typescript + * import { exists, BaseDirectory } from '@tauri-apps/api/fs'; + * // Check if the `$APPDIR/avatar.png` file exists + * await exists('avatar.png', { dir: BaseDirectory.App }); + * ``` + * + * @since 1.1.0 + */ +async function exists(path: string, options: FsOptions = {}): Promise { + return invokeTauriCommand({ + __tauriModule: 'Fs', + message: { + cmd: 'exists', + path, + options + } + }) +} + export type { FsOptions, FsDirOptions, @@ -571,5 +594,6 @@ export { removeDir, copyFile, removeFile, - renameFile + renameFile, + exists } diff --git a/tooling/cli/schema.json b/tooling/cli/schema.json index f11ea6a08a6..8cf02ca26fb 100644 --- a/tooling/cli/schema.json +++ b/tooling/cli/schema.json @@ -45,6 +45,7 @@ "all": false, "copyFile": false, "createDir": false, + "exists": false, "readDir": false, "readFile": false, "removeDir": false, @@ -306,6 +307,7 @@ "all": false, "copyFile": false, "createDir": false, + "exists": false, "readDir": false, "readFile": false, "removeDir": false, @@ -1498,6 +1500,7 @@ "all": false, "copyFile": false, "createDir": false, + "exists": false, "readDir": false, "readFile": false, "removeDir": false, @@ -1735,6 +1738,11 @@ "description": "Rename file from local filesystem.", "default": false, "type": "boolean" + }, + "exists": { + "description": "Check if path exists on the local filesystem.", + "default": false, + "type": "boolean" } }, "additionalProperties": false