PageSourceSearch

https://ande.ai/assets/radio-group-sReMh9AW.js

js ande.ai collected 2026-10-05 16:21:34 UTC 6,404 bytes, 5 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a8ae0dc7-54be-5ca0-8280-9a0cab11d4a2")}catch(e){}}();
3(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`884afbbb66f3ed1739c35de963f695335ece2a53`}}catch{}})();import{s as e}from"./rolldown-runtime-DBhiMQ14.js";import{t}from"./react-CZN7ywjf.js";import{a as n,i as r,n as i}from"./use-resolve-button-type-Bc2P3W2s.js";import{d as a,h as o,i as s,l as c,m as l,o as u,p as d,r as f,s as p,t as m,y as h}from"./keyboard-CAvDMMwr.js";import{t as g}from"./disabled-z0i-4uBJ.js";import{a as _,i as v,n as y,r as b}from"./form-fields-B2fG0geJ.js";import{i as x,n as S,o as C,t as w}from"./label-DAvztQxw.js";import{n as T,r as E,t as D}from"./description-aC3-xiOb.js";import{r as O}from"./frozen-CarbSQjx.js";import{_ as k,g as A,p as j,v as M}from"./portal-BSisoMEY.js";var N=e(t(),1),P=(e=>(e[e.RegisterOption=0]=`RegisterOption`,e[e.UnregisterOption=1]=`UnregisterOption`,e))(P||{}),F={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:M(n,e=>e.element.current)}},1(e,t){let n=e.options.slice(),r=e.options.findIndex(e=>e.id===t.id);return r===-1?e:(n.splice(r,1),{...e,options:n})}},I=(0,N.createContext)(null);I.displayName=`RadioGroupDataContext`;function L(e){let t=(0,N.useContext)(I);if(t===null){let t=Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,L),t}return t}var R=(0,N.createContext)(null);R.displayName=`RadioGroupActionsContext`;function z(e){let t=(0,N.useContext)(R);if(t===null){let t=Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,z),t}return t}function B(e,t){return a(t.type,F,e,t)}var V=`div`;function H(e,t){let n=(0,s.useId)(),r=g(),{id:i=`headlessui-radiogroup-${n}`,value:a,form:o,name:c,onChange:l,by:u,disabled:x=r||!1,defaultValue:C,tabIndex:w=0,...T}=e,D=O(u),[M,P]=(0,N.useReducer)(B,{options:[]}),F=M.options,[L,z]=S(),[H,U]=E(),W=(0,N.useRef)(null),G=f(W,t),K=v(C),[q,J]=_(a,l,K),Y=(0,N.useMemo)(()=>F.find(e=>!e.propsRef.current.disabled),[F]),X=(0,N.useMemo)(()=>F.some(e=>D(e.propsRef.current.value,q)),[F,q]),Z=d(e=>{if(x||D(e,q))return!1;let t=F.find(t=>D(t.propsRef.current.value,e))?.propsRef.current;return t!=null&&t.disabled?!1:(J?.(e),!0)}),Q=d(e=>{let t=W.current;if(!t)return;let n=h(t),r=F.filter(e=>e.propsRef.current.disabled===!1).map(e=>e.element.current);switch(e.key){case m.Enter:b(e.currentTarget);break;case m.ArrowLeft:case m.ArrowUp:if(e.preventDefault(),e.stopPropagation(),A(r,j.Previous|j.WrapAround)===k.Success){let e=F.find(e=>e.element.current===n?.activeElement);e&&Z(e.propsRef.current.value)}break;case m.ArrowRight:case m.ArrowDown:if(e.preventDefault(),e.stopPropagation(),A(r,j.Next|j.WrapAround)===k.Success){let e=F.find(e=>e.element.current===n?.activeElement);e&&Z(e.propsRef.current.value)}break;case m.Space:{e.preventDefault(),e.stopPropagation();let t=F.find(e=>e.element.current===n?.activeElement);t&&Z(t.propsRef.current.value)}}}),$=d(e=>(P({type:0,...e}),()=>P({type:1,id:e.id}))),ee=(0,N.useMemo)(()=>({value:q,firstOption:Y,containsCheckedOption:X,disabled:x,compare:D,tabIndex:w,...M}),[q,Y,X,x,D,w,M]),te=(0,N.useMemo)(()=>({registerOption:$,change:Z}),[$,Z]),ne={ref:G,id:i,role:`radiogroup`,"aria-labelledby":L,"aria-describedby":H,onKeyDown:Q},re=(0,N.useMemo)(()=>({value:q}),[q]),ie=(0,N.useCallback)(()=>{if(K!==void 0)return Z(K)},[Z,K]),ae=p();return N.createElement(U,{name:`RadioGroup.Description`},N.createElement(z,{name:`RadioGroup.Label`},N.createElement(R.Provider,{value:te},N.createElement(I.Provider,{value:ee},c!=null&&N.createElement(y,{disabled:x,data:{[c]:q||`on`},overrides:{type:`radio`,checked:q!=null},form:o,onReset:ie}),ae({ourProps:ne,theirProps:T,slot:re,defaultTag:V,name:`RadioGroup`})))))}var U=`div`;function W(e,t){let a=L(`RadioGroup.Option`),u=z(`RadioGroup.Option`),m=(0,s.useId)(),{id:h=`headlessui-radiogroup-option-${m}`,value:g,disabled:_=a.disabled||!1,autoFocus:v=!1,...y}=e,b=(0,N.useRef)(null),x=f(b,t),[C,w]=S(),[T,D]=E(),O=l({value:g,disabled:_});o(()=>u.registerOption({id:h,element:b,propsRef:O}),[h,u,b,O]);let k=d(e=>{var t;if(i(e.currentTarget))return e.preventDefault();u.change(g)&&((t=b.current)==null||t.focus())}),A=a.firstOption?.id===h,{isFocusVisible:j,focusProps:M}=r({autoFocus:v}),{isHovered:P,hoverProps:F}=n({isDisabled:_}),I=a.compare(a.value,g),R=c({ref:x,id:h,role:`radio`,"aria-checked":I?`true`:`false`,"aria-labelledby":C,"aria-describedby":T,"aria-disabled":_?!0:void 0,tabIndex:_?-1:I||!a.containsCheckedOption&&A?a.tabIndex:-1,onClick:_?void 0:k,autoFocus:v},M,F),B=(0,N.useMemo)(()=>({checked:I,disabled:_,active:j,hover:P,focus:j,autofocus:v}),[I,_,P,j,v]),V=p();return N.createElement(D,{name:`RadioGroup.Description`},N.createElement(w,{name:`RadioGroup.Label`},V({ourProps:R,theirProps:y,slot:B,defaultTag:U,name:`RadioGroup.Option`})))}var G=`span`;function K(e,t){let a=L(`Radio`),u=z(`Radio`),m=(0,s.useId)(),h=C(),_=g(),{id:v=h||`headlessui-radio-${m}`,value:y,disabled:b=a.disabled||_||!1,autoFocus:x=!1,...S}=e,E=(0,N.useRef)(null),D=f(E,t),O=w(),k=T(),A=l({value:y,disabled:b});o(()=>u.registerOption({id:v,element:E,propsRef:A}),[v,u,E,A]);let j=d(e=>{var t;if(i(e.currentTarget))return e.preventDefault();u.change(y)&&((t=E.current)==null||t.focus())}),{isFocusVisible:M,focusProps:P}=r({autoFocus:x}),{isHovered:F,hoverProps:I}=n({isDisabled:b}),R=a.firstOption?.id===v,B=a.compare(a.value,y),V=c({ref:D,id:v,role:`radio`,"aria-checked":B?`true`:`false`,"aria-labelledby":O,"aria-describedby":k,"aria-disabled":b?!0:void 0,tabIndex:b?-1:B||!a.containsCheckedOption&&R?a.tabIndex:-1,autoFocus:x,onClick:b?void 0:j},P,I),H=(0,N.useMemo)(()=>({checked:B,disabled:b,hover:F,focus:M,autofocus:x}),[B,b,F,M,x]);return p()({ourProps:V,theirProps:S,slot:H,defaultTag:G,name:`Radio`})}var q=u(H),J=u(W),Y=u(K),X=Object.assign(q,{Option:J,Radio:Y,Label:x,Description:D});
3export{X as n,Y as t};
4//# sourceMappingURL=radio-group-sReMh9AW.js.map
5//# debugId=a8ae0dc7-54be-5ca0-8280-9a0cab11d4a2

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.