{"version":3,"file":"toast.1ec976f2.js","sources":["../../../../stores/toast.ts"],"sourcesContent":["import { defineStore } from 'pinia';\nimport { Nullable } from '@/types/generic';\n\ntype ToastType = 'success' | 'error';\ntype ToastPosition = 'top' | 'bottom';\n\ninterface State {\n isActive: boolean;\n persist: boolean;\n message: string;\n position: ToastPosition;\n type: ToastType;\n}\n\nexport const useToastStore = defineStore('toast', {\n state: (): State => ({\n isActive: false,\n persist: false,\n message: '',\n position: 'top',\n type: 'success',\n }),\n actions: {\n display(message: string, type: Nullable = null, persist: boolean = false) {\n this.message = message;\n if (type) {\n this.type = type;\n }\n this.persist = persist;\n this.isActive = true;\n },\n hide() {\n this.message = '';\n this.isActive = false;\n this.persist = false;\n },\n },\n});\n"],"names":["useToastStore","defineStore","message","type","persist"],"mappings":"wCAca,MAAAA,EAAgBC,EAAY,QAAS,CAChD,MAAO,KAAc,CACnB,SAAU,GACV,QAAS,GACT,QAAS,GACT,SAAU,MACV,KAAM,SAAA,GAER,QAAS,CACP,QAAQC,EAAiBC,EAA4B,KAAMC,EAAmB,GAAO,CACnF,KAAK,QAAUF,EACXC,IACF,KAAK,KAAOA,GAEd,KAAK,QAAUC,EACf,KAAK,SAAW,EAClB,EACA,MAAO,CACL,KAAK,QAAU,GACf,KAAK,SAAW,GAChB,KAAK,QAAU,EACjB,CACF,CACF,CAAC"}