You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
886 B

import{e as f,a3 as r,a4 as c}from"./ydFS6PsN.js";const p="$s";function l(...o){const n=typeof o[o.length-1]=="string"?o.pop():void 0;typeof o[0]!="string"&&o.unshift(n);const[e,t]=o;if(!e||typeof e!="string")throw new TypeError("[nuxt] [useState] key must be a string: "+e);if(t!==void 0&&typeof t!="function")throw new Error("[nuxt] [useState] init must be a function: "+t);const s=p+e,i=f(),u=r(i.payload.state,s);if(t&&(i._state[s]??={_default:t}),u.value===void 0&&t){const a=t();if(c(a))return i.payload.state[s]=a,a;u.value=a}return u}let y=0;function d(){const o=l("app:toasts",()=>[]);function n(e,t="info",s=3e3){const i=++y;o.value.push({id:i,type:t,msg:e}),s>0&&setTimeout(()=>{o.value=o.value.filter(u=>u.id!==i)},s)}return{toasts:o,toast:n,success:(e,t)=>n(e,"success",t),error:(e,t)=>n(e,"error",t),info:(e,t)=>n(e,"info",t),warn:(e,t)=>n(e,"warning",t)}}export{d as u};