import{A as e,I as t,J as n,R as r,_ as i,g as a,l as o,m as s,v as c,x as l}from"./vue.runtime.esm-bundler-DS0mm12S.js";import{t as u}from"./VisuallyHidden-nGm_7oL3.js";import{s as d}from"./PopperContent-uFA7BIqu.js";var f=l({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(r){let i=r,{primitiveElement:o,currentElement:c}=d();return n(s(()=>i.checked??i.value),(e,t)=>{if(!c.value)return;let n=c.value,r=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(r,`value`).set;if(i&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});i.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(n,r)=>(t(),a(u,e({ref_key:`primitiveElement`,ref:o},{...i,...n.$attrs},{as:`input`}),null,16))}}),p=l({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(n){let l=n,u=s(()=>typeof l.value==`object`&&Array.isArray(l.value)&&l.value.length===0&&l.required),d=s(()=>typeof l.value==`string`||typeof l.value==`number`||typeof l.value==`boolean`||l.value===null||l.value===void 0?[{name:l.name,value:l.value}]:typeof l.value==`object`&&Array.isArray(l.value)?l.value.flatMap((e,t)=>typeof e==`object`?Object.entries(e).map(([e,n])=>({name:`${l.name}[${t}][${e}]`,value:n})):{name:`${l.name}[${t}]`,value:e}):l.value!==null&&typeof l.value==`object`&&!Array.isArray(l.value)?Object.entries(l.value).map(([e,t])=>({name:`${l.name}[${e}]`,value:t})):[]);return(n,s)=>(t(),c(o,null,[i(` We render single input if it's required `),u.value?(t(),a(f,e({key:n.name},{...l,...n.$attrs},{name:n.name,value:n.value}),null,16,[`name`,`value`])):(t(!0),c(o,{key:1},r(d.value,r=>(t(),a(f,e({key:r.name},{ref_for:!0},{...l,...n.$attrs},{name:r.name,value:r.value}),null,16,[`name`,`value`]))),128))],2112))}});export{p as t};