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