mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-23 02:32:28 +03:00
47 lines
81 KiB
JavaScript
47 lines
81 KiB
JavaScript
(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)}})();function V(){}function hs(e){return e()}function ql(){return Object.create(null)}function ue(e){e.forEach(hs)}function Ks(e){return typeof e=="function"}function ge(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Bn;function Qs(e,t){return Bn||(Bn=document.createElement("a")),Bn.href=t,e===Bn.href}function Zs(e){return Object.keys(e).length===0}function xs(e,...t){if(e==null)return V;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function _s(e,t,n){e.$$.on_destroy.push(xs(t,n))}function s(e,t){e.appendChild(t)}function m(e,t,n){e.insertBefore(t,n||null)}function p(e){e.parentNode.removeChild(e)}function zt(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 eo(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function A(e){return document.createTextNode(e)}function h(){return A(" ")}function ti(){return A("")}function L(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function Wi(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 le(e){return e===""?null:+e}function to(e){return Array.from(e.childNodes)}function K(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function q(e,t){e.value=t==null?"":t}function Wt(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 Pi(e){const t=e.querySelector(":checked")||e.options[0];return t&&t.__value}function Jn(e,t,n){e.classList[n?"add":"remove"](t)}class no{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=eo(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)m(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(p)}}let Vt;function Gt(e){Vt=e}function bs(){if(!Vt)throw new Error("Function called outside component initialization");return Vt}function dt(e){bs().$$.on_mount.push(e)}function Ri(e){bs().$$.on_destroy.push(e)}const qt=[],Oi=[],Yn=[],Fl=[],io=Promise.resolve();let Di=!1;function lo(){Di||(Di=!0,io.then(gs))}function Pt(e){Yn.push(e)}const Ei=new Set;let Xn=0;function gs(){const e=Vt;do{for(;Xn<qt.length;){const t=qt[Xn];Xn++,Gt(t),so(t.$$)}for(Gt(null),qt.length=0,Xn=0;Oi.length;)Oi.pop()();for(let t=0;t<Yn.length;t+=1){const n=Yn[t];Ei.has(n)||(Ei.add(n),n())}Yn.length=0}while(qt.length);for(;Fl.length;)Fl.pop()();Di=!1,Ei.clear(),Gt(e)}function so(e){if(e.fragment!==null){e.update(),ue(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Pt)}}const $n=new Set;let ft;function ni(){ft={r:0,c:[],p:ft}}function ii(){ft.r||ue(ft.c),ft=ft.p}function Se(e,t){e&&e.i&&($n.delete(e),e.i(t))}function Ie(e,t,n,i){if(e&&e.o){if($n.has(e))return;$n.add(e),ft.c.push(()=>{$n.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function Qn(e){e&&e.c()}function Bt(e,t,n,i){const{fragment:l,on_mount:o,on_destroy:u,after_update:d}=e.$$;l&&l.m(t,n),i||Pt(()=>{const c=o.map(hs).filter(Ks);u?u.push(...c):ue(c),e.$$.on_mount=[]}),d.forEach(Pt)}function Jt(e,t){const n=e.$$;n.fragment!==null&&(ue(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function oo(e,t){e.$$.dirty[0]===-1&&(qt.push(e),lo(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function ke(e,t,n,i,l,o,u,d=[-1]){const c=Vt;Gt(e);const f=e.$$={fragment:null,ctx:null,props:o,update:V,not_equal:l,bound:ql(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:ql(),dirty:d,skip_bound:!1,root:t.target||c.$$.root};u&&u(f.root);let b=!1;if(f.ctx=n?n(e,t.props||{},(k,g,...w)=>{const _=w.length?w[0]:g;return f.ctx&&l(f.ctx[k],f.ctx[k]=_)&&(!f.skip_bound&&f.bound[k]&&f.bound[k](_),b&&oo(e,k)),g}):[],f.update(),b=!0,ue(f.before_update),f.fragment=i?i(f.ctx):!1,t.target){if(t.hydrate){const k=to(t.target);f.fragment&&f.fragment.l(k),k.forEach(p)}else f.fragment&&f.fragment.c();t.intro&&Se(e.$$.fragment),Bt(e,t.target,t.anchor,t.customElement),gs()}Gt(c)}class Me{$destroy(){Jt(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&&!Zs(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Et=[];function ys(e,t=V){let n;const i=new Set;function l(d){if(ge(e,d)&&(e=d,n)){const c=!Et.length;for(const f of i)f[1](),Et.push(f,e);if(c){for(let f=0;f<Et.length;f+=2)Et[f][0](Et[f+1]);Et.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 ao=Object.defineProperty,We=(e,t)=>{for(var n in t)ao(e,n,{get:t[n],enumerable:!0})},ro={};We(ro,{convertFileSrc:()=>co,invoke:()=>Xt,transformCallback:()=>mt});function uo(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function mt(e,t=!1){let n=uo(),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 Xt(e,t={}){return new Promise((n,i)=>{let l=mt(u=>{n(u),Reflect.deleteProperty(window,`_${o}`)},!0),o=mt(u=>{i(u),Reflect.deleteProperty(window,`_${l}`)},!0);window.__TAURI_IPC__({cmd:e,callback:l,error:o,...t})})}function co(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}async function E(e){return Xt("tauri",e)}var fo={};We(fo,{Child:()=>vs,Command:()=>Zn,EventEmitter:()=>Kn,open:()=>Ii});async function po(e,t,n=[],i){return typeof n=="object"&&Object.freeze(n),E({__tauriModule:"Shell",message:{cmd:"execute",program:t,args:n,options:i,onEventFn:mt(e)}})}var Kn=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)}},vs=class{constructor(e){this.pid=e}async write(e){return E({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof e=="string"?e:Array.from(e)}})}async kill(){return E({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}},Zn=class extends Kn{constructor(e,t=[],n){super(),this.stdout=new Kn,this.stderr=new Kn,this.program=e,this.args=typeof t=="string"?[t]:t,this.options=n!=null?n:{}}static create(e,t=[],n){return new Zn(e,t,n)}static sidecar(e,t=[],n){let i=new Zn(e,t,n);return i.options.sidecar=!0,i}async spawn(){return po(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 vs(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:this.collectOutput(n),stderr:this.collectOutput(i)})}),this.spawn().catch(t)})}collectOutput(e){return this.options.encoding==="raw"?e.reduce((t,n)=>new Uint8Array([...t,...n,10]),new Uint8Array):e.join(`
|
|
`)}};async function Ii(e,t){return E({__tauriModule:"Shell",message:{cmd:"open",path:e,with:t}})}var mo={};We(mo,{TauriEvent:()=>Ts,emit:()=>li,listen:()=>Yt,once:()=>Cs});async function ws(e,t){return E({__tauriModule:"Event",message:{cmd:"unlisten",event:e,eventId:t}})}async function ks(e,t,n){await E({__tauriModule:"Event",message:{cmd:"emit",event:e,windowLabel:t,payload:n}})}async function Ni(e,t,n){return E({__tauriModule:"Event",message:{cmd:"listen",event:e,windowLabel:t,handler:mt(n)}}).then(i=>async()=>ws(e,i))}async function Ms(e,t,n){return Ni(e,t,i=>{n(i),ws(e,i.id).catch(()=>{})})}var Ts=(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))(Ts||{});async function Yt(e,t){return Ni(e,null,t)}async function Cs(e,t){return Ms(e,null,t)}async function li(e,t){return ks(e,void 0,t)}var ho={};We(ho,{CloseRequestedEvent:()=>zs,LogicalPosition:()=>Ss,LogicalSize:()=>xn,PhysicalPosition:()=>nt,PhysicalSize:()=>pt,UserAttentionType:()=>Hi,WebviewWindow:()=>ht,WebviewWindowHandle:()=>As,WindowManager:()=>Es,appWindow:()=>Fe,availableMonitors:()=>go,currentMonitor:()=>_o,getAll:()=>Ls,getCurrent:()=>Ft,primaryMonitor:()=>bo});var xn=class{constructor(e,t){this.type="Logical",this.width=e,this.height=t}},pt=class{constructor(e,t){this.type="Physical",this.width=e,this.height=t}toLogical(e){return new xn(this.width/e,this.height/e)}},Ss=class{constructor(e,t){this.type="Logical",this.x=e,this.y=t}},nt=class{constructor(e,t){this.type="Physical",this.x=e,this.y=t}toLogical(e){return new Ss(this.x/e,this.y/e)}},Hi=(e=>(e[e.Critical=1]="Critical",e[e.Informational=2]="Informational",e))(Hi||{});function Ft(){return new ht(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function Ls(){return window.__TAURI_METADATA__.__windows.map(e=>new ht(e.label,{skip:!0}))}var Gl=["tauri://created","tauri://error"],As=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)}):Ni(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)}):Ms(e,this.label,t)}async emit(e,t){if(Gl.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:t});return Promise.resolve()}return ks(e,this.label,t)}_handleTauriEvent(e,t){return Gl.includes(e)?(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0):!1}},Es=class extends As{async scaleFactor(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:t})=>new nt(e,t))}async outerPosition(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:t})=>new nt(e,t))}async innerSize(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:t})=>new pt(e,t))}async outerSize(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:t})=>new pt(e,t))}async isFullscreen(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return E({__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"}),E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:t}}}})}async setResizable(e){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setShadow(e){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setShadow",payload:e}}}})}async setAlwaysOnTop(e){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setContentProtected(e){return E({__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 E({__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 E({__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 E({__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 E({__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 E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return E({__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 E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return E({__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 E({__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 E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",t=>{let n=new zs(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)}},zs=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}},ht=class extends Es{constructor(e,t={}){super(e),t!=null&&t.skip||E({__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 Ls().some(t=>t.label===e)?new ht(e,{skip:!0}):null}},Fe;"__TAURI_METADATA__"in window?Fe=new ht(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.`),Fe=new ht("main",{skip:!0}));function Ui(e){return e===null?null:{name:e.name,scaleFactor:e.scaleFactor,position:new nt(e.position.x,e.position.y),size:new pt(e.size.width,e.size.height)}}async function _o(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(Ui)}async function bo(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(Ui)}async function go(){return E({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(e=>e.map(Ui))}function yo(){return navigator.appVersion.includes("Win")}var vo={};We(vo,{EOL:()=>wo,arch:()=>To,platform:()=>Ws,tempdir:()=>Co,type:()=>Mo,version:()=>ko});var wo=yo()?`\r
|
|
`:`
|
|
`;async function Ws(){return E({__tauriModule:"Os",message:{cmd:"platform"}})}async function ko(){return E({__tauriModule:"Os",message:{cmd:"version"}})}async function Mo(){return E({__tauriModule:"Os",message:{cmd:"osType"}})}async function To(){return E({__tauriModule:"Os",message:{cmd:"arch"}})}async function Co(){return E({__tauriModule:"Os",message:{cmd:"tempdir"}})}var So={};We(So,{getName:()=>Os,getTauriVersion:()=>Ds,getVersion:()=>Ps,hide:()=>Is,show:()=>Rs});async function Ps(){return E({__tauriModule:"App",message:{cmd:"getAppVersion"}})}async function Os(){return E({__tauriModule:"App",message:{cmd:"getAppName"}})}async function Ds(){return E({__tauriModule:"App",message:{cmd:"getTauriVersion"}})}async function Rs(){return E({__tauriModule:"App",message:{cmd:"show"}})}async function Is(){return E({__tauriModule:"App",message:{cmd:"hide"}})}var Lo={};We(Lo,{exit:()=>Ns,relaunch:()=>ji});async function Ns(e=0){return E({__tauriModule:"Process",message:{cmd:"exit",exitCode:e}})}async function ji(){return E({__tauriModule:"Process",message:{cmd:"relaunch"}})}function Ao(e){let t,n,i,l,o,u,d,c,f,b,k,g,w,_,v,S,D,U,O,F,W,C,T,H,M,I;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=h(),i=a("br"),l=h(),o=a("br"),u=h(),d=a("pre"),c=A("App name: "),f=a("code"),b=A(e[2]),k=A(`
|
|
App version: `),g=a("code"),w=A(e[0]),_=A(`
|
|
Tauri version: `),v=a("code"),S=A(e[1]),D=A(`
|
|
`),U=h(),O=a("br"),F=h(),W=a("div"),C=a("button"),C.textContent="Close application",T=h(),H=a("button"),H.textContent="Relaunch application",r(C,"class","btn"),r(H,"class","btn"),r(W,"class","flex flex-wrap gap-1 shadow-")},m(j,J){m(j,t,J),m(j,n,J),m(j,i,J),m(j,l,J),m(j,o,J),m(j,u,J),m(j,d,J),s(d,c),s(d,f),s(f,b),s(d,k),s(d,g),s(g,w),s(d,_),s(d,v),s(v,S),s(d,D),m(j,U,J),m(j,O,J),m(j,F,J),m(j,W,J),s(W,C),s(W,T),s(W,H),M||(I=[L(C,"click",e[3]),L(H,"click",e[4])],M=!0)},p(j,[J]){J&4&&K(b,j[2]),J&1&&K(w,j[0]),J&2&&K(S,j[1])},i:V,o:V,d(j){j&&p(t),j&&p(n),j&&p(i),j&&p(l),j&&p(o),j&&p(u),j&&p(d),j&&p(U),j&&p(O),j&&p(F),j&&p(W),M=!1,ue(I)}}}function Eo(e,t,n){let i="0.0.0",l="0.0.0",o="Unknown";Os().then(c=>{n(2,o=c)}),Ps().then(c=>{n(0,i=c)}),Ds().then(c=>{n(1,l=c)});async function u(){await Ns()}async function d(){await ji()}return[i,l,o,u,d]}class zo extends Me{constructor(t){super(),ke(this,t,Eo,Ao,ge,{})}}function Wo(e){let t,n,i,l,o,u,d,c,f,b,k,g,w;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=h(),i=a("br"),l=h(),o=a("div"),o.textContent="Note that the arguments are only parsed, not implemented.",u=h(),d=a("br"),c=h(),f=a("br"),b=h(),k=a("button"),k.textContent="Get matches",r(o,"class","note"),r(k,"class","btn"),r(k,"id","cli-matches")},m(_,v){m(_,t,v),m(_,n,v),m(_,i,v),m(_,l,v),m(_,o,v),m(_,u,v),m(_,d,v),m(_,c,v),m(_,f,v),m(_,b,v),m(_,k,v),g||(w=L(k,"click",e[0]),g=!0)},p:V,i:V,o:V,d(_){_&&p(t),_&&p(n),_&&p(i),_&&p(l),_&&p(o),_&&p(u),_&&p(d),_&&p(c),_&&p(f),_&&p(b),_&&p(k),g=!1,w()}}}function Po(e,t,n){let{onMessage:i}=t;function l(){Xt("plugin:cli|cli_matches").then(i).catch(i)}return e.$$set=o=>{"onMessage"in o&&n(1,i=o.onMessage)},[l,i]}class Oo extends Me{constructor(t){super(),ke(this,t,Po,Wo,ge,{onMessage:1})}}function Do(e){let t,n,i,l,o,u,d,c;return{c(){t=a("div"),n=a("button"),n.textContent="Call Log API",i=h(),l=a("button"),l.textContent="Call Request (async) API",o=h(),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,b){m(f,t,b),s(t,n),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[L(n,"click",e[0]),L(l,"click",e[1]),L(u,"click",e[2])],d=!0)},p:V,i:V,o:V,d(f){f&&p(t),d=!1,ue(c)}}}function Ro(e,t,n){let{onMessage:i}=t,l;dt(async()=>{l=await Yt("rust-event",i)}),Ri(()=>{l&&l()});function o(){Xt("log_operation",{event:"tauri-click",payload:"this payload is optional because we used Option in Rust"})}function u(){Xt("perform_request",{endpoint:"dummy endpoint arg",body:{id:5,name:"test"}}).then(i).catch(i)}function d(){li("js-event","this is the payload string")}return e.$$set=c=>{"onMessage"in c&&n(3,i=c.onMessage)},[o,u,d,i]}class Io extends Me{constructor(t){super(),ke(this,t,Ro,Do,ge,{onMessage:3})}}var No={};We(No,{ask:()=>Us,confirm:()=>Uo,message:()=>Ho,open:()=>qi,save:()=>Hs});async function qi(e={}){return typeof e=="object"&&Object.freeze(e),E({__tauriModule:"Dialog",message:{cmd:"openDialog",options:e}})}async function Hs(e={}){return typeof e=="object"&&Object.freeze(e),E({__tauriModule:"Dialog",message:{cmd:"saveDialog",options:e}})}async function Ho(e,t){var i,l;let n=typeof t=="string"?{title:t}:t;return E({__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 Us(e,t){var i,l,o,u,d;let n=typeof t=="string"?{title:t}:t;return E({__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 Uo(e,t){var i,l,o,u,d;let n=typeof t=="string"?{title:t}:t;return E({__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"]}})}function jo(e){let t,n,i,l,o,u,d,c,f,b,k,g,w,_,v,S,D,U,O,F,W,C,T,H;return{c(){t=a("div"),n=a("input"),i=h(),l=a("input"),o=h(),u=a("br"),d=h(),c=a("div"),f=a("input"),b=h(),k=a("label"),k.textContent="Multiple",g=h(),w=a("div"),_=a("input"),v=h(),S=a("label"),S.textContent="Directory",D=h(),U=a("br"),O=h(),F=a("button"),F.textContent="Open dialog",W=h(),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(_,"type","checkbox"),r(_,"id","dialog-directory"),r(S,"for","dialog-directory"),r(F,"class","btn"),r(F,"id","open-dialog"),r(C,"class","btn"),r(C,"id","save-dialog")},m(M,I){m(M,t,I),s(t,n),q(n,e[0]),s(t,i),s(t,l),q(l,e[1]),m(M,o,I),m(M,u,I),m(M,d,I),m(M,c,I),s(c,f),f.checked=e[2],s(c,b),s(c,k),m(M,g,I),m(M,w,I),s(w,_),_.checked=e[3],s(w,v),s(w,S),m(M,D,I),m(M,U,I),m(M,O,I),m(M,F,I),m(M,W,I),m(M,C,I),T||(H=[L(n,"input",e[7]),L(l,"input",e[8]),L(f,"change",e[9]),L(_,"change",e[10]),L(F,"click",e[4]),L(C,"click",e[5])],T=!0)},p(M,[I]){I&1&&n.value!==M[0]&&q(n,M[0]),I&2&&l.value!==M[1]&&q(l,M[1]),I&4&&(f.checked=M[2]),I&8&&(_.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(g),M&&p(w),M&&p(D),M&&p(U),M&&p(O),M&&p(F),M&&p(W),M&&p(C),T=!1,ue(H)}}}function qo(e,t,n){let{onMessage:i}=t,l=null,o=null,u=!1,d=!1;function c(){qi({title:"My wonderful open dialog",defaultPath:l,filters:o?[{name:"Tauri Example",extensions:o.split(",").map(_=>_.trim())}]:[],multiple:u,directory:d}).then(i).catch(i)}function f(){Hs({title:"My wonderful save dialog",defaultPath:l,filters:o?[{name:"Tauri Example",extensions:o.split(",").map(_=>_.trim())}]:[]}).then(i).catch(i)}function b(){l=this.value,n(0,l)}function k(){o=this.value,n(1,o)}function g(){u=this.checked,n(2,u)}function w(){d=this.checked,n(3,d)}return e.$$set=_=>{"onMessage"in _&&n(6,i=_.onMessage)},[l,o,u,d,c,f,i,b,k,g,w]}class Fo extends Me{constructor(t){super(),ke(this,t,qo,jo,ge,{onMessage:6})}}var Go={};We(Go,{Body:()=>it,Client:()=>qs,Response:()=>js,ResponseType:()=>Fi,fetch:()=>Vo,getClient:()=>ei});var Fi=(e=>(e[e.JSON=1]="JSON",e[e.Text=2]="Text",e[e.Binary=3]="Binary",e))(Fi||{}),it=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 it("Form",t)}static json(e){return new it("Json",e)}static text(e){return new it("Text",e)}static bytes(e){return new it("Bytes",Array.from(e instanceof ArrayBuffer?new Uint8Array(e):e))}},js=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}},qs=class{constructor(e){this.id=e}async drop(){return E({__tauriModule:"Http",message:{cmd:"dropClient",client:this.id}})}async request(e){let t=!e.responseType||e.responseType===1;return t&&(e.responseType=2),E({__tauriModule:"Http",message:{cmd:"httpRequest",client:this.id,options:e}}).then(n=>{let i=new js(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 ei(e){return E({__tauriModule:"Http",message:{cmd:"createClient",options:e}}).then(t=>new qs(t))}var zi=null;async function Vo(e,t){var n;return zi===null&&(zi=await ei()),zi.request({url:e,method:(n=t==null?void 0:t.method)!=null?n:"GET",...t})}function Vl(e,t,n){const i=e.slice();return i[12]=t[n],i[14]=n,i}function Bl(e){let t,n,i,l,o,u,d,c,f,b,k,g,w,_,v,S,D,U=e[5],O=[];for(let T=0;T<U.length;T+=1)O[T]=Yl(Vl(e,U,T));const F=T=>Ie(O[T],1,1,()=>{O[T]=null});let W=!e[3]&&$l(),C=!e[3]&&e[8]&&Kl();return{c(){t=a("span"),n=a("span"),i=A(e[6]),l=h(),o=a("ul");for(let T=0;T<O.length;T+=1)O[T].c();u=h(),d=a("span"),c=A(e[7]),W&&W.c(),f=h(),b=a("span"),k=A(e[6]),g=A(Yo),w=A(e[7]),C&&C.c(),_=ti(),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"),Jn(t,"hidden",e[8]),r(b,"class","bracket svelte-gbh3pt"),r(b,"tabindex","0"),Jn(b,"hidden",!e[8])},m(T,H){m(T,t,H),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),m(T,f,H),m(T,b,H),s(b,k),s(b,g),s(b,w),C&&C.m(T,H),m(T,_,H),v=!0,S||(D=[L(n,"click",e[11]),L(d,"click",e[11]),L(b,"click",e[11])],S=!0)},p(T,H){if((!v||H&64)&&K(i,T[6]),H&1591){U=T[5];let M;for(M=0;M<U.length;M+=1){const I=Vl(T,U,M);O[M]?(O[M].p(I,H),Se(O[M],1)):(O[M]=Yl(I),O[M].c(),Se(O[M],1),O[M].m(o,null))}for(ni(),M=U.length;M<O.length;M+=1)F(M);ii()}(!v||H&128)&&K(c,T[7]),T[3]?W&&(W.d(1),W=null):W||(W=$l(),W.c(),W.m(t,null)),H&256&&Jn(t,"hidden",T[8]),(!v||H&64)&&K(k,T[6]),(!v||H&128)&&K(w,T[7]),H&256&&Jn(b,"hidden",!T[8]),!T[3]&&T[8]?C||(C=Kl(),C.c(),C.m(_.parentNode,_)):C&&(C.d(1),C=null)},i(T){if(!v){for(let H=0;H<U.length;H+=1)Se(O[H]);v=!0}},o(T){O=O.filter(Boolean);for(let H=0;H<O.length;H+=1)Ie(O[H]);v=!1},d(T){T&&p(t),zt(O,T),W&&W.d(),T&&p(f),T&&p(b),C&&C.d(T),T&&p(_),S=!1,ue(D)}}}function Jl(e){let t,n,i=e[12]+"",l,o;return{c(){t=a("span"),n=A('"'),l=A(i),o=A('":'),r(t,"class","key")},m(u,d){m(u,t,d),s(t,n),s(t,l),s(t,o)},p(u,d){d&32&&i!==(i=u[12]+"")&&K(l,i)},d(u){u&&p(t)}}}function Bo(e){let t,n=e[10](e[0][e[12]])+"",i,l,o=e[14]<e[5].length-1&&Xl();return{c(){t=a("span"),i=A(n),o&&o.c(),r(t,"class",l="val "+e[9](e[0][e[12]])+" svelte-gbh3pt")},m(u,d){m(u,t,d),s(t,i),o&&o.m(t,null)},p(u,d){d&33&&n!==(n=u[10](u[0][u[12]])+"")&&K(i,n),u[14]<u[5].length-1?o||(o=Xl(),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 Jo(e){let t,n;return t=new Fs({props:{json:e[0][e[12]],depth:e[1],_lvl:e[2]+1,_last:e[14]===e[5].length-1}}),{c(){Qn(t.$$.fragment)},m(i,l){Bt(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||(Se(t.$$.fragment,i),n=!0)},o(i){Ie(t.$$.fragment,i),n=!1},d(i){Jt(t,i)}}}function Xl(e){let t;return{c(){t=a("span"),t.textContent=",",r(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Yl(e){let t,n,i,l,o,u,d,c=!e[4]&&Jl(e);const f=[Jo,Bo],b=[];function k(g,w){return w&33&&(i=null),i==null&&(i=g[9](g[0][g[12]])==="object"),i?0:1}return l=k(e,-1),o=b[l]=f[l](e),{c(){t=a("li"),c&&c.c(),n=h(),o.c(),u=h()},m(g,w){m(g,t,w),c&&c.m(t,null),s(t,n),b[l].m(t,null),s(t,u),d=!0},p(g,w){g[4]?c&&(c.d(1),c=null):c?c.p(g,w):(c=Jl(g),c.c(),c.m(t,n));let _=l;l=k(g,w),l===_?b[l].p(g,w):(ni(),Ie(b[_],1,1,()=>{b[_]=null}),ii(),o=b[l],o?o.p(g,w):(o=b[l]=f[l](g),o.c()),Se(o,1),o.m(t,u))},i(g){d||(Se(o),d=!0)},o(g){Ie(o),d=!1},d(g){g&&p(t),c&&c.d(),b[l].d()}}}function $l(e){let t;return{c(){t=a("span"),t.textContent=",",r(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Kl(e){let t;return{c(){t=a("span"),t.textContent=",",r(t,"class","comma svelte-gbh3pt")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Xo(e){let t,n,i=e[5].length&&Bl(e);return{c(){i&&i.c(),t=ti()},m(l,o){i&&i.m(l,o),m(l,t,o),n=!0},p(l,[o]){l[5].length?i?(i.p(l,o),o&32&&Se(i,1)):(i=Bl(l),i.c(),Se(i,1),i.m(t.parentNode,t)):i&&(ni(),Ie(i,1,1,()=>{i=null}),ii())},i(l){n||(Se(i),n=!0)},o(l){Ie(i),n=!1},d(l){i&&i.d(l),l&&p(t)}}}const Yo="...";function $o(e,t,n){let{json:i}=t,{depth:l=1/0}=t,{_lvl:o=0}=t,{_last:u=!0}=t;const d=v=>v===null?"null":typeof v;let c,f,b,k,g;const w=v=>{switch(d(v)){case"string":return`"${v}"`;case"function":return"f () {...}";case"symbol":return v.toString();default:return v}},_=()=>{n(8,g=!g)};return e.$$set=v=>{"json"in v&&n(0,i=v.json),"depth"in v&&n(1,l=v.depth),"_lvl"in v&&n(2,o=v._lvl),"_last"in v&&n(3,u=v._last)},e.$$.update=()=>{e.$$.dirty&17&&(n(5,c=d(i)==="object"?Object.keys(i):[]),n(4,f=Array.isArray(i)),n(6,b=f?"[":"{"),n(7,k=f?"]":"}")),e.$$.dirty&6&&n(8,g=l<o)},[i,l,o,u,f,c,b,k,g,d,w,_]}class Fs extends Me{constructor(t){super(),ke(this,t,$o,Xo,ge,{json:0,depth:1,_lvl:2,_last:3})}}function Ko(e){let t,n,i,l,o,u,d,c,f,b,k,g,w,_,v,S,D,U,O,F,W,C,T,H,M,I,j,J,ne,ce,te,Y,se,ee,R,X,Z,_e,fe,pe,ye,oe,x,me,Le;return oe=new Fs({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=h(),f=a("br"),b=h(),k=a("textarea"),g=h(),w=a("br"),_=h(),v=a("button"),v.textContent="Make request",S=h(),D=a("br"),U=h(),O=a("h3"),O.textContent="HTTP Form",F=h(),W=a("div"),C=a("input"),T=h(),H=a("input"),M=h(),I=a("br"),j=h(),J=a("label"),ne=a("input"),ce=A(`
|
|
Multipart`),te=h(),Y=a("br"),se=h(),ee=a("br"),R=h(),X=a("button"),X.textContent="Post it",Z=h(),_e=a("br"),fe=h(),pe=a("br"),ye=h(),Qn(oe.$$.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&&Pt(()=>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(v,"class","btn"),r(v,"id","make-request"),r(C,"class","input"),r(H,"class","input"),r(W,"class","flex gap-2 children:grow"),r(ne,"type","checkbox"),r(X,"class","btn"),r(X,"type","button")},m(z,G){m(z,t,G),s(t,n),s(n,i),s(n,l),s(n,o),s(n,u),s(n,d),Wt(n,e[0]),s(t,c),s(t,f),s(t,b),s(t,k),q(k,e[1]),s(t,g),s(t,w),s(t,_),s(t,v),m(z,S,G),m(z,D,G),m(z,U,G),m(z,O,G),m(z,F,G),m(z,W,G),s(W,C),q(C,e[2]),s(W,T),s(W,H),q(H,e[3]),m(z,M,G),m(z,I,G),m(z,j,G),m(z,J,G),s(J,ne),ne.checked=e[5],s(J,ce),m(z,te,G),m(z,Y,G),m(z,se,G),m(z,ee,G),m(z,R,G),m(z,X,G),m(z,Z,G),m(z,_e,G),m(z,fe,G),m(z,pe,G),m(z,ye,G),Bt(oe,z,G),x=!0,me||(Le=[L(n,"change",e[9]),L(k,"input",e[10]),L(t,"submit",Wi(e[6])),L(C,"input",e[11]),L(H,"input",e[12]),L(ne,"change",e[13]),L(X,"click",e[7])],me=!0)},p(z,[G]){G&1&&Wt(n,z[0]),G&2&&q(k,z[1]),G&4&&C.value!==z[2]&&q(C,z[2]),G&8&&H.value!==z[3]&&q(H,z[3]),G&32&&(ne.checked=z[5]);const Ae={};G&16&&(Ae.json=z[4]),oe.$set(Ae)},i(z){x||(Se(oe.$$.fragment,z),x=!0)},o(z){Ie(oe.$$.fragment,z),x=!1},d(z){z&&p(t),z&&p(S),z&&p(D),z&&p(U),z&&p(O),z&&p(F),z&&p(W),z&&p(M),z&&p(I),z&&p(j),z&&p(J),z&&p(te),z&&p(Y),z&&p(se),z&&p(ee),z&&p(R),z&&p(X),z&&p(Z),z&&p(_e),z&&p(fe),z&&p(pe),z&&p(ye),Jt(oe,z),me=!1,ue(Le)}}}function Qo(e,t,n){let i="GET",l="",{onMessage:o}=t;async function u(){const D=await ei().catch(F=>{throw o(F),F}),O={url:"http://localhost:3003",method:i||"GET"||"GET"};l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")?O.body=it.json(JSON.parse(l)):l!==""&&(O.body=it.text(l)),D.request(O).then(o).catch(o)}let d="baz",c="qux",f=null,b=!0;async function k(){const D=await ei().catch(U=>{throw o(U),U});n(4,f=await D.request({url:"http://localhost:3003",method:"POST",body:it.form({foo:d,bar:c}),headers:b?{"Content-Type":"multipart/form-data"}:void 0,responseType:Fi.Text}))}function g(){i=Pi(this),n(0,i)}function w(){l=this.value,n(1,l)}function _(){d=this.value,n(2,d)}function v(){c=this.value,n(3,c)}function S(){b=this.checked,n(5,b)}return e.$$set=D=>{"onMessage"in D&&n(8,o=D.onMessage)},[i,l,d,c,f,b,u,k,o,g,w,_,v,S]}class Zo extends Me{constructor(t){super(),ke(this,t,Qo,Ko,ge,{onMessage:8})}}function xo(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){m(l,t,o),n||(i=L(t,"click",ea),n=!0)},p:V,i:V,o:V,d(l){l&&p(t),n=!1,i()}}}function ea(){new Notification("Notification title",{body:"This is the notification body"})}function ta(e,t,n){let{onMessage:i}=t;return e.$$set=l=>{"onMessage"in l&&n(0,i=l.onMessage)},[i]}class na extends Me{constructor(t){super(),ke(this,t,ta,xo,ge,{onMessage:0})}}function Ql(e,t,n){const i=e.slice();return i[69]=t[n],i}function Zl(e,t,n){const i=e.slice();return i[72]=t[n],i}function xl(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]=es(Zl(e,d,f));return{c(){t=a("span"),t.textContent="Selected window:",n=h(),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&&Pt(()=>e[40].call(i))},m(f,b){m(f,t,b),m(f,n,b),m(f,i,b),s(i,l);for(let k=0;k<c.length;k+=1)c[k].m(i,null);Wt(i,e[0]),o||(u=L(i,"change",e[40]),o=!0)},p(f,b){if(b[0]&2){d=Object.keys(f[1]);let k;for(k=0;k<d.length;k+=1){const g=Zl(f,d,k);c[k]?c[k].p(g,b):(c[k]=es(g),c[k].c(),c[k].m(i,null))}for(;k<c.length;k+=1)c[k].d(1);c.length=d.length}b[0]&3&&Wt(i,f[0])},d(f){f&&p(t),f&&p(n),f&&p(i),zt(c,f),o=!1,u()}}}function es(e){let t,n=e[72]+"",i,l;return{c(){t=a("option"),i=A(n),t.__value=l=e[72],t.value=t.__value},m(o,u){m(o,t,u),s(t,i)},p(o,u){u[0]&2&&n!==(n=o[72]+"")&&K(i,n),u[0]&2&&l!==(l=o[72])&&(t.__value=l,t.value=t.__value)},d(o){o&&p(t)}}}function ts(e){let t,n,i,l,o,u,d,c,f,b,k,g,w,_,v,S,D,U,O,F,W,C,T,H,M,I,j,J,ne,ce,te,Y,se,ee,R,X,Z,_e,fe,pe,ye,oe,x,me,Le,z,G,Ae,ve,ae,de,re,we,Ne,Pe,Q,N,ie,B,he,$t,Ge,_t,Kt,De,Qt,bt,Zt,Re,xt,Ve,$,Ot,Ee,Dt,lt,Rt,ze,gt,yt,vt,Ce,He,Oe,st,It,ot,Nt,at=e[27].width+"",wt,en,tn,Vi,nn=e[27].height+"",si,Bi,Be,ln,Ji,sn,Xi,on=e[28].width+"",oi,Yi,an,$i,rn=e[28].height+"",ai,Ki,kt,Je,un,Qi,cn,Zi,dn=e[27].toLogical(e[24]).width+"",ri,xi,fn,el,pn=e[27].toLogical(e[24]).height+"",ui,tl,Xe,mn,nl,hn,il,_n=e[28].toLogical(e[24]).width+"",ci,ll,bn,sl,gn=e[28].toLogical(e[24]).height+"",di,ol,Mt,Ye,yn,al,vn,rl,wn=e[25].x+"",fi,ul,kn,cl,Mn=e[25].y+"",pi,dl,$e,Tn,fl,Cn,pl,Sn=e[26].x+"",mi,ml,Ln,hl,An=e[26].y+"",hi,_l,Tt,Ke,En,bl,zn,gl,Wn=e[25].toLogical(e[24]).x+"",_i,yl,Pn,vl,On=e[25].toLogical(e[24]).y+"",bi,wl,Qe,Dn,kl,Rn,Ml,In=e[26].toLogical(e[24]).x+"",gi,Tl,Nn,Cl,Hn=e[26].toLogical(e[24]).y+"",yi,vi,wi,ki,Ht,Mi,Ue,Un,Ct,Sl,Ll,jn,St,Al,El,qn,Lt,zl,Ti,je,Fn,Wl,qe,Pl,Gn,Ol,Ze,Dl,Vn,Rl,xe,Ci,Si,Li,rt,ut,et,Il,Ut,Nl,ct,tt,Hl,jt,Ai,Ul,At=e[30],Te=[];for(let y=0;y<At.length;y+=1)Te[y]=ns(Ql(e,At,y));return{c(){t=a("br"),n=h(),i=a("div"),l=a("button"),l.textContent="Center",o=h(),u=a("button"),u.textContent="Minimize",d=h(),c=a("button"),c.textContent="Hide",f=h(),b=a("button"),b.textContent="Change icon",k=h(),g=a("button"),g.textContent="Request attention",w=h(),_=a("br"),v=h(),S=a("div"),D=a("label"),U=A(`Maximized
|
|
`),O=a("input"),F=h(),W=a("label"),C=A(`Resizable
|
|
`),T=a("input"),H=h(),M=a("label"),I=A(`Has decorations
|
|
`),j=a("input"),J=h(),ne=a("label"),ce=A(`Always on top
|
|
`),te=a("input"),Y=h(),se=a("label"),ee=A(`Content protected
|
|
`),R=a("input"),X=h(),Z=a("label"),_e=A(`Fullscreen
|
|
`),fe=a("input"),pe=h(),ye=a("br"),oe=h(),x=a("div"),me=a("div"),Le=a("div"),z=A(`X
|
|
`),G=a("input"),Ae=h(),ve=a("div"),ae=A(`Y
|
|
`),de=a("input"),re=h(),we=a("div"),Ne=a("div"),Pe=A(`Width
|
|
`),Q=a("input"),N=h(),ie=a("div"),B=A(`Height
|
|
`),he=a("input"),$t=h(),Ge=a("div"),_t=a("div"),Kt=A(`Min width
|
|
`),De=a("input"),Qt=h(),bt=a("div"),Zt=A(`Min height
|
|
`),Re=a("input"),xt=h(),Ve=a("div"),$=a("div"),Ot=A(`Max width
|
|
`),Ee=a("input"),Dt=h(),lt=a("div"),Rt=A(`Max height
|
|
`),ze=a("input"),gt=h(),yt=a("br"),vt=h(),Ce=a("div"),He=a("div"),Oe=a("div"),st=a("div"),st.textContent="Inner Size",It=h(),ot=a("span"),Nt=A("Width: "),wt=A(at),en=h(),tn=a("span"),Vi=A("Height: "),si=A(nn),Bi=h(),Be=a("div"),ln=a("div"),ln.textContent="Outer Size",Ji=h(),sn=a("span"),Xi=A("Width: "),oi=A(on),Yi=h(),an=a("span"),$i=A("Height: "),ai=A(rn),Ki=h(),kt=a("div"),Je=a("div"),un=a("div"),un.textContent="Inner Logical Size",Qi=h(),cn=a("span"),Zi=A("Width: "),ri=A(dn),xi=h(),fn=a("span"),el=A("Height: "),ui=A(pn),tl=h(),Xe=a("div"),mn=a("div"),mn.textContent="Outer Logical Size",nl=h(),hn=a("span"),il=A("Width: "),ci=A(_n),ll=h(),bn=a("span"),sl=A("Height: "),di=A(gn),ol=h(),Mt=a("div"),Ye=a("div"),yn=a("div"),yn.textContent="Inner Position",al=h(),vn=a("span"),rl=A("x: "),fi=A(wn),ul=h(),kn=a("span"),cl=A("y: "),pi=A(Mn),dl=h(),$e=a("div"),Tn=a("div"),Tn.textContent="Outer Position",fl=h(),Cn=a("span"),pl=A("x: "),mi=A(Sn),ml=h(),Ln=a("span"),hl=A("y: "),hi=A(An),_l=h(),Tt=a("div"),Ke=a("div"),En=a("div"),En.textContent="Inner Logical Position",bl=h(),zn=a("span"),gl=A("x: "),_i=A(Wn),yl=h(),Pn=a("span"),vl=A("y: "),bi=A(On),wl=h(),Qe=a("div"),Dn=a("div"),Dn.textContent="Outer Logical Position",kl=h(),Rn=a("span"),Ml=A("x: "),gi=A(In),Tl=h(),Nn=a("span"),Cl=A("y: "),yi=A(Hn),vi=h(),wi=a("br"),ki=h(),Ht=a("h4"),Ht.textContent="Cursor",Mi=h(),Ue=a("div"),Un=a("label"),Ct=a("input"),Sl=A(`
|
|
Grab`),Ll=h(),jn=a("label"),St=a("input"),Al=A(`
|
|
Visible`),El=h(),qn=a("label"),Lt=a("input"),zl=A(`
|
|
Ignore events`),Ti=h(),je=a("div"),Fn=a("label"),Wl=A(`Icon
|
|
`),qe=a("select");for(let y=0;y<Te.length;y+=1)Te[y].c();Pl=h(),Gn=a("label"),Ol=A(`X position
|
|
`),Ze=a("input"),Dl=h(),Vn=a("label"),Rl=A(`Y position
|
|
`),xe=a("input"),Ci=h(),Si=a("br"),Li=h(),rt=a("div"),ut=a("form"),et=a("input"),Il=h(),Ut=a("button"),Ut.textContent="Set title",Nl=h(),ct=a("form"),tt=a("input"),Hl=h(),jt=a("button"),jt.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(b,"class","btn"),r(g,"class","btn"),r(g,"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(j,"type","checkbox"),r(te,"type","checkbox"),r(R,"type","checkbox"),r(fe,"type","checkbox"),r(S,"class","flex flex-wrap gap-2"),r(G,"class","input"),r(G,"type","number"),r(G,"min","0"),r(de,"class","input"),r(de,"type","number"),r(de,"min","0"),r(me,"class","flex children:grow flex-col"),r(Q,"class","input"),r(Q,"type","number"),r(Q,"min","400"),r(he,"class","input"),r(he,"type","number"),r(he,"min","400"),r(we,"class","flex children:grow flex-col"),r(De,"class","input"),r(De,"type","number"),r(Re,"class","input"),r(Re,"type","number"),r(Ge,"class","flex children:grow flex-col"),r(Ee,"class","input"),r(Ee,"type","number"),r(Ee,"min","800"),r(ze,"class","input"),r(ze,"type","number"),r(ze,"min","400"),r(Ve,"class","flex children:grow flex-col"),r(x,"class","flex flex-row gap-2 flex-wrap"),r(st,"class","text-accent dark:text-darkAccent font-700"),r(Oe,"class","grow"),r(ln,"class","text-accent dark:text-darkAccent font-700"),r(Be,"class","grow"),r(He,"class","flex"),r(un,"class","text-accent dark:text-darkAccent font-700"),r(Je,"class","grow"),r(mn,"class","text-accent dark:text-darkAccent font-700"),r(Xe,"class","grow"),r(kt,"class","flex"),r(yn,"class","text-accent dark:text-darkAccent font-700"),r(Ye,"class","grow"),r(Tn,"class","text-accent dark:text-darkAccent font-700"),r($e,"class","grow"),r(Mt,"class","flex"),r(En,"class","text-accent dark:text-darkAccent font-700"),r(Ke,"class","grow"),r(Dn,"class","text-accent dark:text-darkAccent font-700"),r(Qe,"class","grow"),r(Tt,"class","flex"),r(Ht,"class","mb-2"),r(Ct,"type","checkbox"),r(St,"type","checkbox"),r(Lt,"type","checkbox"),r(Ue,"class","flex gap-2"),r(qe,"class","input"),e[20]===void 0&&Pt(()=>e[59].call(qe)),r(Ze,"class","input"),r(Ze,"type","number"),r(xe,"class","input"),r(xe,"type","number"),r(je,"class","flex gap-2"),r(et,"class","input grow"),r(et,"id","title"),r(Ut,"class","btn"),r(Ut,"type","submit"),r(ut,"class","flex gap-1"),r(tt,"class","input grow"),r(tt,"id","url"),r(jt,"class","btn"),r(jt,"id","open-url"),r(ct,"class","flex gap-1"),r(rt,"class","flex flex-col gap-1")},m(y,P){m(y,t,P),m(y,n,P),m(y,i,P),s(i,l),s(i,o),s(i,u),s(i,d),s(i,c),s(i,f),s(i,b),s(i,k),s(i,g),m(y,w,P),m(y,_,P),m(y,v,P),m(y,S,P),s(S,D),s(D,U),s(D,O),O.checked=e[3],s(S,F),s(S,W),s(W,C),s(W,T),T.checked=e[2],s(S,H),s(S,M),s(M,I),s(M,j),j.checked=e[4],s(S,J),s(S,ne),s(ne,ce),s(ne,te),te.checked=e[5],s(S,Y),s(S,se),s(se,ee),s(se,R),R.checked=e[6],s(S,X),s(S,Z),s(Z,_e),s(Z,fe),fe.checked=e[7],m(y,pe,P),m(y,ye,P),m(y,oe,P),m(y,x,P),s(x,me),s(me,Le),s(Le,z),s(Le,G),q(G,e[14]),s(me,Ae),s(me,ve),s(ve,ae),s(ve,de),q(de,e[15]),s(x,re),s(x,we),s(we,Ne),s(Ne,Pe),s(Ne,Q),q(Q,e[8]),s(we,N),s(we,ie),s(ie,B),s(ie,he),q(he,e[9]),s(x,$t),s(x,Ge),s(Ge,_t),s(_t,Kt),s(_t,De),q(De,e[10]),s(Ge,Qt),s(Ge,bt),s(bt,Zt),s(bt,Re),q(Re,e[11]),s(x,xt),s(x,Ve),s(Ve,$),s($,Ot),s($,Ee),q(Ee,e[12]),s(Ve,Dt),s(Ve,lt),s(lt,Rt),s(lt,ze),q(ze,e[13]),m(y,gt,P),m(y,yt,P),m(y,vt,P),m(y,Ce,P),s(Ce,He),s(He,Oe),s(Oe,st),s(Oe,It),s(Oe,ot),s(ot,Nt),s(ot,wt),s(Oe,en),s(Oe,tn),s(tn,Vi),s(tn,si),s(He,Bi),s(He,Be),s(Be,ln),s(Be,Ji),s(Be,sn),s(sn,Xi),s(sn,oi),s(Be,Yi),s(Be,an),s(an,$i),s(an,ai),s(Ce,Ki),s(Ce,kt),s(kt,Je),s(Je,un),s(Je,Qi),s(Je,cn),s(cn,Zi),s(cn,ri),s(Je,xi),s(Je,fn),s(fn,el),s(fn,ui),s(kt,tl),s(kt,Xe),s(Xe,mn),s(Xe,nl),s(Xe,hn),s(hn,il),s(hn,ci),s(Xe,ll),s(Xe,bn),s(bn,sl),s(bn,di),s(Ce,ol),s(Ce,Mt),s(Mt,Ye),s(Ye,yn),s(Ye,al),s(Ye,vn),s(vn,rl),s(vn,fi),s(Ye,ul),s(Ye,kn),s(kn,cl),s(kn,pi),s(Mt,dl),s(Mt,$e),s($e,Tn),s($e,fl),s($e,Cn),s(Cn,pl),s(Cn,mi),s($e,ml),s($e,Ln),s(Ln,hl),s(Ln,hi),s(Ce,_l),s(Ce,Tt),s(Tt,Ke),s(Ke,En),s(Ke,bl),s(Ke,zn),s(zn,gl),s(zn,_i),s(Ke,yl),s(Ke,Pn),s(Pn,vl),s(Pn,bi),s(Tt,wl),s(Tt,Qe),s(Qe,Dn),s(Qe,kl),s(Qe,Rn),s(Rn,Ml),s(Rn,gi),s(Qe,Tl),s(Qe,Nn),s(Nn,Cl),s(Nn,yi),m(y,vi,P),m(y,wi,P),m(y,ki,P),m(y,Ht,P),m(y,Mi,P),m(y,Ue,P),s(Ue,Un),s(Un,Ct),Ct.checked=e[16],s(Un,Sl),s(Ue,Ll),s(Ue,jn),s(jn,St),St.checked=e[17],s(jn,Al),s(Ue,El),s(Ue,qn),s(qn,Lt),Lt.checked=e[21],s(qn,zl),m(y,Ti,P),m(y,je,P),s(je,Fn),s(Fn,Wl),s(Fn,qe);for(let be=0;be<Te.length;be+=1)Te[be].m(qe,null);Wt(qe,e[20]),s(je,Pl),s(je,Gn),s(Gn,Ol),s(Gn,Ze),q(Ze,e[18]),s(je,Dl),s(je,Vn),s(Vn,Rl),s(Vn,xe),q(xe,e[19]),m(y,Ci,P),m(y,Si,P),m(y,Li,P),m(y,rt,P),s(rt,ut),s(ut,et),q(et,e[29]),s(ut,Il),s(ut,Ut),s(rt,Nl),s(rt,ct),s(ct,tt),q(tt,e[23]),s(ct,Hl),s(ct,jt),Ai||(Ul=[L(l,"click",e[41]),L(u,"click",e[34]),L(c,"click",e[33]),L(b,"click",e[35]),L(g,"click",e[37]),L(O,"change",e[42]),L(T,"change",e[43]),L(j,"change",e[44]),L(te,"change",e[45]),L(R,"change",e[46]),L(fe,"change",e[47]),L(G,"input",e[48]),L(de,"input",e[49]),L(Q,"input",e[50]),L(he,"input",e[51]),L(De,"input",e[52]),L(Re,"input",e[53]),L(Ee,"input",e[54]),L(ze,"input",e[55]),L(Ct,"change",e[56]),L(St,"change",e[57]),L(Lt,"change",e[58]),L(qe,"change",e[59]),L(Ze,"input",e[60]),L(xe,"input",e[61]),L(et,"input",e[62]),L(ut,"submit",Wi(e[32])),L(tt,"input",e[63]),L(ct,"submit",Wi(e[31]))],Ai=!0)},p(y,P){if(P[0]&8&&(O.checked=y[3]),P[0]&4&&(T.checked=y[2]),P[0]&16&&(j.checked=y[4]),P[0]&32&&(te.checked=y[5]),P[0]&64&&(R.checked=y[6]),P[0]&128&&(fe.checked=y[7]),P[0]&16384&&le(G.value)!==y[14]&&q(G,y[14]),P[0]&32768&&le(de.value)!==y[15]&&q(de,y[15]),P[0]&256&&le(Q.value)!==y[8]&&q(Q,y[8]),P[0]&512&&le(he.value)!==y[9]&&q(he,y[9]),P[0]&1024&&le(De.value)!==y[10]&&q(De,y[10]),P[0]&2048&&le(Re.value)!==y[11]&&q(Re,y[11]),P[0]&4096&&le(Ee.value)!==y[12]&&q(Ee,y[12]),P[0]&8192&&le(ze.value)!==y[13]&&q(ze,y[13]),P[0]&134217728&&at!==(at=y[27].width+"")&&K(wt,at),P[0]&134217728&&nn!==(nn=y[27].height+"")&&K(si,nn),P[0]&268435456&&on!==(on=y[28].width+"")&&K(oi,on),P[0]&268435456&&rn!==(rn=y[28].height+"")&&K(ai,rn),P[0]&150994944&&dn!==(dn=y[27].toLogical(y[24]).width+"")&&K(ri,dn),P[0]&150994944&&pn!==(pn=y[27].toLogical(y[24]).height+"")&&K(ui,pn),P[0]&285212672&&_n!==(_n=y[28].toLogical(y[24]).width+"")&&K(ci,_n),P[0]&285212672&&gn!==(gn=y[28].toLogical(y[24]).height+"")&&K(di,gn),P[0]&33554432&&wn!==(wn=y[25].x+"")&&K(fi,wn),P[0]&33554432&&Mn!==(Mn=y[25].y+"")&&K(pi,Mn),P[0]&67108864&&Sn!==(Sn=y[26].x+"")&&K(mi,Sn),P[0]&67108864&&An!==(An=y[26].y+"")&&K(hi,An),P[0]&50331648&&Wn!==(Wn=y[25].toLogical(y[24]).x+"")&&K(_i,Wn),P[0]&50331648&&On!==(On=y[25].toLogical(y[24]).y+"")&&K(bi,On),P[0]&83886080&&In!==(In=y[26].toLogical(y[24]).x+"")&&K(gi,In),P[0]&83886080&&Hn!==(Hn=y[26].toLogical(y[24]).y+"")&&K(yi,Hn),P[0]&65536&&(Ct.checked=y[16]),P[0]&131072&&(St.checked=y[17]),P[0]&2097152&&(Lt.checked=y[21]),P[0]&1073741824){At=y[30];let be;for(be=0;be<At.length;be+=1){const jl=Ql(y,At,be);Te[be]?Te[be].p(jl,P):(Te[be]=ns(jl),Te[be].c(),Te[be].m(qe,null))}for(;be<Te.length;be+=1)Te[be].d(1);Te.length=At.length}P[0]&1074790400&&Wt(qe,y[20]),P[0]&262144&&le(Ze.value)!==y[18]&&q(Ze,y[18]),P[0]&524288&&le(xe.value)!==y[19]&&q(xe,y[19]),P[0]&536870912&&et.value!==y[29]&&q(et,y[29]),P[0]&8388608&&tt.value!==y[23]&&q(tt,y[23])},d(y){y&&p(t),y&&p(n),y&&p(i),y&&p(w),y&&p(_),y&&p(v),y&&p(S),y&&p(pe),y&&p(ye),y&&p(oe),y&&p(x),y&&p(gt),y&&p(yt),y&&p(vt),y&&p(Ce),y&&p(vi),y&&p(wi),y&&p(ki),y&&p(Ht),y&&p(Mi),y&&p(Ue),y&&p(Ti),y&&p(je),zt(Te,y),y&&p(Ci),y&&p(Si),y&&p(Li),y&&p(rt),Ai=!1,ue(Ul)}}}function ns(e){let t,n=e[69]+"",i;return{c(){t=a("option"),i=A(n),t.__value=e[69],t.value=t.__value},m(l,o){m(l,t,o),s(t,i)},p:V,d(l){l&&p(t)}}}function ia(e){let t,n,i,l,o,u,d,c,f=Object.keys(e[1]).length>=1,b,k,g,w=f&&xl(e),_=e[1][e[0]]&&ts(e);return{c(){t=a("div"),n=a("div"),i=a("input"),l=h(),o=a("button"),o.textContent="New window",u=h(),d=a("br"),c=h(),w&&w.c(),b=h(),_&&_.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(v,S){m(v,t,S),s(t,n),s(n,i),q(i,e[22]),s(n,l),s(n,o),s(t,u),s(t,d),s(t,c),w&&w.m(t,null),s(t,b),_&&_.m(t,null),k||(g=[L(i,"input",e[39]),L(o,"click",e[36])],k=!0)},p(v,S){S[0]&4194304&&i.value!==v[22]&&q(i,v[22]),S[0]&2&&(f=Object.keys(v[1]).length>=1),f?w?w.p(v,S):(w=xl(v),w.c(),w.m(t,b)):w&&(w.d(1),w=null),v[1][v[0]]?_?_.p(v,S):(_=ts(v),_.c(),_.m(t,null)):_&&(_.d(1),_=null)},i:V,o:V,d(v){v&&p(t),w&&w.d(),_&&_.d(),k=!1,ue(g)}}}function la(e,t,n){let i=Fe.label;const l={[Fe.label]:Fe},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,b=!1,k=!0,g=!1,w=!0,_=!1,v=null,S=null,D=null,U=null,O=null,F=null,W=null,C=null,T=1,H=new nt(W,C),M=new nt(W,C),I=new pt(v,S),j=new pt(v,S),J,ne,ce=!1,te=!0,Y=null,se=null,ee="default",R=!1,X="Awesome Tauri Example!";function Z(){Ii(c)}function _e(){l[i].setTitle(X)}function fe(){l[i].hide(),setTimeout(l[i].show,2e3)}function pe(){l[i].minimize(),setTimeout(l[i].unminimize,2e3)}function ye(){qi({multiple:!1}).then($=>{typeof $=="string"&&l[i].setIcon($)})}function oe(){if(!d)return;const $=new ht(d);n(1,l[d]=$,l),$.once("tauri://error",function(){u("Error creating new webview")})}function x(){l[i].innerSize().then($=>{n(27,I=$),n(8,v=I.width),n(9,S=I.height)}),l[i].outerSize().then($=>{n(28,j=$)})}function me(){l[i].innerPosition().then($=>{n(25,H=$)}),l[i].outerPosition().then($=>{n(26,M=$),n(14,W=M.x),n(15,C=M.y)})}async function Le($){!$||(J&&J(),ne&&ne(),ne=await $.listen("tauri://move",me),J=await $.listen("tauri://resize",x))}async function z(){await l[i].minimize(),await l[i].requestUserAttention(Hi.Critical),await new Promise($=>setTimeout($,3e3)),await l[i].requestUserAttention(null)}function G(){d=this.value,n(22,d)}function Ae(){i=Pi(this),n(0,i),n(1,l)}const ve=()=>l[i].center();function ae(){b=this.checked,n(3,b)}function de(){f=this.checked,n(2,f)}function re(){k=this.checked,n(4,k)}function we(){g=this.checked,n(5,g)}function Ne(){w=this.checked,n(6,w)}function Pe(){_=this.checked,n(7,_)}function Q(){W=le(this.value),n(14,W)}function N(){C=le(this.value),n(15,C)}function ie(){v=le(this.value),n(8,v)}function B(){S=le(this.value),n(9,S)}function he(){D=le(this.value),n(10,D)}function $t(){U=le(this.value),n(11,U)}function Ge(){O=le(this.value),n(12,O)}function _t(){F=le(this.value),n(13,F)}function Kt(){ce=this.checked,n(16,ce)}function De(){te=this.checked,n(17,te)}function Qt(){R=this.checked,n(21,R)}function bt(){ee=Pi(this),n(20,ee),n(30,o)}function Zt(){Y=le(this.value),n(18,Y)}function Re(){se=le(this.value),n(19,se)}function xt(){X=this.value,n(29,X)}function Ve(){c=this.value,n(23,c)}return e.$$set=$=>{"onMessage"in $&&n(38,u=$.onMessage)},e.$$.update=()=>{var $,Ot,Ee,Dt,lt,Rt,ze,gt,yt,vt,Ce,He,Oe,st,It,ot,Nt,at,wt;e.$$.dirty[0]&3&&(l[i],me(),x()),e.$$.dirty[0]&7&&(($=l[i])==null||$.setResizable(f)),e.$$.dirty[0]&11&&(b?(Ot=l[i])==null||Ot.maximize():(Ee=l[i])==null||Ee.unmaximize()),e.$$.dirty[0]&19&&((Dt=l[i])==null||Dt.setDecorations(k)),e.$$.dirty[0]&35&&((lt=l[i])==null||lt.setAlwaysOnTop(g)),e.$$.dirty[0]&67&&((Rt=l[i])==null||Rt.setContentProtected(w)),e.$$.dirty[0]&131&&((ze=l[i])==null||ze.setFullscreen(_)),e.$$.dirty[0]&771&&v&&S&&((gt=l[i])==null||gt.setSize(new pt(v,S))),e.$$.dirty[0]&3075&&(D&&U?(yt=l[i])==null||yt.setMinSize(new xn(D,U)):(vt=l[i])==null||vt.setMinSize(null)),e.$$.dirty[0]&12291&&(O>800&&F>400?(Ce=l[i])==null||Ce.setMaxSize(new xn(O,F)):(He=l[i])==null||He.setMaxSize(null)),e.$$.dirty[0]&49155&&W!==null&&C!==null&&((Oe=l[i])==null||Oe.setPosition(new nt(W,C))),e.$$.dirty[0]&3&&((st=l[i])==null||st.scaleFactor().then(en=>n(24,T=en))),e.$$.dirty[0]&3&&Le(l[i]),e.$$.dirty[0]&65539&&((It=l[i])==null||It.setCursorGrab(ce)),e.$$.dirty[0]&131075&&((ot=l[i])==null||ot.setCursorVisible(te)),e.$$.dirty[0]&1048579&&((Nt=l[i])==null||Nt.setCursorIcon(ee)),e.$$.dirty[0]&786435&&Y!==null&&se!==null&&((at=l[i])==null||at.setCursorPosition(new nt(Y,se))),e.$$.dirty[0]&2097155&&((wt=l[i])==null||wt.setIgnoreCursorEvents(R))},[i,l,f,b,k,g,w,_,v,S,D,U,O,F,W,C,ce,te,Y,se,ee,R,d,c,T,H,M,I,j,X,o,Z,_e,fe,pe,ye,oe,z,u,G,Ae,ve,ae,de,re,we,Ne,Pe,Q,N,ie,B,he,$t,Ge,_t,Kt,De,Qt,bt,Zt,Re,xt,Ve]}class sa extends Me{constructor(t){super(),ke(this,t,la,ia,ge,{onMessage:38},null,[-1,-1,-1])}}var oa={};We(oa,{isRegistered:()=>ra,register:()=>Gs,registerAll:()=>aa,unregister:()=>Vs,unregisterAll:()=>Bs});async function Gs(e,t){return E({__tauriModule:"GlobalShortcut",message:{cmd:"register",shortcut:e,handler:mt(t)}})}async function aa(e,t){return E({__tauriModule:"GlobalShortcut",message:{cmd:"registerAll",shortcuts:e,handler:mt(t)}})}async function ra(e){return E({__tauriModule:"GlobalShortcut",message:{cmd:"isRegistered",shortcut:e}})}async function Vs(e){return E({__tauriModule:"GlobalShortcut",message:{cmd:"unregister",shortcut:e}})}async function Bs(){return E({__tauriModule:"GlobalShortcut",message:{cmd:"unregisterAll"}})}function is(e,t,n){const i=e.slice();return i[9]=t[n],i}function ls(e){let t,n=e[9]+"",i,l,o,u,d;function c(){return e[8](e[9])}return{c(){t=a("div"),i=A(n),l=h(),o=a("button"),o.textContent="Unregister",r(o,"class","btn"),r(o,"type","button"),r(t,"class","flex justify-between")},m(f,b){m(f,t,b),s(t,i),s(t,l),s(t,o),u||(d=L(o,"click",c),u=!0)},p(f,b){e=f,b&2&&n!==(n=e[9]+"")&&K(i,n)},d(f){f&&p(t),u=!1,d()}}}function ss(e){let t,n,i,l,o;return{c(){t=a("br"),n=h(),i=a("button"),i.textContent="Unregister all",r(i,"class","btn"),r(i,"type","button")},m(u,d){m(u,t,d),m(u,n,d),m(u,i,d),l||(o=L(i,"click",e[5]),l=!0)},p:V,d(u){u&&p(t),u&&p(n),u&&p(i),l=!1,o()}}}function ua(e){let t,n,i,l,o,u,d,c,f,b,k,g=e[1],w=[];for(let v=0;v<g.length;v+=1)w[v]=ls(is(e,g,v));let _=e[1].length>1&&ss(e);return{c(){t=a("div"),n=a("input"),i=h(),l=a("button"),l.textContent="Register",o=h(),u=a("br"),d=h(),c=a("div");for(let v=0;v<w.length;v+=1)w[v].c();f=h(),_&&_.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(v,S){m(v,t,S),s(t,n),q(n,e[0]),s(t,i),s(t,l),m(v,o,S),m(v,u,S),m(v,d,S),m(v,c,S);for(let D=0;D<w.length;D+=1)w[D].m(c,null);s(c,f),_&&_.m(c,null),b||(k=[L(n,"input",e[7]),L(l,"click",e[3])],b=!0)},p(v,[S]){if(S&1&&n.value!==v[0]&&q(n,v[0]),S&18){g=v[1];let D;for(D=0;D<g.length;D+=1){const U=is(v,g,D);w[D]?w[D].p(U,S):(w[D]=ls(U),w[D].c(),w[D].m(c,f))}for(;D<w.length;D+=1)w[D].d(1);w.length=g.length}v[1].length>1?_?_.p(v,S):(_=ss(v),_.c(),_.m(c,null)):_&&(_.d(1),_=null)},i:V,o:V,d(v){v&&p(t),v&&p(o),v&&p(u),v&&p(d),v&&p(c),zt(w,v),_&&_.d(),b=!1,ue(k)}}}function ca(e,t,n){let i,{onMessage:l}=t;const o=ys([]);_s(e,o,g=>n(1,i=g));let u="CmdOrControl+X";function d(){const g=u;Gs(g,()=>{l(`Shortcut ${g} triggered`)}).then(()=>{o.update(w=>[...w,g]),l(`Shortcut ${g} registered successfully`)}).catch(l)}function c(g){const w=g;Vs(w).then(()=>{o.update(_=>_.filter(v=>v!==w)),l(`Shortcut ${w} unregistered`)}).catch(l)}function f(){Bs().then(()=>{o.update(()=>[]),l("Unregistered all shortcuts")}).catch(l)}function b(){u=this.value,n(0,u)}const k=g=>c(g);return e.$$set=g=>{"onMessage"in g&&n(6,l=g.onMessage)},[u,i,o,d,c,f,l,b,k]}class da extends Me{constructor(t){super(),ke(this,t,ca,ua,ge,{onMessage:6})}}function os(e){let t,n,i,l,o,u,d;return{c(){t=a("br"),n=h(),i=a("input"),l=h(),o=a("button"),o.textContent="Write",r(i,"class","input"),r(i,"placeholder","write to stdin"),r(o,"class","btn")},m(c,f){m(c,t,f),m(c,n,f),m(c,i,f),q(i,e[4]),m(c,l,f),m(c,o,f),u||(d=[L(i,"input",e[14]),L(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,ue(d)}}}function fa(e){let t,n,i,l,o,u,d,c,f,b,k,g,w,_,v,S,D,U,O,F,W,C,T,H,M=e[5]&&os(e);return{c(){t=a("div"),n=a("div"),i=A(`Script:
|
|
`),l=a("input"),o=h(),u=a("div"),d=A(`Encoding:
|
|
`),c=a("input"),f=h(),b=a("div"),k=A(`Working directory:
|
|
`),g=a("input"),w=h(),_=a("div"),v=A(`Arguments:
|
|
`),S=a("input"),D=h(),U=a("div"),O=a("button"),O.textContent="Run",F=h(),W=a("button"),W.textContent="Kill",C=h(),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(g,"class","grow input"),r(g,"placeholder","Working directory"),r(b,"class","flex items-center gap-1"),r(S,"class","grow input"),r(S,"placeholder","Environment variables"),r(_,"class","flex items-center gap-1"),r(O,"class","btn"),r(W,"class","btn"),r(U,"class","flex children:grow gap-1"),r(t,"class","flex flex-col childre:grow gap-1")},m(I,j){m(I,t,j),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,b),s(b,k),s(b,g),q(g,e[1]),s(t,w),s(t,_),s(_,v),s(_,S),q(S,e[2]),s(t,D),s(t,U),s(U,O),s(U,F),s(U,W),s(t,C),M&&M.m(t,null),T||(H=[L(l,"input",e[10]),L(c,"input",e[11]),L(g,"input",e[12]),L(S,"input",e[13]),L(O,"click",e[6]),L(W,"click",e[7])],T=!0)},p(I,[j]){j&1&&l.value!==I[0]&&q(l,I[0]),j&8&&c.value!==I[3]&&q(c,I[3]),j&2&&g.value!==I[1]&&q(g,I[1]),j&4&&S.value!==I[2]&&q(S,I[2]),I[5]?M?M.p(I,j):(M=os(I),M.c(),M.m(t,null)):M&&(M.d(1),M=null)},i:V,o:V,d(I){I&&p(t),M&&M.d(),T=!1,ue(H)}}}function pa(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",b="",k="",g;function w(){return f.split(" ").reduce((C,T)=>{let[H,M]=T.split("=");return{...C,[H]:M}},{})}function _(){n(5,g=null);const C=Zn.create(l,[...o,d],{cwd:c||null,env:w(),encoding:b||void 0});C.on("close",T=>{u(`command finished with code ${T.code} and signal ${T.signal}`),n(5,g=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,g=T)}).catch(u)}function v(){g.kill().then(()=>u("killed child process")).catch(u)}function S(){g.write(k).catch(u)}function D(){d=this.value,n(0,d)}function U(){b=this.value,n(3,b)}function O(){c=this.value,n(1,c)}function F(){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,b,k,g,_,v,S,u,D,U,O,F,W]}class ma extends Me{constructor(t){super(),ke(this,t,pa,fa,ge,{onMessage:9})}}var ha={};We(ha,{checkUpdate:()=>Xs,installUpdate:()=>Js,onUpdaterEvent:()=>Gi});async function Gi(e){return Yt("tauri://update-status",t=>{e(t==null?void 0:t.payload)})}async function Js(){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())}Gi(l).then(o=>{e=o}).catch(o=>{throw t(),o}),li("tauri://update-install").catch(o=>{throw t(),o})})}async function Xs(){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}))}Cs("tauri://update-available",u=>{l(u==null?void 0:u.payload)}).catch(u=>{throw t(),u}),Gi(o).then(u=>{e=u}).catch(u=>{throw t(),u}),li("tauri://update").catch(u=>{throw t(),u})})}function _a(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){m(n,t,i)},p:V,d(n){n&&p(t)}}}function ba(e){let t,n,i;return{c(){t=a("button"),t.textContent="Install update",r(t,"class","btn")},m(l,o){m(l,t,o),n||(i=L(t,"click",e[4]),n=!0)},p:V,d(l){l&&p(t),n=!1,i()}}}function ga(e){let t,n,i;return{c(){t=a("button"),t.textContent="Check update",r(t,"class","btn")},m(l,o){m(l,t,o),n||(i=L(t,"click",e[3]),n=!0)},p:V,d(l){l&&p(t),n=!1,i()}}}function ya(e){let t;function n(o,u){return!o[0]&&!o[2]?ga:!o[1]&&o[2]?ba:_a}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){m(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 va(e,t,n){let{onMessage:i}=t,l;dt(async()=>{l=await Yt("tauri://update-status",i)}),Ri(()=>{l&&l()});let o,u,d;async function c(){n(0,o=!0);try{const{shouldUpdate:b,manifest:k}=await Xs();i(`Should update: ${b}`),i(k),n(2,d=b)}catch(b){i(b)}finally{n(0,o=!1)}}async function f(){n(1,u=!0);try{await Js(),i("Installation complete, restart required."),await ji()}catch(b){i(b)}finally{n(1,u=!1)}}return e.$$set=b=>{"onMessage"in b&&n(5,i=b.onMessage)},[o,u,d,c,f,i]}class wa extends Me{constructor(t){super(),ke(this,t,va,ya,ge,{onMessage:5})}}var ka={};We(ka,{readText:()=>$s,writeText:()=>Ys});async function Ys(e){return E({__tauriModule:"Clipboard",message:{cmd:"writeText",data:e}})}async function $s(){return E({__tauriModule:"Clipboard",message:{cmd:"readText",data:null}})}function Ma(e){let t,n,i,l,o,u,d,c;return{c(){t=a("div"),n=a("input"),i=h(),l=a("button"),l.textContent="Write",o=h(),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,b){m(f,t,b),s(t,n),q(n,e[0]),s(t,i),s(t,l),s(t,o),s(t,u),d||(c=[L(n,"input",e[4]),L(l,"click",e[1]),L(u,"click",e[2])],d=!0)},p(f,[b]){b&1&&n.value!==f[0]&&q(n,f[0])},i:V,o:V,d(f){f&&p(t),d=!1,ue(c)}}}function Ta(e,t,n){let{onMessage:i}=t,l="clipboard message";function o(){Ys(l).then(()=>{i("Wrote to the clipboard")}).catch(i)}function u(){$s().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 Ca extends Me{constructor(t){super(),ke(this,t,Ta,Ma,ge,{onMessage:3})}}function Sa(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){m(n,t,i)},p:V,i:V,o:V,d(n){n&&p(t)}}}function La(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 dt(async()=>{try{const d=await navigator.mediaDevices.getUserMedia(l);o(d)}catch(d){u(d)}}),Ri(()=>{window.stream.getTracks().forEach(function(d){d.stop()})}),e.$$set=d=>{"onMessage"in d&&n(0,i=d.onMessage)},[i]}class Aa extends Me{constructor(t){super(),ke(this,t,La,Sa,ge,{onMessage:0})}}function Ea(e){let t,n,i,l,o,u;return{c(){t=a("div"),n=a("button"),n.textContent="Show",i=h(),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){m(d,t,c),s(t,n),s(t,i),s(t,l),o||(u=[L(n,"click",e[0]),L(l,"click",e[1])],o=!0)},p:V,i:V,o:V,d(d){d&&p(t),o=!1,ue(u)}}}function za(e,t,n){let{onMessage:i}=t;function l(){o().then(()=>{setTimeout(()=>{Rs().then(()=>i("Shown app")).catch(i)},2e3)}).catch(i)}function o(){return Is().then(()=>i("Hide app")).catch(i)}return e.$$set=u=>{"onMessage"in u&&n(2,i=u.onMessage)},[l,o,i]}class Wa extends Me{constructor(t){super(),ke(this,t,za,Ea,ge,{onMessage:2})}}function as(e,t,n){const i=e.slice();return i[32]=t[n],i}function rs(e,t,n){const i=e.slice();return i[35]=t[n],i}function us(e){let t,n,i,l,o,u,d,c,f,b,k,g,w,_,v;function S(C,T){return C[3]?Oa:Pa}let D=S(e),U=D(e);function O(C,T){return C[2]?Ra:Da}let F=O(e),W=F(e);return{c(){t=a("div"),n=a("span"),n.textContent="Tauri API Validation",i=h(),l=a("span"),o=a("span"),U.c(),d=h(),c=a("span"),c.innerHTML='<div class="i-codicon-chrome-minimize"></div>',f=h(),b=a("span"),W.c(),g=h(),w=a("span"),w.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(b,"title",k=e[2]?"Restore":"Maximize"),r(b,"class","hover:bg-hoverOverlay active:bg-hoverOverlayDarker dark:hover:bg-darkHoverOverlay dark:active:bg-darkHoverOverlayDarker"),r(w,"title","Close"),r(w,"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){m(C,t,T),s(t,n),s(t,i),s(t,l),s(l,o),U.m(o,null),s(l,d),s(l,c),s(l,f),s(l,b),W.m(b,null),s(l,g),s(l,w),_||(v=[L(o,"click",e[12]),L(c,"click",e[9]),L(b,"click",e[10]),L(w,"click",e[11])],_=!0)},p(C,T){D!==(D=S(C))&&(U.d(1),U=D(C),U&&(U.c(),U.m(o,null))),T[0]&8&&u!==(u=C[3]?"Switch to Light mode":"Switch to Dark mode")&&r(o,"title",u),F!==(F=O(C))&&(W.d(1),W=F(C),W&&(W.c(),W.m(b,null))),T[0]&4&&k!==(k=C[2]?"Restore":"Maximize")&&r(b,"title",k)},d(C){C&&p(t),U.d(),W.d(),_=!1,ue(v)}}}function Pa(e){let t;return{c(){t=a("div"),r(t,"class","i-ph-moon")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Oa(e){let t;return{c(){t=a("div"),r(t,"class","i-ph-sun")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Da(e){let t;return{c(){t=a("div"),r(t,"class","i-codicon-chrome-maximize")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Ra(e){let t;return{c(){t=a("div"),r(t,"class","i-codicon-chrome-restore")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Ia(e){let t;return{c(){t=a("span"),r(t,"class","i-codicon-menu animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function Na(e){let t;return{c(){t=a("span"),r(t,"class","i-codicon-close animate-duration-300ms animate-fade-in")},m(n,i){m(n,t,i)},d(n){n&&p(t)}}}function cs(e){let t,n,i,l,o,u,d,c,f;function b(w,_){return w[3]?Ua:Ha}let k=b(e),g=k(e);return{c(){t=a("a"),g.c(),n=h(),i=a("br"),l=h(),o=a("div"),u=h(),d=a("br"),r(t,"href","##"),r(t,"class","nv justify-between h-8"),r(o,"class","bg-white/5 h-2px")},m(w,_){m(w,t,_),g.m(t,null),m(w,n,_),m(w,i,_),m(w,l,_),m(w,o,_),m(w,u,_),m(w,d,_),c||(f=L(t,"click",e[12]),c=!0)},p(w,_){k!==(k=b(w))&&(g.d(1),g=k(w),g&&(g.c(),g.m(t,null)))},d(w){w&&p(t),g.d(),w&&p(n),w&&p(i),w&&p(l),w&&p(o),w&&p(u),w&&p(d),c=!1,f()}}}function Ha(e){let t,n;return{c(){t=A(`Switch to Dark mode
|
|
`),n=a("div"),r(n,"class","i-ph-moon")},m(i,l){m(i,t,l),m(i,n,l)},d(i){i&&p(t),i&&p(n)}}}function Ua(e){let t,n;return{c(){t=A(`Switch to Light mode
|
|
`),n=a("div"),r(n,"class","i-ph-sun")},m(i,l){m(i,t,l),m(i,n,l)},d(i){i&&p(t),i&&p(n)}}}function ja(e){let t,n,i,l,o=e[35].label+"",u,d,c,f;function b(){return e[20](e[35])}return{c(){t=a("a"),n=a("div"),i=h(),l=a("p"),u=A(o),r(n,"class",e[35].icon+" mr-2"),r(t,"href","##"),r(t,"class",d="nv "+(e[1]===e[35]?"nv_selected":""))},m(k,g){m(k,t,g),s(t,n),s(t,i),s(t,l),s(l,u),c||(f=L(t,"click",b),c=!0)},p(k,g){e=k,g[0]&2&&d!==(d="nv "+(e[1]===e[35]?"nv_selected":""))&&r(t,"class",d)},d(k){k&&p(t),c=!1,f()}}}function ds(e){let t,n=e[35]&&ja(e);return{c(){n&&n.c(),t=ti()},m(i,l){n&&n.m(i,l),m(i,t,l)},p(i,l){i[35]&&n.p(i,l)},d(i){n&&n.d(i),i&&p(t)}}}function fs(e){let t,n=e[32].html+"",i;return{c(){t=new no(!1),i=ti(),t.a=i},m(l,o){t.m(n,l,o),m(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 qa(e){let t,n,i,l,o,u,d,c,f,b,k,g,w,_,v,S,D,U,O,F,W,C,T,H,M,I,j=e[1].label+"",J,ne,ce,te,Y,se,ee,R,X,Z,_e,fe,pe,ye,oe,x,me,Le,z=e[5]&&us(e);function G(N,ie){return N[0]?Na:Ia}let Ae=G(e),ve=Ae(e),ae=!e[5]&&cs(e),de=e[7],re=[];for(let N=0;N<de.length;N+=1)re[N]=ds(rs(e,de,N));var we=e[1].component;function Ne(N){return{props:{onMessage:N[14],insecureRenderHtml:N[15]}}}we&&(Y=new we(Ne(e)));let Pe=e[6],Q=[];for(let N=0;N<Pe.length;N+=1)Q[N]=fs(as(e,Pe,N));return{c(){z&&z.c(),t=h(),n=a("div"),ve.c(),i=h(),l=a("div"),o=a("aside"),u=a("img"),c=h(),ae&&ae.c(),f=h(),b=a("a"),b.innerHTML=`Documentation
|
|
<span class="i-codicon-link-external"></span>`,k=h(),g=a("a"),g.innerHTML=`GitHub
|
|
<span class="i-codicon-link-external"></span>`,w=h(),_=a("a"),_.innerHTML=`Source
|
|
<span class="i-codicon-link-external"></span>`,v=h(),S=a("br"),D=h(),U=a("div"),O=h(),F=a("br"),W=h(),C=a("div");for(let N=0;N<re.length;N+=1)re[N].c();T=h(),H=a("main"),M=a("div"),I=a("h1"),J=A(j),ne=h(),ce=a("div"),te=a("div"),Y&&Qn(Y.$$.fragment),se=h(),ee=a("div"),R=a("div"),X=h(),Z=a("div"),_e=a("p"),_e.textContent="Console",fe=h(),pe=a("div"),pe.innerHTML='<div class="i-codicon-clear-all"></div>',ye=h(),oe=a("div");for(let N=0;N<Q.length;N+=1)Q[N].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"),Qs(u.src,d="tauri_logo.png")||r(u,"src",d),r(u,"alt","Tauri logo"),r(b,"class","nv justify-between h-8"),r(b,"target","_blank"),r(b,"href","https://tauri.app/v1/guides/"),r(g,"class","nv justify-between h-8"),r(g,"target","_blank"),r(g,"href","https://github.com/tauri-apps/tauri"),r(_,"class","nv justify-between h-8"),r(_,"target","_blank"),r(_,"href","https://github.com/tauri-apps/tauri/tree/dev/examples/api"),r(U,"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(ce,"class","overflow-y-auto"),r(M,"class","px-5 overflow-hidden grid grid-rows-[auto_1fr]"),r(R,"class","bg-black/20 h-2px cursor-ns-resize"),r(_e,"class","font-semibold"),r(pe,"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(Z,"class","flex justify-between items-center px-2"),r(oe,"class","px-2 overflow-y-auto all:font-mono code-block all:text-xs"),r(ee,"id","console"),r(ee,"class","select-none h-15rem grid grid-rows-[2px_2rem_1fr] gap-1 overflow-hidden"),r(H,"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(N,ie){z&&z.m(N,ie),m(N,t,ie),m(N,n,ie),ve.m(n,null),m(N,i,ie),m(N,l,ie),s(l,o),s(o,u),s(o,c),ae&&ae.m(o,null),s(o,f),s(o,b),s(o,k),s(o,g),s(o,w),s(o,_),s(o,v),s(o,S),s(o,D),s(o,U),s(o,O),s(o,F),s(o,W),s(o,C);for(let B=0;B<re.length;B+=1)re[B].m(C,null);s(l,T),s(l,H),s(H,M),s(M,I),s(I,J),s(M,ne),s(M,ce),s(ce,te),Y&&Bt(Y,te,null),s(H,se),s(H,ee),s(ee,R),s(ee,X),s(ee,Z),s(Z,_e),s(Z,fe),s(Z,pe),s(ee,ye),s(ee,oe);for(let B=0;B<Q.length;B+=1)Q[B].m(oe,null);e[21](ee),x=!0,me||(Le=[L(u,"click",e[19]),L(R,"mousedown",e[17]),L(pe,"click",e[16])],me=!0)},p(N,ie){if(N[5]?z?z.p(N,ie):(z=us(N),z.c(),z.m(t.parentNode,t)):z&&(z.d(1),z=null),Ae!==(Ae=G(N))&&(ve.d(1),ve=Ae(N),ve&&(ve.c(),ve.m(n,null))),N[5]?ae&&(ae.d(1),ae=null):ae?ae.p(N,ie):(ae=cs(N),ae.c(),ae.m(o,f)),ie[0]&387){de=N[7];let B;for(B=0;B<de.length;B+=1){const he=rs(N,de,B);re[B]?re[B].p(he,ie):(re[B]=ds(he),re[B].c(),re[B].m(C,null))}for(;B<re.length;B+=1)re[B].d(1);re.length=de.length}if((!x||ie[0]&2)&&j!==(j=N[1].label+"")&&K(J,j),we!==(we=N[1].component)){if(Y){ni();const B=Y;Ie(B.$$.fragment,1,0,()=>{Jt(B,1)}),ii()}we?(Y=new we(Ne(N)),Qn(Y.$$.fragment),Se(Y.$$.fragment,1),Bt(Y,te,null)):Y=null}if(ie[0]&64){Pe=N[6];let B;for(B=0;B<Pe.length;B+=1){const he=as(N,Pe,B);Q[B]?Q[B].p(he,ie):(Q[B]=fs(he),Q[B].c(),Q[B].m(oe,null))}for(;B<Q.length;B+=1)Q[B].d(1);Q.length=Pe.length}},i(N){x||(Y&&Se(Y.$$.fragment,N),x=!0)},o(N){Y&&Ie(Y.$$.fragment,N),x=!1},d(N){z&&z.d(N),N&&p(t),N&&p(n),ve.d(),N&&p(i),N&&p(l),ae&&ae.d(),zt(re,N),Y&&Jt(Y),zt(Q,N),e[21](null),me=!1,ue(Le)}}}let ps=50;function ms(e){const t=document.querySelector("html");e?t.classList.add("dark"):t.classList.remove("dark"),localStorage&&localStorage.setItem("theme",e?"dark":"")}function Fa(e,t){e.style.setProperty("--translate-x",`${t?"0":"-18.75"}rem`)}function Ga(e,t,n){let i;Fe.label!=="main"&&Fe.onCloseRequested(async R=>{await confirm("Are you sure?")||R.preventDefault()}),Fe.onFileDropEvent(R=>{D(`File drop: ${JSON.stringify(R.payload)}`)});const l=navigator.userAgent.toLowerCase(),o=l.includes("android")||l.includes("iphone"),u=[{label:"Welcome",component:zo,icon:"i-ph-hand-waving"},{label:"Communication",component:Io,icon:"i-codicon-radio-tower"},!o&&{label:"CLI",component:Oo,icon:"i-codicon-terminal"},!o&&{label:"Dialog",component:Fo,icon:"i-codicon-multiple-windows"},{label:"HTTP",component:Zo,icon:"i-ph-globe-hemisphere-west"},!o&&{label:"Notifications",component:na,icon:"i-codicon-bell-dot"},!o&&{label:"App",component:Wa,icon:"i-codicon-hubot"},!o&&{label:"Window",component:sa,icon:"i-codicon-window"},!o&&{label:"Shortcuts",component:da,icon:"i-codicon-record-keys"},{label:"Shell",component:ma,icon:"i-codicon-terminal-bash"},!o&&{label:"Updater",component:wa,icon:"i-codicon-cloud-download"},!o&&{label:"Clipboard",component:Ca,icon:"i-codicon-clippy"},{label:"WebRTC",component:Aa,icon:"i-ph-broadcast"}];let d=u[0];function c(R){n(1,d=R)}let f;dt(async()=>{const R=Ft();n(2,f=await R.isMaximized()),Yt("tauri://resize",async()=>{n(2,f=await R.isMaximized())})});function b(){Ft().minimize()}async function k(){const R=Ft();await R.isMaximized()?R.unmaximize():R.maximize()}let g=!1;async function w(){g||(g=await Us("Are you sure that you want to close this window?",{title:"Tauri API"}),g&&Ft().close())}let _;dt(()=>{n(3,_=localStorage&&localStorage.getItem("theme")=="dark"),ms(_)});function v(){n(3,_=!_),ms(_)}let S=ys([]);_s(e,S,R=>n(6,i=R));function D(R){S.update(X=>[{html:`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> `+(typeof R=="string"?R:JSON.stringify(R,null,1))+"</pre>"},...X])}function U(R){S.update(X=>[{html:`<pre><strong class="text-accent dark:text-darkAccent">[${new Date().toLocaleTimeString()}]:</strong> `+R+"</pre>"},...X])}function O(){S.update(()=>[])}let F,W,C;function T(R){C=R.clientY;const X=window.getComputedStyle(F);W=parseInt(X.height,10);const Z=fe=>{const pe=fe.clientY-C,ye=W-pe;n(4,F.style.height=`${ye<ps?ps:ye}px`,F)},_e=()=>{document.removeEventListener("mouseup",_e),document.removeEventListener("mousemove",Z)};document.addEventListener("mouseup",_e),document.addEventListener("mousemove",Z)}let H;dt(async()=>{n(5,H=await Ws()==="win32")});let M=!1,I,j,J=!1,ne=0,ce=0;const te=(R,X,Z)=>Math.min(Math.max(X,R),Z);dt(()=>{n(18,I=document.querySelector("#sidebar")),j=document.querySelector("#sidebarToggle"),document.addEventListener("click",R=>{j.contains(R.target)?n(0,M=!M):M&&!I.contains(R.target)&&n(0,M=!1)}),document.addEventListener("touchstart",R=>{if(j.contains(R.target))return;const X=R.touches[0].clientX;(0<X&&X<20&&!M||M)&&(J=!0,ne=X)}),document.addEventListener("touchmove",R=>{if(J){const X=R.touches[0].clientX;ce=X;const Z=(X-ne)/10;I.style.setProperty("--translate-x",`-${te(0,M?0-Z:18.75-Z,18.75)}rem`)}}),document.addEventListener("touchend",()=>{if(J){const R=(ce-ne)/10;n(0,M=M?R>-(18.75/2):R>18.75/2)}J=!1})});const Y=()=>Ii("https://tauri.app/"),se=R=>{c(R),n(0,M=!1)};function ee(R){Oi[R?"unshift":"push"](()=>{F=R,n(4,F)})}return e.$$.update=()=>{if(e.$$.dirty[0]&1){const R=document.querySelector("#sidebar");R&&Fa(R,M)}},[M,d,f,_,F,H,i,u,c,b,k,w,v,S,D,U,O,T,I,Y,se,ee]}class Va extends Me{constructor(t){super(),ke(this,t,Ga,qa,ge,{},null,[-1,-1])}}new Va({target:document.querySelector("#app")});
|