1import{r as t,c as s,h as o,a as i}from"./p-9add63ef.js";function e(t){const s=new FormData(t);const o={};s.forEach(((t,s)=>{o[s]=t}));return o}const r=":host{display:block}::slotted(*:not(:last-child)){margin-bottom:var(--sc-form-row-spacing, 0.75em)}::slotted(*:not(:last-child)).wp-block-spacer{margin-bottom:0}::slotted(*:focus-within),::slotted(*:active){position:relative;z-index:var(--sc-form-focus-within-z-index, auto);}";const n=r;const a=class{constructor(o){t(this,o);this.scSubmit=s(this,"scSubmit",7);this.scFormSubmit=s(this,"scFormSubmit",7);this.scFormChange=s(this,"scFormChange",7);this.novalidate=false}async getFormData(){return new FormData(this.formElement)}async getFormJson(){return e(this.formElement)}async handleChange(){this.scFormChange.emit(e(this.formElement))}async submit(){return this.submitForm()}getFormControls(){return[...this.form.querySelectorAll("*")]}async validate(){const t=this.getFormControls();const s=t.filter((t=>typeof t.reportValidity==="function"));if(!this.novalidate){for(const t of s){if(!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)){continue}const s=await t.reportValidity();if(!s){return false}}}return true}submitForm(){const t=document.createElement("button");if(this.formElement){t.type="submit";t.style.position="absolute";t.style.width="0";t.style.height="0";t.style.clip="rect(0 0 0 0)";t.style.clipPath="inset(50%)";t.style.overflow="hidden";t.style.whiteSpace="nowrap";this.formElement.append(t);t.click();t.remove()}}render(){return o("div",{key:"4bb0f0bbf2ef51b5f69d8407dd6812ab9c31d943",part:"base",class:"form",role:"form"},o("form",{key:"ecdb3d8bc3fcd4b43eb850eaa89712b6c9d5cf8d",part:"form",ref:t=>this.formElement=t,class:"test",onSubmit:async t=>{t.preventDefault();const s=await this.validate();if(!s){return false}this.scSubmit.emit();this.scFormSubmit.emit()},novalidate:this.novalidate},o("slot",{key:"51a5833bce902a91104de30888888f33293c99bc"})))}get form(){return i(this)}};a.style=n;export{a as sc_form}; 2//# sourceMappingURL=p-7ad8d4a8.entry.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.