import{d as f,aR as u,aU as l,aV as d,c as m,b as w,E as p,K as _,M as g,o as h}from"./index-CWMhB7z4.js";import{_ as b}from"./definition.vue_vue_type_script_setup_true_lang-CgNXv26P.js";function v(){return{resolve:e=>({href:new URL(e,window.location.href).href})}}function x(e,t){return window.location.assign(e),Promise.resolve()}const B=f({name:"ShwfedNavigationActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=e,i=v(),a=g(),r=(n,o)=>p(n,{..._(a),...o});function c(n){try{return new URL(n,window.location.href).origin!==window.location.origin}catch{return!1}}const s=u(()=>l(r(t.config.url),n=>d(async()=>{const o=c(n);if(t.config.mode==="_blank"){window.open(o?n:i.resolve(n).href,"_blank");return}await x(n)})));return(n,o)=>(h(),m(b,{"action-id":e.buttonId,effect:w(s)},null,8,["action-id","effect"]))}});export{B as default};
