import{aM as C,I as k,O as E,aN as $,d as w,r as A,i as B,f as _,a as p,b as d,q as m,w as t,e as f,c as R,t as a,v as I,u as n,n as h,_ as N,E as T,s as U,ad as D}from"./B2UyoCas.js";import{_ as V}from"./C9KnTrrC.js";const x=()=>{const{text:i,copy:r,copied:s}=C(),{t:c}=k(),l=E();return $(s,()=>{s.value&&l.add({title:c("clipboardCopied"),icon:"i-heroicons-check-circle",color:"success"})},{throttle:600}),{text:i,copy:r}},z={key:0,class:"transition-discrete starting:o_opacity-0 starting:blur-sm starting:pointer-events-none ending:o_opacity-100 ending:blur-none ending:pointer-events-auto delay-700 duration-1000 ease-in-out"},q={class:"max-w-prose text-sm"},M={key:0,class:"text-xs o_mt-3 rounded-md bg-uiError/10 outline outline-uiError/20 o_p-2 max-w-prose"},O={class:"break-all o_mb-2"},P=w({__name:"DisplayApiError",props:{error:{},refresh:{},withRefresh:{type:Boolean,default:!0}},setup(i){const r=i,s=A(!1),c=D(()=>{r.refresh(),s.value=!1},2e3),l=()=>{s.value=!0,c()},{copy:g}=x(),y=B(()=>r.withRefresh?!!["408","403","429"].find(o=>r.error.message.includes(o)):!1);return(e,u)=>{const o=I,b=N,v=V;return e.error?(d(),_("div",z,[m(v,{color:"error",variant:"subtle",icon:"mdi:alarm-light",size:"sm",title:e.$t("UniversalAPIErrorTitle"),ui:{icon:"animate-pulse"}},{description:t(()=>[f("p",q,a(e.$t("UniversalAPIError")),1),e.error.message?(d(),_("div",M,[f("p",O,a(e.error.message),1),m(o,{color:"error",variant:"solid",type:"button",size:"sm",onClick:u[0]||(u[0]=S=>n(g)(e.error.message))},{default:t(()=>[h(a(e.$t("CopyErrorMessage")),1)]),_:1})])):p("",!0),n(y)?(d(),R(o,{key:1,color:"error",variant:"solid",type:"button",onClick:l},{trailing:t(()=>[m(b,{name:n(U).icoRefresh,class:T({"animate-spin":n(s)})},null,8,["name","class"])]),default:t(()=>[h(a(e.$t("RefreshingApi"))+" ",1)]),_:1})):p("",!0)]),_:1},8,["title"])])):p("",!0)}}}),H=Object.assign(P,{__name:"DisplayApiError"});export{H as _,x as u};
