1import{x as D,r as a,f as U,g as k,aa as S,l as H,j as r,m as j,ab as O,T as _,P as K,ac as $,ad as q,ae as w,Z as A,af as G}from"./index.3bHSf9gi.js";import{I as N}from"./InputInstructions.ikAdmYQR.js";import{u as Z}from"./useBasicWidgetState.CSKMY_WY.js";import{u as J,a as M,b as Q}from"./useUpdateUiValue.y-s71G-M.js";import{u as X}from"./uniqueId.DDLECwS_.js";import{I as Y}from"./input.-I2c-pPm.js";import"./FormClearHelper.DyYuMYyM.js";import"./inputUtils.CptNuJwn.js";import"./base-input.DYzkAUR7.js";const tt=D("div",{target:"e1o1zy6o0"})("position:relative;");function et({disabled:o,element:e,widgetMgr:s,fragmentId:u}){const[n,p]=a.useState(()=>T(s,e)??null),{width:W,elementRef:x}=U(),[i,m]=a.useState(!1),y=a.useCallback(()=>{p(e.default??null),m(!0)},[e.default]),[C,h]=Z({getStateFromWidgetMgr:T,getDefaultStateFromProto:ot,getCurrStateFromProto:at,updateWidgetMgrState:st,element:e,widgetMgr:s,fragmentId:u,onFormCleared:y});J(C,n,p,i);const[V,f]=a.useState(!1),t=k(),[b]=a.useState(()=>X("text_input_")),{placeholder:F,formId:l,icon:d,maxChars:I}=e,g=a.useCallback(()=>{m(!1),h({value:n,fromUi:!0})},[n,h]),E=S({formId:l})?s.allowFormEnterToSubmit(l):i,v=V&&W>t.breakpoints.hideWidgetDetails,R=a.useCallback(()=>{i&&g(),f(!1)},[i,g]),z=a.useCallback(()=>{f(!0)},[]),L=M({formId:l,maxChars:I,setDirty:m,setUiValue:p,setValueWithSource:h}),P=Q(l,g,i,s,u);return H(tt,{className:"stTextInput","data-testid":"stTextInput",ref:x,children:[r($,{label:e.label,disabled:o,labelVisibility:j(e.labelVisibility?.value),htmlFor:b,children:e.help&&r(O,{children:r(_,{content:e.help,placement:K.TOP_RIGHT})})}),r(Y,{value:n??"",placeholder:F,onBlur:R,onFocus:z,onChange:L,onKeyPress:P,"aria-label":e.label,disabled:o,id:b,type:it(e),autoComplete:e.autocomplete,startEnhancer:d&&r(A,{"data-testid":"stTextInputIcon",iconValue:d,size:"lg"}),overrides:{Input:{style:{fontWeight:t.fontWeights.normal,minWidth:0,lineHeight:t.lineHeights.inputWidget,paddingRight:t.spacing.sm,paddingLeft:t.spacing.md,paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm,"::placeholder":{color:t.colors.fadedText60}}},Root:{props:{"data-testid":"stTextInputRootElement"},style:({$isFocused:B})=>{const c=w(t.colors,B);return{height:t.sizes.minElementHeight,borderLeftWidth:t.sizes.borderWidth,borderRightWidth:t.sizes.borderWidth,borderTopWidth:t.sizes.borderWidth,borderBottomWidth:t.sizes.borderWidth,borderTopColor:c,borderRightColor:c,borderBottomColor:c,borderLeftColor:c,paddingLeft:d?t.spacing.sm:0}}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:t.iconSizes.lg,color:q(d)?t.colors.fadedText60:"inherit"}}}}),v&&r(N,{dirty:i,value:n??"",maxLength:I,inForm:S({formId:l}),allowEnterToSubmit:E})]})}function T(o,e){return o.getStringValue(e)??null}function ot(o){return o.default??null}function at(o){return o.value??null}function st(o,e,s,u){e.setStringValue(o,s.value,{fromUi:s.fromUi},u)}function it(o){return o.type===G.Type.PASSWORD?"password":"text"}const gt=a.memo(et);export{gt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.