/*!
 * KoliBri - The accessible HTML-Standard
 */
"use strict";var tslib_es6=require("./tslib.es6-7DbU_BSw.js"),index=require("./index-D0FxsaCe.js"),Input=require("./Input-qTFj8HfQ.js"),FormFieldStateWrapper=require("./FormFieldStateWrapper-BeAW0hiT.js");const SuggestionsFc=e=>{var{id:t,suggestions:s}=e,i=tslib_es6.__rest(e,["id","suggestions"]);return s?index.h("datalist",Object.assign({id:`${t}-list`},i),s.map(e=>index.h("option",{value:e}))):null};function getInputProps(e,t,s){var i;const n=[...FormFieldStateWrapper.getRenderStates(e).ariaDescribedBy,...null!==(i=t.ariaDescribedBy)&&void 0!==i?i:[]],a={id:e._id,hideLabel:e._hideLabel,label:e._label,disabled:e._disabled,name:e._name};if("_accessKey"in e&&(a.accessKey=e._accessKey),"_type"in e&&(a.type=e._type),"_value"in e&&(a.value=e._value),"_required"in e&&(a.required=e._required),"_maxLength"in e&&"_maxLengthBehavior"in e&&"hard"===e._maxLengthBehavior&&(a.maxlength=e._maxLength),"_placeholder"in e&&(a.placeholder=e._placeholder),"_autoComplete"in e&&(a.autoComplete=e._autoComplete),"_spellCheck"in e&&(a.spellcheck=e._spellCheck),"_pattern"in e&&(a.pattern=e._pattern),"_readOnly"in e&&(a.readonly=e._readOnly),"_min"in e&&(a.min=e._min),"_max"in e&&(a.max=e._max),"_step"in e&&(a.step=e._step),"_multiple"in e&&(a.multiple=e._multiple),"_checked"in e&&(a.checked=e._checked),"_indeterminate"in e&&(a.indeterminate=e._indeterminate),"_touched"in e&&(a.touched=e._touched),"_msg"in e&&(a.msg=e._msg),"_shortKey"in e&&(a["aria-keyshortcuts"]=e._shortKey),"_suggestions"in e&&!s){Array.isArray(e._suggestions)&&e._suggestions.length>0&&(a.suggestions=index.h(SuggestionsFc,{id:e._id,suggestions:e._suggestions}))}return Object.assign(Object.assign(Object.assign({},a),t),{ariaDescribedBy:n})}const InputStateWrapper=e=>{var{state:t,customSuggestions:s}=e,i=tslib_es6.__rest(e,["state","customSuggestions"]);return index.h(Input.InputFc,Object.assign({},getInputProps(t,i,s)))};exports.InputStateWrapper=InputStateWrapper,exports.SuggestionsFc=SuggestionsFc;