import{cf as e,cg as a,a3 as r,a8 as t,u as n,a as o,c as l,o as u,w as s,ao as d,aH as i}from"./index-ip5gDR6L.js";import{f as m,a as v}from"./use-form-common-props-BwBs_jod.js";const I={prefix:Math.floor(1e4*Math.random()),current:0},p=Symbol("elIdInjection"),f=()=>t()?r(p,I):I,c=r=>{const t=f(),o=e();return a(()=>n(r)||`${o.value}-id-${t.prefix}-${t.current++}`)},b=()=>({form:r(m,void 0),formItem:r(v,void 0)}),x=(e,{formItemContext:a,disableIdGeneration:r,disableIdManagement:n})=>{r||(r=o(!1)),n||(n=o(!1));const m=t(),v=o();let I;const p=l(()=>{var r;return!!(!e.label&&!e.ariaLabel&&a&&a.inputIds&&(null==(r=a.inputIds)?void 0:r.length)<=1)});return u(()=>{I=s([d(e,"id"),r],([e,r])=>{const t=null!=e?e:r?void 0:c().value;t!==v.value&&((null==a?void 0:a.removeInputId)&&!(()=>{let e=null==m?void 0:m.parent;for(;e;){if("ElFormItem"===e.type.name)return!1;if("ElLabelWrap"===e.type.name)return!0;e=e.parent}return!1})()&&(v.value&&a.removeInputId(v.value),(null==n?void 0:n.value)||r||!t||a.addInputId(t)),v.value=t)},{immediate:!0})}),i(()=>{I&&I(),(null==a?void 0:a.removeInputId)&&v.value&&a.removeInputId(v.value)}),{isLabeledByFormItem:p,inputId:v}};export{b as a,x as b,f as c,c as u};
