import{r as s,g as t}from"./p-65ddb289.js";class e{}class a{constructor(t){s(this,t),this.snackQueue=[]}async create(s){this.controllerEl=document.querySelector("materials-snackbar-controller"),this.controllerEl||(this.controllerEl=document.body.appendChild(document.createElement("materials-snackbar-controller")));const t=document.createElement("materials-snackbar");Object.assign(t,new e,s),t.addEventListener("close",s=>{s.target.remove(),this.controllerEl.sliceQueue()}),this.controllerEl.pushToQueue(t)}async pushToQueue(s){this.snackQueue=[...this.snackQueue,s]}async sliceQueue(){this.snackQueue=this.snackQueue.length>1?[...this.snackQueue.slice(1,this.snackQueue.length)]:[]}handleQueue(s,t){s.length>0&&(t.length>s.length||1===s.length)&&document.body.appendChild(s[0])}get host(){return t(this)}static get watchers(){return{snackQueue:["handleQueue"]}}}export{a as materials_snackbar_controller};