import{s as e}from"./chunk-Bj-mKKzh.js";import{n as t,t as n}from"./jsx-runtime-CiQ1k8xo.js";import{t as r}from"./clsx-BcPLHiun.js";import{lt as i}from"./vscode-api-DjORcpSo.js";import{o as a}from"./lib-MoKmYgcO.js";import{c as o,r as s}from"./statsig-BP9zNYqZ.js";var c={cadencedShimmer:`_cadencedShimmer_1bpr9_1`,cadencedShimmerSweep:`_cadencedShimmerSweep_1bpr9_12`,cadencedShimmerHighlight:`_cadencedShimmerHighlight_1bpr9_35`,cadencedShimmerActive:`_cadencedShimmerActive_1bpr9_44`,cadencedLoadingShimmerSweep:`_cadencedLoadingShimmerSweep_1bpr9_1`,cadencedLoadingShimmerHighlight:`_cadencedLoadingShimmerHighlight_1bpr9_1`},l=i(),u=e(t(),1),d=n(),f=1e3,p=4e3,m=600,h=`cadenced_legacy`;function g(e){let t=(0,l.c)(13),n,r,i,a;if(t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({active:a,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a),!(a===void 0||a)){let e;return t[5]!==n||t[6]!==r||t[7]!==i?(e=(0,d.jsx)(`span`,{className:r,...i,children:n}),t[5]=n,t[6]=r,t[7]=i,t[8]=e):e=t[8],e}let o;return t[9]!==n||t[10]!==r||t[11]!==i?(o=(0,d.jsx)(_,{className:r,...i,children:n}),t[9]=n,t[10]=r,t[11]=i,t[12]=o):o=t[12],o}function _(e){let t=(0,l.c)(21),n,i,a;t[0]===e?(n=t[1],i=t[2],a=t[3]):({className:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a);let g=o(),_=(0,u.useRef)(null),v;if(t[4]!==g){let e=s(g,`1585730870`);v=e.get(`shimmer_variant`,null)===h||e.groupName===h,t[4]=g,t[5]=v}else v=t[5];let y=v,b,x;t[6]===y?(b=t[7],x=t[8]):(b=()=>{if(!y||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=_.current;if(e==null)return;let t,n=()=>{t!=null&&(window.clearTimeout(t),t=void 0)},r=()=>{n(),e.classList.remove(c.cadencedShimmerActive),e.classList.add(c.cadencedShimmerActive),t=window.setTimeout(()=>{e.classList.remove(c.cadencedShimmerActive),t=void 0},f)},i,a=window.setTimeout(()=>{r(),i=window.setInterval(r,p)},m);return()=>{n(),window.clearTimeout(a),i!=null&&window.clearInterval(i),e.classList.remove(c.cadencedShimmerActive)}},x=[y],t[6]=y,t[7]=b,t[8]=x),(0,u.useEffect)(b,x);let S=y?_:void 0,C=y&&c.cadencedShimmer,w;t[9]!==i||t[10]!==C?(w=r(`loading-shimmer-pure-text`,C,i),t[9]=i,t[10]=C,t[11]=w):w=t[11];let T;t[12]!==n||t[13]!==y?(T=y?(0,d.jsx)(`span`,{"aria-hidden":!0,className:c.cadencedShimmerSweep,children:(0,d.jsx)(`span`,{className:c.cadencedShimmerHighlight,children:n})}):null,t[12]=n,t[13]=y,t[14]=T):T=t[14];let E;return t[15]!==n||t[16]!==a||t[17]!==S||t[18]!==w||t[19]!==T?(E=(0,d.jsxs)(`span`,{ref:S,className:w,...a,children:[n,T]}),t[15]=n,t[16]=a,t[17]=S,t[18]=w,t[19]=T,t[20]=E):E=t[20],E}function v(e){let t=(0,l.c)(12),n,i,o;t[0]===e?(n=t[1],i=t[2],o=t[3]):({className:n,message:i,...o}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=o);let s;t[4]===n?s=t[5]:(s=r(`text-size-chat leading-[1.5] select-none truncate`,n),t[4]=n,t[5]=s);let c;t[6]===i?c=t[7]:(c=i??(0,d.jsx)(a,{id:`thinkingShimmer.default`,defaultMessage:`Thinking`,description:`Default placeholder shown while the assistant is thinking`}),t[6]=i,t[7]=c);let u;return t[8]!==o||t[9]!==s||t[10]!==c?(u=(0,d.jsx)(g,{className:s,...o,children:c}),t[8]=o,t[9]=s,t[10]=c,t[11]=u):u=t[11],u}export{v as n,g as t};
//# sourceMappingURL=thinking-shimmer-BLzK6Vzl.js.map