From f5109e0c962e3d25404995194968bade1be33b16 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Fri, 4 Feb 2022 21:57:41 -0300 Subject: [PATCH] fix(api): window label null instead of actual value, closes #3295 (#3332) --- .changes/fix-window-label-api.md | 5 +++++ .changes/refactor-window-metadata.md | 5 +++++ core/tauri/scripts/bundle.js | 2 +- core/tauri/scripts/core.js | 2 +- core/tauri/src/manager.rs | 20 +++++++++---------- examples/api/dist/assets/index.js | 18 ++++++++--------- tooling/api/src/window.ts | 30 ++++++++++++---------------- 7 files changed, 44 insertions(+), 38 deletions(-) create mode 100644 .changes/fix-window-label-api.md create mode 100644 .changes/refactor-window-metadata.md diff --git a/.changes/fix-window-label-api.md b/.changes/fix-window-label-api.md new file mode 100644 index 00000000000..e2c3ac45937 --- /dev/null +++ b/.changes/fix-window-label-api.md @@ -0,0 +1,5 @@ +--- +"api": patch +--- + +Fixes `window.label` property returning null instead of the actual label. diff --git a/.changes/refactor-window-metadata.md b/.changes/refactor-window-metadata.md new file mode 100644 index 00000000000..ba23c2abce9 --- /dev/null +++ b/.changes/refactor-window-metadata.md @@ -0,0 +1,5 @@ +--- +"tauri": "patch" +--- + +**Breaking change:** Move `__currentWindow` and `__windows` values from `window.__TAURI__` to `window.__TAURI_METADATA__`. diff --git a/core/tauri/scripts/bundle.js b/core/tauri/scripts/bundle.js index a58ac0dfc16..dca4f6dc571 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||function(e,t){return e.__proto__=t,e})(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:function(e){return e.__proto__||Object.getPrototypeOf(e)})(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;--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),d}},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:O(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},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,i)}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,o)}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){return navigator.userAgent.includes("Windows")?"https://asset.localhost/".concat(e):"asset://".concat(e)}});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 m(){return(m=_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 d=Object.freeze({__proto__:null,getMatches:function(){return m.apply(this,arguments)}});function y(){return(y=_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 g(){return(g=_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"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _=Object.freeze({__proto__:null,writeText:function(e){return y.apply(this,arguments)},readText:function(){return g.apply(this,arguments)}});function w(){return(w=_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:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(){return(v=_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)})))).apply(this,arguments)}function b(){return(b=_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:"Dialog",message:{cmd:"messageDialog",message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(){return(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",s({__tauriModule:"Dialog",message:{cmd:"askDialog",title:r,message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=_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:"Dialog",message:{cmd:"confirmDialog",title:r,message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var x=Object.freeze({__proto__:null,open:function(){return w.apply(this,arguments)},save:function(){return v.apply(this,arguments)},message:function(e){return b.apply(this,arguments)},ask:function(e,t){return R.apply(this,arguments)},confirm:function(e,t){return k.apply(this,arguments)}});function T(e,t,r){return G.apply(this,arguments)}function G(){return(G=_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)})))).apply(this,arguments)}function P(e){return M.apply(this,arguments)}function M(){return(M=_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:"Event",message:{cmd:"unlisten",eventId:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(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",s({__tauriModule:"Event",message:{cmd:"listen",event:t,handler:a(r)}}).then((function(e){return _asyncToGenerator(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",P(e));case 1:case"end":return t.stop()}}),t)})))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function C(e,t){return S.apply(this,arguments)}function S(){return(S=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,(function(e){r(e),P(e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function D(e,t){return A.apply(this,arguments)}function A(){return(A=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",T(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var z,L=Object.freeze({__proto__:null,listen:O,once:C,emit:D});function E(){return(E=_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:"readFile",path:t,options:r}}).then((function(e){return(new TextDecoder).decode(new Uint8Array(e))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(){return(W=_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:"readFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function F(){return(F=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from((new TextEncoder).encode(t.contents)),options:r}}));case 4:case"end":return e.stop()}}),e)})))).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"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from(t.contents),options:r}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(){return(N=_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)})))).apply(this,arguments)}function U(){return(U=_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)})))).apply(this,arguments)}function H(){return(H=_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)})))).apply(this,arguments)}function q(){return(q=_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 B(){return(B=_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)})))).apply(this,arguments)}function V(){return(V=_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)})))).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"}(z||(z={}));var J=Object.freeze({__proto__:null,get BaseDirectory(){return z},get Dir(){return z},readTextFile:function(e){return E.apply(this,arguments)},readBinaryFile:function(e){return W.apply(this,arguments)},writeFile:function(e){return F.apply(this,arguments)},writeBinaryFile:function(e){return I.apply(this,arguments)},readDir:function(e){return N.apply(this,arguments)},createDir:function(e){return U.apply(this,arguments)},removeDir:function(e){return H.apply(this,arguments)},copyFile:function(e,t){return q.apply(this,arguments)},removeFile:function(e){return B.apply(this,arguments)},renameFile:function(e,t){return V.apply(this,arguments)}});function K(){return(K=_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 Y(){return(Y=_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 $(){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:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Q(){return(Q=_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 X(){return(X=_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 Z,ee=Object.freeze({__proto__:null,register:function(e,t){return K.apply(this,arguments)},registerAll:function(e,t){return Y.apply(this,arguments)},isRegistered:function(e){return $.apply(this,arguments)},unregister:function(e){return Q.apply(this,arguments)},unregisterAll:function(){return X.apply(this,arguments)}});function te(e,t){return null!=e?e:t()}function re(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})),oe=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===Z.JSON)&&(t.responseType=Z.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new ae(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 ie(e){return ue.apply(this,arguments)}function ue(){return(ue=_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 oe(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var se=null;function ce(){return(ce=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==se){e.next=4;break}return e.next=3,ie();case 3:se=e.sent;case 4:return e.abrupt("return",se.request(_objectSpread({url:t,method:te(re([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var pe=Object.freeze({__proto__:null,getClient:ie,fetch:function(e,t){return ce.apply(this,arguments)},Body:ne,Client:oe,Response:ae,get ResponseType(){return Z}});function le(){return(le=_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 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",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var he=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return fe.apply(this,arguments)},isPermissionGranted:function(){return le.apply(this,arguments)}});function me(){return navigator.appVersion.includes("Win")}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:z.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ye(){return(ye=_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:z.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:z.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _e(){return(_e=_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:z.Config}}));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:z.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ve(){return(ve=_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:z.Desktop}}));case 1: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",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:z.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Re(){return(Re=_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:z.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}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:z.Executable}}));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:z.Font}}));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:z.Home}}));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:z.LocalData}}));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:z.Picture}}));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:z.Public}}));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:z.Resource}}));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:z.Runtime}}));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:z.Template}}));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:z.Video}}));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:z.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ae=me()?"\\":"/",ze=me()?";":":";function Le(){return(Le=_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)})))).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",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ve=Object.freeze({__proto__:null,exit:function(){return qe.apply(this,arguments)},relaunch:function(){return Be.apply(this,arguments)}});function Je(e,t){return null!=e?e:t()}function Ke(e,t,r,n){return Ye.apply(this,arguments)}function Ye(){return(Ye=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n,o){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"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 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var $e=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addEventListener",value:function(e,t){e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t]}},{key:"_emit",value:function(e,t){if(e in this.eventListeners){var r,n=_createForOfIteratorHelper(this.eventListeners[e]);try{for(n.s();!(r=n.n()).done;){(0,r.value)(t)}}catch(e){n.e(e)}finally{n.f()}}}},{key:"on",value:function(e,t){return this.addEventListener(e,t),this}}]),e}(),Qe=function(){function e(t){_classCallCheck(this,e),this.pid=t}var t,r;return _createClass(e,[{key:"write",value:(r=_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:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:t}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"kill",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),Xe=function(e){_inherits(a,e);var t,r,n=_createSuper(a);function a(e){var t,r=arguments.length>1&&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=Je(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new $e}},{key:"__init3",value:function(){this.stderr=new $e}},{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",Ke((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 Qe(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}($e);function Ze(){return(Ze=_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)})))).apply(this,arguments)}var et=Object.freeze({__proto__:null,Command:Xe,Child:Qe,open:function(e,t){return Ze.apply(this,arguments)}});function tt(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),ot([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 lt().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(mt),yt=new dt(null,{skip:!0});function gt(){return(gt=_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 _t(){return(_t=_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 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:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var vt=Object.freeze({__proto__:null,WebviewWindow:dt,WebviewWindowHandle:ht,WindowManager:mt,getCurrent:function(){return new dt(window.__TAURI__.__currentWindow.label,{skip:!0})},getAll:lt,appWindow:yt,LogicalSize:ut,PhysicalSize:st,LogicalPosition:ct,PhysicalPosition:pt,get UserAttentionType(){return it},currentMonitor:function(){return gt.apply(this,arguments)},primaryMonitor:function(){return _t.apply(this,arguments)},availableMonitors:function(){return wt.apply(this,arguments)}}),bt=me()?"\r\n":"\n";function Rt(){return(Rt=_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 kt(){return(kt=_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 xt(){return(xt=_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 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:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Gt(){return(Gt=_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 Pt=Object.freeze({__proto__:null,EOL:bt,platform:function(){return Rt.apply(this,arguments)},version:function(){return kt.apply(this,arguments)},type:function(){return xt.apply(this,arguments)},arch:function(){return Tt.apply(this,arguments)},tempdir:function(){return Gt.apply(this,arguments)}}),Mt=o;e.app=h,e.cli=d,e.clipboard=_,e.dialog=x,e.event=L,e.fs=J,e.globalShortcut=ee,e.http=pe,e.invoke=Mt,e.notification=he,e.os=Pt,e.path=He,e.process=Ve,e.shell=et,e.tauri=u,e.updater=at,e.window=vt,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||function(e,t){return e.__proto__=t,e})(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:function(e){return e.__proto__||Object.getPrototypeOf(e)})(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;--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),d}},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:O(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},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,i)}),!0),i=a((function(e){n(e),Reflect.deleteProperty(window,o)}),!0);window.__TAURI_IPC__(_objectSpread({cmd:t,callback:o,error:i},r))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var u=Object.freeze({__proto__:null,transformCallback:a,invoke:o,convertFileSrc:function(e){return navigator.userAgent.includes("Windows")?"https://asset.localhost/".concat(e):"asset://".concat(e)}});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 m(){return(m=_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 d=Object.freeze({__proto__:null,getMatches:function(){return m.apply(this,arguments)}});function y(){return(y=_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 g(){return(g=_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"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _=Object.freeze({__proto__:null,writeText:function(e){return y.apply(this,arguments)},readText:function(){return g.apply(this,arguments)}});function w(){return(w=_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:"openDialog",options:t}}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(){return(v=_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)})))).apply(this,arguments)}function b(){return(b=_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:"Dialog",message:{cmd:"messageDialog",message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(){return(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",s({__tauriModule:"Dialog",message:{cmd:"askDialog",title:r,message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(){return(k=_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:"Dialog",message:{cmd:"confirmDialog",title:r,message:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var x=Object.freeze({__proto__:null,open:function(){return w.apply(this,arguments)},save:function(){return v.apply(this,arguments)},message:function(e){return b.apply(this,arguments)},ask:function(e,t){return R.apply(this,arguments)},confirm:function(e,t){return k.apply(this,arguments)}});function T(e,t,r){return G.apply(this,arguments)}function G(){return(G=_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)})))).apply(this,arguments)}function P(e){return M.apply(this,arguments)}function M(){return(M=_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:"Event",message:{cmd:"unlisten",eventId:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(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",s({__tauriModule:"Event",message:{cmd:"listen",event:t,handler:a(r)}}).then((function(e){return _asyncToGenerator(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",P(e));case 1:case"end":return t.stop()}}),t)})))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function C(e,t){return A.apply(this,arguments)}function A(){return(A=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",O(t,(function(e){r(e),P(e.id).catch((function(){}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(e,t){return D.apply(this,arguments)}function D(){return(D=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",T(t,null,r));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var z,L=Object.freeze({__proto__:null,listen:O,once:C,emit:S});function E(){return(E=_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:"readFile",path:t,options:r}}).then((function(e){return(new TextDecoder).decode(new Uint8Array(e))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(){return(W=_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:"readFile",path:t,options:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function F(){return(F=_asyncToGenerator(regeneratorRuntime.mark((function e(t){var r,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from((new TextEncoder).encode(t.contents)),options:r}}));case 4:case"end":return e.stop()}}),e)})))).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"object"===_typeof(r=n.length>1&&void 0!==n[1]?n[1]:{})&&Object.freeze(r),"object"===_typeof(t)&&Object.freeze(t),e.abrupt("return",s({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:Array.from(t.contents),options:r}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(){return(N=_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)})))).apply(this,arguments)}function U(){return(U=_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)})))).apply(this,arguments)}function H(){return(H=_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)})))).apply(this,arguments)}function q(){return(q=_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 B(){return(B=_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)})))).apply(this,arguments)}function V(){return(V=_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)})))).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"}(z||(z={}));var J=Object.freeze({__proto__:null,get BaseDirectory(){return z},get Dir(){return z},readTextFile:function(e){return E.apply(this,arguments)},readBinaryFile:function(e){return W.apply(this,arguments)},writeFile:function(e){return F.apply(this,arguments)},writeBinaryFile:function(e){return I.apply(this,arguments)},readDir:function(e){return N.apply(this,arguments)},createDir:function(e){return U.apply(this,arguments)},removeDir:function(e){return H.apply(this,arguments)},copyFile:function(e,t){return q.apply(this,arguments)},removeFile:function(e){return B.apply(this,arguments)},renameFile:function(e,t){return V.apply(this,arguments)}});function K(){return(K=_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 Y(){return(Y=_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 $(){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:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Q(){return(Q=_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 X(){return(X=_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 Z,ee=Object.freeze({__proto__:null,register:function(e,t){return K.apply(this,arguments)},registerAll:function(e,t){return Y.apply(this,arguments)},isRegistered:function(e){return $.apply(this,arguments)},unregister:function(e){return Q.apply(this,arguments)},unregisterAll:function(){return X.apply(this,arguments)}});function te(e,t){return null!=e?e:t()}function re(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})),oe=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===Z.JSON)&&(t.responseType=Z.Text),e.abrupt("return",s({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(e){var t=new ae(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 ie(e){return ue.apply(this,arguments)}function ue(){return(ue=_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 oe(e)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var se=null;function ce(){return(ce=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==se){e.next=4;break}return e.next=3,ie();case 3:se=e.sent;case 4:return e.abrupt("return",se.request(_objectSpread({url:t,method:te(re([r,"optionalAccess",function(e){return e.method}]),(function(){return"GET"}))},r)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var pe=Object.freeze({__proto__:null,getClient:ie,fetch:function(e,t){return ce.apply(this,arguments)},Body:ne,Client:oe,Response:ae,get ResponseType(){return Z}});function le(){return(le=_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 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",window.Notification.requestPermission());case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var he=Object.freeze({__proto__:null,sendNotification:function(e){"string"==typeof e?new window.Notification(e):new window.Notification(e.title,e)},requestPermission:function(){return fe.apply(this,arguments)},isPermissionGranted:function(){return le.apply(this,arguments)}});function me(){return navigator.appVersion.includes("Win")}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:z.App}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ye(){return(ye=_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:z.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:z.Cache}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _e(){return(_e=_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:z.Config}}));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:z.Data}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ve(){return(ve=_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:z.Desktop}}));case 1: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",s({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:z.Document}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Re(){return(Re=_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:z.Download}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}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:z.Executable}}));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:z.Font}}));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:z.Home}}));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:z.LocalData}}));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:z.Picture}}));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:z.Public}}));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:z.Resource}}));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:z.Runtime}}));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:z.Template}}));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:z.Video}}));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:z.Log}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var De=me()?"\\":"/",ze=me()?";":":";function Le(){return(Le=_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)})))).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",s({__tauriModule:"Process",message:{cmd:"relaunch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ve=Object.freeze({__proto__:null,exit:function(){return qe.apply(this,arguments)},relaunch:function(){return Be.apply(this,arguments)}});function Je(e,t){return null!=e?e:t()}function Ke(e,t,r,n){return Ye.apply(this,arguments)}function Ye(){return(Ye=_asyncToGenerator(regeneratorRuntime.mark((function e(t,r,n,o){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"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 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var $e=function(){function e(){_classCallCheck(this,e),e.prototype.__init.call(this)}return _createClass(e,[{key:"__init",value:function(){this.eventListeners=Object.create(null)}},{key:"addEventListener",value:function(e,t){e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t]}},{key:"_emit",value:function(e,t){if(e in this.eventListeners){var r,n=_createForOfIteratorHelper(this.eventListeners[e]);try{for(n.s();!(r=n.n()).done;){(0,r.value)(t)}}catch(e){n.e(e)}finally{n.f()}}}},{key:"on",value:function(e,t){return this.addEventListener(e,t),this}}]),e}(),Qe=function(){function e(t){_classCallCheck(this,e),this.pid=t}var t,r;return _createClass(e,[{key:"write",value:(r=_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:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:t}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"kill",value:(t=_asyncToGenerator(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),Xe=function(e){_inherits(a,e);var t,r,n=_createSuper(a);function a(e){var t,r=arguments.length>1&&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=Je(o,(function(){return{}})),t}return _createClass(a,[{key:"__init2",value:function(){this.stdout=new $e}},{key:"__init3",value:function(){this.stderr=new $e}},{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",Ke((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 Qe(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}($e);function Ze(){return(Ze=_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)})))).apply(this,arguments)}var et=Object.freeze({__proto__:null,Command:Xe,Child:Qe,open:function(e,t){return Ze.apply(this,arguments)}});function tt(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),ot([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 lt().some((function(t){return t.label===e}))?new r(e,{skip:!0}):null}}]),r}(mt),yt=new dt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0});function gt(){return(gt=_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 _t(){return(_t=_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 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:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var vt=Object.freeze({__proto__:null,WebviewWindow:dt,WebviewWindowHandle:ht,WindowManager:mt,getCurrent:function(){return new dt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},getAll:lt,appWindow:yt,LogicalSize:ut,PhysicalSize:st,LogicalPosition:ct,PhysicalPosition:pt,get UserAttentionType(){return it},currentMonitor:function(){return gt.apply(this,arguments)},primaryMonitor:function(){return _t.apply(this,arguments)},availableMonitors:function(){return wt.apply(this,arguments)}}),bt=me()?"\r\n":"\n";function Rt(){return(Rt=_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 kt(){return(kt=_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 xt(){return(xt=_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 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:"Os",message:{cmd:"arch"}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Gt(){return(Gt=_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 Pt=Object.freeze({__proto__:null,EOL:bt,platform:function(){return Rt.apply(this,arguments)},version:function(){return kt.apply(this,arguments)},type:function(){return xt.apply(this,arguments)},arch:function(){return Tt.apply(this,arguments)},tempdir:function(){return Gt.apply(this,arguments)}}),Mt=o;e.app=h,e.cli=d,e.clipboard=_,e.dialog=x,e.event=L,e.fs=J,e.globalShortcut=ee,e.http=pe,e.invoke=Mt,e.notification=he,e.os=Pt,e.path=He,e.process=Ve,e.shell=et,e.tauri=u,e.updater=at,e.window=vt,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/core/tauri/scripts/core.js b/core/tauri/scripts/core.js index 4f40ea8997f..0f0bbf317f0 100644 --- a/core/tauri/scripts/core.js +++ b/core/tauri/scripts/core.js @@ -158,7 +158,7 @@ handler: window.__TAURI__.transformCallback(function (event) { if (event.payload) { var windowLabel = event.payload.label - window.__TAURI__.__windows.push({ + window.__TAURI_METADATA__.__windows.push({ label: windowLabel }) } diff --git a/core/tauri/src/manager.rs b/core/tauri/src/manager.rs index aab0b585ab1..d8b20975173 100644 --- a/core/tauri/src/manager.rs +++ b/core/tauri/src/manager.rs @@ -424,20 +424,20 @@ impl WindowManager { webview_attributes = webview_attributes .initialization_script(&self.inner.invoke_initialization_script) - .initialization_script(&self.initialization_script(&ipc_init,&pattern_init,&plugin_init, is_init_global)?) .initialization_script(&format!( r#" - if (!window.__TAURI__) {{ - Object.defineProperty(window, '__TAURI__', {{ - value: {{}} - }}) - }} - window.__TAURI__.__windows = {window_labels_array}.map(function (label) {{ return {{ label: label }} }}); - window.__TAURI__.__currentWindow = {{ label: {current_window_label} }} + Object.defineProperty(window, '__TAURI_METADATA__', {{ + value: {{ + __windows: {window_labels_array}.map(function (label) {{ return {{ label: label }} }}), + __currentWindow: {{ label: {current_window_label} }} + }} + }}) "#, window_labels_array = serde_json::to_string(pending_labels)?, current_window_label = serde_json::to_string(&label)?, - )); + )) + .initialization_script(&self.initialization_script(&ipc_init,&pattern_init,&plugin_init, is_init_global)?) + ; #[cfg(feature = "isolation")] if let Pattern::Isolation { schema, .. } = self.pattern() { @@ -1164,7 +1164,7 @@ fn on_window_event( let label = window.label(); for window in manager.inner.windows.lock().unwrap().values() { window.eval(&format!( - r#"window.__TAURI__.__windows = window.__TAURI__.__windows.filter(w => w.label !== "{}");"#, + r#"window.__TAURI_METADATA__.__windows = window.__TAURI_METADATA__.__windows.filter(w => w.label !== "{}");"#, label ))?; } diff --git a/examples/api/dist/assets/index.js b/examples/api/dist/assets/index.js index 478b7dcbc33..ef45a9f3031 100644 --- a/examples/api/dist/assets/index.js +++ b/examples/api/dist/assets/index.js @@ -1,4 +1,4 @@ -var Ho=Object.defineProperty,Io=Object.defineProperties;var qo=Object.getOwnPropertyDescriptors;var Ui=Object.getOwnPropertySymbols;var No=Object.prototype.hasOwnProperty,Bo=Object.prototype.propertyIsEnumerable;var Hi=(e,t,n)=>t in e?Ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ii=(e,t)=>{for(var n in t||(t={}))No.call(t,n)&&Hi(e,n,t[n]);if(Ui)for(var n of Ui(t))Bo.call(t,n)&&Hi(e,n,t[n]);return e},qi=(e,t)=>Io(e,qo(t));import{S as X,i as Y,s as $,e as s,a as v,t as z,b as a,c as O,d as r,l as T,f as G,n as I,g as W,r as x,o as Xe,h as Wn,j as A,p as Ye,k as he,m as Go,q as Ni,u as dt,v as $e,w as Bi,x as J,y as Gi,z as Vi,A as Ji,B as Ki,C as Xi,D as Yi,E as Vo,F as $i,G as Qi,H as Jo,I as Ko,J as Xo}from"./vendor.js";const Yo=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.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)}};Yo();/*! ***************************************************************************** +var Ho=Object.defineProperty,Io=Object.defineProperties;var qo=Object.getOwnPropertyDescriptors;var Ui=Object.getOwnPropertySymbols;var No=Object.prototype.hasOwnProperty,Bo=Object.prototype.propertyIsEnumerable;var Hi=(e,t,n)=>t in e?Ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ii=(e,t)=>{for(var n in t||(t={}))No.call(t,n)&&Hi(e,n,t[n]);if(Ui)for(var n of Ui(t))Bo.call(t,n)&&Hi(e,n,t[n]);return e},qi=(e,t)=>Io(e,qo(t));import{S as X,i as Y,s as $,e as s,a as v,t as z,b as a,c as O,d as r,l as C,f as G,n as I,g as W,r as x,o as Xe,h as Wn,j as E,p as Ye,k as he,m as Go,q as Ni,u as dt,v as $e,w as Bi,x as J,y as Gi,z as Vi,A as Ji,B as Ki,C as Xi,D as Yi,E as Vo,F as $i,G as Qi,H as Jo,I as Ko,J as Xo}from"./vendor.js";const Yo=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.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)}};Yo();/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -11,29 +11,29 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Zi=function(e,t){return(Zi=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])})(e,t)};function Ln(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Zi(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ft=function(){return(ft=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&o[o.length-1])||f[0]!==6&&f[0]!==2)){u=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]0&&o[o.length-1])||f[0]!==6&&f[0]!==2)){u=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]{n(2,l=p)}),no().then(p=>{n(0,i=p)}),oo().then(p=>{n(1,o=p)});async function u(){await ro()}async function c(){await Dn()}return[i,o,l,u,c]}class xo extends X{constructor(t){super();Y(this,t,Zo,Qo,$,{})}}function lo(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,C({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]})})}Object.freeze({__proto__:null,getMatches:lo});function tr(e){let t,n,i,o,l,u,c,p,h,f,M;return{c(){t=s("div"),n=z(`This binary can be run on the terminal and takes the following arguments: +`)})}),n.spawn().catch(l)})]})})},t}(An);function En(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})]})})}Object.freeze({__proto__:null,Command:eo,Child:to,open:En});function no(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"App",message:{cmd:"getAppVersion"}})]})})}function io(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"App",message:{cmd:"getAppName"}})]})})}function oo(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"App",message:{cmd:"getTauriVersion"}})]})})}Object.freeze({__proto__:null,getName:io,getVersion:no,getTauriVersion:oo});function ro(e){return e===void 0&&(e=0),g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})]})})}function Dn(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"Process",message:{cmd:"relaunch"}})]})})}Object.freeze({__proto__:null,exit:ro,relaunch:Dn});function Qo(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y,P,S,j,F,U;return{c(){t=s("h1"),t.textContent="Welcome",n=v(),i=s("p"),i.textContent="Tauri's API capabilities using the ` @tauri-apps/api ` package. It's used as\n the main validation app, serving as the testbed of our development process. In\n the future, this app will be used on Tauri's integration tests.",o=v(),l=s("p"),u=z("Current App version: "),c=z(e[0]),p=v(),h=s("p"),f=z("Current Tauri version: "),M=z(e[1]),m=v(),d=s("p"),b=z("Current App name: "),k=z(e[2]),y=v(),P=s("button"),P.textContent="Close application",S=v(),j=s("button"),j.textContent="Relaunch application",a(P,"class","button"),a(j,"class","button")},m(L,H){O(L,t,H),O(L,n,H),O(L,i,H),O(L,o,H),O(L,l,H),r(l,u),r(l,c),O(L,p,H),O(L,h,H),r(h,f),r(h,M),O(L,m,H),O(L,d,H),r(d,b),r(d,k),O(L,y,H),O(L,P,H),O(L,S,H),O(L,j,H),F||(U=[C(P,"click",e[3]),C(j,"click",e[4])],F=!0)},p(L,[H]){H&1&&G(c,L[0]),H&2&&G(M,L[1]),H&4&&G(k,L[2])},i:I,o:I,d(L){L&&W(t),L&&W(n),L&&W(i),L&&W(o),L&&W(l),L&&W(p),L&&W(h),L&&W(m),L&&W(d),L&&W(y),L&&W(P),L&&W(S),L&&W(j),F=!1,x(U)}}}function Zo(e,t,n){let i=0,o=0,l="Unknown";io().then(p=>{n(2,l=p)}),no().then(p=>{n(0,i=p)}),oo().then(p=>{n(1,o=p)});async function u(){await ro()}async function c(){await Dn()}return[i,o,l,u,c]}class xo extends X{constructor(t){super();Y(this,t,Zo,Qo,$,{})}}function lo(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]})})}Object.freeze({__proto__:null,getMatches:lo});function tr(e){let t,n,i,o,l,u,c,p,h,f,M;return{c(){t=s("div"),n=z(`This binary can be run on the terminal and takes the following arguments: `),i=s("ul"),i.innerHTML=`
  • --config PATH
  • --theme light|dark|system
  • --verbose
  • `,o=z(` Additionally, it has a `),l=s("i"),l.textContent="update --background",u=z(` subcommand. Note that the arguments are only parsed, not implemented. - `),c=s("br"),p=v(),h=s("button"),h.textContent="Get matches",a(h,"class","button"),a(h,"id","cli-matches")},m(m,d){O(m,t,d),r(t,n),r(t,i),r(t,o),r(t,l),r(t,u),r(t,c),r(t,p),r(t,h),f||(M=T(h,"click",e[0]),f=!0)},p:I,i:I,o:I,d(m){m&&W(t),f=!1,M()}}}function er(e,t,n){let{onMessage:i}=t;function o(){lo().then(i).catch(i)}return e.$$set=l=>{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class nr extends X{constructor(t){super();Y(this,t,er,tr,$,{onMessage:1})}}function uo(e,t,n){return g(this,void 0,void 0,function(){return _(this,function(i){switch(i.label){case 0:return[4,C({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:typeof n=="string"?n:JSON.stringify(n)}})];case 1:return i.sent(),[2]}})})}function so(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,C({__tauriModule:"Event",message:{cmd:"unlisten",eventId:e}})]})})}function Et(e,t){return g(this,void 0,void 0,function(){var n=this;return _(this,function(i){return[2,C({__tauriModule:"Event",message:{cmd:"listen",event:e,handler:Lt(t)}}).then(function(o){return function(){return g(n,void 0,void 0,function(){return _(this,function(l){return[2,so(o)]})})}})]})})}function Rn(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,Et(e,function(i){t(i),so(i.id).catch(function(){})})]})})}function Qe(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,uo(e,null,t)]})})}Object.freeze({__proto__:null,listen:Et,once:Rn,emit:Qe});function ir(e){let t,n,i,o,l,u,c,p;return{c(){t=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","button"),a(n,"id","log"),a(o,"class","button"),a(o,"id","request"),a(u,"class","button"),a(u,"id","event")},m(h,f){O(h,t,f),r(t,n),r(t,i),r(t,o),r(t,l),r(t,u),c||(p=[T(n,"click",e[0]),T(o,"click",e[1]),T(u,"click",e[2])],c=!0)},p:I,i:I,o:I,d(h){h&&W(t),c=!1,x(p)}}}function or(e,t,n){let{onMessage:i}=t,o;Xe(async()=>{o=await Et("rust-event",i)}),Wn(()=>{o&&o()});function l(){me("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){me("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){Qe("js-event","this is the payload string")}return e.$$set=p=>{"onMessage"in p&&n(3,i=p.onMessage)},[l,u,c,i]}class rr extends X{constructor(t){super();Y(this,t,or,ir,$,{onMessage:3})}}function jn(e){return e===void 0&&(e={}),g(this,void 0,void 0,function(){return _(this,function(t){return typeof e=="object"&&Object.freeze(e),[2,C({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})]})})}function ao(e){return e===void 0&&(e={}),g(this,void 0,void 0,function(){return _(this,function(t){return typeof e=="object"&&Object.freeze(e),[2,C({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})]})})}function lr(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,C({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e}})]})})}function ur(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,C({__tauriModule:"Dialog",message:{cmd:"askDialog",title:t,message:e}})]})})}function sr(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,C({__tauriModule:"Dialog",message:{cmd:"confirmDialog",title:t,message:e}})]})})}Object.freeze({__proto__:null,open:jn,save:ao,message:lr,ask:ur,confirm:sr});var Vt;function ar(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,C({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}}).then(function(i){return new TextDecoder().decode(new Uint8Array(i))})]})})}function Fn(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,C({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}})]})})}function cr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return typeof t=="object"&&Object.freeze(t),typeof e=="object"&&Object.freeze(e),[2,C({__tauriModule:"Fs",message:{cmd:"writeFile",path:e.path,contents:Array.from(new TextEncoder().encode(e.contents)),options:t}})]})})}function dr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return typeof t=="object"&&Object.freeze(t),typeof e=="object"&&Object.freeze(e),[2,C({__tauriModule:"Fs",message:{cmd:"writeFile",path:e.path,contents:Array.from(e.contents),options:t}})]})})}function co(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,C({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})]})})}function fr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,C({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})]})})}function pr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,C({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})]})})}function hr(e,t,n){return n===void 0&&(n={}),g(this,void 0,void 0,function(){return _(this,function(i){return[2,C({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})]})})}function mr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,C({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})]})})}function vr(e,t,n){return n===void 0&&(n={}),g(this,void 0,void 0,function(){return _(this,function(i){return[2,C({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})]})})}(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"})(Vt||(Vt={}));Object.freeze({__proto__:null,get BaseDirectory(){return Vt},get Dir(){return Vt},readTextFile:ar,readBinaryFile:Fn,writeFile:cr,writeBinaryFile:dr,readDir:co,createDir:fr,removeDir:pr,copyFile:hr,removeFile:mr,renameFile:vr});function gr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y,P,S,j,F;return{c(){t=s("div"),n=s("input"),i=v(),o=s("input"),l=v(),u=s("div"),c=s("input"),p=v(),h=s("label"),h.textContent="Multiple",f=v(),M=s("div"),m=s("input"),d=v(),b=s("label"),b.textContent="Directory",k=v(),y=s("button"),y.textContent="Open dialog",P=v(),S=s("button"),S.textContent="Open save dialog",a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(o,"id","dialog-filter"),a(o,"placeholder","Extensions filter, comma-separated"),a(o,"class","svelte-1eg58yg"),a(c,"type","checkbox"),a(c,"id","dialog-multiple"),a(h,"for","dialog-multiple"),a(m,"type","checkbox"),a(m,"id","dialog-directory"),a(b,"for","dialog-directory"),a(y,"class","button"),a(y,"id","open-dialog"),a(S,"class","button"),a(S,"id","save-dialog")},m(U,L){O(U,t,L),r(t,n),A(n,e[0]),r(t,i),r(t,o),A(o,e[1]),r(t,l),r(t,u),r(u,c),c.checked=e[2],r(u,p),r(u,h),r(t,f),r(t,M),r(M,m),m.checked=e[3],r(M,d),r(M,b),r(t,k),r(t,y),r(t,P),r(t,S),j||(F=[T(n,"input",e[8]),T(o,"input",e[9]),T(c,"change",e[10]),T(m,"change",e[11]),T(y,"click",e[4]),T(S,"click",e[5])],j=!0)},p(U,[L]){L&1&&n.value!==U[0]&&A(n,U[0]),L&2&&o.value!==U[1]&&A(o,U[1]),L&4&&(c.checked=U[2]),L&8&&(m.checked=U[3])},i:I,o:I,d(U){U&&W(t),j=!1,x(F)}}}function _r(e,t){var n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){var l=o.target.result;t(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function br(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:o}=t,l=null,u=null,c=!1,p=!1;function h(){jn({title:"My wonderful open dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(k=>k.trim())}]:[],multiple:c,directory:p}).then(function(k){if(Array.isArray(k))i(k);else{var y=k,P=y.match(/\S+\.\S+$/g);Fn(y).then(function(S){P&&(y.includes(".png")||y.includes(".jpg"))?_r(new Uint8Array(S),function(j){var F="data:image/png;base64,"+j;o('')}):i(k)}).catch(i(k))}}).catch(i)}function f(){ao({title:"My wonderful save dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(k=>k.trim())}]:[]}).then(i).catch(i)}function M(){l=this.value,n(0,l)}function m(){u=this.value,n(1,u)}function d(){c=this.checked,n(2,c)}function b(){p=this.checked,n(3,p)}return e.$$set=k=>{"onMessage"in k&&n(6,i=k.onMessage),"insecureRenderHtml"in k&&n(7,o=k.insecureRenderHtml)},[l,u,c,p,h,f,i,o,M,m,d,b]}class yr extends X{constructor(t){super();Y(this,t,br,gr,$,{onMessage:6,insecureRenderHtml:7})}}function fo(e,t,n){const i=e.slice();return i[9]=t[n],i}function po(e){let t,n=e[9][0]+"",i,o;return{c(){t=s("option"),i=z(n),t.__value=o=e[9][1],t.value=t.__value},m(l,u){O(l,t,u),r(t,i)},p:I,d(l){l&&W(t)}}}function wr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b=e[2],k=[];for(let y=0;yisNaN(parseInt(m))).map(m=>[m,Vt[m]]);function p(){const m=l.match(/\S+\.\S+$/g),d={dir:ho()};(m?Fn(l,d):co(l,d)).then(function(k){if(m)if(l.includes(".png")||l.includes(".jpg"))Mr(new Uint8Array(k),function(y){const P="data:image/png;base64,"+y;o('')});else{const y=String.fromCharCode.apply(null,k);o(''),setTimeout(()=>{const P=document.getElementById("file-response");P.value=y,document.getElementById("file-save").addEventListener("click",function(){writeFile({file:l,contents:P.value},{dir:ho()}).catch(i)})})}else i(k)}).catch(i)}function h(){n(1,u.src=xi(l),u)}function f(){l=this.value,n(0,l)}function M(m){Go[m?"unshift":"push"](()=>{u=m,n(1,u)})}return e.$$set=m=>{"onMessage"in m&&n(5,i=m.onMessage),"insecureRenderHtml"in m&&n(6,o=m.insecureRenderHtml)},[l,u,c,p,h,i,o,f,M]}class Cr extends X{constructor(t){super();Y(this,t,kr,wr,$,{onMessage:5,insecureRenderHtml:6})}}var ve;(function(e){e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary"})(ve||(ve={}));var Un=function(){function e(t,n){this.type=t,this.payload=n}return e.form=function(t){return new e("Form",t)},e.json=function(t){return new e("Json",t)},e.text=function(t){return new e("Text",t)},e.bytes=function(t){return new e("Bytes",t)},e}(),mo=function(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data},vo=function(){function e(t){this.id=t}return e.prototype.drop=function(){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,C({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},e.prototype.request=function(t){return g(this,void 0,void 0,function(){var n;return _(this,function(i){return(n=!t.responseType||t.responseType===ve.JSON)&&(t.responseType=ve.Text),[2,C({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then(function(o){var l=new mo(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})]})})},e.prototype.get=function(t,n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,this.request(ft({method:"GET",url:t},n))]})})},e.prototype.post=function(t,n,i){return g(this,void 0,void 0,function(){return _(this,function(o){return[2,this.request(ft({method:"POST",url:t,body:n},i))]})})},e.prototype.put=function(t,n,i){return g(this,void 0,void 0,function(){return _(this,function(o){return[2,this.request(ft({method:"PUT",url:t,body:n},i))]})})},e.prototype.patch=function(t,n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,this.request(ft({method:"PATCH",url:t},n))]})})},e.prototype.delete=function(t,n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,this.request(ft({method:"DELETE",url:t},n))]})})},e}();function Hn(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,C({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(function(n){return new vo(n)})]})})}var In=null;function Tr(e,t){var n;return g(this,void 0,void 0,function(){return _(this,function(i){switch(i.label){case 0:return In!==null?[3,2]:[4,Hn()];case 1:In=i.sent(),i.label=2;case 2:return[2,In.request(ft({url:e,method:(n=t==null?void 0:t.method)!==null&&n!==void 0?n:"GET"},t))]}})})}Object.freeze({__proto__:null,getClient:Hn,fetch:Tr,Body:Un,Client:vo,Response:mo,get ResponseType(){return ve}});function Sr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y,P;return{c(){t=s("form"),n=s("select"),i=s("option"),i.textContent="GET",o=s("option"),o.textContent="POST",l=s("option"),l.textContent="PUT",u=s("option"),u.textContent="PATCH",c=s("option"),c.textContent="DELETE",p=v(),h=s("input"),f=v(),M=s("br"),m=v(),d=s("textarea"),b=v(),k=s("button"),k.textContent="Make request",i.__value="GET",i.value=i.__value,o.__value="POST",o.value=o.__value,l.__value="PUT",l.value=l.__value,u.__value="PATCH",u.value=u.__value,c.__value="DELETE",c.value=c.__value,a(n,"class","button"),a(n,"id","request-method"),e[0]===void 0&&Ni(()=>e[5].call(n)),a(h,"id","request-url"),a(h,"placeholder","Type the request URL..."),a(d,"id","request-body"),a(d,"placeholder","Request body"),a(d,"rows","5"),dt(d,"width","100%"),dt(d,"margin-right","10px"),dt(d,"font-size","12px"),a(k,"class","button"),a(k,"id","make-request")},m(S,j){O(S,t,j),r(t,n),r(n,i),r(n,o),r(n,l),r(n,u),r(n,c),$e(n,e[0]),r(t,p),r(t,h),A(h,e[1]),r(t,f),r(t,M),r(t,m),r(t,d),A(d,e[2]),r(t,b),r(t,k),y||(P=[T(n,"change",e[5]),T(h,"input",e[6]),T(d,"input",e[7]),T(t,"submit",Ye(e[3]))],y=!0)},p(S,[j]){j&1&&$e(n,S[0]),j&2&&h.value!==S[1]&&A(h,S[1]),j&4&&A(d,S[2])},i:I,o:I,d(S){S&&W(t),y=!1,x(P)}}}function zr(e,t,n){let i="GET",o="https://jsonplaceholder.typicode.com/todos/1",l="",{onMessage:u}=t;async function c(){const M=await Hn().catch(k=>{throw u(k),k}),b={url:o||""||"",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?b.body=Un.json(JSON.parse(l)):l!==""&&(b.body=Un.text(l)),M.request(b).then(u).catch(u)}function p(){i=Bi(this),n(0,i)}function h(){o=this.value,n(1,o)}function f(){l=this.value,n(2,l)}return e.$$set=M=>{"onMessage"in M&&n(4,u=M.onMessage)},[i,o,l,c,u,p,h,f]}class Pr extends X{constructor(t){super();Y(this,t,zr,Sr,$,{onMessage:4})}}function Or(e){let t,n,i;return{c(){t=s("button"),t.textContent="Send test notification",a(t,"class","button"),a(t,"id","notification")},m(o,l){O(o,t,l),n||(i=T(t,"click",Wr),n=!0)},p:I,i:I,o:I,d(o){o&&W(t),n=!1,i()}}}function Wr(){new Notification("Notification title",{body:"This is the notification body"})}function Lr(e,t,n){let{onMessage:i}=t;return e.$$set=o=>{"onMessage"in o&&n(0,i=o.onMessage)},[i]}class Er extends X{constructor(t){super();Y(this,t,Lr,Or,$,{onMessage:0})}}var Jt,Ze=function(e,t){this.type="Logical",this.width=e,this.height=t},Kt=function(){function e(t,n){this.type="Physical",this.width=t,this.height=n}return e.prototype.toLogical=function(t){return new Ze(this.width/t,this.height/t)},e}(),go=function(e,t){this.type="Logical",this.x=e,this.y=t},Xt=function(){function e(t,n){this.type="Physical",this.x=t,this.y=n}return e.prototype.toLogical=function(t){return new go(this.x/t,this.y/t)},e}();function Ar(){return new ge(window.__TAURI__.__currentWindow.label,{skip:!0})}function _o(){return window.__TAURI__.__windows.map(function(e){return new ge(e.label,{skip:!0})})}(function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"})(Jt||(Jt={}));var bo=["tauri://created","tauri://error"],yo=function(){function e(t){try{this.label=t!=null?t:window.__TAURI__.__currentWindow.label}catch{this.label=""}this.listeners=Object.create(null)}return e.prototype.listen=function(t,n){return g(this,void 0,void 0,function(){var i=this;return _(this,function(o){return this._handleTauriEvent(t,n)?[2,Promise.resolve(function(){var l=i.listeners[t];l.splice(l.indexOf(n),1)})]:[2,Et(t,n)]})})},e.prototype.once=function(t,n){return g(this,void 0,void 0,function(){var i=this;return _(this,function(o){return this._handleTauriEvent(t,n)?[2,Promise.resolve(function(){var l=i.listeners[t];l.splice(l.indexOf(n),1)})]:[2,Rn(t,n)]})})},e.prototype.emit=function(t,n){return g(this,void 0,void 0,function(){var i,o;return _(this,function(l){if(bo.includes(t)){for(i=0,o=this.listeners[t]||[];i{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class nr extends X{constructor(t){super();Y(this,t,er,tr,$,{onMessage:1})}}function uo(e,t,n){return g(this,void 0,void 0,function(){return _(this,function(i){switch(i.label){case 0:return[4,T({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:typeof n=="string"?n:JSON.stringify(n)}})];case 1:return i.sent(),[2]}})})}function so(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Event",message:{cmd:"unlisten",eventId:e}})]})})}function At(e,t){return g(this,void 0,void 0,function(){var n=this;return _(this,function(i){return[2,T({__tauriModule:"Event",message:{cmd:"listen",event:e,handler:Lt(t)}}).then(function(o){return function(){return g(n,void 0,void 0,function(){return _(this,function(l){return[2,so(o)]})})}})]})})}function Rn(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,At(e,function(i){t(i),so(i.id).catch(function(){})})]})})}function Qe(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,uo(e,null,t)]})})}Object.freeze({__proto__:null,listen:At,once:Rn,emit:Qe});function ir(e){let t,n,i,o,l,u,c,p;return{c(){t=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","button"),a(n,"id","log"),a(o,"class","button"),a(o,"id","request"),a(u,"class","button"),a(u,"id","event")},m(h,f){O(h,t,f),r(t,n),r(t,i),r(t,o),r(t,l),r(t,u),c||(p=[C(n,"click",e[0]),C(o,"click",e[1]),C(u,"click",e[2])],c=!0)},p:I,i:I,o:I,d(h){h&&W(t),c=!1,x(p)}}}function or(e,t,n){let{onMessage:i}=t,o;Xe(async()=>{o=await At("rust-event",i)}),Wn(()=>{o&&o()});function l(){me("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){me("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){Qe("js-event","this is the payload string")}return e.$$set=p=>{"onMessage"in p&&n(3,i=p.onMessage)},[l,u,c,i]}class rr extends X{constructor(t){super();Y(this,t,or,ir,$,{onMessage:3})}}function jn(e){return e===void 0&&(e={}),g(this,void 0,void 0,function(){return _(this,function(t){return typeof e=="object"&&Object.freeze(e),[2,T({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})]})})}function ao(e){return e===void 0&&(e={}),g(this,void 0,void 0,function(){return _(this,function(t){return typeof e=="object"&&Object.freeze(e),[2,T({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})]})})}function lr(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e}})]})})}function ur(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Dialog",message:{cmd:"askDialog",title:t,message:e}})]})})}function sr(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Dialog",message:{cmd:"confirmDialog",title:t,message:e}})]})})}Object.freeze({__proto__:null,open:jn,save:ao,message:lr,ask:ur,confirm:sr});var Vt;function ar(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}}).then(function(i){return new TextDecoder().decode(new Uint8Array(i))})]})})}function Fn(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Fs",message:{cmd:"readFile",path:e,options:t}})]})})}function cr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return typeof t=="object"&&Object.freeze(t),typeof e=="object"&&Object.freeze(e),[2,T({__tauriModule:"Fs",message:{cmd:"writeFile",path:e.path,contents:Array.from(new TextEncoder().encode(e.contents)),options:t}})]})})}function dr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return typeof t=="object"&&Object.freeze(t),typeof e=="object"&&Object.freeze(e),[2,T({__tauriModule:"Fs",message:{cmd:"writeFile",path:e.path,contents:Array.from(e.contents),options:t}})]})})}function co(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Fs",message:{cmd:"readDir",path:e,options:t}})]})})}function fr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Fs",message:{cmd:"createDir",path:e,options:t}})]})})}function pr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Fs",message:{cmd:"removeDir",path:e,options:t}})]})})}function hr(e,t,n){return n===void 0&&(n={}),g(this,void 0,void 0,function(){return _(this,function(i){return[2,T({__tauriModule:"Fs",message:{cmd:"copyFile",source:e,destination:t,options:n}})]})})}function mr(e,t){return t===void 0&&(t={}),g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"Fs",message:{cmd:"removeFile",path:e,options:t}})]})})}function vr(e,t,n){return n===void 0&&(n={}),g(this,void 0,void 0,function(){return _(this,function(i){return[2,T({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:e,newPath:t,options:n}})]})})}(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"})(Vt||(Vt={}));Object.freeze({__proto__:null,get BaseDirectory(){return Vt},get Dir(){return Vt},readTextFile:ar,readBinaryFile:Fn,writeFile:cr,writeBinaryFile:dr,readDir:co,createDir:fr,removeDir:pr,copyFile:hr,removeFile:mr,renameFile:vr});function gr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y,P,S,j,F;return{c(){t=s("div"),n=s("input"),i=v(),o=s("input"),l=v(),u=s("div"),c=s("input"),p=v(),h=s("label"),h.textContent="Multiple",f=v(),M=s("div"),m=s("input"),d=v(),b=s("label"),b.textContent="Directory",k=v(),y=s("button"),y.textContent="Open dialog",P=v(),S=s("button"),S.textContent="Open save dialog",a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(o,"id","dialog-filter"),a(o,"placeholder","Extensions filter, comma-separated"),a(o,"class","svelte-1eg58yg"),a(c,"type","checkbox"),a(c,"id","dialog-multiple"),a(h,"for","dialog-multiple"),a(m,"type","checkbox"),a(m,"id","dialog-directory"),a(b,"for","dialog-directory"),a(y,"class","button"),a(y,"id","open-dialog"),a(S,"class","button"),a(S,"id","save-dialog")},m(U,L){O(U,t,L),r(t,n),E(n,e[0]),r(t,i),r(t,o),E(o,e[1]),r(t,l),r(t,u),r(u,c),c.checked=e[2],r(u,p),r(u,h),r(t,f),r(t,M),r(M,m),m.checked=e[3],r(M,d),r(M,b),r(t,k),r(t,y),r(t,P),r(t,S),j||(F=[C(n,"input",e[8]),C(o,"input",e[9]),C(c,"change",e[10]),C(m,"change",e[11]),C(y,"click",e[4]),C(S,"click",e[5])],j=!0)},p(U,[L]){L&1&&n.value!==U[0]&&E(n,U[0]),L&2&&o.value!==U[1]&&E(o,U[1]),L&4&&(c.checked=U[2]),L&8&&(m.checked=U[3])},i:I,o:I,d(U){U&&W(t),j=!1,x(F)}}}function _r(e,t){var n=new Blob([e],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){var l=o.target.result;t(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function br(e,t,n){let{onMessage:i}=t,{insecureRenderHtml:o}=t,l=null,u=null,c=!1,p=!1;function h(){jn({title:"My wonderful open dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(k=>k.trim())}]:[],multiple:c,directory:p}).then(function(k){if(Array.isArray(k))i(k);else{var y=k,P=y.match(/\S+\.\S+$/g);Fn(y).then(function(S){P&&(y.includes(".png")||y.includes(".jpg"))?_r(new Uint8Array(S),function(j){var F="data:image/png;base64,"+j;o('')}):i(k)}).catch(i(k))}}).catch(i)}function f(){ao({title:"My wonderful save dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(k=>k.trim())}]:[]}).then(i).catch(i)}function M(){l=this.value,n(0,l)}function m(){u=this.value,n(1,u)}function d(){c=this.checked,n(2,c)}function b(){p=this.checked,n(3,p)}return e.$$set=k=>{"onMessage"in k&&n(6,i=k.onMessage),"insecureRenderHtml"in k&&n(7,o=k.insecureRenderHtml)},[l,u,c,p,h,f,i,o,M,m,d,b]}class yr extends X{constructor(t){super();Y(this,t,br,gr,$,{onMessage:6,insecureRenderHtml:7})}}function fo(e,t,n){const i=e.slice();return i[9]=t[n],i}function po(e){let t,n=e[9][0]+"",i,o;return{c(){t=s("option"),i=z(n),t.__value=o=e[9][1],t.value=t.__value},m(l,u){O(l,t,u),r(t,i)},p:I,d(l){l&&W(t)}}}function wr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b=e[2],k=[];for(let y=0;yisNaN(parseInt(m))).map(m=>[m,Vt[m]]);function p(){const m=l.match(/\S+\.\S+$/g),d={dir:ho()};(m?Fn(l,d):co(l,d)).then(function(k){if(m)if(l.includes(".png")||l.includes(".jpg"))Mr(new Uint8Array(k),function(y){const P="data:image/png;base64,"+y;o('')});else{const y=String.fromCharCode.apply(null,k);o(''),setTimeout(()=>{const P=document.getElementById("file-response");P.value=y,document.getElementById("file-save").addEventListener("click",function(){writeFile({file:l,contents:P.value},{dir:ho()}).catch(i)})})}else i(k)}).catch(i)}function h(){n(1,u.src=xi(l),u)}function f(){l=this.value,n(0,l)}function M(m){Go[m?"unshift":"push"](()=>{u=m,n(1,u)})}return e.$$set=m=>{"onMessage"in m&&n(5,i=m.onMessage),"insecureRenderHtml"in m&&n(6,o=m.insecureRenderHtml)},[l,u,c,p,h,i,o,f,M]}class Tr extends X{constructor(t){super();Y(this,t,kr,wr,$,{onMessage:5,insecureRenderHtml:6})}}var ve;(function(e){e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary"})(ve||(ve={}));var Un=function(){function e(t,n){this.type=t,this.payload=n}return e.form=function(t){return new e("Form",t)},e.json=function(t){return new e("Json",t)},e.text=function(t){return new e("Text",t)},e.bytes=function(t){return new e("Bytes",t)},e}(),mo=function(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.rawHeaders=e.rawHeaders,this.data=e.data},vo=function(){function e(t){this.id=t}return e.prototype.drop=function(){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},e.prototype.request=function(t){return g(this,void 0,void 0,function(){var n;return _(this,function(i){return(n=!t.responseType||t.responseType===ve.JSON)&&(t.responseType=ve.Text),[2,T({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then(function(o){var l=new mo(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})]})})},e.prototype.get=function(t,n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,this.request(ft({method:"GET",url:t},n))]})})},e.prototype.post=function(t,n,i){return g(this,void 0,void 0,function(){return _(this,function(o){return[2,this.request(ft({method:"POST",url:t,body:n},i))]})})},e.prototype.put=function(t,n,i){return g(this,void 0,void 0,function(){return _(this,function(o){return[2,this.request(ft({method:"PUT",url:t,body:n},i))]})})},e.prototype.patch=function(t,n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,this.request(ft({method:"PATCH",url:t},n))]})})},e.prototype.delete=function(t,n){return g(this,void 0,void 0,function(){return _(this,function(i){return[2,this.request(ft({method:"DELETE",url:t},n))]})})},e}();function Hn(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(function(n){return new vo(n)})]})})}var In=null;function Cr(e,t){var n;return g(this,void 0,void 0,function(){return _(this,function(i){switch(i.label){case 0:return In!==null?[3,2]:[4,Hn()];case 1:In=i.sent(),i.label=2;case 2:return[2,In.request(ft({url:e,method:(n=t==null?void 0:t.method)!==null&&n!==void 0?n:"GET"},t))]}})})}Object.freeze({__proto__:null,getClient:Hn,fetch:Cr,Body:Un,Client:vo,Response:mo,get ResponseType(){return ve}});function Sr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y,P;return{c(){t=s("form"),n=s("select"),i=s("option"),i.textContent="GET",o=s("option"),o.textContent="POST",l=s("option"),l.textContent="PUT",u=s("option"),u.textContent="PATCH",c=s("option"),c.textContent="DELETE",p=v(),h=s("input"),f=v(),M=s("br"),m=v(),d=s("textarea"),b=v(),k=s("button"),k.textContent="Make request",i.__value="GET",i.value=i.__value,o.__value="POST",o.value=o.__value,l.__value="PUT",l.value=l.__value,u.__value="PATCH",u.value=u.__value,c.__value="DELETE",c.value=c.__value,a(n,"class","button"),a(n,"id","request-method"),e[0]===void 0&&Ni(()=>e[5].call(n)),a(h,"id","request-url"),a(h,"placeholder","Type the request URL..."),a(d,"id","request-body"),a(d,"placeholder","Request body"),a(d,"rows","5"),dt(d,"width","100%"),dt(d,"margin-right","10px"),dt(d,"font-size","12px"),a(k,"class","button"),a(k,"id","make-request")},m(S,j){O(S,t,j),r(t,n),r(n,i),r(n,o),r(n,l),r(n,u),r(n,c),$e(n,e[0]),r(t,p),r(t,h),E(h,e[1]),r(t,f),r(t,M),r(t,m),r(t,d),E(d,e[2]),r(t,b),r(t,k),y||(P=[C(n,"change",e[5]),C(h,"input",e[6]),C(d,"input",e[7]),C(t,"submit",Ye(e[3]))],y=!0)},p(S,[j]){j&1&&$e(n,S[0]),j&2&&h.value!==S[1]&&E(h,S[1]),j&4&&E(d,S[2])},i:I,o:I,d(S){S&&W(t),y=!1,x(P)}}}function zr(e,t,n){let i="GET",o="https://jsonplaceholder.typicode.com/todos/1",l="",{onMessage:u}=t;async function c(){const M=await Hn().catch(k=>{throw u(k),k}),b={url:o||""||"",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?b.body=Un.json(JSON.parse(l)):l!==""&&(b.body=Un.text(l)),M.request(b).then(u).catch(u)}function p(){i=Bi(this),n(0,i)}function h(){o=this.value,n(1,o)}function f(){l=this.value,n(2,l)}return e.$$set=M=>{"onMessage"in M&&n(4,u=M.onMessage)},[i,o,l,c,u,p,h,f]}class Pr extends X{constructor(t){super();Y(this,t,zr,Sr,$,{onMessage:4})}}function Or(e){let t,n,i;return{c(){t=s("button"),t.textContent="Send test notification",a(t,"class","button"),a(t,"id","notification")},m(o,l){O(o,t,l),n||(i=C(t,"click",Wr),n=!0)},p:I,i:I,o:I,d(o){o&&W(t),n=!1,i()}}}function Wr(){new Notification("Notification title",{body:"This is the notification body"})}function Lr(e,t,n){let{onMessage:i}=t;return e.$$set=o=>{"onMessage"in o&&n(0,i=o.onMessage)},[i]}class Ar extends X{constructor(t){super();Y(this,t,Lr,Or,$,{onMessage:0})}}var Jt,Ze=function(e,t){this.type="Logical",this.width=e,this.height=t},Kt=function(){function e(t,n){this.type="Physical",this.width=t,this.height=n}return e.prototype.toLogical=function(t){return new Ze(this.width/t,this.height/t)},e}(),go=function(e,t){this.type="Logical",this.x=e,this.y=t},Xt=function(){function e(t,n){this.type="Physical",this.x=t,this.y=n}return e.prototype.toLogical=function(t){return new go(this.x/t,this.y/t)},e}();function Er(){return new ge(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function _o(){return window.__TAURI_METADATA__.__windows.map(function(e){return new ge(e.label,{skip:!0})})}(function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"})(Jt||(Jt={}));var bo=["tauri://created","tauri://error"],yo=function(){function e(t){this.label=t,this.listeners=Object.create(null)}return e.prototype.listen=function(t,n){return g(this,void 0,void 0,function(){var i=this;return _(this,function(o){return this._handleTauriEvent(t,n)?[2,Promise.resolve(function(){var l=i.listeners[t];l.splice(l.indexOf(n),1)})]:[2,At(t,n)]})})},e.prototype.once=function(t,n){return g(this,void 0,void 0,function(){var i=this;return _(this,function(o){return this._handleTauriEvent(t,n)?[2,Promise.resolve(function(){var l=i.listeners[t];l.splice(l.indexOf(n),1)})]:[2,Rn(t,n)]})})},e.prototype.emit=function(t,n){return g(this,void 0,void 0,function(){var i,o;return _(this,function(l){if(bo.includes(t)){for(i=0,o=this.listeners[t]||[];ie[31].call(n)),a(u,"type","checkbox"),a(f,"type","checkbox"),a(d,"title","Unminimizes after 2 seconds"),a(k,"title","Unminimizes after 2 seconds"),a(P,"title","Visible again after 2 seconds"),a(F,"type","checkbox"),a(N,"type","checkbox"),a(B,"type","checkbox"),a(Q,"type","checkbox"),a(it,"type","number"),a(it,"min","0"),a(it,"class","svelte-12ggtr4"),a(ot,"type","number"),a(ot,"min","0"),a(ot,"class","svelte-12ggtr4"),a(pt,"class","flex col grow svelte-12ggtr4"),a(rt,"type","number"),a(rt,"min","400"),a(rt,"class","svelte-12ggtr4"),a(lt,"type","number"),a(lt,"min","400"),a(lt,"class","svelte-12ggtr4"),a(ht,"class","flex col grow svelte-12ggtr4"),a(mt,"type","number"),a(mt,"class","svelte-12ggtr4"),a(vt,"type","number"),a(vt,"class","svelte-12ggtr4"),a(q,"class","flex col grow svelte-12ggtr4"),a(at,"type","number"),a(at,"min","400"),a(at,"class","svelte-12ggtr4"),a(ct,"type","number"),a(ct,"min","400"),a(ct,"class","svelte-12ggtr4"),a(Ut,"class","flex col grow svelte-12ggtr4"),a(et,"class","window-controls flex flex-row svelte-12ggtr4"),a(t,"class","flex col"),a($t,"class","svelte-12ggtr4"),a(Qt,"class","svelte-12ggtr4"),a(gt,"class","grow window-property svelte-12ggtr4"),a(Zt,"class","svelte-12ggtr4"),a(xt,"class","svelte-12ggtr4"),a(_t,"class","grow window-property svelte-12ggtr4"),a(Ht,"class","flex"),a(te,"class","svelte-12ggtr4"),a(ee,"class","svelte-12ggtr4"),a(bt,"class","grow window-property svelte-12ggtr4"),a(ne,"class","svelte-12ggtr4"),a(ie,"class","svelte-12ggtr4"),a(yt,"class","grow window-property svelte-12ggtr4"),a(It,"class","flex"),a(oe,"class","svelte-12ggtr4"),a(re,"class","svelte-12ggtr4"),a(wt,"class","grow window-property svelte-12ggtr4"),a(le,"class","svelte-12ggtr4"),a(ue,"class","svelte-12ggtr4"),a(Mt,"class","grow window-property svelte-12ggtr4"),a(qt,"class","flex"),a(se,"class","svelte-12ggtr4"),a(ae,"class","svelte-12ggtr4"),a(kt,"class","grow window-property svelte-12ggtr4"),a(ce,"class","svelte-12ggtr4"),a(de,"class","svelte-12ggtr4"),a(Ct,"class","grow window-property svelte-12ggtr4"),a(Nt,"class","flex"),a(Pt,"id","title"),a(fe,"class","button"),a(fe,"type","submit"),dt(Tt,"margin-top","24px"),a(Ot,"id","url"),a(pe,"class","button"),a(pe,"id","open-url"),dt(St,"margin-top","24px"),a(Wt,"class","button"),a(Wt,"title","Minimizes the window, requests attention for 3s and then resets it"),a(Bt,"class","button")},m(w,E){O(w,t,E),r(t,n);for(let V=0;V{q&&o[i].setIcon(q)})}function be(){const q=Math.random().toString().replace(".",""),zt=new ge(q);n(1,o[q]=zt,o),zt.once("tauri://error",function(){l("Error creating new webview")})}function At(){o[i].innerSize().then(q=>{n(20,N=q),n(7,d=N.width),n(8,b=N.height)}),o[i].outerSize().then(q=>{n(21,tt=q)})}function ye(){o[i].innerPosition().then(q=>{n(18,L=q)}),o[i].outerPosition().then(q=>{n(19,H=q),n(13,j=H.x),n(14,F=H.y)})}async function Yt(q){st&&st(),K&&K(),K=await q.listen("tauri://move",ye),st=await q.listen("tauri://resize",At)}async function et(){await o[i].minimize(),await o[i].requestUserAttention(Jt.Critical),await new Promise(q=>setTimeout(q,3e3)),await o[i].requestUserAttention(null)}function pt(){i=Bi(this),n(0,i),n(1,o)}function Dt(){c=this.checked,n(2,c)}function we(){p=this.checked,n(3,p)}const it=()=>o[i].center();function Me(){h=this.checked,n(16,h)}function Rt(){f=this.checked,n(4,f)}function ke(){M=this.checked,n(5,M)}function ot(){m=this.checked,n(6,m)}function Ce(){j=J(this.value),n(13,j)}function ht(){F=J(this.value),n(14,F)}function jt(){d=J(this.value),n(7,d)}function Te(){b=J(this.value),n(8,b)}function rt(){k=J(this.value),n(9,k)}function Se(){y=J(this.value),n(10,y)}function Ft(){P=J(this.value),n(11,P)}function ze(){S=J(this.value),n(12,S)}function lt(){B=this.value,n(22,B)}function Pe(){u=this.value,n(15,u)}return e.$$set=q=>{"onMessage"in q&&n(30,l=q.onMessage)},e.$$.update=()=>{e.$$.dirty[0]&7&&o[i].setResizable(c),e.$$.dirty[0]&11&&(p?o[i].maximize():o[i].unmaximize()),e.$$.dirty[0]&19&&o[i].setDecorations(f),e.$$.dirty[0]&35&&o[i].setAlwaysOnTop(M),e.$$.dirty[0]&67&&o[i].setFullscreen(m),e.$$.dirty[0]&387&&o[i].setSize(new Kt(d,b)),e.$$.dirty[0]&1539&&(k&&y?o[i].setMinSize(new Ze(k,y)):o[i].setMinSize(null)),e.$$.dirty[0]&6147&&(P&&S?o[i].setMaxSize(new Ze(P,S)):o[i].setMaxSize(null)),e.$$.dirty[0]&24579&&o[i].setPosition(new Xt(j,F)),e.$$.dirty[0]&3&&o[i].scaleFactor().then(q=>n(17,U=q)),e.$$.dirty[0]&3&&Yt(o[i])},[i,o,c,p,f,M,m,d,b,k,y,P,S,j,F,u,h,U,L,H,N,tt,B,R,nt,D,Q,_e,be,et,l,pt,Dt,we,it,Me,Rt,ke,ot,Ce,ht,jt,Te,rt,Se,Ft,ze,lt,Pe]}class Hr extends X{constructor(t){super();Y(this,t,Ur,Fr,$,{onMessage:30},[-1,-1])}}function Co(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,C({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:Lt(t)}})]})})}function Ir(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,C({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:Lt(t)}})]})})}function qr(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,C({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})]})})}function To(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,C({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})]})})}function So(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,C({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:Co,registerAll:Ir,isRegistered:qr,unregister:To,unregisterAll:So});function zo(e,t,n){const i=e.slice();return i[9]=t[n],i}function Po(e){let t,n=e[9]+"",i,o,l,u,c;function p(){return e[8](e[9])}return{c(){t=s("div"),i=z(n),o=v(),l=s("button"),l.textContent="Unregister",a(l,"type","button")},m(h,f){O(h,t,f),r(t,i),r(t,o),r(t,l),u||(c=T(l,"click",p),u=!0)},p(h,f){e=h,f&2&&n!==(n=e[9]+"")&&G(i,n)},d(h){h&&W(t),u=!1,c()}}}function Oo(e){let t,n,i;return{c(){t=s("button"),t.textContent="Unregister all",a(t,"type","button")},m(o,l){O(o,t,l),n||(i=T(t,"click",e[5]),n=!0)},p:I,d(o){o&&W(t),n=!1,i()}}}function Nr(e){let t,n,i,o,l,u,c,p,h,f,M=e[1],m=[];for(let b=0;bn(1,i=m));let u="CmdOrControl+X";function c(){const m=u;Co(m,()=>{o(`Shortcut ${m} triggered`)}).then(()=>{l.update(d=>[...d,m]),o(`Shortcut ${m} registered successfully`)}).catch(o)}function p(m){const d=m;To(d).then(()=>{l.update(b=>b.filter(k=>k!==d)),o(`Shortcut ${d} unregistered`)}).catch(o)}function h(){So().then(()=>{l.update(()=>[]),o("Unregistered all shortcuts")}).catch(o)}function f(){u=this.value,n(0,u)}const M=m=>p(m);return e.$$set=m=>{"onMessage"in m&&n(6,o=m.onMessage)},[u,i,l,c,p,h,o,f,M]}class Gr extends X{constructor(t){super();Y(this,t,Br,Nr,$,{onMessage:6})}}function Wo(e){let t,n,i,o,l;return{c(){t=s("input"),n=v(),i=s("button"),i.textContent="Write",a(t,"placeholder","write to stdin"),a(i,"class","button")},m(u,c){O(u,t,c),A(t,e[3]),O(u,n,c),O(u,i,c),o||(l=[T(t,"input",e[10]),T(i,"click",e[7])],o=!0)},p(u,c){c&8&&t.value!==u[3]&&A(t,u[3])},d(u){u&&W(t),u&&W(n),u&&W(i),o=!1,x(l)}}}function Vr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y=e[4]&&Wo(e);return{c(){t=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="Run",u=v(),c=s("button"),c.textContent="Kill",p=v(),y&&y.c(),h=v(),f=s("div"),M=s("input"),m=v(),d=s("input"),a(l,"class","button"),a(c,"class","button"),a(M,"placeholder","Working directory"),a(d,"placeholder","Environment variables"),dt(d,"width","300px")},m(P,S){O(P,t,S),r(t,n),r(n,i),A(i,e[0]),r(n,o),r(n,l),r(n,u),r(n,c),r(n,p),y&&y.m(n,null),r(t,h),r(t,f),r(f,M),A(M,e[1]),r(f,m),r(f,d),A(d,e[2]),b||(k=[T(i,"input",e[9]),T(l,"click",e[5]),T(c,"click",e[6]),T(M,"input",e[11]),T(d,"input",e[12])],b=!0)},p(P,[S]){S&1&&i.value!==P[0]&&A(i,P[0]),P[4]?y?y.p(P,S):(y=Wo(P),y.c(),y.m(n,null)):y&&(y.d(1),y=null),S&2&&M.value!==P[1]&&A(M,P[1]),S&4&&d.value!==P[2]&&A(d,P[2])},i:I,o:I,d(P){P&&W(t),y&&y.d(),b=!1,x(k)}}}function Jr(e,t,n){const i=navigator.userAgent.includes("Windows");let o=i?"cmd":"sh",l=i?["/C"]:["-c"],{onMessage:u}=t,c='echo "hello world"',p=null,h="SOMETHING=value ANOTHER=2",f="",M;function m(){return h.split(" ").reduce((F,U)=>{let[L,H]=U.split("=");return qi(Ii({},F),{[L]:H})},{})}function d(){n(4,M=null);const F=new eo(o,[...l,c],{cwd:p||null,env:m()});F.on("close",U=>{u(`command finished with code ${U.code} and signal ${U.signal}`),n(4,M=null)}),F.on("error",U=>u(`command error: "${U}"`)),F.stdout.on("data",U=>u(`command stdout: "${U}"`)),F.stderr.on("data",U=>u(`command stderr: "${U}"`)),F.spawn().then(U=>{n(4,M=U)}).catch(u)}function b(){M.kill().then(()=>u("killed child process")).catch(u)}function k(){M.write(f).catch(u)}function y(){c=this.value,n(0,c)}function P(){f=this.value,n(3,f)}function S(){p=this.value,n(1,p)}function j(){h=this.value,n(2,h)}return e.$$set=F=>{"onMessage"in F&&n(8,u=F.onMessage)},[c,p,h,f,M,d,b,k,u,y,P,S,j]}class Kr extends X{constructor(t){super();Y(this,t,Jr,Vr,$,{onMessage:8})}}function Lo(){return g(this,void 0,void 0,function(){function e(){t&&t(),t=void 0}var t;return _(this,function(n){return[2,new Promise(function(i,o){Et("tauri://update-status",function(l){var u;(u=l==null?void 0:l.payload).error?(e(),o(u.error)):u.status==="DONE"&&(e(),i())}).then(function(l){t=l}).catch(function(l){throw e(),l}),Qe("tauri://update-install").catch(function(l){throw e(),l})})]})})}function Eo(){return g(this,void 0,void 0,function(){function e(){t&&t(),t=void 0}var t;return _(this,function(n){return[2,new Promise(function(i,o){Rn("tauri://update-available",function(l){var u;u=l==null?void 0:l.payload,e(),i({manifest:u,shouldUpdate:!0})}).catch(function(l){throw e(),l}),Et("tauri://update-status",function(l){var u;(u=l==null?void 0:l.payload).error?(e(),o(u.error)):u.status==="UPTODATE"&&(e(),i({shouldUpdate:!1}))}).then(function(l){t=l}).catch(function(l){throw e(),l}),Qe("tauri://update").catch(function(l){throw e(),l})})]})})}Object.freeze({__proto__:null,installUpdate:Lo,checkUpdate:Eo});function Xr(e){let t,n,i,o,l,u;return{c(){t=s("div"),n=s("button"),n.textContent="Check update",i=v(),o=s("button"),o.textContent="Install update",a(n,"class","button"),a(n,"id","check_update"),a(o,"class","button hidden"),a(o,"id","start_update")},m(c,p){O(c,t,p),r(t,n),r(t,i),r(t,o),l||(u=[T(n,"click",e[0]),T(o,"click",e[1])],l=!0)},p:I,i:I,o:I,d(c){c&&W(t),l=!1,x(u)}}}function Yr(e,t,n){let{onMessage:i}=t,o;Xe(async()=>{o=await Et("tauri://update-status",i)}),Wn(()=>{o&&o()});async function l(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:c,manifest:p}=await Eo();i(`Should update: ${c}`),i(p),c&&document.getElementById("start_update").classList.remove("hidden")}catch(c){i(c)}}async function u(){try{document.getElementById("start_update").classList.add("hidden"),await Lo(),i("Installation complete, restart required."),await Dn()}catch(c){i(c)}}return e.$$set=c=>{"onMessage"in c&&n(2,i=c.onMessage)},[l,u,i]}class $r extends X{constructor(t){super();Y(this,t,Yr,Xr,$,{onMessage:2})}}function Ao(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,C({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})]})})}function Do(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,C({__tauriModule:"Clipboard",message:{cmd:"readText"}})]})})}Object.freeze({__proto__:null,writeText:Ao,readText:Do});function Qr(e){let t,n,i,o,l,u,c,p,h;return{c(){t=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="Write",u=v(),c=s("button"),c.textContent="Read",a(i,"placeholder","Text to write to the clipboard"),a(l,"type","button"),a(c,"type","button")},m(f,M){O(f,t,M),r(t,n),r(n,i),A(i,e[0]),r(n,o),r(n,l),r(t,u),r(t,c),p||(h=[T(i,"input",e[4]),T(l,"click",e[1]),T(c,"click",e[2])],p=!0)},p(f,[M]){M&1&&i.value!==f[0]&&A(i,f[0])},i:I,o:I,d(f){f&&W(t),p=!1,x(h)}}}function Zr(e,t,n){let{onMessage:i}=t,o="clipboard message";function l(){Ao(o).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){Do().then(p=>{i(`Clipboard contents: ${p}`)}).catch(i)}function c(){o=this.value,n(0,o)}return e.$$set=p=>{"onMessage"in p&&n(3,i=p.onMessage)},[o,l,u,i,c]}class xr extends X{constructor(t){super();Y(this,t,Zr,Qr,$,{onMessage:3})}}function tl(e){let t;return{c(){t=s("div"),t.innerHTML=`

    Not available for Linux

    - `},m(n,i){O(n,t,i)},p:I,i:I,o:I,d(n){n&&W(t)}}}function el(e,t,n){let{onMessage:i}=t;const o=window.constraints={audio:!0,video:!0};function l(c){const p=document.querySelector("video"),h=c.getVideoTracks();i("Got stream with constraints:",o),i(`Using video device: ${h[0].label}`),window.stream=c,p.srcObject=c}function u(c){if(c.name==="ConstraintNotSatisfiedError"){const p=o.video;i(`The resolution ${p.width.exact}x${p.height.exact} px is not supported by your device.`)}else c.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: ${c.name}`,c)}return Xe(async()=>{try{const c=await navigator.mediaDevices.getUserMedia(o);l(c)}catch(c){u(c)}}),Wn(()=>{window.stream.getTracks().forEach(function(c){c.stop()})}),e.$$set=c=>{"onMessage"in c&&n(0,i=c.onMessage)},[i]}class nl extends X{constructor(t){super();Y(this,t,el,tl,$,{onMessage:0})}}function il(e){let t,n,i,o,l,u,c,p,h,f,M,m;return{c(){t=s("input"),n=v(),i=s("input"),o=v(),l=s("button"),l.textContent="Post it.",u=v(),c=s("p"),c.textContent="Result:",p=v(),h=s("pre"),f=z(e[2]),a(l,"type","button")},m(d,b){O(d,t,b),A(t,e[0]),O(d,n,b),O(d,i,b),A(i,e[1]),O(d,o,b),O(d,l,b),O(d,u,b),O(d,c,b),O(d,p,b),O(d,h,b),r(h,f),M||(m=[T(t,"input",e[4]),T(i,"input",e[5]),T(l,"click",e[3])],M=!0)},p(d,[b]){b&1&&t.value!==d[0]&&A(t,d[0]),b&2&&i.value!==d[1]&&A(i,d[1]),b&4&&G(f,d[2])},i:I,o:I,d(d){d&&W(t),d&&W(n),d&&W(i),d&&W(o),d&&W(l),d&&W(u),d&&W(c),d&&W(p),d&&W(h),M=!1,x(m)}}}function ol(e,t,n){let i="baz",o="qux",l=null;async function u(){let h=navigator.userAgent.includes("Windows")?"https://customprotocol.test/example.html":"customprotocol://test/example.html";const M=await(await fetch(h,{method:"POST",body:JSON.stringify({foo:i,bar:o})})).json();n(2,l=JSON.stringify(M))}function c(){i=this.value,n(0,i)}function p(){o=this.value,n(1,o)}return[i,o,l,u,c,p]}class rl extends X{constructor(t){super();Y(this,t,ol,il,$,{})}}function Ro(e,t,n){const i=e.slice();return i[10]=t[n],i}function jo(e,t,n){const i=e.slice();return i[13]=t[n],i}function Fo(e){let t,n=e[13].label+"",i,o,l,u,c;function p(){return e[9](e[13])}return{c(){t=s("p"),i=z(n),o=v(),a(t,"class",l="nv noselect "+(e[0]===e[13]?"nv_selected":""))},m(h,f){O(h,t,f),r(t,i),r(t,o),u||(c=T(t,"click",p),u=!0)},p(h,f){e=h,f&1&&l!==(l="nv noselect "+(e[0]===e[13]?"nv_selected":""))&&a(t,"class",l)},d(h){h&&W(t),u=!1,c()}}}function ll(e){let t,n=e[10].html+"",i;return{c(){i=Ji(),t=new Xo(i)},m(o,l){t.m(n,o,l),O(o,i,l)},p(o,l){l&2&&n!==(n=o[10].html+"")&&t.p(n)},d(o){o&&W(i),o&&t.d()}}}function ul(e){let t,n=e[10].text+"",i;return{c(){t=s("p"),i=z(n)},m(o,l){O(o,t,l),r(t,i)},p(o,l){l&2&&n!==(n=o[10].text+"")&&G(i,n)},d(o){o&&W(t)}}}function Uo(e){let t;function n(l,u){return l[10].text?ul:ll}let i=n(e),o=i(e);return{c(){o.c(),t=Ji()},m(l,u){o.m(l,u),O(l,t,u)},p(l,u){i===(i=n(l))&&o?o.p(l,u):(o.d(1),o=i(l),o&&(o.c(),o.m(t.parentNode,t)))},d(l){o.d(l),l&&W(t)}}}function sl(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y,P,S,j,F,U,L,H=e[2],N=[];for(let R=0;RDocumentation + `),ct=s("input"),xe=v(),ut=s("div"),Ht=s("div"),gt=s("div"),tn=s("div"),tn.textContent="Inner Size",Yn=v(),$t=s("span"),$n=z("Width: "),en=z(Ae),Qn=v(),Qt=s("span"),Zn=z("Height: "),nn=z(Ee),xn=v(),_t=s("div"),on=s("div"),on.textContent="Outer Size",ti=v(),Zt=s("span"),ei=z("Width: "),rn=z(De),ni=v(),xt=s("span"),ii=z("Height: "),ln=z(Re),oi=v(),It=s("div"),bt=s("div"),un=s("div"),un.textContent="Inner Logical Size",ri=v(),te=s("span"),li=z("Width: "),sn=z(je),ui=v(),ee=s("span"),si=z("Height: "),an=z(Fe),ai=v(),yt=s("div"),cn=s("div"),cn.textContent="Outer Logical Size",ci=v(),ne=s("span"),di=z("Width: "),dn=z(Ue),fi=v(),ie=s("span"),pi=z("Height: "),fn=z(He),hi=v(),qt=s("div"),wt=s("div"),pn=s("div"),pn.textContent="Inner Position",mi=v(),oe=s("span"),vi=z("x: "),hn=z(Ie),gi=v(),re=s("span"),_i=z("y: "),mn=z(qe),bi=v(),Mt=s("div"),vn=s("div"),vn.textContent="Outer Position",yi=v(),le=s("span"),wi=z("x: "),gn=z(Ne),Mi=v(),ue=s("span"),ki=z("y: "),_n=z(Be),Ti=v(),Nt=s("div"),kt=s("div"),bn=s("div"),bn.textContent="Inner Logical Position",Ci=v(),se=s("span"),Si=z("x: "),yn=z(Ge),zi=v(),ae=s("span"),Pi=z("y: "),wn=z(Ve),Oi=v(),Tt=s("div"),Mn=s("div"),Mn.textContent="Outer Logical Position",Wi=v(),ce=s("span"),Li=z("x: "),kn=z(Je),Ai=v(),de=s("span"),Ei=z("y: "),Tn=z(Ke),Cn=v(),Ct=s("form"),Pt=s("input"),Di=v(),fe=s("button"),fe.textContent="Set title",Sn=v(),St=s("form"),Ot=s("input"),Ri=v(),pe=s("button"),pe.textContent="Open URL",zn=v(),Wt=s("button"),Wt.textContent="Request attention",Pn=v(),Bt=s("button"),Bt.textContent="New window",a(n,"class","button"),e[0]===void 0&&Ni(()=>e[31].call(n)),a(u,"type","checkbox"),a(f,"type","checkbox"),a(d,"title","Unminimizes after 2 seconds"),a(k,"title","Unminimizes after 2 seconds"),a(P,"title","Visible again after 2 seconds"),a(F,"type","checkbox"),a(N,"type","checkbox"),a(B,"type","checkbox"),a(Q,"type","checkbox"),a(it,"type","number"),a(it,"min","0"),a(it,"class","svelte-12ggtr4"),a(ot,"type","number"),a(ot,"min","0"),a(ot,"class","svelte-12ggtr4"),a(pt,"class","flex col grow svelte-12ggtr4"),a(rt,"type","number"),a(rt,"min","400"),a(rt,"class","svelte-12ggtr4"),a(lt,"type","number"),a(lt,"min","400"),a(lt,"class","svelte-12ggtr4"),a(ht,"class","flex col grow svelte-12ggtr4"),a(mt,"type","number"),a(mt,"class","svelte-12ggtr4"),a(vt,"type","number"),a(vt,"class","svelte-12ggtr4"),a(q,"class","flex col grow svelte-12ggtr4"),a(at,"type","number"),a(at,"min","400"),a(at,"class","svelte-12ggtr4"),a(ct,"type","number"),a(ct,"min","400"),a(ct,"class","svelte-12ggtr4"),a(Ut,"class","flex col grow svelte-12ggtr4"),a(et,"class","window-controls flex flex-row svelte-12ggtr4"),a(t,"class","flex col"),a($t,"class","svelte-12ggtr4"),a(Qt,"class","svelte-12ggtr4"),a(gt,"class","grow window-property svelte-12ggtr4"),a(Zt,"class","svelte-12ggtr4"),a(xt,"class","svelte-12ggtr4"),a(_t,"class","grow window-property svelte-12ggtr4"),a(Ht,"class","flex"),a(te,"class","svelte-12ggtr4"),a(ee,"class","svelte-12ggtr4"),a(bt,"class","grow window-property svelte-12ggtr4"),a(ne,"class","svelte-12ggtr4"),a(ie,"class","svelte-12ggtr4"),a(yt,"class","grow window-property svelte-12ggtr4"),a(It,"class","flex"),a(oe,"class","svelte-12ggtr4"),a(re,"class","svelte-12ggtr4"),a(wt,"class","grow window-property svelte-12ggtr4"),a(le,"class","svelte-12ggtr4"),a(ue,"class","svelte-12ggtr4"),a(Mt,"class","grow window-property svelte-12ggtr4"),a(qt,"class","flex"),a(se,"class","svelte-12ggtr4"),a(ae,"class","svelte-12ggtr4"),a(kt,"class","grow window-property svelte-12ggtr4"),a(ce,"class","svelte-12ggtr4"),a(de,"class","svelte-12ggtr4"),a(Tt,"class","grow window-property svelte-12ggtr4"),a(Nt,"class","flex"),a(Pt,"id","title"),a(fe,"class","button"),a(fe,"type","submit"),dt(Ct,"margin-top","24px"),a(Ot,"id","url"),a(pe,"class","button"),a(pe,"id","open-url"),dt(St,"margin-top","24px"),a(Wt,"class","button"),a(Wt,"title","Minimizes the window, requests attention for 3s and then resets it"),a(Bt,"class","button")},m(w,A){O(w,t,A),r(t,n);for(let V=0;V{q&&o[i].setIcon(q)})}function be(){const q=Math.random().toString().replace(".",""),zt=new ge(q);n(1,o[q]=zt,o),zt.once("tauri://error",function(){l("Error creating new webview")})}function Et(){o[i].innerSize().then(q=>{n(20,N=q),n(7,d=N.width),n(8,b=N.height)}),o[i].outerSize().then(q=>{n(21,tt=q)})}function ye(){o[i].innerPosition().then(q=>{n(18,L=q)}),o[i].outerPosition().then(q=>{n(19,H=q),n(13,j=H.x),n(14,F=H.y)})}async function Yt(q){st&&st(),K&&K(),K=await q.listen("tauri://move",ye),st=await q.listen("tauri://resize",Et)}async function et(){await o[i].minimize(),await o[i].requestUserAttention(Jt.Critical),await new Promise(q=>setTimeout(q,3e3)),await o[i].requestUserAttention(null)}function pt(){i=Bi(this),n(0,i),n(1,o)}function Dt(){c=this.checked,n(2,c)}function we(){p=this.checked,n(3,p)}const it=()=>o[i].center();function Me(){h=this.checked,n(16,h)}function Rt(){f=this.checked,n(4,f)}function ke(){M=this.checked,n(5,M)}function ot(){m=this.checked,n(6,m)}function Te(){j=J(this.value),n(13,j)}function ht(){F=J(this.value),n(14,F)}function jt(){d=J(this.value),n(7,d)}function Ce(){b=J(this.value),n(8,b)}function rt(){k=J(this.value),n(9,k)}function Se(){y=J(this.value),n(10,y)}function Ft(){P=J(this.value),n(11,P)}function ze(){S=J(this.value),n(12,S)}function lt(){B=this.value,n(22,B)}function Pe(){u=this.value,n(15,u)}return e.$$set=q=>{"onMessage"in q&&n(30,l=q.onMessage)},e.$$.update=()=>{e.$$.dirty[0]&7&&o[i].setResizable(c),e.$$.dirty[0]&11&&(p?o[i].maximize():o[i].unmaximize()),e.$$.dirty[0]&19&&o[i].setDecorations(f),e.$$.dirty[0]&35&&o[i].setAlwaysOnTop(M),e.$$.dirty[0]&67&&o[i].setFullscreen(m),e.$$.dirty[0]&387&&o[i].setSize(new Kt(d,b)),e.$$.dirty[0]&1539&&(k&&y?o[i].setMinSize(new Ze(k,y)):o[i].setMinSize(null)),e.$$.dirty[0]&6147&&(P&&S?o[i].setMaxSize(new Ze(P,S)):o[i].setMaxSize(null)),e.$$.dirty[0]&24579&&o[i].setPosition(new Xt(j,F)),e.$$.dirty[0]&3&&o[i].scaleFactor().then(q=>n(17,U=q)),e.$$.dirty[0]&3&&Yt(o[i])},[i,o,c,p,f,M,m,d,b,k,y,P,S,j,F,u,h,U,L,H,N,tt,B,R,nt,D,Q,_e,be,et,l,pt,Dt,we,it,Me,Rt,ke,ot,Te,ht,jt,Ce,rt,Se,Ft,ze,lt,Pe]}class Hr extends X{constructor(t){super();Y(this,t,Ur,Fr,$,{onMessage:30},[-1,-1])}}function To(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:Lt(t)}})]})})}function Ir(e,t){return g(this,void 0,void 0,function(){return _(this,function(n){return[2,T({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:Lt(t)}})]})})}function qr(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})]})})}function Co(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})]})})}function So(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:To,registerAll:Ir,isRegistered:qr,unregister:Co,unregisterAll:So});function zo(e,t,n){const i=e.slice();return i[9]=t[n],i}function Po(e){let t,n=e[9]+"",i,o,l,u,c;function p(){return e[8](e[9])}return{c(){t=s("div"),i=z(n),o=v(),l=s("button"),l.textContent="Unregister",a(l,"type","button")},m(h,f){O(h,t,f),r(t,i),r(t,o),r(t,l),u||(c=C(l,"click",p),u=!0)},p(h,f){e=h,f&2&&n!==(n=e[9]+"")&&G(i,n)},d(h){h&&W(t),u=!1,c()}}}function Oo(e){let t,n,i;return{c(){t=s("button"),t.textContent="Unregister all",a(t,"type","button")},m(o,l){O(o,t,l),n||(i=C(t,"click",e[5]),n=!0)},p:I,d(o){o&&W(t),n=!1,i()}}}function Nr(e){let t,n,i,o,l,u,c,p,h,f,M=e[1],m=[];for(let b=0;bn(1,i=m));let u="CmdOrControl+X";function c(){const m=u;To(m,()=>{o(`Shortcut ${m} triggered`)}).then(()=>{l.update(d=>[...d,m]),o(`Shortcut ${m} registered successfully`)}).catch(o)}function p(m){const d=m;Co(d).then(()=>{l.update(b=>b.filter(k=>k!==d)),o(`Shortcut ${d} unregistered`)}).catch(o)}function h(){So().then(()=>{l.update(()=>[]),o("Unregistered all shortcuts")}).catch(o)}function f(){u=this.value,n(0,u)}const M=m=>p(m);return e.$$set=m=>{"onMessage"in m&&n(6,o=m.onMessage)},[u,i,l,c,p,h,o,f,M]}class Gr extends X{constructor(t){super();Y(this,t,Br,Nr,$,{onMessage:6})}}function Wo(e){let t,n,i,o,l;return{c(){t=s("input"),n=v(),i=s("button"),i.textContent="Write",a(t,"placeholder","write to stdin"),a(i,"class","button")},m(u,c){O(u,t,c),E(t,e[3]),O(u,n,c),O(u,i,c),o||(l=[C(t,"input",e[10]),C(i,"click",e[7])],o=!0)},p(u,c){c&8&&t.value!==u[3]&&E(t,u[3])},d(u){u&&W(t),u&&W(n),u&&W(i),o=!1,x(l)}}}function Vr(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y=e[4]&&Wo(e);return{c(){t=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="Run",u=v(),c=s("button"),c.textContent="Kill",p=v(),y&&y.c(),h=v(),f=s("div"),M=s("input"),m=v(),d=s("input"),a(l,"class","button"),a(c,"class","button"),a(M,"placeholder","Working directory"),a(d,"placeholder","Environment variables"),dt(d,"width","300px")},m(P,S){O(P,t,S),r(t,n),r(n,i),E(i,e[0]),r(n,o),r(n,l),r(n,u),r(n,c),r(n,p),y&&y.m(n,null),r(t,h),r(t,f),r(f,M),E(M,e[1]),r(f,m),r(f,d),E(d,e[2]),b||(k=[C(i,"input",e[9]),C(l,"click",e[5]),C(c,"click",e[6]),C(M,"input",e[11]),C(d,"input",e[12])],b=!0)},p(P,[S]){S&1&&i.value!==P[0]&&E(i,P[0]),P[4]?y?y.p(P,S):(y=Wo(P),y.c(),y.m(n,null)):y&&(y.d(1),y=null),S&2&&M.value!==P[1]&&E(M,P[1]),S&4&&d.value!==P[2]&&E(d,P[2])},i:I,o:I,d(P){P&&W(t),y&&y.d(),b=!1,x(k)}}}function Jr(e,t,n){const i=navigator.userAgent.includes("Windows");let o=i?"cmd":"sh",l=i?["/C"]:["-c"],{onMessage:u}=t,c='echo "hello world"',p=null,h="SOMETHING=value ANOTHER=2",f="",M;function m(){return h.split(" ").reduce((F,U)=>{let[L,H]=U.split("=");return qi(Ii({},F),{[L]:H})},{})}function d(){n(4,M=null);const F=new eo(o,[...l,c],{cwd:p||null,env:m()});F.on("close",U=>{u(`command finished with code ${U.code} and signal ${U.signal}`),n(4,M=null)}),F.on("error",U=>u(`command error: "${U}"`)),F.stdout.on("data",U=>u(`command stdout: "${U}"`)),F.stderr.on("data",U=>u(`command stderr: "${U}"`)),F.spawn().then(U=>{n(4,M=U)}).catch(u)}function b(){M.kill().then(()=>u("killed child process")).catch(u)}function k(){M.write(f).catch(u)}function y(){c=this.value,n(0,c)}function P(){f=this.value,n(3,f)}function S(){p=this.value,n(1,p)}function j(){h=this.value,n(2,h)}return e.$$set=F=>{"onMessage"in F&&n(8,u=F.onMessage)},[c,p,h,f,M,d,b,k,u,y,P,S,j]}class Kr extends X{constructor(t){super();Y(this,t,Jr,Vr,$,{onMessage:8})}}function Lo(){return g(this,void 0,void 0,function(){function e(){t&&t(),t=void 0}var t;return _(this,function(n){return[2,new Promise(function(i,o){At("tauri://update-status",function(l){var u;(u=l==null?void 0:l.payload).error?(e(),o(u.error)):u.status==="DONE"&&(e(),i())}).then(function(l){t=l}).catch(function(l){throw e(),l}),Qe("tauri://update-install").catch(function(l){throw e(),l})})]})})}function Ao(){return g(this,void 0,void 0,function(){function e(){t&&t(),t=void 0}var t;return _(this,function(n){return[2,new Promise(function(i,o){Rn("tauri://update-available",function(l){var u;u=l==null?void 0:l.payload,e(),i({manifest:u,shouldUpdate:!0})}).catch(function(l){throw e(),l}),At("tauri://update-status",function(l){var u;(u=l==null?void 0:l.payload).error?(e(),o(u.error)):u.status==="UPTODATE"&&(e(),i({shouldUpdate:!1}))}).then(function(l){t=l}).catch(function(l){throw e(),l}),Qe("tauri://update").catch(function(l){throw e(),l})})]})})}Object.freeze({__proto__:null,installUpdate:Lo,checkUpdate:Ao});function Xr(e){let t,n,i,o,l,u;return{c(){t=s("div"),n=s("button"),n.textContent="Check update",i=v(),o=s("button"),o.textContent="Install update",a(n,"class","button"),a(n,"id","check_update"),a(o,"class","button hidden"),a(o,"id","start_update")},m(c,p){O(c,t,p),r(t,n),r(t,i),r(t,o),l||(u=[C(n,"click",e[0]),C(o,"click",e[1])],l=!0)},p:I,i:I,o:I,d(c){c&&W(t),l=!1,x(u)}}}function Yr(e,t,n){let{onMessage:i}=t,o;Xe(async()=>{o=await At("tauri://update-status",i)}),Wn(()=>{o&&o()});async function l(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:c,manifest:p}=await Ao();i(`Should update: ${c}`),i(p),c&&document.getElementById("start_update").classList.remove("hidden")}catch(c){i(c)}}async function u(){try{document.getElementById("start_update").classList.add("hidden"),await Lo(),i("Installation complete, restart required."),await Dn()}catch(c){i(c)}}return e.$$set=c=>{"onMessage"in c&&n(2,i=c.onMessage)},[l,u,i]}class $r extends X{constructor(t){super();Y(this,t,Yr,Xr,$,{onMessage:2})}}function Eo(e){return g(this,void 0,void 0,function(){return _(this,function(t){return[2,T({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})]})})}function Do(){return g(this,void 0,void 0,function(){return _(this,function(e){return[2,T({__tauriModule:"Clipboard",message:{cmd:"readText"}})]})})}Object.freeze({__proto__:null,writeText:Eo,readText:Do});function Qr(e){let t,n,i,o,l,u,c,p,h;return{c(){t=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="Write",u=v(),c=s("button"),c.textContent="Read",a(i,"placeholder","Text to write to the clipboard"),a(l,"type","button"),a(c,"type","button")},m(f,M){O(f,t,M),r(t,n),r(n,i),E(i,e[0]),r(n,o),r(n,l),r(t,u),r(t,c),p||(h=[C(i,"input",e[4]),C(l,"click",e[1]),C(c,"click",e[2])],p=!0)},p(f,[M]){M&1&&i.value!==f[0]&&E(i,f[0])},i:I,o:I,d(f){f&&W(t),p=!1,x(h)}}}function Zr(e,t,n){let{onMessage:i}=t,o="clipboard message";function l(){Eo(o).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){Do().then(p=>{i(`Clipboard contents: ${p}`)}).catch(i)}function c(){o=this.value,n(0,o)}return e.$$set=p=>{"onMessage"in p&&n(3,i=p.onMessage)},[o,l,u,i,c]}class xr extends X{constructor(t){super();Y(this,t,Zr,Qr,$,{onMessage:3})}}function tl(e){let t;return{c(){t=s("div"),t.innerHTML=`

    Not available for Linux

    + `},m(n,i){O(n,t,i)},p:I,i:I,o:I,d(n){n&&W(t)}}}function el(e,t,n){let{onMessage:i}=t;const o=window.constraints={audio:!0,video:!0};function l(c){const p=document.querySelector("video"),h=c.getVideoTracks();i("Got stream with constraints:",o),i(`Using video device: ${h[0].label}`),window.stream=c,p.srcObject=c}function u(c){if(c.name==="ConstraintNotSatisfiedError"){const p=o.video;i(`The resolution ${p.width.exact}x${p.height.exact} px is not supported by your device.`)}else c.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: ${c.name}`,c)}return Xe(async()=>{try{const c=await navigator.mediaDevices.getUserMedia(o);l(c)}catch(c){u(c)}}),Wn(()=>{window.stream.getTracks().forEach(function(c){c.stop()})}),e.$$set=c=>{"onMessage"in c&&n(0,i=c.onMessage)},[i]}class nl extends X{constructor(t){super();Y(this,t,el,tl,$,{onMessage:0})}}function il(e){let t,n,i,o,l,u,c,p,h,f,M,m;return{c(){t=s("input"),n=v(),i=s("input"),o=v(),l=s("button"),l.textContent="Post it.",u=v(),c=s("p"),c.textContent="Result:",p=v(),h=s("pre"),f=z(e[2]),a(l,"type","button")},m(d,b){O(d,t,b),E(t,e[0]),O(d,n,b),O(d,i,b),E(i,e[1]),O(d,o,b),O(d,l,b),O(d,u,b),O(d,c,b),O(d,p,b),O(d,h,b),r(h,f),M||(m=[C(t,"input",e[4]),C(i,"input",e[5]),C(l,"click",e[3])],M=!0)},p(d,[b]){b&1&&t.value!==d[0]&&E(t,d[0]),b&2&&i.value!==d[1]&&E(i,d[1]),b&4&&G(f,d[2])},i:I,o:I,d(d){d&&W(t),d&&W(n),d&&W(i),d&&W(o),d&&W(l),d&&W(u),d&&W(c),d&&W(p),d&&W(h),M=!1,x(m)}}}function ol(e,t,n){let i="baz",o="qux",l=null;async function u(){let h=navigator.userAgent.includes("Windows")?"https://customprotocol.test/example.html":"customprotocol://test/example.html";const M=await(await fetch(h,{method:"POST",body:JSON.stringify({foo:i,bar:o})})).json();n(2,l=JSON.stringify(M))}function c(){i=this.value,n(0,i)}function p(){o=this.value,n(1,o)}return[i,o,l,u,c,p]}class rl extends X{constructor(t){super();Y(this,t,ol,il,$,{})}}function Ro(e,t,n){const i=e.slice();return i[10]=t[n],i}function jo(e,t,n){const i=e.slice();return i[13]=t[n],i}function Fo(e){let t,n=e[13].label+"",i,o,l,u,c;function p(){return e[9](e[13])}return{c(){t=s("p"),i=z(n),o=v(),a(t,"class",l="nv noselect "+(e[0]===e[13]?"nv_selected":""))},m(h,f){O(h,t,f),r(t,i),r(t,o),u||(c=C(t,"click",p),u=!0)},p(h,f){e=h,f&1&&l!==(l="nv noselect "+(e[0]===e[13]?"nv_selected":""))&&a(t,"class",l)},d(h){h&&W(t),u=!1,c()}}}function ll(e){let t,n=e[10].html+"",i;return{c(){i=Ji(),t=new Xo(i)},m(o,l){t.m(n,o,l),O(o,i,l)},p(o,l){l&2&&n!==(n=o[10].html+"")&&t.p(n)},d(o){o&&W(i),o&&t.d()}}}function ul(e){let t,n=e[10].text+"",i;return{c(){t=s("p"),i=z(n)},m(o,l){O(o,t,l),r(t,i)},p(o,l){l&2&&n!==(n=o[10].text+"")&&G(i,n)},d(o){o&&W(t)}}}function Uo(e){let t;function n(l,u){return l[10].text?ul:ll}let i=n(e),o=i(e);return{c(){o.c(),t=Ji()},m(l,u){o.m(l,u),O(l,t,u)},p(l,u){i===(i=n(l))&&o?o.p(l,u):(o.d(1),o=i(l),o&&(o.c(),o.m(t.parentNode,t)))},d(l){o.d(l),l&&W(t)}}}function sl(e){let t,n,i,o,l,u,c,p,h,f,M,m,d,b,k,y,P,S,j,F,U,L,H=e[2],N=[];for(let R=0;RDocumentation Github - Source`,c=v(),p=s("div"),h=s("div");for(let R=0;R{Qi(D,1)}),Vo()}tt?(m=new tt(st(R)),Ki(m.$$.fragment),$i(m.$$.fragment,1),Xi(m,M,null)):m=null}if(nt&2){K=R[1];let D;for(D=0;D{Ko(al,()=>{me("menu_toggle")})});const o=[{label:"Welcome",component:xo},{label:"Messages",component:rr},{label:"CLI",component:nr},{label:"Dialog",component:yr},{label:"File system",component:Cr},{label:"HTTP",component:Pr},{label:"HTTP Form",component:rl},{label:"Notifications",component:Er},{label:"Window",component:Hr},{label:"Shortcuts",component:Gr},{label:"Shell",component:Kr},{label:"Updater",component:$r},{label:"Clipboard",component:xr},{label:"WebRTC",component:nl}];let l=o[0],u=Vi([]);Gi(e,u,d=>n(1,i=d));function c(d){n(0,l=d)}function p(d){u.update(b=>[{text:`[${new Date().toLocaleTimeString()}]: `+(typeof d=="string"?d:JSON.stringify(d))},...b])}function h(d){u.update(b=>[{html:d},...b])}function f(){u.update(()=>[])}function M(){An("https://tauri.studio/")}return[l,i,o,u,c,p,h,f,M,d=>c(d)]}class dl extends X{constructor(t){super();Y(this,t,cl,sl,$,{})}}new dl({target:document.body}); + Source`,c=v(),p=s("div"),h=s("div");for(let R=0;R{Qi(D,1)}),Vo()}tt?(m=new tt(st(R)),Ki(m.$$.fragment),$i(m.$$.fragment,1),Xi(m,M,null)):m=null}if(nt&2){K=R[1];let D;for(D=0;D{Ko(al,()=>{me("menu_toggle")})});const o=[{label:"Welcome",component:xo},{label:"Messages",component:rr},{label:"CLI",component:nr},{label:"Dialog",component:yr},{label:"File system",component:Tr},{label:"HTTP",component:Pr},{label:"HTTP Form",component:rl},{label:"Notifications",component:Ar},{label:"Window",component:Hr},{label:"Shortcuts",component:Gr},{label:"Shell",component:Kr},{label:"Updater",component:$r},{label:"Clipboard",component:xr},{label:"WebRTC",component:nl}];let l=o[0],u=Vi([]);Gi(e,u,d=>n(1,i=d));function c(d){n(0,l=d)}function p(d){u.update(b=>[{text:`[${new Date().toLocaleTimeString()}]: `+(typeof d=="string"?d:JSON.stringify(d))},...b])}function h(d){u.update(b=>[{html:d},...b])}function f(){u.update(()=>[])}function M(){En("https://tauri.studio/")}return[l,i,o,u,c,p,h,f,M,d=>c(d)]}class dl extends X{constructor(t){super();Y(this,t,cl,sl,$,{})}}new dl({target:document.body}); diff --git a/tooling/api/src/window.ts b/tooling/api/src/window.ts index 0aea5e0de93..f8ed116bdb8 100644 --- a/tooling/api/src/window.ts +++ b/tooling/api/src/window.ts @@ -164,7 +164,7 @@ interface WindowDef { /** @ignore */ declare global { interface Window { - __TAURI__: { + __TAURI_METADATA__: { __windows: WindowDef[] __currentWindow: WindowDef } @@ -193,7 +193,7 @@ enum UserAttentionType { * @return The current WebviewWindow. */ function getCurrent(): WebviewWindow { - return new WebviewWindow(window.__TAURI__.__currentWindow.label, { + return new WebviewWindow(window.__TAURI_METADATA__.__currentWindow.label, { // @ts-expect-error skip: true }) @@ -205,7 +205,7 @@ function getCurrent(): WebviewWindow { * @return The list of WebviewWindow. */ function getAll(): WebviewWindow[] { - return window.__TAURI__.__windows.map( + return window.__TAURI_METADATA__.__windows.map( (w) => new WebviewWindow(w.label, { // @ts-expect-error @@ -228,12 +228,8 @@ class WebviewWindowHandle { /** Local event listeners. */ listeners: { [key: string]: Array> } - constructor(label: WindowLabel | null | undefined) { - try { - this.label = label ?? window.__TAURI__.__currentWindow.label - } catch { - this.label = '' - } + constructor(label: WindowLabel) { + this.label = label // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment this.listeners = Object.create(null) } @@ -1100,10 +1096,7 @@ class WebviewWindow extends WindowManager { * * @param label The webview window label. It must be alphanumeric. * @returns The WebviewWindow instance to communicate with the webview. */ - constructor( - label: WindowLabel | null | undefined, - options: WindowOptions = {} - ) { + constructor(label: WindowLabel, options: WindowOptions = {}) { super(label) // @ts-expect-error if (!options?.skip) { @@ -1140,10 +1133,13 @@ class WebviewWindow extends WindowManager { } /** The WebviewWindow for the current window. */ -const appWindow = new WebviewWindow(null, { - // @ts-expect-error - skip: true -}) +const appWindow = new WebviewWindow( + window.__TAURI_METADATA__.__currentWindow.label, + { + // @ts-expect-error + skip: true + } +) /** Configuration for the window to create. */ interface WindowOptions {