var Fo=Object.defineProperty,Ro=Object.defineProperties;var Uo=Object.getOwnPropertyDescriptors;var Ui=Object.getOwnPropertySymbols;var Io=Object.prototype.hasOwnProperty,No=Object.prototype.propertyIsEnumerable;var Ii=(e,t,n)=>t in e?Fo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ni=(e,t)=>{for(var n in t||(t={}))Io.call(t,n)&&Ii(e,n,t[n]);if(Ui)for(var n of Ui(t))No.call(t,n)&&Ii(e,n,t[n]);return e},qi=(e,t)=>Ro(e,Uo(t));import{S as J,i as K,s as Y,e as s,a as g,t as z,b as a,c as O,d as r,l as T,f as H,n as U,g as W,r as Z,o as he,h as Wn,j as A,p as Ke,k as Ye,m as qo,q as Hi,u as ct,v as Xe,w as Bi,x as V,y as Ho,z as Gi,A as $i,B as Vi,C as Ji,D as Bo,E as Ki,F as Yi,H as Go,G as $o,I as Vo}from"./vendor.a59520a9.js";const Jo=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerpolicy&&(l.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?l.credentials="include":o.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}};Jo();/*! ***************************************************************************** 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 Xi=function(e,t){return(Xi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])})(e,t)};function Ln(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Xi(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var dt=function(){return(dt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){u=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]{n(2,l=p)}),to().then(p=>{n(0,i=p)}),no().then(p=>{n(1,o=p)});async function u(){await io()}async function c(){await Dn()}return[i,o,l,u,c]}class Qo extends J{constructor(t){super();K(this,t,Xo,Yo,Y,{})}}function oo(){return b(this,void 0,void 0,function(){return y(this,function(e){return[2,k({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]})})}Object.freeze({__proto__:null,getMatches:oo});function Zo(e){let t,n,i,o,l,u,c,p,f,d,_;return{c(){t=s("div"),n=z(`This binary can be run on the terminal and takes the following arguments: `),i=s("ul"),i.innerHTML=`
  • --config PATH
  • --theme light|dark|system
  • --verbose
  • `,o=z(` Additionally, it has a `),l=s("i"),l.textContent="update --background",u=z(` subcommand. Note that the arguments are only parsed, not implemented. `),c=s("br"),p=g(),f=s("button"),f.textContent="Get matches",a(f,"class","button"),a(f,"id","cli-matches")},m(m,h){O(m,t,h),r(t,n),r(t,i),r(t,o),r(t,l),r(t,u),r(t,c),r(t,p),r(t,f),d||(_=T(f,"click",e[0]),d=!0)},p:U,i:U,o:U,d(m){m&&W(t),d=!1,_()}}}function xo(e,t,n){let{onMessage:i}=t;function o(){oo().then(i).catch(i)}return e.$$set=l=>{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class tr extends J{constructor(t){super();K(this,t,xo,Zo,Y,{onMessage:1})}}function ro(e,t,n){return b(this,void 0,void 0,function(){return y(this,function(i){switch(i.label){case 0:return[4,k({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:n}})];case 1:return i.sent(),[2]}})})}function lo(e){return b(this,void 0,void 0,function(){return y(this,function(t){return[2,k({__tauriModule:"Event",message:{cmd:"unlisten",eventId:e}})]})})}function Et(e,t){return b(this,void 0,void 0,function(){var n=this;return y(this,function(i){return[2,k({__tauriModule:"Event",message:{cmd:"listen",event:e,handler:Lt(t)}}).then(function(o){return function(){return b(n,void 0,void 0,function(){return y(this,function(l){return[2,lo(o)]})})}})]})})}function jn(e,t){return b(this,void 0,void 0,function(){return y(this,function(n){return[2,Et(e,function(i){t(i),lo(i.id).catch(function(){})})]})})}function Qe(e,t){return b(this,void 0,void 0,function(){return y(this,function(n){return[2,ro(e,void 0,t)]})})}Object.freeze({__proto__:null,listen:Et,once:jn,emit:Qe});function er(e){let t,n,i,o,l,u,c,p;return{c(){t=s("div"),n=s("button"),n.textContent="Call Log API",i=g(),o=s("button"),o.textContent="Call Request (async) API",l=g(),u=s("button"),u.textContent="Send event to Rust",a(n,"class","button"),a(n,"id","log"),a(o,"class","button"),a(o,"id","request"),a(u,"class","button"),a(u,"id","event")},m(f,d){O(f,t,d),r(t,n),r(t,i),r(t,o),r(t,l),r(t,u),c||(p=[T(n,"click",e[0]),T(o,"click",e[1]),T(u,"click",e[2])],c=!0)},p:U,i:U,o:U,d(f){f&&W(t),c=!1,Z(p)}}}function nr(e,t,n){let{onMessage:i}=t,o;he(async()=>{o=await Et("rust-event",i)}),Wn(()=>{o&&o()});function l(){me("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){me("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){Qe("js-event","this is the payload string")}return e.$$set=p=>{"onMessage"in p&&n(3,i=p.onMessage)},[l,u,c,i]}class ir extends J{constructor(t){super();K(this,t,nr,er,Y,{onMessage:3})}}function Fn(e){return e===void 0&&(e={}),b(this,void 0,void 0,function(){return y(this,function(t){return typeof e=="object"&&Object.freeze(e),[2,k({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})]})})}function so(e){return e===void 0&&(e={}),b(this,void 0,void 0,function(){return y(this,function(t){return typeof e=="object"&&Object.freeze(e),[2,k({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})]})})}function or(e){return b(this,void 0,void 0,function(){return y(this,function(t){return[2,k({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:e}})]})})}function rr(e,t){return b(this,void 0,void 0,function(){return y(this,function(n){return[2,k({__tauriModule:"Dialog",message:{cmd:"askDialog",title:t,message:e}})]})})}function lr(e,t){return b(this,void 0,void 0,function(){return y(this,function(n){return[2,k({__tauriModule:"Dialog",message:{cmd:"confirmDialog",title:t,message:e}})]})})}Object.freeze({__proto__:null,open:Fn,save:so,message:or,ask:rr,confirm:lr});var $t;function sr(e,t){return t===void 0&&(t={}),b(this,void 0,void 0,function(){return y(this,function(n){return[2,k({__tauriModule:"Fs",message:{cmd:"readTextFile",path:e,options:t}})]})})}function Rn(e,t){return t===void 0&&(t={}),b(this,void 0,void 0,function(){return y(this,function(n){return[2,k({__tauriModule:"Fs",message:{cmd:"readBinaryFile",path:e,options:t}})]})})}function ur(e,t){return t===void 0&&(t={}),b(this,void 0,void 0,function(){return y(this,function(n){return typeof t=="object"&&Object.freeze(t),typeof e=="object"&&Object.freeze(e),[2,k({__tauriModule:"Fs",message:{cmd:"writeFile",path:e.path,contents:e.contents,options:t}})]})})}(function(e){e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Desktop=6]="Desktop",e[e.Document=7]="Document",e[e.Download=8]="Download",e[e.Executable=9]="Executable",e[e.Font=10]="Font",e[e.Home=11]="Home",e[e.Picture=12]="Picture",e[e.Public=13]="Public",e[e.Runtime=14]="Runtime",e[e.Template=15]="Template",e[e.Video=16]="Video",e[e.Resource=17]="Resource",e[e.App=18]="App",e[e.Current=19]="Current",e[e.Log=20]="Log"})($t||($t={}));function ar(e){var t=function(n){if(n.length<65536)return String.fromCharCode.apply(null,Array.from(n));for(var i="",o=n.length,l=0;lv.trim())}]:[],multiple:u,directory:c}).then(function(v){if(Array.isArray(v))i(v);else{var C=v,w=C.match(/\S+\.\S+$/g);Rn(C).then(function(P){w&&(C.includes(".png")||C.includes(".jpg"))?gr(new Uint8Array(P),function(S){var D="data:image/png;base64,"+S;i('')}):i(v)}).catch(i(v))}}).catch(i)}function f(){so({defaultPath:o,filters:l?[{name:"Tauri Example",extensions:l.split(",").map(v=>v.trim())}]:[]}).then(i).catch(i)}function d(){o=this.value,n(0,o)}function _(){l=this.value,n(1,l)}function m(){u=this.checked,n(2,u)}function h(){c=this.checked,n(3,c)}return e.$$set=v=>{"onMessage"in v&&n(6,i=v.onMessage)},[o,l,u,c,p,f,i,d,_,m,h]}class br extends J{constructor(t){super();K(this,t,_r,vr,Y,{onMessage:6})}}function ao(e,t,n){const i=e.slice();return i[8]=t[n],i}function co(e){let t,n=e[8][0]+"",i,o;return{c(){t=s("option"),i=z(n),t.__value=o=e[8][1],t.value=t.__value},m(l,u){O(l,t,u),r(t,i)},p:U,d(l){l&&W(t)}}}function yr(e){let t,n,i,o,l,u,c,p,f,d,_,m,h,v=e[2],C=[];for(let w=0;wisNaN(parseInt(_))).map(_=>[_,$t[_]]);function c(){const _=o.match(/\S+\.\S+$/g),m={dir:fo()};(_?Rn(o,m):uo(o,m)).then(function(v){if(_)if(o.includes(".png")||o.includes(".jpg"))wr(new Uint8Array(v),function(C){const w="data:image/png;base64,"+C;i('')});else{const C=String.fromCharCode.apply(null,v);i(''),setTimeout(()=>{const w=document.getElementById("file-response");w.value=C,document.getElementById("file-save").addEventListener("click",function(){writeFile({file:o,contents:w.value},{dir:fo()}).catch(i)})})}else i(v)}).catch(i)}function p(){n(1,l.src=Qi(o),l)}function f(){o=this.value,n(0,o)}function d(_){qo[_?"unshift":"push"](()=>{l=_,n(1,l)})}return e.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage)},[o,l,u,c,p,i,f,d]}class kr extends J{constructor(t){super();K(this,t,Mr,yr,Y,{onMessage:5})}}var ve;(function(e){e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary"})(ve||(ve={}));var Un=function(){function e(t,n){this.type=t,this.payload=n}return e.form=function(t){return new e("Form",t)},e.json=function(t){return new e("Json",t)},e.text=function(t){return new e("Text",t)},e.bytes=function(t){return new e("Bytes",t)},e}(),po=function(e){this.url=e.url,this.status=e.status,this.ok=this.status>=200&&this.status<300,this.headers=e.headers,this.data=e.data},ho=function(){function e(t){this.id=t}return e.prototype.drop=function(){return b(this,void 0,void 0,function(){return y(this,function(t){return[2,k({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},e.prototype.request=function(t){return b(this,void 0,void 0,function(){var n;return y(this,function(i){return(n=!t.responseType||t.responseType===ve.JSON)&&(t.responseType=ve.Text),[2,k({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:t}}).then(function(o){var l=new po(o);if(n){try{l.data=JSON.parse(l.data)}catch(u){if(l.ok&&l.data==="")l.data={};else if(respone.ok)throw Error("Failed to parse response `".concat(l.data,"` as JSON: ").concat(u,";\n try setting the `responseType` option to `ResponseType.Text` or `ResponseType.Binary` if the API does not return a JSON response."))}return l}return l})]})})},e.prototype.get=function(t,n){return b(this,void 0,void 0,function(){return y(this,function(i){return[2,this.request(dt({method:"GET",url:t},n))]})})},e.prototype.post=function(t,n,i){return b(this,void 0,void 0,function(){return y(this,function(o){return[2,this.request(dt({method:"POST",url:t,body:n},i))]})})},e.prototype.put=function(t,n,i){return b(this,void 0,void 0,function(){return y(this,function(o){return[2,this.request(dt({method:"PUT",url:t,body:n},i))]})})},e.prototype.patch=function(t,n){return b(this,void 0,void 0,function(){return y(this,function(i){return[2,this.request(dt({method:"PATCH",url:t},n))]})})},e.prototype.delete=function(t,n){return b(this,void 0,void 0,function(){return y(this,function(i){return[2,this.request(dt({method:"DELETE",url:t},n))]})})},e}();function In(e){return b(this,void 0,void 0,function(){return y(this,function(t){return[2,k({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(function(n){return new ho(n)})]})})}var Nn=null;function Cr(e,t){var n;return b(this,void 0,void 0,function(){return y(this,function(i){switch(i.label){case 0:return Nn!==null?[3,2]:[4,In()];case 1:Nn=i.sent(),i.label=2;case 2:return[2,Nn.request(dt({url:e,method:(n=t==null?void 0:t.method)!==null&&n!==void 0?n:"GET"},t))]}})})}Object.freeze({__proto__:null,getClient:In,fetch:Cr,Body:Un,Client:ho,Response:po,get ResponseType(){return ve}});function Tr(e){let t,n,i,o,l,u,c,p,f,d,_,m,h,v,C,w,P;return{c(){t=s("form"),n=s("select"),i=s("option"),i.textContent="GET",o=s("option"),o.textContent="POST",l=s("option"),l.textContent="PUT",u=s("option"),u.textContent="PATCH",c=s("option"),c.textContent="DELETE",p=g(),f=s("input"),d=g(),_=s("br"),m=g(),h=s("textarea"),v=g(),C=s("button"),C.textContent="Make request",i.__value="GET",i.value=i.__value,o.__value="POST",o.value=o.__value,l.__value="PUT",l.value=l.__value,u.__value="PATCH",u.value=u.__value,c.__value="DELETE",c.value=c.__value,a(n,"class","button"),a(n,"id","request-method"),e[0]===void 0&&Hi(()=>e[5].call(n)),a(f,"id","request-url"),a(f,"placeholder","Type the request URL..."),a(h,"id","request-body"),a(h,"placeholder","Request body"),a(h,"rows","5"),ct(h,"width","100%"),ct(h,"margin-right","10px"),ct(h,"font-size","12px"),a(C,"class","button"),a(C,"id","make-request")},m(S,D){O(S,t,D),r(t,n),r(n,i),r(n,o),r(n,l),r(n,u),r(n,c),Xe(n,e[0]),r(t,p),r(t,f),A(f,e[1]),r(t,d),r(t,_),r(t,m),r(t,h),A(h,e[2]),r(t,v),r(t,C),w||(P=[T(n,"change",e[5]),T(f,"input",e[6]),T(h,"input",e[7]),T(t,"submit",Ke(e[3]))],w=!0)},p(S,[D]){D&1&&Xe(n,S[0]),D&2&&f.value!==S[1]&&A(f,S[1]),D&4&&A(h,S[2])},i:U,o:U,d(S){S&&W(t),w=!1,Z(P)}}}function Sr(e,t,n){let i="GET",o="https://jsonplaceholder.typicode.com/todos/1",l="",{onMessage:u}=t;async function c(){const _=await In(),v={url:o||""||"",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?v.body=Un.json(JSON.parse(l)):l!==""&&(v.body=Un.text(l)),_.request(v).then(u).catch(u)}function p(){i=Bi(this),n(0,i)}function f(){o=this.value,n(1,o)}function d(){l=this.value,n(2,l)}return e.$$set=_=>{"onMessage"in _&&n(4,u=_.onMessage)},[i,o,l,c,u,p,f,d]}class zr extends J{constructor(t){super();K(this,t,Sr,Tr,Y,{onMessage:4})}}function Pr(e){let t,n,i;return{c(){t=s("button"),t.textContent="Send test notification",a(t,"class","button"),a(t,"id","notification")},m(o,l){O(o,t,l),n||(i=T(t,"click",e[0]),n=!0)},p:U,i:U,o:U,d(o){o&&W(t),n=!1,i()}}}function mo(){new Notification("Notification title",{body:"This is the notification body"})}function Or(e,t,n){let{onMessage:i}=t;function o(){Notification.permission==="default"?Notification.requestPermission().then(function(l){l==="granted"?mo():i("Permission is "+l)}).catch(i):Notification.permission==="granted"?mo():i("Permission is denied")}return e.$$set=l=>{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class Wr extends J{constructor(t){super();K(this,t,Or,Pr,Y,{onMessage:1})}}var Vt,Ze=function(e,t){this.type="Logical",this.width=e,this.height=t},Jt=function(){function e(t,n){this.type="Physical",this.width=t,this.height=n}return e.prototype.toLogical=function(t){return new Ze(this.width/t,this.height/t)},e}(),vo=function(e,t){this.type="Logical",this.x=e,this.y=t},Kt=function(){function e(t,n){this.type="Physical",this.x=t,this.y=n}return e.prototype.toLogical=function(t){return new vo(this.x/t,this.y/t)},e}();function Lr(){return new ge(window.__TAURI__.__currentWindow.label,{skip:!0})}function go(){return window.__TAURI__.__windows.map(function(e){return new ge(e.label,{skip:!0})})}(function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"})(Vt||(Vt={}));var _o=["tauri://created","tauri://error"],bo=function(){function e(t){try{this.label=t!=null?t:window.__TAURI__.__currentWindow.label}catch{this.label=""}this.listeners=Object.create(null)}return e.prototype.listen=function(t,n){return b(this,void 0,void 0,function(){var i=this;return y(this,function(o){return this._handleTauriEvent(t,n)?[2,Promise.resolve(function(){var l=i.listeners[t];l.splice(l.indexOf(n),1)})]:[2,Et(t,n)]})})},e.prototype.once=function(t,n){return b(this,void 0,void 0,function(){var i=this;return y(this,function(o){return this._handleTauriEvent(t,n)?[2,Promise.resolve(function(){var l=i.listeners[t];l.splice(l.indexOf(n),1)})]:[2,jn(t,n)]})})},e.prototype.emit=function(t,n){return b(this,void 0,void 0,function(){var i,o;return y(this,function(l){if(_o.includes(t)){for(i=0,o=this.listeners[t]||[];ie[31].call(n)),a(u,"type","checkbox"),a(d,"type","checkbox"),a(h,"title","Unminimizes after 2 seconds"),a(C,"title","Unminimizes after 2 seconds"),a(P,"title","Visible again after 2 seconds"),a(R,"type","checkbox"),a(G,"type","checkbox"),a(F,"type","checkbox"),a(ft,"type","checkbox"),a(et,"type","number"),a(et,"min","0"),a(et,"class","svelte-12ggtr4"),a(nt,"type","number"),a(nt,"min","0"),a(nt,"class","svelte-12ggtr4"),a(pt,"class","flex col grow svelte-12ggtr4"),a(it,"type","number"),a(it,"min","400"),a(it,"class","svelte-12ggtr4"),a(ot,"type","number"),a(ot,"min","400"),a(ot,"class","svelte-12ggtr4"),a(ht,"class","flex col grow svelte-12ggtr4"),a(mt,"type","number"),a(mt,"class","svelte-12ggtr4"),a(vt,"type","number"),a(vt,"class","svelte-12ggtr4"),a(N,"class","flex col grow svelte-12ggtr4"),a(ut,"type","number"),a(ut,"min","400"),a(ut,"class","svelte-12ggtr4"),a(at,"type","number"),a(at,"min","400"),a(at,"class","svelte-12ggtr4"),a(Ut,"class","flex col grow svelte-12ggtr4"),a(x,"class","window-controls flex flex-row svelte-12ggtr4"),a(t,"class","flex col"),a(Xt,"class","svelte-12ggtr4"),a(Qt,"class","svelte-12ggtr4"),a(gt,"class","grow window-property svelte-12ggtr4"),a(Zt,"class","svelte-12ggtr4"),a(xt,"class","svelte-12ggtr4"),a(_t,"class","grow window-property svelte-12ggtr4"),a(It,"class","flex"),a(te,"class","svelte-12ggtr4"),a(ee,"class","svelte-12ggtr4"),a(bt,"class","grow window-property svelte-12ggtr4"),a(ne,"class","svelte-12ggtr4"),a(ie,"class","svelte-12ggtr4"),a(yt,"class","grow window-property svelte-12ggtr4"),a(Nt,"class","flex"),a(oe,"class","svelte-12ggtr4"),a(re,"class","svelte-12ggtr4"),a(wt,"class","grow window-property svelte-12ggtr4"),a(le,"class","svelte-12ggtr4"),a(se,"class","svelte-12ggtr4"),a(Mt,"class","grow window-property svelte-12ggtr4"),a(qt,"class","flex"),a(ue,"class","svelte-12ggtr4"),a(ae,"class","svelte-12ggtr4"),a(kt,"class","grow window-property svelte-12ggtr4"),a(ce,"class","svelte-12ggtr4"),a(de,"class","svelte-12ggtr4"),a(Ct,"class","grow window-property svelte-12ggtr4"),a(Ht,"class","flex"),a(Pt,"id","title"),a(fe,"class","button"),a(fe,"type","submit"),ct(Tt,"margin-top","24px"),a(Ot,"id","url"),a(pe,"class","button"),a(pe,"id","open-url"),ct(St,"margin-top","24px"),a(Wt,"class","button"),a(Wt,"title","Minimizes the window, requests attention for 3s and then resets it"),a(Bt,"class","button")},m(M,E){O(M,t,E),r(t,n);for(let $=0;${n(20,G=N),n(7,h=G.width),n(8,v=G.height)}),o[i].outerSize().then(N=>{n(21,B=N)})}function ye(){o[i].innerPosition().then(N=>{n(18,L=N)}),o[i].outerPosition().then(N=>{n(19,I=N),n(13,D=I.x),n(14,R=I.y)})}async function Yt(N){Q&&Q(),tt&&tt(),tt=await N.listen("tauri://move",ye),Q=await N.listen("tauri://resize",At)}async function x(){await o[i].minimize(),await o[i].requestUserAttention(Vt.Critical),await new Promise(N=>setTimeout(N,3e3)),await o[i].requestUserAttention(null)}function pt(){i=Bi(this),n(0,i),n(1,o)}function Dt(){c=this.checked,n(2,c)}function we(){p=this.checked,n(3,p)}const et=()=>o[i].center();function Me(){f=this.checked,n(16,f)}function jt(){d=this.checked,n(4,d)}function ke(){_=this.checked,n(5,_)}function nt(){m=this.checked,n(6,m)}function Ce(){D=V(this.value),n(13,D)}function ht(){R=V(this.value),n(14,R)}function Ft(){h=V(this.value),n(7,h)}function Te(){v=V(this.value),n(8,v)}function it(){C=V(this.value),n(9,C)}function Se(){w=V(this.value),n(10,w)}function Rt(){P=V(this.value),n(11,P)}function ze(){S=V(this.value),n(12,S)}function ot(){F=this.value,n(22,F)}function Pe(){u=this.value,n(15,u)}return e.$$set=N=>{"onMessage"in N&&n(30,l=N.onMessage)},e.$$.update=()=>{e.$$.dirty[0]&7&&o[i].setResizable(c),e.$$.dirty[0]&11&&(p?o[i].maximize():o[i].unmaximize()),e.$$.dirty[0]&19&&o[i].setDecorations(d),e.$$.dirty[0]&35&&o[i].setAlwaysOnTop(_),e.$$.dirty[0]&67&&o[i].setFullscreen(m),e.$$.dirty[0]&387&&o[i].setSize(new Jt(h,v)),e.$$.dirty[0]&1539&&(C&&w?o[i].setMinSize(new Ze(C,w)):o[i].setMinSize(null)),e.$$.dirty[0]&6147&&(P&&S?o[i].setMaxSize(new Ze(P,S)):o[i].setMaxSize(null)),e.$$.dirty[0]&24579&&o[i].setPosition(new Kt(D,R)),e.$$.dirty[0]&3&&o[i].scaleFactor().then(N=>n(17,j=N)),e.$$.dirty[0]&3&&Yt(o[i])},[i,o,c,p,d,_,m,h,v,C,w,P,S,D,R,u,f,j,L,I,G,B,F,rt,q,st,ft,_e,be,x,l,pt,Dt,we,et,Me,jt,ke,nt,Ce,ht,Ft,Te,it,Se,Rt,ze,ot,Pe]}class Rr extends J{constructor(t){super();K(this,t,Fr,jr,Y,{onMessage:30},[-1,-1])}}function ko(e,t){return b(this,void 0,void 0,function(){return y(this,function(n){return[2,k({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:Lt(t)}})]})})}function Ur(e,t){return b(this,void 0,void 0,function(){return y(this,function(n){return[2,k({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:Lt(t)}})]})})}function Ir(e){return b(this,void 0,void 0,function(){return y(this,function(t){return[2,k({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})]})})}function Co(e){return b(this,void 0,void 0,function(){return y(this,function(t){return[2,k({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})]})})}function To(){return b(this,void 0,void 0,function(){return y(this,function(e){return[2,k({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:ko,registerAll:Ur,isRegistered:Ir,unregister:Co,unregisterAll:To});function So(e,t,n){const i=e.slice();return i[9]=t[n],i}function zo(e){let t,n=e[9]+"",i,o,l,u,c;function p(){return e[8](e[9])}return{c(){t=s("div"),i=z(n),o=g(),l=s("button"),l.textContent="Unregister",a(l,"type","button")},m(f,d){O(f,t,d),r(t,i),r(t,o),r(t,l),u||(c=T(l,"click",p),u=!0)},p(f,d){e=f,d&2&&n!==(n=e[9]+"")&&H(i,n)},d(f){f&&W(t),u=!1,c()}}}function Po(e){let t,n,i;return{c(){t=s("button"),t.textContent="Unregister all",a(t,"type","button")},m(o,l){O(o,t,l),n||(i=T(t,"click",e[5]),n=!0)},p:U,d(o){o&&W(t),n=!1,i()}}}function Nr(e){let t,n,i,o,l,u,c,p,f,d,_=e[1],m=[];for(let v=0;v<_.length;v+=1)m[v]=zo(So(e,_,v));let h=e[1].length&&Po(e);return{c(){t=s("div"),n=s("div"),i=s("input"),o=g(),l=s("button"),l.textContent="Register",u=g(),c=s("div");for(let v=0;vn(1,i=m));let u="CmdOrControl+X";function c(){const m=u;ko(m,()=>{o(`Shortcut ${m} triggered`)}).then(()=>{l.update(h=>[...h,m]),o(`Shortcut ${m} registered successfully`)}).catch(o)}function p(m){const h=m;Co(h).then(()=>{l.update(v=>v.filter(C=>C!==h)),o(`Shortcut ${h} unregistered`)}).catch(o)}function f(){To().then(()=>{l.update(()=>[]),o("Unregistered all shortcuts")}).catch(o)}function d(){u=this.value,n(0,u)}const _=m=>p(m);return e.$$set=m=>{"onMessage"in m&&n(6,o=m.onMessage)},[u,i,l,c,p,f,o,d,_]}class Hr extends J{constructor(t){super();K(this,t,qr,Nr,Y,{onMessage:6})}}function Oo(e){let t,n,i,o,l;return{c(){t=s("input"),n=g(),i=s("button"),i.textContent="Write",a(t,"placeholder","write to stdin"),a(i,"class","button")},m(u,c){O(u,t,c),A(t,e[3]),O(u,n,c),O(u,i,c),o||(l=[T(t,"input",e[10]),T(i,"click",e[7])],o=!0)},p(u,c){c&8&&t.value!==u[3]&&A(t,u[3])},d(u){u&&W(t),u&&W(n),u&&W(i),o=!1,Z(l)}}}function Br(e){let t,n,i,o,l,u,c,p,f,d,_,m,h,v,C,w=e[4]&&Oo(e);return{c(){t=s("div"),n=s("div"),i=s("input"),o=g(),l=s("button"),l.textContent="Run",u=g(),c=s("button"),c.textContent="Kill",p=g(),w&&w.c(),f=g(),d=s("div"),_=s("input"),m=g(),h=s("input"),a(l,"class","button"),a(c,"class","button"),a(_,"placeholder","Working directory"),a(h,"placeholder","Environment variables"),ct(h,"width","300px")},m(P,S){O(P,t,S),r(t,n),r(n,i),A(i,e[0]),r(n,o),r(n,l),r(n,u),r(n,c),r(n,p),w&&w.m(n,null),r(t,f),r(t,d),r(d,_),A(_,e[1]),r(d,m),r(d,h),A(h,e[2]),v||(C=[T(i,"input",e[9]),T(l,"click",e[5]),T(c,"click",e[6]),T(_,"input",e[11]),T(h,"input",e[12])],v=!0)},p(P,[S]){S&1&&i.value!==P[0]&&A(i,P[0]),P[4]?w?w.p(P,S):(w=Oo(P),w.c(),w.m(n,null)):w&&(w.d(1),w=null),S&2&&_.value!==P[1]&&A(_,P[1]),S&4&&h.value!==P[2]&&A(h,P[2])},i:U,o:U,d(P){P&&W(t),w&&w.d(),v=!1,Z(C)}}}function Gr(e,t,n){const i=navigator.userAgent.includes("Windows");let o=i?"cmd":"sh",l=i?["/C"]:["-c"],{onMessage:u}=t,c='echo "hello world"',p=null,f="SOMETHING=value ANOTHER=2",d="",_;function m(){return f.split(" ").reduce((R,j)=>{let[L,I]=j.split("=");return qi(Ni({},R),{[L]:I})},{})}function h(){n(4,_=null);const R=new xi(o,[...l,c],{cwd:p||null,env:m()});R.on("close",j=>{u(`command finished with code ${j.code} and signal ${j.signal}`),n(4,_=null)}),R.on("error",j=>u(`command error: "${j}"`)),R.stdout.on("data",j=>u(`command stdout: "${j}"`)),R.stderr.on("data",j=>u(`command stderr: "${j}"`)),R.spawn().then(j=>{n(4,_=j)}).catch(u)}function v(){_.kill().then(()=>u("killed child process")).catch(u)}function C(){_.write(d).catch(u)}function w(){c=this.value,n(0,c)}function P(){d=this.value,n(3,d)}function S(){p=this.value,n(1,p)}function D(){f=this.value,n(2,f)}return e.$$set=R=>{"onMessage"in R&&n(8,u=R.onMessage)},[c,p,f,d,_,h,v,C,u,w,P,S,D]}class $r extends J{constructor(t){super();K(this,t,Gr,Br,Y,{onMessage:8})}}function Wo(){return b(this,void 0,void 0,function(){function e(){t&&t(),t=void 0}var t;return y(this,function(n){return[2,new Promise(function(i,o){Et("tauri://update-status",function(l){var u;(u=l==null?void 0:l.payload).error?(e(),o(u.error)):u.status==="DONE"&&(e(),i())}).then(function(l){t=l}).catch(function(l){throw e(),l}),Qe("tauri://update-install").catch(function(l){throw e(),l})})]})})}function Lo(){return b(this,void 0,void 0,function(){function e(){t&&t(),t=void 0}var t;return y(this,function(n){return[2,new Promise(function(i,o){jn("tauri://update-available",function(l){var u;u=l==null?void 0:l.payload,e(),i({manifest:u,shouldUpdate:!0})}).catch(function(l){throw e(),l}),Et("tauri://update-status",function(l){var u;(u=l==null?void 0:l.payload).error?(e(),o(u.error)):u.status==="UPTODATE"&&(e(),i({shouldUpdate:!1}))}).then(function(l){t=l}).catch(function(l){throw e(),l}),Qe("tauri://update").catch(function(l){throw e(),l})})]})})}Object.freeze({__proto__:null,installUpdate:Wo,checkUpdate:Lo});function Vr(e){let t,n,i,o,l,u;return{c(){t=s("div"),n=s("button"),n.textContent="Check update",i=g(),o=s("button"),o.textContent="Install update",a(n,"class","button"),a(n,"id","check_update"),a(o,"class","button hidden"),a(o,"id","start_update")},m(c,p){O(c,t,p),r(t,n),r(t,i),r(t,o),l||(u=[T(n,"click",e[0]),T(o,"click",e[1])],l=!0)},p:U,i:U,o:U,d(c){c&&W(t),l=!1,Z(u)}}}function Jr(e,t,n){let{onMessage:i}=t,o;he(async()=>{o=await Et("tauri://update-status",i)}),Wn(()=>{o&&o()});async function l(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:c,manifest:p}=await Lo();i(`Should update: ${c}`),i(p),c&&document.getElementById("start_update").classList.remove("hidden")}catch(c){i(c)}}async function u(){try{document.getElementById("start_update").classList.add("hidden"),await Wo(),i("Installation complete, restart required."),await Dn()}catch(c){i(c)}}return e.$$set=c=>{"onMessage"in c&&n(2,i=c.onMessage)},[l,u,i]}class Kr extends J{constructor(t){super();K(this,t,Jr,Vr,Y,{onMessage:2})}}function Eo(e){return b(this,void 0,void 0,function(){return y(this,function(t){return[2,k({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})]})})}function Ao(){return b(this,void 0,void 0,function(){return y(this,function(e){return[2,k({__tauriModule:"Clipboard",message:{cmd:"readText"}})]})})}Object.freeze({__proto__:null,writeText:Eo,readText:Ao});function Yr(e){let t,n,i,o,l,u,c,p,f;return{c(){t=s("div"),n=s("div"),i=s("input"),o=g(),l=s("button"),l.textContent="Write",u=g(),c=s("button"),c.textContent="Read",a(i,"placeholder","Text to write to the clipboard"),a(l,"type","button"),a(c,"type","button")},m(d,_){O(d,t,_),r(t,n),r(n,i),A(i,e[0]),r(n,o),r(n,l),r(t,u),r(t,c),p||(f=[T(i,"input",e[4]),T(l,"click",e[1]),T(c,"click",e[2])],p=!0)},p(d,[_]){_&1&&i.value!==d[0]&&A(i,d[0])},i:U,o:U,d(d){d&&W(t),p=!1,Z(f)}}}function Xr(e,t,n){let{onMessage:i}=t,o="clipboard message";function l(){Eo(o).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){Ao().then(p=>{i(`Clipboard contents: ${p}`)}).catch(i)}function c(){o=this.value,n(0,o)}return e.$$set=p=>{"onMessage"in p&&n(3,i=p.onMessage)},[o,l,u,i,c]}class Qr extends J{constructor(t){super();K(this,t,Xr,Yr,Y,{onMessage:3})}}function Zr(e){let t;return{c(){t=s("div"),t.innerHTML=`

    Not available for Linux

    `},m(n,i){O(n,t,i)},p:U,i:U,o:U,d(n){n&&W(t)}}}function xr(e,t,n){let{onMessage:i}=t;const o=window.constraints={audio:!0,video:!0};function l(c){const p=document.querySelector("video"),f=c.getVideoTracks();i("Got stream with constraints:",o),i(`Using video device: ${f[0].label}`),window.stream=c,p.srcObject=c}function u(c){if(c.name==="ConstraintNotSatisfiedError"){const p=o.video;i(`The resolution ${p.width.exact}x${p.height.exact} px is not supported by your device.`)}else c.name==="PermissionDeniedError"&&i("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");i(`getUserMedia error: ${c.name}`,c)}return he(async()=>{try{const c=await navigator.mediaDevices.getUserMedia(o);l(c)}catch(c){u(c)}}),Wn(()=>{window.stream.getTracks().forEach(function(c){c.stop()})}),e.$$set=c=>{"onMessage"in c&&n(0,i=c.onMessage)},[i]}class tl extends J{constructor(t){super();K(this,t,xr,Zr,Y,{onMessage:0})}}function el(e){let t,n,i,o,l,u,c,p,f,d,_,m;return{c(){t=s("input"),n=g(),i=s("input"),o=g(),l=s("button"),l.textContent="Post it.",u=g(),c=s("p"),c.textContent="Result:",p=g(),f=s("pre"),d=z(e[2]),a(l,"type","button")},m(h,v){O(h,t,v),A(t,e[0]),O(h,n,v),O(h,i,v),A(i,e[1]),O(h,o,v),O(h,l,v),O(h,u,v),O(h,c,v),O(h,p,v),O(h,f,v),r(f,d),_||(m=[T(t,"input",e[4]),T(i,"input",e[5]),T(l,"click",e[3])],_=!0)},p(h,[v]){v&1&&t.value!==h[0]&&A(t,h[0]),v&2&&i.value!==h[1]&&A(i,h[1]),v&4&&H(d,h[2])},i:U,o:U,d(h){h&&W(t),h&&W(n),h&&W(i),h&&W(o),h&&W(l),h&&W(u),h&&W(c),h&&W(p),h&&W(f),_=!1,Z(m)}}}function nl(e,t,n){let i="baz",o="qux",l=null;async function u(){let f=navigator.userAgent.includes("Windows")?"https://customprotocol.test/example.html":"customprotocol://test/example.html";const _=await(await fetch(f,{method:"POST",body:JSON.stringify({foo:i,bar:o})})).json();n(2,l=JSON.stringify(_))}function c(){i=this.value,n(0,i)}function p(){o=this.value,n(1,o)}return[i,o,l,u,c,p]}class il extends J{constructor(t){super();K(this,t,nl,el,Y,{})}}function Do(e,t,n){const i=e.slice();return i[9]=t[n],i}function jo(e){let t,n=e[9].label+"",i,o,l,u,c;function p(){return e[7](e[9])}return{c(){t=s("p"),i=z(n),o=g(),a(t,"class",l="nv noselect "+(e[0]===e[9]?"nv_selected":""))},m(f,d){O(f,t,d),r(t,i),r(t,o),u||(c=T(t,"click",p),u=!0)},p(f,d){e=f,d&1&&l!==(l="nv noselect "+(e[0]===e[9]?"nv_selected":""))&&a(t,"class",l)},d(f){f&&W(t),u=!1,c()}}}function ol(e){let t,n,i,o,l,u,c,p,f,d,_,m,h,v,C,w,P,S,D,R,j,L,I,G=e[2],B=[];for(let F=0;FDocumentation Github Source`,c=g(),p=s("div"),f=s("div");for(let F=0;F{Yi(q,1)}),Bo()}Q?(m=new Q(tt(F)),$i(m.$$.fragment),Ki(m.$$.fragment,1),Vi(m,_,null)):m=null}(!j||rt&2)&&R.p(F[1])},i(F){j||(m&&Ki(m.$$.fragment,F),j=!0)},o(F){m&&Ji(m.$$.fragment,F),j=!1},d(F){F&&W(t),Ye(B,F),m&&Yi(m),L=!1,Z(I)}}}const rl="ctrl+b";function ll(e,t,n){he(()=>{Vo(rl,()=>{me("menu_toggle")})});const i=[{label:"Welcome",component:Qo},{label:"Messages",component:ir},{label:"CLI",component:tr},{label:"Dialog",component:br},{label:"File system",component:kr},{label:"HTTP",component:zr},{label:"HTTP Form",component:il},{label:"Notifications",component:Wr},{label:"Window",component:Rr},{label:"Shortcuts",component:Hr},{label:"Shell",component:$r},{label:"Updater",component:Kr},{label:"Clipboard",component:Qr},{label:"WebRTC",component:tl}];let o=i[0],l=Gi([]),u="";function c(m){n(0,o=m)}function p(m){l.update(h=>[`[${new Date().toLocaleTimeString()}]: `+(typeof m=="string"?m:JSON.stringify(m)),...h])}function f(){An("https://tauri.studio/")}return he(()=>{l.subscribe(m=>{n(1,u=m.join(` `))})}),[o,u,i,l,c,p,f,m=>c(m),()=>{l.update(()=>[])}]}class sl extends J{constructor(t){super();K(this,t,ll,ol,Y,{})}}new sl({target:document.body});