/*!
 * KoliBri - The accessible HTML-Standard
 */
import{f as e}from"./component-names-Dy77vq43.js";import{J as o,j as t,M as n,a as i,L as f}from"./common-DEEjER7G.js";const s=n=>{if(o()){t(`↓ Search form element start.`);f.debug(n)}while(n instanceof HTMLElement&&n.tagName!=="FORM"&&n.tagName!==e.toUpperCase()){try{if(n.parentElement instanceof HTMLElement){n=n.parentElement}else if(n.parentNode instanceof ShadowRoot){n=n.parentNode.host}else{n=null}}catch(e){}if(o()){f.debug(n)}}if(o()){t(`↑ Search form element finished.`)}return n};const l=(o={})=>{var t,f;const l=s(o.form);if(l instanceof HTMLElement){const o=new Event("reset",{bubbles:true,cancelable:true});if(l.tagName==="FORM"){n(o,l);l.dispatchEvent(o)}else if(l.tagName===e.toUpperCase()){n(o,i.querySelector("form",l));const e=l;if(typeof((t=e._on)===null||t===void 0?void 0:t.onReset)==="function"){(f=e._on)===null||f===void 0?void 0:f.onReset(o)}}}};const a=(f={})=>{const l=s(f.form);if(l instanceof HTMLElement){const f=new SubmitEvent("submit",{bubbles:true,cancelable:true,submitter:l});if(l.tagName==="FORM"){if(o()&&l.noValidate===false){t(`If you have not focusable or hidden form fields in your form, you should enable noValidate for your form.`,{force:true})}setTimeout((()=>{if(typeof l.requestSubmit==="function"){l.requestSubmit()}else{n(f,l);l.dispatchEvent(f)}}))}else if(l.tagName===e.toUpperCase()){n(f,i.querySelector("form",l));const e=l;setTimeout((()=>{var o,t;if(typeof((o=e._on)===null||o===void 0?void 0:o.onSubmit)==="function"){(t=e._on)===null||t===void 0?void 0:t.onSubmit(f)}}))}}};export{l as a,a as p};
//# sourceMappingURL=controller-D0y9uwX0.js.map