PageSourceSearch

https://www.flexcar.com/cdn/cfa/c9cd0935cb1346044d74dcab52f77f3fb8cb7ff9/assets/checkbox-TE7pzvAZ.js

js flexcar.com collected 2026-09-24 09:45:56 UTC 9,394 bytes, 6 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]="7483d1ea-b8ff-512c-a999-e3fd44a36ce1")}catch(e){}}();
3import{r as s,j as p,k as V}from"./chunk-62JRHF6Z-Cg50Stu2.js";import{d as W}from"./index-KatFkK5c.js";import"./index-B-9bbPAc.js";import{c as N}from"./spacer-y5aqkyMZ.js";import{C as q}from"./check-small-Bdr-IMWE.js";import{c as U}from"./colors-Cc7HAQZt.js";import{C as G}from"./check-F6xWM4Mb.js";function I(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function K(...e){return t=>{let n=!1;const c=e.map(r=>{const o=I(r,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let r=0;r<c.length;r++){const o=c[r];typeof o=="function"?o():I(e[r],null)}}}}function R(...e){return s.useCallback(K(...e),e)}function X(e,t=[]){let n=[];function c(o,a){const i=s.createContext(a),u=n.length;n=[...n,a];const f=l=>{const{scope:h,children:x,...m}=l,v=h?.[e]?.[u]||i,y=s.useMemo(()=>m,Object.values(m));return p.jsx(v.Provider,{value:y,children:x})};f.displayName=o+"Provider";function d(l,h){const x=h?.[e]?.[u]||i,m=s.useContext(x);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${o}\``)}return[f,d]}const r=()=>{const o=n.map(a=>s.createContext(a));return function(i){const u=i?.[e]||o;return s.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return r.scopeName=e,[c,Z(r,...t)]}function Z(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const c=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(o){const a=c.reduce((i,{useScope:u,scopeName:f})=>{const l=u(o)[`__scope${f}`];return{...i,...l}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function $(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var A=globalThis?.document?s.useLayoutEffect:()=>{},J=V[" useInsertionEffect ".trim().toString()]||A;function Q({prop:e,defaultProp:t,onChange:n=()=>{},caller:c}){const[r,o,a]=Y({defaultProp:t,onChange:n}),i=e!==void 0,u=i?e:r;{const d=s.useRef(e!==void 0);s.useEffect(()=>{const l=d.current;l!==i&&console.warn(`${c} is changing from ${l?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,c])}const f=s.useCallback(d=>{if(i){const l=ee(d)?d(e):d;l!==e&&a.current?.(l)}else o(d)},[i,e,o,a]);return[u,f]}function Y({defaultProp:e,onChange:t}){const[n,c]=s.useState(e),r=s.useRef(n),o=s.useRef(t);return J(()=>{o.current=t},[t]),s.useEffect(()=>{r.current!==n&&(o.current?.(n),r.current=n)},[n,r]),[n,c,o]}function ee(e){return typeof e=="function"}function te(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function re(e){const[t,n]=s.useState(void 0);return A(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const c=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const o=r[0];let a,i;if("borderBoxSize"in o){const u=o.borderBoxSize,f=Array.isArray(u)?u[0]:u;a=f.inlineSize,i=f.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return c.observe(e,{box:"border-box"}),()=>c.unobserve(e)}else n(void 0)},[e]),t}function ne(e){const t=oe(e),n=s.forwardRef((c,r)=>{const{children:o,...a}=c,i=s.Children.toArray(o),u=i.find(ce);if(u){const f=u.props.children,d=i.map(l=>l===u?s.Children.count(f)>1?s.Children.only(null):s.isValidElement(f)?f.props.children:null:l);return p.jsx(t,{...a,ref:r,children:s.isValidElement(f)?s.cloneElement(f,void 0,d):null})}return p.jsx(t,{...a,ref:r,children:o})});return n.displayName=`${e}.Slot`,n}function oe(e){const t=s.forwardRef((n,c)=>{const{children:r,...o}=n,a=s.isValidElement(r)?ue(r):void 0,i=R(a,c);if(s.isValidElement(r)){const u=ie(o,r.props);return r.type!==s.Fragment&&(u.ref=i),s.cloneElement(r,u)}return s.Children.count(r)>
31?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var se=Symbol("radix.slottable");function ce(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===se}function ie(e,t){const n={...t};for(const c in t){const r=e[c],o=t[c];/^on[A-Z]/.test(c)?r&&o?n[c]=(...i)=>{const u=o(...i);return r(...i),u}:r&&(n[c]=r):c==="style"?n[c]={...r,...o}:c==="className"&&(n[c]=[r,o].filter(Boolean).join(" "))}return{...e,...n}}function ue(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],w=ae.reduce((e,t)=>{const n=ne(`Primitive.${t}`),c=s.forwardRef((r,o)=>{const{asChild:a,...i}=r,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(u,{...i,ref:o})});return c.displayName=`Primitive.${t}`,{...e,[t]:c}},{}),g="Checkbox",[le]=X(g),[fe,P]=le(g);function de(e){const{__scopeCheckbox:t,checked:n,children:c,defaultChecked:r,disabled:o,form:a,name:i,onCheckedChange:u,required:f,value:d="on",internal_do_not_use_render:l}=e,[h,x]=Q({prop:n,defaultProp:r??!1,onChange:u,caller:g}),[m,v]=s.useState(null),[y,b]=s.useState(null),C=s.useRef(!1),S=m?!!a||!!m.closest("form"):!0,E={checked:h,disabled:o,setChecked:x,control:m,setControl:v,name:i,form:a,value:d,hasConsumerStoppedPropagationRef:C,required:f,defaultChecked:k(r)?!1:r,isFormControl:S,bubbleInput:y,setBubbleInput:b};return p.jsx(fe,{scope:t,...E,children:pe(l)?l(E):c})}var B="CheckboxTrigger",O=s.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...c},r)=>{const{control:o,value:a,disabled:i,checked:u,required:f,setControl:d,setChecked:l,hasConsumerStoppedPropagationRef:h,isFormControl:x,bubbleInput:m}=P(B,e),v=R(r,d),y=s.useRef(u);return s.useEffect(()=>{const b=o?.form;if(b){const C=()=>l(y.current);return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[o,l]),p.jsx(w.button,{type:"button",role:"checkbox","aria-checked":k(u)?"mixed":u,"aria-required":f,"data-state":H(u),"data-disabled":i?"":void 0,disabled:i,value:a,...c,ref:v,onKeyDown:$(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:$(n,b=>{l(C=>k(C)?!0:!C),m&&x&&(h.current=b.isPropagationStopped(),h.current||b.stopPropagation())})})});O.displayName=B;var _=s.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:c,checked:r,defaultChecked:o,required:a,disabled:i,value:u,onCheckedChange:f,form:d,...l}=e;return p.jsx(de,{__scopeCheckbox:n,checked:r,defaultChecked:o,disabled:i,required:a,onCheckedChange:f,name:c,form:d,value:u,internal_do_not_use_render:({isFormControl:h})=>p.jsxs(p.Fragment,{children:[p.jsx(O,{...l,ref:t,__scopeCheckbox:n}),h&&p.jsx(D,{__scopeCheckbox:n})]})})});_.displayName=g;var z="CheckboxIndicator",M=s.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:c,...r}=e,o=P(z,n);return p.jsx(W,{present:c||k(o.checked)||o.checked===!0,children:p.jsx(w.span,{"data-state":H(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});M.displayName=z;var T="CheckboxBubbleInput",D=s.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:c,hasConsumerStoppedPropagationRef:r,checked:o,defaultChecked:a,required:i,disabled:u,name:f,value:d,form:l,bubbleInput:h,setBubbleInput:x}=P(T,e),m=R(n,x),v=te(o),y=re(c);s.useEffect(()=>{const C=h;if(!C)return;const S=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(S,"checked").set,L=!r.current;if(v!==o&&j){const F=new Event("click",{bubbles:L});C.indeterminate=k(o),j.call(C,k(o)?!1:o),C.dispatchEvent(F)}},[h,v,o,r]);const b=s.useRef(k(o)?!1:o);return p.jsx(w.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??b.current,required:i,disabled:u,name:f,value:d,form:l,...t,tabIndex:-1,ref:m,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});D.displayName=T;function pe(e){return typeof e=="function"}function k(e){return e==="indeterminate"}function H(e){return k(e)?"indeterminate":e?"checked":"unchecked"}const he=s.forwardRef(({intermediate:e=!1,checkSize:t="default",className:n,...c},r)=>
3p.jsx(_,{ref:r,className:N("peer h-5 w-5 shrink-0 rounded-md border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-flexcar-blue30 data-[state=checked]:bg-flexcar-blue30 data-[state=checked]:text-primary-foreground",n),...c,children:p.jsx(M,{className:N("flex items-center justify-center text-current"),children:e?p.jsx("div",{className:"h-[1.5px] w-[10px] rounded-full bg-white"}):t==="default"?p.jsx(G,{className:"h-5 w-5"}):t==="small"?p.jsx(q,{fillPrimary:U.neutral100,className:"h-4 w-4"}):null})}));he.displayName=_.displayName;export{he as C};
4//# sourceMappingURL=checkbox-TE7pzvAZ.js.map
5
6//# debugId=7483d1ea-b8ff-512c-a999-e3fd44a36ce1

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.