{"version":3,"names":["dynamic","omit","untrack","composeRefs","userRef","mergeRootProps","resolveClassStyle","createInput","Input","props","c","value","disabled","id","undefined","name","userStyling","state","userProps","styledUserProps","controlProps","control","Tag","as","bindControl"],"sources":["input.tsx"],"sourcesContent":["import type { JSX, ValidComponent } from \"@solidjs/web\";\nimport { dynamic } from \"@solidjs/web\";\nimport { omit, untrack } from \"solid-js\";\nimport { composeRefs, userRef } from \"../internals/compose-refs\";\nimport { mergeRootProps } from \"../internals/merge-root-props\";\nimport { resolveClassStyle } from \"../internals/resolve-class-style\";\nimport type { BaseUIComponentProps } from \"../internals/types\";\nimport { createInput, type InputState } from \"./create-input.tsx\";\n\nexport type { InputState };\n\nexport interface InputProps extends BaseUIComponentProps<\"input\", InputState> {\n\t/**\n\t * Tag/component to render. Defaults to `\"input\"`. Replaces the\n\t * pre-spike `render` prop (axis G).\n\t */\n\tas?: ValidComponent;\n}\n\n/**\n * A native input element that automatically works with a surrounding\n * `<Field.Root>`. Renders an `<input>` element (or `as` override).\n *\n * Thin structural adapter over {@link createInput} — the field wiring\n * (labelable id, value registration, `aria-labelledby` / `aria-describedby` /\n * `aria-invalid` composition, touched / dirty / filled / focused setters and\n * the validation pipeline) lives in the primitive. Outside a `<Field.Root>`\n * the primitive's contexts resolve to their NOOP form and this still renders\n * a plain `<input>` with the forwarded consumer props.\n */\nexport function Input(props: InputProps): JSX.Element {\n\tconst c = createInput({\n\t\tvalue: () => props.value,\n\t\tdisabled: () => props.disabled === true,\n\t\t// Setup-time read (useLabelableId consumes it once) — untrack so it\n\t\t// doesn't trip `[STRICT_READ_UNTRACKED]`.\n\t\tid: untrack(() => (typeof props.id === \"string\" ? props.id : undefined)),\n\t\tname: () => (typeof props.name === \"string\" ? props.name : undefined),\n\t});\n\n\t// Bind the slot bag to a `const` before the JSX spread — hydration-critical.\n\t// Spreading an inline call (`{...c.control(...)}`) makes the Solid SSR\n\t// compiler wrap it in a lazy thunk whose server-side resolution diverges\n\t// from the client's, dropping attributes from the SSR markup and shifting\n\t// hydration keys. A pre-bound variable spread is passed straight through.\n\t// See `collapsible-root.tsx` for the full explanation.\n\tconst userStyling = resolveClassStyle(props, () => c.state());\n\tconst userProps = omit(props, \"class\", \"style\", \"attrs\", \"as\", \"id\");\n\tconst styledUserProps = mergeRootProps(userStyling, userProps);\n\tconst controlProps = c.control(styledUserProps);\n\n\tconst Tag = dynamic(() => props.as ?? \"input\");\n\treturn (\n\t\t<Tag {...controlProps} ref={composeRefs(c.bindControl, userRef(props))} />\n\t);\n}\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,IAAI,EAAEC,OAAO,QAAQ,UAAU;AACxC,SAASC,WAAW,EAAEC,OAAO,QAAQ,2BAA2B;AAChE,SAASC,cAAc,QAAQ,+BAA+B;AAC9D,SAASC,iBAAiB,QAAQ,kCAAkC;AAEpE,SAASC,WAAW,QAAyB,oBAAoB;AAYjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,KAAKA,CAACC,KAAiB,EAAe;EACrD,MAAMC,CAAC,GAAGH,WAAW,CAAC;IACrBI,KAAK,EAAEA,CAAA,KAAMF,KAAK,CAACE,KAAK;IACxBC,QAAQ,EAAEA,CAAA,KAAMH,KAAK,CAACG,QAAQ,KAAK,IAAI;IACvC;IACA;IACAC,EAAE,EAAEX,OAAO,CAAC,MAAO,OAAOO,KAAK,CAACI,EAAE,KAAK,QAAQ,GAAGJ,KAAK,CAACI,EAAE,GAAGC,SAAU,CAAC;IACxEC,IAAI,EAAEA,CAAA,KAAO,OAAON,KAAK,CAACM,IAAI,KAAK,QAAQ,GAAGN,KAAK,CAACM,IAAI,GAAGD;EAC5D,CAAC,CAAC;;EAEF;EACA;EACA;EACA;EACA;EACA;EACA,MAAME,WAAW,GAAGV,iBAAiB,CAACG,KAAK,EAAE,MAAMC,CAAC,CAACO,KAAK,CAAC,CAAC,CAAC;EAC7D,MAAMC,SAAS,GAAGjB,IAA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