import{W as s,u as m,X as i,Y as f,Z as l,L as u}from"./index-B6uGkrgD.js";const c=e=>{for(s()&&(m("↓ Search form element start."),u.debug(e));e instanceof HTMLElement&&e.tagName!=="FORM"&&e.tagName!==f.toUpperCase();){try{e.parentElement instanceof HTMLElement?e=e.parentElement:e.parentNode instanceof ShadowRoot?e=e.parentNode.host:e=null}catch{}s()&&(u.debug(e),m("↑ Search form element finished."))}return e},p=(e={})=>{var t,n;const o=c(e.form);if(o instanceof HTMLElement){const a=new Event("reset",{bubbles:!0,cancelable:!0});if(o.tagName==="FORM")i(a,o),o.dispatchEvent(a);else if(o.tagName===f.toUpperCase()){i(a,l.querySelector("form",o));const r=o;typeof((t=r._on)===null||t===void 0?void 0:t.onReset)=="function"&&((n=r._on)===null||n===void 0||n.onReset(a))}}},b=(e={})=>{const t=c(e.form);if(t instanceof HTMLElement){const n=new SubmitEvent("submit",{bubbles:!0,cancelable:!0,submitter:t});if(t.tagName==="FORM")s()&&t.noValidate===!1&&m("If you have not focusable or hidden form fields in your form, you should enable noValidate for your form.",{force:!0}),setTimeout(()=>{typeof t.requestSubmit=="function"?t.requestSubmit():(i(n,t),t.dispatchEvent(n))});else if(t.tagName===f.toUpperCase()){i(n,l.querySelector("form",t));const o=t;setTimeout(()=>{var a,r;typeof((a=o._on)===null||a===void 0?void 0:a.onSubmit)=="function"&&((r=o._on)===null||r===void 0||r.onSubmit(n))})}}};export{p as a,b as p};
//# sourceMappingURL=controller-BShVWk74-DTfwaZJT.js.map
