pdyform 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("pdyform/core"),y=require("clsx"),B=require("tailwind-merge"),s=require("radix-vue"),g=require("lucide-vue-next");function m(...t){return B.twMerge(y.clsx(t))}const V=["type","value"],v=e.defineComponent({__name:"Input",props:{class:{},type:{},modelValue:{}},emits:["update:modelValue","blur"],setup(t,{emit:n}){const a=t,r=n;return(l,o)=>(e.openBlock(),e.createElementBlock("input",{type:t.type,class:e.normalizeClass(e.unref(m)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a.class)),value:t.modelValue,onInput:o[0]||(o[0]=i=>r("update:modelValue",i.target.value)),onBlur:o[1]||(o[1]=i=>r("blur",i))},null,42,V))}}),f=e.defineComponent({__name:"InputRenderer",props:{field:{},modelValue:{},fieldId:{}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,r=n,l=o=>{r("update:modelValue",p.normalizeFieldValue(a.field,o))};return(o,i)=>(e.openBlock(),e.createBlock(v,{id:t.fieldId,type:t.field.type,placeholder:t.field.placeholder,disabled:t.field.disabled,name:t.field.name,modelValue:t.modelValue??"","onUpdate:modelValue":l},null,8,["id","type","placeholder","disabled","name","modelValue"]))}}),C=["value"],w=e.defineComponent({__name:"Textarea",props:{class:{},modelValue:{}},emits:["update:modelValue","blur"],setup(t,{emit:n}){const a=t,r=n;return(l,o)=>(e.openBlock(),e.createElementBlock("textarea",{class:e.normalizeClass(e.unref(m)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a.class)),value:t.modelValue,onInput:o[0]||(o[0]=i=>r("update:modelValue",i.target.value)),onBlur:o[1]||(o[1]=i=>r("blur",i))},null,42,C))}}),S=e.defineComponent({__name:"TextareaRenderer",props:{field:{},modelValue:{},fieldId:{}},emits:["update:modelValue"],setup(t,{emit:n}){const a=n;return(r,l)=>(e.openBlock(),e.createBlock(w,{id:t.fieldId,placeholder:t.field.placeholder,disabled:t.field.disabled,name:t.field.name,modelValue:t.modelValue??"","onUpdate:modelValue":l[0]||(l[0]=o=>a("update:modelValue",o))},null,8,["id","placeholder","disabled","name","modelValue"]))}}),$=e.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const n=t,a=e.computed(()=>{const{class:l,...o}=n;return o}),r=s.useForwardProps(a);return(l,o)=>(e.openBlock(),e.createBlock(e.unref(s.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(m)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n.class)}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default"),e.createVNode(e.unref(s.SelectIcon),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ChevronDown),{class:"h-4 w-4 opacity-50"})]),_:1})]),_:3},16,["class"]))}}),N=e.defineComponent({__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const n=t,a=e.computed(()=>{const{class:l,...o}=n;return o}),r=s.useForwardProps(a);return(l,o)=>(e.openBlock(),e.createBlock(e.unref(s.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(s.SelectContent),e.mergeProps(e.unref(r),{class:e.unref(m)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n.class)}),{default:e.withCtx(()=>[e.createVNode(e.unref(s.SelectViewport),{class:e.normalizeClass(e.unref(m)("p-1",t.position==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"))},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},8,["class"])]),_:3},16,["class"])]),_:3}))}}),P={class:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},_=e.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const n=t,a=e.computed(()=>{const{class:l,...o}=n;return o}),r=s.useForwardProps(a);return(l,o)=>(e.openBlock(),e.createBlock(e.unref(s.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(m)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n.class)}),{default:e.withCtx(()=>[e.createElementVNode("span",P,[e.createVNode(e.unref(s.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(g.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(s.SelectItemText),null,{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),I=e.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},dir:{},name:{},autocomplete:{},disabled:{type:Boolean},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(t,{emit:n}){const a=t,r=n,l=s.useForwardPropsEmits(a,r);return(o,i)=>(e.openBlock(),e.createBlock(e.unref(s.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(l))),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),E=e.defineComponent({__name:"SelectRenderer",props:{field:{},modelValue:{},fieldId:{}},emits:["update:modelValue"],setup(t,{emit:n}){const a=n;return(r,l)=>(e.openBlock(),e.createBlock(I,{disabled:t.field.disabled,name:t.field.name,modelValue:t.modelValue!=null?String(t.modelValue):"","onUpdate:modelValue":l[0]||(l[0]=o=>a("update:modelValue",o))},{default:e.withCtx(()=>[e.createVNode($,{id:t.fieldId},{default:e.withCtx(()=>[e.createVNode(e.unref(s.SelectValue),{placeholder:t.field.placeholder||"Select an option"},null,8,["placeholder"])]),_:1},8,["id"]),e.createVNode(N,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.field.options,o=>(e.openBlock(),e.createBlock(_,{key:o.value,value:String(o.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["disabled","name","modelValue"]))}}),F=e.defineComponent({__name:"Checkbox",props:{defaultChecked:{type:Boolean},checked:{type:[Boolean,String]},disabled:{type:Boolean},required:{type:Boolean},name:{},value:{},id:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:checked","blur"],setup(t,{emit:n}){const a=t,r=n,l=e.computed(()=>{const{class:i,...d}=a;return d}),o=s.useForwardPropsEmits(l,r);return(i,d)=>(e.openBlock(),e.createBlock(e.unref(s.CheckboxRoot),e.mergeProps(e.unref(o),{class:e.unref(m)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a.class),onBlur:d[0]||(d[0]=c=>r("blur"))}),{default:e.withCtx(()=>[e.createVNode(e.unref(s.CheckboxIndicator),{class:"flex h-full w-full items-center justify-center text-current"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.Check),{class:"h-4 w-4"})]),_:1})]),_:1},16,["class"]))}}),h=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const n=t,a=e.computed(()=>{const{class:r,...l}=n;return l});return(r,l)=>(e.openBlock(),e.createBlock(e.unref(s.Label),e.mergeProps(a.value,{class:e.unref(m)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),R={class:"flex flex-wrap gap-4"},D=e.defineComponent({__name:"CheckboxRenderer",props:{field:{},modelValue:{},fieldId:{}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,r=n,l=(o,i)=>{const d=Array.isArray(a.modelValue)?[...a.modelValue]:[];if(i)d.push(o);else{const c=d.indexOf(o);c>-1&&d.splice(c,1)}r("update:modelValue",d)};return(o,i)=>(e.openBlock(),e.createElementBlock("div",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.field.options,d=>(e.openBlock(),e.createElementBlock("div",{key:d.value,class:"flex items-center space-x-2"},[e.createVNode(F,{id:`checkbox-${t.field.name}-${d.value}`,disabled:t.field.disabled,checked:Array.isArray(t.modelValue)&&t.modelValue.includes(d.value),"onUpdate:checked":c=>l(d.value,!!c)},null,8,["id","disabled","checked","onUpdate:checked"]),e.createVNode(h,{for:`checkbox-${t.field.name}-${d.value}`,class:"font-normal"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["for"])]))),128))]))}}),q=e.defineComponent({__name:"RadioGroupItem",props:{id:{},value:{},disabled:{type:Boolean},required:{type:Boolean},name:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const n=t,a=e.computed(()=>{const{class:l,...o}=n;return o}),r=s.useForwardProps(a);return(l,o)=>(e.openBlock(),e.createBlock(e.unref(s.RadioGroupItem),e.mergeProps(e.unref(r),{class:e.unref(m)("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n.class)}),{default:e.withCtx(()=>[e.createVNode(e.unref(s.RadioGroupIndicator),{class:"flex items-center justify-center"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.Circle),{class:"h-2.5 w-2.5 fill-current text-current"})]),_:1})]),_:1},16,["class"]))}}),z=e.defineComponent({__name:"RadioGroup",props:{modelValue:{},defaultValue:{},disabled:{type:Boolean},name:{},required:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,r=n,l=e.computed(()=>{const{class:i,...d}=a;return d}),o=s.useForwardPropsEmits(l,r);return(i,d)=>(e.openBlock(),e.createBlock(e.unref(s.RadioGroupRoot),e.mergeProps(e.unref(o),{class:e.unref(m)("grid gap-2",a.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["class"]))}}),M=e.defineComponent({__name:"RadioRenderer",props:{field:{},modelValue:{},fieldId:{}},emits:["update:modelValue"],setup(t,{emit:n}){const a=n;return(r,l)=>(e.openBlock(),e.createBlock(z,{class:"flex flex-wrap gap-4",disabled:t.field.disabled,name:t.field.name,modelValue:t.modelValue!=null?String(t.modelValue):"","onUpdate:modelValue":l[0]||(l[0]=o=>a("update:modelValue",o))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.field.options,o=>(e.openBlock(),e.createElementBlock("div",{key:o.value,class:"flex items-center space-x-2"},[e.createVNode(q,{id:`radio-${t.field.name}-${o.value}`,value:String(o.value)},null,8,["id","value"]),e.createVNode(h,{for:`radio-${t.field.name}-${o.value}`,class:"font-normal"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["disabled","name","modelValue"]))}}),b={text:f,number:f,password:f,email:f,date:f,textarea:S,select:E,checkbox:D,radio:M},T={key:1,class:"text-[0.8rem] text-muted-foreground"},U={key:2,class:"text-[0.8rem] font-medium text-destructive"},x=e.defineComponent({__name:"FormFieldRenderer",props:{field:{},modelValue:{},error:{},componentMap:{}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,r=n,l=e.computed(()=>`field-${a.field.name}`),o=e.computed(()=>a.componentMap?{...b,...a.componentMap}:b),i=e.computed(()=>o.value[a.field.type]??f);return(d,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["space-y-2",t.field.className])},[t.field.label?(e.openBlock(),e.createBlock(h,{key:0,for:l.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.field.label),1)]),_:1},8,["for"])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),{field:t.field,fieldId:l.value,modelValue:t.modelValue,"onUpdate:modelValue":c[0]||(c[0]=u=>r("update:modelValue",u))},null,8,["field","fieldId","modelValue"])),t.field.description?(e.openBlock(),e.createElementBlock("p",T,e.toDisplayString(t.field.description),1)):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("p",U,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)],2))}}),L={key:0,class:"space-y-1"},j={key:0,class:"text-2xl font-bold tracking-tight"},G={key:1,class:"text-muted-foreground"},O={class:"space-y-4"},A=["disabled"],W=e.defineComponent({__name:"DynamicForm",props:{schema:{},className:{}},emits:["submit"],setup(t,{emit:n}){const a=t,r=n,l=e.ref(p.createFormRuntimeState(a.schema.fields)),o=(d,c)=>{l.value=p.applyFieldChange(a.schema.fields,l.value,d,c)},i=()=>{const d=p.setSubmitting(l.value,!0),{state:c,hasError:u}=p.runSubmitValidation(a.schema.fields,d);l.value=c,u||r("submit",{...c.values})};return(d,c)=>(e.openBlock(),e.createElementBlock("form",{class:e.normalizeClass(["space-y-6",t.className]),onSubmit:e.withModifiers(i,["prevent"])},[t.schema.title||t.schema.description?(e.openBlock(),e.createElementBlock("div",L,[t.schema.title?(e.openBlock(),e.createElementBlock("h2",j,e.toDisplayString(t.schema.title),1)):e.createCommentVNode("",!0),t.schema.description?(e.openBlock(),e.createElementBlock("p",G,e.toDisplayString(t.schema.description),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",O,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.schema.fields,u=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:u.id},[u.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(x,{key:0,field:u,"model-value":l.value.values[u.name],error:l.value.errors[u.name],"onUpdate:modelValue":k=>o(u.name,k)},null,8,["field","model-value","error","onUpdate:modelValue"]))],64))),128))]),e.createElementVNode("button",{type:"submit",disabled:l.value.isSubmitting,class:"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full"},e.toDisplayString(l.value.isSubmitting?"Submitting...":t.schema.submitButtonText||"Submit"),9,A)],34))}});exports.DynamicForm=W;exports.FormFieldRenderer=x;exports.defaultComponentMap=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),D=require("clsx"),j=require("tailwind-merge"),u=require("radix-vue"),V=require("lucide-vue-next");function C(t){if(typeof t=="number")return Number.isNaN(t)?null:t;if(typeof t!="string"||t.trim()==="")return null;const n=Number(t);return Number.isNaN(n)?null:n}var z={required:"{label} is required",min:"{label} must be at least {value}",max:"{label} must be at most {value}",email:"Invalid email address",pattern:"Invalid format",custom:"Invalid value"};function v(t,n,o){return t.replace("{label}",n.label).replace("{value}",String(o.value||""))}function w(t,n,o){if(!n)return o;const r=n.split(/[.[\]]/).filter(Boolean);let l=t;for(const a of r){if(l==null)return o;l=l[a]}return l===void 0?o:l}function M(t,n,o){if(Object(t)!==t)return t;const r=n.split(/[.[\]]/).filter(Boolean),l={...t};let a=l;for(let s=0;s<r.length-1;s++){const i=r[s],d=r[s+1],c=/^\d+$/.test(d);!(i in a)||a[i]===null||typeof a[i]!="object"?a[i]=c?[]:{}:a[i]=Array.isArray(a[i])?[...a[i]]:{...a[i]},a=a[i]}return a[r[r.length-1]]=o,l}function N(t,n){if(t.type!=="number")return n;if(n===""||n===void 0||n===null)return"";const o=C(n);return o===null?n:o}async function P(t,n,o){if(!n.validations)return null;const r={...z,...o};for(const l of n.validations)switch(l.type){case"required":if(t==null||t===""||Array.isArray(t)&&t.length===0)return l.message||v(r.required,n,l);break;case"min":if(n.type==="number"){const a=C(t);if(a!==null&&a<l.value){const s=n.type==="number"?r.min:typeof t=="string"?"{label} must be at least {value} characters":r.min;return l.message||v(s,n,l)}break}if(typeof t=="number"&&t<l.value)return l.message||v(r.min,n,l);if(typeof t=="string"&&t.length<l.value)return l.message||v("{label} must be at least {value} characters",n,l);break;case"max":if(n.type==="number"){const a=C(t);if(a!==null&&a>l.value)return l.message||v(r.max,n,l);break}if(typeof t=="number"&&t>l.value)return l.message||v(r.max,n,l);if(typeof t=="string"&&t.length>l.value)return l.message||v("{label} must be at most {value} characters",n,l);break;case"email":{if(t&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return l.message||v(r.email,n,l);break}case"pattern":if(t&&l.value&&!new RegExp(l.value).test(t))return l.message||v(r.pattern,n,l);break;case"custom":if(l.validator){const a=await l.validator(t);if(typeof a=="string")return a;if(a===!1)return l.message||v(r.custom,n,l)}break}return null}async function $(t,n,o,r,l,a){if(r&&l){const i=await r(l);if(i[n])return i[n]}const s=t.find(i=>i.name===n);return s?await P(o,s,a):null}async function T(t,n,o,r){let l={};o&&(l=await o(n));const a=t.map(async s=>{if(l[s.name])return;const i=await P(w(n,s.name),s,r);i&&(l[s.name]=i)});return await Promise.all(a),l}function U(t){return t.reduce((n,o)=>(n[o.name]=o.defaultValue!==void 0?o.defaultValue:o.type==="checkbox"?[]:"",n),{})}const I=t=>{let n;const o=new Set,r=(c,p)=>{const m=typeof c=="function"?c(n):c;if(!Object.is(m,n)){const b=n;n=p??(typeof m!="object"||m===null)?m:Object.assign({},n,m),o.forEach(k=>k(n,b))}},l=()=>n,i={setState:r,getState:l,getInitialState:()=>d,subscribe:c=>(o.add(c),()=>o.delete(c))},d=n=t(r,l,i);return i},O=t=>t?I(t):I;function A(t,n,o){return O()((r,l)=>({values:U(t),errors:{},validatingFields:[],isSubmitting:!1,setFieldValue:async(a,s)=>{const i=t.find(c=>c.name===a),d=i?N(i,s):s;r(c=>({values:M(c.values,a,d),validatingFields:[...c.validatingFields,a]}));try{const c=l().values,p=await $(t,a,d,n,c,o);r(m=>({errors:{...m.errors,[a]:p||""},validatingFields:m.validatingFields.filter(b=>b!==a)}))}catch{r(p=>({validatingFields:p.validatingFields.filter(m=>m!==a)}))}},setFieldBlur:async a=>{r(s=>({validatingFields:[...s.validatingFields,a]}));try{const s=l().values,i=w(s,a),d=await $(t,a,i,n,s,o);r(c=>({errors:{...c.errors,[a]:d||""},validatingFields:c.validatingFields.filter(p=>p!==a)}))}catch{r(i=>({validatingFields:i.validatingFields.filter(d=>d!==a)}))}},setSubmitting:a=>r({isSubmitting:a}),runSubmitValidation:async()=>{r({isSubmitting:!0});const a=l(),s=await T(t,a.values,n,o),i=Object.keys(s).length>0;return r({errors:s,isSubmitting:!1}),{state:l(),hasError:i}}}))}function y(...t){return j.twMerge(D.clsx(t))}const L=["type","value"],E=e.defineComponent({__name:"Input",props:{class:{},type:{},modelValue:{}},emits:["update:modelValue","blur"],setup(t,{emit:n}){const o=t,r=n;return(l,a)=>(e.openBlock(),e.createElementBlock("input",e.mergeProps(l.$attrs,{type:t.type,class:e.unref(y)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",o.class),value:t.modelValue,onInput:a[0]||(a[0]=s=>r("update:modelValue",s.target.value)),onBlur:a[1]||(a[1]=s=>r("blur",s))}),null,16,L))}}),x=e.defineComponent({__name:"InputRenderer",props:{field:{},fieldId:{},modelValue:{},ariaInvalid:{type:Boolean},ariaRequired:{type:Boolean},ariaDescribedby:{}},emits:["update:modelValue","blur"],setup(t,{emit:n}){const o=t,r=n,l=a=>{r("update:modelValue",N(o.field,a))};return(a,s)=>(e.openBlock(),e.createBlock(E,{id:t.fieldId,type:t.field.type,placeholder:t.field.placeholder,disabled:typeof t.field.disabled=="boolean"?t.field.disabled:void 0,name:t.field.name,modelValue:t.modelValue??"","onUpdate:modelValue":l,onBlur:s[0]||(s[0]=i=>r("blur",i))},null,8,["id","type","placeholder","disabled","name","modelValue"]))}}),G=["value"],K=e.defineComponent({__name:"Textarea",props:{class:{},modelValue:{}},emits:["update:modelValue","blur"],setup(t,{emit:n}){const o=t,r=n;return(l,a)=>(e.openBlock(),e.createElementBlock("textarea",e.mergeProps(l.$attrs,{class:e.unref(y)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",o.class),value:t.modelValue,onInput:a[0]||(a[0]=s=>r("update:modelValue",s.target.value)),onBlur:a[1]||(a[1]=s=>r("blur",s))}),null,16,G))}}),W=e.defineComponent({__name:"TextareaRenderer",props:{field:{},fieldId:{},modelValue:{},ariaInvalid:{type:Boolean},ariaRequired:{type:Boolean},ariaDescribedby:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=n;return(r,l)=>(e.openBlock(),e.createBlock(K,{id:t.fieldId,placeholder:t.field.placeholder,disabled:typeof t.field.disabled=="boolean"?t.field.disabled:void 0,name:t.field.name,modelValue:t.modelValue??"","onUpdate:modelValue":l[0]||(l[0]=a=>o("update:modelValue",a))},null,8,["id","placeholder","disabled","name","modelValue"]))}}),H=e.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const n=t,o=e.computed(()=>{const{class:l,...a}=n;return a}),r=u.useForwardProps(o);return(l,a)=>(e.openBlock(),e.createBlock(e.unref(u.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(y)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n.class)}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default"),e.createVNode(e.unref(u.SelectIcon),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(V.ChevronDown),{class:"h-4 w-4 opacity-50"})]),_:1})]),_:3},16,["class"]))}}),J=e.defineComponent({__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const n=t,o=e.computed(()=>{const{class:l,...a}=n;return a}),r=u.useForwardProps(o);return(l,a)=>(e.openBlock(),e.createBlock(e.unref(u.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.SelectContent),e.mergeProps(e.unref(r),{class:e.unref(y)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n.class)}),{default:e.withCtx(()=>[e.createVNode(e.unref(u.SelectViewport),{class:e.normalizeClass(e.unref(y)("p-1",t.position==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"))},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},8,["class"])]),_:3},16,["class"])]),_:3}))}}),Q={class:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},X=e.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const n=t,o=e.computed(()=>{const{class:l,...a}=n;return a}),r=u.useForwardProps(o);return(l,a)=>(e.openBlock(),e.createBlock(e.unref(u.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(y)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n.class)}),{default:e.withCtx(()=>[e.createElementVNode("span",Q,[e.createVNode(e.unref(u.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(V.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(u.SelectItemText),null,{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),Y=e.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},dir:{},name:{},autocomplete:{},disabled:{type:Boolean},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(t,{emit:n}){const o=t,r=n,l=u.useForwardPropsEmits(o,r);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(u.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(l))),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16))}}),Z=e.defineComponent({__name:"SelectRenderer",props:{field:{},fieldId:{},modelValue:{},ariaInvalid:{type:Boolean},ariaRequired:{type:Boolean},ariaDescribedby:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=n;return(r,l)=>(e.openBlock(),e.createBlock(Y,{disabled:typeof t.field.disabled=="boolean"?t.field.disabled:void 0,name:t.field.name,modelValue:t.modelValue!=null?String(t.modelValue):"","onUpdate:modelValue":l[0]||(l[0]=a=>o("update:modelValue",a))},{default:e.withCtx(()=>[e.createVNode(H,{id:t.fieldId},{default:e.withCtx(()=>[e.createVNode(e.unref(u.SelectValue),{placeholder:t.field.placeholder||"Select an option"},null,8,["placeholder"])]),_:1},8,["id"]),e.createVNode(J,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.field.options,a=>(e.openBlock(),e.createBlock(X,{key:a.value,value:String(a.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["disabled","name","modelValue"]))}}),_=e.defineComponent({__name:"Checkbox",props:{defaultChecked:{type:Boolean},checked:{type:[Boolean,String]},disabled:{type:Boolean},required:{type:Boolean},name:{},value:{},id:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:checked","blur"],setup(t,{emit:n}){const o=t,r=n,l=e.computed(()=>{const{class:s,...i}=o;return i}),a=u.useForwardPropsEmits(l,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(u.CheckboxRoot),e.mergeProps(e.unref(a),{class:e.unref(y)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",o.class),onBlur:i[0]||(i[0]=d=>r("blur"))}),{default:e.withCtx(()=>[e.createVNode(e.unref(u.CheckboxIndicator),{class:"flex h-full w-full items-center justify-center text-current"},{default:e.withCtx(()=>[e.createVNode(e.unref(V.Check),{class:"h-4 w-4"})]),_:1})]),_:1},16,["class"]))}}),F=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const n=t,o=e.computed(()=>{const{class:r,...l}=n;return l});return(r,l)=>(e.openBlock(),e.createBlock(e.unref(u.Label),e.mergeProps(o.value,{class:e.unref(y)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),ee={class:"flex flex-wrap gap-4"},te=e.defineComponent({__name:"CheckboxRenderer",props:{field:{},fieldId:{},modelValue:{},ariaInvalid:{type:Boolean},ariaRequired:{type:Boolean},ariaDescribedby:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,l=(a,s)=>{const i=Array.isArray(o.modelValue)?[...o.modelValue]:[];if(s)i.push(a);else{const d=i.indexOf(a);d>-1&&i.splice(d,1)}r("update:modelValue",i)};return(a,s)=>(e.openBlock(),e.createElementBlock("div",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.field.options,i=>(e.openBlock(),e.createElementBlock("div",{key:i.value,class:"flex items-center space-x-2"},[e.createVNode(_,{id:`checkbox-${t.field.name}-${i.value}`,disabled:typeof t.field.disabled=="boolean"?t.field.disabled:void 0,checked:Array.isArray(t.modelValue)&&t.modelValue.includes(i.value),"onUpdate:checked":d=>l(i.value,!!d)},null,8,["id","disabled","checked","onUpdate:checked"]),e.createVNode(F,{for:`checkbox-${t.field.name}-${i.value}`,class:"font-normal"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.label),1)]),_:2},1032,["for"])]))),128))]))}}),ae=e.defineComponent({__name:"RadioGroupItem",props:{id:{},value:{},disabled:{type:Boolean},required:{type:Boolean},name:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const n=t,o=e.computed(()=>{const{class:l,...a}=n;return a}),r=u.useForwardProps(o);return(l,a)=>(e.openBlock(),e.createBlock(e.unref(u.RadioGroupItem),e.mergeProps(e.unref(r),{class:e.unref(y)("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n.class)}),{default:e.withCtx(()=>[e.createVNode(e.unref(u.RadioGroupIndicator),{class:"flex items-center justify-center"},{default:e.withCtx(()=>[e.createVNode(e.unref(V.Circle),{class:"h-2.5 w-2.5 fill-current text-current"})]),_:1})]),_:1},16,["class"]))}}),le=e.defineComponent({__name:"RadioGroup",props:{modelValue:{},defaultValue:{},disabled:{type:Boolean},name:{},required:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,l=e.computed(()=>{const{class:s,...i}=o;return i}),a=u.useForwardPropsEmits(l,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(u.RadioGroupRoot),e.mergeProps(e.unref(a),{class:e.unref(y)("grid gap-2",o.class)}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16,["class"]))}}),ne=e.defineComponent({__name:"RadioRenderer",props:{field:{},fieldId:{},modelValue:{},ariaInvalid:{type:Boolean},ariaRequired:{type:Boolean},ariaDescribedby:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=n;return(r,l)=>(e.openBlock(),e.createBlock(le,{class:"flex flex-wrap gap-4",disabled:typeof t.field.disabled=="boolean"?t.field.disabled:void 0,name:t.field.name,modelValue:t.modelValue!=null?String(t.modelValue):"","onUpdate:modelValue":l[0]||(l[0]=a=>o("update:modelValue",a))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.field.options,a=>(e.openBlock(),e.createElementBlock("div",{key:a.value,class:"flex items-center space-x-2"},[e.createVNode(ae,{id:`radio-${t.field.name}-${a.value}`,value:String(a.value)},null,8,["id","value"]),e.createVNode(F,{for:`radio-${t.field.name}-${a.value}`,class:"font-normal"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["disabled","name","modelValue"]))}}),oe=e.defineComponent({__name:"DateRenderer",props:{field:{},modelValue:{},fieldId:{},ariaInvalid:{type:Boolean},ariaRequired:{type:Boolean},ariaDescribedby:{}},emits:["update:modelValue","blur"],setup(t,{emit:n}){const o=n;return(r,l)=>(e.openBlock(),e.createBlock(E,{id:t.fieldId,type:"date",modelValue:t.modelValue,placeholder:t.field.placeholder,disabled:typeof t.field.disabled=="boolean"?t.field.disabled:void 0,name:t.field.name,"aria-invalid":t.ariaInvalid,"aria-required":t.ariaRequired,"aria-describedby":t.ariaDescribedby,"onUpdate:modelValue":l[0]||(l[0]=a=>o("update:modelValue",a)),onBlur:l[1]||(l[1]=a=>o("blur",a))},null,8,["id","modelValue","placeholder","disabled","name","aria-invalid","aria-required","aria-describedby"]))}}),re=e.defineComponent({__name:"Switch",props:{defaultChecked:{type:Boolean},checked:{type:Boolean},disabled:{type:Boolean},required:{type:Boolean},name:{},id:{},value:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:checked"],setup(t,{emit:n}){const o=t,r=n,l=e.computed(()=>{const{class:s,...i}=o;return i}),a=u.useForwardPropsEmits(l,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(u.SwitchRoot),e.mergeProps(e.unref(a),{class:e.unref(y)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",o.class)}),{default:e.withCtx(()=>[e.createVNode(e.unref(u.SwitchThumb),{class:e.normalizeClass(e.unref(y)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"))},null,8,["class"])]),_:1},16,["class"]))}}),ie={class:"flex items-center space-x-2"},se=e.defineComponent({__name:"SwitchRenderer",props:{field:{},modelValue:{type:Boolean},fieldId:{},ariaInvalid:{type:Boolean},ariaRequired:{type:Boolean},ariaDescribedby:{}},emits:["update:modelValue","blur"],setup(t,{emit:n}){const o=n;return(r,l)=>(e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(re,{id:t.fieldId,checked:t.modelValue,disabled:typeof t.field.disabled=="boolean"?t.field.disabled:void 0,"aria-invalid":t.ariaInvalid,"aria-required":t.ariaRequired,"aria-describedby":t.ariaDescribedby,"onUpdate:checked":l[0]||(l[0]=a=>o("update:modelValue",a))},null,8,["id","checked","disabled","aria-invalid","aria-required","aria-describedby"])]))}}),S={text:x,number:x,password:x,email:x,textarea:W,select:Z,checkbox:te,radio:ne,date:oe,switch:se},de={key:0,class:"text-destructive"},ce=["id"],ue=["id"],R=e.defineComponent({__name:"FormFieldRenderer",props:{field:{},modelValue:{},error:{},componentMap:{}},emits:["update:modelValue","blur"],setup(t,{emit:n}){const o=t,r=n,l=e.computed(()=>`field-${o.field.name}`),a=e.computed(()=>`${l.value}-description`),s=e.computed(()=>`${l.value}-error`),i=e.computed(()=>{var m;return(m=o.field.validations)==null?void 0:m.some(b=>b.type==="required")}),d=e.computed(()=>{const m=[];return o.field.description&&m.push(a.value),o.error&&m.push(s.value),m.length>0?m.join(" "):void 0}),c=e.computed(()=>o.componentMap?{...S,...o.componentMap}:S),p=e.computed(()=>c.value[o.field.type]??x);return(m,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["space-y-2",t.field.className])},[t.field.label?(e.openBlock(),e.createBlock(F,{key:0,for:l.value,class:e.normalizeClass(i.value?"flex items-center gap-1":"")},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.field.label)+" ",1),i.value?(e.openBlock(),e.createElementBlock("span",de,"*")):e.createCommentVNode("",!0)]),_:1},8,["for","class"])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.value),{field:t.field,fieldId:l.value,modelValue:t.modelValue,"aria-invalid":!!t.error,"aria-required":i.value,"aria-describedby":d.value,"onUpdate:modelValue":b[0]||(b[0]=k=>r("update:modelValue",k)),onBlur:b[1]||(b[1]=k=>r("blur",k))},null,40,["field","fieldId","modelValue","aria-invalid","aria-required","aria-describedby"])),t.field.description?(e.openBlock(),e.createElementBlock("p",{key:1,id:a.value,class:"text-[0.8rem] text-muted-foreground"},e.toDisplayString(t.field.description),9,ce)):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("p",{key:2,id:s.value,class:"text-[0.8rem] font-medium text-destructive"},e.toDisplayString(t.error),9,ue)):e.createCommentVNode("",!0)],2))}});function q({schema:t}){const n=A(t.fields,t.resolver,t.errorMessages),o=e.ref(n.getState()),r=n.subscribe(d=>{o.value=d});return e.onUnmounted(()=>{r()}),{store:n,state:o,setValue:async(d,c)=>{await n.getState().setFieldValue(d,c)},getValue:d=>w(o.value.values,d),validate:async()=>{const{hasError:d,state:c}=await n.getState().runSubmitValidation();return{hasError:d,values:c.values}},reset:()=>{n.setState({values:{},errors:{},isSubmitting:!1})}}}const me={key:0,class:"space-y-1"},fe={key:0,class:"text-2xl font-bold tracking-tight"},pe={key:1,class:"text-muted-foreground"},be={class:"space-y-4"},ge=["disabled"],ye=e.defineComponent({__name:"DynamicForm",props:{schema:{},className:{},form:{}},emits:["submit"],setup(t,{emit:n}){const o=t,r=n,l=q({schema:o.schema}),a=o.form||l,{store:s,state:i}=a,d=async(f,B)=>{await s.getState().setFieldValue(f,B)},c=async f=>{await s.getState().setFieldBlur(f)},p=f=>typeof f.hidden=="function"?f.hidden(i.value.values):!!f.hidden,m=f=>{const B=typeof f.disabled=="function"?f.disabled(i.value.values):!!f.disabled,g=i.value.validatingFields.includes(f.name);return{...f,disabled:B||g}},b=async()=>{const{hasError:f,values:B}=await a.validate();if(f){const g=o.schema.fields.find(h=>i.value.errors[h.name]);if(g){const h=document.getElementById(`field-${g.name}`);h==null||h.focus(),h==null||h.scrollIntoView({behavior:"smooth",block:"center"})}return}r("submit",B)},k=e.computed(()=>i.value.validatingFields.length>0);return(f,B)=>(e.openBlock(),e.createElementBlock("form",{class:e.normalizeClass(["space-y-6",t.className]),onSubmit:e.withModifiers(b,["prevent"])},[t.schema.title||t.schema.description?(e.openBlock(),e.createElementBlock("div",me,[t.schema.title?(e.openBlock(),e.createElementBlock("h2",fe,e.toDisplayString(t.schema.title),1)):e.createCommentVNode("",!0),t.schema.description?(e.openBlock(),e.createElementBlock("p",pe,e.toDisplayString(t.schema.description),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.schema.fields,g=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g.id},[p(g)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(R,{key:0,field:m(g),"model-value":e.unref(w)(e.unref(i).values,g.name),error:e.unref(i).errors[g.name],"onUpdate:modelValue":h=>d(g.name,h),onBlur:h=>c(g.name)},null,8,["field","model-value","error","onUpdate:modelValue","onBlur"]))],64))),128))]),e.createElementVNode("button",{type:"submit",disabled:e.unref(i).isSubmitting||k.value,class:"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full"},e.toDisplayString(e.unref(i).isSubmitting?"Submitting...":k.value?"Validating...":t.schema.submitButtonText||"Submit"),9,ge)],34))}});exports.DynamicForm=ye;exports.FormFieldRenderer=R;exports.defaultComponentMap=S;exports.useForm=q;