diff --git a/plugins/deep-link/src/api-iife.js b/plugins/deep-link/src/api-iife.js index bb3eed827..9a31c2d2c 100644 --- a/plugins/deep-link/src/api-iife.js +++ b/plugins/deep-link/src/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_DEEPLINK__=function(e){"use strict";var t=Object.defineProperty,n=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})},r=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},i=(e,t,n)=>(r(e,t,"read from private field"),n?n.call(e):t.get(e)),a=(e,t,n,i)=>(r(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function o(e,t=!1){let n=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${n}`;return Object.defineProperty(window,r,{value:n=>(t&&Reflect.deleteProperty(window,r),e?.(n)),writable:!1,configurable:!0}),n}n({},{Channel:()=>s,PluginListener:()=>c,addPluginListener:()=>u,convertFileSrc:()=>d,invoke:()=>_,transformCallback:()=>o});var l,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,l,(()=>{})),this.id=o((e=>{i(this,l).call(this,e)}))}set onmessage(e){a(this,l,e)}get onmessage(){return i(this,l)}toJSON(){return`__CHANNEL__:${this.id}`}};l=new WeakMap;var c=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return _(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function u(e,t,n){let r=new s;return r.onmessage=n,_(`plugin:${e}|register_listener`,{event:t,handler:r}).then((()=>new c(e,t,r.id)))}async function _(e,t={}){return new Promise(((n,r)=>{let i=o((e=>{n(e),Reflect.deleteProperty(window,`_${a}`)}),!0),a=o((e=>{r(e),Reflect.deleteProperty(window,`_${i}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:i,error:a,...t})}))}function d(e,t="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${t}.localhost/${n}`:`${t}://localhost/${n}`}n({},{TauriEvent:()=>w,emit:()=>f,listen:()=>E,once:()=>p});var w=(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))(w||{});async function h(e,t){await _("plugin:event|unlisten",{event:e,eventId:t})}async function E(e,t,n){return _("plugin:event|listen",{event:e,windowLabel:n?.target,handler:o(t)}).then((t=>async()=>h(e,t)))}async function p(e,t,n){return E(e,(n=>{t(n),h(e,n.id).catch((()=>{}))}),n)}async function f(e,t,n){await _("plugin:event|emit",{event:e,windowLabel:n?.target,payload:t})}async function I(){return await _("plugin:deep-link|get_current")}return e.getCurrent=I,e.onOpenUrl=async function(e){const t=await I();return null!=t&&e(t),await E("deep-link://new-url",(t=>e(t.payload)))},e}({});Object.defineProperty(window.__TAURI__,"deepLink",{value:__TAURI_DEEPLINK__})} +if("__TAURI__"in window){var __TAURI_DEEPLINK__=function(e){"use strict";var t=Object.defineProperty,n=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})},r=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},i=(e,t,n)=>(r(e,t,"read from private field"),n?n.call(e):t.get(e)),a=(e,t,n,i)=>(r(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function o(e,t=!1){let n=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${n}`;return Object.defineProperty(window,r,{value:n=>(t&&Reflect.deleteProperty(window,r),e?.(n)),writable:!1,configurable:!0}),n}n({},{Channel:()=>s,PluginListener:()=>c,addPluginListener:()=>u,convertFileSrc:()=>d,invoke:()=>_,transformCallback:()=>o});var l,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,l,(()=>{})),this.id=o((e=>{i(this,l).call(this,e)}))}set onmessage(e){a(this,l,e)}get onmessage(){return i(this,l)}toJSON(){return`__CHANNEL__:${this.id}`}};l=new WeakMap;var c=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return _(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function u(e,t,n){let r=new s;return r.onmessage=n,_(`plugin:${e}|register_listener`,{event:t,handler:r}).then((()=>new c(e,t,r.id)))}async function _(e,t={},n){return new Promise(((r,i)=>{let a=o((e=>{r(e),Reflect.deleteProperty(window,`_${l}`)}),!0),l=o((e=>{i(e),Reflect.deleteProperty(window,`_${a}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:a,error:l,payload:t,options:n})}))}function d(e,t="asset"){return window.__TAURI__.convertFileSrc(e,t)}n({},{TauriEvent:()=>w,emit:()=>f,listen:()=>E,once:()=>p});var w=(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))(w||{});async function h(e,t){await _("plugin:event|unlisten",{event:e,eventId:t})}async function E(e,t,n){return _("plugin:event|listen",{event:e,windowLabel:n?.target,handler:o(t)}).then((t=>async()=>h(e,t)))}async function p(e,t,n){return E(e,(n=>{t(n),h(e,n.id).catch((()=>{}))}),n)}async function f(e,t,n){await _("plugin:event|emit",{event:e,windowLabel:n?.target,payload:t})}async function I(){return await _("plugin:deep-link|get_current")}return e.getCurrent=I,e.onOpenUrl=async function(e){const t=await I();return null!=t&&e(t),await E("deep-link://new-url",(t=>e(t.payload)))},e}({});Object.defineProperty(window.__TAURI__,"deepLink",{value:__TAURI_DEEPLINK__})}