(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const h of a.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerpolicy&&(a.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?a.credentials="include":r.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();function $(){}function rt(e){return e()}function Ge(){return Object.create(null)}function F(e){e.forEach(rt)}function pt(e){return typeof e=="function"}function ue(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let be;function gt(e,t){return be||(be=document.createElement("a")),be.href=t,e===be.href}function _t(e){return Object.keys(e).length===0}function vt(e,...t){if(e==null)return $;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function bt(e,t,n){e.$$.on_destroy.push(vt(t,n))}function o(e,t){e.appendChild(t)}function k(e,t,n){e.insertBefore(t,n||null)}function w(e){e.parentNode.removeChild(e)}function Xe(e,t){for(let n=0;ne.removeEventListener(t,n,i)}function l(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function wt(e){return Array.from(e.childNodes)}function kt(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}class Et{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,i=null){this.e||(this.is_svg?this.e=yt(n.nodeName):this.e=f(n.nodeName),this.t=n,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let n=0;n{ke.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function Ke(e){e&&e.c()}function Ne(e,t,n,i){const{fragment:r,on_mount:a,on_destroy:h,after_update:c}=e.$$;r&&r.m(t,n),i||We(()=>{const u=a.map(rt).filter(pt);h?h.push(...u):F(u),e.$$.on_mount=[]}),c.forEach(We)}function Ae(e,t){const n=e.$$;n.fragment!==null&&(F(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Dt(e,t){e.$$.dirty[0]===-1&&(le.push(e),xt(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const S=R.length?R[0]:O;return d.ctx&&r(d.ctx[v],d.ctx[v]=S)&&(!d.skip_bound&&d.bound[v]&&d.bound[v](S),E&&Dt(e,v)),O}):[],d.update(),E=!0,F(d.before_update),d.fragment=i?i(d.ctx):!1,t.target){if(t.hydrate){const v=wt(t.target);d.fragment&&d.fragment.l(v),v.forEach(w)}else d.fragment&&d.fragment.c();t.intro&&Ie(e.$$.fragment),Ne(e,t.target,t.anchor,t.customElement),ct()}ce(u)}class Oe{$destroy(){Ae(this,1),this.$destroy=$}$on(t,n){const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!_t(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const J=[];function Tt(e,t=$){let n;const i=new Set;function r(c){if(ue(e,c)&&(e=c,n)){const u=!J.length;for(const d of i)d[1](),J.push(d,e);if(u){for(let d=0;d{i.delete(d),i.size===0&&(n(),n=null)}}return{set:r,update:a,subscribe:h}}function Ct(e){let t;return{c(){t=f("p"),t.innerHTML=`This is a demo of Tauri's API capabilities using the @tauri-apps/api package. It's used as the main validation app, serving as the test bed of our development process. In the future, this app will be used on Tauri's integration tests.`},m(n,i){k(n,t,i)},p:$,i:$,o:$,d(n){n&&w(t)}}}class Mt extends Oe{constructor(t){super(),Le(this,t,null,Ct,ue,{})}}var Wt=Object.defineProperty,at=(e,t)=>{for(var n in t)Wt(e,n,{get:t[n],enumerable:!0})},It={};at(It,{convertFileSrc:()=>At,invoke:()=>xe,transformCallback:()=>$e});function Nt(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function $e(e,t=!1){let n=Nt(),i=`_${n}`;return Object.defineProperty(window,i,{value:r=>(t&&Reflect.deleteProperty(window,i),e==null?void 0:e(r)),writable:!1,configurable:!0}),n}async function xe(e,t={}){return new Promise((n,i)=>{let r=$e(h=>{n(h),Reflect.deleteProperty(window,`_${a}`)},!0),a=$e(h=>{i(h),Reflect.deleteProperty(window,`_${r}`)},!0);window.__TAURI_IPC__({cmd:e,callback:r,error:a,...t})})}function At(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}var Pt={};at(Pt,{TauriEvent:()=>ft,emit:()=>ht,listen:()=>mt,once:()=>qt});async function Pe(e){return xe("tauri",e)}async function ut(e,t){return Pe({__tauriModule:"Event",message:{cmd:"unlisten",event:e,eventId:t}})}async function Rt(e,t,n){await Pe({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:n}})}async function dt(e,t,n){return Pe({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:$e(n)}}).then(i=>async()=>ut(e,i))}async function Ht(e,t,n){return dt(e,t,i=>{n(i),ut(e,i.id).catch(()=>{})})}var ft=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e))(ft||{});async function mt(e,t){return dt(e,null,t)}async function qt(e,t){return Ht(e,null,t)}async function ht(e,t){return Rt(e,void 0,t)}function jt(e){let t,n,i,r,a,h,c,u;return{c(){t=f("div"),n=f("button"),n.textContent="Call Log API",i=g(),r=f("button"),r.textContent="Call Request (async) API",a=g(),h=f("button"),h.textContent="Send event to Rust",l(n,"class","btn"),l(n,"id","log"),l(r,"class","btn"),l(r,"id","request"),l(h,"class","btn"),l(h,"id","event")},m(d,E){k(d,t,E),o(t,n),o(t,i),o(t,r),o(t,a),o(t,h),c||(u=[z(n,"click",e[0]),z(r,"click",e[1]),z(h,"click",e[2])],c=!0)},p:$,i:$,o:$,d(d){d&&w(t),c=!1,F(u)}}}function Ut(e,t,n){let{onMessage:i}=t,r;Ee(async()=>{r=await mt("rust-event",i)}),lt(()=>{r&&r()});function a(){xe("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function h(){xe("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function c(){ht("js-event","this is the payload string")}return e.$$set=u=>{"onMessage"in u&&n(3,i=u.onMessage)},[a,h,c,i]}class zt extends Oe{constructor(t){super(),Le(this,t,Ut,jt,ue,{onMessage:3})}}function Ft(e){let t;return{c(){t=f("div"),t.innerHTML=`
Not available for Linux
`,l(t,"class","flex flex-col gap-2")},m(n,i){k(n,t,i)},p:$,i:$,o:$,d(n){n&&w(t)}}}function Vt(e,t,n){let{onMessage:i}=t;const r=window.constraints={audio:!0,video:!0};function a(c){const u=document.querySelector("video"),d=c.getVideoTracks();i("Got stream with constraints:",r),i(`Using video device: ${d[0].label}`),window.stream=c,u.srcObject=c}function h(c){if(c.name==="ConstraintNotSatisfiedError"){const u=r.video;i(`The resolution ${u.width.exact}x${u.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 Ee(async()=>{try{const c=await navigator.mediaDevices.getUserMedia(r);a(c)}catch(c){h(c)}}),lt(()=>{window.stream.getTracks().forEach(function(c){c.stop()})}),e.$$set=c=>{"onMessage"in c&&n(0,i=c.onMessage)},[i]}class Bt extends Oe{constructor(t){super(),Le(this,t,Vt,Ft,ue,{onMessage:0})}}function Qe(e,t,n){const i=e.slice();return i[25]=t[n],i}function Ze(e,t,n){const i=e.slice();return i[28]=t[n],i}function Gt(e){let t;return{c(){t=f("span"),l(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){k(n,t,i)},d(n){n&&w(t)}}}function Xt(e){let t;return{c(){t=f("span"),l(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){k(n,t,i)},d(n){n&&w(t)}}}function Yt(e){let t,n;return{c(){t=K(`Switch to Dark mode `),n=f("div"),l(n,"class","i-ph-moon")},m(i,r){k(i,t,r),k(i,n,r)},d(i){i&&w(t),i&&w(n)}}}function Jt(e){let t,n;return{c(){t=K(`Switch to Light mode `),n=f("div"),l(n,"class","i-ph-sun")},m(i,r){k(i,t,r),k(i,n,r)},d(i){i&&w(t),i&&w(n)}}}function Kt(e){let t,n,i,r,a=e[28].label+"",h,c,u,d;function E(){return e[14](e[28])}return{c(){t=f("a"),n=f("div"),i=g(),r=f("p"),h=K(a),l(n,"class",e[28].icon+" mr-2"),l(t,"href","##"),l(t,"class",c="nv "+(e[1]===e[28]?"nv_selected":""))},m(v,O){k(v,t,O),o(t,n),o(t,i),o(t,r),o(r,h),u||(d=z(t,"click",E),u=!0)},p(v,O){e=v,O&2&&c!==(c="nv "+(e[1]===e[28]?"nv_selected":""))&&l(t,"class",c)},d(v){v&&w(t),u=!1,d()}}}function et(e){let t,n=e[28]&&Kt(e);return{c(){n&&n.c(),t=ot()},m(i,r){n&&n.m(i,r),k(i,t,r)},p(i,r){i[28]&&n.p(i,r)},d(i){n&&n.d(i),i&&w(t)}}}function tt(e){let t,n=e[25].html+"",i;return{c(){t=new Et(!1),i=ot(),t.a=i},m(r,a){t.m(n,r,a),k(r,i,a)},p(r,a){a&16&&n!==(n=r[25].html+"")&&t.p(n)},d(r){r&&w(i),r&&t.d()}}}function Qt(e){let t,n,i,r,a,h,c,u,d,E,v,O,R,S,Q,W,de,b,H,T,q,V,Z,ee,fe,me,p,_,C,I,N,te,j=e[1].label+"",Se,Re,he,ne,y,He,M,pe,qe,B,ge,je,ie,Ue,re,oe,De,ze;function Fe(s,D){return s[0]?Xt:Gt}let _e=Fe(e),A=_e(e);function Ve(s,D){return s[2]?Jt:Yt}let ve=Ve(e),P=ve(e),G=e[5],x=[];for(let s=0;s`,de=g(),b=f("a"),b.innerHTML=`GitHub `,H=g(),T=f("a"),T.innerHTML=`Source `,q=g(),V=f("br"),Z=g(),ee=f("div"),fe=g(),me=f("br"),p=g(),_=f("div");for(let s=0;s',Ue=g(),re=f("div");for(let s=0;s{Ae(m,1)}),St()}X?(y=new X(Be(s)),Ke(y.$$.fragment),Ie(y.$$.fragment,1),Ne(y,ne,null)):y=null}if(D&16){Y=s[4];let m;for(m=0;m{n(2,u=localStorage&&localStorage.getItem("theme")=="dark"),it(u)});function d(){n(2,u=!u),it(u)}let E=Tt([]);bt(e,E,p=>n(4,i=p));function v(p){E.update(_=>[{html:`
[${new Date().toLocaleTimeString()}]: `+(typeof p=="string"?p:JSON.stringify(p,null,1))+"
"},..._])}function O(p){E.update(_=>[{html:`
[${new Date().toLocaleTimeString()}]: `+p+"
"},..._])}function R(){E.update(()=>[])}let S,Q,W;function de(p){W=p.clientY;const _=window.getComputedStyle(S);Q=parseInt(_.height,10);const C=N=>{const te=N.clientY-W,j=Q-te;n(3,S.style.height=`${j{document.removeEventListener("mouseup",I),document.removeEventListener("mousemove",C)};document.addEventListener("mouseup",I),document.addEventListener("mousemove",C)}let b=!1,H,T,q=!1,V=0,Z=0;const ee=(p,_,C)=>Math.min(Math.max(_,p),C);Ee(()=>{n(13,H=document.querySelector("#sidebar")),T=document.querySelector("#sidebarToggle"),document.addEventListener("click",p=>{T.contains(p.target)?n(0,b=!b):b&&!H.contains(p.target)&&n(0,b=!1)}),document.addEventListener("touchstart",p=>{if(T.contains(p.target))return;const _=p.touches[0].clientX;(0<_&&_<20&&!b||b)&&(q=!0,V=_)}),document.addEventListener("touchmove",p=>{if(q){const _=p.touches[0].clientX;Z=_;const C=(_-V)/10;H.style.setProperty("--translate-x",`-${ee(0,b?0-C:18.75-C,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(q){const p=(Z-V)/10;n(0,b=b?p>-(18.75/2):p>18.75/2)}q=!1})});const fe=p=>{c(p),n(0,b=!1)};function me(p){Ce[p?"unshift":"push"](()=>{S=p,n(3,S)})}return e.$$.update=()=>{if(e.$$.dirty&1){const p=document.querySelector("#sidebar");p&&Zt(p,b)}},[b,h,u,S,i,a,c,d,E,v,O,R,de,H,fe,me]}class tn extends Oe{constructor(t){super(),Le(this,t,en,Qt,ue,{})}}new tn({target:document.querySelector("#app")});