import{C as e,I as t,It as n,Q as r,bt as i,j as a,lt as o}from"./_plugin-vue_export-helper-BVhEvvHC.js";import{Fi as s,M as c}from"./src-CD6Jsigc.js";import{r as l}from"./axios-DSyjHw-i.js";import{o as u}from"./rpcClient-DCPRsoB6.js";t(),i();var d=a({__name:`HotkeyRecorderInput`,props:{hotkey:{default:``},disabled:{type:Boolean,default:!1},conflictLabel:{default:``}},emits:[`update`,`clear`],setup(t,{emit:i}){let a=i,{t:o}=l();return(i,s)=>(r(),e(n(c),{hotkey:t.hotkey,disabled:t.disabled,"conflict-label":t.conflictLabel,"no-hotkey-label":n(o)(`castermode.editor.noHotkey`),"press-key-label":n(o)(`castermode.editor.pressKey`),"record-label":n(o)(`castermode.editor.record`),"edit-label":n(o)(`castermode.editor.edit`),"cancel-label":n(o)(`castermode.editor.cancel`),"clear-label":n(o)(`button.clear`),onUpdate:s[0]||=(...e)=>a(`update`,...e),onClear:s[1]||=e=>a(`clear`)},null,8,[`hotkey`,`disabled`,`conflict-label`,`no-hotkey-label`,`press-key-label`,`record-label`,`edit-label`,`cancel-label`,`clear-label`]))}});t();var f=15e3;function p(){let e=u.value?.casterMode;return e?Promise.resolve(e):new Promise((e,t)=>{let n=o(u,t=>{t&&(n(),clearTimeout(r),e(t.casterMode))}),r=setTimeout(()=>{n(),t(Error(`RPC client not available`))},f)})}async function m(){let e=await(await p()).getConfig();return JSON.parse(e.json)}async function h(e){await(await p()).setConfig({json:JSON.stringify(e)})}async function g(){return(await(await p()).getActiveOverlays()).overlays.filter(e=>!!e)}function _(e){return{roomName:``,commandId:s(),senderMemberId:``,senderName:``,buttonId:``,postgameId:-1,show:!1,timePeriod:-1,team:-1,players:[],playerIndex:-1,displayMode:-1,dps:!1,pageId:``,clearTargeting:!1,accessKey:``,...e}}function v(e){return(e??[]).map(e=>({team:e.team??0,role:e.role??0}))}async function y(e){let t=await(await p()).execute(_(e));if(!t.ok)throw Error(t.error||`Caster command '${e.commandType}' failed`);return t}async function b(e){let t=await y(e);return t.entryJson?JSON.parse(t.entryJson):null}export{h as a,m as i,b as n,v as o,g as r,d as s,y as t};