import{e as n}from"./utils-1.0.74-7xWhx9mc.js";import{a as u}from"./hooks-1.0.74-NYCTWeI9.js";import{ao as f,ap as p}from"./lib-1.0.74-B5IEqfHg.js";import{R as m}from"./RestApi-1.0.74-5XKxNzpR.js";const g=(o,s)=>{const e=u();return{builtinLog:o,builtinShowAlert:(r,t)=>{e(p({title:r,message:t}))},builtinShowConfirm:(r,t,i)=>{e(f({title:r,message:t,callback:i}))},builtinShowSnackbar:(r,t)=>{t?n(r,{variant:t==="success"||t==="error"||t==="warning"||t==="info"?t:"default"}):n(r,{variant:"default"})},builtinCallService:(r,t,i,l)=>{if(typeof r!="string"&&!Array.isArray(r)){console.error("Invalid function call - wpda.callService()");return}const a=typeof r=="string"?"":r[0],c=typeof r=="string"?r:r[1];m("app/call",{app_id:s,cls:a,fnc:c,arg:JSON.stringify(t)},i,l)}}};export{g as u};
