mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-22 10:11:32 +03:00
39bf895b73
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
46 lines
99 KiB
JavaScript
46 lines
99 KiB
JavaScript
const rr=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.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)}};rr();function J(){}function kl(t){return t()}function Go(){return Object.create(null)}function ue(t){t.forEach(kl)}function sr(t){return typeof t=="function"}function be(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Gn;function ur(t,e){return Gn||(Gn=document.createElement("a")),Gn.href=e,t===Gn.href}function ar(t){return Object.keys(t).length===0}function cr(t,...e){if(t==null)return J;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Ml(t,e,n){t.$$.on_destroy.push(cr(e,n))}function r(t,e){t.appendChild(e)}function m(t,e,n){t.insertBefore(e,n||null)}function h(t){t.parentNode.removeChild(t)}function ht(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function s(t){return document.createElement(t)}function fr(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function z(t){return document.createTextNode(t)}function v(){return z(" ")}function oi(){return z("")}function D(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function Zn(t){return function(e){return e.preventDefault(),t.call(this,e)}}function a(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function re(t){return t===""?null:+t}function dr(t){return Array.from(t.childNodes)}function Z(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function G(t,e){t.value=e==null?"":e}function Dt(t,e){for(let n=0;n<t.options.length;n+=1){const i=t.options[n];if(i.__value===e){i.selected=!0;return}}t.selectedIndex=-1}function Pi(t){const e=t.querySelector(":checked")||t.options[0];return e&&e.__value}function Jn(t,e,n){t.classList[n?"add":"remove"](e)}class pr{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,i=null){this.e||(this.is_svg?this.e=fr(n.nodeName):this.e=s(n.nodeName),this.t=n,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let n=0;n<this.n.length;n+=1)m(this.t,this.n[n],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(h)}}let Xt;function Jt(t){Xt=t}function Cl(){if(!Xt)throw new Error("Function called outside component initialization");return Xt}function ft(t){Cl().$$.on_mount.push(t)}function ji(t){Cl().$$.on_destroy.push(t)}const Vt=[],$n=[],Yn=[],Jo=[],hr=Promise.resolve();let Ri=!1;function mr(){Ri||(Ri=!0,hr.then(Tl))}function zt(t){Yn.push(t)}const zi=new Set;let Xn=0;function Tl(){const t=Xt;do{for(;Xn<Vt.length;){const e=Vt[Xn];Xn++,Jt(e),vr(e.$$)}for(Jt(null),Vt.length=0,Xn=0;$n.length;)$n.pop()();for(let e=0;e<Yn.length;e+=1){const n=Yn[e];zi.has(n)||(zi.add(n),n())}Yn.length=0}while(Vt.length);for(;Jo.length;)Jo.pop()();Ri=!1,zi.clear(),Jt(t)}function vr(t){if(t.fragment!==null){t.update(),ue(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(zt)}}const Kn=new Set;let dt;function li(){dt={r:0,c:[],p:dt}}function ri(){dt.r||ue(dt.c),dt=dt.p}function We(t,e){t&&t.i&&(Kn.delete(t),t.i(e))}function je(t,e,n,i){if(t&&t.o){if(Kn.has(t))return;Kn.add(t),dt.c.push(()=>{Kn.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}function ei(t){t&&t.c()}function Yt(t,e,n,i){const{fragment:o,on_mount:l,on_destroy:u,after_update:f}=t.$$;o&&o.m(e,n),i||zt(()=>{const c=l.map(kl).filter(sr);u?u.push(...c):ue(c),t.$$.on_mount=[]}),f.forEach(zt)}function Kt(t,e){const n=t.$$;n.fragment!==null&&(ue(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function _r(t,e){t.$$.dirty[0]===-1&&(Vt.push(t),mr(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Ce(t,e,n,i,o,l,u,f=[-1]){const c=Xt;Jt(t);const p=t.$$={fragment:null,ctx:null,props:l,update:J,not_equal:o,bound:Go(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Go(),dirty:f,skip_bound:!1,root:e.target||c.$$.root};u&&u(p.root);let d=!1;if(p.ctx=n?n(t,e.props||{},(k,_,...y)=>{const g=y.length?y[0]:_;return p.ctx&&o(p.ctx[k],p.ctx[k]=g)&&(!p.skip_bound&&p.bound[k]&&p.bound[k](g),d&&_r(t,k)),_}):[],p.update(),d=!0,ue(p.before_update),p.fragment=i?i(p.ctx):!1,e.target){if(e.hydrate){const k=dr(e.target);p.fragment&&p.fragment.l(k),k.forEach(h)}else p.fragment&&p.fragment.c();e.intro&&We(t.$$.fragment),Yt(t,e.target,e.anchor,e.customElement),Tl()}Jt(c)}class Te{$destroy(){Kt(this,1),this.$destroy=J}$on(e,n){const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}$set(e){this.$$set&&!ar(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ot=[];function Al(t,e=J){let n;const i=new Set;function o(f){if(be(t,f)&&(t=f,n)){const c=!Ot.length;for(const p of i)p[1](),Ot.push(p,t);if(c){for(let p=0;p<Ot.length;p+=2)Ot[p][0](Ot[p+1]);Ot.length=0}}}function l(f){o(f(t))}function u(f,c=J){const p=[f,c];return i.add(p),i.size===1&&(n=e(o)||J),f(t),()=>{i.delete(p),i.size===0&&(n(),n=null)}}return{set:o,update:l,subscribe:u}}var Ii=function(t,e){return Ii=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])},Ii(t,e)};function Hi(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ii(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var se=function(){return se=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},se.apply(this,arguments)};function M(t,e,n,i){return new(n||(n=Promise))(function(o,l){function u(p){try{c(i.next(p))}catch(d){l(d)}}function f(p){try{c(i.throw(p))}catch(d){l(d)}}function c(p){var d;p.done?o(p.value):(d=p.value,d instanceof n?d:new n(function(k){k(d)})).then(u,f)}c((i=i.apply(t,e||[])).next())})}function C(t,e){var n,i,o,l,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function f(c){return function(p){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,i&&(o=2&d[0]?i.return:d[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,d[1])).done)return o;switch(i=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return u.label++,{value:d[1],done:!1};case 5:u.label++,i=d[1],d=[0];continue;case 7:d=u.ops.pop(),u.trys.pop();continue;default:if(o=u.trys,!((o=o.length>0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){u=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){u.label=d[1];break}if(d[0]===6&&u.label<o[1]){u.label=o[1],o=d;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(d);break}o[2]&&u.ops.pop(),u.trys.pop();continue}d=e.call(t,u)}catch(k){d=[6,k],i=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,p])}}}function mt(t,e){e===void 0&&(e=!1);var n=window.crypto.getRandomValues(new Uint32Array(1))[0],i="_".concat(n);return Object.defineProperty(window,i,{value:function(o){return e&&Reflect.deleteProperty(window,i),t==null?void 0:t(o)},writable:!1,configurable:!0}),n}function ti(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,new Promise(function(i,o){var l=mt(function(f){i(f),Reflect.deleteProperty(window,"_".concat(u))},!0),u=mt(function(f){o(f),Reflect.deleteProperty(window,"_".concat(l))},!0);window.__TAURI_IPC__(se({cmd:t,callback:l,error:u},e))})]})})}function Ll(t,e){e===void 0&&(e="asset");var n=encodeURIComponent(t);return navigator.userAgent.includes("Windows")?"https://".concat(e,".localhost/").concat(n):"".concat(e,"://").concat(n)}Object.freeze({__proto__:null,transformCallback:mt,invoke:ti,convertFileSrc:Ll});function S(t){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,ti("tauri",t)]})})}function br(t,e,n,i){return n===void 0&&(n=[]),M(this,void 0,void 0,function(){return C(this,function(o){return typeof n=="object"&&Object.freeze(n),[2,S({__tauriModule:"Shell",message:{cmd:"execute",program:e,args:n,options:i,onEventFn:mt(t)}})]})})}var xn=function(){function t(){this.eventListeners=Object.create(null)}return t.prototype.addListener=function(e,n){return this.on(e,n)},t.prototype.removeListener=function(e,n){return this.off(e,n)},t.prototype.on=function(e,n){return e in this.eventListeners?this.eventListeners[e].push(n):this.eventListeners[e]=[n],this},t.prototype.once=function(e,n){var i=this,o=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];i.removeListener(e,o),n.apply(void 0,l)};return this.addListener(e,o)},t.prototype.off=function(e,n){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter(function(i){return i!==n})),this},t.prototype.removeAllListeners=function(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this},t.prototype.emit=function(e){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];if(e in this.eventListeners){for(var o=this.eventListeners[e],l=0,u=o;l<u.length;l++){var f=u[l];f.apply(void 0,n)}return!0}return!1},t.prototype.listenerCount=function(e){return e in this.eventListeners?this.eventListeners[e].length:0},t.prototype.prependListener=function(e,n){return e in this.eventListeners?this.eventListeners[e].unshift(n):this.eventListeners[e]=[n],this},t.prototype.prependOnceListener=function(e,n){var i=this,o=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];i.removeListener(e,o),n.apply(void 0,l)};return this.prependListener(e,o)},t}(),El=function(){function t(e){this.pid=e}return t.prototype.write=function(e){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})]})})},t.prototype.kill=function(){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})]})})},t}(),Sl=function(t){function e(n,i,o){i===void 0&&(i=[]);var l=t.call(this)||this;return l.stdout=new xn,l.stderr=new xn,l.program=n,l.args=typeof i=="string"?[i]:i,l.options=o!=null?o:{},l}return Hi(e,t),e.sidecar=function(n,i,o){i===void 0&&(i=[]);var l=new e(n,i,o);return l.options.sidecar=!0,l},e.prototype.spawn=function(){return M(this,void 0,void 0,function(){var n=this;return C(this,function(i){return[2,br(function(o){switch(o.event){case"Error":n.emit("error",o.payload);break;case"Terminated":n.emit("close",o.payload);break;case"Stdout":n.stdout.emit("data",o.payload);break;case"Stderr":n.stderr.emit("data",o.payload)}},this.program,this.args,this.options).then(function(o){return new El(o)})]})})},e.prototype.execute=function(){return M(this,void 0,void 0,function(){var n=this;return C(this,function(i){return[2,new Promise(function(o,l){n.on("error",l);var u=[],f=[];n.stdout.on("data",function(c){u.push(c)}),n.stderr.on("data",function(c){f.push(c)}),n.on("close",function(c){o({code:c.code,signal:c.signal,stdout:u.join(`
|
|
`),stderr:f.join(`
|
|
`)})}),n.spawn().catch(l)})]})})},e}(xn);function Fi(t,e){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Shell",message:{cmd:"open",path:t,with:e}})]})})}Object.freeze({__proto__:null,Command:Sl,Child:El,EventEmitter:xn,open:Fi});function Ol(t,e){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Event",message:{cmd:"unlisten",event:t,eventId:e}})]})})}function Dl(t,e,n){return M(this,void 0,void 0,function(){return C(this,function(i){switch(i.label){case 0:return[4,S({__tauriModule:"Event",message:{cmd:"emit",event:t,windowLabel:e,payload:typeof n=="string"?n:JSON.stringify(n)}})];case 1:return i.sent(),[2]}})})}function Ui(t,e,n){return M(this,void 0,void 0,function(){var i=this;return C(this,function(o){return[2,S({__tauriModule:"Event",message:{cmd:"listen",event:t,windowLabel:e,handler:mt(n)}}).then(function(l){return function(){return M(i,void 0,void 0,function(){return C(this,function(u){return[2,Ol(t,l)]})})}})]})})}function zl(t,e,n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,Ui(t,e,function(o){n(o),Ol(t,o.id).catch(function(){})})]})})}var ve;function Qt(t,e){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,Ui(t,null,e)]})})}function Wl(t,e){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,zl(t,null,e)]})})}function si(t,e){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,Dl(t,void 0,e)]})})}(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_FILE_DROP="tauri://file-drop",t.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",t.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",t.MENU="tauri://menu",t.CHECK_UPDATE="tauri://update",t.UPDATE_AVAILABLE="tauri://update-available",t.INSTALL_UPDATE="tauri://update-install",t.STATUS_UPDATE="tauri://update-status",t.DOWNLOAD_PROGRESS="tauri://update-download-progress"})(ve||(ve={}));Object.freeze({__proto__:null,get TauriEvent(){return ve},listen:Qt,once:Wl,emit:si});var xt,ni=function(t,e){this.type="Logical",this.width=t,this.height=e},pt=function(){function t(e,n){this.type="Physical",this.width=e,this.height=n}return t.prototype.toLogical=function(e){return new ni(this.width/e,this.height/e)},t}(),Pl=function(t,e){this.type="Logical",this.x=t,this.y=e},nt=function(){function t(e,n){this.type="Physical",this.x=e,this.y=n}return t.prototype.toLogical=function(e){return new Pl(this.x/e,this.y/e)},t}();function Gt(){return new Wt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Rl(){return window.__TAURI_METADATA__.__windows.map(function(t){return new Wt(t.label,{skip:!0})})}(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(xt||(xt={}));var Be,Xo=["tauri://created","tauri://error"],Il=function(){function t(e){this.label=e,this.listeners=Object.create(null)}return t.prototype.listen=function(e,n){return M(this,void 0,void 0,function(){var i=this;return C(this,function(o){return this._handleTauriEvent(e,n)?[2,Promise.resolve(function(){var l=i.listeners[e];l.splice(l.indexOf(n),1)})]:[2,Ui(e,this.label,n)]})})},t.prototype.once=function(e,n){return M(this,void 0,void 0,function(){var i=this;return C(this,function(o){return this._handleTauriEvent(e,n)?[2,Promise.resolve(function(){var l=i.listeners[e];l.splice(l.indexOf(n),1)})]:[2,zl(e,this.label,n)]})})},t.prototype.emit=function(e,n){return M(this,void 0,void 0,function(){var i,o;return C(this,function(l){if(Xo.includes(e)){for(i=0,o=this.listeners[e]||[];i<o.length;i++)(0,o[i])({event:e,id:-1,windowLabel:this.label,payload:n});return[2,Promise.resolve()]}return[2,Dl(e,this.label,n)]})})},t.prototype._handleTauriEvent=function(e,n){return!!Xo.includes(e)&&(e in this.listeners?this.listeners[e].push(n):this.listeners[e]=[n],!0)},t}(),Nl=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return Hi(e,t),e.prototype.scaleFactor=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})]})})},e.prototype.innerPosition=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(function(i){var o=i.x,l=i.y;return new nt(o,l)})]})})},e.prototype.outerPosition=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(function(i){var o=i.x,l=i.y;return new nt(o,l)})]})})},e.prototype.innerSize=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(function(i){var o=i.width,l=i.height;return new pt(o,l)})]})})},e.prototype.outerSize=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(function(i){var o=i.width,l=i.height;return new pt(o,l)})]})})},e.prototype.isFullscreen=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})]})})},e.prototype.isMaximized=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})]})})},e.prototype.isDecorated=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})]})})},e.prototype.isResizable=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})]})})},e.prototype.isVisible=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})]})})},e.prototype.theme=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})]})})},e.prototype.center=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})]})})},e.prototype.requestUserAttention=function(n){return M(this,void 0,void 0,function(){var i;return C(this,function(o){return i=null,n&&(i=n===xt.Critical?{type:"Critical"}:{type:"Informational"}),[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:i}}}})]})})},e.prototype.setResizable=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:n}}}})]})})},e.prototype.setTitle=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:n}}}})]})})},e.prototype.maximize=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})]})})},e.prototype.unmaximize=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})]})})},e.prototype.toggleMaximize=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})]})})},e.prototype.minimize=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})]})})},e.prototype.unminimize=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})]})})},e.prototype.show=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})]})})},e.prototype.hide=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})]})})},e.prototype.close=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})]})})},e.prototype.setDecorations=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:n}}}})]})})},e.prototype.setAlwaysOnTop=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:n}}}})]})})},e.prototype.setSize=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){if(!n||n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:n.type,data:{width:n.width,height:n.height}}}}}})]})})},e.prototype.setMinSize=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){if(n&&n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:n?{type:n.type,data:{width:n.width,height:n.height}}:null}}}})]})})},e.prototype.setMaxSize=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){if(n&&n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:n?{type:n.type,data:{width:n.width,height:n.height}}:null}}}})]})})},e.prototype.setPosition=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){if(!n||n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:n.type,data:{x:n.x,y:n.y}}}}}})]})})},e.prototype.setFullscreen=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:n}}}})]})})},e.prototype.setFocus=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})]})})},e.prototype.setIcon=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof n=="string"?n:Array.from(n)}}}}})]})})},e.prototype.setSkipTaskbar=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:n}}}})]})})},e.prototype.setCursorGrab=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:n}}}})]})})},e.prototype.setCursorVisible=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:n}}}})]})})},e.prototype.setCursorIcon=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:n}}}})]})})},e.prototype.setCursorPosition=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){if(!n||n.type!=="Logical"&&n.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:n.type,data:{x:n.x,y:n.y}}}}}})]})})},e.prototype.setIgnoreCursorEvents=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:n}}}})]})})},e.prototype.startDragging=function(){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})]})})},e.prototype.onResized=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,this.listen(ve.WINDOW_RESIZED,n)]})})},e.prototype.onMoved=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,this.listen(ve.WINDOW_MOVED,n)]})})},e.prototype.onCloseRequested=function(n){return M(this,void 0,void 0,function(){var i=this;return C(this,function(o){return[2,this.listen(ve.WINDOW_CLOSE_REQUESTED,function(l){var u=new jl(l);Promise.resolve(n(u)).then(function(){if(!u.isPreventDefault())return i.close()})})]})})},e.prototype.onFocusChanged=function(n){return M(this,void 0,void 0,function(){var i,o;return C(this,function(l){switch(l.label){case 0:return[4,this.listen(ve.WINDOW_FOCUS,function(u){n(se(se({},u),{payload:!0}))})];case 1:return i=l.sent(),[4,this.listen(ve.WINDOW_BLUR,function(u){n(se(se({},u),{payload:!1}))})];case 2:return o=l.sent(),[2,function(){i(),o()}]}})})},e.prototype.onScaleChanged=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,this.listen(ve.WINDOW_SCALE_FACTOR_CHANGED,n)]})})},e.prototype.onMenuClicked=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,this.listen(ve.MENU,n)]})})},e.prototype.onFileDropEvent=function(n){return M(this,void 0,void 0,function(){var i,o,l;return C(this,function(u){switch(u.label){case 0:return[4,this.listen(ve.WINDOW_FILE_DROP,function(f){n(se(se({},f),{payload:{type:"drop",paths:f.payload}}))})];case 1:return i=u.sent(),[4,this.listen(ve.WINDOW_FILE_DROP_HOVER,function(f){n(se(se({},f),{payload:{type:"hover",paths:f.payload}}))})];case 2:return o=u.sent(),[4,this.listen(ve.WINDOW_FILE_DROP_CANCELLED,function(f){n(se(se({},f),{payload:{type:"cancel"}}))})];case 3:return l=u.sent(),[2,function(){i(),o(),l()}]}})})},e.prototype.onThemeChanged=function(n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,this.listen(ve.WINDOW_THEME_CHANGED,n)]})})},e}(Il),jl=function(){function t(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}return t.prototype.preventDefault=function(){this._preventDefault=!0},t.prototype.isPreventDefault=function(){return this._preventDefault},t}(),Wt=function(t){function e(n,i){i===void 0&&(i={});var o=t.call(this,n)||this;return i!=null&&i.skip||S({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:se({label:n},i)}}}).then(function(){return M(o,void 0,void 0,function(){return C(this,function(l){return[2,this.emit("tauri://created")]})})}).catch(function(l){return M(o,void 0,void 0,function(){return C(this,function(u){return[2,this.emit("tauri://error",l)]})})}),o}return Hi(e,t),e.getByLabel=function(n){return Rl().some(function(i){return i.label===n})?new e(n,{skip:!0}):null},e}(Nl);function qi(t){return t===null?null:{name:t.name,scaleFactor:t.scaleFactor,position:new nt(t.position.x,t.position.y),size:new pt(t.size.width,t.size.height)}}function gr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(qi)]})})}function yr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(qi)]})})}function wr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(function(e){return e.map(qi)})]})})}"__TAURI_METADATA__"in window?Be=new Wt(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.
|
|
Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),Be=new Wt("main",{skip:!0}));Object.freeze({__proto__:null,WebviewWindow:Wt,WebviewWindowHandle:Il,WindowManager:Nl,CloseRequestedEvent:jl,getCurrent:Gt,getAll:Rl,get appWindow(){return Be},LogicalSize:ni,PhysicalSize:pt,LogicalPosition:Pl,PhysicalPosition:nt,get UserAttentionType(){return xt},currentMonitor:gr,primaryMonitor:yr,availableMonitors:wr});function kr(){return navigator.appVersion.includes("Win")}var Mr=kr()?`\r
|
|
`:`
|
|
`;function Hl(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Os",message:{cmd:"platform"}})]})})}function Cr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Os",message:{cmd:"version"}})]})})}function Tr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Os",message:{cmd:"osType"}})]})})}function Ar(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Os",message:{cmd:"arch"}})]})})}function Lr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Os",message:{cmd:"tempdir"}})]})})}Object.freeze({__proto__:null,EOL:Mr,platform:Hl,version:Cr,type:Tr,arch:Ar,tempdir:Lr});function Fl(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"App",message:{cmd:"getAppVersion"}})]})})}function Ul(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"App",message:{cmd:"getAppName"}})]})})}function ql(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"App",message:{cmd:"getTauriVersion"}})]})})}function Bl(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"App",message:{cmd:"show"}})]})})}function Vl(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"App",message:{cmd:"hide"}})]})})}Object.freeze({__proto__:null,getName:Ul,getVersion:Fl,getTauriVersion:ql,show:Bl,hide:Vl});function Gl(t){return t===void 0&&(t=0),M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"Process",message:{cmd:"exit",exitCode:t}})]})})}function Bi(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Process",message:{cmd:"relaunch"}})]})})}Object.freeze({__proto__:null,exit:Gl,relaunch:Bi});function Er(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F,R,q,O,A,L,P,T,U;return{c(){e=s("p"),e.innerHTML=`This is a demo of Tauri's API capabilities using the <code>@tauri-apps/api</code> 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.`,n=v(),i=s("br"),o=v(),l=s("br"),u=v(),f=s("pre"),c=z("App name: "),p=s("code"),d=z(t[2]),k=z(`
|
|
App version: `),_=s("code"),y=z(t[0]),g=z(`
|
|
Tauri version: `),b=s("code"),E=z(t[1]),W=z(`
|
|
`),F=v(),R=s("br"),q=v(),O=s("div"),A=s("button"),A.textContent="Close application",L=v(),P=s("button"),P.textContent="Relaunch application",a(A,"class","btn"),a(P,"class","btn"),a(O,"class","flex flex-wrap gap-1 shadow-")},m(B,Y){m(B,e,Y),m(B,n,Y),m(B,i,Y),m(B,o,Y),m(B,l,Y),m(B,u,Y),m(B,f,Y),r(f,c),r(f,p),r(p,d),r(f,k),r(f,_),r(_,y),r(f,g),r(f,b),r(b,E),r(f,W),m(B,F,Y),m(B,R,Y),m(B,q,Y),m(B,O,Y),r(O,A),r(O,L),r(O,P),T||(U=[D(A,"click",t[3]),D(P,"click",t[4])],T=!0)},p(B,[Y]){Y&4&&Z(d,B[2]),Y&1&&Z(y,B[0]),Y&2&&Z(E,B[1])},i:J,o:J,d(B){B&&h(e),B&&h(n),B&&h(i),B&&h(o),B&&h(l),B&&h(u),B&&h(f),B&&h(F),B&&h(R),B&&h(q),B&&h(O),T=!1,ue(U)}}}function Sr(t,e,n){let i="0.0.0",o="0.0.0",l="Unknown";Ul().then(c=>{n(2,l=c)}),Fl().then(c=>{n(0,i=c)}),ql().then(c=>{n(1,o=c)});async function u(){await Gl()}async function f(){await Bi()}return[i,o,l,u,f]}class Or extends Te{constructor(e){super(),Ce(this,e,Sr,Er,be,{})}}function Jl(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Cli",message:{cmd:"cliMatches"}})]})})}Object.freeze({__proto__:null,getMatches:Jl});function Dr(t){let e,n,i,o,l,u,f,c,p,d,k,_,y;return{c(){e=s("p"),e.innerHTML=`This binary can be run from the terminal and takes the following arguments:
|
|
<code class="code-block flex flex-wrap my-2"><pre> --config <PATH>
|
|
--theme <light|dark|system>
|
|
--verbose</pre></code>
|
|
Additionally, it has a <code>update --background</code> subcommand.`,n=v(),i=s("br"),o=v(),l=s("div"),l.textContent="Note that the arguments are only parsed, not implemented.",u=v(),f=s("br"),c=v(),p=s("br"),d=v(),k=s("button"),k.textContent="Get matches",a(l,"class","note"),a(k,"class","btn"),a(k,"id","cli-matches")},m(g,b){m(g,e,b),m(g,n,b),m(g,i,b),m(g,o,b),m(g,l,b),m(g,u,b),m(g,f,b),m(g,c,b),m(g,p,b),m(g,d,b),m(g,k,b),_||(y=D(k,"click",t[0]),_=!0)},p:J,i:J,o:J,d(g){g&&h(e),g&&h(n),g&&h(i),g&&h(o),g&&h(l),g&&h(u),g&&h(f),g&&h(c),g&&h(p),g&&h(d),g&&h(k),_=!1,y()}}}function zr(t,e,n){let{onMessage:i}=e;function o(){Jl().then(i).catch(i)}return t.$$set=l=>{"onMessage"in l&&n(1,i=l.onMessage)},[o,i]}class Wr extends Te{constructor(e){super(),Ce(this,e,zr,Dr,be,{onMessage:1})}}function Pr(t){let e,n,i,o,l,u,f,c;return{c(){e=s("div"),n=s("button"),n.textContent="Call Log API",i=v(),o=s("button"),o.textContent="Call Request (async) API",l=v(),u=s("button"),u.textContent="Send event to Rust",a(n,"class","btn"),a(n,"id","log"),a(o,"class","btn"),a(o,"id","request"),a(u,"class","btn"),a(u,"id","event")},m(p,d){m(p,e,d),r(e,n),r(e,i),r(e,o),r(e,l),r(e,u),f||(c=[D(n,"click",t[0]),D(o,"click",t[1]),D(u,"click",t[2])],f=!0)},p:J,i:J,o:J,d(p){p&&h(e),f=!1,ue(c)}}}function Rr(t,e,n){let{onMessage:i}=e,o;ft(async()=>{o=await Qt("rust-event",i)}),ji(()=>{o&&o()});function l(){ti("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){ti("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function f(){si("js-event","this is the payload string")}return t.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[l,u,f,i]}class Ir extends Te{constructor(e){super(),Ce(this,e,Rr,Pr,be,{onMessage:3})}}function Vi(t){return t===void 0&&(t={}),M(this,void 0,void 0,function(){return C(this,function(e){return typeof t=="object"&&Object.freeze(t),[2,S({__tauriModule:"Dialog",message:{cmd:"openDialog",options:t}})]})})}function Xl(t){return t===void 0&&(t={}),M(this,void 0,void 0,function(){return C(this,function(e){return typeof t=="object"&&Object.freeze(t),[2,S({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:t}})]})})}function Nr(t,e){var n;return M(this,void 0,void 0,function(){var i;return C(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,S({__tauriModule:"Dialog",message:{cmd:"messageDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}function Yl(t,e){var n;return M(this,void 0,void 0,function(){var i;return C(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,S({__tauriModule:"Dialog",message:{cmd:"askDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}function jr(t,e){var n;return M(this,void 0,void 0,function(){var i;return C(this,function(o){return i=typeof e=="string"?{title:e}:e,[2,S({__tauriModule:"Dialog",message:{cmd:"confirmDialog",message:t.toString(),title:(n=i==null?void 0:i.title)===null||n===void 0?void 0:n.toString(),type:i==null?void 0:i.type}})]})})}Object.freeze({__proto__:null,open:Vi,save:Xl,message:Nr,ask:Yl,confirm:jr});var Pt;function Hr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Fs",message:{cmd:"readTextFile",path:t,options:e}})]})})}function Gi(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){var n;return C(this,function(i){switch(i.label){case 0:return[4,S({__tauriModule:"Fs",message:{cmd:"readFile",path:t,options:e}})];case 1:return n=i.sent(),[2,Uint8Array.from(n)]}})})}function Ni(t,e,n){return M(this,void 0,void 0,function(){var i,o;return C(this,function(l){return typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t),i={path:"",contents:""},o=n,typeof t=="string"?i.path=t:(i.path=t.path,i.contents=t.contents),typeof e=="string"?i.contents=e!=null?e:"":o=e,[2,S({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(new TextEncoder().encode(i.contents)),options:o}})]})})}function Fr(t,e,n){return M(this,void 0,void 0,function(){var i,o;return C(this,function(l){return typeof n=="object"&&Object.freeze(n),typeof t=="object"&&Object.freeze(t),i={path:"",contents:[]},o=n,typeof t=="string"?i.path=t:(i.path=t.path,i.contents=t.contents),e&&"dir"in e?o=e:typeof t=="string"&&(i.contents=e!=null?e:[]),[2,S({__tauriModule:"Fs",message:{cmd:"writeFile",path:i.path,contents:Array.from(i.contents instanceof ArrayBuffer?new Uint8Array(i.contents):i.contents),options:o}})]})})}function Kl(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Fs",message:{cmd:"readDir",path:t,options:e}})]})})}function Ur(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Fs",message:{cmd:"createDir",path:t,options:e}})]})})}function qr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Fs",message:{cmd:"removeDir",path:t,options:e}})]})})}function Br(t,e,n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Fs",message:{cmd:"copyFile",source:t,destination:e,options:n}})]})})}function Vr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Fs",message:{cmd:"removeFile",path:t,options:e}})]})})}function Gr(t,e,n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return C(this,function(i){return[2,S({__tauriModule:"Fs",message:{cmd:"renameFile",oldPath:t,newPath:e,options:n}})]})})}function Jr(t,e){return e===void 0&&(e={}),M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"Fs",message:{cmd:"exists",path:t,options:e}})]})})}(function(t){t[t.Audio=1]="Audio",t[t.Cache=2]="Cache",t[t.Config=3]="Config",t[t.Data=4]="Data",t[t.LocalData=5]="LocalData",t[t.Desktop=6]="Desktop",t[t.Document=7]="Document",t[t.Download=8]="Download",t[t.Executable=9]="Executable",t[t.Font=10]="Font",t[t.Home=11]="Home",t[t.Picture=12]="Picture",t[t.Public=13]="Public",t[t.Runtime=14]="Runtime",t[t.Template=15]="Template",t[t.Video=16]="Video",t[t.Resource=17]="Resource",t[t.App=18]="App",t[t.Log=19]="Log",t[t.Temp=20]="Temp",t[t.AppConfig=21]="AppConfig",t[t.AppData=22]="AppData",t[t.AppLocalData=23]="AppLocalData",t[t.AppCache=24]="AppCache",t[t.AppLog=25]="AppLog"})(Pt||(Pt={}));Object.freeze({__proto__:null,get BaseDirectory(){return Pt},get Dir(){return Pt},readTextFile:Hr,readBinaryFile:Gi,writeTextFile:Ni,writeFile:Ni,writeBinaryFile:Fr,readDir:Kl,createDir:Ur,removeDir:qr,copyFile:Br,removeFile:Vr,renameFile:Gr,exists:Jr});function Xr(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F,R,q,O,A,L,P;return{c(){e=s("div"),n=s("input"),i=v(),o=s("input"),l=v(),u=s("br"),f=v(),c=s("div"),p=s("input"),d=v(),k=s("label"),k.textContent="Multiple",_=v(),y=s("div"),g=s("input"),b=v(),E=s("label"),E.textContent="Directory",W=v(),F=s("br"),R=v(),q=s("button"),q.textContent="Open dialog",O=v(),A=s("button"),A.textContent="Open save dialog",a(n,"class","input"),a(n,"id","dialog-default-path"),a(n,"placeholder","Default path"),a(o,"class","input"),a(o,"id","dialog-filter"),a(o,"placeholder","Extensions filter, comma-separated"),a(e,"class","flex gap-2 children:grow"),a(p,"type","checkbox"),a(p,"id","dialog-multiple"),a(k,"for","dialog-multiple"),a(g,"type","checkbox"),a(g,"id","dialog-directory"),a(E,"for","dialog-directory"),a(q,"class","btn"),a(q,"id","open-dialog"),a(A,"class","btn"),a(A,"id","save-dialog")},m(T,U){m(T,e,U),r(e,n),G(n,t[0]),r(e,i),r(e,o),G(o,t[1]),m(T,l,U),m(T,u,U),m(T,f,U),m(T,c,U),r(c,p),p.checked=t[2],r(c,d),r(c,k),m(T,_,U),m(T,y,U),r(y,g),g.checked=t[3],r(y,b),r(y,E),m(T,W,U),m(T,F,U),m(T,R,U),m(T,q,U),m(T,O,U),m(T,A,U),L||(P=[D(n,"input",t[8]),D(o,"input",t[9]),D(p,"change",t[10]),D(g,"change",t[11]),D(q,"click",t[4]),D(A,"click",t[5])],L=!0)},p(T,[U]){U&1&&n.value!==T[0]&&G(n,T[0]),U&2&&o.value!==T[1]&&G(o,T[1]),U&4&&(p.checked=T[2]),U&8&&(g.checked=T[3])},i:J,o:J,d(T){T&&h(e),T&&h(l),T&&h(u),T&&h(f),T&&h(c),T&&h(_),T&&h(y),T&&h(W),T&&h(F),T&&h(R),T&&h(q),T&&h(O),T&&h(A),L=!1,ue(P)}}}function Yr(t,e){var n=new Blob([t],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){var l=o.target.result;e(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function Kr(t,e,n){let{onMessage:i}=e,{insecureRenderHtml:o}=e,l=null,u=null,f=!1,c=!1;function p(){Vi({title:"My wonderful open dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[],multiple:f,directory:c}).then(function(b){if(Array.isArray(b))i(b);else{var E=b,W=E.match(/\S+\.\S+$/g);Gi(E).then(function(F){W&&(E.includes(".png")||E.includes(".jpg"))?Yr(new Uint8Array(F),function(R){var q="data:image/png;base64,"+R;o('<img src="'+q+'"></img>')}):i(b)}).catch(i(b))}}).catch(i)}function d(){Xl({title:"My wonderful save dialog",defaultPath:l,filters:u?[{name:"Tauri Example",extensions:u.split(",").map(b=>b.trim())}]:[]}).then(i).catch(i)}function k(){l=this.value,n(0,l)}function _(){u=this.value,n(1,u)}function y(){f=this.checked,n(2,f)}function g(){c=this.checked,n(3,c)}return t.$$set=b=>{"onMessage"in b&&n(6,i=b.onMessage),"insecureRenderHtml"in b&&n(7,o=b.insecureRenderHtml)},[l,u,f,c,p,d,i,o,k,_,y,g]}class xr extends Te{constructor(e){super(),Ce(this,e,Kr,Xr,be,{onMessage:6,insecureRenderHtml:7})}}function Yo(t,e,n){const i=t.slice();return i[9]=e[n],i}function Ko(t){let e,n=t[9][0]+"",i,o;return{c(){e=s("option"),i=z(n),e.__value=o=t[9][1],e.value=e.__value},m(l,u){m(l,e,u),r(e,i)},p:J,d(l){l&&h(e)}}}function Qr(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F,R,q=t[2],O=[];for(let A=0;A<q.length;A+=1)O[A]=Ko(Yo(t,q,A));return{c(){e=s("form"),n=s("div"),i=s("select"),o=s("option"),o.textContent="None";for(let A=0;A<O.length;A+=1)O[A].c();l=v(),u=s("input"),f=v(),c=s("br"),p=v(),d=s("div"),k=s("button"),k.textContent="Read",_=v(),y=s("button"),y.textContent="Use as img src",g=v(),b=s("br"),E=v(),W=s("img"),o.__value="",o.value=o.__value,a(i,"class","input"),a(i,"id","dir"),a(u,"class","input grow"),a(u,"id","path-to-read"),a(u,"placeholder","Type the path to read..."),a(n,"class","flex gap-1"),a(k,"class","btn"),a(k,"id","read"),a(y,"class","btn"),a(y,"type","button"),a(e,"class","flex flex-col"),a(W,"alt","")},m(A,L){m(A,e,L),r(e,n),r(n,i),r(i,o);for(let P=0;P<O.length;P+=1)O[P].m(i,null);r(n,l),r(n,u),G(u,t[0]),r(e,f),r(e,c),r(e,p),r(e,d),r(d,k),r(d,_),r(d,y),m(A,g,L),m(A,b,L),m(A,E,L),m(A,W,L),t[8](W),F||(R=[D(u,"input",t[7]),D(y,"click",t[4]),D(e,"submit",Zn(t[3]))],F=!0)},p(A,[L]){if(L&4){q=A[2];let P;for(P=0;P<q.length;P+=1){const T=Yo(A,q,P);O[P]?O[P].p(T,L):(O[P]=Ko(T),O[P].c(),O[P].m(i,null))}for(;P<O.length;P+=1)O[P].d(1);O.length=q.length}L&1&&u.value!==A[0]&&G(u,A[0])},i:J,o:J,d(A){A&&h(e),ht(O,A),A&&h(g),A&&h(b),A&&h(E),A&&h(W),t[8](null),F=!1,ue(R)}}}function xo(){return document.getElementById("dir").value?parseInt(dir.value):null}function Zr(t,e){const n=new Blob([t],{type:"application/octet-binary"}),i=new FileReader;i.onload=function(o){const l=o.target.result;e(l.substr(l.indexOf(",")+1))},i.readAsDataURL(n)}function $r(t,e,n){let{onMessage:i}=e,{insecureRenderHtml:o}=e,l="",u;const f=Object.keys(Pt).filter(_=>isNaN(parseInt(_))).map(_=>[_,Pt[_]]);function c(){const _=l.match(/\S+\.\S+$/g),y={dir:xo()};(_?Gi(l,y):Kl(l,y)).then(function(b){if(_)if(l.includes(".png")||l.includes(".jpg"))Zr(new Uint8Array(b),function(E){const W="data:image/png;base64,"+E;o('<img src="'+W+'"></img>')});else{const E=String.fromCharCode.apply(null,b);o('<textarea id="file-response"></textarea><button id="file-save">Save</button>'),setTimeout(()=>{const W=document.getElementById("file-response");W.value=E,document.getElementById("file-save").addEventListener("click",function(){Ni(l,W.value,{dir:xo()}).catch(i)})})}else i(b)}).catch(i)}function p(){n(1,u.src=Ll(l),u)}function d(){l=this.value,n(0,l)}function k(_){$n[_?"unshift":"push"](()=>{u=_,n(1,u)})}return t.$$set=_=>{"onMessage"in _&&n(5,i=_.onMessage),"insecureRenderHtml"in _&&n(6,o=_.insecureRenderHtml)},[l,u,f,c,p,i,o,d,k]}class es extends Te{constructor(e){super(),Ce(this,e,$r,Qr,be,{onMessage:5,insecureRenderHtml:6})}}var Rt;(function(t){t[t.JSON=1]="JSON",t[t.Text=2]="Text",t[t.Binary=3]="Binary"})(Rt||(Rt={}));var Qn=function(){function t(e,n){this.type=e,this.payload=n}return t.form=function(e){var n={};for(var i in e){var o=e[i],l=void 0;l=typeof o=="string"?o:o instanceof Uint8Array||Array.isArray(o)?Array.from(o):typeof o.file=="string"?{file:o.file,mime:o.mime,fileName:o.fileName}:{file:Array.from(o.file),mime:o.mime,fileName:o.fileName},n[i]=l}return new t("Form",n)},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",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))},t}(),xl=function(t){this.url=t.url,this.status=t.status,this.ok=this.status>=200&&this.status<300,this.headers=t.headers,this.rawHeaders=t.rawHeaders,this.data=t.data},Ql=function(){function t(e){this.id=e}return t.prototype.drop=function(){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})]})})},t.prototype.request=function(e){return M(this,void 0,void 0,function(){var n;return C(this,function(i){return(n=!e.responseType||e.responseType===Rt.JSON)&&(e.responseType=Rt.Text),[2,S({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(function(o){var l=new xl(o);if(n){try{l.data=JSON.parse(l.data)}catch(u){if(l.ok&&l.data==="")l.data={};else if(l.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})]})})},t.prototype.get=function(e,n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,this.request(se({method:"GET",url:e},n))]})})},t.prototype.post=function(e,n,i){return M(this,void 0,void 0,function(){return C(this,function(o){return[2,this.request(se({method:"POST",url:e,body:n},i))]})})},t.prototype.put=function(e,n,i){return M(this,void 0,void 0,function(){return C(this,function(o){return[2,this.request(se({method:"PUT",url:e,body:n},i))]})})},t.prototype.patch=function(e,n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,this.request(se({method:"PATCH",url:e},n))]})})},t.prototype.delete=function(e,n){return M(this,void 0,void 0,function(){return C(this,function(i){return[2,this.request(se({method:"DELETE",url:e},n))]})})},t}();function ii(t){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"Http",message:{cmd:"createClient",options:t}}).then(function(n){return new Ql(n)})]})})}var Wi=null;function ts(t,e){var n;return M(this,void 0,void 0,function(){return C(this,function(i){switch(i.label){case 0:return Wi!==null?[3,2]:[4,ii()];case 1:Wi=i.sent(),i.label=2;case 2:return[2,Wi.request(se({url:t,method:(n=e==null?void 0:e.method)!==null&&n!==void 0?n:"GET"},e))]}})})}Object.freeze({__proto__:null,getClient:ii,fetch:ts,Body:Qn,Client:Ql,Response:xl,get ResponseType(){return Rt}});function Qo(t,e,n){const i=t.slice();return i[12]=e[n],i[14]=n,i}function Zo(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F=t[5],R=[];for(let L=0;L<F.length;L+=1)R[L]=tl(Qo(t,F,L));const q=L=>je(R[L],1,1,()=>{R[L]=null});let O=!t[3]&&nl(),A=!t[3]&&t[8]&&il();return{c(){e=s("span"),n=s("span"),i=z(t[6]),o=v(),l=s("ul");for(let L=0;L<R.length;L+=1)R[L].c();u=v(),f=s("span"),c=z(t[7]),O&&O.c(),p=v(),d=s("span"),k=z(t[6]),_=z(ls),y=z(t[7]),A&&A.c(),g=oi(),a(n,"class","bracket svelte-gbh3pt"),a(n,"tabindex","0"),a(l,"class","svelte-gbh3pt"),a(f,"class","bracket svelte-gbh3pt"),a(f,"tabindex","0"),a(e,"class","svelte-gbh3pt"),Jn(e,"hidden",t[8]),a(d,"class","bracket svelte-gbh3pt"),a(d,"tabindex","0"),Jn(d,"hidden",!t[8])},m(L,P){m(L,e,P),r(e,n),r(n,i),r(e,o),r(e,l);for(let T=0;T<R.length;T+=1)R[T].m(l,null);r(e,u),r(e,f),r(f,c),O&&O.m(e,null),m(L,p,P),m(L,d,P),r(d,k),r(d,_),r(d,y),A&&A.m(L,P),m(L,g,P),b=!0,E||(W=[D(n,"click",t[11]),D(f,"click",t[11]),D(d,"click",t[11])],E=!0)},p(L,P){if((!b||P&64)&&Z(i,L[6]),P&1591){F=L[5];let T;for(T=0;T<F.length;T+=1){const U=Qo(L,F,T);R[T]?(R[T].p(U,P),We(R[T],1)):(R[T]=tl(U),R[T].c(),We(R[T],1),R[T].m(l,null))}for(li(),T=F.length;T<R.length;T+=1)q(T);ri()}(!b||P&128)&&Z(c,L[7]),L[3]?O&&(O.d(1),O=null):O||(O=nl(),O.c(),O.m(e,null)),P&256&&Jn(e,"hidden",L[8]),(!b||P&64)&&Z(k,L[6]),(!b||P&128)&&Z(y,L[7]),P&256&&Jn(d,"hidden",!L[8]),!L[3]&&L[8]?A||(A=il(),A.c(),A.m(g.parentNode,g)):A&&(A.d(1),A=null)},i(L){if(!b){for(let P=0;P<F.length;P+=1)We(R[P]);b=!0}},o(L){R=R.filter(Boolean);for(let P=0;P<R.length;P+=1)je(R[P]);b=!1},d(L){L&&h(e),ht(R,L),O&&O.d(),L&&h(p),L&&h(d),A&&A.d(L),L&&h(g),E=!1,ue(W)}}}function $o(t){let e,n,i=t[12]+"",o,l;return{c(){e=s("span"),n=z('"'),o=z(i),l=z('":'),a(e,"class","key")},m(u,f){m(u,e,f),r(e,n),r(e,o),r(e,l)},p(u,f){f&32&&i!==(i=u[12]+"")&&Z(o,i)},d(u){u&&h(e)}}}function ns(t){let e,n=t[10](t[0][t[12]])+"",i,o,l=t[14]<t[5].length-1&&el();return{c(){e=s("span"),i=z(n),l&&l.c(),a(e,"class",o="val "+t[9](t[0][t[12]])+" svelte-gbh3pt")},m(u,f){m(u,e,f),r(e,i),l&&l.m(e,null)},p(u,f){f&33&&n!==(n=u[10](u[0][u[12]])+"")&&Z(i,n),u[14]<u[5].length-1?l||(l=el(),l.c(),l.m(e,null)):l&&(l.d(1),l=null),f&33&&o!==(o="val "+u[9](u[0][u[12]])+" svelte-gbh3pt")&&a(e,"class",o)},i:J,o:J,d(u){u&&h(e),l&&l.d()}}}function is(t){let e,n;return e=new Zl({props:{json:t[0][t[12]],depth:t[1],_lvl:t[2]+1,_last:t[14]===t[5].length-1}}),{c(){ei(e.$$.fragment)},m(i,o){Yt(e,i,o),n=!0},p(i,o){const l={};o&33&&(l.json=i[0][i[12]]),o&2&&(l.depth=i[1]),o&4&&(l._lvl=i[2]+1),o&32&&(l._last=i[14]===i[5].length-1),e.$set(l)},i(i){n||(We(e.$$.fragment,i),n=!0)},o(i){je(e.$$.fragment,i),n=!1},d(i){Kt(e,i)}}}function el(t){let e;return{c(){e=s("span"),e.textContent=",",a(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function tl(t){let e,n,i,o,l,u,f,c=!t[4]&&$o(t);const p=[is,ns],d=[];function k(_,y){return y&33&&(i=null),i==null&&(i=_[9](_[0][_[12]])==="object"),i?0:1}return o=k(t,-1),l=d[o]=p[o](t),{c(){e=s("li"),c&&c.c(),n=v(),l.c(),u=v()},m(_,y){m(_,e,y),c&&c.m(e,null),r(e,n),d[o].m(e,null),r(e,u),f=!0},p(_,y){_[4]?c&&(c.d(1),c=null):c?c.p(_,y):(c=$o(_),c.c(),c.m(e,n));let g=o;o=k(_,y),o===g?d[o].p(_,y):(li(),je(d[g],1,1,()=>{d[g]=null}),ri(),l=d[o],l?l.p(_,y):(l=d[o]=p[o](_),l.c()),We(l,1),l.m(e,u))},i(_){f||(We(l),f=!0)},o(_){je(l),f=!1},d(_){_&&h(e),c&&c.d(),d[o].d()}}}function nl(t){let e;return{c(){e=s("span"),e.textContent=",",a(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function il(t){let e;return{c(){e=s("span"),e.textContent=",",a(e,"class","comma svelte-gbh3pt")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function os(t){let e,n,i=t[5].length&&Zo(t);return{c(){i&&i.c(),e=oi()},m(o,l){i&&i.m(o,l),m(o,e,l),n=!0},p(o,[l]){o[5].length?i?(i.p(o,l),l&32&&We(i,1)):(i=Zo(o),i.c(),We(i,1),i.m(e.parentNode,e)):i&&(li(),je(i,1,1,()=>{i=null}),ri())},i(o){n||(We(i),n=!0)},o(o){je(i),n=!1},d(o){i&&i.d(o),o&&h(e)}}}const ls="...";function rs(t,e,n){let{json:i}=e,{depth:o=1/0}=e,{_lvl:l=0}=e,{_last:u=!0}=e;const f=b=>b===null?"null":typeof b;let c,p,d,k,_;const y=b=>{switch(f(b)){case"string":return`"${b}"`;case"function":return"f () {...}";case"symbol":return b.toString();default:return b}},g=()=>{n(8,_=!_)};return t.$$set=b=>{"json"in b&&n(0,i=b.json),"depth"in b&&n(1,o=b.depth),"_lvl"in b&&n(2,l=b._lvl),"_last"in b&&n(3,u=b._last)},t.$$.update=()=>{t.$$.dirty&17&&(n(5,c=f(i)==="object"?Object.keys(i):[]),n(4,p=Array.isArray(i)),n(6,d=p?"[":"{"),n(7,k=p?"]":"}")),t.$$.dirty&6&&n(8,_=o<l)},[i,o,l,u,p,c,d,k,_,f,y,g]}class Zl extends Te{constructor(e){super(),Ce(this,e,rs,os,be,{json:0,depth:1,_lvl:2,_last:3})}}function ss(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F,R,q,O,A,L,P,T,U,B,Y,$,ge,te,oe,x,ye,I,Q,le,ae,ee,_e,ce,we,ne,Ae,Se;return we=new Zl({props:{json:t[4]}}),{c(){e=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",f=s("option"),f.textContent="DELETE",c=v(),p=s("br"),d=v(),k=s("textarea"),_=v(),y=s("br"),g=v(),b=s("button"),b.textContent="Make request",E=v(),W=s("br"),F=v(),R=s("h3"),R.textContent="HTTP Form",q=v(),O=s("div"),A=s("input"),L=v(),P=s("input"),T=v(),U=s("br"),B=v(),Y=s("label"),$=s("input"),ge=z(`
|
|
Multipart`),te=v(),oe=s("br"),x=v(),ye=s("br"),I=v(),Q=s("button"),Q.textContent="Post it",le=v(),ae=s("br"),ee=v(),_e=s("br"),ce=v(),ei(we.$$.fragment),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,f.__value="DELETE",f.value=f.__value,a(n,"class","input"),a(n,"id","request-method"),t[0]===void 0&&zt(()=>t[9].call(n)),a(k,"class","input h-auto w-100%"),a(k,"id","request-body"),a(k,"placeholder","Request body"),a(k,"rows","5"),a(b,"class","btn"),a(b,"id","make-request"),a(A,"class","input"),a(P,"class","input"),a(O,"class","flex gap-2 children:grow"),a($,"type","checkbox"),a(Q,"class","btn"),a(Q,"type","button")},m(N,V){m(N,e,V),r(e,n),r(n,i),r(n,o),r(n,l),r(n,u),r(n,f),Dt(n,t[0]),r(e,c),r(e,p),r(e,d),r(e,k),G(k,t[1]),r(e,_),r(e,y),r(e,g),r(e,b),m(N,E,V),m(N,W,V),m(N,F,V),m(N,R,V),m(N,q,V),m(N,O,V),r(O,A),G(A,t[2]),r(O,L),r(O,P),G(P,t[3]),m(N,T,V),m(N,U,V),m(N,B,V),m(N,Y,V),r(Y,$),$.checked=t[5],r(Y,ge),m(N,te,V),m(N,oe,V),m(N,x,V),m(N,ye,V),m(N,I,V),m(N,Q,V),m(N,le,V),m(N,ae,V),m(N,ee,V),m(N,_e,V),m(N,ce,V),Yt(we,N,V),ne=!0,Ae||(Se=[D(n,"change",t[9]),D(k,"input",t[10]),D(e,"submit",Zn(t[6])),D(A,"input",t[11]),D(P,"input",t[12]),D($,"change",t[13]),D(Q,"click",t[7])],Ae=!0)},p(N,[V]){V&1&&Dt(n,N[0]),V&2&&G(k,N[1]),V&4&&A.value!==N[2]&&G(A,N[2]),V&8&&P.value!==N[3]&&G(P,N[3]),V&32&&($.checked=N[5]);const Ie={};V&16&&(Ie.json=N[4]),we.$set(Ie)},i(N){ne||(We(we.$$.fragment,N),ne=!0)},o(N){je(we.$$.fragment,N),ne=!1},d(N){N&&h(e),N&&h(E),N&&h(W),N&&h(F),N&&h(R),N&&h(q),N&&h(O),N&&h(T),N&&h(U),N&&h(B),N&&h(Y),N&&h(te),N&&h(oe),N&&h(x),N&&h(ye),N&&h(I),N&&h(Q),N&&h(le),N&&h(ae),N&&h(ee),N&&h(_e),N&&h(ce),Kt(we,N),Ae=!1,ue(Se)}}}function us(t,e,n){let i="GET",o="",{onMessage:l}=e;async function u(){const W=await ii().catch(q=>{throw l(q),q}),R={url:"http://localhost:3003",method:i||"GET"||"GET"};o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]")?R.body=Qn.json(JSON.parse(o)):o!==""&&(R.body=Qn.text(o)),W.request(R).then(l).catch(l)}let f="baz",c="qux",p=null,d=!0;async function k(){const W=await ii().catch(F=>{throw l(F),F});n(4,p=await W.request({url:"http://localhost:3003",method:"POST",body:Qn.form({foo:f,bar:c}),headers:d?{"Content-Type":"multipart/form-data"}:void 0,responseType:Rt.Text}))}function _(){i=Pi(this),n(0,i)}function y(){o=this.value,n(1,o)}function g(){f=this.value,n(2,f)}function b(){c=this.value,n(3,c)}function E(){d=this.checked,n(5,d)}return t.$$set=W=>{"onMessage"in W&&n(8,l=W.onMessage)},[i,o,f,c,p,d,u,k,l,_,y,g,b,E]}class as extends Te{constructor(e){super(),Ce(this,e,us,ss,be,{onMessage:8})}}function cs(t){let e,n,i;return{c(){e=s("button"),e.textContent="Send test notification",a(e,"class","btn"),a(e,"id","notification")},m(o,l){m(o,e,l),n||(i=D(e,"click",fs),n=!0)},p:J,i:J,o:J,d(o){o&&h(e),n=!1,i()}}}function fs(){new Notification("Notification title",{body:"This is the notification body"})}function ds(t,e,n){let{onMessage:i}=e;return t.$$set=o=>{"onMessage"in o&&n(0,i=o.onMessage)},[i]}class ps extends Te{constructor(e){super(),Ce(this,e,ds,cs,be,{onMessage:0})}}function ol(t,e,n){const i=t.slice();return i[67]=e[n],i}function ll(t,e,n){const i=t.slice();return i[70]=e[n],i}function rl(t){let e,n,i,o,l,u,f=Object.keys(t[1]),c=[];for(let p=0;p<f.length;p+=1)c[p]=sl(ll(t,f,p));return{c(){e=s("span"),e.textContent="Selected window:",n=v(),i=s("select"),o=s("option"),o.textContent="Choose a window...";for(let p=0;p<c.length;p+=1)c[p].c();a(e,"class","font-700 text-sm"),o.__value="",o.value=o.__value,o.disabled=!0,o.selected=!0,a(i,"class","input"),t[0]===void 0&&zt(()=>t[39].call(i))},m(p,d){m(p,e,d),m(p,n,d),m(p,i,d),r(i,o);for(let k=0;k<c.length;k+=1)c[k].m(i,null);Dt(i,t[0]),l||(u=D(i,"change",t[39]),l=!0)},p(p,d){if(d[0]&2){f=Object.keys(p[1]);let k;for(k=0;k<f.length;k+=1){const _=ll(p,f,k);c[k]?c[k].p(_,d):(c[k]=sl(_),c[k].c(),c[k].m(i,null))}for(;k<c.length;k+=1)c[k].d(1);c.length=f.length}d[0]&3&&Dt(i,p[0])},d(p){p&&h(e),p&&h(n),p&&h(i),ht(c,p),l=!1,u()}}}function sl(t){let e,n=t[70]+"",i,o;return{c(){e=s("option"),i=z(n),e.__value=o=t[70],e.value=e.__value},m(l,u){m(l,e,u),r(e,i)},p(l,u){u[0]&2&&n!==(n=l[70]+"")&&Z(i,n),u[0]&2&&o!==(o=l[70])&&(e.__value=o,e.value=e.__value)},d(l){l&&h(e)}}}function ul(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F,R,q,O,A,L,P,T,U,B,Y,$,ge,te,oe,x,ye,I,Q,le,ae,ee,_e,ce,we,ne,Ae,Se,N,V,Ie,Oe,Le,fe,he,de,De,it,me,pe,H,ie,X,ke,Zt,vt,$t,Ne,en,Ve,_t,tn,K,It,ot,Nt,Pe,bt,gt,yt,ze,He,Re,lt,jt,rt,Ht,st=t[26].width+"",wt,Ft,kt,Xi,nn=t[26].height+"",ui,Yi,Ge,on,Ki,ln,xi,rn=t[27].width+"",ai,Qi,sn,Zi,un=t[27].height+"",ci,$i,Mt,Je,an,eo,cn,to,fn=t[26].toLogical(t[23]).width+"",fi,no,dn,io,pn=t[26].toLogical(t[23]).height+"",di,oo,Xe,hn,lo,mn,ro,vn=t[27].toLogical(t[23]).width+"",pi,so,_n,uo,bn=t[27].toLogical(t[23]).height+"",hi,ao,Ct,Ye,gn,co,yn,fo,wn=t[24].x+"",mi,po,kn,ho,Mn=t[24].y+"",vi,mo,Ke,Cn,vo,Tn,_o,An=t[25].x+"",_i,bo,Ln,go,En=t[25].y+"",bi,yo,Tt,xe,Sn,wo,On,ko,Dn=t[24].toLogical(t[23]).x+"",gi,Mo,zn,Co,Wn=t[24].toLogical(t[23]).y+"",yi,To,Qe,Pn,Ao,Rn,Lo,In=t[25].toLogical(t[23]).x+"",wi,Eo,Nn,So,jn=t[25].toLogical(t[23]).y+"",ki,Mi,Ci,Ti,Ut,Ai,Fe,Hn,At,Oo,Do,Fn,Lt,zo,Wo,Un,Et,Po,Li,Ue,qn,Ro,qe,Io,Bn,No,Ze,jo,Vn,Ho,$e,Ei,Si,Oi,ut,at,et,Fo,qt,Uo,ct,tt,qo,Bt,Di,Bo,St=t[29],Ee=[];for(let w=0;w<St.length;w+=1)Ee[w]=al(ol(t,St,w));return{c(){e=s("br"),n=v(),i=s("div"),o=s("button"),o.textContent="Center",l=v(),u=s("button"),u.textContent="Minimize",f=v(),c=s("button"),c.textContent="Hide",p=v(),d=s("button"),d.textContent="Change icon",k=v(),_=s("button"),_.textContent="Request attention",y=v(),g=s("br"),b=v(),E=s("div"),W=s("label"),F=z(`Maximized
|
|
`),R=s("input"),q=v(),O=s("label"),A=z(`Resizable
|
|
`),L=s("input"),P=v(),T=s("label"),U=z(`Has decorations
|
|
`),B=s("input"),Y=v(),$=s("label"),ge=z(`Always on top
|
|
`),te=s("input"),oe=v(),x=s("label"),ye=z(`Fullscreen
|
|
`),I=s("input"),Q=v(),le=s("br"),ae=v(),ee=s("div"),_e=s("div"),ce=s("div"),we=z(`X
|
|
`),ne=s("input"),Ae=v(),Se=s("div"),N=z(`Y
|
|
`),V=s("input"),Ie=v(),Oe=s("div"),Le=s("div"),fe=z(`Width
|
|
`),he=s("input"),de=v(),De=s("div"),it=z(`Height
|
|
`),me=s("input"),pe=v(),H=s("div"),ie=s("div"),X=z(`Min width
|
|
`),ke=s("input"),Zt=v(),vt=s("div"),$t=z(`Min height
|
|
`),Ne=s("input"),en=v(),Ve=s("div"),_t=s("div"),tn=z(`Max width
|
|
`),K=s("input"),It=v(),ot=s("div"),Nt=z(`Max height
|
|
`),Pe=s("input"),bt=v(),gt=s("br"),yt=v(),ze=s("div"),He=s("div"),Re=s("div"),lt=s("div"),lt.textContent="Inner Size",jt=v(),rt=s("span"),Ht=z("Width: "),wt=z(st),Ft=v(),kt=s("span"),Xi=z("Height: "),ui=z(nn),Yi=v(),Ge=s("div"),on=s("div"),on.textContent="Outer Size",Ki=v(),ln=s("span"),xi=z("Width: "),ai=z(rn),Qi=v(),sn=s("span"),Zi=z("Height: "),ci=z(un),$i=v(),Mt=s("div"),Je=s("div"),an=s("div"),an.textContent="Inner Logical Size",eo=v(),cn=s("span"),to=z("Width: "),fi=z(fn),no=v(),dn=s("span"),io=z("Height: "),di=z(pn),oo=v(),Xe=s("div"),hn=s("div"),hn.textContent="Outer Logical Size",lo=v(),mn=s("span"),ro=z("Width: "),pi=z(vn),so=v(),_n=s("span"),uo=z("Height: "),hi=z(bn),ao=v(),Ct=s("div"),Ye=s("div"),gn=s("div"),gn.textContent="Inner Position",co=v(),yn=s("span"),fo=z("x: "),mi=z(wn),po=v(),kn=s("span"),ho=z("y: "),vi=z(Mn),mo=v(),Ke=s("div"),Cn=s("div"),Cn.textContent="Outer Position",vo=v(),Tn=s("span"),_o=z("x: "),_i=z(An),bo=v(),Ln=s("span"),go=z("y: "),bi=z(En),yo=v(),Tt=s("div"),xe=s("div"),Sn=s("div"),Sn.textContent="Inner Logical Position",wo=v(),On=s("span"),ko=z("x: "),gi=z(Dn),Mo=v(),zn=s("span"),Co=z("y: "),yi=z(Wn),To=v(),Qe=s("div"),Pn=s("div"),Pn.textContent="Outer Logical Position",Ao=v(),Rn=s("span"),Lo=z("x: "),wi=z(In),Eo=v(),Nn=s("span"),So=z("y: "),ki=z(jn),Mi=v(),Ci=s("br"),Ti=v(),Ut=s("h4"),Ut.textContent="Cursor",Ai=v(),Fe=s("div"),Hn=s("label"),At=s("input"),Oo=z(`
|
|
Grab`),Do=v(),Fn=s("label"),Lt=s("input"),zo=z(`
|
|
Visible`),Wo=v(),Un=s("label"),Et=s("input"),Po=z(`
|
|
Ignore events`),Li=v(),Ue=s("div"),qn=s("label"),Ro=z(`Icon
|
|
`),qe=s("select");for(let w=0;w<Ee.length;w+=1)Ee[w].c();Io=v(),Bn=s("label"),No=z(`X position
|
|
`),Ze=s("input"),jo=v(),Vn=s("label"),Ho=z(`Y position
|
|
`),$e=s("input"),Ei=v(),Si=s("br"),Oi=v(),ut=s("div"),at=s("form"),et=s("input"),Fo=v(),qt=s("button"),qt.textContent="Set title",Uo=v(),ct=s("form"),tt=s("input"),qo=v(),Bt=s("button"),Bt.textContent="Open URL",a(o,"class","btn"),a(o,"title","Unminimizes after 2 seconds"),a(u,"class","btn"),a(u,"title","Unminimizes after 2 seconds"),a(c,"class","btn"),a(c,"title","Visible again after 2 seconds"),a(d,"class","btn"),a(_,"class","btn"),a(_,"title","Minimizes the window, requests attention for 3s and then resets it"),a(i,"class","flex flex-wrap gap-2"),a(R,"type","checkbox"),a(L,"type","checkbox"),a(B,"type","checkbox"),a(te,"type","checkbox"),a(I,"type","checkbox"),a(E,"class","flex flex-wrap gap-2"),a(ne,"class","input"),a(ne,"type","number"),a(ne,"min","0"),a(V,"class","input"),a(V,"type","number"),a(V,"min","0"),a(_e,"class","flex children:grow flex-col"),a(he,"class","input"),a(he,"type","number"),a(he,"min","400"),a(me,"class","input"),a(me,"type","number"),a(me,"min","400"),a(Oe,"class","flex children:grow flex-col"),a(ke,"class","input"),a(ke,"type","number"),a(Ne,"class","input"),a(Ne,"type","number"),a(H,"class","flex children:grow flex-col"),a(K,"class","input"),a(K,"type","number"),a(K,"min","800"),a(Pe,"class","input"),a(Pe,"type","number"),a(Pe,"min","400"),a(Ve,"class","flex children:grow flex-col"),a(ee,"class","flex flex-row gap-2 flex-wrap"),a(lt,"class","text-accent dark:text-darkAccent font-700"),a(Re,"class","grow"),a(on,"class","text-accent dark:text-darkAccent font-700"),a(Ge,"class","grow"),a(He,"class","flex"),a(an,"class","text-accent dark:text-darkAccent font-700"),a(Je,"class","grow"),a(hn,"class","text-accent dark:text-darkAccent font-700"),a(Xe,"class","grow"),a(Mt,"class","flex"),a(gn,"class","text-accent dark:text-darkAccent font-700"),a(Ye,"class","grow"),a(Cn,"class","text-accent dark:text-darkAccent font-700"),a(Ke,"class","grow"),a(Ct,"class","flex"),a(Sn,"class","text-accent dark:text-darkAccent font-700"),a(xe,"class","grow"),a(Pn,"class","text-accent dark:text-darkAccent font-700"),a(Qe,"class","grow"),a(Tt,"class","flex"),a(Ut,"class","mb-2"),a(At,"type","checkbox"),a(Lt,"type","checkbox"),a(Et,"type","checkbox"),a(Fe,"class","flex gap-2"),a(qe,"class","input"),t[19]===void 0&&zt(()=>t[57].call(qe)),a(Ze,"class","input"),a(Ze,"type","number"),a($e,"class","input"),a($e,"type","number"),a(Ue,"class","flex gap-2"),a(et,"class","input grow"),a(et,"id","title"),a(qt,"class","btn"),a(qt,"type","submit"),a(at,"class","flex gap-1"),a(tt,"class","input grow"),a(tt,"id","url"),a(Bt,"class","btn"),a(Bt,"id","open-url"),a(ct,"class","flex gap-1"),a(ut,"class","flex flex-col gap-1")},m(w,j){m(w,e,j),m(w,n,j),m(w,i,j),r(i,o),r(i,l),r(i,u),r(i,f),r(i,c),r(i,p),r(i,d),r(i,k),r(i,_),m(w,y,j),m(w,g,j),m(w,b,j),m(w,E,j),r(E,W),r(W,F),r(W,R),R.checked=t[3],r(E,q),r(E,O),r(O,A),r(O,L),L.checked=t[2],r(E,P),r(E,T),r(T,U),r(T,B),B.checked=t[4],r(E,Y),r(E,$),r($,ge),r($,te),te.checked=t[5],r(E,oe),r(E,x),r(x,ye),r(x,I),I.checked=t[6],m(w,Q,j),m(w,le,j),m(w,ae,j),m(w,ee,j),r(ee,_e),r(_e,ce),r(ce,we),r(ce,ne),G(ne,t[13]),r(_e,Ae),r(_e,Se),r(Se,N),r(Se,V),G(V,t[14]),r(ee,Ie),r(ee,Oe),r(Oe,Le),r(Le,fe),r(Le,he),G(he,t[7]),r(Oe,de),r(Oe,De),r(De,it),r(De,me),G(me,t[8]),r(ee,pe),r(ee,H),r(H,ie),r(ie,X),r(ie,ke),G(ke,t[9]),r(H,Zt),r(H,vt),r(vt,$t),r(vt,Ne),G(Ne,t[10]),r(ee,en),r(ee,Ve),r(Ve,_t),r(_t,tn),r(_t,K),G(K,t[11]),r(Ve,It),r(Ve,ot),r(ot,Nt),r(ot,Pe),G(Pe,t[12]),m(w,bt,j),m(w,gt,j),m(w,yt,j),m(w,ze,j),r(ze,He),r(He,Re),r(Re,lt),r(Re,jt),r(Re,rt),r(rt,Ht),r(rt,wt),r(Re,Ft),r(Re,kt),r(kt,Xi),r(kt,ui),r(He,Yi),r(He,Ge),r(Ge,on),r(Ge,Ki),r(Ge,ln),r(ln,xi),r(ln,ai),r(Ge,Qi),r(Ge,sn),r(sn,Zi),r(sn,ci),r(ze,$i),r(ze,Mt),r(Mt,Je),r(Je,an),r(Je,eo),r(Je,cn),r(cn,to),r(cn,fi),r(Je,no),r(Je,dn),r(dn,io),r(dn,di),r(Mt,oo),r(Mt,Xe),r(Xe,hn),r(Xe,lo),r(Xe,mn),r(mn,ro),r(mn,pi),r(Xe,so),r(Xe,_n),r(_n,uo),r(_n,hi),r(ze,ao),r(ze,Ct),r(Ct,Ye),r(Ye,gn),r(Ye,co),r(Ye,yn),r(yn,fo),r(yn,mi),r(Ye,po),r(Ye,kn),r(kn,ho),r(kn,vi),r(Ct,mo),r(Ct,Ke),r(Ke,Cn),r(Ke,vo),r(Ke,Tn),r(Tn,_o),r(Tn,_i),r(Ke,bo),r(Ke,Ln),r(Ln,go),r(Ln,bi),r(ze,yo),r(ze,Tt),r(Tt,xe),r(xe,Sn),r(xe,wo),r(xe,On),r(On,ko),r(On,gi),r(xe,Mo),r(xe,zn),r(zn,Co),r(zn,yi),r(Tt,To),r(Tt,Qe),r(Qe,Pn),r(Qe,Ao),r(Qe,Rn),r(Rn,Lo),r(Rn,wi),r(Qe,Eo),r(Qe,Nn),r(Nn,So),r(Nn,ki),m(w,Mi,j),m(w,Ci,j),m(w,Ti,j),m(w,Ut,j),m(w,Ai,j),m(w,Fe,j),r(Fe,Hn),r(Hn,At),At.checked=t[15],r(Hn,Oo),r(Fe,Do),r(Fe,Fn),r(Fn,Lt),Lt.checked=t[16],r(Fn,zo),r(Fe,Wo),r(Fe,Un),r(Un,Et),Et.checked=t[20],r(Un,Po),m(w,Li,j),m(w,Ue,j),r(Ue,qn),r(qn,Ro),r(qn,qe);for(let Me=0;Me<Ee.length;Me+=1)Ee[Me].m(qe,null);Dt(qe,t[19]),r(Ue,Io),r(Ue,Bn),r(Bn,No),r(Bn,Ze),G(Ze,t[17]),r(Ue,jo),r(Ue,Vn),r(Vn,Ho),r(Vn,$e),G($e,t[18]),m(w,Ei,j),m(w,Si,j),m(w,Oi,j),m(w,ut,j),r(ut,at),r(at,et),G(et,t[28]),r(at,Fo),r(at,qt),r(ut,Uo),r(ut,ct),r(ct,tt),G(tt,t[22]),r(ct,qo),r(ct,Bt),Di||(Bo=[D(o,"click",t[40]),D(u,"click",t[33]),D(c,"click",t[32]),D(d,"click",t[34]),D(_,"click",t[36]),D(R,"change",t[41]),D(L,"change",t[42]),D(B,"change",t[43]),D(te,"change",t[44]),D(I,"change",t[45]),D(ne,"input",t[46]),D(V,"input",t[47]),D(he,"input",t[48]),D(me,"input",t[49]),D(ke,"input",t[50]),D(Ne,"input",t[51]),D(K,"input",t[52]),D(Pe,"input",t[53]),D(At,"change",t[54]),D(Lt,"change",t[55]),D(Et,"change",t[56]),D(qe,"change",t[57]),D(Ze,"input",t[58]),D($e,"input",t[59]),D(et,"input",t[60]),D(at,"submit",Zn(t[31])),D(tt,"input",t[61]),D(ct,"submit",Zn(t[30]))],Di=!0)},p(w,j){if(j[0]&8&&(R.checked=w[3]),j[0]&4&&(L.checked=w[2]),j[0]&16&&(B.checked=w[4]),j[0]&32&&(te.checked=w[5]),j[0]&64&&(I.checked=w[6]),j[0]&8192&&re(ne.value)!==w[13]&&G(ne,w[13]),j[0]&16384&&re(V.value)!==w[14]&&G(V,w[14]),j[0]&128&&re(he.value)!==w[7]&&G(he,w[7]),j[0]&256&&re(me.value)!==w[8]&&G(me,w[8]),j[0]&512&&re(ke.value)!==w[9]&&G(ke,w[9]),j[0]&1024&&re(Ne.value)!==w[10]&&G(Ne,w[10]),j[0]&2048&&re(K.value)!==w[11]&&G(K,w[11]),j[0]&4096&&re(Pe.value)!==w[12]&&G(Pe,w[12]),j[0]&67108864&&st!==(st=w[26].width+"")&&Z(wt,st),j[0]&67108864&&nn!==(nn=w[26].height+"")&&Z(ui,nn),j[0]&134217728&&rn!==(rn=w[27].width+"")&&Z(ai,rn),j[0]&134217728&&un!==(un=w[27].height+"")&&Z(ci,un),j[0]&75497472&&fn!==(fn=w[26].toLogical(w[23]).width+"")&&Z(fi,fn),j[0]&75497472&&pn!==(pn=w[26].toLogical(w[23]).height+"")&&Z(di,pn),j[0]&142606336&&vn!==(vn=w[27].toLogical(w[23]).width+"")&&Z(pi,vn),j[0]&142606336&&bn!==(bn=w[27].toLogical(w[23]).height+"")&&Z(hi,bn),j[0]&16777216&&wn!==(wn=w[24].x+"")&&Z(mi,wn),j[0]&16777216&&Mn!==(Mn=w[24].y+"")&&Z(vi,Mn),j[0]&33554432&&An!==(An=w[25].x+"")&&Z(_i,An),j[0]&33554432&&En!==(En=w[25].y+"")&&Z(bi,En),j[0]&25165824&&Dn!==(Dn=w[24].toLogical(w[23]).x+"")&&Z(gi,Dn),j[0]&25165824&&Wn!==(Wn=w[24].toLogical(w[23]).y+"")&&Z(yi,Wn),j[0]&41943040&&In!==(In=w[25].toLogical(w[23]).x+"")&&Z(wi,In),j[0]&41943040&&jn!==(jn=w[25].toLogical(w[23]).y+"")&&Z(ki,jn),j[0]&32768&&(At.checked=w[15]),j[0]&65536&&(Lt.checked=w[16]),j[0]&1048576&&(Et.checked=w[20]),j[0]&536870912){St=w[29];let Me;for(Me=0;Me<St.length;Me+=1){const Vo=ol(w,St,Me);Ee[Me]?Ee[Me].p(Vo,j):(Ee[Me]=al(Vo),Ee[Me].c(),Ee[Me].m(qe,null))}for(;Me<Ee.length;Me+=1)Ee[Me].d(1);Ee.length=St.length}j[0]&537395200&&Dt(qe,w[19]),j[0]&131072&&re(Ze.value)!==w[17]&&G(Ze,w[17]),j[0]&262144&&re($e.value)!==w[18]&&G($e,w[18]),j[0]&268435456&&et.value!==w[28]&&G(et,w[28]),j[0]&4194304&&tt.value!==w[22]&&G(tt,w[22])},d(w){w&&h(e),w&&h(n),w&&h(i),w&&h(y),w&&h(g),w&&h(b),w&&h(E),w&&h(Q),w&&h(le),w&&h(ae),w&&h(ee),w&&h(bt),w&&h(gt),w&&h(yt),w&&h(ze),w&&h(Mi),w&&h(Ci),w&&h(Ti),w&&h(Ut),w&&h(Ai),w&&h(Fe),w&&h(Li),w&&h(Ue),ht(Ee,w),w&&h(Ei),w&&h(Si),w&&h(Oi),w&&h(ut),Di=!1,ue(Bo)}}}function al(t){let e,n=t[67]+"",i,o;return{c(){e=s("option"),i=z(n),e.__value=o=t[67],e.value=e.__value},m(l,u){m(l,e,u),r(e,i)},p:J,d(l){l&&h(e)}}}function hs(t){let e,n,i,o,l,u,f,c,p=Object.keys(t[1]).length>=1,d,k,_,y=p&&rl(t),g=t[1][t[0]]&&ul(t);return{c(){e=s("div"),n=s("div"),i=s("input"),o=v(),l=s("button"),l.textContent="New window",u=v(),f=s("br"),c=v(),y&&y.c(),d=v(),g&&g.c(),a(i,"class","input grow"),a(i,"type","text"),a(i,"placeholder","New Window label.."),a(l,"class","btn"),a(n,"class","flex gap-1"),a(e,"class","flex flex-col children:grow gap-2")},m(b,E){m(b,e,E),r(e,n),r(n,i),G(i,t[21]),r(n,o),r(n,l),r(e,u),r(e,f),r(e,c),y&&y.m(e,null),r(e,d),g&&g.m(e,null),k||(_=[D(i,"input",t[38]),D(l,"click",t[35])],k=!0)},p(b,E){E[0]&2097152&&i.value!==b[21]&&G(i,b[21]),E[0]&2&&(p=Object.keys(b[1]).length>=1),p?y?y.p(b,E):(y=rl(b),y.c(),y.m(e,d)):y&&(y.d(1),y=null),b[1][b[0]]?g?g.p(b,E):(g=ul(b),g.c(),g.m(e,null)):g&&(g.d(1),g=null)},i:J,o:J,d(b){b&&h(e),y&&y.d(),g&&g.d(),k=!1,ue(_)}}}function ms(t,e,n){let i=Be.label;const o={[Be.label]:Be},l=["default","crosshair","hand","arrow","move","text","wait","help","progress","notAllowed","contextMenu","cell","verticalText","alias","copy","noDrop","grab","grabbing","allScroll","zoomIn","zoomOut","eResize","nResize","neResize","nwResize","sResize","seResize","swResize","wResize","ewResize","nsResize","neswResize","nwseResize","colResize","rowResize"];let{onMessage:u}=e,f,c="https://tauri.app",p=!0,d=!1,k=!0,_=!1,y=!1,g=null,b=null,E=null,W=null,F=null,R=null,q=null,O=null,A=1,L=new nt(q,O),P=new nt(q,O),T=new pt(g,b),U=new pt(g,b),B,Y,$=!1,ge=!0,te=null,oe=null,x="default",ye=!1,I="Awesome Tauri Example!";function Q(){Fi(c)}function le(){o[i].setTitle(I)}function ae(){o[i].hide(),setTimeout(o[i].show,2e3)}function ee(){o[i].minimize(),setTimeout(o[i].unminimize,2e3)}function _e(){Vi({multiple:!1}).then(K=>{typeof K=="string"&&o[i].setIcon(K)})}function ce(){if(!f)return;const K=new Wt(f);n(1,o[f]=K,o),K.once("tauri://error",function(){u("Error creating new webview")})}function we(){o[i].innerSize().then(K=>{n(26,T=K),n(7,g=T.width),n(8,b=T.height)}),o[i].outerSize().then(K=>{n(27,U=K)})}function ne(){o[i].innerPosition().then(K=>{n(24,L=K)}),o[i].outerPosition().then(K=>{n(25,P=K),n(13,q=P.x),n(14,O=P.y)})}async function Ae(K){!K||(B&&B(),Y&&Y(),Y=await K.listen("tauri://move",ne),B=await K.listen("tauri://resize",we))}async function Se(){await o[i].minimize(),await o[i].requestUserAttention(xt.Critical),await new Promise(K=>setTimeout(K,3e3)),await o[i].requestUserAttention(null)}function N(){f=this.value,n(21,f)}function V(){i=Pi(this),n(0,i),n(1,o)}const Ie=()=>o[i].center();function Oe(){d=this.checked,n(3,d)}function Le(){p=this.checked,n(2,p)}function fe(){k=this.checked,n(4,k)}function he(){_=this.checked,n(5,_)}function de(){y=this.checked,n(6,y)}function De(){q=re(this.value),n(13,q)}function it(){O=re(this.value),n(14,O)}function me(){g=re(this.value),n(7,g)}function pe(){b=re(this.value),n(8,b)}function H(){E=re(this.value),n(9,E)}function ie(){W=re(this.value),n(10,W)}function X(){F=re(this.value),n(11,F)}function ke(){R=re(this.value),n(12,R)}function Zt(){$=this.checked,n(15,$)}function vt(){ge=this.checked,n(16,ge)}function $t(){ye=this.checked,n(20,ye)}function Ne(){x=Pi(this),n(19,x),n(29,l)}function en(){te=re(this.value),n(17,te)}function Ve(){oe=re(this.value),n(18,oe)}function _t(){I=this.value,n(28,I)}function tn(){c=this.value,n(22,c)}return t.$$set=K=>{"onMessage"in K&&n(37,u=K.onMessage)},t.$$.update=()=>{var K,It,ot,Nt,Pe,bt,gt,yt,ze,He,Re,lt,jt,rt,Ht,st,wt,Ft;t.$$.dirty[0]&3&&(o[i],ne(),we()),t.$$.dirty[0]&7&&((K=o[i])==null||K.setResizable(p)),t.$$.dirty[0]&11&&(d?(It=o[i])==null||It.maximize():(ot=o[i])==null||ot.unmaximize()),t.$$.dirty[0]&19&&((Nt=o[i])==null||Nt.setDecorations(k)),t.$$.dirty[0]&35&&((Pe=o[i])==null||Pe.setAlwaysOnTop(_)),t.$$.dirty[0]&67&&((bt=o[i])==null||bt.setFullscreen(y)),t.$$.dirty[0]&387&&g&&b&&((gt=o[i])==null||gt.setSize(new pt(g,b))),t.$$.dirty[0]&1539&&(E&&W?(yt=o[i])==null||yt.setMinSize(new ni(E,W)):(ze=o[i])==null||ze.setMinSize(null)),t.$$.dirty[0]&6147&&(F>800&&R>400?(He=o[i])==null||He.setMaxSize(new ni(F,R)):(Re=o[i])==null||Re.setMaxSize(null)),t.$$.dirty[0]&24579&&q!==null&&O!==null&&((lt=o[i])==null||lt.setPosition(new nt(q,O))),t.$$.dirty[0]&3&&((jt=o[i])==null||jt.scaleFactor().then(kt=>n(23,A=kt))),t.$$.dirty[0]&3&&Ae(o[i]),t.$$.dirty[0]&32771&&((rt=o[i])==null||rt.setCursorGrab($)),t.$$.dirty[0]&65539&&((Ht=o[i])==null||Ht.setCursorVisible(ge)),t.$$.dirty[0]&524291&&((st=o[i])==null||st.setCursorIcon(x)),t.$$.dirty[0]&393219&&te!==null&&oe!==null&&((wt=o[i])==null||wt.setCursorPosition(new nt(te,oe))),t.$$.dirty[0]&1048579&&((Ft=o[i])==null||Ft.setIgnoreCursorEvents(ye))},[i,o,p,d,k,_,y,g,b,E,W,F,R,q,O,$,ge,te,oe,x,ye,f,c,A,L,P,T,U,I,l,Q,le,ae,ee,_e,ce,Se,u,N,V,Ie,Oe,Le,fe,he,de,De,it,me,pe,H,ie,X,ke,Zt,vt,$t,Ne,en,Ve,_t,tn]}class vs extends Te{constructor(e){super(),Ce(this,e,ms,hs,be,{onMessage:37},null,[-1,-1,-1])}}function $l(t,e){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:t,handler:mt(e)}})]})})}function _s(t,e){return M(this,void 0,void 0,function(){return C(this,function(n){return[2,S({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:t,handler:mt(e)}})]})})}function bs(t){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:t}})]})})}function er(t){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:t}})]})})}function tr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})]})})}Object.freeze({__proto__:null,register:$l,registerAll:_s,isRegistered:bs,unregister:er,unregisterAll:tr});function cl(t,e,n){const i=t.slice();return i[9]=e[n],i}function fl(t){let e,n=t[9]+"",i,o,l,u,f;function c(){return t[8](t[9])}return{c(){e=s("div"),i=z(n),o=v(),l=s("button"),l.textContent="Unregister",a(l,"class","btn"),a(l,"type","button"),a(e,"class","flex justify-between")},m(p,d){m(p,e,d),r(e,i),r(e,o),r(e,l),u||(f=D(l,"click",c),u=!0)},p(p,d){t=p,d&2&&n!==(n=t[9]+"")&&Z(i,n)},d(p){p&&h(e),u=!1,f()}}}function dl(t){let e,n,i,o,l;return{c(){e=s("br"),n=v(),i=s("button"),i.textContent="Unregister all",a(i,"class","btn"),a(i,"type","button")},m(u,f){m(u,e,f),m(u,n,f),m(u,i,f),o||(l=D(i,"click",t[5]),o=!0)},p:J,d(u){u&&h(e),u&&h(n),u&&h(i),o=!1,l()}}}function gs(t){let e,n,i,o,l,u,f,c,p,d,k,_=t[1],y=[];for(let b=0;b<_.length;b+=1)y[b]=fl(cl(t,_,b));let g=t[1].length>1&&dl(t);return{c(){e=s("div"),n=s("input"),i=v(),o=s("button"),o.textContent="Register",l=v(),u=s("br"),f=v(),c=s("div");for(let b=0;b<y.length;b+=1)y[b].c();p=v(),g&&g.c(),a(n,"class","input grow"),a(n,"placeholder","Type a shortcut with '+' as separator..."),a(o,"class","btn"),a(o,"type","button"),a(e,"class","flex gap-1"),a(c,"class","flex flex-col gap-1")},m(b,E){m(b,e,E),r(e,n),G(n,t[0]),r(e,i),r(e,o),m(b,l,E),m(b,u,E),m(b,f,E),m(b,c,E);for(let W=0;W<y.length;W+=1)y[W].m(c,null);r(c,p),g&&g.m(c,null),d||(k=[D(n,"input",t[7]),D(o,"click",t[3])],d=!0)},p(b,[E]){if(E&1&&n.value!==b[0]&&G(n,b[0]),E&18){_=b[1];let W;for(W=0;W<_.length;W+=1){const F=cl(b,_,W);y[W]?y[W].p(F,E):(y[W]=fl(F),y[W].c(),y[W].m(c,p))}for(;W<y.length;W+=1)y[W].d(1);y.length=_.length}b[1].length>1?g?g.p(b,E):(g=dl(b),g.c(),g.m(c,null)):g&&(g.d(1),g=null)},i:J,o:J,d(b){b&&h(e),b&&h(l),b&&h(u),b&&h(f),b&&h(c),ht(y,b),g&&g.d(),d=!1,ue(k)}}}function ys(t,e,n){let i,{onMessage:o}=e;const l=Al([]);Ml(t,l,_=>n(1,i=_));let u="CmdOrControl+X";function f(){const _=u;$l(_,()=>{o(`Shortcut ${_} triggered`)}).then(()=>{l.update(y=>[...y,_]),o(`Shortcut ${_} registered successfully`)}).catch(o)}function c(_){const y=_;er(y).then(()=>{l.update(g=>g.filter(b=>b!==y)),o(`Shortcut ${y} unregistered`)}).catch(o)}function p(){tr().then(()=>{l.update(()=>[]),o("Unregistered all shortcuts")}).catch(o)}function d(){u=this.value,n(0,u)}const k=_=>c(_);return t.$$set=_=>{"onMessage"in _&&n(6,o=_.onMessage)},[u,i,l,f,c,p,o,d,k]}class ws extends Te{constructor(e){super(),Ce(this,e,ys,gs,be,{onMessage:6})}}function pl(t){let e,n,i,o,l,u,f;return{c(){e=s("br"),n=v(),i=s("input"),o=v(),l=s("button"),l.textContent="Write",a(i,"class","input"),a(i,"placeholder","write to stdin"),a(l,"class","btn")},m(c,p){m(c,e,p),m(c,n,p),m(c,i,p),G(i,t[4]),m(c,o,p),m(c,l,p),u||(f=[D(i,"input",t[14]),D(l,"click",t[8])],u=!0)},p(c,p){p&16&&i.value!==c[4]&&G(i,c[4])},d(c){c&&h(e),c&&h(n),c&&h(i),c&&h(o),c&&h(l),u=!1,ue(f)}}}function ks(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F,R,q,O,A,L,P,T=t[5]&&pl(t);return{c(){e=s("div"),n=s("div"),i=z(`Script:
|
|
`),o=s("input"),l=v(),u=s("div"),f=z(`Encoding:
|
|
`),c=s("input"),p=v(),d=s("div"),k=z(`Working directory:
|
|
`),_=s("input"),y=v(),g=s("div"),b=z(`Arguments:
|
|
`),E=s("input"),W=v(),F=s("div"),R=s("button"),R.textContent="Run",q=v(),O=s("button"),O.textContent="Kill",A=v(),T&&T.c(),a(o,"class","grow input"),a(n,"class","flex items-center gap-1"),a(c,"class","grow input"),a(u,"class","flex items-center gap-1"),a(_,"class","grow input"),a(_,"placeholder","Working directory"),a(d,"class","flex items-center gap-1"),a(E,"class","grow input"),a(E,"placeholder","Environment variables"),a(g,"class","flex items-center gap-1"),a(R,"class","btn"),a(O,"class","btn"),a(F,"class","flex children:grow gap-1"),a(e,"class","flex flex-col childre:grow gap-1")},m(U,B){m(U,e,B),r(e,n),r(n,i),r(n,o),G(o,t[0]),r(e,l),r(e,u),r(u,f),r(u,c),G(c,t[3]),r(e,p),r(e,d),r(d,k),r(d,_),G(_,t[1]),r(e,y),r(e,g),r(g,b),r(g,E),G(E,t[2]),r(e,W),r(e,F),r(F,R),r(F,q),r(F,O),r(e,A),T&&T.m(e,null),L||(P=[D(o,"input",t[10]),D(c,"input",t[11]),D(_,"input",t[12]),D(E,"input",t[13]),D(R,"click",t[6]),D(O,"click",t[7])],L=!0)},p(U,[B]){B&1&&o.value!==U[0]&&G(o,U[0]),B&8&&c.value!==U[3]&&G(c,U[3]),B&2&&_.value!==U[1]&&G(_,U[1]),B&4&&E.value!==U[2]&&G(E,U[2]),U[5]?T?T.p(U,B):(T=pl(U),T.c(),T.m(e,null)):T&&(T.d(1),T=null)},i:J,o:J,d(U){U&&h(e),T&&T.d(),L=!1,ue(P)}}}function Ms(t,e,n){const i=navigator.userAgent.includes("Windows");let o=i?"cmd":"sh",l=i?["/C"]:["-c"],{onMessage:u}=e,f='echo "hello world"',c=null,p="SOMETHING=value ANOTHER=2",d="",k="",_;function y(){return p.split(" ").reduce((A,L)=>{let[P,T]=L.split("=");return{...A,[P]:T}},{})}function g(){n(5,_=null);const A=new Sl(o,[...l,f],{cwd:c||null,env:y(),encoding:d});A.on("close",L=>{u(`command finished with code ${L.code} and signal ${L.signal}`),n(5,_=null)}),A.on("error",L=>u(`command error: "${L}"`)),A.stdout.on("data",L=>u(`command stdout: "${L}"`)),A.stderr.on("data",L=>u(`command stderr: "${L}"`)),A.spawn().then(L=>{n(5,_=L)}).catch(u)}function b(){_.kill().then(()=>u("killed child process")).catch(u)}function E(){_.write(k).catch(u)}function W(){f=this.value,n(0,f)}function F(){d=this.value,n(3,d)}function R(){c=this.value,n(1,c)}function q(){p=this.value,n(2,p)}function O(){k=this.value,n(4,k)}return t.$$set=A=>{"onMessage"in A&&n(9,u=A.onMessage)},[f,c,p,d,k,_,g,b,E,u,W,F,R,q,O]}class Cs extends Te{constructor(e){super(),Ce(this,e,Ms,ks,be,{onMessage:9})}}function Ji(t){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,Qt(ve.STATUS_UPDATE,function(n){t(n==null?void 0:n.payload)})]})})}function nr(){return M(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return C(this,function(n){return[2,new Promise(function(i,o){Ji(function(l){return l.error?(t(),o(l.error)):l.status==="DONE"?(t(),i()):void 0}).then(function(l){e=l}).catch(function(l){throw t(),l}),si(ve.INSTALL_UPDATE).catch(function(l){throw t(),l})})]})})}function ir(){return M(this,void 0,void 0,function(){function t(){e&&e(),e=void 0}var e;return C(this,function(n){return[2,new Promise(function(i,o){Wl(ve.UPDATE_AVAILABLE,function(l){var u;u=l==null?void 0:l.payload,t(),i({manifest:u,shouldUpdate:!0})}).catch(function(l){throw t(),l}),Ji(function(l){return l.error?(t(),o(l.error)):l.status==="UPTODATE"?(t(),i({shouldUpdate:!1})):void 0}).then(function(l){e=l}).catch(function(l){throw t(),l}),si(ve.CHECK_UPDATE).catch(function(l){throw t(),l})})]})})}Object.freeze({__proto__:null,onUpdaterEvent:Ji,installUpdate:nr,checkUpdate:ir});function Ts(t){let e;return{c(){e=s("button"),e.innerHTML='<div class="spinner animate-spin svelte-4xesec"></div>',a(e,"class","btn text-accentText dark:text-darkAccentText flex items-center justify-center")},m(n,i){m(n,e,i)},p:J,d(n){n&&h(e)}}}function As(t){let e,n,i;return{c(){e=s("button"),e.textContent="Install update",a(e,"class","btn")},m(o,l){m(o,e,l),n||(i=D(e,"click",t[4]),n=!0)},p:J,d(o){o&&h(e),n=!1,i()}}}function Ls(t){let e,n,i;return{c(){e=s("button"),e.textContent="Check update",a(e,"class","btn")},m(o,l){m(o,e,l),n||(i=D(e,"click",t[3]),n=!0)},p:J,d(o){o&&h(e),n=!1,i()}}}function Es(t){let e;function n(l,u){return!l[0]&&!l[2]?Ls:!l[1]&&l[2]?As:Ts}let i=n(t),o=i(t);return{c(){e=s("div"),o.c(),a(e,"class","flex children:grow children:h10")},m(l,u){m(l,e,u),o.m(e,null)},p(l,[u]){i===(i=n(l))&&o?o.p(l,u):(o.d(1),o=i(l),o&&(o.c(),o.m(e,null)))},i:J,o:J,d(l){l&&h(e),o.d()}}}function Ss(t,e,n){let{onMessage:i}=e,o;ft(async()=>{o=await Qt("tauri://update-status",i)}),ji(()=>{o&&o()});let l,u,f;async function c(){n(0,l=!0);try{const{shouldUpdate:d,manifest:k}=await ir();i(`Should update: ${d}`),i(k),n(2,f=d)}catch(d){i(d)}finally{n(0,l=!1)}}async function p(){n(1,u=!0);try{await nr(),i("Installation complete, restart required."),await Bi()}catch(d){i(d)}finally{n(1,u=!1)}}return t.$$set=d=>{"onMessage"in d&&n(5,i=d.onMessage)},[l,u,f,c,p,i]}class Os extends Te{constructor(e){super(),Ce(this,e,Ss,Es,be,{onMessage:5})}}function or(t){return M(this,void 0,void 0,function(){return C(this,function(e){return[2,S({__tauriModule:"Clipboard",message:{cmd:"writeText",data:t}})]})})}function lr(){return M(this,void 0,void 0,function(){return C(this,function(t){return[2,S({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})]})})}Object.freeze({__proto__:null,writeText:or,readText:lr});function Ds(t){let e,n,i,o,l,u,f,c;return{c(){e=s("div"),n=s("input"),i=v(),o=s("button"),o.textContent="Write",l=v(),u=s("button"),u.textContent="Read",a(n,"class","grow input"),a(n,"placeholder","Text to write to the clipboard"),a(o,"class","btn"),a(o,"type","button"),a(u,"class","btn"),a(u,"type","button"),a(e,"class","flex gap-1")},m(p,d){m(p,e,d),r(e,n),G(n,t[0]),r(e,i),r(e,o),r(e,l),r(e,u),f||(c=[D(n,"input",t[4]),D(o,"click",t[1]),D(u,"click",t[2])],f=!0)},p(p,[d]){d&1&&n.value!==p[0]&&G(n,p[0])},i:J,o:J,d(p){p&&h(e),f=!1,ue(c)}}}function zs(t,e,n){let{onMessage:i}=e,o="clipboard message";function l(){or(o).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){lr().then(c=>{i(`Clipboard contents: ${c}`)}).catch(i)}function f(){o=this.value,n(0,o)}return t.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,l,u,i,f]}class Ws extends Te{constructor(e){super(),Ce(this,e,zs,Ds,be,{onMessage:3})}}function Ps(t){let e;return{c(){e=s("div"),e.innerHTML=`<div class="note-red grow">Not available for Linux</div>
|
|
<video id="localVideo" autoplay="" playsinline=""><track kind="captions"/></video>`,a(e,"class","flex flex-col gap-2")},m(n,i){m(n,e,i)},p:J,i:J,o:J,d(n){n&&h(e)}}}function Rs(t,e,n){let{onMessage:i}=e;const o=window.constraints={audio:!0,video:!0};function l(f){const c=document.querySelector("video"),p=f.getVideoTracks();i("Got stream with constraints:",o),i(`Using video device: ${p[0].label}`),window.stream=f,c.srcObject=f}function u(f){if(f.name==="ConstraintNotSatisfiedError"){const c=o.video;i(`The resolution ${c.width.exact}x${c.height.exact} px is not supported by your device.`)}else f.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: ${f.name}`,f)}return ft(async()=>{try{const f=await navigator.mediaDevices.getUserMedia(o);l(f)}catch(f){u(f)}}),ji(()=>{window.stream.getTracks().forEach(function(f){f.stop()})}),t.$$set=f=>{"onMessage"in f&&n(0,i=f.onMessage)},[i]}class Is extends Te{constructor(e){super(),Ce(this,e,Rs,Ps,be,{onMessage:0})}}function Ns(t){let e,n,i,o,l,u;return{c(){e=s("div"),n=s("button"),n.textContent="Show",i=v(),o=s("button"),o.textContent="Hide",a(n,"class","btn"),a(n,"id","show"),a(n,"title","Hides and shows the app after 2 seconds"),a(o,"class","btn"),a(o,"id","hide")},m(f,c){m(f,e,c),r(e,n),r(e,i),r(e,o),l||(u=[D(n,"click",t[0]),D(o,"click",t[1])],l=!0)},p:J,i:J,o:J,d(f){f&&h(e),l=!1,ue(u)}}}function js(t,e,n){let{onMessage:i}=e;function o(){l().then(()=>{setTimeout(()=>{Bl().then(()=>i("Shown app")).catch(i)},2e3)}).catch(i)}function l(){return Vl().then(()=>i("Hide app")).catch(i)}return t.$$set=u=>{"onMessage"in u&&n(2,i=u.onMessage)},[o,l,i]}class Hs extends Te{constructor(e){super(),Ce(this,e,js,Ns,be,{onMessage:2})}}function hl(t,e,n){const i=t.slice();return i[32]=e[n],i}function ml(t,e,n){const i=t.slice();return i[35]=e[n],i}function vl(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b;function E(A,L){return A[3]?Us:Fs}let W=E(t),F=W(t);function R(A,L){return A[2]?Bs:qs}let q=R(t),O=q(t);return{c(){e=s("div"),n=s("span"),n.textContent="Tauri API Validation",i=v(),o=s("span"),l=s("span"),F.c(),f=v(),c=s("span"),c.innerHTML='<div class="i-codicon-chrome-minimize"></div>',p=v(),d=s("span"),O.c(),_=v(),y=s("span"),y.innerHTML='<div class="i-codicon-chrome-close"></div>',a(n,"class","lt-sm:pl-10 text-darkPrimaryText"),a(l,"title",u=t[3]?"Switch to Light mode":"Switch to Dark mode"),a(l,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(c,"title","Minimize"),a(c,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(d,"title",k=t[2]?"Restore":"Maximize"),a(d,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),a(y,"title","Close"),a(y,"class","hover:bg-red-700 dark:hover:bg-red-700 hover:text-darkPrimaryText active:bg-red-700/90 dark:active:bg-red-700/90 active:text-darkPrimaryText "),a(o,"class","h-100% children:h-100% children:w-12 children:inline-flex children:items-center children:justify-center"),a(e,"class","w-screen select-none h-8 pl-2 flex justify-between items-center absolute text-primaryText dark:text-darkPrimaryText"),a(e,"data-tauri-drag-region","")},m(A,L){m(A,e,L),r(e,n),r(e,i),r(e,o),r(o,l),F.m(l,null),r(o,f),r(o,c),r(o,p),r(o,d),O.m(d,null),r(o,_),r(o,y),g||(b=[D(l,"click",t[12]),D(c,"click",t[9]),D(d,"click",t[10]),D(y,"click",t[11])],g=!0)},p(A,L){W!==(W=E(A))&&(F.d(1),F=W(A),F&&(F.c(),F.m(l,null))),L[0]&8&&u!==(u=A[3]?"Switch to Light mode":"Switch to Dark mode")&&a(l,"title",u),q!==(q=R(A))&&(O.d(1),O=q(A),O&&(O.c(),O.m(d,null))),L[0]&4&&k!==(k=A[2]?"Restore":"Maximize")&&a(d,"title",k)},d(A){A&&h(e),F.d(),O.d(),g=!1,ue(b)}}}function Fs(t){let e;return{c(){e=s("div"),a(e,"class","i-ph-moon")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Us(t){let e;return{c(){e=s("div"),a(e,"class","i-ph-sun")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function qs(t){let e;return{c(){e=s("div"),a(e,"class","i-codicon-chrome-maximize")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Bs(t){let e;return{c(){e=s("div"),a(e,"class","i-codicon-chrome-restore")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Vs(t){let e;return{c(){e=s("span"),a(e,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function Gs(t){let e;return{c(){e=s("span"),a(e,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,e,i)},d(n){n&&h(e)}}}function _l(t){let e,n,i,o,l,u,f,c,p;function d(y,g){return y[3]?Xs:Js}let k=d(t),_=k(t);return{c(){e=s("a"),_.c(),n=v(),i=s("br"),o=v(),l=s("div"),u=v(),f=s("br"),a(e,"href","##"),a(e,"class","nv justify-between h-8"),a(l,"class","bg-white/5 h-2px")},m(y,g){m(y,e,g),_.m(e,null),m(y,n,g),m(y,i,g),m(y,o,g),m(y,l,g),m(y,u,g),m(y,f,g),c||(p=D(e,"click",t[12]),c=!0)},p(y,g){k!==(k=d(y))&&(_.d(1),_=k(y),_&&(_.c(),_.m(e,null)))},d(y){y&&h(e),_.d(),y&&h(n),y&&h(i),y&&h(o),y&&h(l),y&&h(u),y&&h(f),c=!1,p()}}}function Js(t){let e,n;return{c(){e=z(`Switch to Dark mode
|
|
`),n=s("div"),a(n,"class","i-ph-moon")},m(i,o){m(i,e,o),m(i,n,o)},d(i){i&&h(e),i&&h(n)}}}function Xs(t){let e,n;return{c(){e=z(`Switch to Light mode
|
|
`),n=s("div"),a(n,"class","i-ph-sun")},m(i,o){m(i,e,o),m(i,n,o)},d(i){i&&h(e),i&&h(n)}}}function Ys(t){let e,n,i,o,l,u=t[35].label+"",f,c,p,d;function k(){return t[20](t[35])}return{c(){e=s("a"),n=s("div"),o=v(),l=s("p"),f=z(u),a(n,"class",i=t[35].icon+" mr-2"),a(e,"href","##"),a(e,"class",c="nv "+(t[1]===t[35]?"nv_selected":""))},m(_,y){m(_,e,y),r(e,n),r(e,o),r(e,l),r(l,f),p||(d=D(e,"click",k),p=!0)},p(_,y){t=_,y[0]&2&&c!==(c="nv "+(t[1]===t[35]?"nv_selected":""))&&a(e,"class",c)},d(_){_&&h(e),p=!1,d()}}}function bl(t){let e,n=t[35]&&Ys(t);return{c(){n&&n.c(),e=oi()},m(i,o){n&&n.m(i,o),m(i,e,o)},p(i,o){i[35]&&n.p(i,o)},d(i){n&&n.d(i),i&&h(e)}}}function gl(t){let e,n=t[32].html+"",i;return{c(){e=new pr(!1),i=oi(),e.a=i},m(o,l){e.m(n,o,l),m(o,i,l)},p(o,l){l[0]&64&&n!==(n=o[32].html+"")&&e.p(n)},d(o){o&&h(i),o&&e.d()}}}function Ks(t){let e,n,i,o,l,u,f,c,p,d,k,_,y,g,b,E,W,F,R,q,O,A,L,P,T,U,B,Y=t[1].label+"",$,ge,te,oe,x,ye,I,Q,le,ae,ee,_e,ce,we,ne,Ae,Se,N,V=t[5]&&vl(t);function Ie(H,ie){return H[0]?Gs:Vs}let Oe=Ie(t),Le=Oe(t),fe=!t[5]&&_l(t),he=t[7],de=[];for(let H=0;H<he.length;H+=1)de[H]=bl(ml(t,he,H));var De=t[1].component;function it(H){return{props:{onMessage:H[14],insecureRenderHtml:H[15]}}}De&&(x=new De(it(t)));let me=t[6],pe=[];for(let H=0;H<me.length;H+=1)pe[H]=gl(hl(t,me,H));return{c(){V&&V.c(),e=v(),n=s("div"),Le.c(),i=v(),o=s("div"),l=s("aside"),u=s("img"),c=v(),fe&&fe.c(),p=v(),d=s("a"),d.innerHTML=`Documentation
|
|
<span class="i-codicon-link-external"></span>`,k=v(),_=s("a"),_.innerHTML=`GitHub
|
|
<span class="i-codicon-link-external"></span>`,y=v(),g=s("a"),g.innerHTML=`Source
|
|
<span class="i-codicon-link-external"></span>`,b=v(),E=s("br"),W=v(),F=s("div"),R=v(),q=s("br"),O=v(),A=s("div");for(let H=0;H<de.length;H+=1)de[H].c();P=v(),T=s("main"),U=s("div"),B=s("h1"),$=z(Y),ge=v(),te=s("div"),oe=s("div"),x&&ei(x.$$.fragment),ye=v(),I=s("div"),Q=s("div"),le=v(),ae=s("div"),ee=s("p"),ee.textContent="Console",_e=v(),ce=s("div"),ce.innerHTML='<div class="i-codicon-clear-all"></div>',we=v(),ne=s("div");for(let H=0;H<pe.length;H+=1)pe[H].c();a(n,"id","sidebarToggle"),a(n,"class","z-2000 display-none lt-sm:flex justify-center items-center absolute top-2 left-2 w-8 h-8 rd-8 bg-accent dark:bg-darkAccent active:bg-accentDark dark:active:bg-darkAccentDark"),a(u,"class","self-center p-7 cursor-pointer"),ur(u.src,f="tauri_logo.png")||a(u,"src",f),a(u,"alt","Tauri logo"),a(d,"class","nv justify-between h-8"),a(d,"target","_blank"),a(d,"href","https://tauri.app/v1/guides/"),a(_,"class","nv justify-between h-8"),a(_,"target","_blank"),a(_,"href","https://github.com/tauri-apps/tauri"),a(g,"class","nv justify-between h-8"),a(g,"target","_blank"),a(g,"href","https://github.com/tauri-apps/tauri/tree/dev/examples/api"),a(F,"class","bg-white/5 h-2px"),a(A,"class","flex flex-col overflow-y-auto children-h-10 children-flex-none gap-1"),a(l,"id","sidebar"),a(l,"class",L="lt-sm:h-screen lt-sm:shadow-lg lt-sm:shadow lt-sm:transition-transform lt-sm:absolute lt-sm:z-1999 "+(t[5]?"bg-darkPrimaryLighter/60 lt-sm:bg-darkPrimaryLighter":"bg-darkPrimaryLighter")+" transition-colors-250 overflow-hidden grid select-none px-2"),a(oe,"class","mr-2"),a(te,"class","overflow-y-auto"),a(U,"class","px-5 overflow-hidden grid grid-rows-[auto_1fr]"),a(Q,"class","bg-black/20 h-2px cursor-ns-resize"),a(ee,"class","font-semibold"),a(ce,"class","cursor-pointer h-85% rd-1 p-1 flex justify-center items-center hover:bg-hoverOverlay dark:hover:bg-darkHoverOverlay active:bg-hoverOverlay/25 dark:active:bg-darkHoverOverlay/25 "),a(ae,"class","flex justify-between items-center px-2"),a(ne,"class","px-2 overflow-y-auto all:font-mono code-block all:text-xs"),a(I,"id","console"),a(I,"class","select-none h-15rem grid grid-rows-[2px_2rem_1fr] gap-1 overflow-hidden"),a(T,"class","flex-1 bg-primary dark:bg-darkPrimary transition-transform transition-colors-250 grid grid-rows-[2fr_auto]"),a(o,"class","flex h-screen w-screen overflow-hidden children-pt8 children-pb-2 text-primaryText dark:text-darkPrimaryText")},m(H,ie){V&&V.m(H,ie),m(H,e,ie),m(H,n,ie),Le.m(n,null),m(H,i,ie),m(H,o,ie),r(o,l),r(l,u),r(l,c),fe&&fe.m(l,null),r(l,p),r(l,d),r(l,k),r(l,_),r(l,y),r(l,g),r(l,b),r(l,E),r(l,W),r(l,F),r(l,R),r(l,q),r(l,O),r(l,A);for(let X=0;X<de.length;X+=1)de[X].m(A,null);r(o,P),r(o,T),r(T,U),r(U,B),r(B,$),r(U,ge),r(U,te),r(te,oe),x&&Yt(x,oe,null),r(T,ye),r(T,I),r(I,Q),r(I,le),r(I,ae),r(ae,ee),r(ae,_e),r(ae,ce),r(I,we),r(I,ne);for(let X=0;X<pe.length;X+=1)pe[X].m(ne,null);t[21](I),Ae=!0,Se||(N=[D(u,"click",t[19]),D(Q,"mousedown",t[17]),D(ce,"click",t[16])],Se=!0)},p(H,ie){if(H[5]?V?V.p(H,ie):(V=vl(H),V.c(),V.m(e.parentNode,e)):V&&(V.d(1),V=null),Oe!==(Oe=Ie(H))&&(Le.d(1),Le=Oe(H),Le&&(Le.c(),Le.m(n,null))),H[5]?fe&&(fe.d(1),fe=null):fe?fe.p(H,ie):(fe=_l(H),fe.c(),fe.m(l,p)),ie[0]&387){he=H[7];let X;for(X=0;X<he.length;X+=1){const ke=ml(H,he,X);de[X]?de[X].p(ke,ie):(de[X]=bl(ke),de[X].c(),de[X].m(A,null))}for(;X<de.length;X+=1)de[X].d(1);de.length=he.length}if((!Ae||ie[0]&32&&L!==(L="lt-sm:h-screen lt-sm:shadow-lg lt-sm:shadow lt-sm:transition-transform lt-sm:absolute lt-sm:z-1999 "+(H[5]?"bg-darkPrimaryLighter/60 lt-sm:bg-darkPrimaryLighter":"bg-darkPrimaryLighter")+" transition-colors-250 overflow-hidden grid select-none px-2"))&&a(l,"class",L),(!Ae||ie[0]&2)&&Y!==(Y=H[1].label+"")&&Z($,Y),De!==(De=H[1].component)){if(x){li();const X=x;je(X.$$.fragment,1,0,()=>{Kt(X,1)}),ri()}De?(x=new De(it(H)),ei(x.$$.fragment),We(x.$$.fragment,1),Yt(x,oe,null)):x=null}if(ie[0]&64){me=H[6];let X;for(X=0;X<me.length;X+=1){const ke=hl(H,me,X);pe[X]?pe[X].p(ke,ie):(pe[X]=gl(ke),pe[X].c(),pe[X].m(ne,null))}for(;X<pe.length;X+=1)pe[X].d(1);pe.length=me.length}},i(H){Ae||(x&&We(x.$$.fragment,H),Ae=!0)},o(H){x&&je(x.$$.fragment,H),Ae=!1},d(H){V&&V.d(H),H&&h(e),H&&h(n),Le.d(),H&&h(i),H&&h(o),fe&&fe.d(),ht(de,H),x&&Kt(x),ht(pe,H),t[21](null),Se=!1,ue(N)}}}let yl=50;function wl(t){const e=document.querySelector("html");t?e.classList.add("dark"):e.classList.remove("dark"),localStorage&&localStorage.setItem("theme",t?"dark":"")}function xs(t,e){t.style.setProperty("--translate-x",`${e?"0":"-18.75"}rem`)}function Qs(t,e,n){let i;Be.label!=="main"&&Be.onCloseRequested(async I=>{await confirm("Are you sure?")||I.preventDefault()}),Be.onFileDropEvent(I=>{W(`File drop: ${JSON.stringify(I.payload)}`)});const o=navigator.userAgent.toLowerCase(),l=o.includes("android")||o.includes("iphone"),u=[{label:"Welcome",component:Or,icon:"i-ph-hand-waving"},{label:"Communication",component:Ir,icon:"i-codicon-radio-tower"},!l&&{label:"CLI",component:Wr,icon:"i-codicon-terminal"},!l&&{label:"Dialog",component:xr,icon:"i-codicon-multiple-windows"},{label:"File system",component:es,icon:"i-codicon-files"},{label:"HTTP",component:as,icon:"i-ph-globe-hemisphere-west"},!l&&{label:"Notifications",component:ps,icon:"i-codicon-bell-dot"},!l&&{label:"App",component:Hs,icon:"i-codicon-hubot"},!l&&{label:"Window",component:vs,icon:"i-codicon-window"},!l&&{label:"Shortcuts",component:ws,icon:"i-codicon-record-keys"},{label:"Shell",component:Cs,icon:"i-codicon-terminal-bash"},!l&&{label:"Updater",component:Os,icon:"i-codicon-cloud-download"},!l&&{label:"Clipboard",component:Ws,icon:"i-codicon-clippy"},{label:"WebRTC",component:Is,icon:"i-ph-broadcast"}];let f=u[0];function c(I){n(1,f=I)}let p;ft(async()=>{const I=Gt();n(2,p=await I.isMaximized()),Qt("tauri://resize",async()=>{n(2,p=await I.isMaximized())})});function d(){Gt().minimize()}async function k(){const I=Gt();await I.isMaximized()?I.unmaximize():I.maximize()}let _=!1;async function y(){_||(_=await Yl("Are you sure that you want to close this window?",{title:"Tauri API"}),_&&Gt().close())}let g;ft(()=>{n(3,g=localStorage&&localStorage.getItem("theme")=="dark"),wl(g)});function b(){n(3,g=!g),wl(g)}let E=Al([]);Ml(t,E,I=>n(6,i=I));function W(I){E.update(Q=>[{html:`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> `+(typeof I=="string"?I:JSON.stringify(I,null,1))+"</pre>"},...Q])}function F(I){E.update(Q=>[{html:`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> `+I+"</pre>"},...Q])}function R(){E.update(()=>[])}let q,O,A;function L(I){A=I.clientY;const Q=window.getComputedStyle(q);O=parseInt(Q.height,10);const le=ee=>{const _e=ee.clientY-A,ce=O-_e;n(4,q.style.height=`${ce<yl?yl:ce}px`,q)},ae=()=>{document.removeEventListener("mouseup",ae),document.removeEventListener("mousemove",le)};document.addEventListener("mouseup",ae),document.addEventListener("mousemove",le)}let P;ft(async()=>{n(5,P=await Hl()==="win32")});let T=!1,U,B,Y=!1,$=0,ge=0;const te=(I,Q,le)=>Math.min(Math.max(Q,I),le);ft(()=>{n(18,U=document.querySelector("#sidebar")),B=document.querySelector("#sidebarToggle"),document.addEventListener("click",I=>{B.contains(I.target)?n(0,T=!T):T&&!U.contains(I.target)&&n(0,T=!1)}),document.addEventListener("touchstart",I=>{if(B.contains(I.target))return;const Q=I.touches[0].clientX;(0<Q&&Q<20&&!T||T)&&(Y=!0,$=Q)}),document.addEventListener("touchmove",I=>{if(Y){const Q=I.touches[0].clientX;ge=Q;const le=(Q-$)/10;U.style.setProperty("--translate-x",`-${te(0,T?0-le:18.75-le,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(Y){const I=(ge-$)/10;n(0,T=T?I>-(18.75/2):I>18.75/2)}Y=!1})});const oe=()=>Fi("https://tauri.app/"),x=I=>{c(I),n(0,T=!1)};function ye(I){$n[I?"unshift":"push"](()=>{q=I,n(4,q)})}return t.$$.update=()=>{if(t.$$.dirty[0]&1){const I=document.querySelector("#sidebar");I&&xs(I,T)}},[T,f,p,g,q,P,i,u,c,d,k,y,b,E,W,F,R,L,U,oe,x,ye]}class Zs extends Te{constructor(e){super(),Ce(this,e,Qs,Ks,be,{},null,[-1,-1])}}new Zs({target:document.querySelector("#app")});
|