'use client';import { a } from './chunk-SYZ6QHLS.js';
import { a as a$1 } from './chunk-D3DSJ4MI.js';
import { cx } from '@onbeam/styled-system/css';
import { forwardRef, useMemo } from 'react';
import { OTPInput } from 'input-otp';
import { inputOTP } from '@onbeam/styled-system/recipes';
import { nanoId } from '@onbeam/utils';
import { jsxs, jsx } from 'react/jsx-runtime';

var m=forwardRef(({className:i,maxLength:o=6,errorMessage:t,hasError:f=!1,...s},u)=>{let n=inputOTP(),a$2=useMemo(()=>new Array(o).fill(null).map(()=>({id:nanoId()})),[o]);return jsxs(OTPInput,{ref:u,containerClassName:cx(n.root,i),maxLength:o,...s,children:[jsx("div",{className:n.group,children:a$2.map(({id:P},l)=>jsx(a,{hasError:!!(t||f),index:l},P))}),jsx(a$1,{children:t})]})});m.displayName="InputOTP";

export { m as a };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-CGEHNZ63.js.map