import{r as l,j as c,ae as I,b as M}from"./index-DHiKqTn6.js";function R(e,r=[]){let a=[];function n(u,i){const o=l.createContext(i);o.displayName=u+"Context";const s=a.length;a=[...a,i];const d=p=>{const{scope:m,children:x,...v}=p,j=m?.[e]?.[s]||o,E=l.useMemo(()=>v,Object.values(v));return c.jsx(j.Provider,{value:E,children:x})};d.displayName=u+"Provider";function b(p,m){const x=m?.[e]?.[s]||o,v=l.useContext(x);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${u}\``)}return[d,b]}const t=()=>{const u=a.map(i=>l.createContext(i));return function(o){const s=o?.[e]||u;return l.useMemo(()=>({[`__scope${e}`]:{...o,[e]:s}}),[o,s])}};return t.scopeName=e,[n,V(t,...r)]}function V(...e){const r=e[0];if(e.length===1)return r;const a=()=>{const n=e.map(t=>({useScope:t(),scopeName:t.scopeName}));return function(u){const i=n.reduce((o,{useScope:s,scopeName:d})=>{const p=s(u)[`__scope${d}`];return{...o,...p}},{});return l.useMemo(()=>({[`__scope${r.scopeName}`]:i}),[i])}};return a.scopeName=r.scopeName,a}var A=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$=A.reduce((e,r)=>{const a=I(`Primitive.${r}`),n=l.forwardRef((t,u)=>{const{asChild:i,...o}=t,s=i?a:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(s,{...o,ref:u})});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{}),g="Progress",P=100,[D]=R(g),[O,L]=D(g),S=l.forwardRef((e,r)=>{const{__scopeProgress:a,value:n=null,max:t,getValueLabel:u=T,...i}=e;(t||t===0)&&!N(t)&&console.error(G(`${t}`,"Progress"));const o=N(t)?t:P;n!==null&&!h(n,o)&&console.error(X(`${n}`,"Progress"));const s=h(n,o)?n:null,d=f(s)?u(s,o):void 0;return c.jsx(O,{scope:a,value:s,max:o,children:c.jsx($.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":f(s)?s:void 0,"aria-valuetext":d,role:"progressbar","data-state":C(s,o),"data-value":s??void 0,"data-max":o,...i,ref:r})})});S.displayName=g;var w="ProgressIndicator",y=l.forwardRef((e,r)=>{const{__scopeProgress:a,...n}=e,t=L(w,a);return c.jsx($.div,{"data-state":C(t.value,t.max),"data-value":t.value??void 0,"data-max":t.max,...n,ref:r})});y.displayName=w;function T(e,r){return`${Math.round(e/r*100)}%`}function C(e,r){return e==null?"indeterminate":e===r?"complete":"loading"}function f(e){return typeof e=="number"}function N(e){return f(e)&&!isNaN(e)&&e>0}function h(e,r){return f(e)&&!isNaN(e)&&e<=r&&e>=0}function G(e,r){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${r}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${P}\`.`}function X(e,r){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${r}\`. The \`value\` prop must be:
  - a positive number
  - less than the value passed to \`max\` (or ${P} if no \`max\` prop is set)
  - \`null\` or \`undefined\` if the progress is indeterminate.

Defaulting to \`null\`.`}var _=S,k=y;const B=l.forwardRef(({className:e,value:r,...a},n)=>c.jsx(_,{ref:n,className:M("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:c.jsx(k,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(r||0)}%)`}})}));B.displayName=_.displayName;export{B as P};
