import{z as n,y as e}from"./index.5f1a5861.1761573291572.js";import{b as i}from"./app.54bed779.1761573291572.js";const t={"tab://setting":()=>{n.emit("openController")},"tab://addSearchEngine":(e={})=>{e.size={width:window.innerWidth<500?"calc(100% - 15px)":"800px",height:window.innerWidth>500?"400px":window.innerHeight-200+"px",top:window.innerHeight>700?"260px":"15vh",closeBtn:!1},e.component="addSearchEngine",n.emit("openPlugin",e)},"tab://addicon":(e={})=>{n.emit("openApp",{...i.addIcon,data:e})},"tab://editAll":(n={})=>{setTimeout((()=>{e.state.editStatus=!0}),100)},"tab://background":(e={})=>{n.emit("openApp",i.wallpaper)},"tab://bookmark":(e={})=>{e.full=!1,e.size={width:window.innerWidth<500?"calc(100% - 15px)":"1000px",height:window.innerWidth>500?"550px":window.innerHeight-200+"px"},e.component="bookmark",n.emit("openPlugin",e)},"tab://tip":(e={})=>{e.full=!1,e.size={width:window.innerWidth<500?"calc(100% - 15px)":"600px",height:"450px",closeBtn:!0},e.component="tip",n.emit("openPlugin",e)}};window.openCard=function(e){let{width:i=null,height:t=null,minHeight:o=null,minWidth:d=null,custom:p={},origin:r={},id:a=""}=e;p||(p={});const{width:l=(window.innerWidth<1200?window.innerWidth<900?window.innerWidth:900:1200),height:w=(window.innerHeight<700?window.innerHeight:700)}=p;n.emit("openApp",{width:null==i?l:i,height:null==t?w:t,title:e.name,src:e.src,url:e.url,minHeight:o,minWidth:d,custom:p,origin:r,id:a})};const o=n=>{e.state.moveStatus=!1,window.openCard({name:n.name,src:n.src,url:n.window})},d=(i,t=!1)=>{const o=e.getters.find(i);if(o){const{app:e=0,custom:i={}}=o;if(1===e){if(/^http/.test(o.url),o.url,"/noteApp"===o.url)return void n.emit("openApp",{...o,name_en:"noteApp"});window.openCard({...o,origin:o})}else r(o.url,t)}},p=n=>{let e=document.createElement("a");e.href=n,e.target="_blank",e.click(),e.remove()},r=(n,i=!1)=>{if(t[n])t[n]();else if(i)p(n);else if(e.state.config.openType.linkOpen)p(n);else{let e=document.createElement("a");e.href=n,e.click(),e.remove()}};n.on("openCard",(n=>{window.openCard(n)}));export{t as C,d as a,o as b,p as o,r};
