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{D.delete(t),i&&(n&&t.d(1),i())})),t.o(e)}}function q(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||W((()=>{const n=c.map(e).filter(o);a?a.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(W)}function B(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]&&(z.push(t),O||(O=!0,E.then(F)),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&&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(a)}else f.fragment&&f.fragment.c();o.intro&&I(e.$$.fragment),N(e,o.target,o.anchor,o.customElement),F()}M(d)}class V{$destroy(){B(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)}} /*! ***************************************************************************** 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 J=function(t,e){return(J=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 X(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}J(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var K=function(){return(K=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&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)})),at().then((t=>{n(0,i=t)})),dt().then((t=>{n(1,o=t)})),[i,o,r,async function(){await ft()},async function(){await ht()}]}Object.freeze({__proto__:null,Command:st,Child:ut,open:ct}),Object.freeze({__proto__:null,getName:lt,getVersion:at,getTauriVersion:dt}),Object.freeze({__proto__:null,exit:ft,relaunch:ht});class mt extends V{constructor(t){super(),H(this,t,vt,pt,r,{})}}function gt(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]}))}))}function yt(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 _t(t,e,n){let{onMessage:i}=e;return t.$$set=t=>{"onMessage"in t&&n(1,i=t.onMessage)},[function(){gt().then(i).catch(i)},i]}Object.freeze({__proto__:null,getMatches:gt});class bt extends V{constructor(t){super(),H(this,t,_t,yt,r,{onMessage:1})}}function wt(t,e,n){return Y(this,void 0,void 0,(function(){return Q(this,(function(i){switch(i.label){case 0:return[4,et({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:e,payload:n}})];case 1:return i.sent(),[2]}}))}))}function xt(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Event",message:{cmd:"unlisten",eventId:t}})]}))}))}function Mt(t,e){return Y(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,et({__tauriModule:"Event",message:{cmd:"listen",event:t,handler:Z(e)}}).then((function(t){return function(){return Y(n,void 0,void 0,(function(){return Q(this,(function(e){return[2,xt(t)]}))}))}}))]}))}))}function kt(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,Mt(t,(function(t){e(t),xt(t.id).catch((function(){}))}))]}))}))}function $t(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,wt(t,void 0,e)]}))}))}function Ct(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 zt(t,e,n){let i,{onMessage:o}=e;return $((async()=>{i=await Mt("rust-event",o)})),C((()=>{i&&i()})),t.$$set=t=>{"onMessage"in t&&n(3,o=t.onMessage)},[function(){tt("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})},function(){tt("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(o).catch(o)},function(){$t("js-event","this is the payload string")},o]}Object.freeze({__proto__:null,listen:Mt,once:kt,emit:$t});class Tt extends V{constructor(t){super(),H(this,t,zt,Ct,r,{onMessage:3})}}function Pt(t){return void 0===t&&(t={}),Y(this,void 0,void 0,(function(){return Q(this,(function(e){return"object"==typeof t&&Object.freeze(t),[2,et({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}})]}))}))}function St(t){return void 0===t&&(t={}),Y(this,void 0,void 0,(function(){return Q(this,(function(e){return"object"==typeof t&&Object.freeze(t),[2,et({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}})]}))}))}function Et(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"Fs",message:{cmd:"readBinaryFile",path:t,options:e}})]}))}))}function Ot(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(){Pt({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);Et(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(){St({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:Pt,save:St}),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"}(it||(it={})),Object.freeze({__proto__:null,get BaseDirectory(){return it},get Dir(){return it},readTextFile:function(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})]}))}))},readBinaryFile:Et,writeFile:function(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return"object"==typeof e&&Object.freeze(e),"object"==typeof t&&Object.freeze(t),[2,et({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:t.contents,options:e}})]}))}))},writeBinaryFile:function(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return"object"==typeof e&&Object.freeze(e),"object"==typeof t&&Object.freeze(t),[2,et({__tauriModule:"Fs",message:{cmd:"writeBinaryFile",path:t.path,contents:Ot(t.contents),options:e}})]}))}))},readDir:Wt,createDir:function(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})]}))}))},removeDir:function(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})]}))}))},copyFile:function(t,e,n){return void 0===n&&(n={}),Y(this,void 0,void 0,(function(){return Q(this,(function(i){return[2,et({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:n}})]}))}))},removeFile:function(t,e){return void 0===e&&(e={}),Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})]}))}))},renameFile:function(t,e,n){return void 0===n&&(n={}),Y(this,void 0,void 0,(function(){return Q(this,(function(i){return[2,et({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:n}})]}))}))}});class Ft extends V{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)),H(this,t,At,jt,r,{onMessage:6})}}function Lt(t,e,n){const i=t.slice();return i[5]=e[n],i}function Dt(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 Rt(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,it[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:It()};(t?Et(o,e):Wt(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:It()}).catch(i)}))}))}else i(e)})).catch(i)},i,function(){o=this.value,n(0,o)}]}class qt extends V{constructor(t){super(),H(this,t,Ut,Rt,r,{onMessage:3})}}!function(t){t[t.JSON=1]="JSON",t[t.Text=2]="Text",t[t.Binary=3]="Binary"}(ot||(ot={}));var Nt=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}(),Bt=function(){function t(t){this.id=t}return t.prototype.drop=function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]}))}))},t.prototype.request=function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}})]}))}))},t.prototype.get=function(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,this.request(K({method:"GET",url:t},e))]}))}))},t.prototype.post=function(t,e,n){return Y(this,void 0,void 0,(function(){return Q(this,(function(i){return[2,this.request(K({method:"POST",url:t,body:e},n))]}))}))},t.prototype.put=function(t,e,n){return Y(this,void 0,void 0,(function(){return Q(this,(function(i){return[2,this.request(K({method:"PUT",url:t,body:e},n))]}))}))},t.prototype.patch=function(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,this.request(K({method:"PATCH",url:t},e))]}))}))},t.prototype.delete=function(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,this.request(K({method:"DELETE",url:t},e))]}))}))},t}();function Gt(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(t){return new Bt(t)}))]}))}))}var Ht=null;function Vt(e){let n,o,r,u,l,f,g,y,x,M,k,$,C,z,T,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"),z=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,m(o,"class","button"),m(o,"id","request-method"),void 0===e[0]&&W((()=>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(T,"class","button"),m(T,"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,z),s(n,T),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 Jt(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 Gt(),e={url:o||""||"",method:i||"GET"||"GET"};r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]")?e.body=Nt.json(JSON.parse(r)):""!==r&&(e.body=Nt.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:Gt,fetch:function(t,e){var n;return Y(this,void 0,void 0,(function(){return Q(this,(function(i){switch(i.label){case 0:return null!==Ht?[3,2]:[4,Gt()];case 1:Ht=i.sent(),i.label=2;case 2:return[2,Ht.request(K({url:t,method:null!==(n=null==e?void 0:e.method)&&void 0!==n?n:"GET"},e))]}}))}))},Body:Nt,Client:Bt});class Xt extends V{constructor(t){super(),H(this,t,Jt,Vt,r,{onMessage:4})}}function Kt(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 Yt(){new Notification("Notification title",{body:"This is the notification body"})}function Qt(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?Yt():i("Permission is "+t)})).catch(i):"granted"===Notification.permission?Yt():i("Permission is denied")},i]}class Zt extends V{constructor(t){super(),H(this,t,Qt,Kt,r,{onMessage:1})}}var te=function(t,e){this.type="Logical",this.width=t,this.height=e},ee=function(){function t(t,e){this.type="Physical",this.width=t,this.height=e}return t.prototype.toLogical=function(t){return new te(this.width/t,this.height/t)},t}(),ne=function(t,e){this.type="Logical",this.x=t,this.y=e},ie=function(){function t(t,e){this.type="Physical",this.x=t,this.y=e}return t.prototype.toLogical=function(t){return new ne(this.x/t,this.y/t)},t}();function oe(){return window.__TAURI__.__windows}var re=["tauri://created","tauri://error"],ue=function(){function t(t){this.label=t,this.listeners=Object.create(null)}return t.prototype.listen=function(t,e){return Y(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return this._handleTauriEvent(t,e)?[2,Promise.resolve((function(){var i=n.listeners[t];i.splice(i.indexOf(e),1)}))]:[2,Mt(t,e)]}))}))},t.prototype.once=function(t,e){return Y(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return this._handleTauriEvent(t,e)?[2,Promise.resolve((function(){var i=n.listeners[t];i.splice(i.indexOf(e),1)}))]:[2,kt(t,e)]}))}))},t.prototype.emit=function(t,e){return Y(this,void 0,void 0,(function(){var n,i;return Q(this,(function(o){if(re.includes(t)){for(n=0,i=this.listeners[t]||[];n{"onMessage"in t&&n(22,b=t.onMessage)},t.$$.update=()=>{1&t.$$.dirty[0]&&i(x),2&t.$$.dirty[0]&&(M?r():u()),4&t.$$.dirty[0]&&d($),8&t.$$.dirty[0]&&f(C),16&t.$$.dirty[0]&&y(z),96&t.$$.dirty[0]&&h(new te(T,P)),384&t.$$.dirty[0]&&p(S&&E?new te(S,E):null),1536&t.$$.dirty[0]&&v(O&&W?new te(O,W):null),6144&t.$$.dirty[0]&&m(new ne(j,A))},[x,M,$,C,z,T,P,S,E,O,W,j,A,w,k,F,function(){ct(w)},function(){o(F)},function(){l(),setTimeout(a,2e3)},function(){s(),setTimeout(c,2e3)},function(){Pt({multiple:!1}).then(_)},function(){new se(Math.random().toString()).once("tauri://error",(function(){b("Error creating new webview")}))},b,function(){x=this.checked,n(0,x)},function(){M=this.checked,n(1,M)},function(){k=this.checked,n(14,k)},function(){$=this.checked,n(2,$)},function(){C=this.checked,n(3,C)},function(){z=this.checked,n(4,z)},function(){j=g(this.value),n(11,j)},function(){A=g(this.value),n(12,A)},function(){T=g(this.value),n(5,T)},function(){P=g(this.value),n(6,P)},function(){S=g(this.value),n(7,S)},function(){E=g(this.value),n(8,E)},function(){O=g(this.value),n(9,O)},function(){W=g(this.value),n(10,W)},function(){F=this.value,n(15,F)},function(){w=this.value,n(13,w)}]}Object.freeze({__proto__:null,WebviewWindow:se,WebviewWindowHandle:ue,WindowManager:ce,getCurrent:function(){return new ue(window.__TAURI__.__currentWindow.label)},getAll:oe,appWindow:ae,LogicalSize:te,PhysicalSize:ee,LogicalPosition:ne,PhysicalPosition:ie,currentMonitor:function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"currentMonitor"}})]}))}))},primaryMonitor:function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"primaryMonitor"}})]}))}))},availableMonitors:function(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"Window",message:{cmd:"availableMonitors"}})]}))}))}});class fe extends V{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)),H(this,t,de,le,r,{onMessage:22},[-1,-1])}}const he=[];function pe(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:Z(e)}})]}))}))}function ve(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]}))}))}function me(){return Y(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,et({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]}))}))}function ge(t,e,n){const i=t.slice();return i[9]=e[n],i}function ye(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 _e(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 be(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;ve(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;pe(t,(()=>{s(`Shortcut ${t} triggered`)})).then((()=>{c.update((e=>[...e,t])),s(`Shortcut ${t} registered successfully`)})).catch(s)},l,function(){me().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:pe,registerAll:function(t,e){return Y(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,et({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:Z(e)}})]}))}))},isRegistered:function(t){return Y(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,et({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]}))}))},unregister:ve,unregisterAll:me});class xe extends V{constructor(t){super(),H(this,t,we,be,r,{onMessage:6})}}function Me(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 ke(e){let n,o,r,u,l,f,v,g,y,w,x,M,k,$,C,z=e[4]&&Me(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(),z&&z.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),z&&z.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]?z?z.p(t,e):(z=Me(t),z.c(),z.m(o,null)):z&&(z.d(1),z=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),z&&z.d(),$=!1,i(C)}}}function $e(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 Ce extends V{constructor(t){super(),H(this,t,$e,ke,r,{onMessage:8})}}function ze(){return Y(this,void 0,void 0,(function(){function t(){e&&e(),e=void 0}var e;return Q(this,(function(n){return[2,new Promise((function(n,i){Mt("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})),$t("tauri://update-install").catch((function(e){throw t(),e}))}))]}))}))}function Te(){return Y(this,void 0,void 0,(function(){function t(){e&&e(),e=void 0}var e;return Q(this,(function(n){return[2,new Promise((function(n,i){kt("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})),Mt("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})),$t("tauri://update").catch((function(e){throw t(),e}))}))]}))}))}function Pe(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 Se(t,e,n){let i,{onMessage:o}=e;return $((async()=>{i=await Mt("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 Te();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 ze(),o("Installation complete, restart required."),await ht()}catch(t){o(t)}},o]}Object.freeze({__proto__:null,installUpdate:ze,checkUpdate:Te});class Ee extends V{constructor(t){super(),H(this,t,Se,Pe,r,{onMessage:2})}}function Oe(t,e,n){const i=t.slice();return i[8]=e[n],i}function We(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 je(t){let e,n,o,r,u,v,g,_,w,x,M,k,$,C,z,T,P,S,E,O,W,j,A,F=t[2],L=[];for(let e=0;eDocumentation \n Github \n Source',g=h(),_=d("div"),w=d("div");for(let t=0;t{B(t,1)})),R.r||i(R.c),R=R.p}D?(k=new D(G(t)),q(k.$$.fragment),I(k.$$.fragment,1),N(k,M,null)):k=null}(!W||2&e)&&y(O,t[1])},i(t){W||(k&&I(k.$$.fragment,t),W=!0)},o(t){k&&U(k.$$.fragment,t),W=!1},d(t){t&&a(e),l(L,t),k&&B(k),j=!1,i(A)}}}function Ae(t,e,n){const i=[{label:"Welcome",component:mt},{label:"Messages",component:Tt},{label:"CLI",component:bt},{label:"Dialog",component:Ft},{label:"File system",component:qt},{label:"HTTP",component:Xt},{label:"Notifications",component:Zt},{label:"Window",component:fe},{label:"Shortcuts",component:xe},{label:"Shell",component:Ce},{label:"Updater",component:Ee}];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(){ct("https://tauri.studio/")},t=>u(t),()=>{n(1,r=[""])}]}return new class extends V{constructor(t){super(),H(this,t,Ae,je,r,{})}}({target:document.body})}(); //# sourceMappingURL=bundle.js.map