import{w as n,bt as v,q as R,x as q,z as S,y as T,l as h}from"./index.js";function x(e,o){const a=n({}),d=v(),i=n(null),p=n(!1),r=n(""),f=R().emit,y=()=>h(i).$el.getBoundingClientRect().y;async function g(){const{api:t,prop:c,value:s}=e,{code:u,message:m,data:l}=await t({[c]:Array.isArray(s)?s[0]:s});d({code:u,message:m,handler:()=>{a.value=l,r.value=String(u),o&&o(l)}})}return q(()=>{if(e.api&&!e.noRequeset)return g()}),S(()=>a.value,()=>setTimeout(()=>{const t={top:y()-134,title:e.title};T(()=>f("map-offset-top",t))},1e3)),{defaultRef:i,hidden:p,code:r,data:a}}const A={api:{type:Function},prop:{type:String},value:{type:[String,Array]},title:{type:String},noRequeset:{type:Boolean}};export{A as d,x as u};
