const c=t=>(Array.isArray(t)?t:[]).filter(e=>e&&typeof e=="object"&&e.action!=="switchOn"&&e.action!=="switchOff"),o=t=>t?.action==="setLED"&&t?.type==="led"&&t?.material==="A"&&t?.state===!0,f=t=>t?.action==="setLED"&&t?.type==="led_rgb_abcd"&&t?.material==="A"&&t?.color==="random"&&t?.state===!0,E=t=>t?.action==="setTime"&&Number(t?.time)===2,l=(t=[])=>{if(t.length!==3||!E(t[2]))return!1;const e=[o,f],n=new Array(e.length).fill(!1);for(const r of t.slice(0,2)){const i=e.findIndex((s,a)=>!n[a]&&s(r));if(i===-1)return!1;n[i]=!0}return n.every(Boolean)},C={skipAnimationDelay:!0,customDelay:2e3,checkWinCondition:(t,e)=>{if(!Array.isArray(t))return!1;const n=t.some(({action:r}={})=>r==="switchOff");return!!e&&n},allowDeferredWin:t=>{const e=c(t);if(e.length!==12)return!1;for(let n=0;n<4;n+=1){const r=e.slice(n*3,(n+1)*3);if(!l(r))return!1}return!0}};export{C as winConfig};
