define(['exports', 'preact/jsx-runtime', 'preact/compat', './logger-0f873e29', './TabbableModeContext-a9c97640', 'preact/hooks', './useId-c9578d26', './LayerHost-733ade2f', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', './InlineUserAssistance-a97e0011', './Flex-590160eb', 'css!./MessageBannerStyles.styles.css', 'module', './UNSAFE_MessageBanner/themes/redwood/MessageBannerVariants.css', 'preact', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-30886397', 'css!./IconStyle.styles.css', './IconButton-368fba34', 'css!./MessageStyles.styles.css', './MessageFormattingUtils-2e19d8de', './TransitionGroup-3b9d81b6', './MessagesContext-602a69a2', 'css!./HiddenAccessibleStyles.styles.css', 'css!./ComponentMessageStyles.styles.css', 'module', './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageVariants.css', './FormFieldContext-3c44aaaa', './Popup-3e2566da', './UNSAFE_Separator/themes/SeparatorStyles.css', 'css!./LabelStyles.styles.css', 'module', './UNSAFE_Label/themes/redwood/LabelVariants.css', './InputGroupContext-372087af', 'module', './UNSAFE_Popup/themes/redwood/PopupVariants.css', './FormContext-5130e198', './useFormContext-30acdd33', './CheckboxRadioContext-6a0fead0', './CheckboxControl-c6a380b3'], (function(e,s,t,o,a,n,r,i,c,l,d,u,m,p,h,y,S,b,C,A,x,U,g,f,F,w,T,k,E,M,v,N,_,B,I,R,L,D,V,P,j,q,H,G){"use strict";const $=t.forwardRef((({"aria-describedby":e,assistiveText:o,columnSpan:a,helpSourceLink:n,helpSourceText:i,isDisabled:c,isReadonly:l,isRequired:d=!1,messages:m,onCommit:p,userAssistanceDensity:h,value:y,testId:S,children:b},C=null)=>{const{isDisabled:A,isReadonly:x,userAssistanceDensity:U}=q.useFormContext(),g=t.useRef(null),f=r.useId(),F=S?`${S}-inline-user-assistance`:void 0,w=c??A,T=l??x,k=h??U,E=!w&&!T,M=E?`${f}-bottom-ua`:void 0,v=t.useCallback((e=>{const{key:s}=e,t=void 0!==s;if(t&&" "!==s)return;const o=e.target,a=t?!o.checked:o.checked,n=!!y;n!==a&&p({value:a,previousValue:n})}),[p,y]);return t.useImperativeHandle(C,(()=>({focus:()=>{!w&&g.current?.focus()},blur:()=>{const e=document.activeElement;g.current===e&&e.blur()}}))),s.jsxs(H.CheckboxRadioContext.Provider,{value:{isFocusRingShown:!w},children:[s.jsx(G.CheckboxControl,{...E?{onChange:v,onKeyUp:v}:{},"aria-describedby":e,assistiveText:o,columnSpan:a,helpSourceLink:n,helpSourceText:i,isChecked:y,isDisabled:w,isReadonly:T,isRequired:d,ref:g,children:b}),E?s.jsx(u.InlineUserAssistance,{id:M,isRequiredShown:!!d&&!y,requiredAlignment:"start",messages:m,userAssistanceDensity:"reflow"===k?"reflow":"efficient",testId:F}):"reflow"===k?void 0:s.jsx(u.InlineUserAssistance,{userAssistanceDensity:"efficient",testId:F})]})}));e.Checkbox=$}));
//# sourceMappingURL=Checkbox-49753599.js.map
