1import{r as p,j as d,iU as U,iV as X,iW as D,iX as I,iY as j,iZ as $,i_ as z,i$ as G,c as K,C as V,m as N,iD as S}from"./main-D78L-pDZ.js";import{C as W}from"./check-Bpili8b0.js";try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="ef5944cf-d12a-4379-83c2-bdeb59565ea6",t._sentryDebugIdIdentifier="sentry-dbid-ef5944cf-d12a-4379-83c2-bdeb59565ea6")}catch{}var g="Checkbox",[Y,ne]=X(g),[Z,R]=Y(g);function J(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:s,disabled:o,form:l,name:c,onCheckedChange:a,required:u,value:C="on",internal_do_not_use_render:b}=t,[h,v]=U({prop:n,defaultProp:s??!1,onChange:a,caller:g}),[k,x]=p.useState(null),[y,i]=p.useState(null),f=p.useRef(!1),_=k?!!l||!!k.closest("form"):!0,E={checked:h,disabled:o,setChecked:v,control:k,setControl:x,name:c,form:l,value:C,hasConsumerStoppedPropagationRef:f,required:u,defaultChecked:m(s)?!1:s,isFormControl:_,bubbleInput:y,setBubbleInput:i};return d.jsx(Z,{scope:e,...E,children:Q(b)?b(E):r})}var B="CheckboxTrigger",T=p.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},s)=>{const{control:o,value:l,disabled:c,checked:a,required:u,setControl:C,setChecked:b,hasConsumerStoppedPropagationRef:h,isFormControl:v,bubbleInput:k}=R(B,t),x=D(s,C),y=p.useRef(a);return p.useEffect(()=>{const i=o?.form;if(i){const f=()=>b(y.current);return i.addEventListener("reset",f),()=>i.removeEventListener("reset",f)}},[o,b]),d.jsx(I.button,{type:"button",role:"checkbox","aria-checked":m(a)?"mixed":a,"aria-required":u,"data-state":L(a),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:x,onKeyDown:j(e,i=>{i.key==="Enter"&&i.preventDefault()}),onClick:j(n,i=>{b(f=>m(f)?!0:!f),k&&v&&(h.current=i.isPropagationStopped(),h.current||i.stopPropagation())})})});T.displayName=B;var w=p.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:o,required:l,disabled:c,value:a,onCheckedChange:u,form:C,...b}=t;return d.jsx(J,{__scopeCheckbox:n,checked:s,defaultChecked:o,disabled:c,required:l,onCheckedChange:u,name:r,form:C,value:a,internal_do_not_use_render:({isFormControl:h})=>d.jsxs(d.Fragment,{children:[d.jsx(T,{...b,ref:e,__scopeCheckbox:n}),h&&d.jsx(F,{__scopeCheckbox:n})]})})});w.displayName=g;var M="CheckboxIndicator",q=p.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...s}=t,o=R(M,n);return d.jsx(G,{present:r||m(o.checked)||o.checked===!0,children:d.jsx(I.span,{"data-state":L(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});q.displayName=M;var A="CheckboxBubbleInput",F=p.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:l,required:c,disabled:a,name:u,value:C,form:b,bubbleInput:h,setBubbleInput:v}=R(A,t),k=D(n,v),x=$(o),y=z(r);p.useEffect(()=>{const f=h;if(!f)return;const _=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(_,"checked").set,O=!s.current;if(x!==o&&P){const H=new Event("click",{bubbles:O});f.indeterminate=m(o),P.call(f,m(o)?!1:o),f.dispatchEvent(H)}},[h,x,o,s]);const i=p.useRef(m(o)?!1:o);return d.jsx(I.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??i.current,required:c,disabled:a,name:u,value:C,form:b,...e,tabIndex:-1,ref:k,style:{...e.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});F.displayName=A;function Q(t){return typeof t=="function"}function m(t){return t==="indeterminate"}function L(t){return m(t)?"indeterminate":t?"checked":"unchecked"}const ee=t=>{const e=K.c(11);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const s=p.use(V),o=S.input[s||"default"],l=S.checkbox[s||"default"];let c;e[3]!==n||e[4]!==o||e[5]!==l?(c=N("peer h-4 w-4 shrink-0 rounded-sm border border-slate-normal ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",o,l,n),e[3]=n,e[4]=o,e[5]=l,e[6]=c):c=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(q,{className:N("flex items-center justify-center text-current"),children:d.jsx(W,{className:"h-4 w-4"})}),e[7]=a):a=e[7];let u;return e[8]!==r||e[9]!==c?(u=d.jsx(w,{className:c,...r,children:a}
1),e[8]=r,e[9]=c,e[10]=u):u=e[10],u};ee.displayName=w.displayName;export{ee as C}; 2//# sourceMappingURL=checkbox-VnKLakWI.js.map
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.