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 c(t,e,n){t.insertBefore(e,n||null)}function a(t){t.parentNode.removeChild(t)}function l(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function v(t){return function(e){return e.preventDefault(),t.call(this,e)}}function m(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 _(t,e){t.value=null==e?"":e}function b(t,e,n,i){t.style.setProperty(e,n,i?"important":"")}function w(t,e){for(let n=0;n{F.delete(t),i&&(n&&t.d(1),i())})),t.o(e)}}function K(t){t&&t.c()}function N(t,n,r,u){const{fragment:s,on_mount:c,on_destroy:a,after_update:l}=t.$$;s&&s.m(n,r),u||j((()=>{const n=c.map(e).filter(o);a?a.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(j)}function q(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 B(t,e){-1===t.$$.dirty[0]&&(O.push(t),z||(z=!0,T.then(L)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{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&&B(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(a)}else f.fragment&&f.fragment.c();o.intro&&I(e.$$.fragment),N(e,o.target,o.anchor,o.customElement),L()}M(d)}class H{$destroy(){q(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)}} /*! * hotkeys-js v3.8.5 * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. * * Copyright (c) 2021 kenny wong * http://jaywcjlove.github.io/hotkeys * * Licensed under the MIT license. */var V="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function J(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on".concat(e),(function(){n(window.event)}))}function X(t,e){for(var n=e.slice(0,e.length-1),i=0;i=0;)e[n-1]+=",",e.splice(n,1),n=e.lastIndexOf("");return e}for(var Q={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,"-":V?173:189,"=":V?61:187,";":V?59:186,"'":222,"[":219,"]":221,"\\":220},Z={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},tt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},et={16:!1,18:!1,17:!1,91:!1},nt={},it=1;it<20;it++)Q["f".concat(it)]=111+it;var ot=[],rt="all",ut=[],st=function(t){return Q[t.toLowerCase()]||Z[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function ct(t){rt=t||"all"}function at(){return rt||"all"}var lt=function(t){var e=t.key,n=t.scope,i=t.method,o=t.splitKey,r=void 0===o?"+":o;Y(e).forEach((function(t){var e=t.split(r),o=e.length,u=e[o-1],s="*"===u?"*":st(u);if(nt[s]){n||(n=at());var c=o>1?X(Z,e):[];nt[s]=nt[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;r0,et)Object.prototype.hasOwnProperty.call(et,o)&&(!et[o]&&e.mods.indexOf(+o)>-1||et[o]&&-1===e.mods.indexOf(+o))&&(i=!1);(0!==e.mods.length||et[16]||et[18]||et[17]||et[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 ft(t){var e=nt["*"],n=t.keyCode||t.which||t.charCode;if(ht.filter.call(this,t)){if(93!==n&&224!==n||(n=91),-1===ot.indexOf(n)&&229!==n&&ot.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(e){var n=tt[e];t[e]&&-1===ot.indexOf(n)?ot.push(n):!t[e]&&ot.indexOf(n)>-1?ot.splice(ot.indexOf(n),1):"metaKey"===e&&t[e]&&3===ot.length&&(t.ctrlKey||t.shiftKey||t.altKey||(ot=ot.slice(ot.indexOf(n))))})),n in et){for(var i in et[n]=!0,Z)Z[i]===n&&(ht[i]=!0);if(!e)return}for(var o in et)Object.prototype.hasOwnProperty.call(et,o)&&(et[o]=t[tt[o]]);t.getModifierState&&(!t.altKey||t.ctrlKey)&&t.getModifierState("AltGraph")&&(-1===ot.indexOf(17)&&ot.push(17),-1===ot.indexOf(18)&&ot.push(18),et[17]=!0,et[18]=!0);var r=at();if(e)for(var u=0;u1&&(o=X(Z,t)),(t="*"===(t=t[t.length-1])?"*":st(t))in nt||(nt[t]=[]),nt[t].push({keyup:c,keydown:a,scope:r,mods:o,shortcut:i[s],method:n,key:i[s],splitKey:l});void 0!==u&&!function(t){return ut.indexOf(t)>-1}(u)&&window&&(ut.push(u),J(u,"keydown",(function(t){ft(t)})),J(window,"focus",(function(){ot=[]})),J(u,"keyup",(function(t){ft(t),function(t){var e=t.keyCode||t.which||t.charCode,n=ot.indexOf(e);if(n>=0&&ot.splice(n,1),t.key&&"meta"===t.key.toLowerCase()&&ot.splice(0,ot.length),93!==e&&224!==e||(e=91),e in et)for(var i in et[e]=!1,Z)Z[i]===e&&(ht[i]=!1)}(t)})))}var pt={setScope:ct,getScope:at,deleteScope:function(t,e){var n,i;for(var o in t||(t=at()),nt)if(Object.prototype.hasOwnProperty.call(nt,o))for(n=nt[o],i=0;i1?e-1:0),i=1;i0&&o[o.length-1])||6!==r[0]&&2!==r[0])){u=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]{n(2,r=t)})),zt().then((t=>{n(0,i=t)})),At().then((t=>{n(1,o=t)})),[i,o,r,async function(){await Wt()},async function(){await Lt()}]}Object.freeze({__proto__:null,Command:St,Child:Pt,open:Tt}),Object.freeze({__proto__:null,getName:jt,getVersion:zt,getTauriVersion:At}),Object.freeze({__proto__:null,exit:Wt,relaunch:Lt});class Rt extends H{constructor(t){super(),G(this,t,Ft,Dt,r,{})}}function It(){return bt(this,void 0,void 0,(function(){return wt(this,(function(t){return[2,kt({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]}))}))}function Ut(e){let n,i,o,r;return{c(){n=d("div"),i=d("button"),i.textContent="Get matches",m(i,"class","button"),m(i,"id","cli-matches")},m(t,u){c(t,n,u),s(n,i),o||(r=p(i,"click",e[0]),o=!0)},p:t,i:t,o:t,d(t){t&&a(n),o=!1,r()}}}function Kt(t,e,n){let{onMessage:i}=e;return t.$$set=t=>{"onMessage"in t&&n(1,i=t.onMessage)},[function(){It().then(i).catch(i)},i]}Object.freeze({__proto__:null,getMatches:It});class Nt extends H{constructor(t){super(),G(this,t,Kt,Ut,r,{onMessage:1})}}function qt(t,e,n){return bt(this,void 0,void 0,(function(){return wt(this,(function(i){switch(i.label){case 0:return[4,kt({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:e,payload:n}})];case 1:return i.sent(),[2]}}))}))}function Bt(t){return bt(this,void 0,void 0,(function(){return wt(this,(function(e){return[2,kt({__tauriModule:"Event",message:{cmd:"unlisten",eventId:t}})]}))}))}function Gt(t,e){return bt(this,void 0,void 0,(function(){var n=this;return wt(this,(function(i){return[2,kt({__tauriModule:"Event",message:{cmd:"listen",event:t,handler:xt(e)}}).then((function(t){return function(){return bt(n,void 0,void 0,(function(){return wt(this,(function(e){return[2,Bt(t)]}))}))}}))]}))}))}function Ht(t,e){return bt(this,void 0,void 0,(function(){return wt(this,(function(n){return[2,Gt(t,(function(t){e(t),Bt(t.id).catch((function(){}))}))]}))}))}function Vt(t,e){return bt(this,void 0,void 0,(function(){return wt(this,(function(n){return[2,qt(t,void 0,e)]}))}))}function Jt(e){let n,o,r,u,l,f,v,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",m(o,"class","button"),m(o,"id","log"),m(u,"class","button"),m(u,"id","request"),m(f,"class","button"),m(f,"id","event")},m(t,i){c(t,n,i),s(n,o),s(n,r),s(n,u),s(n,l),s(n,f),v||(g=[p(o,"click",e[0]),p(u,"click",e[1]),p(f,"click",e[2])],v=!0)},p:t,i:t,o:t,d(t){t&&a(n),v=!1,i(g)}}}function Xt(t,e,n){let i,{onMessage:o}=e;return $((async()=>{i=await Gt("rust-event",o)})),C((()=>{i&&i()})),t.$$set=t=>{"onMessage"in t&&n(3,o=t.onMessage)},[function(){Mt("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})},function(){Mt("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(o).catch(o)},function(){Vt("js-event","this is the payload string")},o]}Object.freeze({__proto__:null,listen:Gt,once:Ht,emit:Vt});class Yt extends H{constructor(t){super(),G(this,t,Xt,Jt,r,{onMessage:3})}}function Qt(t){return void 0===t&&(t={}),bt(this,void 0,void 0,(function(){return wt(this,(function(e){return"object"==typeof t&&Object.freeze(t),[2,kt({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}})]}))}))}function Zt(t){return void 0===t&&(t={}),bt(this,void 0,void 0,(function(){return wt(this,(function(e){return"object"==typeof t&&Object.freeze(t),[2,kt({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}})]}))}))}function te(t,e){return void 0===e&&(e={}),bt(this,void 0,void 0,(function(){return wt(this,(function(n){return[2,kt({__tauriModule:"Fs",message:{cmd:"readBinaryFile",path:t,options:e}})]}))}))}function ee(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{"onMessage"in t&&n(6,i=t.onMessage)},[o,r,u,s,function(){Qt({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);te(e).then((function(o){var r,u,s,c;n&&(e.includes(".png")||e.includes(".jpg"))?(r=new Uint8Array(o),u=function(t){i('')},s=new Blob([r],{type:"application/octet-binary"}),(c=new FileReader).onload=function(t){var e=t.target.result;u(e.substr(e.indexOf(",")+1))},c.readAsDataURL(s)):i(t)})).catch(i(t))}})).catch(i)},function(){Zt({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:Qt,save:Zt}),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"}(Ct||(Ct={})),Object.freeze({__proto__:null,get BaseDirectory(){return Ct},get Dir(){return Ct},readTextFile:function(t,e){return void 0===e&&(e={}),bt(this,void 0,void 0,(function(){return wt(this,(function(n){return[2,kt({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})]}))}))},readBinaryFile:te,writeFile:function(t,e){return void 0===e&&(e={}),bt(this,void 0,void 0,(function(){return wt(this,(function(n){return"object"==typeof e&&Object.freeze(e),"object"==typeof t&&Object.freeze(t),[2,kt({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:t.contents,options:e}})]}))}))},writeBinaryFile:function(t,e){return void 0===e&&(e={}),bt(this,void 0,void 0,(function(){return wt(this,(function(n){return"object"==typeof e&&Object.freeze(e),"object"==typeof t&&Object.freeze(t),[2,kt({__tauriModule:"Fs",message:{cmd:"writeBinaryFile",path:t.path,contents:ee(t.contents),options:e}})]}))}))},readDir:ne,createDir:function(t,e){return void 0===e&&(e={}),bt(this,void 0,void 0,(function(){return wt(this,(function(n){return[2,kt({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})]}))}))},removeDir:function(t,e){return void 0===e&&(e={}),bt(this,void 0,void 0,(function(){return wt(this,(function(n){return[2,kt({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})]}))}))},copyFile:function(t,e,n){return void 0===n&&(n={}),bt(this,void 0,void 0,(function(){return wt(this,(function(i){return[2,kt({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:n}})]}))}))},removeFile:function(t,e){return void 0===e&&(e={}),bt(this,void 0,void 0,(function(){return wt(this,(function(n){return[2,kt({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})]}))}))},renameFile:function(t,e,n){return void 0===n&&(n={}),bt(this,void 0,void 0,(function(){return wt(this,(function(i){return[2,kt({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:n}})]}))}))}});class re extends H{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)),G(this,t,oe,ie,r,{onMessage:6})}}function ue(t,e,n){const i=t.slice();return i[5]=e[n],i}function se(e){let n,i,o=e[5][0]+"";return{c(){n=d("option"),i=f(o),n.__value=e[5][1],n.value=n.__value},m(t,e){c(t,n,e),s(n,i)},p:t,d(t){t&&a(n)}}}function ce(e){let n,o,r,u,f,g,y,b,w,x=e[1],M=[];for(let t=0;tisNaN(parseInt(t)))).map((t=>[t,Ct[t]]));return t.$$set=t=>{"onMessage"in t&&n(3,i=t.onMessage)},[o,r,function(){const t=o.match(/\S+\.\S+$/g),e={dir:ae()};(t?te(o,e):ne(o,e)).then((function(e){if(t)if(o.includes(".png")||o.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){i('')}));else{const t=String.fromCharCode.apply(null,e);i(''),setTimeout((()=>{const e=document.getElementById("file-response");e.value=t,document.getElementById("file-save").addEventListener("click",(function(){writeFile({file:o,contents:e.value},{dir:ae()}).catch(i)}))}))}else i(e)})).catch(i)},i,function(){o=this.value,n(0,o)}]}class de extends H{constructor(t){super(),G(this,t,le,ce,r,{onMessage:3})}}!function(t){t[t.JSON=1]="JSON",t[t.Text=2]="Text",t[t.Binary=3]="Binary"}(Ot||(Ot={}));var fe=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}(),he=function(){function t(t){this.id=t}return t.prototype.drop=function(){return bt(this,void 0,void 0,(function(){return wt(this,(function(t){return[2,kt({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]}))}))},t.prototype.request=function(t){return bt(this,void 0,void 0,(function(){return wt(this,(function(e){return[2,kt({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}})]}))}))},t.prototype.get=function(t,e){return bt(this,void 0,void 0,(function(){return wt(this,(function(n){return[2,this.request(_t({method:"GET",url:t},e))]}))}))},t.prototype.post=function(t,e,n){return bt(this,void 0,void 0,(function(){return wt(this,(function(i){return[2,this.request(_t({method:"POST",url:t,body:e},n))]}))}))},t.prototype.put=function(t,e,n){return bt(this,void 0,void 0,(function(){return wt(this,(function(i){return[2,this.request(_t({method:"PUT",url:t,body:e},n))]}))}))},t.prototype.patch=function(t,e){return bt(this,void 0,void 0,(function(){return wt(this,(function(n){return[2,this.request(_t({method:"PATCH",url:t},e))]}))}))},t.prototype.delete=function(t,e){return bt(this,void 0,void 0,(function(){return wt(this,(function(n){return[2,this.request(_t({method:"DELETE",url:t},e))]}))}))},t}();function pe(t){return bt(this,void 0,void 0,(function(){return wt(this,(function(e){return[2,kt({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(t){return new he(t)}))]}))}))}var ve=null;function me(e){let n,o,r,u,l,f,g,y,x,M,k,$,C,O,E,P,S;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"),M=h(),k=d("br"),$=h(),C=d("textarea"),O=h(),E=d("button"),E.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,m(o,"class","button"),m(o,"id","request-method"),void 0===e[0]&&j((()=>e[5].call(o))),m(x,"id","request-url"),m(x,"placeholder","Type the request URL..."),m(C,"id","request-body"),m(C,"placeholder","Request body"),m(C,"rows","5"),b(C,"width","100%"),b(C,"margin-right","10px"),b(C,"font-size","12px"),m(E,"class","button"),m(E,"id","make-request")},m(t,i){c(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),_(x,e[1]),s(n,M),s(n,k),s(n,$),s(n,C),_(C,e[2]),s(n,O),s(n,E),P||(S=[p(o,"change",e[5]),p(x,"input",e[6]),p(C,"input",e[7]),p(n,"submit",v(e[3]))],P=!0)},p(t,[e]){1&e&&w(o,t[0]),2&e&&x.value!==t[1]&&_(x,t[1]),4&e&&_(C,t[2])},i:t,o:t,d(t){t&&a(n),P=!1,i(S)}}}function ge(t,e,n){let i="GET",o="",r="",{onMessage:u}=e;return t.$$set=t=>{"onMessage"in t&&n(4,u=t.onMessage)},[i,o,r,async function(){const t=await pe(),e={url:o||""||"",method:i||"GET"||"GET"};r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]")?e.body=fe.json(JSON.parse(r)):""!==r&&(e.body=fe.text(r)),t.request(e).then(u).catch(u)},u,function(){i=function(t){const e=t.querySelector(":checked")||t.options[0];return e&&e.__value}(this),n(0,i)},function(){o=this.value,n(1,o)},function(){r=this.value,n(2,r)}]}Object.freeze({__proto__:null,getClient:pe,fetch:function(t,e){var n;return bt(this,void 0,void 0,(function(){return wt(this,(function(i){switch(i.label){case 0:return null!==ve?[3,2]:[4,pe()];case 1:ve=i.sent(),i.label=2;case 2:return[2,ve.request(_t({url:t,method:null!==(n=null==e?void 0:e.method)&&void 0!==n?n:"GET"},e))]}}))}))},Body:fe,Client:he});class ye extends H{constructor(t){super(),G(this,t,ge,me,r,{onMessage:4})}}function _e(e){let n,i,o;return{c(){n=d("button"),n.textContent="Send test notification",m(n,"class","button"),m(n,"id","notification")},m(t,r){c(t,n,r),i||(o=p(n,"click",e[0]),i=!0)},p:t,i:t,o:t,d(t){t&&a(n),i=!1,o()}}}function be(){new Notification("Notification title",{body:"This is the notification body"})}function we(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?be():i("Permission is "+t)})).catch(i):"granted"===Notification.permission?be():i("Permission is denied")},i]}class xe extends H{constructor(t){super(),G(this,t,we,_e,r,{onMessage:1})}}var Me=function(t,e){this.type="Logical",this.width=t,this.height=e},ke=function(){function t(t,e){this.type="Physical",this.width=t,this.height=e}return t.prototype.toLogical=function(t){return new Me(this.width/t,this.height/t)},t}(),$e=function(t,e){this.type="Logical",this.x=t,this.y=e},Ce=function(){function t(t,e){this.type="Physical",this.x=t,this.y=e}return t.prototype.toLogical=function(t){return new $e(this.x/t,this.y/t)},t}();function Oe(){return window.__TAURI__.__windows}var Ee=["tauri://created","tauri://error"],Pe=function(){function t(t){this.label=t,this.listeners=Object.create(null)}return t.prototype.listen=function(t,e){return bt(this,void 0,void 0,(function(){var n=this;return wt(this,(function(i){return this._handleTauriEvent(t,e)?[2,Promise.resolve((function(){var i=n.listeners[t];i.splice(i.indexOf(e),1)}))]:[2,Gt(t,e)]}))}))},t.prototype.once=function(t,e){return bt(this,void 0,void 0,(function(){var n=this;return wt(this,(function(i){return this._handleTauriEvent(t,e)?[2,Promise.resolve((function(){var i=n.listeners[t];i.splice(i.indexOf(e),1)}))]:[2,Ht(t,e)]}))}))},t.prototype.emit=function(t,e){return bt(this,void 0,void 0,(function(){var n,i;return wt(this,(function(o){if(Ee.includes(t)){for(n=0,i=this.listeners[t]||[];n{"onMessage"in t&&n(23,w=t.onMessage)},t.$$.update=()=>{1&t.$$.dirty[0]&&i(M),2&t.$$.dirty[0]&&(k?r():u()),4&t.$$.dirty[0]&&d(C),8&t.$$.dirty[0]&&f(O),16&t.$$.dirty[0]&&y(E),96&t.$$.dirty[0]&&h(new Me(P,S)),384&t.$$.dirty[0]&&p(T&&z?new Me(T,z):null),1536&t.$$.dirty[0]&&v(j&&A?new Me(j,A):null),6144&t.$$.dirty[0]&&m(new $e(W,L))},[M,k,C,O,E,P,S,T,z,j,A,W,L,x,$,D,b,function(){Tt(x)},function(){o(D)},function(){l(),setTimeout(a,2e3)},function(){s(),setTimeout(c,2e3)},function(){Qt({multiple:!1}).then(_)},function(){new Se(Math.random().toString()).once("tauri://error",(function(){w("Error creating new webview")}))},w,function(){M=this.checked,n(0,M)},function(){k=this.checked,n(1,k)},function(){$=this.checked,n(14,$)},function(){C=this.checked,n(2,C)},function(){O=this.checked,n(3,O)},function(){E=this.checked,n(4,E)},function(){W=g(this.value),n(11,W)},function(){L=g(this.value),n(12,L)},function(){P=g(this.value),n(5,P)},function(){S=g(this.value),n(6,S)},function(){T=g(this.value),n(7,T)},function(){z=g(this.value),n(8,z)},function(){j=g(this.value),n(9,j)},function(){A=g(this.value),n(10,A)},function(){D=this.value,n(15,D)},function(){x=this.value,n(13,x)}]}Object.freeze({__proto__:null,WebviewWindow:Se,WebviewWindowHandle:Pe,WindowManager:Te,getCurrent:function(){return new Pe(window.__TAURI__.__currentWindow.label)},getAll:Oe,appWindow:ze,LogicalSize:Me,PhysicalSize:ke,LogicalPosition:$e,PhysicalPosition:Ce,currentMonitor:function(){return bt(this,void 0,void 0,(function(){return wt(this,(function(t){return[2,kt({__tauriModule:"Window",message:{cmd:"currentMonitor"}})]}))}))},primaryMonitor:function(){return bt(this,void 0,void 0,(function(){return wt(this,(function(t){return[2,kt({__tauriModule:"Window",message:{cmd:"primaryMonitor"}})]}))}))},availableMonitors:function(){return bt(this,void 0,void 0,(function(){return wt(this,(function(t){return[2,kt({__tauriModule:"Window",message:{cmd:"availableMonitors"}})]}))}))}});class We extends H{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)),G(this,t,Ae,je,r,{onMessage:23},[-1,-1])}}const Le=[];function De(t,e){return bt(this,void 0,void 0,(function(){return wt(this,(function(n){return[2,kt({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:xt(e)}})]}))}))}function Fe(t){return bt(this,void 0,void 0,(function(){return wt(this,(function(e){return[2,kt({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]}))}))}function Re(){return bt(this,void 0,void 0,(function(){return wt(this,(function(t){return[2,kt({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]}))}))}function Ie(t,e,n){const i=t.slice();return i[9]=e[n],i}function Ue(t){let e,n,i,o,r,u,l=t[9]+"";function v(){return t[8](t[9])}return{c(){e=d("div"),n=f(l),i=h(),o=d("button"),o.textContent="Unregister",m(o,"type","button")},m(t,a){c(t,e,a),s(e,n),s(e,i),s(e,o),r||(u=p(o,"click",v),r=!0)},p(e,i){t=e,2&i&&l!==(l=t[9]+"")&&y(n,l)},d(t){t&&a(e),r=!1,u()}}}function Ke(e){let n,i,o;return{c(){n=d("button"),n.textContent="Unregister all",m(n,"type","button")},m(t,r){c(t,n,r),i||(o=p(n,"click",e[5]),i=!0)},p:t,d(t){t&&a(n),i=!1,o()}}}function Ne(e){let n,o,r,u,f,v,g,y,b,w,x=e[1],M=[];for(let t=0;t{const t=o.indexOf(c);-1!==t&&o.splice(t,1),0===o.length&&(i(),i=null)}}}}([]);u(e,c,(t=>i(1,o=t)));let a="CmdOrControl+X";function l(t){const e=t;Fe(e).then((()=>{c.update((t=>t.filter((t=>t!==e)))),s(`Shortcut ${e} unregistered`)})).catch(s)}return e.$$set=t=>{"onMessage"in t&&i(6,s=t.onMessage)},[a,o,c,function(){const t=a;De(t,(()=>{s(`Shortcut ${t} triggered`)})).then((()=>{c.update((e=>[...e,t])),s(`Shortcut ${t} registered successfully`)})).catch(s)},l,function(){Re().then((()=>{c.update((()=>[])),s("Unregistered all shortcuts")})).catch(s)},s,function(){a=this.value,i(0,a)},t=>l(t)]}Object.freeze({__proto__:null,register:De,registerAll:function(t,e){return bt(this,void 0,void 0,(function(){return wt(this,(function(n){return[2,kt({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:xt(e)}})]}))}))},isRegistered:function(t){return bt(this,void 0,void 0,(function(){return wt(this,(function(e){return[2,kt({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]}))}))},unregister:Fe,unregisterAll:Re});class Be extends H{constructor(t){super(),G(this,t,qe,Ne,r,{onMessage:6})}}function Ge(t){let e,n,o,r,u;return{c(){e=d("input"),n=h(),o=d("button"),o.textContent="Write",m(e,"placeholder","write to stdin"),m(o,"class","button")},m(i,s){c(i,e,s),_(e,t[3]),c(i,n,s),c(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]&&_(e,t[3])},d(t){t&&a(e),t&&a(n),t&&a(o),r=!1,i(u)}}}function He(e){let n,o,r,u,l,f,v,g,y,w,x,M,k,$,C,O=e[4]&&Ge(e);return{c(){n=d("div"),o=d("div"),r=d("input"),u=h(),l=d("button"),l.textContent="Run",f=h(),v=d("button"),v.textContent="Kill",g=h(),O&&O.c(),y=h(),w=d("div"),x=d("input"),M=h(),k=d("input"),m(l,"class","button"),m(v,"class","button"),m(x,"placeholder","Working directory"),m(k,"placeholder","Environment variables"),b(k,"width","300px")},m(t,i){c(t,n,i),s(n,o),s(o,r),_(r,e[0]),s(o,u),s(o,l),s(o,f),s(o,v),s(o,g),O&&O.m(o,null),s(n,y),s(n,w),s(w,x),_(x,e[1]),s(w,M),s(w,k),_(k,e[2]),$||(C=[p(r,"input",e[9]),p(l,"click",e[5]),p(v,"click",e[6]),p(x,"input",e[11]),p(k,"input",e[12])],$=!0)},p(t,[e]){1&e&&r.value!==t[0]&&_(r,t[0]),t[4]?O?O.p(t,e):(O=Ge(t),O.c(),O.m(o,null)):O&&(O.d(1),O=null),2&e&&x.value!==t[1]&&_(x,t[1]),4&e&&k.value!==t[2]&&_(k,t[2])},i:t,o:t,d(t){t&&a(n),O&&O.d(),$=!1,i(C)}}}function Ve(t,e,n){const i=navigator.userAgent.includes("Windows");let o,r=i?"cmd":"sh",u=i?["/C"]:["-c"],{onMessage:s}=e,c='echo "hello world"',a=null,l="SOMETHING=value ANOTHER=2",d="";return t.$$set=t=>{"onMessage"in t&&n(8,s=t.onMessage)},[c,a,l,d,o,function(){n(4,o=null);const t=new St(r,[...u,c],{cwd:a||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(){c=this.value,n(0,c)},function(){d=this.value,n(3,d)},function(){a=this.value,n(1,a)},function(){l=this.value,n(2,l)}]}class Je extends H{constructor(t){super(),G(this,t,Ve,He,r,{onMessage:8})}}function Xe(){return bt(this,void 0,void 0,(function(){function t(){e&&e(),e=void 0}var e;return wt(this,(function(n){return[2,new Promise((function(n,i){Gt("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})),Vt("tauri://update-install").catch((function(e){throw t(),e}))}))]}))}))}function Ye(){return bt(this,void 0,void 0,(function(){function t(){e&&e(),e=void 0}var e;return wt(this,(function(n){return[2,new Promise((function(n,i){Ht("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})),Gt("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})),Vt("tauri://update").catch((function(e){throw t(),e}))}))]}))}))}function Qe(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",m(o,"class","button"),m(o,"id","check_update"),m(u,"class","button hidden"),m(u,"id","start_update")},m(t,i){c(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&&a(n),l=!1,i(f)}}}function Ze(t,e,n){let i,{onMessage:o}=e;return $((async()=>{i=await Gt("tauri://update-status",o)})),C((()=>{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 Ye();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 Xe(),o("Installation complete, restart required."),await Lt()}catch(t){o(t)}},o]}Object.freeze({__proto__:null,installUpdate:Xe,checkUpdate:Ye});class tn extends H{constructor(t){super(),G(this,t,Ze,Qe,r,{onMessage:2})}}function en(t,e,n){const i=t.slice();return i[8]=e[n],i}function nn(t){let e,n,i,o,r,u,l=t[8].label+"";function v(){return t[6](t[8])}return{c(){e=d("p"),n=f(l),i=h(),m(e,"class",o="nv noselect "+(t[0]===t[8]?"nv_selected":""))},m(t,o){c(t,e,o),s(e,n),s(e,i),r||(u=p(e,"click",v),r=!0)},p(n,i){t=n,1&i&&o!==(o="nv noselect "+(t[0]===t[8]?"nv_selected":""))&&m(e,"class",o)},d(t){t&&a(e),r=!1,u()}}}function on(t){let e,n,o,r,u,v,g,_,w,x,M,k,$,C,O,E,P,S,T,z,j,A,W,L=t[2],D=[];for(let e=0;eDocumentation \n Github \n Source',g=h(),_=d("div"),w=d("div");for(let t=0;t{q(t,1)})),R.r||i(R.c),R=R.p}F?(k=new F(B(t)),K(k.$$.fragment),I(k.$$.fragment,1),N(k,M,null)):k=null}(!j||2&e)&&y(z,t[1])},i(t){j||(k&&I(k.$$.fragment,t),j=!0)},o(t){k&&U(k.$$.fragment,t),j=!1},d(t){t&&a(e),l(D,t),k&&q(k),A=!1,i(W)}}}function rn(t,e,n){$((()=>{ht("ctrl+b",(()=>{Mt("menu_toggle")}))}));const i=[{label:"Welcome",component:Rt},{label:"Messages",component:Yt},{label:"CLI",component:Nt},{label:"Dialog",component:re},{label:"File system",component:de},{label:"HTTP",component:ye},{label:"Notifications",component:xe},{label:"Window",component:We},{label:"Shortcuts",component:Be},{label:"Shell",component:Je},{label:"Updater",component:tn}];let o=i[0],r=[""];function u(t){n(0,o=t)}return[o,r,i,u,function(t){n(1,r+="string"==typeof t?t:JSON.stringify(t)),n(1,r+="\n")},function(){Tt("https://tauri.studio/")},t=>u(t),()=>{n(1,r=[""])}]}return new class extends H{constructor(t){super(),G(this,t,rn,on,r,{})}}({target:document.body})}(); //# sourceMappingURL=bundle.js.map