function a(t,e){return t?.getInputTargetBlock?.(e)??null}function u(t){return t?.getNextBlock?.()??null}function i(t,e){return t?.getFieldValue?.(e)}function s(t,e){return!!t&&t.type===e}function h(t){let e=t;for(;e;){if(s(e,"led_rgb_abcd_set")&&i(e,"ledMaterial")==="ALL"&&i(e,"ledColor")==="off")return!0;e=u(e)}return!1}const m={checkpoints:[{id:"checkpoint1",checkCondition:(t,e={})=>{const r=e?.blocklyWorkspaceRef?.current;if(!r)return!1;const l=r.getAllBlocks?r.getAllBlocks(!1):[];if(!Array.isArray(l)||l.length===0)return!1;const f=l.some(n=>n?.type==="led_rgb_abcd_set"),g=l.some(n=>n?.type==="time_set"),k=l.some(n=>n?.type==="switch_condition");return f&&g&&k?(r?.getTopBlocks?.(!0)??[]).some(n=>{let o=n;for(;o;){if(s(o,"controls_if")){const c=a(o,"IF0"),p=a(o,"DO0");if(s(c,"switch_condition")&&i(c,"switchState")==="off"&&h(p))return!0}o=u(o)}return!1}):!1},dialogues:[{speaker:"Rob",message:"Tekan butang 'Switch ON' untuk menghidupkan lampu dan selesaikan misi!",characterDirection:"left",dialogType:"checkpoint"}],cameraPan:{duration:1,position:[0,3,60],lookAt:[0,0,0]},keepCameraAfterDialog:!0}]};export{m as checkpointConfig};
