import{r as e,g as t}from"./p-b31dd0cc.js";class s{}class n{constructor(t){e(this,t),this.snackQueue=[]}async create(e){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 s,e),t.addEventListener("close",e=>{e.target.remove(),this.controllerEl.sliceQueue()}),this.controllerEl.pushToQueue(t)}async pushToQueue(e){this.snackQueue=[...this.snackQueue,e]}async sliceQueue(){this.snackQueue=this.snackQueue.length>1?[...this.snackQueue.slice(1,this.snackQueue.length)]:[]}handleQueue(e,t){e.length>0&&(t.length>e.length||1===e.length)&&document.body.appendChild(e[0])}get host(){return t(this)}static get watchers(){return{snackQueue:["handleQueue"]}}}export{n as materials_snackbar_controller};