var Ql=Object.defineProperty,Zl=Object.defineProperties;var $l=Object.getOwnPropertyDescriptors;var hl=Object.getOwnPropertySymbols;var xl=Object.prototype.hasOwnProperty,ei=Object.prototype.propertyIsEnumerable;var ml=(n,e,l)=>e in n?Ql(n,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[e]=l,vl=(n,e)=>{for(var l in e||(e={}))xl.call(e,l)&&ml(n,l,e[l]);if(hl)for(var l of hl(e))ei.call(e,l)&&ml(n,l,e[l]);return n},_l=(n,e)=>Zl(n,$l(e));import{S as V,i as J,s as K,e as a,a as m,t as M,b as u,c as T,d as t,l as y,f as j,n as I,g as S,r as Q,h as ti,j as ni,o as li,k as ii,m as gl,p as si,q as Pt,u as bl,v as hn,w as mn,x as oi,y as H,z as wl,A as kl,B as ai,C as Wt,D as lt,E as yl,F as ui,G as ri,H as ci,I as Cl,J as Ut,K as pi,L as Ml,M as zl,N as F,O as Tl,P as vn,Q as _n,R as Sl,T as Ll,U as fi,V as di,W as El,X as Hl,Y as hi,Z as mi,_ as vi,$ as _i,a0 as gi,a1 as bi,a2 as wi,a3 as ki,a4 as Ol,a5 as Rl,a6 as Al,a7 as Pl,a8 as yi,a9 as Wl,aa as Ul,ab as Ci,ac as Mi,ad as zi}from"./vendor.js";const Ti=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function l(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerpolicy&&(o.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?o.credentials="include":s.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=l(s);fetch(s.href,o)}};Ti();function Si(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v,b,_,z,C,A,P,W;return{c(){e=a("h1"),e.textContent="Welcome",l=m(),i=a("p"),i.textContent="Tauri's API capabilities using the ` @tauri-apps/api ` package. It's used as\n the main validation app, serving as the testbed of our development process. In\n the future, this app will be used on Tauri's integration tests.",s=m(),o=a("p"),r=M("Current App version: "),c=M(n[0]),h=m(),d=a("p"),k=M("Current Tauri version: "),w=M(n[1]),f=m(),p=a("p"),v=M("Current App name: "),b=M(n[2]),_=m(),z=a("button"),z.textContent="Close application",C=m(),A=a("button"),A.textContent="Relaunch application",u(z,"class","button"),u(A,"class","button")},m(L,U){T(L,e,U),T(L,l,U),T(L,i,U),T(L,s,U),T(L,o,U),t(o,r),t(o,c),T(L,h,U),T(L,d,U),t(d,k),t(d,w),T(L,f,U),T(L,p,U),t(p,v),t(p,b),T(L,_,U),T(L,z,U),T(L,C,U),T(L,A,U),P||(W=[y(z,"click",n[3]),y(A,"click",n[4])],P=!0)},p(L,[U]){U&1&&j(c,L[0]),U&2&&j(w,L[1]),U&4&&j(b,L[2])},i:I,o:I,d(L){L&&S(e),L&&S(l),L&&S(i),L&&S(s),L&&S(o),L&&S(h),L&&S(d),L&&S(f),L&&S(p),L&&S(_),L&&S(z),L&&S(C),L&&S(A),P=!1,Q(W)}}}function Li(n,e,l){let i=0,s=0,o="Unknown";ti().then(h=>{l(2,o=h)}),ni().then(h=>{l(0,i=h)}),li().then(h=>{l(1,s=h)});async function r(){await ii()}async function c(){await gl()}return[i,s,o,r,c]}class Ei extends V{constructor(e){super();J(this,e,Li,Si,K,{})}}function Hi(n){let e,l,i,s,o,r,c,h,d,k,w;return{c(){e=a("div"),l=M(`This binary can be run on the terminal and takes the following arguments: `),i=a("ul"),i.innerHTML=`
  • --config PATH
  • --theme light|dark|system
  • --verbose
  • `,s=M(` Additionally, it has a `),o=a("i"),o.textContent="update --background",r=M(` subcommand. Note that the arguments are only parsed, not implemented. `),c=a("br"),h=m(),d=a("button"),d.textContent="Get matches",u(d,"class","button"),u(d,"id","cli-matches")},m(f,p){T(f,e,p),t(e,l),t(e,i),t(e,s),t(e,o),t(e,r),t(e,c),t(e,h),t(e,d),k||(w=y(d,"click",n[0]),k=!0)},p:I,i:I,o:I,d(f){f&&S(e),k=!1,w()}}}function Oi(n,e,l){let{onMessage:i}=e;function s(){si().then(i).catch(i)}return n.$$set=o=>{"onMessage"in o&&l(1,i=o.onMessage)},[s,i]}class Ri extends V{constructor(e){super();J(this,e,Oi,Hi,K,{onMessage:1})}}function Ai(n){let e,l,i,s,o,r,c,h;return{c(){e=a("div"),l=a("button"),l.textContent="Call Log API",i=m(),s=a("button"),s.textContent="Call Request (async) API",o=m(),r=a("button"),r.textContent="Send event to Rust",u(l,"class","button"),u(l,"id","log"),u(s,"class","button"),u(s,"id","request"),u(r,"class","button"),u(r,"id","event")},m(d,k){T(d,e,k),t(e,l),t(e,i),t(e,s),t(e,o),t(e,r),c||(h=[y(l,"click",n[0]),y(s,"click",n[1]),y(r,"click",n[2])],c=!0)},p:I,i:I,o:I,d(d){d&&S(e),c=!1,Q(h)}}}function Pi(n,e,l){let{onMessage:i}=e,s;Pt(async()=>{s=await bl("rust-event",i)}),hn(()=>{s&&s()});function o(){mn("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function r(){mn("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){oi("js-event","this is the payload string")}return n.$$set=h=>{"onMessage"in h&&l(3,i=h.onMessage)},[o,r,c,i]}class Wi extends V{constructor(e){super();J(this,e,Pi,Ai,K,{onMessage:3})}}function Ui(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v,b,_,z,C,A,P;return{c(){e=a("div"),l=a("input"),i=m(),s=a("input"),o=m(),r=a("div"),c=a("input"),h=m(),d=a("label"),d.textContent="Multiple",k=m(),w=a("div"),f=a("input"),p=m(),v=a("label"),v.textContent="Directory",b=m(),_=a("button"),_.textContent="Open dialog",z=m(),C=a("button"),C.textContent="Open save dialog",u(l,"id","dialog-default-path"),u(l,"placeholder","Default path"),u(s,"id","dialog-filter"),u(s,"placeholder","Extensions filter, comma-separated"),u(s,"class","svelte-1eg58yg"),u(c,"type","checkbox"),u(c,"id","dialog-multiple"),u(d,"for","dialog-multiple"),u(f,"type","checkbox"),u(f,"id","dialog-directory"),u(v,"for","dialog-directory"),u(_,"class","button"),u(_,"id","open-dialog"),u(C,"class","button"),u(C,"id","save-dialog")},m(W,L){T(W,e,L),t(e,l),H(l,n[0]),t(e,i),t(e,s),H(s,n[1]),t(e,o),t(e,r),t(r,c),c.checked=n[2],t(r,h),t(r,d),t(e,k),t(e,w),t(w,f),f.checked=n[3],t(w,p),t(w,v),t(e,b),t(e,_),t(e,z),t(e,C),A||(P=[y(l,"input",n[8]),y(s,"input",n[9]),y(c,"change",n[10]),y(f,"change",n[11]),y(_,"click",n[4]),y(C,"click",n[5])],A=!0)},p(W,[L]){L&1&&l.value!==W[0]&&H(l,W[0]),L&2&&s.value!==W[1]&&H(s,W[1]),L&4&&(c.checked=W[2]),L&8&&(f.checked=W[3])},i:I,o:I,d(W){W&&S(e),A=!1,Q(P)}}}function Ii(n,e){var l=new Blob([n],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(s){var o=s.target.result;e(o.substr(o.indexOf(",")+1))},i.readAsDataURL(l)}function Ni(n,e,l){let{onMessage:i}=e,{insecureRenderHtml:s}=e,o=null,r=null,c=!1,h=!1;function d(){wl({title:"My wonderful open dialog",defaultPath:o,filters:r?[{name:"Tauri Example",extensions:r.split(",").map(b=>b.trim())}]:[],multiple:c,directory:h}).then(function(b){if(Array.isArray(b))i(b);else{var _=b,z=_.match(/\S+\.\S+$/g);kl(_).then(function(C){z&&(_.includes(".png")||_.includes(".jpg"))?Ii(new Uint8Array(C),function(A){var P="data:image/png;base64,"+A;s('')}):i(b)}).catch(i(b))}}).catch(i)}function k(){ai({title:"My wonderful save dialog",defaultPath:o,filters:r?[{name:"Tauri Example",extensions:r.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function w(){o=this.value,l(0,o)}function f(){r=this.value,l(1,r)}function p(){c=this.checked,l(2,c)}function v(){h=this.checked,l(3,h)}return n.$$set=b=>{"onMessage"in b&&l(6,i=b.onMessage),"insecureRenderHtml"in b&&l(7,s=b.insecureRenderHtml)},[o,r,c,h,d,k,i,s,w,f,p,v]}class qi extends V{constructor(e){super();J(this,e,Ni,Ui,K,{onMessage:6,insecureRenderHtml:7})}}function Il(n,e,l){const i=n.slice();return i[9]=e[l],i}function Nl(n){let e,l=n[9][0]+"",i,s;return{c(){e=a("option"),i=M(l),e.__value=s=n[9][1],e.value=e.__value},m(o,r){T(o,e,r),t(e,i)},p:I,d(o){o&&S(e)}}}function Di(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v=n[2],b=[];for(let _=0;_isNaN(parseInt(f))).map(f=>[f,yl[f]]);function h(){const f=o.match(/\S+\.\S+$/g),p={dir:ql()};(f?kl(o,p):ui(o,p)).then(function(b){if(f)if(o.includes(".png")||o.includes(".jpg"))ji(new Uint8Array(b),function(_){const z="data:image/png;base64,"+_;s('')});else{const _=String.fromCharCode.apply(null,b);s(''),setTimeout(()=>{const z=document.getElementById("file-response");z.value=_,document.getElementById("file-save").addEventListener("click",function(){writeFile({file:o,contents:z.value},{dir:ql()}).catch(i)})})}else i(b)}).catch(i)}function d(){l(1,r.src=ri(o),r)}function k(){o=this.value,l(0,o)}function w(f){ci[f?"unshift":"push"](()=>{r=f,l(1,r)})}return n.$$set=f=>{"onMessage"in f&&l(5,i=f.onMessage),"insecureRenderHtml"in f&&l(6,s=f.insecureRenderHtml)},[o,r,c,h,d,i,s,k,w]}class Fi extends V{constructor(e){super();J(this,e,Bi,Di,K,{onMessage:5,insecureRenderHtml:6})}}function Gi(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v,b,_,z;return{c(){e=a("form"),l=a("select"),i=a("option"),i.textContent="GET",s=a("option"),s.textContent="POST",o=a("option"),o.textContent="PUT",r=a("option"),r.textContent="PATCH",c=a("option"),c.textContent="DELETE",h=m(),d=a("input"),k=m(),w=a("br"),f=m(),p=a("textarea"),v=m(),b=a("button"),b.textContent="Make request",i.__value="GET",i.value=i.__value,s.__value="POST",s.value=s.__value,o.__value="PUT",o.value=o.__value,r.__value="PATCH",r.value=r.__value,c.__value="DELETE",c.value=c.__value,u(l,"class","button"),u(l,"id","request-method"),n[0]===void 0&&Cl(()=>n[5].call(l)),u(d,"id","request-url"),u(d,"placeholder","Type the request URL..."),u(p,"id","request-body"),u(p,"placeholder","Request body"),u(p,"rows","5"),u(p,"class","svelte-1xfmj7b"),u(b,"class","button"),u(b,"id","make-request")},m(C,A){T(C,e,A),t(e,l),t(l,i),t(l,s),t(l,o),t(l,r),t(l,c),Ut(l,n[0]),t(e,h),t(e,d),H(d,n[1]),t(e,k),t(e,w),t(e,f),t(e,p),H(p,n[2]),t(e,v),t(e,b),_||(z=[y(l,"change",n[5]),y(d,"input",n[6]),y(p,"input",n[7]),y(e,"submit",Wt(n[3]))],_=!0)},p(C,[A]){A&1&&Ut(l,C[0]),A&2&&d.value!==C[1]&&H(d,C[1]),A&4&&H(p,C[2])},i:I,o:I,d(C){C&&S(e),_=!1,Q(z)}}}function Vi(n,e,l){let i="GET",s="https://jsonplaceholder.typicode.com/todos/1",o="",{onMessage:r}=e;async function c(){const w=await pi().catch(b=>{throw r(b),b}),v={url:s||""||"",method:i||"GET"||"GET"};o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]")?v.body=Ml.json(JSON.parse(o)):o!==""&&(v.body=Ml.text(o)),w.request(v).then(r).catch(r)}function h(){i=zl(this),l(0,i)}function d(){s=this.value,l(1,s)}function k(){o=this.value,l(2,o)}return n.$$set=w=>{"onMessage"in w&&l(4,r=w.onMessage)},[i,s,o,c,r,h,d,k]}class Ji extends V{constructor(e){super();J(this,e,Vi,Gi,K,{onMessage:4})}}function Ki(n){let e,l,i;return{c(){e=a("button"),e.textContent="Send test notification",u(e,"class","button"),u(e,"id","notification")},m(s,o){T(s,e,o),l||(i=y(e,"click",Xi),l=!0)},p:I,i:I,o:I,d(s){s&&S(e),l=!1,i()}}}function Xi(){new Notification("Notification title",{body:"This is the notification body"})}function Yi(n,e,l){let{onMessage:i}=e;return n.$$set=s=>{"onMessage"in s&&l(0,i=s.onMessage)},[i]}class Qi extends V{constructor(e){super();J(this,e,Yi,Ki,K,{onMessage:0})}}function Dl(n,e,l){const i=n.slice();return i[54]=e[l],i}function jl(n){let e,l=n[54]+"",i,s;return{c(){e=a("option"),i=M(l),e.__value=s=n[54],e.value=e.__value},m(o,r){T(o,e,r),t(e,i)},p(o,r){r[0]&2&&l!==(l=o[54]+"")&&j(i,l),r[0]&2&&s!==(s=o[54])&&(e.__value=s,e.value=e.__value)},d(o){o&&S(e)}}}function Zi(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v,b,_,z,C,A,P,W,L,U,q,Z,se,G,D,R,x,O,X,it,st,Te,ot,Ne,$,ue,Se,at,ee,ut,Le,rt,te,ct,re,Ee,pt,ne,ft,He,dt,le,ht,N,ye,gn,ce,bn,mt,wn,pe,kn,Oe,vt,yn,oe,Cn,_t,Mn,ae,It,ie,Re,fe,Nt,zn,qe,Tn,gt=n[20].width+"",qt,Sn,De,Ln,bt=n[20].height+"",Dt,En,de,jt,Hn,je,On,wt=n[21].width+"",Bt,Rn,Be,An,kt=n[21].height+"",Ft,Pn,Ae,he,Gt,Wn,Fe,Un,yt=n[20].toLogical(n[17]).width+"",Vt,In,Ge,Nn,Ct=n[20].toLogical(n[17]).height+"",Jt,qn,me,Kt,Dn,Ve,jn,Mt=n[21].toLogical(n[17]).width+"",Xt,Bn,Je,Fn,zt=n[21].toLogical(n[17]).height+"",Yt,Gn,Pe,ve,Qt,Vn,Ke,Jn,Tt=n[18].x+"",Zt,Kn,Xe,Xn,St=n[18].y+"",$t,Yn,_e,xt,Qn,Ye,Zn,Lt=n[19].x+"",en,$n,Qe,xn,Et=n[19].y+"",tn,el,We,ge,nn,tl,Ze,nl,Ht=n[18].toLogical(n[17]).x+"",ln,ll,$e,il,Ot=n[18].toLogical(n[17]).y+"",sn,sl,be,on,ol,xe,al,Rt=n[19].toLogical(n[17]).x+"",an,ul,et,rl,At=n[19].toLogical(n[17]).y+"",un,rn,we,Ce,cl,tt,cn,ke,Me,pl,nt,pn,ze,fn,Ue,dn,fl,Ie=Object.keys(n[1]),Y=[];for(let g=0;gn[31].call(l)),u(r,"type","checkbox"),u(k,"type","checkbox"),u(p,"title","Unminimizes after 2 seconds"),u(b,"title","Unminimizes after 2 seconds"),u(z,"title","Visible again after 2 seconds"),u(P,"type","checkbox"),u(q,"type","checkbox"),u(D,"type","checkbox"),u(X,"type","checkbox"),u(ee,"type","number"),u(ee,"min","0"),u(ee,"class","svelte-1tppwwz"),u(te,"type","number"),u(te,"min","0"),u(te,"class","svelte-1tppwwz"),u(ue,"class","flex col grow svelte-1tppwwz"),u(ne,"type","number"),u(ne,"min","400"),u(ne,"class","svelte-1tppwwz"),u(le,"type","number"),u(le,"min","400"),u(le,"class","svelte-1tppwwz"),u(re,"class","flex col grow svelte-1tppwwz"),u(ce,"type","number"),u(ce,"class","svelte-1tppwwz"),u(pe,"type","number"),u(pe,"class","svelte-1tppwwz"),u(N,"class","flex col grow svelte-1tppwwz"),u(oe,"type","number"),u(oe,"min","400"),u(oe,"class","svelte-1tppwwz"),u(ae,"type","number"),u(ae,"min","400"),u(ae,"class","svelte-1tppwwz"),u(Oe,"class","flex col grow svelte-1tppwwz"),u($,"class","window-controls flex flex-row svelte-1tppwwz"),u(e,"class","flex col"),u(qe,"class","svelte-1tppwwz"),u(De,"class","svelte-1tppwwz"),u(fe,"class","grow window-property svelte-1tppwwz"),u(je,"class","svelte-1tppwwz"),u(Be,"class","svelte-1tppwwz"),u(de,"class","grow window-property svelte-1tppwwz"),u(Re,"class","flex"),u(Fe,"class","svelte-1tppwwz"),u(Ge,"class","svelte-1tppwwz"),u(he,"class","grow window-property svelte-1tppwwz"),u(Ve,"class","svelte-1tppwwz"),u(Je,"class","svelte-1tppwwz"),u(me,"class","grow window-property svelte-1tppwwz"),u(Ae,"class","flex"),u(Ke,"class","svelte-1tppwwz"),u(Xe,"class","svelte-1tppwwz"),u(ve,"class","grow window-property svelte-1tppwwz"),u(Ye,"class","svelte-1tppwwz"),u(Qe,"class","svelte-1tppwwz"),u(_e,"class","grow window-property svelte-1tppwwz"),u(Pe,"class","flex"),u(Ze,"class","svelte-1tppwwz"),u($e,"class","svelte-1tppwwz"),u(ge,"class","grow window-property svelte-1tppwwz"),u(xe,"class","svelte-1tppwwz"),u(et,"class","svelte-1tppwwz"),u(be,"class","grow window-property svelte-1tppwwz"),u(We,"class","flex"),u(Ce,"id","title"),u(tt,"class","button"),u(tt,"type","submit"),u(we,"class","svelte-1tppwwz"),u(Me,"id","url"),u(nt,"class","button"),u(nt,"id","open-url"),u(ke,"class","svelte-1tppwwz"),u(ze,"class","button"),u(ze,"title","Minimizes the window, requests attention for 3s and then resets it"),u(Ue,"class","button")},m(g,E){T(g,e,E),t(e,l);for(let B=0;B{typeof N=="string"&&s[i].setIcon(N)})}function st(){const N=Math.random().toString().replace(".",""),ye=new fi(N);l(1,s[N]=ye,s),ye.once("tauri://error",function(){o("Error creating new webview")})}function Te(){s[i].innerSize().then(N=>{l(20,q=N),l(7,p=q.width),l(8,v=q.height)}),s[i].outerSize().then(N=>{l(21,Z=N)})}function ot(){s[i].innerPosition().then(N=>{l(18,L=N)}),s[i].outerPosition().then(N=>{l(19,U=N),l(13,A=U.x),l(14,P=U.y)})}async function Ne(N){se&&se(),G&&G(),G=await N.listen("tauri://move",ot),se=await N.listen("tauri://resize",Te)}async function $(){await s[i].minimize(),await s[i].requestUserAttention(di.Critical),await new Promise(N=>setTimeout(N,3e3)),await s[i].requestUserAttention(null)}function ue(){i=zl(this),l(0,i),l(1,s)}function Se(){c=this.checked,l(2,c)}function at(){h=this.checked,l(3,h)}const ee=()=>s[i].center();function ut(){d=this.checked,l(16,d)}function Le(){k=this.checked,l(4,k)}function rt(){w=this.checked,l(5,w)}function te(){f=this.checked,l(6,f)}function ct(){A=F(this.value),l(13,A)}function re(){P=F(this.value),l(14,P)}function Ee(){p=F(this.value),l(7,p)}function pt(){v=F(this.value),l(8,v)}function ne(){b=F(this.value),l(9,b)}function ft(){_=F(this.value),l(10,_)}function He(){z=F(this.value),l(11,z)}function dt(){C=F(this.value),l(12,C)}function le(){D=this.value,l(22,D)}function ht(){r=this.value,l(15,r)}return n.$$set=N=>{"onMessage"in N&&l(30,o=N.onMessage)},n.$$.update=()=>{n.$$.dirty[0]&7&&s[i].setResizable(c),n.$$.dirty[0]&11&&(h?s[i].maximize():s[i].unmaximize()),n.$$.dirty[0]&19&&s[i].setDecorations(k),n.$$.dirty[0]&35&&s[i].setAlwaysOnTop(w),n.$$.dirty[0]&67&&s[i].setFullscreen(f),n.$$.dirty[0]&387&&s[i].setSize(new _n(p,v)),n.$$.dirty[0]&1539&&(b&&_?s[i].setMinSize(new Sl(b,_)):s[i].setMinSize(null)),n.$$.dirty[0]&6147&&(z&&C?s[i].setMaxSize(new Sl(z,C)):s[i].setMaxSize(null)),n.$$.dirty[0]&24579&&s[i].setPosition(new vn(A,P)),n.$$.dirty[0]&3&&s[i].scaleFactor().then(N=>l(17,W=N)),n.$$.dirty[0]&3&&Ne(s[i])},[i,s,c,h,k,w,f,p,v,b,_,z,C,A,P,r,d,W,L,U,q,Z,D,R,x,O,X,it,st,$,o,ue,Se,at,ee,ut,Le,rt,te,ct,re,Ee,pt,ne,ft,He,dt,le,ht]}class xi extends V{constructor(e){super();J(this,e,$i,Zi,K,{onMessage:30},[-1,-1])}}function Bl(n,e,l){const i=n.slice();return i[9]=e[l],i}function Fl(n){let e,l=n[9]+"",i,s,o,r,c;function h(){return n[8](n[9])}return{c(){e=a("div"),i=M(l),s=m(),o=a("button"),o.textContent="Unregister",u(o,"type","button")},m(d,k){T(d,e,k),t(e,i),t(e,s),t(e,o),r||(c=y(o,"click",h),r=!0)},p(d,k){n=d,k&2&&l!==(l=n[9]+"")&&j(i,l)},d(d){d&&S(e),r=!1,c()}}}function Gl(n){let e,l,i;return{c(){e=a("button"),e.textContent="Unregister all",u(e,"type","button")},m(s,o){T(s,e,o),l||(i=y(e,"click",n[5]),l=!0)},p:I,d(s){s&&S(e),l=!1,i()}}}function es(n){let e,l,i,s,o,r,c,h,d,k,w=n[1],f=[];for(let v=0;vl(1,i=f));let r="CmdOrControl+X";function c(){const f=r;hi(f,()=>{s(`Shortcut ${f} triggered`)}).then(()=>{o.update(p=>[...p,f]),s(`Shortcut ${f} registered successfully`)}).catch(s)}function h(f){const p=f;mi(p).then(()=>{o.update(v=>v.filter(b=>b!==p)),s(`Shortcut ${p} unregistered`)}).catch(s)}function d(){vi().then(()=>{o.update(()=>[]),s("Unregistered all shortcuts")}).catch(s)}function k(){r=this.value,l(0,r)}const w=f=>h(f);return n.$$set=f=>{"onMessage"in f&&l(6,s=f.onMessage)},[r,i,o,c,h,d,s,k,w]}class ns extends V{constructor(e){super();J(this,e,ts,es,K,{onMessage:6})}}function Vl(n){let e,l,i,s,o;return{c(){e=a("input"),l=m(),i=a("button"),i.textContent="Write",u(e,"placeholder","write to stdin"),u(i,"class","button")},m(r,c){T(r,e,c),H(e,n[3]),T(r,l,c),T(r,i,c),s||(o=[y(e,"input",n[10]),y(i,"click",n[7])],s=!0)},p(r,c){c&8&&e.value!==r[3]&&H(e,r[3])},d(r){r&&S(e),r&&S(l),r&&S(i),s=!1,Q(o)}}}function ls(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v,b,_=n[4]&&Vl(n);return{c(){e=a("div"),l=a("div"),i=a("input"),s=m(),o=a("button"),o.textContent="Run",r=m(),c=a("button"),c.textContent="Kill",h=m(),_&&_.c(),d=m(),k=a("div"),w=a("input"),f=m(),p=a("input"),u(o,"class","button"),u(c,"class","button"),u(w,"placeholder","Working directory"),u(p,"class","env-vars svelte-1g38c1n"),u(p,"placeholder","Environment variables")},m(z,C){T(z,e,C),t(e,l),t(l,i),H(i,n[0]),t(l,s),t(l,o),t(l,r),t(l,c),t(l,h),_&&_.m(l,null),t(e,d),t(e,k),t(k,w),H(w,n[1]),t(k,f),t(k,p),H(p,n[2]),v||(b=[y(i,"input",n[9]),y(o,"click",n[5]),y(c,"click",n[6]),y(w,"input",n[11]),y(p,"input",n[12])],v=!0)},p(z,[C]){C&1&&i.value!==z[0]&&H(i,z[0]),z[4]?_?_.p(z,C):(_=Vl(z),_.c(),_.m(l,null)):_&&(_.d(1),_=null),C&2&&w.value!==z[1]&&H(w,z[1]),C&4&&p.value!==z[2]&&H(p,z[2])},i:I,o:I,d(z){z&&S(e),_&&_.d(),v=!1,Q(b)}}}function is(n,e,l){const i=navigator.userAgent.includes("Windows");let s=i?"cmd":"sh",o=i?["/C"]:["-c"],{onMessage:r}=e,c='echo "hello world"',h=null,d="SOMETHING=value ANOTHER=2",k="",w;function f(){return d.split(" ").reduce((P,W)=>{let[L,U]=W.split("=");return _l(vl({},P),{[L]:U})},{})}function p(){l(4,w=null);const P=new _i(s,[...o,c],{cwd:h||null,env:f()});P.on("close",W=>{r(`command finished with code ${W.code} and signal ${W.signal}`),l(4,w=null)}),P.on("error",W=>r(`command error: "${W}"`)),P.stdout.on("data",W=>r(`command stdout: "${W}"`)),P.stderr.on("data",W=>r(`command stderr: "${W}"`)),P.spawn().then(W=>{l(4,w=W)}).catch(r)}function v(){w.kill().then(()=>r("killed child process")).catch(r)}function b(){w.write(k).catch(r)}function _(){c=this.value,l(0,c)}function z(){k=this.value,l(3,k)}function C(){h=this.value,l(1,h)}function A(){d=this.value,l(2,d)}return n.$$set=P=>{"onMessage"in P&&l(8,r=P.onMessage)},[c,h,d,k,w,p,v,b,r,_,z,C,A]}class ss extends V{constructor(e){super();J(this,e,is,ls,K,{onMessage:8})}}function os(n){let e,l,i,s,o,r;return{c(){e=a("div"),l=a("button"),l.textContent="Check update",i=m(),s=a("button"),s.textContent="Install update",u(l,"class","button"),u(l,"id","check_update"),u(s,"class","button hidden"),u(s,"id","start_update")},m(c,h){T(c,e,h),t(e,l),t(e,i),t(e,s),o||(r=[y(l,"click",n[0]),y(s,"click",n[1])],o=!0)},p:I,i:I,o:I,d(c){c&&S(e),o=!1,Q(r)}}}function as(n,e,l){let{onMessage:i}=e,s;Pt(async()=>{s=await bl("tauri://update-status",i)}),hn(()=>{s&&s()});async function o(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:c,manifest:h}=await gi();i(`Should update: ${c}`),i(h),c&&document.getElementById("start_update").classList.remove("hidden")}catch(c){i(c)}}async function r(){try{document.getElementById("start_update").classList.add("hidden"),await bi(),i("Installation complete, restart required."),await gl()}catch(c){i(c)}}return n.$$set=c=>{"onMessage"in c&&l(2,i=c.onMessage)},[o,r,i]}class us extends V{constructor(e){super();J(this,e,as,os,K,{onMessage:2})}}function rs(n){let e,l,i,s,o,r,c,h,d;return{c(){e=a("div"),l=a("div"),i=a("input"),s=m(),o=a("button"),o.textContent="Write",r=m(),c=a("button"),c.textContent="Read",u(i,"placeholder","Text to write to the clipboard"),u(o,"type","button"),u(c,"type","button")},m(k,w){T(k,e,w),t(e,l),t(l,i),H(i,n[0]),t(l,s),t(l,o),t(e,r),t(e,c),h||(d=[y(i,"input",n[4]),y(o,"click",n[1]),y(c,"click",n[2])],h=!0)},p(k,[w]){w&1&&i.value!==k[0]&&H(i,k[0])},i:I,o:I,d(k){k&&S(e),h=!1,Q(d)}}}function cs(n,e,l){let{onMessage:i}=e,s="clipboard message";function o(){wi(s).then(()=>{i("Wrote to the clipboard")}).catch(i)}function r(){ki().then(h=>{i(`Clipboard contents: ${h}`)}).catch(i)}function c(){s=this.value,l(0,s)}return n.$$set=h=>{"onMessage"in h&&l(3,i=h.onMessage)},[s,o,r,i,c]}class ps extends V{constructor(e){super();J(this,e,cs,rs,K,{onMessage:3})}}function fs(n){let e;return{c(){e=a("div"),e.innerHTML=`

    Not available for Linux

    `},m(l,i){T(l,e,i)},p:I,i:I,o:I,d(l){l&&S(e)}}}function ds(n,e,l){let{onMessage:i}=e;const s=window.constraints={audio:!0,video:!0};function o(c){const h=document.querySelector("video"),d=c.getVideoTracks();i("Got stream with constraints:",s),i(`Using video device: ${d[0].label}`),window.stream=c,h.srcObject=c}function r(c){if(c.name==="ConstraintNotSatisfiedError"){const h=s.video;i(`The resolution ${h.width.exact}x${h.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 Pt(async()=>{try{const c=await navigator.mediaDevices.getUserMedia(s);o(c)}catch(c){r(c)}}),hn(()=>{window.stream.getTracks().forEach(function(c){c.stop()})}),n.$$set=c=>{"onMessage"in c&&l(0,i=c.onMessage)},[i]}class hs extends V{constructor(e){super();J(this,e,ds,fs,K,{onMessage:0})}}function ms(n){let e,l,i,s,o,r,c,h,d,k,w,f;return{c(){e=a("input"),l=m(),i=a("input"),s=m(),o=a("button"),o.textContent="Post it.",r=m(),c=a("p"),c.textContent="Result:",h=m(),d=a("pre"),k=M(n[2]),u(o,"type","button")},m(p,v){T(p,e,v),H(e,n[0]),T(p,l,v),T(p,i,v),H(i,n[1]),T(p,s,v),T(p,o,v),T(p,r,v),T(p,c,v),T(p,h,v),T(p,d,v),t(d,k),w||(f=[y(e,"input",n[4]),y(i,"input",n[5]),y(o,"click",n[3])],w=!0)},p(p,[v]){v&1&&e.value!==p[0]&&H(e,p[0]),v&2&&i.value!==p[1]&&H(i,p[1]),v&4&&j(k,p[2])},i:I,o:I,d(p){p&&S(e),p&&S(l),p&&S(i),p&&S(s),p&&S(o),p&&S(r),p&&S(c),p&&S(h),p&&S(d),w=!1,Q(f)}}}function vs(n,e,l){let i="baz",s="qux",o=null;async function r(){let d=navigator.userAgent.includes("Windows")?"https://customprotocol.test/example.html":"customprotocol://test/example.html";const w=await(await fetch(d,{method:"POST",body:JSON.stringify({foo:i,bar:s})})).json();l(2,o=JSON.stringify(w))}function c(){i=this.value,l(0,i)}function h(){s=this.value,l(1,s)}return[i,s,o,r,c,h]}class _s extends V{constructor(e){super();J(this,e,vs,ms,K,{})}}function Jl(n,e,l){const i=n.slice();return i[10]=e[l],i}function Kl(n,e,l){const i=n.slice();return i[13]=e[l],i}function Xl(n){let e,l=n[13].label+"",i,s,o,r,c;function h(){return n[9](n[13])}return{c(){e=a("p"),i=M(l),s=m(),u(e,"class",o="nv noselect "+(n[0]===n[13]?"nv_selected":""))},m(d,k){T(d,e,k),t(e,i),t(e,s),r||(c=y(e,"click",h),r=!0)},p(d,k){n=d,k&1&&o!==(o="nv noselect "+(n[0]===n[13]?"nv_selected":""))&&u(e,"class",o)},d(d){d&&S(e),r=!1,c()}}}function gs(n){let e,l=n[10].html+"",i;return{c(){i=Ol(),e=new zi(i)},m(s,o){e.m(l,s,o),T(s,i,o)},p(s,o){o&2&&l!==(l=s[10].html+"")&&e.p(l)},d(s){s&&S(i),s&&e.d()}}}function bs(n){let e,l=n[10].text+"",i;return{c(){e=a("p"),i=M(l)},m(s,o){T(s,e,o),t(e,i)},p(s,o){o&2&&l!==(l=s[10].text+"")&&j(i,l)},d(s){s&&S(e)}}}function Yl(n){let e;function l(o,r){return o[10].text?bs:gs}let i=l(n),s=i(n);return{c(){s.c(),e=Ol()},m(o,r){s.m(o,r),T(o,e,r)},p(o,r){i===(i=l(o))&&s?s.p(o,r):(s.d(1),s=i(o),s&&(s.c(),s.m(e.parentNode,e)))},d(o){s.d(o),o&&S(e)}}}function ws(n){let e,l,i,s,o,r,c,h,d,k,w,f,p,v,b,_,z,C,A,P,W,L,U=n[2],q=[];for(let R=0;RDocumentation Github Source`,c=m(),h=a("div"),d=a("div");for(let R=0;R{Ul(O,1)}),yi()}Z?(f=new Z(se(R)),Rl(f.$$.fragment),Wl(f.$$.fragment,1),Al(f,w,null)):f=null}if(x&2){G=R[1];let O;for(O=0;O{Mi(ks,()=>{mn("menu_toggle")})});const s=[{label:"Welcome",component:Ei},{label:"Messages",component:Wi},{label:"CLI",component:Ri},{label:"Dialog",component:qi},{label:"File system",component:Fi},{label:"HTTP",component:Ji},{label:"HTTP Form",component:_s},{label:"Notifications",component:Qi},{label:"Window",component:xi},{label:"Shortcuts",component:ns},{label:"Shell",component:ss},{label:"Updater",component:us},{label:"Clipboard",component:ps},{label:"WebRTC",component:hs}];let o=s[0],r=Hl([]);El(n,r,p=>l(1,i=p));function c(p){l(0,o=p)}function h(p){r.update(v=>[{text:`[${new Date().toLocaleTimeString()}]: `+(typeof p=="string"?p:JSON.stringify(p))},...v])}function d(p){r.update(v=>[{html:p},...v])}function k(){r.update(()=>[])}function w(){Ll("https://tauri.studio/")}return[o,i,s,r,c,h,d,k,w,p=>c(p)]}class Cs extends V{constructor(e){super();J(this,e,ys,ws,K,{})}}new Cs({target:document.body});