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 r(t){return"function"==typeof t}function o(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 a(t,e){t.appendChild(e)}function s(t,e,n){t.insertBefore(e,n||null)}function c(t){t.parentNode.removeChild(t)}function l(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function m(t){return function(e){return e.preventDefault(),t.call(this,e)}}function _(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function v(t){return""===t?null:+t}function g(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function b(t,e){t.value=null==e?"":e}function y(t,e,n,i){t.style.setProperty(e,n,i?"important":"")}function w(t,e){for(let n=0;n{E.delete(t),i&&(n&&t.d(1),i())})),t.o(e)}}function B(t){t&&t.c()}function L(t,n,o,u){const{fragment:a,on_mount:s,on_destroy:c,after_update:l}=t.$$;a&&a.m(n,o),u||D((()=>{const n=s.map(e).filter(r);c?c.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(D)}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 I(t,e){-1===t.$$.dirty[0]&&(x.push(t),F||(F=!0,O.then(W)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const r=i.length?i[0]:n;return f.ctx&&a(f.ctx[t],f.ctx[t]=r)&&(!f.skip_bound&&f.bound[t]&&f.bound[t](r),p&&I(e,t)),n})):[],f.update(),p=!0,i(f.before_update),f.fragment=!!u&&u(f.ctx),r.target){if(r.hydrate){const t=function(t){return Array.from(t.childNodes)}(r.target);f.fragment&&f.fragment.l(t),t.forEach(c)}else f.fragment&&f.fragment.c();r.intro&&z(e.$$.fragment),L(e,r.target,r.anchor,r.customElement),W()}C(d)}class U{$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)}}function N(t){var e={exports:{}};return t(e,e.exports),e.exports}var G=N((function(t,e){ /*! ***************************************************************************** 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 n=function(t,e){return(n=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 i(t,e,n,i){return new(n||(n=Promise))((function(r,o){function u(t){try{s(i.next(t))}catch(t){o(t)}}function a(t){try{s(i.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}s((i=i.apply(t,e||[])).next())}))}function r(t,e){var n,i,r,o,u={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,i=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((r=(r=u.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]{"onMessage"in t&&n(1,i=t.onMessage)},[function(){Z.getMatches().then(i).catch(i)},i]}class nt extends U{constructor(t){super(),H(this,t,et,tt,o,{onMessage:1})}}var it=N((function(t,e){function n(t,e){return G.__awaiter(this,void 0,void 0,(function(){var n=this;return G.__generator(this,(function(r){return[2,J.invokeTauriCommand({__tauriModule:"Event",message:{cmd:"listen",event:t,handler:G.transformCallback(e)}}).then((function(t){return function(){return G.__awaiter(n,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,i(t)]}))}))}}))]}))}))}function i(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Event",message:{cmd:"unlisten",eventId:t}})]}))}))}e.emit=function(t,e,n){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){switch(i.label){case 0:return[4,J.invokeTauriCommand({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:e,payload:n}})];case 1:return i.sent(),[2]}}))}))},e.listen=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){return[2,n(t,e)]}))}))},e.once=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(r){return[2,n(t,(function(t){e(t),i(t.id).catch((function(){}))}))]}))}))}})),rt=N((function(t,e){function n(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,it.emit(t,void 0,e)]}))}))}var i=Object.freeze({__proto__:null,emit:n,listen:it.listen,once:it.once});e.emit=n,e.event=i})),ot=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.listen=it.listen,e.once=it.once,e.emit=rt.emit})),ut=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.invoke=G.invoke,e.transformCallback=G.transformCallback}));function at(e){let n,r,o,u,l,f,m,v;return{c(){n=d("div"),r=d("button"),r.textContent="Call Log API",o=p(),u=d("button"),u.textContent="Call Request (async) API",l=p(),f=d("button"),f.textContent="Send event to Rust",_(r,"class","button"),_(r,"id","log"),_(u,"class","button"),_(u,"id","request"),_(f,"class","button"),_(f,"id","event")},m(t,i){s(t,n,i),a(n,r),a(n,o),a(n,u),a(n,l),a(n,f),m||(v=[h(r,"click",e[0]),h(u,"click",e[1]),h(f,"click",e[2])],m=!0)},p:t,i:t,o:t,d(t){t&&c(n),m=!1,i(v)}}}function st(t,e,n){let{onMessage:i}=e;return ot.listen("rust-event",i),t.$$set=t=>{"onMessage"in t&&n(3,i=t.onMessage)},[function(){ut.invoke("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})},function(){ut.invoke("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)},function(){ot.emit("js-event","this is the payload string")},i]}class ct extends U{constructor(t){super(),H(this,t,st,at,o,{onMessage:3})}}var lt=N((function(t,e){function n(t){return void 0===t&&(t={}),G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return"object"==typeof t&&Object.freeze(t),[2,J.invokeTauriCommand({__tauriModule:"Dialog",mainThread:!0,message:{cmd:"openDialog",options:t}})]}))}))}function i(t){return void 0===t&&(t={}),G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return"object"==typeof t&&Object.freeze(t),[2,J.invokeTauriCommand({__tauriModule:"Dialog",mainThread:!0,message:{cmd:"saveDialog",options:t}})]}))}))}var r=Object.freeze({__proto__:null,open:n,save:i});e.dialog=r,e.open=n,e.save=i})),dt=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.open=lt.open,e.save=lt.save})),ft=N((function(t,e){var n,i=G;function r(t,e){return void 0===e&&(e={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})]}))}))}function o(t,e){return void 0===e&&(e={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"readBinaryFile",path:t,options:e}})]}))}))}function u(t,e){return void 0===e&&(e={}),i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(n){return"object"==typeof e&&Object.freeze(e),"object"==typeof t&&Object.freeze(t),[2,J.invokeTauriCommand({__tauriModule:"Fs",message:{cmd:"writeFile",path:t.path,contents:t.contents,options:e}})]}))}))}function a(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)},[r,o,u,a,function(){dt.open({defaultPath:r,filters:o?[{name:"Tauri Example",extensions:o.split(",").map((t=>t.trim()))}]:[],multiple:u,directory:a}).then((function(t){if(Array.isArray(t))i(t);else{var e=t,n=e.match(/\S+\.\S+$/g);pt.readBinaryFile(e).then((function(r){var o,u,a,s;n&&(e.includes(".png")||e.includes(".jpg"))?(o=new Uint8Array(r),u=function(t){i('')},a=new Blob([o],{type:"application/octet-binary"}),(s=new FileReader).onload=function(t){var e=t.target.result;u(e.substr(e.indexOf(",")+1))},s.readAsDataURL(a)):i(t)})).catch(i(t))}})).catch(i)},function(){dt.save({defaultPath:r,filters:o?[{name:"Tauri Example",extensions:o.split(",").map((t=>t.trim()))}]:[]}).then(i).catch(i)},i,function(){r=this.value,n(0,r)},function(){o=this.value,n(1,o)},function(){u=this.checked,n(2,u)},function(){a=this.checked,n(3,a)}]}class _t extends U{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}",a(document.head,e)),H(this,t,mt,ht,o,{onMessage:6})}}function vt(t,e,n){const i=t.slice();return i[5]=e[n],i}function gt(e){let n,i,r=e[5][0]+"";return{c(){n=d("option"),i=f(r),n.__value=e[5][1],n.value=n.__value},m(t,e){s(t,n,e),a(n,i)},p:t,d(t){t&&c(n)}}}function bt(e){let n,r,o,u,f,v,g,y,w,k=e[1],C=[];for(let t=0;tisNaN(parseInt(t)))).map((t=>[t,pt.Dir[t]]));return t.$$set=t=>{"onMessage"in t&&n(3,i=t.onMessage)},[r,o,function(){const t=r.match(/\S+\.\S+$/g),e={dir:yt()};(t?pt.readBinaryFile(r,e):pt.readDir(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){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:r,contents:e.value},{dir:yt()}).catch(i)}))}))}else i(e)})).catch(i)},i,function(){r=this.value,n(0,r)}]}class kt extends U{constructor(t){super(),H(this,t,wt,bt,o,{onMessage:3})}}var Ct=N((function(t,e){var n;e.ResponseType=void 0,(n=e.ResponseType||(e.ResponseType={}))[n.JSON=1]="JSON",n[n.Text=2]="Text",n[n.Binary=3]="Binary";var i=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}(),r=function(){function t(t){this.id=t}return t.prototype.drop=function(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]}))}))},t.prototype.request=function(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}})]}))}))},t.prototype.get=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,this.request(G._assign({method:"GET",url:t},e))]}))}))},t.prototype.post=function(t,e,n){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){return[2,this.request(G._assign({method:"POST",url:t,body:e},n))]}))}))},t.prototype.put=function(t,e,n){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){return[2,this.request(G._assign({method:"PUT",url:t,body:e},n))]}))}))},t.prototype.patch=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,this.request(G._assign({method:"PATCH",url:t},e))]}))}))},t.prototype.delete=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,this.request(G._assign({method:"DELETE",url:t},e))]}))}))},t}();function o(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then((function(t){return new r(t)}))]}))}))}var u=null;function a(t,e){var n;return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(i){switch(i.label){case 0:return null!==u?[3,2]:[4,o()];case 1:u=i.sent(),i.label=2;case 2:return[2,u.request(G._assign({url:t,method:null!==(n=null==e?void 0:e.method)&&void 0!==n?n:"GET"},e))]}}))}))}var s=Object.freeze({__proto__:null,get ResponseType(){return e.ResponseType},Body:i,Client:r,getClient:o,fetch:a});e.Body=i,e.Client=r,e.fetch=a,e.getClient=o,e.http=s})),xt=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Body=Ct.Body,e.Client=Ct.Client,Object.defineProperty(e,"ResponseType",{enumerable:!0,get:function(){return Ct.ResponseType}}),e.fetch=Ct.fetch,e.getClient=Ct.getClient}));function Tt(e){let n,r,o,u,l,f,v,g,k,C,x,T,M,$,O,F,j;return{c(){n=d("form"),r=d("select"),o=d("option"),o.textContent="GET",u=d("option"),u.textContent="POST",l=d("option"),l.textContent="PUT",f=d("option"),f.textContent="PATCH",v=d("option"),v.textContent="DELETE",g=p(),k=d("input"),C=p(),x=d("br"),T=p(),M=d("textarea"),$=p(),O=d("button"),O.textContent="Make request",o.__value="GET",o.value=o.__value,u.__value="POST",u.value=u.__value,l.__value="PUT",l.value=l.__value,f.__value="PATCH",f.value=f.__value,v.__value="DELETE",v.value=v.__value,_(r,"class","button"),_(r,"id","request-method"),void 0===e[0]&&D((()=>e[5].call(r))),_(k,"id","request-url"),_(k,"placeholder","Type the request URL..."),_(M,"id","request-body"),_(M,"placeholder","Request body"),_(M,"rows","5"),y(M,"width","100%"),y(M,"margin-right","10px"),y(M,"font-size","12px"),_(O,"class","button"),_(O,"id","make-request")},m(t,i){s(t,n,i),a(n,r),a(r,o),a(r,u),a(r,l),a(r,f),a(r,v),w(r,e[0]),a(n,g),a(n,k),b(k,e[1]),a(n,C),a(n,x),a(n,T),a(n,M),b(M,e[2]),a(n,$),a(n,O),F||(j=[h(r,"change",e[5]),h(k,"input",e[6]),h(M,"input",e[7]),h(n,"submit",m(e[3]))],F=!0)},p(t,[e]){1&e&&w(r,t[0]),2&e&&k.value!==t[1]&&b(k,t[1]),4&e&&b(M,t[2])},i:t,o:t,d(t){t&&c(n),F=!1,i(j)}}}function Mt(t,e,n){let i="GET",r="",o="",{onMessage:u}=e;return t.$$set=t=>{"onMessage"in t&&n(4,u=t.onMessage)},[i,r,o,async function(){const t=await xt.getClient(),e={url:r||""||"",method:i||"GET"||"GET"};o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]")?e.body=xt.Body.json(JSON.parse(o)):""!==o&&(e.body=xt.Body.text(o)),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(){r=this.value,n(1,r)},function(){o=this.value,n(2,o)}]}class $t extends U{constructor(t){super(),H(this,t,Mt,Tt,o,{onMessage:4})}}function Ot(e){let n,i,r;return{c(){n=d("button"),n.textContent="Send test notification",_(n,"class","button"),_(n,"id","notification")},m(t,o){s(t,n,o),i||(r=h(n,"click",e[0]),i=!0)},p:t,i:t,o:t,d(t){t&&c(n),i=!1,r()}}}function Ft(){new Notification("Notification title",{body:"This is the notification body"})}function Dt(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?Ft():i("Permission is "+t)})).catch(i):"granted"===Notification.permission?Ft():i("Permission is denied")},i]}class jt extends U{constructor(t){super(),H(this,t,Dt,Ot,o,{onMessage:1})}}var Pt=N((function(t,e){function n(){return new o(window.__TAURI__.__currentWindow.label)}function i(){return window.__TAURI__.__windows}var r=["tauri://created","tauri://error"],o=function(){function t(t){this.label=t,this.listeners={}}return t.prototype.listen=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){var n=this;return G.__generator(this,(function(i){return this._handleTauriEvent(t,e)?[2,Promise.resolve((function(){var i=n.listeners[t];i.splice(i.indexOf(e),1)}))]:[2,it.listen(t,e)]}))}))},t.prototype.once=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){var n=this;return G.__generator(this,(function(i){return this._handleTauriEvent(t,e)?[2,Promise.resolve((function(){var i=n.listeners[t];i.splice(i.indexOf(e),1)}))]:[2,it.once(t,e)]}))}))},t.prototype.emit=function(t,e){return G.__awaiter(this,void 0,void 0,(function(){var n,i;return G.__generator(this,(function(o){if(r.includes(t)){for(n=0,i=this.listeners[t]||[];n{1&t.$$.dirty[0]&&i(x),2&t.$$.dirty[0]&&(T?o():u()),4&t.$$.dirty[0]&&f($),8&t.$$.dirty[0]&&p(O),16&t.$$.dirty[0]&&w(F),32&t.$$.dirty[0]&&h(D),64&t.$$.dirty[0]&&m(j),384&t.$$.dirty[0]&&P&&W&&_(P,W),1536&t.$$.dirty[0]&&A&&E&&g(A,E),2048&t.$$.dirty[0]&&b(S),4096&t.$$.dirty[0]&&y(z)},[x,T,$,O,F,D,j,P,W,A,E,S,z,C,M,R,function(){X.open(C)},function(){r(R)},function(){l(),setTimeout(c,2e3)},function(){a(),setTimeout(s,2e3)},function(){dt.open({multiple:!1}).then(k)},function(){x=this.checked,n(0,x)},function(){T=this.checked,n(1,T)},function(){M=this.checked,n(14,M)},function(){$=this.checked,n(2,$)},function(){O=this.checked,n(3,O)},function(){F=this.checked,n(4,F)},function(){S=v(this.value),n(11,S)},function(){z=v(this.value),n(12,z)},function(){D=v(this.value),n(5,D)},function(){j=v(this.value),n(6,j)},function(){P=v(this.value),n(7,P)},function(){W=v(this.value),n(8,W)},function(){A=v(this.value),n(9,A)},function(){E=v(this.value),n(10,E)},function(){R=this.value,n(15,R)},function(){C=this.value,n(13,C)}]}class St extends U{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}",a(document.head,e)),H(this,t,Et,At,o,{},[-1,-1])}}const zt=[];var Rt=N((function(t,e){function n(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:G.transformCallback(e)}})]}))}))}function i(t,e){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(n){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:G.transformCallback(e)}})]}))}))}function r(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]}))}))}function o(t){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(e){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]}))}))}function u(){return G.__awaiter(this,void 0,void 0,(function(){return G.__generator(this,(function(t){return[2,J.invokeTauriCommand({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]}))}))}var a=Object.freeze({__proto__:null,register:n,registerAll:i,isRegistered:r,unregister:o,unregisterAll:u});e.globalShortcut=a,e.isRegistered=r,e.register=n,e.registerAll=i,e.unregister=o,e.unregisterAll=u})),Bt=N((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isRegistered=Rt.isRegistered,e.register=Rt.register,e.registerAll=Rt.registerAll,e.unregister=Rt.unregister,e.unregisterAll=Rt.unregisterAll}));function Lt(t,e,n){const i=t.slice();return i[9]=e[n],i}function qt(t){let e,n,i,r,o,u,l=t[9]+"";function m(){return t[8](t[9])}return{c(){e=d("div"),n=f(l),i=p(),r=d("button"),r.textContent="Unregister",_(r,"type","button")},m(t,c){s(t,e,c),a(e,n),a(e,i),a(e,r),o||(u=h(r,"click",m),o=!0)},p(e,i){t=e,2&i&&l!==(l=t[9]+"")&&g(n,l)},d(t){t&&c(e),o=!1,u()}}}function It(e){let n,i,r;return{c(){n=d("button"),n.textContent="Unregister all",_(n,"type","button")},m(t,o){s(t,n,o),i||(r=h(n,"click",e[5]),i=!0)},p:t,d(t){t&&c(n),i=!1,r()}}}function Ht(e){let n,r,o,u,f,m,v,g,y,w,k=e[1],C=[];for(let t=0;t{const t=r.indexOf(s);-1!==t&&r.splice(t,1),0===r.length&&(i(),i=null)}}}}([]);u(e,s,(t=>i(1,r=t)));let c="CmdOrControl+X";function l(t){const e=t;Bt.unregister(e).then((()=>{s.update((t=>t.filter((t=>t!==e)))),a(`Shortcut ${e} unregistered`)})).catch(a)}return e.$$set=t=>{"onMessage"in t&&i(6,a=t.onMessage)},[c,r,s,function(){const t=c;Bt.register(t,(()=>{a(`Shortcut ${t} triggered`)})).then((()=>{s.update((e=>[...e,t])),a(`Shortcut ${t} registered successfully`)})).catch(a)},l,function(){Bt.unregisterAll().then((()=>{s.update((()=>[])),a("Unregistered all shortcuts")})).catch(a)},a,function(){c=this.value,i(0,c)},t=>l(t)]}class Nt extends U{constructor(t){super(),H(this,t,Ut,Ht,o,{onMessage:6})}}function Gt(t){let e,n,r,o,u;return{c(){e=d("input"),n=p(),r=d("button"),r.textContent="Write",_(e,"placeholder","write to stdin"),_(r,"class","button")},m(i,a){s(i,e,a),b(e,t[1]),s(i,n,a),s(i,r,a),o||(u=[h(e,"input",t[8]),h(r,"click",t[5])],o=!0)},p(t,n){2&n&&e.value!==t[1]&&b(e,t[1])},d(t){t&&c(e),t&&c(n),t&&c(r),o=!1,i(u)}}}function Jt(e){let n,r,o,u,l,f,m,v,g,y,w=e[2]&&Gt(e);return{c(){n=d("div"),r=d("div"),o=d("input"),u=p(),l=d("button"),l.textContent="Run",f=p(),m=d("button"),m.textContent="Kill",v=p(),w&&w.c(),_(l,"class","button"),_(m,"class","button")},m(t,i){s(t,n,i),a(n,r),a(r,o),b(o,e[0]),a(r,u),a(r,l),a(r,f),a(r,m),a(r,v),w&&w.m(r,null),g||(y=[h(o,"input",e[7]),h(l,"click",e[3]),h(m,"click",e[4])],g=!0)},p(t,[e]){1&e&&o.value!==t[0]&&b(o,t[0]),t[2]?w?w.p(t,e):(w=Gt(t),w.c(),w.m(r,null)):w&&(w.d(1),w=null)},i:t,o:t,d(t){t&&c(n),w&&w.d(),g=!1,i(y)}}}function Vt(t,e,n){const i=navigator.userAgent.includes("Windows");let r,o=i?"cmd":"sh",u=i?["/C"]:["-c"],{onMessage:a}=e,s='echo "hello world"',c="";return t.$$set=t=>{"onMessage"in t&&n(6,a=t.onMessage)},[s,c,r,function(){n(2,r=null);const t=new X.Command(o,[...u,s]);t.on("close",(t=>{a(`command finished with code ${t.code} and signal ${t.signal}`),n(2,r=null)})),t.on("error",(t=>a(`command error: "${t}"`))),t.stdout.on("data",(t=>a(`command stdout: "${t}"`))),t.stderr.on("data",(t=>a(`command stderr: "${t}"`))),t.spawn().then((t=>{n(2,r=t)})).catch(a)},function(){r.kill().then((()=>a("killed child process"))).error(a)},function(){r.write(c).catch(a)},a,function(){s=this.value,n(0,s)},function(){c=this.value,n(1,c)}]}class Xt extends U{constructor(t){super(),H(this,t,Vt,Jt,o,{onMessage:6})}}function Yt(t,e,n){const i=t.slice();return i[8]=e[n],i}function Kt(t){let e,n,i,r,o,u,l=t[8].label+"";function m(){return t[6](t[8])}return{c(){e=d("p"),n=f(l),i=p(),_(e,"class",r="nv noselect "+(t[0]===t[8]?"nv_selected":""))},m(t,r){s(t,e,r),a(e,n),a(e,i),o||(u=h(e,"click",m),o=!0)},p(n,i){t=n,1&i&&r!==(r="nv noselect "+(t[0]===t[8]?"nv_selected":""))&&_(e,"class",r)},d(t){t&&c(e),o=!1,u()}}}function Qt(t){let e,n,r,o,u,m,v,b,w,k,C,x,T,M,$,O,F,D,j,P,W,A,E,I=t[2],H=[];for(let e=0;eDocumentation \n Github \n Source',v=p(),b=d("div"),w=d("div");for(let t=0;t{q(t,1)})),S.r||i(S.c),S=S.p}U?(x=new U(N(t)),B(x.$$.fragment),z(x.$$.fragment,1),L(x,C,null)):x=null}(!W||2&e)&&g(P,t[1])},i(t){W||(x&&z(x.$$.fragment,t),W=!0)},o(t){x&&R(x.$$.fragment,t),W=!1},d(t){t&&c(e),l(H,t),x&&q(x),A=!1,i(E)}}}function Zt(t,e,n){const i=[{label:"Welcome",component:K},{label:"Messages",component:ct},{label:"CLI",component:nt},{label:"Dialog",component:_t},{label:"File system",component:kt},{label:"HTTP",component:$t},{label:"Notifications",component:jt},{label:"Window",component:St},{label:"Shortcuts",component:Nt},{label:"Shell",component:Xt}];let r=i[0],o=[""];function u(t){n(0,r=t)}return[r,o,i,u,function(t){n(1,o+="string"==typeof t?t:JSON.stringify(t)),n(1,o+="\n")},function(){X.open("https://tauri.studio/")},t=>u(t),()=>{n(1,o=[""])}]}return new class extends U{constructor(t){super(),H(this,t,Zt,Qt,o,{})}}({target:document.body})}(); //# sourceMappingURL=bundle.js.map