tauri/examples/api/public/build/bundle.js

26 lines
66 KiB
JavaScript

var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e)}function o(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function u(e,n,i){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const i=e.subscribe(...n);return i.unsubscribe?()=>i.unsubscribe():i}(n,i))}function s(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function c(t){t.parentNode.removeChild(t)}function l(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function d(t){return document.createElement(t)}function f(t){return document.createTextNode(t)}function h(){return f(" ")}function p(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function m(t){return function(e){return e.preventDefault(),t.call(this,e)}}function v(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function g(t){return""===t?null:+t}function y(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function b(t,e){t.value=null==e?"":e}function _(t,e,n,i){t.style.setProperty(e,n,i?"important":"")}function w(t,e){for(let n=0;n<t.options.length;n+=1){const i=t.options[n];if(i.__value===e)return void(i.selected=!0)}}function x(t){const e=t.querySelector(":checked")||t.options[0];return e&&e.__value}class k{constructor(t=null){this.a=t,this.e=this.n=null}m(t,e,n=null){this.e||(this.e=d(e.nodeName),this.t=e,this.h(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)a(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(c)}}let M;function C(t){M=t}function $(){if(!M)throw new Error("Function called outside component initialization");return M}function O(t){$().$$.on_mount.push(t)}function T(t){$().$$.on_destroy.push(t)}const S=[],E=[],P=[],z=[],A=Promise.resolve();let j=!1;function W(t){P.push(t)}let L=!1;const F=new Set;function D(){if(!L){L=!0;do{for(let t=0;t<S.length;t+=1){const e=S[t];C(e),R(e.$$)}for(C(null),S.length=0;E.length;)E.pop()();for(let t=0;t<P.length;t+=1){const e=P[t];F.has(e)||(F.add(e),e())}P.length=0}while(S.length);for(;z.length;)z.pop()();j=!1,L=!1,F.clear()}}function R(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(W)}}const U=new Set;let I;function N(t,e){t&&t.i&&(U.delete(t),t.i(e))}function q(t,e,n,i){if(t&&t.o){if(U.has(t))return;U.add(t),I.c.push((()=>{U.delete(t),i&&(n&&t.d(1),i())})),t.o(e)}}function K(t){t&&t.c()}function B(t,n,r,u){const{fragment:s,on_mount:a,on_destroy:c,after_update:l}=t.$$;s&&s.m(n,r),u||W((()=>{const n=a.map(e).filter(o);c?c.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(W)}function H(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function G(t,e){-1===t.$$.dirty[0]&&(S.push(t),j||(j=!0,A.then(D)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function V(e,o,r,u,s,a,l=[-1]){const d=M;C(e);const f=e.$$={fragment:null,ctx:null,props:a,update:t,not_equal:s,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:[]),callbacks:n(),dirty:l,skip_bound:!1};let h=!1;if(f.ctx=r?r(e,o.props||{},((t,n,...i)=>{const o=i.length?i[0]:n;return f.ctx&&s(f.ctx[t],f.ctx[t]=o)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](o),h&&G(e,t)),n})):[],f.update(),h=!0,i(f.before_update),f.fragment=!!u&&u(f.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);f.fragment&&f.fragment.l(t),t.forEach(c)}else f.fragment&&f.fragment.c();o.intro&&N(e.$$.fragment),B(e,o.target,o.anchor,o.customElement),D()}C(d)}class J{$destroy(){H(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const X=[];function Y(e,n=t){let i;const o=[];function u(t){if(r(e,t)&&(e=t,i)){const t=!X.length;for(let t=0;t<o.length;t+=1){const n=o[t];n[1](),X.push(n,e)}if(t){for(let t=0;t<X.length;t+=2)X[t][0](X[t+1]);X.length=0}}}return{set:u,update:function(t){u(t(e))},subscribe:function(r,s=t){const a=[r,s];return o.push(a),1===o.length&&(i=n(u)||t),r(e),()=>{const t=o.indexOf(a);-1!==t&&o.splice(t,1),0===o.length&&(i(),i=null)}}}}
/*!
* hotkeys-js v3.8.5
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2021 kenny wong <wowohoo@qq.com>
* http://jaywcjlove.github.io/hotkeys
*
* Licensed under the MIT license.
*/var Q="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function Z(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on".concat(e),(function(){n(window.event)}))}function tt(t,e){for(var n=e.slice(0,e.length-1),i=0;i<n.length;i++)n[i]=t[n[i].toLowerCase()];return n}function et(t){"string"!=typeof t&&(t="");for(var e=(t=t.replace(/\s/g,"")).split(","),n=e.lastIndexOf("");n>=0;)e[n-1]+=",",e.splice(n,1),n=e.lastIndexOf("");return e}for(var nt={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Q?173:189,"=":Q?61:187,";":Q?59:186,"'":222,"[":219,"]":221,"\\":220},it={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},ot={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},rt={16:!1,18:!1,17:!1,91:!1},ut={},st=1;st<20;st++)nt["f".concat(st)]=111+st;var at=[],ct="all",lt=[],dt=function(t){return nt[t.toLowerCase()]||it[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function ft(t){ct=t||"all"}function ht(){return ct||"all"}var pt=function(t){var e=t.key,n=t.scope,i=t.method,o=t.splitKey,r=void 0===o?"+":o;et(e).forEach((function(t){var e=t.split(r),o=e.length,u=e[o-1],s="*"===u?"*":dt(u);if(ut[s]){n||(n=ht());var a=o>1?tt(it,e):[];ut[s]=ut[s].map((function(t){return(!i||t.method===i)&&t.scope===n&&function(t,e){for(var n=t.length>=e.length?t:e,i=t.length>=e.length?e:t,o=!0,r=0;r<n.length;r++)-1===i.indexOf(n[r])&&(o=!1);return o}(t.mods,a)?{}:t}))}}))};function mt(t,e,n){var i;if(e.scope===n||"all"===e.scope){for(var o in i=e.mods.length>0,rt)Object.prototype.hasOwnProperty.call(rt,o)&&(!rt[o]&&e.mods.indexOf(+o)>-1||rt[o]&&-1===e.mods.indexOf(+o))&&(i=!1);(0!==e.mods.length||rt[16]||rt[18]||rt[17]||rt[91])&&!i&&"*"!==e.shortcut||!1===e.method(t,e)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}function vt(t){var e=ut["*"],n=t.keyCode||t.which||t.charCode;if(gt.filter.call(this,t)){if(93!==n&&224!==n||(n=91),-1===at.indexOf(n)&&229!==n&&at.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(e){var n=ot[e];t[e]&&-1===at.indexOf(n)?at.push(n):!t[e]&&at.indexOf(n)>-1?at.splice(at.indexOf(n),1):"metaKey"===e&&t[e]&&3===at.length&&(t.ctrlKey||t.shiftKey||t.altKey||(at=at.slice(at.indexOf(n))))})),n in rt){for(var i in rt[n]=!0,it)it[i]===n&&(gt[i]=!0);if(!e)return}for(var o in rt)Object.prototype.hasOwnProperty.call(rt,o)&&(rt[o]=t[ot[o]]);t.getModifierState&&(!t.altKey||t.ctrlKey)&&t.getModifierState("AltGraph")&&(-1===at.indexOf(17)&&at.push(17),-1===at.indexOf(18)&&at.push(18),rt[17]=!0,rt[18]=!0);var r=ht();if(e)for(var u=0;u<e.length;u++)e[u].scope===r&&("keydown"===t.type&&e[u].keydown||"keyup"===t.type&&e[u].keyup)&&mt(t,e[u],r);if(n in ut)for(var s=0;s<ut[n].length;s++)if(("keydown"===t.type&&ut[n][s].keydown||"keyup"===t.type&&ut[n][s].keyup)&&ut[n][s].key){for(var a=ut[n][s],c=a.splitKey,l=a.key.split(c),d=[],f=0;f<l.length;f++)d.push(dt(l[f]));d.sort().join("")===at.sort().join("")&&mt(t,a,r)}}}function gt(t,e,n){at=[];var i=et(t),o=[],r="all",u=document,s=0,a=!1,c=!0,l="+";for(void 0===n&&"function"==typeof e&&(n=e),"[object Object]"===Object.prototype.toString.call(e)&&(e.scope&&(r=e.scope),e.element&&(u=e.element),e.keyup&&(a=e.keyup),void 0!==e.keydown&&(c=e.keydown),"string"==typeof e.splitKey&&(l=e.splitKey)),"string"==typeof e&&(r=e);s<i.length;s++)o=[],(t=i[s].split(l)).length>1&&(o=tt(it,t)),(t="*"===(t=t[t.length-1])?"*":dt(t))in ut||(ut[t]=[]),ut[t].push({keyup:a,keydown:c,scope:r,mods:o,shortcut:i[s],method:n,key:i[s],splitKey:l});void 0!==u&&!function(t){return lt.indexOf(t)>-1}(u)&&window&&(lt.push(u),Z(u,"keydown",(function(t){vt(t)})),Z(window,"focus",(function(){at=[]})),Z(u,"keyup",(function(t){vt(t),function(t){var e=t.keyCode||t.which||t.charCode,n=at.indexOf(e);if(n>=0&&at.splice(n,1),t.key&&"meta"===t.key.toLowerCase()&&at.splice(0,at.length),93!==e&&224!==e||(e=91),e in rt)for(var i in rt[e]=!1,it)it[i]===e&&(gt[i]=!1)}(t)})))}var yt={setScope:ft,getScope:ht,deleteScope:function(t,e){var n,i;for(var o in t||(t=ht()),ut)if(Object.prototype.hasOwnProperty.call(ut,o))for(n=ut[o],i=0;i<n.length;)n[i].scope===t?n.splice(i,1):i++;ht()===t&&ft(e||"all")},getPressedKeyCodes:function(){return at.slice(0)},isPressed:function(t){return"string"==typeof t&&(t=dt(t)),-1!==at.indexOf(t)},filter:function(t){var e=t.target||t.srcElement,n=e.tagName,i=!0;return!e.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||e.readOnly)||(i=!1),i},unbind:function(t){if(t){if(Array.isArray(t))t.forEach((function(t){t.key&&pt(t)}));else if("object"==typeof t)t.key&&pt(t);else if("string"==typeof t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var o=n[0],r=n[1];"function"==typeof o&&(r=o,o=""),pt({key:t,scope:o,method:r,splitKey:"+"})}}else Object.keys(ut).forEach((function(t){return delete ut[t]}))}};for(var bt in yt)Object.prototype.hasOwnProperty.call(yt,bt)&&(gt[bt]=yt[bt]);if("undefined"!=typeof window){var _t=window.hotkeys;gt.noConflict=function(t){return t&&window.hotkeys===gt&&(window.hotkeys=_t),gt},window.hotkeys=gt}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
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 wt=function(t,e){return(wt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function xt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}wt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var kt=function(){return(kt=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Mt(t,e,n,i){return new(n||(n=Promise))((function(o,r){function u(t){try{a(i.next(t))}catch(t){r(t)}}function s(t){try{a(i.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,s)}a((i=i.apply(t,e||[])).next())}))}function Ct(t,e){var n,i,o,r,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,i=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){u=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){u.label=r[1];break}if(6===r[0]&&u.label<o[1]){u.label=o[1],o=r;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(r);break}o[2]&&u.ops.pop(),u.trys.pop();continue}r=e.call(t,u)}catch(t){r=[6,t],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function $t(t,e){void 0===e&&(e=!1);var n=function(){var t=new Int8Array(1);window.crypto.getRandomValues(t);var e=new Uint8Array(Math.max(16,Math.abs(t[0])));return window.crypto.getRandomValues(e),e.join("")}();return Object.defineProperty(window,n,{value:function(i){return e&&Reflect.deleteProperty(window,n),null==t?void 0:t(i)},writable:!1,configurable:!0}),n}function Ot(t,e){return void 0===e&&(e={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,new Promise((function(n,i){var o=$t((function(t){n(t),Reflect.deleteProperty(window,r)}),!0),r=$t((function(t){i(t),Reflect.deleteProperty(window,o)}),!0);window.rpc.notify(t,kt({__invokeKey:__TAURI_INVOKE_KEY__,callback:o,error:r},e))}))]}))}))}function Tt(t){return navigator.userAgent.includes("Windows")?"https://custom.protocol.asset_"+t:"asset://"+t}function St(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,Ot("tauri",t)]}))}))}function Et(t,e,n,i){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(o){return"object"==typeof n&&Object.freeze(n),[2,St({__tauriModule:"Shell",message:{cmd:"execute",program:e,args:"string"==typeof n?[n]:n,options:i,onEventFn:$t(t)}})]}))}))}Object.freeze({__proto__:null,transformCallback:$t,invoke:Ot,convertFileSrc:Tt});var Pt=function(){function t(){this.eventListeners=Object.create(null)}return t.prototype.addEventListener=function(t,e){t in this.eventListeners?this.eventListeners[t].push(e):this.eventListeners[t]=[e]},t.prototype._emit=function(t,e){if(t in this.eventListeners)for(var n=0,i=this.eventListeners[t];n<i.length;n++)(0,i[n])(e)},t.prototype.on=function(t,e){return this.addEventListener(t,e),this},t}(),zt=function(){function t(t){this.pid=t}return t.prototype.write=function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:t}})]}))}))},t.prototype.kill=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})]}))}))},t}(),At=function(t){function e(e,n,i){void 0===n&&(n=[]);var o=t.call(this)||this;return o.stdout=new Pt,o.stderr=new Pt,o.program=e,o.args="string"==typeof n?[n]:n,o.options=null!=i?i:{},o}return xt(e,t),e.sidecar=function(t,n,i){void 0===n&&(n=[]);var o=new e(t,n,i);return o.options.sidecar=!0,o},e.prototype.spawn=function(){return Mt(this,void 0,void 0,(function(){var t=this;return Ct(this,(function(e){return[2,Et((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(t){return new zt(t)}))]}))}))},e.prototype.execute=function(){return Mt(this,void 0,void 0,(function(){var t=this;return Ct(this,(function(e){return[2,new Promise((function(e,n){t.on("error",n);var i=[],o=[];t.stdout.on("data",(function(t){i.push(t)})),t.stderr.on("data",(function(t){o.push(t)})),t.on("close",(function(t){e({code:t.code,signal:t.signal,stdout:i.join("\n"),stderr:o.join("\n")})})),t.spawn().catch(n)}))]}))}))},e}(Pt);function jt(t,e){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,St({__tauriModule:"Shell",message:{cmd:"open",path:t,with:e}})]}))}))}function Wt(t,e,n){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(i){switch(i.label){case 0:return[4,St({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:e,payload:n}})];case 1:return i.sent(),[2]}}))}))}function Lt(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"Event",message:{cmd:"unlisten",eventId:t}})]}))}))}function Ft(t,e){return Mt(this,void 0,void 0,(function(){var n=this;return Ct(this,(function(i){return[2,St({__tauriModule:"Event",message:{cmd:"listen",event:t,handler:$t(e)}}).then((function(t){return function(){return Mt(n,void 0,void 0,(function(){return Ct(this,(function(e){return[2,Lt(t)]}))}))}}))]}))}))}function Dt(t,e){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,Ft(t,(function(t){e(t),Lt(t.id).catch((function(){}))}))]}))}))}function Rt(t,e){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,Wt(t,void 0,e)]}))}))}Object.freeze({__proto__:null,Command:At,Child:zt,open:jt}),Object.freeze({__proto__:null,listen:Ft,once:Dt,emit:Rt});var Ut,It=function(t,e){this.type="Logical",this.width=t,this.height=e},Nt=function(){function t(t,e){this.type="Physical",this.width=t,this.height=e}return t.prototype.toLogical=function(t){return new It(this.width/t,this.height/t)},t}(),qt=function(t,e){this.type="Logical",this.x=t,this.y=e},Kt=function(){function t(t,e){this.type="Physical",this.x=t,this.y=e}return t.prototype.toLogical=function(t){return new qt(this.x/t,this.y/t)},t}();function Bt(){return new Qt(window.__TAURI__.__currentWindow.label,{skip:!0})}function Ht(){return window.__TAURI__.__windows.map((function(t){return new Qt(t,{skip:!0})}))}!function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"}(Ut||(Ut={}));var Gt,Vt,Jt=["tauri://created","tauri://error"],Xt=function(){function t(t){this.label=t,this.listeners=Object.create(null)}return t.prototype.listen=function(t,e){return Mt(this,void 0,void 0,(function(){var n=this;return Ct(this,(function(i){return this._handleTauriEvent(t,e)?[2,Promise.resolve((function(){var i=n.listeners[t];i.splice(i.indexOf(e),1)}))]:[2,Ft(t,e)]}))}))},t.prototype.once=function(t,e){return Mt(this,void 0,void 0,(function(){var n=this;return Ct(this,(function(i){return this._handleTauriEvent(t,e)?[2,Promise.resolve((function(){var i=n.listeners[t];i.splice(i.indexOf(e),1)}))]:[2,Dt(t,e)]}))}))},t.prototype.emit=function(t,e){return Mt(this,void 0,void 0,(function(){var n,i;return Ct(this,(function(o){if(Jt.includes(t)){for(n=0,i=this.listeners[t]||[];n<i.length;n++)(0,i[n])({event:t,id:-1,payload:e});return[2,Promise.resolve()]}return[2,Wt(t,this.label,e)]}))}))},t.prototype._handleTauriEvent=function(t,e){return!!Jt.includes(t)&&(t in this.listeners?this.listeners[t].push(e):this.listeners[t]=[e],!0)},t}(),Yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xt(e,t),e.prototype.scaleFactor=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})]}))}))},e.prototype.innerPosition=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}})]}))}))},e.prototype.outerPosition=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}})]}))}))},e.prototype.innerSize=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}})]}))}))},e.prototype.outerSize=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}})]}))}))},e.prototype.isFullscreen=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})]}))}))},e.prototype.isMaximized=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})]}))}))},e.prototype.isDecorated=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})]}))}))},e.prototype.isResizable=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})]}))}))},e.prototype.isVisible=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})]}))}))},e.prototype.center=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})]}))}))},e.prototype.requestUserAttention=function(t){return Mt(this,void 0,void 0,(function(){var e;return Ct(this,(function(n){return e=null,t&&(e=t===Ut.Critical?{type:"Critical"}:{type:"Informational"}),[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:e}}}})]}))}))},e.prototype.setResizable=function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:t}}}})]}))}))},e.prototype.setTitle=function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:t}}}})]}))}))},e.prototype.maximize=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})]}))}))},e.prototype.unmaximize=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})]}))}))},e.prototype.minimize=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})]}))}))},e.prototype.unminimize=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})]}))}))},e.prototype.show=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})]}))}))},e.prototype.hide=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})]}))}))},e.prototype.close=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})]}))}))},e.prototype.setDecorations=function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:t}}}})]}))}))},e.prototype.setAlwaysOnTop=function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:t}}}})]}))}))},e.prototype.setSize=function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){if(!t||"Logical"!==t.type&&"Physical"!==t.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:t.type,data:{width:t.width,height:t.height}}}}}})]}))}))},e.prototype.setMinSize=function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){if(t&&"Logical"!==t.type&&"Physical"!==t.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:t?{type:t.type,data:{width:t.width,height:t.height}}:null}}}})]}))}))},e.prototype.setMaxSize=function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){if(t&&"Logical"!==t.type&&"Physical"!==t.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:t?{type:t.type,data:{width:t.width,height:t.height}}:null}}}})]}))}))},e.prototype.setPosition=function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){if(!t||"Logical"!==t.type&&"Physical"!==t.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:t.type,data:{x:t.x,y:t.y}}}}}})]}))}))},e.prototype.setFullscreen=function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:t}}}})]}))}))},e.prototype.setFocus=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})]}))}))},e.prototype.setIcon=function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:t}}}}})]}))}))},e.prototype.setSkipTaskbar=function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:t}}}})]}))}))},e.prototype.startDragging=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})]}))}))},e}(Xt),Qt=function(t){function e(e,n){void 0===n&&(n={});var i=t.call(this,e)||this;return(null==n?void 0:n.skip)||St({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:kt({label:e},n)}}}).then((function(){return Mt(i,void 0,void 0,(function(){return Ct(this,(function(t){return[2,this.emit("tauri://created")]}))}))})).catch((function(t){return Mt(i,void 0,void 0,(function(){return Ct(this,(function(e){return[2,this.emit("tauri://error",t)]}))}))})),i}return xt(e,t),e.getByLabel=function(t){return Ht().some((function(e){return e.label===t}))?new e(t,{skip:!0}):null},e}(Yt),Zt=new Qt;function te(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"App",message:{cmd:"getAppVersion"}})]}))}))}function ee(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"App",message:{cmd:"getAppName"}})]}))}))}function ne(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"App",message:{cmd:"getTauriVersion"}})]}))}))}function ie(t){return void 0===t&&(t=0),Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}})]}))}))}function oe(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Process",message:{cmd:"relaunch"}})]}))}))}function re(e){let n,o,r,u,l,m,g,b,_,w,x,k,M,C,$,O,T,S,E,P,z;return{c(){n=d("h1"),n.textContent="Welcome",o=h(),r=d("p"),r.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.",u=h(),l=d("p"),m=f("Current App version: "),g=f(e[0]),b=h(),_=d("p"),w=f("Current Tauri version: "),x=f(e[1]),k=h(),M=d("p"),C=f("Current App name: "),$=f(e[2]),O=h(),T=d("button"),T.textContent="Close application",S=h(),E=d("button"),E.textContent="Relaunch application",v(T,"class","button"),v(E,"class","button")},m(t,i){a(t,n,i),a(t,o,i),a(t,r,i),a(t,u,i),a(t,l,i),s(l,m),s(l,g),a(t,b,i),a(t,_,i),s(_,w),s(_,x),a(t,k,i),a(t,M,i),s(M,C),s(M,$),a(t,O,i),a(t,T,i),a(t,S,i),a(t,E,i),P||(z=[p(T,"click",e[3]),p(E,"click",e[4])],P=!0)},p(t,[e]){1&e&&y(g,t[0]),2&e&&y(x,t[1]),4&e&&y($,t[2])},i:t,o:t,d(t){t&&c(n),t&&c(o),t&&c(r),t&&c(u),t&&c(l),t&&c(b),t&&c(_),t&&c(k),t&&c(M),t&&c(O),t&&c(T),t&&c(S),t&&c(E),P=!1,i(z)}}}function ue(t,e,n){let i=0,o=0,r="Unknown";return ee().then((t=>{n(2,r=t)})),te().then((t=>{n(0,i=t)})),ne().then((t=>{n(1,o=t)})),[i,o,r,async function(){await ie()},async function(){await oe()}]}Object.freeze({__proto__:null,WebviewWindow:Qt,WebviewWindowHandle:Xt,WindowManager:Yt,getCurrent:Bt,getAll:Ht,appWindow:Zt,LogicalSize:It,PhysicalSize:Nt,LogicalPosition:qt,PhysicalPosition:Kt,get UserAttentionType(){return Ut},currentMonitor:function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"currentMonitor"}})]}))}))},primaryMonitor:function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"primaryMonitor"}})]}))}))},availableMonitors:function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Window",message:{cmd:"availableMonitors"}})]}))}))}}),Object.freeze({__proto__:null,getName:ee,getVersion:te,getTauriVersion:ne}),Object.freeze({__proto__:null,exit:ie,relaunch:oe});class se extends J{constructor(t){super(),V(this,t,ue,re,r,{})}}function ae(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]}))}))}function ce(e){let n,i,o,r,u,l,m,g,y,b,_;return{c(){n=d("div"),i=f("This binary can be run on the terminal and takes the following arguments:\n "),o=d("ul"),o.innerHTML="<li>--config PATH</li> \n <li>--theme light|dark|system</li> \n <li>--verbose</li>",r=f("\n Additionally, it has a "),u=d("i"),u.textContent="update --background",l=f(" subcommand.\n Note that the arguments are only parsed, not implemented.\n "),m=d("br"),g=h(),y=d("button"),y.textContent="Get matches",v(y,"class","button"),v(y,"id","cli-matches")},m(t,c){a(t,n,c),s(n,i),s(n,o),s(n,r),s(n,u),s(n,l),s(n,m),s(n,g),s(n,y),b||(_=p(y,"click",e[0]),b=!0)},p:t,i:t,o:t,d(t){t&&c(n),b=!1,_()}}}function le(t,e,n){let{onMessage:i}=e;return t.$$set=t=>{"onMessage"in t&&n(1,i=t.onMessage)},[function(){ae().then(i).catch(i)},i]}Object.freeze({__proto__:null,getMatches:ae});class de extends J{constructor(t){super(),V(this,t,le,ce,r,{onMessage:1})}}function fe(e){let n,o,r,u,l,f,m,g;return{c(){n=d("div"),o=d("button"),o.textContent="Call Log API",r=h(),u=d("button"),u.textContent="Call Request (async) API",l=h(),f=d("button"),f.textContent="Send event to Rust",v(o,"class","button"),v(o,"id","log"),v(u,"class","button"),v(u,"id","request"),v(f,"class","button"),v(f,"id","event")},m(t,i){a(t,n,i),s(n,o),s(n,r),s(n,u),s(n,l),s(n,f),m||(g=[p(o,"click",e[0]),p(u,"click",e[1]),p(f,"click",e[2])],m=!0)},p:t,i:t,o:t,d(t){t&&c(n),m=!1,i(g)}}}function he(t,e,n){let i,{onMessage:o}=e;return O((async()=>{i=await Ft("rust-event",o)})),T((()=>{i&&i()})),t.$$set=t=>{"onMessage"in t&&n(3,o=t.onMessage)},[function(){Ot("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})},function(){Ot("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(o).catch(o)},function(){Rt("js-event","this is the payload string")},o]}class pe extends J{constructor(t){super(),V(this,t,he,fe,r,{onMessage:3})}}function me(t){return void 0===t&&(t={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return"object"==typeof t&&Object.freeze(t),[2,St({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}})]}))}))}function ve(t){return void 0===t&&(t={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return"object"==typeof t&&Object.freeze(t),[2,St({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}})]}))}))}function ge(t,e){return void 0===e&&(e={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,St({__tauriModule:"Fs",message:{cmd:"readBinaryFile",path:t,options:e}})]}))}))}function ye(t){var e=function(t){if(t.length<65536)return String.fromCharCode.apply(null,Array.from(t));for(var e="",n=t.length,i=0;i<n;i++){var o=t.subarray(65536*i,65536*(i+1));e+=String.fromCharCode.apply(null,Array.from(o))}return e}(new Uint8Array(t));return btoa(e)}function be(t,e){return void 0===e&&(e={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,St({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:e}})]}))}))}function _e(e){let n,o,r,u,l,f,m,g,y,_,w,x,k,M,C,$,O,T,S,E;return{c(){n=d("div"),o=d("input"),r=h(),u=d("input"),l=h(),f=d("div"),m=d("input"),g=h(),y=d("label"),y.textContent="Multiple",_=h(),w=d("div"),x=d("input"),k=h(),M=d("label"),M.textContent="Directory",C=h(),$=d("button"),$.textContent="Open dialog",O=h(),T=d("button"),T.textContent="Open save dialog",v(o,"id","dialog-default-path"),v(o,"placeholder","Default path"),v(u,"id","dialog-filter"),v(u,"placeholder","Extensions filter, comma-separated"),v(u,"class","svelte-1eg58yg"),v(m,"type","checkbox"),v(m,"id","dialog-multiple"),v(y,"for","dialog-multiple"),v(x,"type","checkbox"),v(x,"id","dialog-directory"),v(M,"for","dialog-directory"),v($,"class","button"),v($,"id","open-dialog"),v(T,"class","button"),v(T,"id","save-dialog")},m(t,i){a(t,n,i),s(n,o),b(o,e[0]),s(n,r),s(n,u),b(u,e[1]),s(n,l),s(n,f),s(f,m),m.checked=e[2],s(f,g),s(f,y),s(n,_),s(n,w),s(w,x),x.checked=e[3],s(w,k),s(w,M),s(n,C),s(n,$),s(n,O),s(n,T),S||(E=[p(o,"input",e[7]),p(u,"input",e[8]),p(m,"change",e[9]),p(x,"change",e[10]),p($,"click",e[4]),p(T,"click",e[5])],S=!0)},p(t,[e]){1&e&&o.value!==t[0]&&b(o,t[0]),2&e&&u.value!==t[1]&&b(u,t[1]),4&e&&(m.checked=t[2]),8&e&&(x.checked=t[3])},i:t,o:t,d(t){t&&c(n),S=!1,i(E)}}}function we(t,e,n){let{onMessage:i}=e,o=null,r=null,u=!1,s=!1;return t.$$set=t=>{"onMessage"in t&&n(6,i=t.onMessage)},[o,r,u,s,function(){me({defaultPath:o,filters:r?[{name:"Tauri Example",extensions:r.split(",").map((t=>t.trim()))}]:[],multiple:u,directory:s}).then((function(t){if(Array.isArray(t))i(t);else{var e=t,n=e.match(/\S+\.\S+$/g);ge(e).then((function(o){var r,u,s,a;n&&(e.includes(".png")||e.includes(".jpg"))?(r=new Uint8Array(o),u=function(t){i('<img src="data:image/png;base64,'+t+'"></img>')},s=new Blob([r],{type:"application/octet-binary"}),(a=new FileReader).onload=function(t){var e=t.target.result;u(e.substr(e.indexOf(",")+1))},a.readAsDataURL(s)):i(t)})).catch(i(t))}})).catch(i)},function(){ve({defaultPath:o,filters:r?[{name:"Tauri Example",extensions:r.split(",").map((t=>t.trim()))}]:[]}).then(i).catch(i)},i,function(){o=this.value,n(0,o)},function(){r=this.value,n(1,r)},function(){u=this.checked,n(2,u)},function(){s=this.checked,n(3,s)}]}Object.freeze({__proto__:null,open:me,save:ve}),function(t){t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Desktop=6]="Desktop",t[t.Document=7]="Document",t[t.Download=8]="Download",t[t.Executable=9]="Executable",t[t.Font=10]="Font",t[t.Home=11]="Home",t[t.Picture=12]="Picture",t[t.Public=13]="Public",t[t.Runtime=14]="Runtime",t[t.Template=15]="Template",t[t.Video=16]="Video",t[t.Resource=17]="Resource",t[t.App=18]="App",t[t.Current=19]="Current"}(Gt||(Gt={})),Object.freeze({__proto__:null,get BaseDirectory(){return Gt},get Dir(){return Gt},readTextFile:function(t,e){return void 0===e&&(e={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,St({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})]}))}))},readBinaryFile:ge,writeFile:function(t,e){return void 0===e&&(e={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return"object"==typeof e&&Object.freeze(e),"object"==typeof t&&Object.freeze(t),[2,St({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:t.contents,options:e}})]}))}))},writeBinaryFile:function(t,e){return void 0===e&&(e={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return"object"==typeof e&&Object.freeze(e),"object"==typeof t&&Object.freeze(t),[2,St({__tauriModule:"Fs",message:{cmd:"writeBinaryFile",path:t.path,contents:ye(t.contents),options:e}})]}))}))},readDir:be,createDir:function(t,e){return void 0===e&&(e={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,St({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})]}))}))},removeDir:function(t,e){return void 0===e&&(e={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,St({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})]}))}))},copyFile:function(t,e,n){return void 0===n&&(n={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(i){return[2,St({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:n}})]}))}))},removeFile:function(t,e){return void 0===e&&(e={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,St({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})]}))}))},renameFile:function(t,e,n){return void 0===n&&(n={}),Mt(this,void 0,void 0,(function(){return Ct(this,(function(i){return[2,St({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:n}})]}))}))}});class xe extends J{constructor(t){var e;super(),document.getElementById("svelte-1eg58yg-style")||((e=d("style")).id="svelte-1eg58yg-style",e.textContent="#dialog-filter.svelte-1eg58yg{width:260px}",s(document.head,e)),V(this,t,we,_e,r,{onMessage:6})}}function ke(t,e,n){const i=t.slice();return i[8]=e[n],i}function Me(e){let n,i,o=e[8][0]+"";return{c(){n=d("option"),i=f(o),n.__value=e[8][1],n.value=n.__value},m(t,e){a(t,n,e),s(n,i)},p:t,d(t){t&&c(n)}}}function Ce(e){let n,o,r,u,f,g,y,_,w,x,k,M,C,$=e[2],O=[];for(let t=0;t<$.length;t+=1)O[t]=Me(ke(e,$,t));return{c(){n=d("form"),o=d("select"),r=d("option"),r.textContent="None";for(let t=0;t<O.length;t+=1)O[t].c();u=h(),f=d("input"),g=h(),y=d("button"),y.textContent="Read",_=h(),w=d("button"),w.textContent="Use as img src",x=h(),k=d("img"),r.__value="",r.value=r.__value,v(o,"class","button"),v(o,"id","dir"),v(f,"id","path-to-read"),v(f,"placeholder","Type the path to read..."),v(y,"class","button"),v(y,"id","read"),v(w,"class","button"),v(w,"type","button"),v(k,"alt","file")},m(t,i){a(t,n,i),s(n,o),s(o,r);for(let t=0;t<O.length;t+=1)O[t].m(o,null);s(n,u),s(n,f),b(f,e[0]),s(n,g),s(n,y),s(n,_),s(n,w),s(n,x),s(n,k),e[7](k),M||(C=[p(f,"input",e[6]),p(w,"click",e[4]),p(n,"submit",m(e[3]))],M=!0)},p(t,[e]){if(4&e){let n;for($=t[2],n=0;n<$.length;n+=1){const i=ke(t,$,n);O[n]?O[n].p(i,e):(O[n]=Me(i),O[n].c(),O[n].m(o,null))}for(;n<O.length;n+=1)O[n].d(1);O.length=$.length}1&e&&f.value!==t[0]&&b(f,t[0])},i:t,o:t,d(t){t&&c(n),l(O,t),e[7](null),M=!1,i(C)}}}function $e(){return document.getElementById("dir").value?parseInt(dir.value):null}function Oe(t,e,n){let i,{onMessage:o}=e,r="";const u=Object.keys(Gt).filter((t=>isNaN(parseInt(t)))).map((t=>[t,Gt[t]]));return t.$$set=t=>{"onMessage"in t&&n(5,o=t.onMessage)},[r,i,u,function(){const t=r.match(/\S+\.\S+$/g),e={dir:$e()};(t?ge(r,e):be(r,e)).then((function(e){if(t)if(r.includes(".png")||r.includes(".jpg"))!function(t,e){const n=new Blob([t],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(t){const n=t.target.result;e(n.substr(n.indexOf(",")+1))},i.readAsDataURL(n)}(new Uint8Array(e),(function(t){o('<img src="'+("data:image/png;base64,"+t)+'"></img>')}));else{const t=String.fromCharCode.apply(null,e);o('<textarea id="file-response" style="height: 400px"></textarea><button id="file-save">Save</button>'),setTimeout((()=>{const e=document.getElementById("file-response");e.value=t,document.getElementById("file-save").addEventListener("click",(function(){writeFile({file:r,contents:e.value},{dir:$e()}).catch(o)}))}))}else o(e)})).catch(o)},function(){n(1,i.src=Tt(r),i)},o,function(){r=this.value,n(0,r)},function(t){E[t?"unshift":"push"]((()=>{i=t,n(1,i)}))}]}class Te extends J{constructor(t){super(),V(this,t,Oe,Ce,r,{onMessage:5})}}!function(t){t[t.JSON=1]="JSON",t[t.Text=2]="Text",t[t.Binary=3]="Binary"}(Vt||(Vt={}));var Se=function(){function t(t,e){this.type=t,this.payload=e}return t.form=function(e){return new t("Form",e)},t.json=function(e){return new t("Json",e)},t.text=function(e){return new t("Text",e)},t.bytes=function(e){return new t("Bytes",e)},t}(),Ee=function(t){this.url=t.url,this.status=t.status,this.ok=this.status>=200&&this.status<300,this.headers=t.headers,this.data=t.data},Pe=function(){function t(t){this.id=t}return t.prototype.drop=function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]}))}))},t.prototype.request=function(t){return Mt(this,void 0,void 0,(function(){var e;return Ct(this,(function(n){return(e=!t.responseType||t.responseType===Vt.JSON)&&(t.responseType=Vt.Text),[2,St({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then((function(t){var n=new Ee(t);if(e){try{n.data=JSON.parse(n.data)}catch(t){if(n.ok)throw Error("Failed to parse response `"+n.data+"` as JSON: "+t+";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response.")}return n}return n}))]}))}))},t.prototype.get=function(t,e){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,this.request(kt({method:"GET",url:t},e))]}))}))},t.prototype.post=function(t,e,n){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(i){return[2,this.request(kt({method:"POST",url:t,body:e},n))]}))}))},t.prototype.put=function(t,e,n){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(i){return[2,this.request(kt({method:"PUT",url:t,body:e},n))]}))}))},t.prototype.patch=function(t,e){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,this.request(kt({method:"PATCH",url:t},e))]}))}))},t.prototype.delete=function(t,e){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,this.request(kt({method:"DELETE",url:t},e))]}))}))},t}();function ze(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(t){return new Pe(t)}))]}))}))}var Ae=null;function je(e){let n,o,r,u,l,f,g,y,x,k,M,C,$,O,T,S,E;return{c(){n=d("form"),o=d("select"),r=d("option"),r.textContent="GET",u=d("option"),u.textContent="POST",l=d("option"),l.textContent="PUT",f=d("option"),f.textContent="PATCH",g=d("option"),g.textContent="DELETE",y=h(),x=d("input"),k=h(),M=d("br"),C=h(),$=d("textarea"),O=h(),T=d("button"),T.textContent="Make request",r.__value="GET",r.value=r.__value,u.__value="POST",u.value=u.__value,l.__value="PUT",l.value=l.__value,f.__value="PATCH",f.value=f.__value,g.__value="DELETE",g.value=g.__value,v(o,"class","button"),v(o,"id","request-method"),void 0===e[0]&&W((()=>e[5].call(o))),v(x,"id","request-url"),v(x,"placeholder","Type the request URL..."),v($,"id","request-body"),v($,"placeholder","Request body"),v($,"rows","5"),_($,"width","100%"),_($,"margin-right","10px"),_($,"font-size","12px"),v(T,"class","button"),v(T,"id","make-request")},m(t,i){a(t,n,i),s(n,o),s(o,r),s(o,u),s(o,l),s(o,f),s(o,g),w(o,e[0]),s(n,y),s(n,x),b(x,e[1]),s(n,k),s(n,M),s(n,C),s(n,$),b($,e[2]),s(n,O),s(n,T),S||(E=[p(o,"change",e[5]),p(x,"input",e[6]),p($,"input",e[7]),p(n,"submit",m(e[3]))],S=!0)},p(t,[e]){1&e&&w(o,t[0]),2&e&&x.value!==t[1]&&b(x,t[1]),4&e&&b($,t[2])},i:t,o:t,d(t){t&&c(n),S=!1,i(E)}}}function We(t,e,n){let i="GET",o="https://jsonplaceholder.typicode.com/todos/1",r="",{onMessage:u}=e;return t.$$set=t=>{"onMessage"in t&&n(4,u=t.onMessage)},[i,o,r,async function(){const t=await ze(),e={url:o||""||"",method:i||"GET"||"GET"};r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]")?e.body=Se.json(JSON.parse(r)):""!==r&&(e.body=Se.text(r)),t.request(e).then(u).catch(u)},u,function(){i=x(this),n(0,i)},function(){o=this.value,n(1,o)},function(){r=this.value,n(2,r)}]}Object.freeze({__proto__:null,getClient:ze,fetch:function(t,e){var n;return Mt(this,void 0,void 0,(function(){return Ct(this,(function(i){switch(i.label){case 0:return null!==Ae?[3,2]:[4,ze()];case 1:Ae=i.sent(),i.label=2;case 2:return[2,Ae.request(kt({url:t,method:null!==(n=null==e?void 0:e.method)&&void 0!==n?n:"GET"},e))]}}))}))},Body:Se,Client:Pe,Response:Ee,get ResponseType(){return Vt}});class Le extends J{constructor(t){super(),V(this,t,We,je,r,{onMessage:4})}}function Fe(e){let n,i,o;return{c(){n=d("button"),n.textContent="Send test notification",v(n,"class","button"),v(n,"id","notification")},m(t,r){a(t,n,r),i||(o=p(n,"click",e[0]),i=!0)},p:t,i:t,o:t,d(t){t&&c(n),i=!1,o()}}}function De(){new Notification("Notification title",{body:"This is the notification body"})}function Re(t,e,n){let{onMessage:i}=e;return t.$$set=t=>{"onMessage"in t&&n(1,i=t.onMessage)},[function(){"default"===Notification.permission?Notification.requestPermission().then((function(t){"granted"===t?De():i("Permission is "+t)})).catch(i):"granted"===Notification.permission?De():i("Permission is denied")},i]}class Ue extends J{constructor(t){super(),V(this,t,Re,Fe,r,{onMessage:1})}}function Ie(t,e,n){const i=t.slice();return i[44]=e[n],i}function Ne(t){let e,n,i,o=t[44]+"";return{c(){e=d("option"),n=f(o),e.__value=i=t[44],e.value=e.__value},m(t,i){a(t,e,i),s(e,n)},p(t,r){2&r[0]&&o!==(o=t[44]+"")&&y(n,o),2&r[0]&&i!==(i=t[44])&&(e.__value=i,e.value=e.__value)},d(t){t&&c(e)}}}function qe(e){let n,o,r,u,y,x,k,M,C,$,O,T,S,E,P,z,A,j,L,F,D,R,U,I,N,q,K,B,H,G,V,J,X,Y,Q,Z,tt,et,nt,it,ot,rt,ut,st,at,ct,lt,dt,ft,ht,pt,mt,vt,gt,yt,bt,_t,wt,xt,kt,Mt,Ct,$t,Ot,Tt,St,Et,Pt,zt,At,jt,Wt,Lt,Ft,Dt,Rt,Ut,It,Nt,qt,Kt,Bt,Ht,Gt,Vt,Jt,Xt,Yt,Qt,Zt=Object.keys(e[1]),te=[];for(let t=0;t<Zt.length;t+=1)te[t]=Ne(Ie(e,Zt,t));return{c(){n=d("div"),o=d("select");for(let t=0;t<te.length;t+=1)te[t].c();r=h(),u=d("div"),y=d("label"),x=d("input"),k=f("\n Resizable"),M=h(),C=d("label"),$=d("input"),O=f("\n Maximize"),T=h(),S=d("button"),S.textContent="Center",E=h(),P=d("button"),P.textContent="Minimize",z=h(),A=d("button"),A.textContent="Hide",j=h(),L=d("label"),F=d("input"),D=f("\n Transparent"),R=h(),U=d("label"),I=d("input"),N=f("\n Has decorations"),q=h(),K=d("label"),B=d("input"),H=f("\n Always on top"),G=h(),V=d("label"),J=d("input"),X=f("\n Fullscreen"),Y=h(),Q=d("button"),Q.textContent="Change icon",Z=h(),tt=d("div"),et=d("div"),nt=d("div"),it=d("div"),ot=f("X\n "),rt=d("input"),ut=h(),st=d("div"),at=f("Y\n "),ct=d("input"),lt=h(),dt=d("div"),ft=d("div"),ht=f("Width\n "),pt=d("input"),mt=h(),vt=d("div"),gt=f("Height\n "),yt=d("input"),bt=h(),_t=d("div"),wt=d("div"),xt=f("Min width\n "),kt=d("input"),Mt=h(),Ct=d("div"),$t=f("Min height\n "),Ot=d("input"),Tt=h(),St=d("div"),Et=d("div"),Pt=f("Max width\n "),zt=d("input"),At=h(),jt=d("div"),Wt=f("Max height\n "),Lt=d("input"),Ft=h(),Dt=d("form"),Rt=d("input"),Ut=h(),It=d("button"),It.textContent="Set title",Nt=h(),qt=d("form"),Kt=d("input"),Bt=h(),Ht=d("button"),Ht.textContent="Open URL",Gt=h(),Vt=d("button"),Vt.textContent="Request attention",Jt=h(),Xt=d("button"),Xt.textContent="New window",v(o,"class","button"),void 0===e[0]&&W((()=>e[26].call(o))),v(x,"type","checkbox"),v($,"type","checkbox"),v(S,"title","Unminimizes after 2 seconds"),v(P,"title","Unminimizes after 2 seconds"),v(A,"title","Visible again after 2 seconds"),v(F,"type","checkbox"),v(I,"type","checkbox"),v(B,"type","checkbox"),v(J,"type","checkbox"),v(rt,"type","number"),v(rt,"min","0"),v(rt,"class","svelte-b76pvm"),v(ct,"type","number"),v(ct,"min","0"),v(ct,"class","svelte-b76pvm"),v(nt,"class","flex col grow svelte-b76pvm"),v(pt,"type","number"),v(pt,"min","400"),v(pt,"class","svelte-b76pvm"),v(yt,"type","number"),v(yt,"min","400"),v(yt,"class","svelte-b76pvm"),v(dt,"class","flex col grow svelte-b76pvm"),v(kt,"type","number"),v(kt,"class","svelte-b76pvm"),v(Ot,"type","number"),v(Ot,"class","svelte-b76pvm"),v(_t,"class","flex col grow svelte-b76pvm"),v(zt,"type","number"),v(zt,"min","400"),v(zt,"class","svelte-b76pvm"),v(Lt,"type","number"),v(Lt,"min","400"),v(Lt,"class","svelte-b76pvm"),v(St,"class","flex col grow svelte-b76pvm"),v(et,"class","window-controls flex flex-row svelte-b76pvm"),v(n,"class","flex col"),v(Rt,"id","title"),v(It,"class","button"),v(It,"type","submit"),_(Dt,"margin-top","24px"),v(Kt,"id","url"),v(Ht,"class","button"),v(Ht,"id","open-url"),_(qt,"margin-top","24px"),v(Vt,"class","button"),v(Vt,"title","Minimizes the window, requests attention for 3s and then resets it"),v(Xt,"class","button")},m(t,i){a(t,n,i),s(n,o);for(let t=0;t<te.length;t+=1)te[t].m(o,null);w(o,e[0]),s(n,r),s(n,u),s(u,y),s(y,x),x.checked=e[2],s(y,k),s(u,M),s(u,C),s(C,$),$.checked=e[3],s(C,O),s(u,T),s(u,S),s(u,E),s(u,P),s(u,z),s(u,A),s(u,j),s(u,L),s(L,F),F.checked=e[16],s(L,D),s(u,R),s(u,U),s(U,I),I.checked=e[4],s(U,N),s(u,q),s(u,K),s(K,B),B.checked=e[5],s(K,H),s(u,G),s(u,V),s(V,J),J.checked=e[6],s(V,X),s(u,Y),s(u,Q),s(n,Z),s(n,tt),s(tt,et),s(et,nt),s(nt,it),s(it,ot),s(it,rt),b(rt,e[13]),s(nt,ut),s(nt,st),s(st,at),s(st,ct),b(ct,e[14]),s(et,lt),s(et,dt),s(dt,ft),s(ft,ht),s(ft,pt),b(pt,e[7]),s(dt,mt),s(dt,vt),s(vt,gt),s(vt,yt),b(yt,e[8]),s(et,bt),s(et,_t),s(_t,wt),s(wt,xt),s(wt,kt),b(kt,e[9]),s(_t,Mt),s(_t,Ct),s(Ct,$t),s(Ct,Ot),b(Ot,e[10]),s(et,Tt),s(et,St),s(St,Et),s(Et,Pt),s(Et,zt),b(zt,e[11]),s(St,At),s(St,jt),s(jt,Wt),s(jt,Lt),b(Lt,e[12]),a(t,Ft,i),a(t,Dt,i),s(Dt,Rt),b(Rt,e[17]),s(Dt,Ut),s(Dt,It),a(t,Nt,i),a(t,qt,i),s(qt,Kt),b(Kt,e[15]),s(qt,Bt),s(qt,Ht),a(t,Gt,i),a(t,Vt,i),a(t,Jt,i),a(t,Xt,i),Yt||(Qt=[p(o,"change",e[26]),p(x,"change",e[27]),p($,"change",e[28]),p(S,"click",e[29]),p(P,"click",e[21]),p(A,"click",e[20]),p(F,"change",e[30]),p(I,"change",e[31]),p(B,"change",e[32]),p(J,"change",e[33]),p(Q,"click",e[22]),p(rt,"input",e[34]),p(ct,"input",e[35]),p(pt,"input",e[36]),p(yt,"input",e[37]),p(kt,"input",e[38]),p(Ot,"input",e[39]),p(zt,"input",e[40]),p(Lt,"input",e[41]),p(Rt,"input",e[42]),p(Dt,"submit",m(e[19])),p(Kt,"input",e[43]),p(qt,"submit",m(e[18])),p(Vt,"click",e[24]),p(Xt,"click",e[23])],Yt=!0)},p(t,e){if(2&e[0]){let n;for(Zt=Object.keys(t[1]),n=0;n<Zt.length;n+=1){const i=Ie(t,Zt,n);te[n]?te[n].p(i,e):(te[n]=Ne(i),te[n].c(),te[n].m(o,null))}for(;n<te.length;n+=1)te[n].d(1);te.length=Zt.length}3&e[0]&&w(o,t[0]),4&e[0]&&(x.checked=t[2]),8&e[0]&&($.checked=t[3]),65536&e[0]&&(F.checked=t[16]),16&e[0]&&(I.checked=t[4]),32&e[0]&&(B.checked=t[5]),64&e[0]&&(J.checked=t[6]),8192&e[0]&&g(rt.value)!==t[13]&&b(rt,t[13]),16384&e[0]&&g(ct.value)!==t[14]&&b(ct,t[14]),128&e[0]&&g(pt.value)!==t[7]&&b(pt,t[7]),256&e[0]&&g(yt.value)!==t[8]&&b(yt,t[8]),512&e[0]&&g(kt.value)!==t[9]&&b(kt,t[9]),1024&e[0]&&g(Ot.value)!==t[10]&&b(Ot,t[10]),2048&e[0]&&g(zt.value)!==t[11]&&b(zt,t[11]),4096&e[0]&&g(Lt.value)!==t[12]&&b(Lt,t[12]),131072&e[0]&&Rt.value!==t[17]&&b(Rt,t[17]),32768&e[0]&&Kt.value!==t[15]&&b(Kt,t[15])},i:t,o:t,d(t){t&&c(n),l(te,t),t&&c(Ft),t&&c(Dt),t&&c(Nt),t&&c(qt),t&&c(Gt),t&&c(Vt),t&&c(Jt),t&&c(Xt),Yt=!1,i(Qt)}}}function Ke(t,e,n){window.UserAttentionType=Ut;let i=Bt().label;const o={[i]:Zt};let{onMessage:r}=e,u="https://tauri.studio",s=!0,a=!1,c=!1,l=!0,d=!1,f=!1,h=900,p=700,m=600,v=600,y=null,b=null,_=100,w=100,k="Awesome Tauri Example!";return t.$$set=t=>{"onMessage"in t&&n(25,r=t.onMessage)},t.$$.update=()=>{7&t.$$.dirty[0]&&o[i].setResizable(s),11&t.$$.dirty[0]&&(a?o[i].maximize():o[i].unmaximize()),19&t.$$.dirty[0]&&o[i].setDecorations(l),35&t.$$.dirty[0]&&o[i].setAlwaysOnTop(d),67&t.$$.dirty[0]&&o[i].setFullscreen(f),387&t.$$.dirty[0]&&o[i].setSize(new It(h,p)),1539&t.$$.dirty[0]&&(m&&v?o[i].setMinSize(new It(m,v)):o[i].setMinSize(null)),6147&t.$$.dirty[0]&&(y&&b?o[i].setMaxSize(new It(y,b)):o[i].setMaxSize(null)),24579&t.$$.dirty[0]&&o[i].setPosition(new qt(_,w))},[i,o,s,a,l,d,f,h,p,m,v,y,b,_,w,u,c,k,function(){jt(u)},function(){o[i].setTitle(k)},function(){o[i].hide(),setTimeout(o[i].show,2e3)},function(){o[i].minimize(),setTimeout(o[i].unminimize,2e3)},function(){me({multiple:!1}).then(o[i].setIcon)},function(){const t=Math.random().toString(),e=new Qt(t);n(1,o[t]=e,o),e.once("tauri://error",(function(){r("Error creating new webview")}))},async function(){await o[i].minimize(),await o[i].requestUserAttention(Ut.Critical),await new Promise((t=>setTimeout(t,3e3))),await o[i].requestUserAttention(null)},r,function(){i=x(this),n(0,i),n(1,o)},function(){s=this.checked,n(2,s)},function(){a=this.checked,n(3,a)},()=>o[i].center(),function(){c=this.checked,n(16,c)},function(){l=this.checked,n(4,l)},function(){d=this.checked,n(5,d)},function(){f=this.checked,n(6,f)},function(){_=g(this.value),n(13,_)},function(){w=g(this.value),n(14,w)},function(){h=g(this.value),n(7,h)},function(){p=g(this.value),n(8,p)},function(){m=g(this.value),n(9,m)},function(){v=g(this.value),n(10,v)},function(){y=g(this.value),n(11,y)},function(){b=g(this.value),n(12,b)},function(){k=this.value,n(17,k)},function(){u=this.value,n(15,u)}]}class Be extends J{constructor(t){var e;super(),document.getElementById("svelte-b76pvm-style")||((e=d("style")).id="svelte-b76pvm-style",e.textContent=".flex-row.svelte-b76pvm.svelte-b76pvm{flex-direction:row}.grow.svelte-b76pvm.svelte-b76pvm{flex-grow:1}.window-controls.svelte-b76pvm input.svelte-b76pvm{width:50px}",s(document.head,e)),V(this,t,Ke,qe,r,{onMessage:25},[-1,-1])}}function He(t,e){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,St({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:$t(e)}})]}))}))}function Ge(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]}))}))}function Ve(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]}))}))}function Je(t,e,n){const i=t.slice();return i[9]=e[n],i}function Xe(t){let e,n,i,o,r,u,l=t[9]+"";function m(){return t[8](t[9])}return{c(){e=d("div"),n=f(l),i=h(),o=d("button"),o.textContent="Unregister",v(o,"type","button")},m(t,c){a(t,e,c),s(e,n),s(e,i),s(e,o),r||(u=p(o,"click",m),r=!0)},p(e,i){t=e,2&i&&l!==(l=t[9]+"")&&y(n,l)},d(t){t&&c(e),r=!1,u()}}}function Ye(e){let n,i,o;return{c(){n=d("button"),n.textContent="Unregister all",v(n,"type","button")},m(t,r){a(t,n,r),i||(o=p(n,"click",e[5]),i=!0)},p:t,d(t){t&&c(n),i=!1,o()}}}function Qe(e){let n,o,r,u,f,m,g,y,_,w,x=e[1],k=[];for(let t=0;t<x.length;t+=1)k[t]=Xe(Je(e,x,t));let M=e[1].length&&Ye(e);return{c(){n=d("div"),o=d("div"),r=d("input"),u=h(),f=d("button"),f.textContent="Register",m=h(),g=d("div");for(let t=0;t<k.length;t+=1)k[t].c();y=h(),M&&M.c(),v(r,"placeholder","Type a shortcut with '+' as separator..."),v(f,"type","button")},m(t,i){a(t,n,i),s(n,o),s(o,r),b(r,e[0]),s(o,u),s(o,f),s(n,m),s(n,g);for(let t=0;t<k.length;t+=1)k[t].m(g,null);s(g,y),M&&M.m(g,null),_||(w=[p(r,"input",e[7]),p(f,"click",e[3])],_=!0)},p(t,[e]){if(1&e&&r.value!==t[0]&&b(r,t[0]),18&e){let n;for(x=t[1],n=0;n<x.length;n+=1){const i=Je(t,x,n);k[n]?k[n].p(i,e):(k[n]=Xe(i),k[n].c(),k[n].m(g,y))}for(;n<k.length;n+=1)k[n].d(1);k.length=x.length}t[1].length?M?M.p(t,e):(M=Ye(t),M.c(),M.m(g,null)):M&&(M.d(1),M=null)},i:t,o:t,d(t){t&&c(n),l(k,t),M&&M.d(),_=!1,i(w)}}}function Ze(t,e,n){let i,{onMessage:o}=e;const r=Y([]);u(t,r,(t=>n(1,i=t)));let s="CmdOrControl+X";function a(t){const e=t;Ge(e).then((()=>{r.update((t=>t.filter((t=>t!==e)))),o(`Shortcut ${e} unregistered`)})).catch(o)}return t.$$set=t=>{"onMessage"in t&&n(6,o=t.onMessage)},[s,i,r,function(){const t=s;He(t,(()=>{o(`Shortcut ${t} triggered`)})).then((()=>{r.update((e=>[...e,t])),o(`Shortcut ${t} registered successfully`)})).catch(o)},a,function(){Ve().then((()=>{r.update((()=>[])),o("Unregistered all shortcuts")})).catch(o)},o,function(){s=this.value,n(0,s)},t=>a(t)]}Object.freeze({__proto__:null,register:He,registerAll:function(t,e){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(n){return[2,St({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:$t(e)}})]}))}))},isRegistered:function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]}))}))},unregister:Ge,unregisterAll:Ve});class tn extends J{constructor(t){super(),V(this,t,Ze,Qe,r,{onMessage:6})}}function en(t){let e,n,o,r,u;return{c(){e=d("input"),n=h(),o=d("button"),o.textContent="Write",v(e,"placeholder","write to stdin"),v(o,"class","button")},m(i,s){a(i,e,s),b(e,t[3]),a(i,n,s),a(i,o,s),r||(u=[p(e,"input",t[10]),p(o,"click",t[7])],r=!0)},p(t,n){8&n&&e.value!==t[3]&&b(e,t[3])},d(t){t&&c(e),t&&c(n),t&&c(o),r=!1,i(u)}}}function nn(e){let n,o,r,u,l,f,m,g,y,w,x,k,M,C,$,O=e[4]&&en(e);return{c(){n=d("div"),o=d("div"),r=d("input"),u=h(),l=d("button"),l.textContent="Run",f=h(),m=d("button"),m.textContent="Kill",g=h(),O&&O.c(),y=h(),w=d("div"),x=d("input"),k=h(),M=d("input"),v(l,"class","button"),v(m,"class","button"),v(x,"placeholder","Working directory"),v(M,"placeholder","Environment variables"),_(M,"width","300px")},m(t,i){a(t,n,i),s(n,o),s(o,r),b(r,e[0]),s(o,u),s(o,l),s(o,f),s(o,m),s(o,g),O&&O.m(o,null),s(n,y),s(n,w),s(w,x),b(x,e[1]),s(w,k),s(w,M),b(M,e[2]),C||($=[p(r,"input",e[9]),p(l,"click",e[5]),p(m,"click",e[6]),p(x,"input",e[11]),p(M,"input",e[12])],C=!0)},p(t,[e]){1&e&&r.value!==t[0]&&b(r,t[0]),t[4]?O?O.p(t,e):(O=en(t),O.c(),O.m(o,null)):O&&(O.d(1),O=null),2&e&&x.value!==t[1]&&b(x,t[1]),4&e&&M.value!==t[2]&&b(M,t[2])},i:t,o:t,d(t){t&&c(n),O&&O.d(),C=!1,i($)}}}function on(t,e,n){const i=navigator.userAgent.includes("Windows");let o,r=i?"cmd":"sh",u=i?["/C"]:["-c"],{onMessage:s}=e,a='echo "hello world"',c=null,l="SOMETHING=value ANOTHER=2",d="";return t.$$set=t=>{"onMessage"in t&&n(8,s=t.onMessage)},[a,c,l,d,o,function(){n(4,o=null);const t=new At(r,[...u,a],{cwd:c||null,env:l.split(" ").reduce(((t,e)=>{let[n,i]=e.split("=");return{...t,[n]:i}}),{})});t.on("close",(t=>{s(`command finished with code ${t.code} and signal ${t.signal}`),n(4,o=null)})),t.on("error",(t=>s(`command error: "${t}"`))),t.stdout.on("data",(t=>s(`command stdout: "${t}"`))),t.stderr.on("data",(t=>s(`command stderr: "${t}"`))),t.spawn().then((t=>{n(4,o=t)})).catch(s)},function(){o.kill().then((()=>s("killed child process"))).catch(s)},function(){o.write(d).catch(s)},s,function(){a=this.value,n(0,a)},function(){d=this.value,n(3,d)},function(){c=this.value,n(1,c)},function(){l=this.value,n(2,l)}]}class rn extends J{constructor(t){super(),V(this,t,on,nn,r,{onMessage:8})}}function un(){return Mt(this,void 0,void 0,(function(){function t(){e&&e(),e=void 0}var e;return Ct(this,(function(n){return[2,new Promise((function(n,i){Ft("tauri://update-status",(function(e){var o;(o=null==e?void 0:e.payload).error?(t(),i(o.error)):"DONE"===o.status&&(t(),n())})).then((function(t){e=t})).catch((function(e){throw t(),e})),Rt("tauri://update-install").catch((function(e){throw t(),e}))}))]}))}))}function sn(){return Mt(this,void 0,void 0,(function(){function t(){e&&e(),e=void 0}var e;return Ct(this,(function(n){return[2,new Promise((function(n,i){Dt("tauri://update-available",(function(e){var i;i=null==e?void 0:e.payload,t(),n({manifest:i,shouldUpdate:!0})})).catch((function(e){throw t(),e})),Ft("tauri://update-status",(function(e){var o;(o=null==e?void 0:e.payload).error?(t(),i(o.error)):"UPTODATE"===o.status&&(t(),n({shouldUpdate:!1}))})).then((function(t){e=t})).catch((function(e){throw t(),e})),Rt("tauri://update").catch((function(e){throw t(),e}))}))]}))}))}function an(e){let n,o,r,u,l,f;return{c(){n=d("div"),o=d("button"),o.textContent="Check update",r=h(),u=d("button"),u.textContent="Install update",v(o,"class","button"),v(o,"id","check_update"),v(u,"class","button hidden"),v(u,"id","start_update")},m(t,i){a(t,n,i),s(n,o),s(n,r),s(n,u),l||(f=[p(o,"click",e[0]),p(u,"click",e[1])],l=!0)},p:t,i:t,o:t,d(t){t&&c(n),l=!1,i(f)}}}function cn(t,e,n){let i,{onMessage:o}=e;return O((async()=>{i=await Ft("tauri://update-status",o)})),T((()=>{i&&i()})),t.$$set=t=>{"onMessage"in t&&n(2,o=t.onMessage)},[async function(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:t,manifest:e}=await sn();o(`Should update: ${t}`),o(e),t&&document.getElementById("start_update").classList.remove("hidden")}catch(t){o(t)}},async function(){try{document.getElementById("start_update").classList.add("hidden"),await un(),o("Installation complete, restart required."),await oe()}catch(t){o(t)}},o]}Object.freeze({__proto__:null,installUpdate:un,checkUpdate:sn});class ln extends J{constructor(t){super(),V(this,t,cn,an,r,{onMessage:2})}}function dn(e){let n,o,r,u,l,f,m,g,y;return{c(){n=d("div"),o=d("div"),r=d("input"),u=h(),l=d("button"),l.textContent="Write",f=h(),m=d("button"),m.textContent="Read",v(r,"placeholder","Text to write to the clipboard"),v(l,"type","button"),v(m,"type","button")},m(t,i){a(t,n,i),s(n,o),s(o,r),b(r,e[0]),s(o,u),s(o,l),s(n,f),s(n,m),g||(y=[p(r,"input",e[4]),p(l,"click",e[1]),p(m,"click",e[2])],g=!0)},p(t,[e]){1&e&&r.value!==t[0]&&b(r,t[0])},i:t,o:t,d(t){t&&c(n),g=!1,i(y)}}}function fn(t,e,n){let{onMessage:i}=e,o="clipboard message";return t.$$set=t=>{"onMessage"in t&&n(3,i=t.onMessage)},[o,function(){(function(t){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(e){return[2,St({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}})]}))}))})(o).then((()=>{i("Wrote to the clipboard")})).catch(i)},function(){(function(){return Mt(this,void 0,void 0,(function(){return Ct(this,(function(t){return[2,St({__tauriModule:"Clipboard",message:{cmd:"readText"}})]}))}))})().then((t=>{i(`Clipboard contents: ${t}`)})).catch(i)},i,function(){o=this.value,n(0,o)}]}class hn extends J{constructor(t){super(),V(this,t,fn,dn,r,{onMessage:3})}}function pn(t,e,n){const i=t.slice();return i[9]=e[n],i}function mn(t){let e,n,i,o,r,u,l=t[9].label+"";function m(){return t[7](t[9])}return{c(){e=d("p"),n=f(l),i=h(),v(e,"class",o="nv noselect "+(t[0]===t[9]?"nv_selected":""))},m(t,o){a(t,e,o),s(e,n),s(e,i),r||(u=p(e,"click",m),r=!0)},p(n,i){t=n,1&i&&o!==(o="nv noselect "+(t[0]===t[9]?"nv_selected":""))&&v(e,"class",o)},d(t){t&&c(e),r=!1,u()}}}function vn(t){let e,n,o,r,u,f,m,g,y,b,w,x,M,C,$,O,T,S,E,P,z,A,j,W=t[2],L=[];for(let e=0;e<W.length;e+=1)L[e]=mn(pn(t,W,e));var F=t[0].component;function D(t){return{props:{onMessage:t[5]}}}return F&&(x=new F(D(t))),{c(){e=d("main"),n=d("div"),o=d("img"),u=h(),f=d("div"),f.innerHTML='<a class="dark-link" target="_blank" href="https://tauri.studio/en/docs/getting-started/intro">Documentation</a> \n <a class="dark-link" target="_blank" href="https://github.com/tauri-apps/tauri">Github</a> \n <a class="dark-link" target="_blank" href="https://github.com/tauri-apps/tauri/tree/dev/tauri/examples/api">Source</a>',m=h(),g=d("div"),y=d("div");for(let t=0;t<L.length;t+=1)L[t].c();b=h(),w=d("div"),x&&K(x.$$.fragment),M=h(),C=d("div"),$=d("p"),O=d("strong"),O.textContent="Tauri Console",T=h(),S=d("a"),S.textContent="clear",E=h(),v(o,"class","logo"),o.src!==(r="tauri logo.png")&&v(o,"src","tauri logo.png"),v(o,"height","60"),v(o,"alt","logo"),v(n,"class","flex row noselect just-around"),v(n,"style","margin=1em;"),v(n,"data-tauri-drag-region",""),_(y,"width","15em"),_(y,"margin-left","0.5em"),v(w,"class","content"),v(g,"class","flex row"),v(S,"class","nv"),v($,"class","flex row just-around"),P=new k(null),v(C,"id","response"),_(C,"white-space","pre-line")},m(i,r){a(i,e,r),s(e,n),s(n,o),s(n,u),s(n,f),s(e,m),s(e,g),s(g,y);for(let t=0;t<L.length;t+=1)L[t].m(y,null);s(g,b),s(g,w),x&&B(x,w,null),s(e,M),s(e,C),s(C,$),s($,O),s($,T),s($,S),s(C,E),P.m(t[1],C),z=!0,A||(j=[p(o,"click",t[6]),p(S,"click",t[8])],A=!0)},p(t,[e]){if(21&e){let n;for(W=t[2],n=0;n<W.length;n+=1){const i=pn(t,W,n);L[n]?L[n].p(i,e):(L[n]=mn(i),L[n].c(),L[n].m(y,null))}for(;n<L.length;n+=1)L[n].d(1);L.length=W.length}if(F!==(F=t[0].component)){if(x){I={r:0,c:[],p:I};const t=x;q(t.$$.fragment,1,0,(()=>{H(t,1)})),I.r||i(I.c),I=I.p}F?(x=new F(D(t)),K(x.$$.fragment),N(x.$$.fragment,1),B(x,w,null)):x=null}(!z||2&e)&&P.p(t[1])},i(t){z||(x&&N(x.$$.fragment,t),z=!0)},o(t){x&&q(x.$$.fragment,t),z=!1},d(t){t&&c(e),l(L,t),x&&H(x),A=!1,i(j)}}}function gn(t,e,n){O((()=>{gt("ctrl+b",(()=>{Ot("menu_toggle")})),Bt().listen("close-requested",(async()=>{await confirm("Are you sure?")&&await Zt.close()}))}));const i=[{label:"Welcome",component:se},{label:"Messages",component:pe},{label:"CLI",component:de},{label:"Dialog",component:xe},{label:"File system",component:Te},{label:"HTTP",component:Le},{label:"Notifications",component:Ue},{label:"Window",component:Be},{label:"Shortcuts",component:tn},{label:"Shell",component:rn},{label:"Updater",component:ln},{label:"Clipboard",component:hn}];let o=i[0],r=Y([]),u="";function s(t){n(0,o=t)}O((()=>{r.subscribe((t=>{n(1,u=t.join("\n"))}))}));return[o,u,i,r,s,function(t){r.update((e=>[`[${(new Date).toLocaleTimeString()}]: `+("string"==typeof t?t:JSON.stringify(t)),...e]))},function(){jt("https://tauri.studio/")},t=>s(t),()=>{r.update((()=>[]))}]}return new class extends J{constructor(t){super(),V(this,t,gn,vn,r,{})}}({target:document.body})}();
//# sourceMappingURL=bundle.js.map