@inf-monkeys-tech/monkeys-design 2.0.229 → 2.0.230
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/workbench/index.js +1 -1
- package/dist/components/workbench/index.js.map +1 -1
- package/dist/components/workbench/index.mjs +1 -1
- package/dist/components/workbench/index.mjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -63,7 +63,7 @@ var xo__namespace = /*#__PURE__*/_interopNamespace(xo);
|
|
|
63
63
|
var Tt__namespace = /*#__PURE__*/_interopNamespace(Tt);
|
|
64
64
|
var Vo__namespace = /*#__PURE__*/_interopNamespace(Vo);
|
|
65
65
|
|
|
66
|
-
var FS=Object.defineProperty;var a=(e,t)=>FS(e,"name",{value:t,configurable:true});var Wr=a((e,t=0,o=1)=>ni(ai(t,e),o),"default");var Na=a(e=>{e._clipped=false,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=true),e[t]=Wr(e[t],0,255)):t===3&&(e[t]=Wr(e[t],0,1));return e},"default");var dg={};for(let e of ["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])dg[`[object ${e}]`]=e.toLowerCase();function Qe(e){return dg[Object.prototype.toString.call(e)]||"object"}a(Qe,"default");var Ue=a((e,t=null)=>e.length>=3?Array.prototype.slice.call(e):Qe(e[0])=="object"&&t?t.split("").filter(o=>e[0][o]!==void 0).map(o=>e[0][o]):e[0],"default");var nn=a(e=>{if(e.length<2)return null;let t=e.length-1;return Qe(e[t])=="string"?e[t].toLowerCase():null},"default");var{PI:ql,min:ni,max:ai}=Math,tr=ql*2,Yl=ql/3,cg=ql/180,ug=180/ql;var Ze={format:{},autodetect:[]};var Ip=class Ip{constructor(...t){let o=this;if(Qe(t[0])==="object"&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];let r=nn(t),n=false;if(!r){n=true,Ze.sorted||(Ze.autodetect=Ze.autodetect.sort((i,s)=>s.p-i.p),Ze.sorted=true);for(let i of Ze.autodetect)if(r=i.test(...t),r)break}if(Ze.format[r]){let i=Ze.format[r].apply(null,n?t:t.slice(0,-1));o._rgb=Na(i);}else throw new Error("unknown format: "+t);o._rgb.length===3&&o._rgb.push(1);}toString(){return Qe(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};a(Ip,"Color");var Mp=Ip,ye=Mp;var pg="2.6.0";var Xl=a((...e)=>new Xl.Color(...e),"chroma");Xl.Color=ye;Xl.version=pg;var ot=Xl;var HS=a((...e)=>{e=Ue(e,"cmyk");let[t,o,r,n]=e,i=e.length>4?e[4]:1;return n===1?[0,0,0,i]:[t>=1?0:255*(1-t)*(1-n),o>=1?0:255*(1-o)*(1-n),r>=1?0:255*(1-r)*(1-n),i]},"cmyk2rgb"),mg=HS;var{max:fg}=Math,VS=a((...e)=>{let[t,o,r]=Ue(e,"rgb");t=t/255,o=o/255,r=r/255;let n=1-fg(t,fg(o,r)),i=n<1?1/(1-n):0,s=(1-t-n)*i,l=(1-o-n)*i,d=(1-r-n)*i;return [s,l,d,n]},"rgb2cmyk"),bg=VS;ye.prototype.cmyk=function(){return bg(this._rgb)};ot.cmyk=(...e)=>new ye(...e,"cmyk");Ze.format.cmyk=mg;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"cmyk"),Qe(e)==="array"&&e.length===4)return "cmyk"},"test")});var Dp=a(e=>Math.round(e*100)/100,"rnd"),_S=a((...e)=>{let t=Ue(e,"hsla"),o=nn(e)||"lsa";return t[0]=Dp(t[0]||0),t[1]=Dp(t[1]*100)+"%",t[2]=Dp(t[2]*100)+"%",o==="hsla"||t.length>3&&t[3]<1?(t[3]=t.length>3?t[3]:1,o="hsla"):t.length=3,`${o}(${t.join(",")})`},"hsl2css"),gg=_S;var GS=a((...e)=>{e=Ue(e,"rgba");let[t,o,r]=e;t/=255,o/=255,r/=255;let n=ni(t,o,r),i=ai(t,o,r),s=(i+n)/2,l,d;return i===n?(l=0,d=Number.NaN):l=s<.5?(i-n)/(i+n):(i-n)/(2-i-n),t==i?d=(o-r)/(i-n):o==i?d=2+(r-t)/(i-n):r==i&&(d=4+(t-o)/(i-n)),d*=60,d<0&&(d+=360),e.length>3&&e[3]!==void 0?[d,l,s,e[3]]:[d,l,s]},"rgb2hsl"),Ql=GS;var{round:Pp}=Math,$S=a((...e)=>{let t=Ue(e,"rgba"),o=nn(e)||"rgb";return o.substr(0,3)=="hsl"?gg(Ql(t),o):(t[0]=Pp(t[0]),t[1]=Pp(t[1]),t[2]=Pp(t[2]),(o==="rgba"||t.length>3&&t[3]<1)&&(t[3]=t.length>3?t[3]:1,o="rgba"),`${o}(${t.slice(0,o==="rgb"?3:4).join(",")})`)},"rgb2css"),hg=$S;var{round:Ep}=Math,jS=a((...e)=>{e=Ue(e,"hsl");let[t,o,r]=e,n,i,s;if(o===0)n=i=s=r*255;else {let l=[0,0,0],d=[0,0,0],c=r<.5?r*(1+o):r+o-r*o,p=2*r-c,u=t/360;l[0]=u+1/3,l[1]=u,l[2]=u-1/3;for(let g=0;g<3;g++)l[g]<0&&(l[g]+=1),l[g]>1&&(l[g]-=1),6*l[g]<1?d[g]=p+(c-p)*6*l[g]:2*l[g]<1?d[g]=c:3*l[g]<2?d[g]=p+(c-p)*(2/3-l[g])*6:d[g]=p;[n,i,s]=[Ep(d[0]*255),Ep(d[1]*255),Ep(d[2]*255)];}return e.length>3?[n,i,s,e[3]]:[n,i,s,1]},"hsl2rgb"),ys=jS;var xg=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,vg=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,wg=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,kg=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Cg=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Sg=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,{round:yg}=Math,Tg=a(e=>{e=e.toLowerCase().trim();let t;if(Ze.format.named)try{return Ze.format.named(e)}catch{}if(t=e.match(xg)){let o=t.slice(1,4);for(let r=0;r<3;r++)o[r]=+o[r];return o[3]=1,o}if(t=e.match(vg)){let o=t.slice(1,5);for(let r=0;r<4;r++)o[r]=+o[r];return o}if(t=e.match(wg)){let o=t.slice(1,4);for(let r=0;r<3;r++)o[r]=yg(o[r]*2.55);return o[3]=1,o}if(t=e.match(kg)){let o=t.slice(1,5);for(let r=0;r<3;r++)o[r]=yg(o[r]*2.55);return o[3]=+o[3],o}if(t=e.match(Cg)){let o=t.slice(1,4);o[1]*=.01,o[2]*=.01;let r=ys(o);return r[3]=1,r}if(t=e.match(Sg)){let o=t.slice(1,4);o[1]*=.01,o[2]*=.01;let r=ys(o);return r[3]=+t[4],r}},"css2rgb");Tg.test=e=>xg.test(e)||vg.test(e)||wg.test(e)||kg.test(e)||Cg.test(e)||Sg.test(e);var Ap=Tg;ye.prototype.css=function(e){return hg(this._rgb,e)};ot.css=(...e)=>new ye(...e,"css");Ze.format.css=Ap;Ze.autodetect.push({p:5,test:a((e,...t)=>{if(!t.length&&Qe(e)==="string"&&Ap.test(e))return "css"},"test")});Ze.format.gl=(...e)=>{let t=Ue(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};ot.gl=(...e)=>new ye(...e,"gl");ye.prototype.gl=function(){let e=this._rgb;return [e[0]/255,e[1]/255,e[2]/255,e[3]]};var{floor:US}=Math,KS=a((...e)=>{e=Ue(e,"hcg");let[t,o,r]=e,n,i,s;r=r*255;let l=o*255;if(o===0)n=i=s=r;else {t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let d=US(t),c=t-d,p=r*(1-o),u=p+l*(1-c),g=p+l*c,f=p+l;switch(d){case 0:[n,i,s]=[f,g,p];break;case 1:[n,i,s]=[u,f,p];break;case 2:[n,i,s]=[p,f,g];break;case 3:[n,i,s]=[p,u,f];break;case 4:[n,i,s]=[g,p,f];break;case 5:[n,i,s]=[f,p,u];break}}return [n,i,s,e.length>3?e[3]:1]},"hcg2rgb"),Ng=KS;var qS=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),n=ni(t,o,r),i=ai(t,o,r),s=i-n,l=s*100/255,d=n/(255-s)*100,c;return s===0?c=Number.NaN:(t===i&&(c=(o-r)/s),o===i&&(c=2+(r-t)/s),r===i&&(c=4+(t-o)/s),c*=60,c<0&&(c+=360)),[c,l,d]},"rgb2hcg"),Rg=qS;ye.prototype.hcg=function(){return Rg(this._rgb)};ot.hcg=(...e)=>new ye(...e,"hcg");Ze.format.hcg=Ng;Ze.autodetect.push({p:1,test:a((...e)=>{if(e=Ue(e,"hcg"),Qe(e)==="array"&&e.length===3)return "hcg"},"test")});var YS=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,XS=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,QS=a(e=>{if(e.match(YS)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let t=parseInt(e,16),o=t>>16,r=t>>8&255,n=t&255;return [o,r,n,1]}if(e.match(XS)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);let t=parseInt(e,16),o=t>>24&255,r=t>>16&255,n=t>>8&255,i=Math.round((t&255)/255*100)/100;return [o,r,n,i]}throw new Error(`unknown hex color: ${e}`)},"hex2rgb"),Zl=QS;var{round:Jl}=Math,ZS=a((...e)=>{let[t,o,r,n]=Ue(e,"rgba"),i=nn(e)||"auto";n===void 0&&(n=1),i==="auto"&&(i=n<1?"rgba":"rgb"),t=Jl(t),o=Jl(o),r=Jl(r);let l="000000"+(t<<16|o<<8|r).toString(16);l=l.substr(l.length-6);let d="0"+Jl(n*255).toString(16);switch(d=d.substr(d.length-2),i.toLowerCase()){case "rgba":return `#${l}${d}`;case "argb":return `#${d}${l}`;default:return `#${l}`}},"rgb2hex"),ed=ZS;ye.prototype.hex=function(e){return ed(this._rgb,e)};ot.hex=(...e)=>new ye(...e,"hex");Ze.format.hex=Zl;Ze.autodetect.push({p:4,test:a((e,...t)=>{if(!t.length&&Qe(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return "hex"},"test")});var{cos:ii}=Math,JS=a((...e)=>{e=Ue(e,"hsi");let[t,o,r]=e,n,i,s;return isNaN(t)&&(t=0),isNaN(o)&&(o=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(s=(1-o)/3,n=(1+o*ii(tr*t)/ii(Yl-tr*t))/3,i=1-(s+n)):t<2/3?(t-=1/3,n=(1-o)/3,i=(1+o*ii(tr*t)/ii(Yl-tr*t))/3,s=1-(n+i)):(t-=2/3,i=(1-o)/3,s=(1+o*ii(tr*t)/ii(Yl-tr*t))/3,n=1-(i+s)),n=Wr(r*n*3),i=Wr(r*i*3),s=Wr(r*s*3),[n*255,i*255,s*255,e.length>3?e[3]:1]},"hsi2rgb"),Mg=JS;var{min:e1,sqrt:t1,acos:o1}=Math,r1=a((...e)=>{let[t,o,r]=Ue(e,"rgb");t/=255,o/=255,r/=255;let n,i=e1(t,o,r),s=(t+o+r)/3,l=s>0?1-i/s:0;return l===0?n=NaN:(n=(t-o+(t-r))/2,n/=t1((t-o)*(t-o)+(t-r)*(o-r)),n=o1(n),r>o&&(n=tr-n),n/=tr),[n*360,l,s]},"rgb2hsi"),Ig=r1;ye.prototype.hsi=function(){return Ig(this._rgb)};ot.hsi=(...e)=>new ye(...e,"hsi");Ze.format.hsi=Mg;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"hsi"),Qe(e)==="array"&&e.length===3)return "hsi"},"test")});ye.prototype.hsl=function(){return Ql(this._rgb)};ot.hsl=(...e)=>new ye(...e,"hsl");Ze.format.hsl=ys;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"hsl"),Qe(e)==="array"&&e.length===3)return "hsl"},"test")});var{floor:n1}=Math,a1=a((...e)=>{e=Ue(e,"hsv");let[t,o,r]=e,n,i,s;if(r*=255,o===0)n=i=s=r;else {t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let l=n1(t),d=t-l,c=r*(1-o),p=r*(1-o*d),u=r*(1-o*(1-d));switch(l){case 0:[n,i,s]=[r,u,c];break;case 1:[n,i,s]=[p,r,c];break;case 2:[n,i,s]=[c,r,u];break;case 3:[n,i,s]=[c,p,r];break;case 4:[n,i,s]=[u,c,r];break;case 5:[n,i,s]=[r,c,p];break}}return [n,i,s,e.length>3?e[3]:1]},"hsv2rgb"),Dg=a1;var{min:i1,max:s1}=Math,l1=a((...e)=>{e=Ue(e,"rgb");let[t,o,r]=e,n=i1(t,o,r),i=s1(t,o,r),s=i-n,l,d,c;return c=i/255,i===0?(l=Number.NaN,d=0):(d=s/i,t===i&&(l=(o-r)/s),o===i&&(l=2+(r-t)/s),r===i&&(l=4+(t-o)/s),l*=60,l<0&&(l+=360)),[l,d,c]},"rgb2hsl"),Pg=l1;ye.prototype.hsv=function(){return Pg(this._rgb)};ot.hsv=(...e)=>new ye(...e,"hsv");Ze.format.hsv=Dg;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"hsv"),Qe(e)==="array"&&e.length===3)return "hsv"},"test")});var ao={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452};var{pow:d1}=Math,c1=a((...e)=>{e=Ue(e,"lab");let[t,o,r]=e,n,i,s,l,d,c;return i=(t+16)/116,n=isNaN(o)?i:i+o/500,s=isNaN(r)?i:i-r/200,i=ao.Yn*Lp(i),n=ao.Xn*Lp(n),s=ao.Zn*Lp(s),l=Bp(3.2404542*n-1.5371385*i-.4985314*s),d=Bp(-0.969266*n+1.8760108*i+.041556*s),c=Bp(.0556434*n-.2040259*i+1.0572252*s),[l,d,c,e.length>3?e[3]:1]},"lab2rgb"),Bp=a(e=>255*(e<=.00304?12.92*e:1.055*d1(e,1/2.4)-.055),"xyz_rgb"),Lp=a(e=>e>ao.t1?e*e*e:ao.t2*(e-ao.t0),"lab_xyz"),td=c1;var{pow:Eg}=Math,u1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=p1(t,o,r),l=116*i-16;return [l<0?0:l,500*(n-i),200*(i-s)]},"rgb2lab"),Wp=a(e=>(e/=255)<=.04045?e/12.92:Eg((e+.055)/1.055,2.4),"rgb_xyz"),zp=a(e=>e>ao.t3?Eg(e,1/3):e/ao.t2+ao.t0,"xyz_lab"),p1=a((e,t,o)=>{e=Wp(e),t=Wp(t),o=Wp(o);let r=zp((.4124564*e+.3575761*t+.1804375*o)/ao.Xn),n=zp((.2126729*e+.7151522*t+.072175*o)/ao.Yn),i=zp((.0193339*e+.119192*t+.9503041*o)/ao.Zn);return [r,n,i]},"rgb2xyz"),od=u1;ye.prototype.lab=function(){return od(this._rgb)};ot.lab=(...e)=>new ye(...e,"lab");Ze.format.lab=td;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"lab"),Qe(e)==="array"&&e.length===3)return "lab"},"test")});var{sin:m1,cos:f1}=Math,b1=a((...e)=>{let[t,o,r]=Ue(e,"lch");return isNaN(r)&&(r=0),r=r*cg,[t,f1(r)*o,m1(r)*o]},"lch2lab"),rd=b1;var g1=a((...e)=>{e=Ue(e,"lch");let[t,o,r]=e,[n,i,s]=rd(t,o,r),[l,d,c]=td(n,i,s);return [l,d,c,e.length>3?e[3]:1]},"lch2rgb"),nd=g1;var h1=a((...e)=>{let t=Ue(e,"hcl").reverse();return nd(...t)},"hcl2rgb"),Ag=h1;var{sqrt:y1,atan2:x1,round:v1}=Math,w1=a((...e)=>{let[t,o,r]=Ue(e,"lab"),n=y1(o*o+r*r),i=(x1(r,o)*ug+360)%360;return v1(n*1e4)===0&&(i=Number.NaN),[t,n,i]},"lab2lch"),ad=w1;var k1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=od(t,o,r);return ad(n,i,s)},"rgb2lch"),Op=k1;ye.prototype.lch=function(){return Op(this._rgb)};ye.prototype.hcl=function(){return Op(this._rgb).reverse()};ot.lch=(...e)=>new ye(...e,"lch");ot.hcl=(...e)=>new ye(...e,"hcl");Ze.format.lch=nd;Ze.format.hcl=Ag;["lch","hcl"].forEach(e=>Ze.autodetect.push({p:2,test:a((...t)=>{if(t=Ue(t,e),Qe(t)==="array"&&t.length===3)return e},"test")}));var C1={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Bn=C1;ye.prototype.name=function(){let e=ed(this._rgb,"rgb");for(let t of Object.keys(Bn))if(Bn[t]===e)return t.toLowerCase();return e};Ze.format.named=e=>{if(e=e.toLowerCase(),Bn[e])return Zl(Bn[e]);throw new Error("unknown color name: "+e)};Ze.autodetect.push({p:5,test:a((e,...t)=>{if(!t.length&&Qe(e)==="string"&&Bn[e.toLowerCase()])return "named"},"test")});var S1=a(e=>{if(Qe(e)=="number"&&e>=0&&e<=16777215){let t=e>>16,o=e>>8&255,r=e&255;return [t,o,r,1]}throw new Error("unknown num color: "+e)},"num2rgb"),Bg=S1;var T1=a((...e)=>{let[t,o,r]=Ue(e,"rgb");return (t<<16)+(o<<8)+r},"rgb2num"),Lg=T1;ye.prototype.num=function(){return Lg(this._rgb)};ot.num=(...e)=>new ye(...e,"num");Ze.format.num=Bg;Ze.autodetect.push({p:5,test:a((...e)=>{if(e.length===1&&Qe(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return "num"},"test")});var{round:Wg}=Math;ye.prototype.rgb=function(e=true){return e===false?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Wg)};ye.prototype.rgba=function(e=true){return this._rgb.slice(0,4).map((t,o)=>o<3?e===false?t:Wg(t):t)};ot.rgb=(...e)=>new ye(...e,"rgb");Ze.format.rgb=(...e)=>{let t=Ue(e,"rgba");return t[3]===void 0&&(t[3]=1),t};Ze.autodetect.push({p:3,test:a((...e)=>{if(e=Ue(e,"rgba"),Qe(e)==="array"&&(e.length===3||e.length===4&&Qe(e[3])=="number"&&e[3]>=0&&e[3]<=1))return "rgb"},"test")});var{log:id}=Math,N1=a(e=>{let t=e/100,o,r,n;return t<66?(o=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*id(r),n=t<20?0:-254.76935184120902+.8274096064007395*(n=t-10)+115.67994401066147*id(n)):(o=351.97690566805693+.114206453784165*(o=t-55)-40.25366309332127*id(o),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*id(r),n=255),[o,r,n,1]},"temperature2rgb"),sd=N1;var{round:R1}=Math,M1=a((...e)=>{let t=Ue(e,"rgb"),o=t[0],r=t[2],n=1e3,i=4e4,s=.4,l;for(;i-n>s;){l=(i+n)*.5;let d=sd(l);d[2]/d[0]>=r/o?i=l:n=l;}return R1(l)},"rgb2temperature"),zg=M1;ye.prototype.temp=ye.prototype.kelvin=ye.prototype.temperature=function(){return zg(this._rgb)};ot.temp=ot.kelvin=ot.temperature=(...e)=>new ye(...e,"temp");Ze.format.temp=Ze.format.kelvin=Ze.format.temperature=sd;var{pow:ld,sign:I1}=Math,D1=a((...e)=>{e=Ue(e,"lab");let[t,o,r]=e,n=ld(t+.3963377774*o+.2158037573*r,3),i=ld(t-.1055613458*o-.0638541728*r,3),s=ld(t-.0894841775*o-1.291485548*r,3);return [255*Fp(4.0767416621*n-3.3077115913*i+.2309699292*s),255*Fp(-1.2684380046*n+2.6097574011*i-.3413193965*s),255*Fp(-0.0041960863*n-.7034186147*i+1.707614701*s),e.length>3?e[3]:1]},"oklab2rgb"),dd=D1;function Fp(e){let t=Math.abs(e);return t>.0031308?(I1(e)||1)*(1.055*ld(t,1/2.4)-.055):e*12.92}a(Fp,"lrgb2rgb");var{cbrt:Hp,pow:P1,sign:E1}=Math,A1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=[Vp(t/255),Vp(o/255),Vp(r/255)],l=Hp(.4122214708*n+.5363325363*i+.0514459929*s),d=Hp(.2119034982*n+.6806995451*i+.1073969566*s),c=Hp(.0883024619*n+.2817188376*i+.6299787005*s);return [.2104542553*l+.793617785*d-.0040720468*c,1.9779984951*l-2.428592205*d+.4505937099*c,.0259040371*l+.7827717662*d-.808675766*c]},"rgb2oklab"),cd=A1;function Vp(e){let t=Math.abs(e);return t<.04045?e/12.92:(E1(e)||1)*P1((t+.055)/1.055,2.4)}a(Vp,"rgb2lrgb");ye.prototype.oklab=function(){return cd(this._rgb)};ot.oklab=(...e)=>new ye(...e,"oklab");Ze.format.oklab=dd;Ze.autodetect.push({p:3,test:a((...e)=>{if(e=Ue(e,"oklab"),Qe(e)==="array"&&e.length===3)return "oklab"},"test")});var B1=a((...e)=>{e=Ue(e,"lch");let[t,o,r]=e,[n,i,s]=rd(t,o,r),[l,d,c]=dd(n,i,s);return [l,d,c,e.length>3?e[3]:1]},"oklch2rgb"),Og=B1;var L1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=cd(t,o,r);return ad(n,i,s)},"rgb2oklch"),Fg=L1;ye.prototype.oklch=function(){return Fg(this._rgb)};ot.oklch=(...e)=>new ye(...e,"oklch");Ze.format.oklch=Og;Ze.autodetect.push({p:3,test:a((...e)=>{if(e=Ue(e,"oklch"),Qe(e)==="array"&&e.length===3)return "oklch"},"test")});ye.prototype.alpha=function(e,t=false){return e!==void 0&&Qe(e)==="number"?t?(this._rgb[3]=e,this):new ye([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]};ye.prototype.clipped=function(){return this._rgb._clipped||false};ye.prototype.darken=function(e=1){let t=this,o=t.lab();return o[0]-=ao.Kn*e,new ye(o,"lab").alpha(t.alpha(),true)};ye.prototype.brighten=function(e=1){return this.darken(-e)};ye.prototype.darker=ye.prototype.darken;ye.prototype.brighter=ye.prototype.brighten;ye.prototype.get=function(e){let[t,o]=e.split("."),r=this[t]();if(o){let n=t.indexOf(o)-(t.substr(0,2)==="ok"?2:0);if(n>-1)return r[n];throw new Error(`unknown channel ${o} in mode ${t}`)}else return r};var{pow:W1}=Math,z1=1e-7,O1=20;ye.prototype.luminance=function(e,t="rgb"){if(e!==void 0&&Qe(e)==="number"){if(e===0)return new ye([0,0,0,this._rgb[3]],"rgb");if(e===1)return new ye([255,255,255,this._rgb[3]],"rgb");let o=this.luminance(),r=O1,n=a((s,l)=>{let d=s.interpolate(l,.5,t),c=d.luminance();return Math.abs(e-c)<z1||!r--?d:c>e?n(s,d):n(d,l)},"test"),i=(o>e?n(new ye([0,0,0]),this):n(this,new ye([255,255,255]))).rgb();return new ye([...i,this._rgb[3]])}return F1(...this._rgb.slice(0,3))};var F1=a((e,t,o)=>(e=_p(e),t=_p(t),o=_p(o),.2126*e+.7152*t+.0722*o),"rgb2luminance"),_p=a(e=>(e/=255,e<=.03928?e/12.92:W1((e+.055)/1.055,2.4)),"luminance_x");var Pt={};var Ln=a((e,t,o=.5,...r)=>{let n=r[0]||"lrgb";if(!Pt[n]&&!r.length&&(n=Object.keys(Pt)[0]),!Pt[n])throw new Error(`interpolation mode ${n} is not defined`);return Qe(e)!=="object"&&(e=new ye(e)),Qe(t)!=="object"&&(t=new ye(t)),Pt[n](e,t,o).alpha(e.alpha()+o*(t.alpha()-e.alpha()))},"default");ye.prototype.mix=ye.prototype.interpolate=function(e,t=.5,...o){return Ln(this,e,t,...o)};ye.prototype.premultiply=function(e=false){let t=this._rgb,o=t[3];return e?(this._rgb=[t[0]*o,t[1]*o,t[2]*o,o],this):new ye([t[0]*o,t[1]*o,t[2]*o,o],"rgb")};ye.prototype.saturate=function(e=1){let t=this,o=t.lch();return o[1]+=ao.Kn*e,o[1]<0&&(o[1]=0),new ye(o,"lch").alpha(t.alpha(),true)};ye.prototype.desaturate=function(e=1){return this.saturate(-e)};ye.prototype.set=function(e,t,o=false){let[r,n]=e.split("."),i=this[r]();if(n){let s=r.indexOf(n)-(r.substr(0,2)==="ok"?2:0);if(s>-1){if(Qe(t)=="string")switch(t.charAt(0)){case "+":i[s]+=+t;break;case "-":i[s]+=+t;break;case "*":i[s]*=+t.substr(1);break;case "/":i[s]/=+t.substr(1);break;default:i[s]=+t;}else if(Qe(t)==="number")i[s]=t;else throw new Error("unsupported value for Color.set");let l=new ye(i,r);return o?(this._rgb=l._rgb,this):l}throw new Error(`unknown channel ${n} in mode ${r}`)}else return i};ye.prototype.tint=function(e=.5,...t){return Ln(this,"white",e,...t)};ye.prototype.shade=function(e=.5,...t){return Ln(this,"black",e,...t)};var H1=a((e,t,o)=>{let r=e._rgb,n=t._rgb;return new ye(r[0]+o*(n[0]-r[0]),r[1]+o*(n[1]-r[1]),r[2]+o*(n[2]-r[2]),"rgb")},"rgb");Pt.rgb=H1;var{sqrt:Gp,pow:si}=Math,V1=a((e,t,o)=>{let[r,n,i]=e._rgb,[s,l,d]=t._rgb;return new ye(Gp(si(r,2)*(1-o)+si(s,2)*o),Gp(si(n,2)*(1-o)+si(l,2)*o),Gp(si(i,2)*(1-o)+si(d,2)*o),"rgb")},"lrgb");Pt.lrgb=V1;var _1=a((e,t,o)=>{let r=e.lab(),n=t.lab();return new ye(r[0]+o*(n[0]-r[0]),r[1]+o*(n[1]-r[1]),r[2]+o*(n[2]-r[2]),"lab")},"lab");Pt.lab=_1;var or=a((e,t,o,r)=>{let n,i;r==="hsl"?(n=e.hsl(),i=t.hsl()):r==="hsv"?(n=e.hsv(),i=t.hsv()):r==="hcg"?(n=e.hcg(),i=t.hcg()):r==="hsi"?(n=e.hsi(),i=t.hsi()):r==="lch"||r==="hcl"?(r="hcl",n=e.hcl(),i=t.hcl()):r==="oklch"&&(n=e.oklch().reverse(),i=t.oklch().reverse());let s,l,d,c,p,u;(r.substr(0,1)==="h"||r==="oklch")&&([s,d,p]=n,[l,c,u]=i);let g,f,b,x;return !isNaN(s)&&!isNaN(l)?(l>s&&l-s>180?x=l-(s+360):l<s&&s-l>180?x=l+360-s:x=l-s,f=s+o*x):isNaN(s)?isNaN(l)?f=Number.NaN:(f=l,(p==1||p==0)&&r!="hsv"&&(g=c)):(f=s,(u==1||u==0)&&r!="hsv"&&(g=d)),g===void 0&&(g=d+o*(c-d)),b=p+o*(u-p),r==="oklch"?new ye([b,g,f],r):new ye([f,g,b],r)},"default");var Hg=a((e,t,o)=>or(e,t,o,"lch"),"lch");Pt.lch=Hg;Pt.hcl=Hg;var G1=a((e,t,o)=>{let r=e.num(),n=t.num();return new ye(r+o*(n-r),"num")},"num");Pt.num=G1;var $1=a((e,t,o)=>or(e,t,o,"hcg"),"hcg");Pt.hcg=$1;var j1=a((e,t,o)=>or(e,t,o,"hsi"),"hsi");Pt.hsi=j1;var U1=a((e,t,o)=>or(e,t,o,"hsl"),"hsl");Pt.hsl=U1;var K1=a((e,t,o)=>or(e,t,o,"hsv"),"hsv");Pt.hsv=K1;var q1=a((e,t,o)=>{let r=e.oklab(),n=t.oklab();return new ye(r[0]+o*(n[0]-r[0]),r[1]+o*(n[1]-r[1]),r[2]+o*(n[2]-r[2]),"oklab")},"oklab");Pt.oklab=q1;var Y1=a((e,t,o)=>or(e,t,o,"oklch"),"oklch");Pt.oklch=Y1;var{pow:$p,sqrt:jp,PI:Up,cos:Vg,sin:_g,atan2:X1}=Math,Gg=a((e,t="lrgb",o=null)=>{let r=e.length;o||(o=Array.from(new Array(r)).map(()=>1));let n=r/o.reduce(function(u,g){return u+g});if(o.forEach((u,g)=>{o[g]*=n;}),e=e.map(u=>new ye(u)),t==="lrgb")return Q1(e,o);let i=e.shift(),s=i.get(t),l=[],d=0,c=0;for(let u=0;u<s.length;u++)if(s[u]=(s[u]||0)*o[0],l.push(isNaN(s[u])?0:o[0]),t.charAt(u)==="h"&&!isNaN(s[u])){let g=s[u]/180*Up;d+=Vg(g)*o[0],c+=_g(g)*o[0];}let p=i.alpha()*o[0];e.forEach((u,g)=>{let f=u.get(t);p+=u.alpha()*o[g+1];for(let b=0;b<s.length;b++)if(!isNaN(f[b]))if(l[b]+=o[g+1],t.charAt(b)==="h"){let x=f[b]/180*Up;d+=Vg(x)*o[g+1],c+=_g(x)*o[g+1];}else s[b]+=f[b]*o[g+1];});for(let u=0;u<s.length;u++)if(t.charAt(u)==="h"){let g=X1(c/l[u],d/l[u])/Up*180;for(;g<0;)g+=360;for(;g>=360;)g-=360;s[u]=g;}else s[u]=s[u]/l[u];return p/=r,new ye(s,t).alpha(p>.99999?1:p,true)},"default"),Q1=a((e,t)=>{let o=e.length,r=[0,0,0,0];for(let n=0;n<e.length;n++){let i=e[n],s=t[n]/o,l=i._rgb;r[0]+=$p(l[0],2)*s,r[1]+=$p(l[1],2)*s,r[2]+=$p(l[2],2)*s,r[3]+=l[3]*s;}return r[0]=jp(r[0]),r[1]=jp(r[1]),r[2]=jp(r[2]),r[3]>.9999999&&(r[3]=1),new ye(Na(r))},"_average_lrgb");var{pow:Z1}=Math;function Wn(e){let t="rgb",o=ot("#ccc"),r=0,n=[0,1],i=[],s=[0,0],l=false,d=[],c=false,p=0,u=1,g=false,f={},b=true,x=1,y=a(function(C){if(C=C||["#fff","#000"],C&&Qe(C)==="string"&&ot.brewer&&ot.brewer[C.toLowerCase()]&&(C=ot.brewer[C.toLowerCase()]),Qe(C)==="array"){C.length===1&&(C=[C[0],C[0]]),C=C.slice(0);for(let R=0;R<C.length;R++)C[R]=ot(C[R]);i.length=0;for(let R=0;R<C.length;R++)i.push(R/(C.length-1));}return S(),d=C},"setColors"),k=a(function(C){if(l!=null){let R=l.length-1,M=0;for(;M<R&&C>=l[M];)M++;return M-1}return 0},"getClass"),w=a(C=>C,"tMapLightness"),v=a(C=>C,"tMapDomain"),h=a(function(C,R){let M,I;if(R==null&&(R=false),isNaN(C)||C===null)return o;R?I=C:l&&l.length>2?I=k(C)/(l.length-2):u!==p?I=(C-p)/(u-p):I=1,I=v(I),R||(I=w(I)),x!==1&&(I=Z1(I,x)),I=s[0]+I*(1-s[0]-s[1]),I=Wr(I,0,1);let A=Math.floor(I*1e4);if(b&&f[A])M=f[A];else {if(Qe(d)==="array")for(let N=0;N<i.length;N++){let D=i[N];if(I<=D){M=d[N];break}if(I>=D&&N===i.length-1){M=d[N];break}if(I>D&&I<i[N+1]){I=(I-D)/(i[N+1]-D),M=ot.interpolate(d[N],d[N+1],I,t);break}}else Qe(d)==="function"&&(M=d(I));b&&(f[A]=M);}return M},"getColor");var S=a(()=>f={},"resetCache");y(e);let T=a(function(C){let R=ot(h(C));return c&&R[c]?R[c]():R},"f");return T.classes=function(C){if(C!=null){if(Qe(C)==="array")l=C,n=[C[0],C[C.length-1]];else {let R=ot.analyze(n);C===0?l=[R.min,R.max]:l=ot.limits(R,"e",C);}return T}return l},T.domain=function(C){if(!arguments.length)return n;p=C[0],u=C[C.length-1],i=[];let R=d.length;if(C.length===R&&p!==u)for(let M of Array.from(C))i.push((M-p)/(u-p));else {for(let M=0;M<R;M++)i.push(M/(R-1));if(C.length>2){let M=C.map((A,N)=>N/(C.length-1)),I=C.map(A=>(A-p)/(u-p));I.every((A,N)=>M[N]===A)||(v=a(A=>{if(A<=0||A>=1)return A;let N=0;for(;A>=I[N+1];)N++;let D=(A-I[N])/(I[N+1]-I[N]);return M[N]+D*(M[N+1]-M[N])},"tMapDomain"));}}return n=[p,u],T},T.mode=function(C){return arguments.length?(t=C,S(),T):t},T.range=function(C,R){return y(C,R),T},T.out=function(C){return c=C,T},T.spread=function(C){return arguments.length?(r=C,T):r},T.correctLightness=function(C){return C==null&&(C=true),g=C,S(),g?w=a(function(R){let M=h(0,true).lab()[0],I=h(1,true).lab()[0],A=M>I,N=h(R,true).lab()[0],D=M+(I-M)*R,E=N-D,P=0,W=1,H=20;for(;Math.abs(E)>.01&&H-- >0;)(function(){return A&&(E*=-1),E<0?(P=R,R+=(W-R)*.5):(W=R,R+=(P-R)*.5),N=h(R,true).lab()[0],E=N-D})();return R},"tMapLightness"):w=a(R=>R,"tMapLightness"),T},T.padding=function(C){return C!=null?(Qe(C)==="number"&&(C=[C,C]),s=C,T):s},T.colors=function(C,R){arguments.length<2&&(R="hex");let M=[];if(arguments.length===0)M=d.slice(0);else if(C===1)M=[T(.5)];else if(C>1){let I=n[0],A=n[1]-I;M=J1(0,C,false).map(N=>T(I+N/(C-1)*A));}else {e=[];let I=[];if(l&&l.length>2)for(let A=1,N=l.length,D=1<=N;D?A<N:A>N;D?A++:A--)I.push((l[A-1]+l[A])*.5);else I=n;M=I.map(A=>T(A));}return ot[R]&&(M=M.map(I=>I[R]())),M},T.cache=function(C){return C!=null?(b=C,T):b},T.gamma=function(C){return C!=null?(x=C,T):x},T.nodata=function(C){return C!=null?(o=ot(C),T):o},T}a(Wn,"default");function J1(e,t,o){let r=[],n=e<t,i=o?n?t+1:t-1:t;for(let s=e;n?s<i:s>i;n?s++:s--)r.push(s);return r}a(J1,"__range__");var eT=a(function(e){let t=[1,1];for(let o=1;o<e;o++){let r=[1];for(let n=1;n<=t.length;n++)r[n]=(t[n]||0)+t[n-1];t=r;}return t},"binom_row"),tT=a(function(e){let t,o,r,n;if(e=e.map(i=>new ye(i)),e.length===2)[o,r]=e.map(i=>i.lab()),t=a(function(i){let s=[0,1,2].map(l=>o[l]+i*(r[l]-o[l]));return new ye(s,"lab")},"I");else if(e.length===3)[o,r,n]=e.map(i=>i.lab()),t=a(function(i){let s=[0,1,2].map(l=>(1-i)*(1-i)*o[l]+2*(1-i)*i*r[l]+i*i*n[l]);return new ye(s,"lab")},"I");else if(e.length===4){let i;[o,r,n,i]=e.map(s=>s.lab()),t=a(function(s){let l=[0,1,2].map(d=>(1-s)*(1-s)*(1-s)*o[d]+3*(1-s)*(1-s)*s*r[d]+3*(1-s)*s*s*n[d]+s*s*s*i[d]);return new ye(l,"lab")},"I");}else if(e.length>=5){let i,s,l;i=e.map(d=>d.lab()),l=e.length-1,s=eT(l),t=a(function(d){let c=1-d,p=[0,1,2].map(u=>i.reduce((g,f,b)=>g+s[b]*c**(l-b)*d**b*f[u],0));return new ye(p,"lab")},"I");}else throw new RangeError("No point in running bezier with only one color.");return t},"bezier"),$g=a(e=>{let t=tT(e);return t.scale=()=>Wn(t),t},"default");var yr=a((e,t,o)=>{if(!yr[o])throw new Error("unknown blend mode "+o);return yr[o](e,t)},"blend"),zn=a(e=>(t,o)=>{let r=ot(o).rgb(),n=ot(t).rgb();return ot.rgb(e(r,n))},"blend_f"),On=a(e=>(t,o)=>{let r=[];return r[0]=e(t[0],o[0]),r[1]=e(t[1],o[1]),r[2]=e(t[2],o[2]),r},"each"),oT=a(e=>e,"normal"),rT=a((e,t)=>e*t/255,"multiply"),nT=a((e,t)=>e>t?t:e,"darken"),aT=a((e,t)=>e>t?e:t,"lighten"),iT=a((e,t)=>255*(1-(1-e/255)*(1-t/255)),"screen"),sT=a((e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),"overlay"),lT=a((e,t)=>255*(1-(1-t/255)/(e/255)),"burn"),dT=a((e,t)=>e===255?255:(e=255*(t/255)/(1-e/255),e>255?255:e),"dodge");yr.normal=zn(On(oT));yr.multiply=zn(On(rT));yr.screen=zn(On(iT));yr.overlay=zn(On(sT));yr.darken=zn(On(nT));yr.lighten=zn(On(aT));yr.dodge=zn(On(dT));yr.burn=zn(On(lT));var jg=yr;var{pow:cT,sin:uT,cos:pT}=Math;function Kp(e=300,t=-1.5,o=1,r=1,n=[0,1]){let i=0,s;Qe(n)==="array"?s=n[1]-n[0]:(s=0,n=[n,n]);let l=a(function(d){let c=tr*((e+120)/360+t*d),p=cT(n[0]+s*d,r),g=(i!==0?o[0]+d*i:o)*p*(1-p)/2,f=pT(c),b=uT(c),x=p+g*(-0.14861*f+1.78277*b),y=p+g*(-0.29227*f-.90649*b),k=p+g*(1.97294*f);return ot(Na([x*255,y*255,k*255,1]))},"f");return l.start=function(d){return d==null?e:(e=d,l)},l.rotations=function(d){return d==null?t:(t=d,l)},l.gamma=function(d){return d==null?r:(r=d,l)},l.hue=function(d){return d==null?o:(o=d,Qe(o)==="array"?(i=o[1]-o[0],i===0&&(o=o[1])):i=0,l)},l.lightness=function(d){return d==null?n:(Qe(d)==="array"?(n=d,s=d[1]-d[0]):(n=[d,d],s=0),l)},l.scale=()=>ot.scale(l),l.hue(o),l}a(Kp,"default");var mT="0123456789abcdef",{floor:fT,random:bT}=Math,Ug=a(()=>{let e="#";for(let t=0;t<6;t++)e+=mT.charAt(fT(bT()*16));return new ye(e,"hex")},"default");var{log:Kg,pow:gT,floor:hT,abs:yT}=Math;function qp(e,t=null){let o={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Qe(e)==="object"&&(e=Object.values(e)),e.forEach(r=>{t&&Qe(r)==="object"&&(r=r[t]),r!=null&&!isNaN(r)&&(o.values.push(r),o.sum+=r,r<o.min&&(o.min=r),r>o.max&&(o.max=r),o.count+=1);}),o.domain=[o.min,o.max],o.limits=(r,n)=>Yp(o,r,n),o}a(qp,"analyze");function Yp(e,t="equal",o=7){Qe(e)=="array"&&(e=qp(e));let{min:r,max:n}=e,i=e.values.sort((l,d)=>l-d);if(o===1)return [r,n];let s=[];if(t.substr(0,1)==="c"&&(s.push(r),s.push(n)),t.substr(0,1)==="e"){s.push(r);for(let l=1;l<o;l++)s.push(r+l/o*(n-r));s.push(n);}else if(t.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");let l=Math.LOG10E*Kg(r),d=Math.LOG10E*Kg(n);s.push(r);for(let c=1;c<o;c++)s.push(gT(10,l+c/o*(d-l)));s.push(n);}else if(t.substr(0,1)==="q"){s.push(r);for(let l=1;l<o;l++){let d=(i.length-1)*l/o,c=hT(d);if(c===d)s.push(i[c]);else {let p=d-c;s.push(i[c]*(1-p)+i[c+1]*p);}}s.push(n);}else if(t.substr(0,1)==="k"){let l,d=i.length,c=new Array(d),p=new Array(o),u=true,g=0,f=null;f=[],f.push(r);for(let y=1;y<o;y++)f.push(r+y/o*(n-r));for(f.push(n);u;){for(let k=0;k<o;k++)p[k]=0;for(let k=0;k<d;k++){let w=i[k],v=Number.MAX_VALUE,h;for(let S=0;S<o;S++){let T=yT(f[S]-w);T<v&&(v=T,h=S),p[h]++,c[k]=h;}}let y=new Array(o);for(let k=0;k<o;k++)y[k]=null;for(let k=0;k<d;k++)l=c[k],y[l]===null?y[l]=i[k]:y[l]+=i[k];for(let k=0;k<o;k++)y[k]*=1/p[k];u=false;for(let k=0;k<o;k++)if(y[k]!==f[k]){u=true;break}f=y,g++,g>200&&(u=false);}let b={};for(let y=0;y<o;y++)b[y]=[];for(let y=0;y<d;y++)l=c[y],b[l].push(i[y]);let x=[];for(let y=0;y<o;y++)x.push(b[y][0]),x.push(b[y][b[y].length-1]);x=x.sort((y,k)=>y-k),s.push(x[0]);for(let y=1;y<x.length;y+=2){let k=x[y];!isNaN(k)&&s.indexOf(k)===-1&&s.push(k);}}return s}a(Yp,"limits");var qg=a((e,t)=>{e=new ye(e),t=new ye(t);let o=e.luminance(),r=t.luminance();return o>r?(o+.05)/(r+.05):(r+.05)/(o+.05)},"default");var{sqrt:an,pow:eo,min:xT,max:vT,atan2:Yg,abs:Xg,cos:ud,sin:Qg,exp:wT,PI:Zg}=Math;function Xp(e,t,o=1,r=1,n=1){var i=a(function(G){return 360*G/(2*Zg)},"rad2deg"),s=a(function(G){return 2*Zg*G/360},"deg2rad");e=new ye(e),t=new ye(t);let[l,d,c]=Array.from(e.lab()),[p,u,g]=Array.from(t.lab()),f=(l+p)/2,b=an(eo(d,2)+eo(c,2)),x=an(eo(u,2)+eo(g,2)),y=(b+x)/2,k=.5*(1-an(eo(y,7)/(eo(y,7)+eo(25,7)))),w=d*(1+k),v=u*(1+k),h=an(eo(w,2)+eo(c,2)),S=an(eo(v,2)+eo(g,2)),T=(h+S)/2,C=i(Yg(c,w)),R=i(Yg(g,v)),M=C>=0?C:C+360,I=R>=0?R:R+360,A=Xg(M-I)>180?(M+I+360)/2:(M+I)/2,N=1-.17*ud(s(A-30))+.24*ud(s(2*A))+.32*ud(s(3*A+6))-.2*ud(s(4*A-63)),D=I-M;D=Xg(D)<=180?D:I<=M?D+360:D-360,D=2*an(h*S)*Qg(s(D)/2);let E=p-l,P=S-h,W=1+.015*eo(f-50,2)/an(20+eo(f-50,2)),H=1+.045*T,B=1+.015*T*N,L=30*wT(-eo((A-275)/25,2)),_=-(2*an(eo(T,7)/(eo(T,7)+eo(25,7))))*Qg(2*s(L)),$=an(eo(E/(o*W),2)+eo(P/(r*H),2)+eo(D/(n*B),2)+_*(P/(r*H))*(D/(n*B)));return vT(0,xT(100,$))}a(Xp,"default");function Qp(e,t,o="lab"){e=new ye(e),t=new ye(t);let r=e.get(o),n=t.get(o),i=0;for(let s in r){let l=(r[s]||0)-(n[s]||0);i+=l*l;}return Math.sqrt(i)}a(Qp,"default");var Jg=a((...e)=>{try{return new ye(...e),!0}catch{return false}},"default");var eh={cool(){return Wn([ot.hsl(180,1,.9),ot.hsl(250,.7,.4)])},hot(){return Wn(["#000","#f00","#ff0","#fff"]).mode("rgb")}};var pd={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]};for(let e of Object.keys(pd))pd[e.toLowerCase()]=pd[e];var th=pd;Object.assign(ot,{average:Gg,bezier:$g,blend:jg,cubehelix:Kp,mix:Ln,interpolate:Ln,random:Ug,scale:Wn,analyze:qp,contrast:qg,deltaE:Xp,distance:Qp,limits:Yp,valid:Jg,scales:eh,input:Ze,colors:Bn,brewer:th});var sn=ot;var Zp=500,zr={xs:.01,sm:.02,md:.03,lg:.08,xl:.14},kT=a((e,t)=>(e%t+t)%t,"normalizeHue"),md=a(e=>{let t=sn(e).hsv();return sn(t[0],t[1]*.92,Math.min(t[2]+.01,1),"hsv").hex()},"markDarkColor"),fd=a((e,t,o)=>{o===void 0&&(o=Zp);let r=t-o,n;return t<=o?e[0]>80&&e[0]<260?n=r*zr.xs:n=-r*zr.sm:e[0]>20&&e[0]<48?n=-r*zr.md:e[0]>=48&&e[0]<260?n=r*zr.xs:n=-r*zr.sm,kT(e[0]+n,360)},"calculateHue"),bd=a((e,t,o)=>{o===void 0&&(o=Zp);let r=(t-o)/100,n=0;t<o?(n=r*e[1]/5,t<100&&(n-=zr.sm)):t>o&&(e[0]<30||e[0]>200?n=r*zr.md:n=r*zr.xs,e[1]===0&&(n=0));let i=e[1]+n;return i>1?1:i<0?0:i},"calculateSaturation"),gd=a((e,t,o)=>{o===void 0&&(o=Zp);let r=(t-o)/100,n=0;t<o?e[1]<.1?n=r*(1-e[2])/5*1.06:n=r*(1-e[2])/5:t>o&&((e[0]<30||e[0]>200)&&e[0]>0?(n=r*zr.lg,e[2]>.8&&(n=r*zr.xl)):n=r*e[2]/6);let i=e[2]-n;return i>1?1:i<0?0:i},"calculateLightness");var Jp=[50,100,200,300,400,500,600,700,800,900],hd=a((e,t="light")=>{let o=t==="dark",r=o?md(e):e,n=sn(r).luminance();n<.1?r=sn(r).set("hsl.l",.4).hex():n>.9&&(r=sn(r).set("hsl.l",.6).hex());let i=sn(r).hsv(),s=Jp.map(l=>{let d=fd(i,l,500),c=bd(i,l,500),p=gd(i,l,500);return sn(d,c,p,"hsv")});return o?s.reverse():s},"createSolidColorScale"),em=a(e=>{let t=hd(e,"light"),o=hd(e,"dark"),r={};return ["monkeys","monkeys-dark"].forEach((n,i)=>{let s={};i?o.map((l,d)=>Object.assign(s,{[Jp[d]]:l.rgb().join(" ")})):t.map((l,d)=>Object.assign(s,{[Jp[d]]:l.rgb().join(" ")})),Object.assign(r,{[n]:s});}),r},"genTailwindTheme"),oh=CT__default.default(e=>{let t=em(e),o="";Object.entries(t).forEach(([n,i])=>{o+=(n==="monkeys-dark"?".dark":":root,::selection")+"{",Object.entries(i).forEach(([s,l])=>{o+=`--monkeys-${s}:${l};`;}),o+="}";});let r=document.getElementById("monkeys-theme");if(r)r.innerHTML=o;else {let n=document.createElement("style");n.id="monkeys-theme",document.head.appendChild(n),n.innerHTML=o;}},64);var TT="com.infmonkeys.css",yd=new WeakMap;function om(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}a(om,"isRecord");function NT(e){let t=e?.[TT];return om(t)?t:void 0}a(NT,"readCssExtension");function fo(e){return Number.isInteger(e)?String(e):String(Number(e.toFixed(6)))}a(fo,"formatNumber");function Fn(e){return `${fo(e.value)}${e.unit}`}a(Fn,"formatDimension");function tm(e){return `${fo(e.value)}${e.unit}`}a(tm,"formatDuration");function Ra(e){return e==="none"?e:fo(e)}a(Ra,"formatColorComponent");function RT(e){return [Number.parseInt(e.slice(1,3),16)/255,Number.parseInt(e.slice(3,5),16)/255,Number.parseInt(e.slice(5,7),16)/255]}a(RT,"hexToSrgb");function MT(e){if(e.colorSpace==="srgb"&&e.components.every(t=>typeof t=="number"))return e.components;if(e.hex)return RT(e.hex);throw new TypeError(`Web semantic colors in ${e.colorSpace} require a six-digit hex fallback for hsl(var(--token)) consumers.`)}a(MT,"colorSrgbComponents");function IT([e,t,o]){let r=Math.max(e,t,o),n=Math.min(e,t,o),i=(r+n)/2;if(r===n)return [0,0,i*100];let s=r-n,l=i>.5?s/(2-r-n):s/(r+n),d;return r===e?d=(t-o)/s+(t<o?6:0):r===t?d=(o-e)/s+2:d=(e-t)/s+4,[d/6*360,l*100,i*100]}a(IT,"srgbToHsl");function DT(e){if(e.colorSpace==="hsl"&&e.components.every(n=>typeof n=="number")){let[n,i,s]=e.components;return `${fo(n)} ${fo(i)}% ${fo(s)}%`}let[t,o,r]=IT(MT(e));return `${fo(t)} ${fo(o)}% ${fo(r)}%`}a(DT,"formatHslTriplet");function xd(e){let t=e.alpha??1;if(e.hex&&t===1)return e.hex;let o=e.components.map(Ra).join(" "),r=t===1?"":` / ${fo(t)}`;switch(e.colorSpace){case "srgb":return `rgb(${e.components.map(i=>i==="none"?"none":fo(i*255)).join(" ")}${r})`;case "hsl":return `hsl(${Ra(e.components[0])} ${Ra(e.components[1])}% ${Ra(e.components[2])}%${r})`;case "hwb":return `hwb(${Ra(e.components[0])} ${Ra(e.components[1])}% ${Ra(e.components[2])}%${r})`;case "lab":case "lch":case "oklab":case "oklch":return `${e.colorSpace}(${o}${r})`;default:return `color(${e.colorSpace} ${o}${r})`}}a(xd,"formatColor");function rh(e){let t=Array.isArray(e)?e:[e],o=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]);return t.map(r=>o.has(r)||/^[a-zA-Z][\w-]*$/.test(r)?r:`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`).join(", ")}a(rh,"formatFontFamily");function PT(e){return (Array.isArray(e)?e:[e]).map(o=>{if(!om(o))throw new TypeError("DTCG shadow values must be objects.");return [Fn(o.offsetX),Fn(o.offsetY),Fn(o.blur),Fn(o.spread),xd(o.color),o.inset===true?"inset":""].filter(Boolean).join(" ")}).join(", ")}a(PT,"formatShadow");function ET(e,t){if(!Array.isArray(e))throw new TypeError("DTCG gradient values must be arrays.");let o=e.map(n=>{if(!om(n))throw new TypeError("DTCG gradient stops must be objects.");return `${xd(n.color)} ${fo(Number(n.position)*100)}%`}).join(", "),r=NT(t)?.gradient;return r?.kind==="radial"?`radial-gradient(${o})`:`linear-gradient(${fo(r?.angle??90)}deg, ${o})`}a(ET,"formatGradient");function nh(e){switch(e.type){case "color":return xd(e.value);case "dimension":return Fn(e.value);case "fontFamily":return rh(e.value);case "fontWeight":case "number":return String(e.value);case "duration":return tm(e.value);case "cubicBezier":return `cubic-bezier(${e.value.map(fo).join(", ")})`;case "strokeStyle":return typeof e.value=="string"?e.value:e.value.dashArray.map(Fn).join(" ");case "border":{let t=e.value,o={...e,type:"strokeStyle",value:t.style};return `${Fn(t.width)} ${nh(o)} ${xd(t.color)}`}case "transition":{let t=e.value;return `${tm(t.duration)} cubic-bezier(${t.timingFunction.map(fo).join(", ")}) ${tm(t.delay)}`}case "shadow":return PT(e.value);case "gradient":return ET(e.value,e.extensions);case "typography":{let t=e.value;return `${t.fontWeight} ${Fn(t.fontSize)}/${fo(t.lineHeight)} ${rh(t.fontFamily)}`}}}a(nh,"formatTokenValue");function ah(e,t){let o=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase();return `--${t}-${o}`}a(ah,"toCssVariableName");function AT(e){if(!/^[a-zA-Z][a-zA-Z0-9-]*$/.test(e))throw new TypeError("Theme token variablePrefix must start with a letter and contain only letters, numbers, or hyphens.")}a(AT,"assertCssVariablePrefix");function ih(e,t,o){let r=`${t}.${o}`;return e.has(r)?r:e.has(t)?t:void 0}a(ih,"selectModePath");var BT={"semantic.color.background":"--background","semantic.color.foreground":"--foreground","semantic.color.card":"--card","semantic.color.card-foreground":"--card-foreground","semantic.color.popover":"--popover","semantic.color.popover-foreground":"--popover-foreground","semantic.color.primary":"--primary","semantic.color.primary-foreground":"--primary-foreground","semantic.color.secondary":"--secondary","semantic.color.secondary-foreground":"--secondary-foreground","semantic.color.muted":"--muted","semantic.color.muted-foreground":"--muted-foreground","semantic.color.accent":"--accent","semantic.color.accent-foreground":"--accent-foreground","semantic.color.destructive":"--destructive","semantic.color.destructive-foreground":"--destructive-foreground","semantic.color.success":"--success","semantic.color.success-foreground":"--success-foreground","semantic.color.warning":"--warning","semantic.color.warning-foreground":"--warning-foreground","semantic.color.border":"--border","semantic.color.input":"--input","semantic.color.ring":"--ring","semantic.color.media-surface":"--media-surface","semantic.color.media-foreground":"--media-foreground","semantic.color.media-overlay":"--media-overlay","semantic.color.radar-canvas":"--radar-canvas","semantic.color.radar-panel":"--radar-panel","semantic.color.radar-border":"--radar-border","semantic.color.radar-shell-border":"--radar-shell-border","semantic.color.radar-grid":"--radar-grid","semantic.color.radar-axis":"--radar-axis","semantic.color.radar-series-one":"--radar-series-one","semantic.color.radar-series-two":"--radar-series-two","semantic.color.radar-series-three":"--radar-series-three","semantic.color.radar-series-four":"--radar-series-four"},sh=Object.freeze({...Object.fromEntries(Object.entries(BT).map(([e,t])=>[e,{variableName:t,axis:"colorMode",expectedType:"color",format:"hsl"}])),"semantic.color.neocard":{variableName:"--neocard",axis:"colorMode",expectedType:"color",format:"css"},"semantic.radius.base":{variableName:"--radius",axis:"colorMode",expectedType:"dimension",format:"css"},"semantic.spacing.global":{variableName:"--global-spacing",axis:"density",expectedType:"dimension",format:"css"},"semantic.gradient.brand":{variableName:"--monkeys-gradient",axis:"colorMode",expectedType:"gradient",format:"css"},"semantic.font.body":{variableName:"--font-sans",axis:"colorMode",expectedType:"fontFamily",format:"css"}});function rm(e){let t=e.startsWith("$")?e.slice(1).trim():e.trim();if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/i.test(t))throw new TypeError(`Invalid Design Token path ${e}.`);let o=sh[t];return o?o.format==="hsl"?`hsl(var(${o.variableName}))`:`var(${o.variableName})`:`var(${ah(t,"monkeys")})`}a(rm,"resolveThemeTokenCssVariable");function lh(e,t){let o=ih(new Set(Object.keys(e.cssValues)),t,e.colorMode);return o?e.cssValues[o]:void 0}a(lh,"getThemeTokenCssValue");function xs(e,t={}){let o=runtime.resolveThemeTokens(e),r=o.document,n=t.colorMode??"light",i=t.density??"default",s=t.variablePrefix??"monkeys";AT(s);let l={},d={},c={},p=new Map;for(let[f,b]of o.tokens){l[f]=b.value;let x=nh(b);d[f]=x;let y=ah(f,s),k=p.get(y);if(k)throw new TypeError(`Theme token paths ${k} and ${f} both compile to ${y}. Rename one token.`);p.set(y,f),c[y]=x;}let u=new Set(o.tokens.keys());for(let[f,b]of Object.entries(sh)){let x=b.axis==="density"?i:n,y=ih(u,f,x);if(!y)continue;let k=o.tokens.get(y);if(!k||k.type!==b.expectedType)throw new TypeError(`${y} must be a ${b.expectedType} token to drive ${b.variableName}.`);c[b.variableName]=b.format==="hsl"?DT(k.value):d[y];}let g=Object.entries(c).sort(([f],[b])=>f.localeCompare(b)).map(([f,b])=>`${f}:${b};`).join("");return {contract:r,colorMode:n,density:i,values:Object.freeze(l),cssValues:Object.freeze(d),cssVariables:Object.freeze(c),cssText:g}}a(xs,"compileThemeTokens");function dh(e,t={}){let o=xs(e,t),r=t.target??(typeof document>"u"?null:document.documentElement);if(!r)return o;let n=yd.get(r)??new Set,i=new Set(Object.keys(o.cssVariables));for(let s of n)i.has(s)||r.style.removeProperty(s);for(let[s,l]of Object.entries(o.cssVariables))r.style.setProperty(s,l);return yd.set(r,i),t.themeId?r.dataset.monkeysTheme=t.themeId:delete r.dataset.monkeysTheme,r.dataset.monkeysColorMode=o.colorMode,r.dataset.monkeysDensity=o.density,o}a(dh,"applyThemeTokens");function ch(e={}){let t=e.target??(typeof document>"u"?null:document.documentElement);if(!t)return;let o=yd.get(t)??new Set;for(let r of o)t.style.removeProperty(r);yd.delete(t),delete t.dataset.monkeysTheme,delete t.dataset.monkeysColorMode,delete t.dataset.monkeysDensity;}a(ch,"clearThemeTokens");var vd=["background","glowColor","borderColor","borderWidth","borderStyle","radius","shadow","padding","gap"],LT={background:"hsl(var(--card, 0 0% 100%))",glowColor:"var(--monkeys-bento-glow-default)",borderColor:"hsl(var(--border, 214.3 31.8% 91.4%))",borderWidth:"1px",borderStyle:"solid",radius:"var(--radius, 0.75rem)",shadow:"none",padding:"var(--global-spacing, 0.75rem)",gap:"var(--global-spacing, 0.75rem)"},nm=new WeakMap;function uh(e,t){if(!Number.isSafeInteger(t)||t<1)throw new RangeError("Bento level must be a positive safe integer.");let o=e&&nm.get(e)?.get(t);if(o)return o;let r={...LT},n=Object.fromEntries(vd.map(s=>[s,"builtin"]));for(let s of vd){let l=s==="padding"||s==="gap"?e?.density:e?.colorMode,d=s==="glowColor"?"component.bento":"semantic.bento",c=[`${d}.levels.level${t}.${s}`,`${d}.default.${s}`];for(let p of c){let u=l&&e?.cssValues[`${p}.${l}`]!==void 0?`${p}.${l}`:p,g=e?.cssValues[u];if(g!==void 0){r[s]=g,n[s]=u;break}}}let i=Object.freeze({values:Object.freeze(r),sources:Object.freeze(n)});if(e){let s=nm.get(e)??new Map;s.set(t,i),nm.set(e,s);}return i}a(uh,"resolveBentoTokens");var ln={locale:"en-US",messages:{pagination:{navigation:"Pagination",first:"First",previous:"Previous",next:"Next",last:"Last",page:a(({page:e,pageCount:t})=>`Page ${e} of ${t}`,"page"),currentPage:a(({page:e,pageCount:t})=>`Page ${e} of ${t}, current page`,"currentPage"),emptyResults:"0 results",range:a(({start:e,end:t,total:o})=>`${e}-${t} of ${o}`,"range"),selected:a(({count:e})=>`${e} selected`,"selected"),pageSize:"Items per page",loadBatchSize:"Items per load",perLoad:"Items per load",jumpToPage:"Jump to page",pages:"pages",clickToJump:"Click to jump to a page"},dialog:{close:"Close dialog"},dropdownMenu:{actions:"Actions"},loading:{spinner:"Loading"},layout:{resizePanels:"Resize panels",expandPanel:"Expand",collapsePanel:"Collapse",movePanel:"Move",moveBefore:"Move earlier",moveAfter:"Move later"},steps:{label:"Progress",current:"Current",completed:"Completed",error:"Error",disabled:"Disabled"},numberInput:{increment:"Increase value",decrement:"Decrease value"},passwordInput:{showPassword:"Show password",hidePassword:"Hide password"},multiSelect:{placeholder:"Select options",empty:"No options",removeOption:a(({value:e})=>`Remove ${e}`,"removeOption")},table:{dragColumn:a(({columnId:e})=>`Drag column ${e}`,"dragColumn"),resizeColumn:a(({columnId:e})=>`Resize column ${e}`,"resizeColumn"),sortColumn:a(({columnId:e})=>e?`Sort column ${e}`:"Sort column","sortColumn"),loadingRow:"Loading table row"},toolbar:{theme:{label:"Appearance",toggle:"Toggle theme",auto:"Auto",light:"Light",dark:"Dark"},language:{label:"Language",switch:"Switch language"}},toast:{errorTitle:"Error",warningTitle:"Warning",defaultErrorDescription:"Something went wrong.",defaultWarningDescription:"Please check and try again."},dataExplorer:{viewTree:{actions:"More actions",expand:"Expand",collapse:"Collapse",loading:"Loading...",empty:"No views",error:"Unable to load views"}},workbench:{relationshipGraph:{zoomOut:"Zoom out",zoomIn:"Zoom in",zoomToFit:"Fit graph",minimap:"Graph overview"},collection:{label:"Collection",loading:"Loading items",empty:"No items",loadError:"Unable to load items",refreshError:"Unable to refresh items",retry:"Retry",loadingMore:"Loading more items",permission:"You do not have permission to view this content",offline:"You appear to be offline",requestAccess:"Request access"},interactiveTable:{columnActions:"Column actions",freezeColumn:"Freeze to left",freezeEndColumn:"Freeze to right",unfreezeColumn:"Unfreeze from left",unfreezeEndColumn:"Unfreeze from right",unfreezeAllColumns:"Unfreeze all columns",resetColumnWidth:"Reset column width",frozenColumnTitle:"Frozen column"}},agentWorkbench:{label:"Session activity",reasoning:"Reasoning",plan:"Plan",taskNoDetail:"No additional details",modes:{chat:"Chat",work:"Work"},composer:{send:"Send message",stop:"Stop generating",queue:"Queue message",attach:"Add photos or files",voice:"Start voice input",webSearch:"Web search",chatMode:"Chat mode",model:"Model",reasoning:"Reasoning effort",permissions:"Permissions",removeAttachment:"Remove attachment",editQueued:"Edit queued message",deleteQueued:"Delete queued message",moveUp:"Move message up",moveDown:"Move message down",queued:"Queued messages",uploading:"Uploading",uploadFailed:"Upload failed",retryAttachment:"Retry attachment upload",noModels:"No models available",message:"Message",attachmentOnly:"Attachment",reasoningOptions:{low:"Low",medium:"Medium",high:"High",xhigh:"Extra high"},permissionOptions:{"approval-required":"Approval required","auto-approve":"Auto approve","full-access":"Full access"}},quickStart:{label:"Quick start",back:"Back",addFile:"Add file"},tool:{input:"Input",output:"Output",status:{pending:"Pending",running:"Running",completed:"Completed",failed:"Error",denied:"Denied"}},approval:{approve:"Approve",reject:"Reject",approved:"Approved",rejected:"Rejected"},artifact:{pending:"Preparing",ready:"Ready",failed:"Failed",open:a(({name:e})=>`Open ${e}`,"open")},run:{stopping:"Stopping...",stoppedAfter:a(({duration:e})=>`You stopped after ${e}`,"stoppedAfter")},process:{running:"Working",queued:"Queued",waitingApproval:"Waiting for approval",failed:"Failed",stopped:"Stopped",processed:"Processed",processedFor:a(({duration:e})=>`Worked for ${e}`,"processedFor"),completedCount:a(({completed:e,total:t})=>`${e}/${t} completed`,"completedCount")},artifactWorkspace:{outputs:"Outputs",sources:"Sources",viewAll:"View all",toggleSummary:"Toggle files",tabs:"Open files",closeTab:a(({name:e})=>`Close ${e}`,"closeTab"),closeWorkspace:"Close workspace",download:a(({name:e})=>`Download ${e}`,"download"),openExternal:a(({name:e})=>`Open ${e} in a new window`,"openExternal"),loading:"Loading preview...",failed:"Preview unavailable",retry:"Try again"},usage:{label:"Context usage",context:a(({used:e,total:t})=>`${e} / ${t} tokens`,"context")},navigation:{search:"Search agents and sessions",searchSessions:"Search sessions",searchShortcut:"Focus search",clearSearch:"Clear search",tabsLabel:"Agent workbench navigation",agents:"Agents",sessions:"Sessions",newAgent:"New Agent",newSession:"New Session",capabilities:"Capabilities & Extensions",settings:"Agent Settings",allAgents:"All Agents",recentSessions:"Recent Sessions",chat:"Chat",work:"Work",chats:"Chats",builtIn:"Built-in",noDescription:"No description",loading:"Loading...",emptyAgents:"No agents yet",emptySessions:"No sessions yet",noResults:"No matching results",retry:"Retry",pin:"Pin",unpin:"Unpin",rename:"Rename",delete:"Delete",actions:"Actions",save:"Save",cancel:"Cancel",running:"Running",completed:"Completed",failed:"Failed",contextUsage:a(({percent:e})=>`${e}% context used`,"contextUsage")},details:{title:"Task details",description:"Summary and workspace activity",duration:"Duration",updated:"Updated",model:"Model",mode:"Mode",permissions:"Permissions",tokenUsage:"Token usage",summary:"Summary",summaryEmpty:"No summary is available yet.",summaryFailed:"The summary could not be generated.",highlights:"Highlights",pendingItems:"Pending items",tabs:{label:"Task detail views",summary:"Summary",workspace:"Workspace"},status:{queued:"Queued",running:"Running",waiting_approval:"Waiting for approval",stopping:"Stopping",stopped:"Stopped",completed:"Completed",failed:"Failed"},state:{loading:{title:"Loading task details",description:"Restoring the latest session activity."},empty:{title:"No task selected",description:"Select a task to inspect its details."},error:{title:"Unable to load task details",description:"Try again after the session is available."}},actions:{close:"Close task details",copySummary:"Copy summary",retry:"Retry",retrySummary:"Retry summary",resume:"Resume",continueInNewTask:"Continue in new task",editAndRerun:"Edit and rerun",export:"Export"},workspace:{diffs:"Code changes",files:"Files",terminals:"Terminals",tests:"Tests",artifacts:"Artifacts",exitCode:a(({code:e})=>`Exit code ${e}`,"exitCode"),diffStatus:{added:"Added",modified:"Modified",deleted:"Deleted",renamed:"Renamed"},fileOperation:{upsert:"Updated",delete:"Deleted"}}}}}};var wd={locale:"zh-CN",messages:{pagination:{navigation:"\u5206\u9875\u5BFC\u822A",first:"\u9996\u9875",previous:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",last:"\u672B\u9875",page:a(({page:e,pageCount:t})=>`\u7B2C ${e} \u9875\uFF0C\u5171 ${t} \u9875`,"page"),currentPage:a(({page:e,pageCount:t})=>`\u7B2C ${e} \u9875\uFF0C\u5171 ${t} \u9875\uFF0C\u5F53\u524D\u9875`,"currentPage"),emptyResults:"\u5171 0 \u6761",range:a(({start:e,end:t,total:o})=>`\u7B2C ${e}-${t} \u6761\uFF0C\u5171 ${o} \u6761`,"range"),selected:a(({count:e})=>`\u5DF2\u9009\u62E9 ${e} \u9879`,"selected"),pageSize:"\u6BCF\u9875\u663E\u793A\u6570\u91CF",loadBatchSize:"\u6BCF\u6B21\u52A0\u8F7D\u6570\u91CF",perLoad:"\u6BCF\u6B21\u52A0\u8F7D",jumpToPage:"\u8DF3\u8F6C\u5230\u9875\u7801",pages:"\u9875",clickToJump:"\u70B9\u51FB\u8DF3\u8F6C\u9875\u7801"},dialog:{close:"\u5173\u95ED\u5BF9\u8BDD\u6846"},dropdownMenu:{actions:"\u64CD\u4F5C"},loading:{spinner:"\u6B63\u5728\u52A0\u8F7D"},layout:{resizePanels:"\u8C03\u6574\u9762\u677F\u5927\u5C0F",expandPanel:"\u5C55\u5F00",collapsePanel:"\u6536\u8D77",movePanel:"\u79FB\u52A8",moveBefore:"\u5411\u524D\u79FB\u52A8",moveAfter:"\u5411\u540E\u79FB\u52A8"},steps:{label:"\u8FDB\u5EA6",current:"\u5F53\u524D\u6B65\u9AA4",completed:"\u5DF2\u5B8C\u6210",error:"\u9519\u8BEF",disabled:"\u5DF2\u7981\u7528"},numberInput:{increment:"\u589E\u52A0\u6570\u503C",decrement:"\u51CF\u5C11\u6570\u503C"},passwordInput:{showPassword:"\u663E\u793A\u5BC6\u7801",hidePassword:"\u9690\u85CF\u5BC6\u7801"},multiSelect:{placeholder:"\u8BF7\u9009\u62E9",empty:"\u6682\u65E0\u9009\u9879",removeOption:a(({value:e})=>`\u79FB\u9664 ${e}`,"removeOption")},table:{dragColumn:a(({columnId:e})=>`\u62D6\u52A8\u5217 ${e}`,"dragColumn"),resizeColumn:a(({columnId:e})=>`\u8C03\u6574\u5217\u5BBD ${e}`,"resizeColumn"),sortColumn:a(({columnId:e})=>e?`\u6392\u5E8F\u5217 ${e}`:"\u6392\u5E8F\u5217","sortColumn"),loadingRow:"\u6B63\u5728\u52A0\u8F7D\u8868\u683C\u884C"},toolbar:{theme:{label:"\u5916\u89C2",toggle:"\u5207\u6362\u4E3B\u9898",auto:"\u8DDF\u968F\u7CFB\u7EDF",light:"\u6D45\u8272\u6A21\u5F0F",dark:"\u6DF1\u8272\u6A21\u5F0F"},language:{label:"\u8BED\u8A00",switch:"\u5207\u6362\u8BED\u8A00"}},toast:{errorTitle:"\u9519\u8BEF",warningTitle:"\u63D0\u793A",defaultErrorDescription:"\u53D1\u751F\u9519\u8BEF\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",defaultWarningDescription:"\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002"},dataExplorer:{viewTree:{actions:"\u66F4\u591A\u64CD\u4F5C",expand:"\u5C55\u5F00",collapse:"\u6536\u8D77",loading:"\u6B63\u5728\u52A0\u8F7D...",empty:"\u6682\u65E0\u89C6\u56FE",error:"\u65E0\u6CD5\u52A0\u8F7D\u89C6\u56FE"}},workbench:{relationshipGraph:{zoomOut:"\u7F29\u5C0F",zoomIn:"\u653E\u5927",zoomToFit:"\u9002\u5E94\u753B\u5E03",minimap:"\u56FE\u8C31\u6982\u89C8"},collection:{label:"\u5185\u5BB9\u96C6\u5408",loading:"\u6B63\u5728\u52A0\u8F7D\u5185\u5BB9",empty:"\u6682\u65E0\u5185\u5BB9",loadError:"\u65E0\u6CD5\u52A0\u8F7D\u5185\u5BB9",refreshError:"\u65E0\u6CD5\u5237\u65B0\u5185\u5BB9",retry:"\u91CD\u8BD5",loadingMore:"\u6B63\u5728\u52A0\u8F7D\u66F4\u591A\u5185\u5BB9",permission:"\u4F60\u6CA1\u6709\u6743\u9650\u67E5\u770B\u6B64\u5185\u5BB9",offline:"\u7F51\u7EDC\u8FDE\u63A5\u5DF2\u65AD\u5F00",requestAccess:"\u7533\u8BF7\u6743\u9650"},interactiveTable:{columnActions:"\u5217\u64CD\u4F5C",freezeColumn:"\u56FA\u5B9A\u5230\u5DE6\u4FA7",freezeEndColumn:"\u56FA\u5B9A\u5230\u53F3\u4FA7",unfreezeColumn:"\u53D6\u6D88\u5DE6\u4FA7\u56FA\u5B9A",unfreezeEndColumn:"\u53D6\u6D88\u53F3\u4FA7\u56FA\u5B9A",unfreezeAllColumns:"\u53D6\u6D88\u5168\u90E8\u56FA\u5B9A",resetColumnWidth:"\u91CD\u7F6E\u5217\u5BBD",frozenColumnTitle:"\u5DF2\u56FA\u5B9A\u5217"}},agentWorkbench:{label:"\u4F1A\u8BDD\u6D3B\u52A8",reasoning:"\u601D\u8003\u8FC7\u7A0B",plan:"\u6267\u884C\u8BA1\u5212",taskNoDetail:"\u6682\u65E0\u66F4\u591A\u8BE6\u60C5",modes:{chat:"\u5BF9\u8BDD",work:"\u5DE5\u4F5C"},composer:{send:"\u53D1\u9001\u6D88\u606F",stop:"\u505C\u6B62\u751F\u6210",queue:"\u6392\u961F\u53D1\u9001",attach:"\u6DFB\u52A0\u7167\u7247\u6216\u6587\u4EF6",voice:"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165",webSearch:"\u8054\u7F51\u641C\u7D22",chatMode:"\u5BF9\u8BDD\u6A21\u5F0F",model:"\u6A21\u578B",reasoning:"\u601D\u8003\u5F3A\u5EA6",permissions:"\u6743\u9650",removeAttachment:"\u79FB\u9664\u9644\u4EF6",editQueued:"\u7F16\u8F91\u6392\u961F\u6D88\u606F",deleteQueued:"\u5220\u9664\u6392\u961F\u6D88\u606F",moveUp:"\u4E0A\u79FB\u6D88\u606F",moveDown:"\u4E0B\u79FB\u6D88\u606F",queued:"\u6392\u961F\u6D88\u606F",uploading:"\u4E0A\u4F20\u4E2D",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",retryAttachment:"\u91CD\u8BD5\u9644\u4EF6\u4E0A\u4F20",noModels:"\u6682\u65E0\u53EF\u7528\u6A21\u578B",message:"\u6D88\u606F",attachmentOnly:"\u9644\u4EF6",reasoningOptions:{low:"\u4F4E",medium:"\u4E2D",high:"\u9AD8",xhigh:"\u6700\u9AD8"},permissionOptions:{"approval-required":"\u9700\u8981\u6279\u51C6","auto-approve":"\u81EA\u52A8\u6279\u51C6","full-access":"\u5B8C\u5168\u8BBF\u95EE"}},quickStart:{label:"\u5FEB\u901F\u5F00\u59CB",back:"\u8FD4\u56DE",addFile:"\u6DFB\u52A0\u6587\u4EF6"},tool:{input:"\u8F93\u5165",output:"\u8F93\u51FA",status:{pending:"\u7B49\u5F85\u4E2D",running:"\u8FD0\u884C\u4E2D",completed:"\u5DF2\u5B8C\u6210",failed:"\u9519\u8BEF",denied:"\u5DF2\u62D2\u7EDD"}},approval:{approve:"\u5141\u8BB8",reject:"\u62D2\u7EDD",approved:"\u5DF2\u5141\u8BB8",rejected:"\u5DF2\u62D2\u7EDD"},artifact:{pending:"\u51C6\u5907\u4E2D",ready:"\u5DF2\u5C31\u7EEA",failed:"\u5931\u8D25",open:a(({name:e})=>`\u6253\u5F00 ${e}`,"open")},run:{stopping:"\u6B63\u5728\u505C\u6B62...",stoppedAfter:a(({duration:e})=>`\u4F60\u5728 ${e} \u540E\u505C\u6B62\u4E86\u4EFB\u52A1`,"stoppedAfter")},process:{running:"\u6267\u884C\u8FC7\u7A0B",queued:"\u6392\u961F\u4E2D",waitingApproval:"\u7B49\u5F85\u5BA1\u6279",failed:"\u5931\u8D25",stopped:"\u5DF2\u505C\u6B62",processed:"\u5DF2\u5904\u7406",processedFor:a(({duration:e})=>`\u8017\u65F6 ${e.replace(/(\d+)h/g,"$1\u5C0F\u65F6").replace(/(\d+)m/g,"$1\u5206\u949F").replace(/(\d+)s/g,"$1\u79D2").replace(/\s+/g,"")}`,"processedFor"),completedCount:a(({completed:e,total:t})=>`${e}/${t} \u5DF2\u5B8C\u6210`,"completedCount")},artifactWorkspace:{outputs:"\u8F93\u51FA",sources:"\u6765\u6E90",viewAll:"\u67E5\u770B\u5168\u90E8",toggleSummary:"\u5207\u6362\u6587\u4EF6\u6458\u8981",tabs:"\u5DF2\u6253\u5F00\u6587\u4EF6",closeTab:a(({name:e})=>`\u5173\u95ED ${e}`,"closeTab"),closeWorkspace:"\u5173\u95ED\u5DE5\u4F5C\u533A",download:a(({name:e})=>`\u4E0B\u8F7D ${e}`,"download"),openExternal:a(({name:e})=>`\u5728\u65B0\u7A97\u53E3\u6253\u5F00 ${e}`,"openExternal"),loading:"\u6B63\u5728\u52A0\u8F7D\u9884\u89C8...",failed:"\u9884\u89C8\u4E0D\u53EF\u7528",retry:"\u91CD\u8BD5"},usage:{label:"\u4E0A\u4E0B\u6587\u7528\u91CF",context:a(({used:e,total:t})=>`${e} / ${t} tokens`,"context")},navigation:{search:"\u641C\u7D22\u667A\u80FD\u4F53\u548C\u4F1A\u8BDD",searchSessions:"\u641C\u7D22\u4F1A\u8BDD",searchShortcut:"\u805A\u7126\u641C\u7D22\u6846",clearSearch:"\u6E05\u9664\u641C\u7D22",tabsLabel:"\u667A\u80FD\u4F53\u5DE5\u4F5C\u53F0\u5BFC\u822A",agents:"\u667A\u80FD\u4F53",sessions:"\u4F1A\u8BDD",newAgent:"\u65B0\u5EFA\u667A\u80FD\u4F53",newSession:"\u65B0\u5EFA\u4F1A\u8BDD",capabilities:"\u80FD\u529B\u4E0E\u6269\u5C55",settings:"\u667A\u80FD\u4F53\u8BBE\u7F6E",allAgents:"\u5168\u90E8\u667A\u80FD\u4F53",recentSessions:"\u6700\u8FD1\u4F1A\u8BDD",chat:"\u5BF9\u8BDD",work:"\u5DE5\u4F5C",chats:"\u804A\u5929",builtIn:"\u5185\u7F6E",noDescription:"\u6682\u65E0\u63CF\u8FF0",loading:"\u52A0\u8F7D\u4E2D...",emptyAgents:"\u6682\u65E0\u667A\u80FD\u4F53",emptySessions:"\u6682\u65E0\u4F1A\u8BDD",noResults:"\u6CA1\u6709\u5339\u914D\u7ED3\u679C",retry:"\u91CD\u8BD5",pin:"\u7F6E\u9876",unpin:"\u53D6\u6D88\u7F6E\u9876",rename:"\u91CD\u547D\u540D",delete:"\u5220\u9664",actions:"\u64CD\u4F5C",save:"\u4FDD\u5B58",cancel:"\u53D6\u6D88",running:"\u8FD0\u884C\u4E2D",completed:"\u5DF2\u5B8C\u6210",failed:"\u5931\u8D25",contextUsage:a(({percent:e})=>`\u5DF2\u4F7F\u7528 ${e}% \u4E0A\u4E0B\u6587`,"contextUsage")},details:{title:"\u4EFB\u52A1\u8BE6\u60C5",description:"\u6458\u8981\u4E0E\u5DE5\u4F5C\u533A\u6D3B\u52A8",duration:"\u8017\u65F6",updated:"\u66F4\u65B0\u65F6\u95F4",model:"\u6A21\u578B",mode:"\u6A21\u5F0F",permissions:"\u6743\u9650",tokenUsage:"Token \u7528\u91CF",summary:"\u6458\u8981",summaryEmpty:"\u6682\u65F6\u6CA1\u6709\u53EF\u7528\u6458\u8981\u3002",summaryFailed:"\u6458\u8981\u751F\u6210\u5931\u8D25\u3002",highlights:"\u91CD\u70B9",pendingItems:"\u5F85\u5904\u7406\u4E8B\u9879",tabs:{label:"\u4EFB\u52A1\u8BE6\u60C5\u89C6\u56FE",summary:"\u6458\u8981",workspace:"\u5DE5\u4F5C\u533A"},status:{queued:"\u6392\u961F\u4E2D",running:"\u8FD0\u884C\u4E2D",waiting_approval:"\u7B49\u5F85\u5BA1\u6279",stopping:"\u6B63\u5728\u505C\u6B62",stopped:"\u5DF2\u505C\u6B62",completed:"\u5DF2\u5B8C\u6210",failed:"\u5931\u8D25"},state:{loading:{title:"\u6B63\u5728\u52A0\u8F7D\u4EFB\u52A1\u8BE6\u60C5",description:"\u6B63\u5728\u6062\u590D\u6700\u65B0\u7684\u4F1A\u8BDD\u6D3B\u52A8\u3002"},empty:{title:"\u672A\u9009\u62E9\u4EFB\u52A1",description:"\u9009\u62E9\u4EFB\u52A1\u540E\u67E5\u770B\u8BE6\u7EC6\u4FE1\u606F\u3002"},error:{title:"\u65E0\u6CD5\u52A0\u8F7D\u4EFB\u52A1\u8BE6\u60C5",description:"\u4F1A\u8BDD\u6062\u590D\u53EF\u7528\u540E\u8BF7\u91CD\u8BD5\u3002"}},actions:{close:"\u5173\u95ED\u4EFB\u52A1\u8BE6\u60C5",copySummary:"\u590D\u5236\u6458\u8981",retry:"\u91CD\u8BD5",retrySummary:"\u91CD\u65B0\u751F\u6210\u6458\u8981",resume:"\u7EE7\u7EED\u8FD0\u884C",continueInNewTask:"\u5728\u65B0\u4EFB\u52A1\u4E2D\u7EE7\u7EED",editAndRerun:"\u7F16\u8F91\u5E76\u91CD\u65B0\u8FD0\u884C",export:"\u5BFC\u51FA"},workspace:{diffs:"\u4EE3\u7801\u53D8\u66F4",files:"\u6587\u4EF6",terminals:"\u7EC8\u7AEF",tests:"\u6D4B\u8BD5",artifacts:"\u4EA7\u7269",exitCode:a(({code:e})=>`\u9000\u51FA\u7801 ${e}`,"exitCode"),diffStatus:{added:"\u65B0\u589E",modified:"\u4FEE\u6539",deleted:"\u5220\u9664",renamed:"\u91CD\u547D\u540D"},fileOperation:{upsert:"\u5DF2\u66F4\u65B0",delete:"\u5DF2\u5220\u9664"}}}}}};var WT={"en-US":ln,"zh-CN":wd};function ph(e){if(typeof e!="string"||!e.trim())throw new TypeError("Monkeys locale must be a non-empty BCP 47 string.");try{return Intl.getCanonicalLocales(e)[0]}catch{throw new RangeError(`Monkeys locale "${e}" is not a valid BCP 47 identifier.`)}}a(ph,"normalizeLocaleId");function mh(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}a(mh,"isRecord");function fh(e,t,o){if(!mh(e)||!mh(t))throw new TypeError(`${o} must be an object.`);for(let[r,n]of Object.entries(e)){if(n===void 0)continue;if(!(r in t))throw new TypeError(`${o}.${r} is not a supported Monkeys message.`);let i=t[r],s=`${o}.${r}`;if(typeof i=="function"){if(typeof n!="function")throw new TypeError(`${s} must be a function.`)}else if(typeof i=="string"){if(typeof n!="string")throw new TypeError(`${s} must be a string.`)}else fh(n,i,s);}}a(fh,"validateMessageOverride");function bh(e,t){fh(e,ln.messages,t);}a(bh,"assertMessagesOverride");function gh(e){return e==="en-US"||e==="zh-CN"}a(gh,"isBuiltInLocale");function zT(e){if(e===void 0)return {locale:void 0,messages:void 0,hasExplicitLocale:false};if(typeof e=="string"){let o=ph(e);if(!gh(o))throw new RangeError(`Unsupported built-in Monkeys locale "${o}". Provide a locale pack object for custom locales.`);return {locale:o,messages:void 0,hasExplicitLocale:true}}if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError("Monkeys locale must be a locale id or locale pack object.");let t=ph(e.locale);return bh(e.messages,"Monkeys locale messages"),{locale:t,messages:e.messages,hasExplicitLocale:true}}a(zT,"normalizeLocaleInput");function Ma(e,t){return t?{pagination:{...e.pagination,...t.pagination},dialog:{...e.dialog,...t.dialog},dropdownMenu:{...e.dropdownMenu,...t.dropdownMenu},loading:{...e.loading,...t.loading},layout:{...e.layout,...t.layout},steps:{...e.steps,...t.steps},numberInput:{...e.numberInput,...t.numberInput},passwordInput:{...e.passwordInput,...t.passwordInput},multiSelect:{...e.multiSelect,...t.multiSelect},table:{...e.table,...t.table},toolbar:{theme:{...e.toolbar.theme,...t.toolbar?.theme},language:{...e.toolbar.language,...t.toolbar?.language}},toast:{...e.toast,...t.toast},dataExplorer:{viewTree:{...e.dataExplorer.viewTree,...t.dataExplorer?.viewTree}},workbench:{relationshipGraph:{zoomOut:"Zoom out",zoomIn:"Zoom in",zoomToFit:"Fit graph",minimap:"Graph overview",...e.workbench.relationshipGraph,...t.workbench?.relationshipGraph},collection:{...e.workbench.collection,...t.workbench?.collection},interactiveTable:{...e.workbench.interactiveTable,...t.workbench?.interactiveTable}},agentWorkbench:{...e.agentWorkbench,...t.agentWorkbench,modes:{...e.agentWorkbench.modes,...t.agentWorkbench?.modes},composer:{...e.agentWorkbench.composer,...t.agentWorkbench?.composer},quickStart:{...e.agentWorkbench.quickStart,...t.agentWorkbench?.quickStart},tool:{...e.agentWorkbench.tool,...t.agentWorkbench?.tool,status:{...e.agentWorkbench.tool.status,...t.agentWorkbench?.tool?.status}},approval:{...e.agentWorkbench.approval,...t.agentWorkbench?.approval},artifact:{...e.agentWorkbench.artifact,...t.agentWorkbench?.artifact},run:{...e.agentWorkbench.run,...t.agentWorkbench?.run},process:{...e.agentWorkbench.process,...t.agentWorkbench?.process},artifactWorkspace:{...e.agentWorkbench.artifactWorkspace,...t.agentWorkbench?.artifactWorkspace},usage:{...e.agentWorkbench.usage,...t.agentWorkbench?.usage},navigation:{...e.agentWorkbench.navigation,...t.agentWorkbench?.navigation},details:{...e.agentWorkbench.details,...t.agentWorkbench?.details,tabs:{...e.agentWorkbench.details.tabs,...t.agentWorkbench?.details?.tabs},status:{...e.agentWorkbench.details.status,...t.agentWorkbench?.details?.status},state:{loading:{...e.agentWorkbench.details.state.loading,...t.agentWorkbench?.details?.state?.loading},empty:{...e.agentWorkbench.details.state.empty,...t.agentWorkbench?.details?.state?.empty},error:{...e.agentWorkbench.details.state.error,...t.agentWorkbench?.details?.state?.error}},actions:{...e.agentWorkbench.details.actions,...t.agentWorkbench?.details?.actions},workspace:{...e.agentWorkbench.details.workspace,...t.agentWorkbench?.details?.workspace,diffStatus:{...e.agentWorkbench.details.workspace.diffStatus,...t.agentWorkbench?.details?.workspace?.diffStatus},fileOperation:{...e.agentWorkbench.details.workspace.fileOperation,...t.agentWorkbench?.details?.workspace?.fileOperation}}}}}:e}a(Ma,"mergeMonkeysLocaleMessages");var li={locale:ln.locale,messages:Ma(ln.messages)};function kd(e,t,o){t!==void 0&&bh(t,"MonkeysProvider messages");let r=zT(e),n=r.locale??o?.locale??ln.locale,i=gh(n)?WT[n].messages:void 0,s=Ma(ln.messages,i);return o&&(!r.hasExplicitLocale||o.locale===n)&&(s=Ma(s,o.messages)),s=Ma(s,r.messages),s=Ma(s,t),{locale:n,messages:s}}a(kd,"resolveMonkeysLocale");var OT=Object.freeze({}),FT=Object.freeze({}),hh=Symbol.for("@inf-monkeys-tech/monkeys-design/provider-context@1");function HT(){return Object.freeze({locale:ho.createContext({...li,provided:false}),theme:ho.createContext({provided:false}),direction:ho.createContext({provided:false}),environment:ho.createContext({provided:false,environment:OT,portal:FT})})}a(HT,"createMonkeysProviderContexts");function VT(){let e=globalThis,t=e[hh];if(t)return t;let o=HT();return Object.defineProperty(e,hh,{value:o,enumerable:false,configurable:false,writable:false}),o}a(VT,"getMonkeysProviderContexts");var Sd=VT(),di=Sd.locale,dn=Sd.theme,vs=Sd.direction,Ia=Sd.environment;function yh(e,t){return t===void 0?e:e===void 0?t:{...e,...t,slots:e.slots||t.slots?{...e.slots,...t.slots}:void 0,styles:e.styles||t.styles?{...e.styles,...t.styles}:void 0}}a(yh,"mergeAppearance");function Co(){try{return ho.useContext(di)??{...li,provided:!1}}catch{return {...li,provided:false}}}a(Co,"useMonkeysLocale");function Ye(){return ho.useContext(di).messages}a(Ye,"useMonkeysLocaleMessages");function Hn(){return ho.useContext(dn).resolvedTheme}a(Hn,"useMonkeysResolvedTheme");function Pe(e){let t=ho.useContext(dn).baseAppearance;return ho.useMemo(()=>yh(t,e),[e,t])}a(Pe,"useMonkeysBaseAppearance");function xh(e){let t=ho.useContext(dn).dataExplorerAppearance;return ho.useMemo(()=>yh(t,e),[e,t])}a(xh,"useMonkeysDataExplorerAppearance");function Or(){return ho.useContext(dn).statusStates??{}}a(Or,"useMonkeysStatusStates");function Td(){return ho.useContext(dn).listFooter??{}}a(Td,"useMonkeysListFooter");function ci(){return ho.useContext(vs).direction}a(ci,"useMonkeysDirection");function ui(){return ho.useContext(Ia).environment}a(ui,"useMonkeysEnvironment");function pi(){return ho.useContext(Ia).portal}a(pi,"useMonkeysPortalOptions");function ke(){let e=ho.useContext(di),t=ho.useContext(dn),o=ho.useContext(vs),r=e.provided||t.provided||o.provided;return ho.useMemo(()=>r?{dir:o.direction,"data-monkeys-direction":o.direction,"data-monkeys-locale":e.locale,"data-monkeys-theme":t.themeId,"data-monkeys-theme-mode":t.resolvedTheme?.colorMode}:{},[o.direction,e.locale,r,t.resolvedTheme?.colorMode,t.themeId])}a(ke,"useMonkeysComponentAttributes");function im(){return ho.useContext(Ia).iconResolver}a(im,"useMonkeysAssetIconResolver");function vh(){return ho.useContext(Ia).imageResolver}a(vh,"useMonkeysAssetImageResolver");function wh(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}a(wh,"isRecord");function _T(e){if(e!==void 0&&e!=="ltr"&&e!=="rtl")throw new TypeError('MonkeysProvider direction must be "ltr" or "rtl".')}a(_T,"validateDirection");function GT(e){if(e!==void 0){if(!wh(e))throw new TypeError("MonkeysProvider environment must be an object.");if(e.getDocument!==void 0&&typeof e.getDocument!="function")throw new TypeError("MonkeysProvider environment.getDocument must be a function.");if(e.getWindow!==void 0&&typeof e.getWindow!="function")throw new TypeError("MonkeysProvider environment.getWindow must be a function.")}}a(GT,"validateEnvironment");function $T(e){if(e!==void 0){if(!wh(e))throw new TypeError("MonkeysProvider portal must be an object.");if(e.disabled!==void 0&&typeof e.disabled!="boolean")throw new TypeError("MonkeysProvider portal.disabled must be a boolean.");if(e.container!=null&&typeof e.container!="function"&&typeof e.container!="object")throw new TypeError("MonkeysProvider portal.container must be an Element, null, or a function.")}}a($T,"validatePortal");function jT(e,t,o,r){return e?xs(e,{colorMode:t,density:o}):r}a(jT,"resolveProviderTheme");function kh({children:e,locale:t,messages:o,direction:r,theme:n,themeId:i,colorMode:s,density:l,appearance:d,environment:c,iconResolver:p,imageResolver:u,portal:g,statusStates:f,listFooter:b}){let x=ho.useContext(di),y=ho.useContext(dn),k=ho.useContext(vs),w=ho.useContext(Ia);if(_T(r),GT(c),p!==void 0&&typeof p!="function")throw new TypeError("MonkeysProvider iconResolver must be a function.");if(u!==void 0&&typeof u!="function")throw new TypeError("MonkeysProvider imageResolver must be a function.");$T(g);let v=ho.useMemo(()=>kd(t,o,x),[t,o,x]),h=ho.useMemo(()=>({...v,provided:true}),[v]),S=ho.useMemo(()=>jT(n,s,l,y.resolvedTheme),[s,l,y.resolvedTheme,n]),T=ho.useMemo(()=>({provided:true,resolvedTheme:S,themeId:i??y.themeId,baseAppearance:{...y.baseAppearance,...d?.base,...l?{density:l}:void 0,slots:{...y.baseAppearance?.slots,...d?.base?.slots},styles:{...y.baseAppearance?.styles,...d?.base?.styles}},dataExplorerAppearance:{...y.dataExplorerAppearance,...d?.dataExplorer,...l?{density:l}:void 0,slots:{...y.dataExplorerAppearance?.slots,...d?.dataExplorer?.slots},styles:{...y.dataExplorerAppearance?.styles,...d?.dataExplorer?.styles}},statusStates:{...y.statusStates,...f,loading:{...y.statusStates?.loading,...f?.loading},empty:{...y.statusStates?.empty,...f?.empty},error:{...y.statusStates?.error,...f?.error},permission:{...y.statusStates?.permission,...f?.permission}},listFooter:{...y.listFooter,...b,...b?.pageSizeOptions?{pageSizeOptions:[...b.pageSizeOptions]}:void 0}}),[d?.base,d?.dataExplorer,l,y.baseAppearance,y.dataExplorerAppearance,y.statusStates,y.themeId,S,f,b,i]),C=ho.useMemo(()=>({provided:true,direction:r??k.direction??"ltr"}),[r,k.direction]),R=ho.useMemo(()=>({provided:true,iconResolver:p??w.iconResolver,imageResolver:u??w.imageResolver,environment:{...w.environment,...c},portal:{...w.portal,...g}}),[c,w.environment,w.iconResolver,p,u,w.imageResolver,w.portal,g]);return jsxRuntime.jsx(di.Provider,{value:h,children:jsxRuntime.jsx(dn.Provider,{value:T,children:jsxRuntime.jsx(vs.Provider,{value:C,children:jsxRuntime.jsx(Ia.Provider,{value:R,children:e})})})})}a(kh,"MonkeysProvider");function m(...e){return tailwindMerge.twMerge(e.filter(Boolean).join(" "))}a(m,"cn");function V(e){return e!=null&&typeof e!="boolean"}a(V,"hasRenderableNode");function Md(e){return typeof e=="string"?e.trim().length>0:V(e)}a(Md,"hasNonEmptyRenderableNode");var JT={"bottom-start":{side:"bottom",align:"start"},"bottom-end":{side:"bottom",align:"end"},"top-start":{side:"top",align:"start"},"top-end":{side:"top",align:"end"}};function sm(e,t=0){return e.flatMap(o=>[{...o,depth:t},...o.children?sm(o.children,t+1):[]])}a(sm,"flattenOptions");function eN(e){let t=new Set;sm(e).forEach(o=>{if(!o||typeof o!="object")throw new TypeError("UnifiedDropdown options must contain objects.");if(typeof o.value!="string"||!o.value.trim())throw new TypeError("UnifiedDropdown option value must be a non-empty string.");if(t.has(o.value))throw new TypeError(`UnifiedDropdown option value "${o.value}" must be unique.`);t.add(o.value);});}a(eN,"validateOptions");function tN(e){let t=Array.isArray(e)?e:e===void 0?[]:[e];return [...new Set(t.filter(o=>typeof o=="string"))]}a(tN,"normalizeValues");function Nh(e){return e.textValue?e.textValue:typeof e.label=="string"?e.label:e.value}a(Nh,"getOptionText");function fi(e){return e==="multi"||e==="checkbox"}a(fi,"isMultiMode");function oN(e,t){return Nh(e).toLocaleLowerCase().includes(t.toLocaleLowerCase())}a(oN,"matchesSearch");function Th(e,t,o){if(t!==void 0&&(fi(e)?!Array.isArray(t):typeof t!="string"))throw new TypeError(`UnifiedDropdown ${o} must be ${fi(e)?"a string array":"a string"} in ${e} mode.`)}a(Th,"validateValueShape");var Rh=ho.forwardRef(a(function({mode:t,options:o=[],groups:r=[],value:n,defaultValue:i,placeholder:s="Select\u2026",trigger:l,triggerLabel:d,searchPlaceholder:c="Search\u2026",emptyLabel:p="No options",loadingLabel:u="Loading\u2026",clearLabel:g="Clear selection",retryLabel:f="Retry",loading:b=false,error:x,searchable:y=t==="searchable",clearable:k=false,maxSelections:w,disabled:v=false,invalid:h=false,open:S,defaultOpen:T=false,placement:C="bottom-start",closeOnSelect:R=t!=="multi"&&t!=="checkbox",portal:M=true,size:I="default",width:A="trigger",appearance:N,className:D,classNames:E,slots:P,style:W,onOpenChange:H,onValueChange:B,onSelect:L,onAction:F,onClear:_,onRetry:$,...G},z){if(!["single","multi","searchable","radio","checkbox","tree","action"].includes(t))throw new TypeError(`UnifiedDropdown mode "${String(t)}" is not supported.`);let re=ho.useMemo(()=>r.reduce((te,Te)=>{let ze=typeof Te.label=="string"?Te.label:Te.value;return te.push(...Te.options.map(je=>({...je,group:je.group??ze}))),te},[...o]),[r,o]);if(eN(re),w!==void 0&&(!Number.isFinite(w)||w<0))throw new TypeError("UnifiedDropdown maxSelections must be a non-negative finite number.");if(t==="action"&&(n!==void 0||i!==void 0))throw new TypeError("UnifiedDropdown action mode does not accept a value.");t!=="action"&&(Th(t,n,"value"),Th(t,i,"defaultValue"));let Z=ho.useId(),ae=`${Z}-trigger`,ee=`${Z}-listbox`,q=`${Z}-search`,U=ho.useRef(null),X=ho.useRef([]),[O,K]=ho.useState(T),[ne,fe]=ho.useState(i??(fi(t)?[]:"")),[he,me]=ho.useState(""),[ie,be]=ho.useState(0),He=S!==void 0,We=He?S:O,Ke=tN(n??ne),ce=ho.useMemo(()=>sm(re),[re]),Q=ho.useMemo(()=>y?ce.filter(te=>oN(te,he)):ce,[ce,he,y]),ge=ho.useMemo(()=>new Set(Ke),[Ke]),we=ce.filter(te=>ge.has(te.value)),Ie=we.map(Nh).join(", "),oe=d??(Ie||s),xe=we.length===0&&!d,{side:Ve,align:_e}=JT[C],Ge=t==="action",le=t==="radio"||t==="checkbox",Me=Ge||le?"menu":"listbox";ho.useEffect(()=>{We&&be(0);},[We,he]);let Ae=a(te=>{v||(He||K(te),H?.(te));},"setOpen"),J=a(te=>{n===void 0&&fe(te),B?.(te);},"commitValue"),$e=a(te=>{if(!(v||te.disabled)){if(L?.(te),t==="action"){R&&Ae(false),F&&queueMicrotask(()=>F(te));return}if(fi(t)){let Te=ge.has(te.value)?Ke.filter(ze=>ze!==te.value):w!==void 0&&Ke.length>=w?Ke:[...Ke,te.value];J(Te);}else J(te.value);R&&!fi(t)&&Ae(false);}},"selectOption"),ue=a(te=>{if(!v&&(te.key==="ArrowDown"||te.key==="ArrowUp")){te.preventDefault(),We||Ae(true);let Te=te.key==="ArrowDown"?1:-1;be(ze=>Math.max(0,Math.min(Q.length-1,ze+Te)));}},"handleTriggerKeyDown"),Re=a(te=>{if(te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();let Te=te.key==="ArrowDown"?1:-1;be(ze=>{let je=ze+Te;return Math.max(0,Math.min(Q.length-1,je))});}te.key==="Enter"&&Q[ie]&&(te.preventDefault(),$e(Q[ie]));},"handleContentKeyDown");ho.useEffect(()=>{We&&X.current[ie]?.scrollIntoView({block:"nearest"});},[ie,We]);let se=a(()=>{J(fi(t)?[]:""),_?.();},"clearSelection");return jsxRuntime.jsx(_n__namespace.Root,{open:We,onOpenChange:Ae,children:jsxRuntime.jsxs("div",{...G,ref:z,className:m("relative inline-flex min-w-0",D),style:W,"data-monkeys-component":"unified-dropdown","data-mode":t,"data-state":We?"open":"closed","data-invalid":h||void 0,"data-disabled":v||void 0,"data-appearance-preset":N?.preset,"data-appearance-variant":N?.variant,"data-appearance-density":N?.density,"data-appearance-radius":N?.radius,children:[jsxRuntime.jsx(_n__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{ref:U,id:ae,type:"button",disabled:v,"aria-expanded":We,"aria-haspopup":Ge||le?"menu":"listbox","aria-controls":We?ee:void 0,"aria-invalid":h||void 0,onKeyDown:ue,className:m("flex min-w-0 items-center justify-between gap-2 rounded-md border border-input bg-control-surface px-3 text-left text-sm text-foreground shadow-sm outline-hidden transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-control-surface","disabled:cursor-not-allowed disabled:opacity-50",I==="sm"?"h-8 py-1 text-xs":"h-10 py-2",h&&"border-destructive focus-visible:ring-destructive",A==="responsive"&&"w-full sm:w-auto",E?.trigger),children:[l?jsxRuntime.jsx("span",{className:"min-w-0 shrink-0",children:l}):null,jsxRuntime.jsx("span",{className:m("min-w-0 flex-1 truncate",xe&&"text-muted-foreground"),children:oe}),jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 opacity-60"})]})}),(()=>{let te=jsxRuntime.jsxs(_n__namespace.Content,{id:ee,side:Ve,align:_e,sideOffset:6,collisionPadding:8,avoidCollisions:true,onKeyDown:Re,onOpenAutoFocus:Te=>{Te.preventDefault(),(y?document.getElementById(q):X.current[0])?.focus();},tabIndex:-1,className:m("z-50 max-h-[min(24rem,calc(100vh-1rem))] max-w-[calc(100vw-1rem)] overflow-y-auto rounded-md border bg-menu-surface p-1 text-popover-foreground shadow-md outline-hidden",A==="trigger"&&"w-[var(--radix-popover-trigger-width)] min-w-[12rem]",A==="content"&&"min-w-[12rem] max-w-[min(32rem,calc(100vw-1rem))]",A==="responsive"&&"w-[min(var(--radix-popover-trigger-width),calc(100vw-1rem))] min-w-[12rem]",E?.content),children:[y?jsxRuntime.jsxs("div",{className:"relative mb-1",children:[jsxRuntime.jsx(lucideReact.Search,{"aria-hidden":"true",className:"pointer-events-none absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),jsxRuntime.jsx("input",{id:q,value:he,onChange:Te=>me(Te.target.value),placeholder:c,"aria-label":c,className:m("h-9 w-full rounded-sm border-0 bg-transparent pl-8 pr-2 text-sm outline-hidden ring-0 placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring",E?.search)})]}):null,k&&we.length>0?jsxRuntime.jsx("button",{type:"button",className:"mb-1 w-full rounded-sm px-2 py-1 text-left text-xs text-muted-foreground hover:bg-accent",onClick:se,children:g}):null,b&&Q.length===0?P?.loading?P.loading():jsxRuntime.jsx("div",{role:"status",className:m("px-2 py-6 text-center text-sm text-muted-foreground",E?.empty),children:u}):x&&Q.length===0?P?.error?P.error():jsxRuntime.jsxs("div",{role:"alert",className:m("px-2 py-6 text-center text-sm text-destructive-text",E?.empty),children:[x,$?jsxRuntime.jsx("button",{type:"button",className:"mt-2 block w-full text-center text-foreground underline",onClick:$,children:f}):null]}):Q.length===0?P?.empty?P.empty():jsxRuntime.jsx("div",{role:"status",className:m("px-2 py-6 text-center text-sm text-muted-foreground",E?.empty),children:p}):jsxRuntime.jsx("div",{role:t==="tree"?"tree":Me,"aria-multiselectable":t==="multi"||void 0,children:Q.map((Te,ze)=>{let je=ge.has(Te.value),it=t==="radio"?jsxRuntime.jsx(lucideReact.Circle,{"aria-hidden":"true",className:m("h-3.5 w-3.5",je&&"fill-current")}):jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"});return jsxRuntime.jsxs("div",{children:[Te.group&&(ze===0||Q[ze-1]?.group!==Te.group)?jsxRuntime.jsx("div",{role:"presentation",className:m("px-2 pb-1 pt-2 text-xs font-medium text-muted-foreground",E?.groupLabel),children:Te.group}):null,jsxRuntime.jsxs("button",{ref:Y=>{X.current[ze]=Y;},type:"button",role:t==="tree"?"treeitem":t==="radio"?"menuitemradio":t==="checkbox"?"menuitemcheckbox":Ge?"menuitem":"option","aria-level":t==="tree"?Te.depth+1:void 0,"aria-selected":!Ge&&!le?je:void 0,"aria-checked":le?je:void 0,disabled:Te.disabled,"data-highlighted":ze===ie||void 0,"data-state":je?"checked":"unchecked",onMouseEnter:()=>be(ze),onClick:()=>$e(Te),className:m("relative flex min-h-9 w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm outline-hidden transition-colors","hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50",ze===ie&&"bg-accent text-accent-foreground",je&&"font-medium",Te.danger&&"text-destructive-text",t!=="action"&&"pl-8",E?.item),style:t==="tree"?{paddingInlineStart:`${8+Te.depth*16}px`}:void 0,children:[t!=="action"?jsxRuntime.jsx("span",{className:"absolute left-2 flex h-4 w-4 items-center justify-center",children:je?it:null}):null,P?.option?P.option({option:Te,selected:je,highlighted:ze===ie}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[Te.icon?jsxRuntime.jsx("span",{className:"shrink-0",children:Te.icon}):null,jsxRuntime.jsx("span",{className:m("min-w-0 flex-1 truncate",E?.itemLabel),children:Te.label}),Te.description?jsxRuntime.jsx("span",{className:m("max-w-[45%] truncate text-xs text-muted-foreground",E?.itemDescription),children:Te.description}):null]})]})]},Te.value)})}),x&&Q.length>0?jsxRuntime.jsx("div",{role:"status",className:"px-2 py-1 text-xs text-destructive-text",children:x}):null,b&&Q.length>0?jsxRuntime.jsx("div",{role:"status",className:"px-2 py-1 text-xs text-muted-foreground",children:u}):null,P?.footer?P.footer():null]});return M?jsxRuntime.jsx(_n__namespace.Portal,{children:te}):te})()]})})},"UnifiedDropdown"));var Mh=ho.createContext(void 0);function Ih({appearance:e,children:t}){return jsxRuntime.jsx(Mh.Provider,{value:e,children:t})}a(Ih,"DataExplorerAppearanceProvider");function Et(e){let t=ho.useContext(Mh);return ho.useMemo(()=>e?t?{...t,...e,slots:{...t.slots,...e.slots},styles:{...t.styles,...e.styles}}:e:t,[e,t])}a(Et,"useDataExplorerAppearance");function j(...e){return e.filter(Boolean).join(" ")}a(j,"cn");function Mt(e,t){return typeof e=="function"?e(t):e}a(Mt,"resolveDataExplorerValue");var lN={},Ph={surfaceRoot:"relative flex h-full min-h-0 w-full min-w-0 overflow-hidden rounded-md border border-border bg-background shadow-sm",toolbarRoot:"flex flex-wrap items-center gap-2 border-b border-border bg-background px-4 py-3",toolbarLeading:"flex items-center gap-2",toolbarSearch:"flex h-10 min-w-52 flex-1 items-center gap-2 rounded-md border border-border bg-background px-3 text-sm",toolbarSearchIcon:"inline-flex shrink-0 text-muted-foreground",toolbarSearchInput:"min-w-0 flex-1 bg-transparent text-sm outline-hidden placeholder:text-muted-foreground",toolbarViewSwitch:"flex items-center rounded-md border border-border bg-background p-0.5",toolbarViewButton:"inline-flex h-9 min-w-9 items-center justify-center gap-2 rounded-md px-2 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50",toolbarViewButtonActive:"bg-muted text-foreground",toolbarActions:"flex items-center gap-2",actionBarRoot:"flex min-w-0 flex-wrap items-center gap-2",actionBarLeading:"flex shrink-0 items-center gap-2",actionBarActions:"flex min-w-0 flex-1 flex-wrap items-center gap-2",actionBarTrailing:"flex shrink-0 items-center gap-2",actionButtonBase:"inline-flex h-9 items-center justify-center gap-2 rounded-md border px-3 text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",actionButtonDefault:"border-border bg-background text-foreground hover:bg-accent/60",actionButtonPrimary:"border-primary/20 bg-primary/10 text-primary hover:bg-primary/15",actionButtonDanger:"border-destructive/20 bg-destructive/10 text-destructive-text hover:bg-destructive/15",actionButtonMuted:"border-border/60 bg-muted/45 text-muted-foreground hover:bg-muted/70 hover:text-foreground",actionButtonActive:"ring-1 ring-primary/30",actionButtonDisabled:"cursor-not-allowed opacity-60",actionIconButton:"w-9 px-0",actionToggleActive:"border-primary/30 bg-primary/10 text-primary",controlButton:"inline-flex h-10 min-w-0 items-center justify-center gap-2 rounded-md border border-border bg-background px-3 text-sm font-medium text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",controlButtonIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current [&_svg_*]:!stroke-current",controlButtonLabel:"min-w-0 truncate",controlSelectTrigger:"inline-flex h-10 min-w-28 items-center justify-between gap-3 rounded-md border border-border bg-background px-3 text-sm font-medium text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",controlSelectValue:"flex min-w-0 items-center gap-1 truncate",controlCheckbox:"inline-flex h-9 items-center gap-2 rounded-md border border-border bg-background px-3 text-sm font-medium text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",controlCheckboxIndicator:"flex h-4 w-4 shrink-0 items-center justify-center rounded border border-border bg-background text-primary",controlCheckboxLabel:"min-w-0 truncate",menuTrigger:"inline-flex h-8 w-8 items-center justify-center rounded-md text-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",menuContent:"z-50 min-w-36 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-hidden",menuLabel:"px-2 py-1.5 text-xs font-medium text-muted-foreground",menuSeparator:"-mx-1 my-1 h-px bg-border",menuItem:"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",menuItemPrimary:"text-primary focus:text-primary",menuItemDanger:"text-destructive-text focus:text-destructive-text",menuItemMuted:"text-muted-foreground",menuItemIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center",menuItemLabel:"truncate",cardRoot:"group relative flex min-w-0 flex-col overflow-hidden rounded-lg border border-border/70 bg-background transition-shadow",cardInteractive:"cursor-pointer hover:shadow-sm",cardSelected:"ring-2 ring-primary",cardDisabled:"opacity-60",cardHeader:"p-4",cardMedia:"shrink-0 overflow-hidden",cardFooter:"shrink-0 border-t border-border/60 px-4 py-3",recordCardRoot:"group relative border-border/70 transition-shadow hover:shadow-sm",recordCardActive:"z-10 ring-2 ring-monkeys-500",footerRoot:"flex items-center border-t border-border bg-background px-4 py-3",footerSummary:"flex items-center gap-1 whitespace-nowrap text-sm text-muted-foreground",footerJumpButton:"inline-flex items-center gap-1 text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",footerPageSizeSelect:"h-8 rounded-md border border-border bg-background px-2 text-sm text-foreground",previewRoot:"relative h-full min-h-0 w-full flex-1 select-none self-stretch overflow-hidden bg-slate-950",previewPlaceholder:"flex h-full w-full items-center justify-center rounded-xl bg-white/5 px-6 text-center text-sm text-white/60",previewActions:"absolute right-4 top-4 z-20 flex flex-col gap-2",previewControls:"absolute bottom-4 right-4 z-20 flex flex-col gap-2",previewZoomLabel:"min-w-[3rem] rounded-full border border-white/15 bg-black/30 px-1 py-1 text-center text-xs font-medium text-white/70 shadow-lg backdrop-blur",previewControlButton:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur transition hover:bg-black/45",previewNavigationButton:"absolute top-1/2 flex h-10 w-10 -translate-y-1/2 items-center justify-center rounded-full border border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur transition-colors hover:bg-black/45 disabled:pointer-events-none disabled:opacity-40",detailRoot:"flex h-full flex-col overflow-hidden bg-background",detailHeader:"flex items-center justify-between gap-3 border-b border-border bg-background px-4 py-4 sm:px-5",detailLeading:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",detailNavigation:"hidden items-center gap-1 rounded-lg border border-border bg-background px-1 py-1 md:flex",detailNavigationButton:"flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-50",detailCloseButton:"flex h-10 w-10 items-center justify-center rounded-full border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",detailPreviewPanel:"min-h-0 overflow-hidden border-b border-border bg-background xl:border-b-0",detailPreviewFrame:"relative h-full min-h-0 w-full overflow-hidden bg-background",detailRightPanel:"min-h-0 min-w-0 border-t border-border bg-background xl:border-l xl:border-t-0",detailRightPanelBody:"h-full overflow-y-auto overscroll-contain bg-background p-5",treeShellRoot:"flex h-full min-h-0 flex-col overflow-hidden",treeShellHeader:"flex shrink-0 items-start justify-between gap-3 px-4 py-3",treeShellTitle:"truncate text-sm font-semibold",treeShellSubtitle:"mt-1 text-sm text-muted-foreground",treeShellToolbar:"flex shrink-0 items-center gap-2",treeShellBody:"min-h-0 flex-1 overflow-hidden",treeShellFooter:"shrink-0",treeRoot:"min-w-0 space-y-1 overflow-hidden text-sm",treeGroup:"min-w-0 space-y-1",treeGroupHeader:"group/tree-group flex min-w-0 items-center gap-1",treeGroupHeaderButton:"flex h-9 min-w-0 flex-1 items-center gap-2 rounded-md px-2 text-left font-medium text-muted-foreground transition-colors hover:bg-accent/55 hover:text-foreground",treeGroupContent:"min-w-0 space-y-0.5",treeGroupActions:"shrink-0 opacity-0 transition-opacity group-hover/tree-group:opacity-100 data-[state=open]:opacity-100",treeNode:"min-w-0",treeNodeButton:"group/tree-node flex min-h-9 w-full min-w-0 items-center gap-1 rounded-md pr-1 text-left text-sm text-foreground transition-colors hover:bg-accent/55 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",treeNodeSelected:"bg-accent text-accent-foreground",treeNodeDisabled:"cursor-not-allowed opacity-55",treeNodeDragging:"opacity-50",treeNodeToggle:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",treeNodeIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground group-hover/tree-node:text-foreground",treeNodeLabel:"min-w-0 truncate",treeNodeDescription:"mt-0.5 truncate text-xs text-muted-foreground",treeNodeMeta:"ml-2 shrink-0 text-xs text-muted-foreground",treeNodeBadge:"ml-2 shrink-0 rounded-full border border-border bg-muted px-1.5 py-0.5 text-[11px] leading-none text-muted-foreground",treeNodeActions:"ml-1 shrink-0 opacity-0 transition-opacity group-hover/tree-node:opacity-100 data-[state=open]:opacity-100",treeNodeChildren:"mt-0.5 min-w-0 space-y-0.5",treeNodeDragHandle:"inline-flex h-5 w-5 shrink-0 cursor-grab items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground active:cursor-grabbing group-hover/tree-node:opacity-100",treeEmpty:"px-3 py-2 text-xs text-muted-foreground",treeError:"px-3 py-2 text-xs text-destructive-text",treeLoading:"px-3 py-2 text-xs text-muted-foreground"},dN={flush:{surfaceRoot:"relative flex h-full min-h-0 w-full min-w-0 overflow-hidden"}},cN={compact:{treeShellHeader:"px-3 py-2",toolbarRoot:"px-3 py-2",toolbarSearch:"h-9 min-w-48",toolbarViewButton:"h-8 min-w-8 text-xs",actionButtonBase:"h-8 px-2.5 text-xs",actionIconButton:"h-8 w-8 px-0",controlButton:"h-9 px-2.5 text-xs",controlSelectTrigger:"h-9 min-w-24 px-2.5 text-xs",controlCheckbox:"h-8 px-2.5 text-xs",menuTrigger:"h-8 w-8",footerRoot:"px-3 py-2",footerPageSizeSelect:"h-8 text-xs",treeGroupHeaderButton:"h-8 text-xs",treeNodeButton:"min-h-8 text-xs",treeEmpty:"py-1.5 text-xs",treeError:"py-1.5 text-xs",treeLoading:"py-1.5 text-xs"},default:{},comfortable:{treeShellHeader:"px-5 py-4",toolbarRoot:"px-5 py-4",toolbarSearch:"h-11",toolbarViewButton:"h-10 min-w-10",actionButtonBase:"h-10 px-3.5",actionIconButton:"h-10 w-10 px-0",controlButton:"h-11 px-3.5",controlSelectTrigger:"h-11 min-w-32 px-3.5",controlCheckbox:"h-10 px-3.5",menuTrigger:"h-9 w-9",footerRoot:"px-5 py-3.5",treeGroupHeaderButton:"h-10",treeNodeButton:"min-h-10"}},uN={none:{surfaceRoot:"rounded-none",toolbarSearch:"rounded-none",toolbarViewSwitch:"rounded-none",toolbarViewButton:"rounded-none",actionButtonBase:"rounded-none",controlButton:"rounded-none",controlSelectTrigger:"rounded-none",controlCheckbox:"rounded-none",controlCheckboxIndicator:"rounded-none",menuTrigger:"rounded-none",menuContent:"rounded-none",menuItem:"rounded-none",cardRoot:"rounded-none",footerPageSizeSelect:"rounded-none",detailLeading:"rounded-none",detailNavigation:"rounded-none",detailNavigationButton:"rounded-none",detailCloseButton:"rounded-none",treeGroupHeaderButton:"rounded-none",treeNodeButton:"rounded-none",treeNodeToggle:"rounded-none",treeNodeBadge:"rounded-none",treeNodeDragHandle:"rounded-none"},sm:{surfaceRoot:"rounded-sm",toolbarSearch:"rounded-sm",toolbarViewSwitch:"rounded-sm",toolbarViewButton:"rounded-sm",actionButtonBase:"rounded-sm",controlButton:"rounded-sm",controlSelectTrigger:"rounded-sm",controlCheckbox:"rounded-sm",controlCheckboxIndicator:"rounded-sm",menuTrigger:"rounded-sm",menuContent:"rounded-sm",menuItem:"rounded-sm",cardRoot:"rounded-sm",treeGroupHeaderButton:"rounded-sm",treeNodeButton:"rounded-sm",treeNodeToggle:"rounded-sm",treeNodeBadge:"rounded-sm",treeNodeDragHandle:"rounded-sm"},md:{},lg:{surfaceRoot:"rounded-xl",toolbarSearch:"rounded-lg",toolbarViewSwitch:"rounded-lg",toolbarViewButton:"rounded-lg",actionButtonBase:"rounded-lg",controlButton:"rounded-lg",controlSelectTrigger:"rounded-lg",controlCheckbox:"rounded-lg",controlCheckboxIndicator:"rounded-md",menuTrigger:"rounded-lg",menuContent:"rounded-lg",cardRoot:"rounded-xl",treeGroupHeaderButton:"rounded-lg",treeNodeButton:"rounded-lg",treeNodeToggle:"rounded-md",treeNodeBadge:"rounded-lg",treeNodeDragHandle:"rounded-md"},xl:{surfaceRoot:"rounded-2xl",toolbarSearch:"rounded-xl",toolbarViewSwitch:"rounded-xl",toolbarViewButton:"rounded-xl",actionButtonBase:"rounded-xl",controlButton:"rounded-xl",controlSelectTrigger:"rounded-xl",controlCheckbox:"rounded-xl",controlCheckboxIndicator:"rounded-lg",menuTrigger:"rounded-xl",menuContent:"rounded-xl",cardRoot:"rounded-2xl",treeGroupHeaderButton:"rounded-xl",treeNodeButton:"rounded-xl",treeNodeToggle:"rounded-lg",treeNodeBadge:"rounded-xl",treeNodeDragHandle:"rounded-lg"},full:{surfaceRoot:"rounded-2xl",toolbarSearch:"rounded-full",toolbarViewSwitch:"rounded-full",toolbarViewButton:"rounded-full",actionButtonBase:"rounded-full",controlButton:"rounded-full",controlSelectTrigger:"rounded-full",controlCheckbox:"rounded-full",controlCheckboxIndicator:"rounded-full",menuTrigger:"rounded-full",cardRoot:"rounded-2xl",treeGroupHeaderButton:"rounded-full",treeNodeButton:"rounded-full",treeNodeToggle:"rounded-full",treeNodeBadge:"rounded-full",treeNodeDragHandle:"rounded-full"}},pN={none:{surfaceRoot:"border-transparent",toolbarRoot:"border-transparent",toolbarSearch:"border-transparent",toolbarViewSwitch:"border-transparent",actionButtonBase:"border-transparent",controlButton:"border-transparent",controlSelectTrigger:"border-transparent",controlCheckbox:"border-transparent",cardRoot:"border-transparent",footerRoot:"border-transparent",detailHeader:"border-transparent",detailPreviewPanel:"border-transparent",detailRightPanel:"border-transparent"},subtle:{surfaceRoot:"border-border/60",toolbarRoot:"border-border/60",toolbarSearch:"border-border/60",toolbarViewSwitch:"border-border/60",actionButtonDefault:"border-border/60",controlButton:"border-border/60",controlSelectTrigger:"border-border/60",controlCheckbox:"border-border/60",cardRoot:"border-border/60",footerRoot:"border-border/60"},solid:{},strong:{surfaceRoot:"border-foreground/20",toolbarRoot:"border-foreground/20",toolbarSearch:"border-foreground/20",toolbarViewSwitch:"border-foreground/20",actionButtonDefault:"border-foreground/20",controlButton:"border-foreground/20",controlSelectTrigger:"border-foreground/20",controlCheckbox:"border-foreground/20",cardRoot:"border-foreground/20",footerRoot:"border-foreground/20"}},mN={plain:{},muted:{surfaceRoot:"bg-card",toolbarRoot:"bg-muted/20",toolbarSearch:"bg-background",toolbarViewSwitch:"bg-background",controlButton:"bg-background",controlSelectTrigger:"bg-background",controlCheckbox:"bg-background",cardRoot:"bg-card",footerRoot:"bg-muted/20",detailHeader:"bg-muted/20"},soft:{surfaceRoot:"bg-background/95 shadow-sm",toolbarRoot:"bg-background/95",actionButtonDefault:"bg-muted/30 hover:bg-muted/55",controlButton:"bg-muted/30 hover:bg-muted/55",controlSelectTrigger:"bg-muted/30 hover:bg-muted/55",controlCheckbox:"bg-muted/30 hover:bg-muted/55",cardRoot:"bg-background/95 shadow-sm",footerRoot:"bg-background/95"},glass:{surfaceRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",toolbarRoot:"border-white/10 bg-white/5 backdrop-blur-md",toolbarSearch:"border-white/10 bg-white/5",toolbarViewSwitch:"border-white/10 bg-white/5",actionButtonDefault:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlButton:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlSelectTrigger:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlCheckbox:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlCheckboxIndicator:"border-white/15 bg-white/10",cardRoot:"border-white/10 bg-white/[0.06] shadow-none",footerRoot:"border-white/10 bg-white/5 backdrop-blur-md"},"dark-stage":{previewRoot:"bg-slate-950",previewPlaceholder:"bg-white/5 text-white/60",actionButtonBase:"inline-flex h-9 items-center justify-center gap-2 rounded-full border px-3 text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-white/45 focus-visible:ring-offset-0",actionButtonDefault:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",controlButton:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",controlSelectTrigger:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",controlCheckbox:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",actionButtonPrimary:"border-white/25 bg-white/20 text-white shadow-lg backdrop-blur hover:bg-white/28",actionButtonMuted:"border-white/10 bg-black/20 text-white/70 shadow-lg backdrop-blur hover:bg-black/[0.35] hover:text-white",actionIconButton:"h-9 w-9 px-0"}},Dh={default:{density:"default",radius:"md",border:"solid",background:"plain"},soft:{density:"default",radius:"md",border:"subtle",background:"plain"},compact:{density:"compact",radius:"md",border:"subtle",background:"soft"},"tinted-glass":{density:"default",radius:"lg",border:"subtle",background:"glass"},flat:{density:"compact",radius:"none",border:"solid",background:"plain"},glass:{density:"default",radius:"lg",border:"subtle",background:"glass"},"hard-edge":{density:"compact",radius:"none",border:"solid",background:"plain"}},fN={soft:{actionButtonBase:"font-medium",controlButton:"font-medium",controlSelectTrigger:"font-medium",controlCheckbox:"font-medium",menuTrigger:"rounded-full",cardRoot:"border-border/70"},compact:{toolbarRoot:"gap-2",actionButtonBase:"text-xs",controlButton:"text-xs",controlSelectTrigger:"text-xs",controlCheckbox:"text-xs",footerRoot:"text-xs"},"tinted-glass":{actionButtonDefault:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",actionButtonPrimary:"border-primary/30 bg-primary/15 text-primary-foreground hover:bg-primary/20",actionButtonMuted:"border-border/50 bg-muted/20 text-muted-foreground hover:bg-muted/45 hover:text-foreground",controlButton:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",controlSelectTrigger:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",controlCheckbox:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",controlCheckboxIndicator:"border-border/60 bg-background/10 text-primary",menuContent:"border-border bg-popover text-popover-foreground shadow-2xl",menuSeparator:"bg-border",menuItem:"focus:bg-accent focus:text-accent-foreground",cardSelected:"ring-2 ring-primary",previewRoot:"bg-background",treeGroupHeaderButton:"text-muted-foreground hover:bg-accent/60 hover:text-foreground",treeNodeButton:"text-foreground hover:bg-accent/60 hover:text-accent-foreground focus-visible:ring-ring",treeNodeSelected:"bg-accent text-accent-foreground",treeNodeToggle:"text-muted-foreground hover:bg-accent hover:text-foreground",treeNodeIcon:"text-muted-foreground group-hover/tree-node:text-foreground",treeNodeMeta:"text-muted-foreground",treeNodeBadge:"border-border bg-muted text-muted-foreground",treeNodeActions:"text-muted-foreground",treeNodeDragHandle:"text-muted-foreground hover:bg-accent hover:text-foreground group-hover/tree-node:opacity-100",treeEmpty:"text-muted-foreground",treeError:"text-destructive-text",treeLoading:"text-muted-foreground"},flat:{toolbarRoot:"border-slate-200 bg-white",toolbarSearch:"rounded-none border-slate-200 bg-white shadow-none",toolbarViewSwitch:"rounded-none border-slate-200 bg-white shadow-none",actionButtonBase:"rounded-none shadow-none",controlButton:"rounded-none border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",controlSelectTrigger:"rounded-none border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",controlCheckbox:"rounded-none border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",actionButtonDefault:"border-slate-200 bg-white text-slate-700 hover:bg-slate-50",menuTrigger:"rounded-none border border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",menuContent:"rounded-none border-slate-200 bg-white shadow-none",cardRoot:"rounded-none border-slate-200 bg-white shadow-none",footerRoot:"border-slate-200 bg-white",treeRoot:"space-y-1 text-sm",treeGroupHeader:"group/tree-group flex min-w-0 items-center",treeGroupHeaderButton:"h-9 rounded-none px-3 text-slate-600 shadow-none hover:bg-slate-100 hover:text-slate-950",treeGroupContent:"space-y-1",treeNodeButton:"min-h-9 rounded-none text-slate-700 hover:bg-slate-100 hover:text-slate-950 focus-visible:ring-slate-300",treeNodeSelected:"bg-slate-100 text-slate-950",treeNodeToggle:"rounded-none text-slate-500 hover:bg-transparent hover:text-slate-950",treeNodeIcon:"text-slate-500 group-hover/tree-node:text-slate-950",treeNodeDragHandle:"rounded-none text-slate-400 hover:bg-transparent hover:text-slate-700",treeNodeActions:"text-slate-500"},glass:{menuContent:"border-white/10 bg-slate-950/90 text-white backdrop-blur-xl",menuSeparator:"bg-white/10",menuItem:"focus:bg-white/10 focus:text-white"},"hard-edge":{toolbarRoot:"border-slate-200 bg-white",actionButtonBase:"rounded-none shadow-none",controlButton:"rounded-none shadow-none",controlSelectTrigger:"rounded-none shadow-none",controlCheckbox:"rounded-none shadow-none",cardRoot:"rounded-none border-slate-200 bg-white shadow-none",footerRoot:"border-slate-200 bg-white",footerPageSizeSelect:"rounded-none border-slate-200 shadow-none"}},bN=Object.keys(Ph);function gN(...e){return bN.reduce((t,o)=>(t[o]=j(...e.map(r=>r?.[o])),t),{})}a(gN,"mergeSlots");function hN(...e){return e.reduce((t,o)=>({...t,...o}),{})}a(hN,"mergeStyles");function yN(e){let t=Dh[e];if(!t)throw new TypeError(`Unknown Data Explorer theme preset "${String(e)}". Expected one of: ${Object.keys(Dh).join(", ")}.`);return t}a(yN,"getPresetDefaults");function Ct(e){let t=e?.preset??"default",o=e?.surface??"card",r=yN(t),n=e?.density??r.density??"default",i=e?.radius??r.radius??"md",s=e?.border??r.border??"solid",l=e?.background??r.background??"plain",d=gN(Ph,fN[t],cN[n],uN[i],pN[s],mN[l],e?.slots);return o==="flush"&&(d.surfaceRoot=j(dN.flush.surfaceRoot,e?.slots?.surfaceRoot)),{surface:o,preset:t,density:n,radius:i,border:s,background:l,styles:hN(lN,e?.styles),slots:d}}a(Ct,"resolveDataExplorerAppearance");function Pd(e,t,o){return j(t==="primary"?e.slots.actionButtonPrimary:t==="danger"?e.slots.actionButtonDanger:t==="muted"?e.slots.actionButtonMuted:e.slots.actionButtonDefault,o&&e.slots.actionButtonActive)}a(Pd,"getDataExplorerActionToneClassName");function Gn(e,t){if(t==="primary")return e.slots.menuItemPrimary;if(t==="danger")return e.slots.menuItemDanger;if(t==="muted")return e.slots.menuItemMuted}a(Gn,"getDataExplorerMenuItemToneClassName");function vN(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4 animate-spin",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(vN,"LoadingIcon");var ws=ho.forwardRef(a(function({children:t,label:o,icon:r,endIcon:n,type:i="button",title:s,ariaLabel:l,tone:d,active:c=false,iconOnly:p=false,disabled:u=false,loading:g=false,stopPropagation:f=false,appearance:b,className:x,classNames:y,style:k,onClick:w,"aria-label":v,...h},S){let T=Ct(Et(b)),C=t??o,R=u||g,M=a(I=>{f&&I.stopPropagation(),!R&&w?.(I);},"handleClick");return jsxRuntime.jsxs("button",{...h,ref:S,type:i,title:s,"aria-label":l??v,"aria-pressed":c||void 0,"aria-busy":g||void 0,disabled:R,className:j(T.slots.controlButton,p&&T.slots.actionIconButton,Pd(T,d,c),R&&T.slots.actionButtonDisabled,y?.root,x),style:{...T.styles.control,...c?T.styles.controlActive:void 0,...R?T.styles.controlDisabled:void 0,...k},onClick:M,children:[g?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonIcon,y?.icon),children:jsxRuntime.jsx(vN,{})}):r?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonIcon,y?.icon),children:r}):null,p?jsxRuntime.jsx("span",{className:"sr-only",children:C}):C?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonLabel,y?.label),children:C}):null,n?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonIcon,y?.icon),children:n}):null]})},"DataExplorerButton"));function wN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",children:jsxRuntime.jsx("path",{d:"m5 12 4 4L19 6"})})}a(wN,"CheckIcon");function Ed({checked:e=false,icon:t,label:o,title:r,disabled:n=false,appearance:i,className:s,classNames:l,style:d,onCheckedChange:c}){let p=Ct(Et(i));return jsxRuntime.jsxs("button",{type:"button",title:r,"aria-pressed":e,disabled:n,className:j(p.slots.controlCheckbox,e&&p.slots.actionToggleActive,n&&p.slots.actionButtonDisabled,l?.root,s),style:{...p.styles.control,...e?p.styles.controlActive:void 0,...n?p.styles.controlDisabled:void 0,...d},onClick:u=>{u.stopPropagation(),!n&&c?.(!e);},children:[jsxRuntime.jsx("span",{className:j(p.slots.controlCheckboxIndicator,l?.indicator,t!=null&&!e&&l?.icon),children:e?jsxRuntime.jsx(wN,{}):t}),o?jsxRuntime.jsx("span",{className:j(p.slots.controlCheckboxLabel,l?.label),children:o}):null]})}a(Ed,"DataExplorerCheckbox");function CN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}a(CN,"ChevronDownIcon");function SN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m5 12 4 4L19 6"})})}a(SN,"CheckIcon");function Bd({value:e="",options:t=[],label:o,placeholder:r="Select",icon:n,title:i,triggerLabel:s,disabled:l=false,display:d="value",align:c="start",sideOffset:p=6,appearance:u,className:g,classNames:f,style:b,onValueChange:x}){let y=Ct(Et(u)),k=t.find(v=>v.value===e),w=d==="label-value"&&o?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{children:o}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:k?.label??r})]}):k?.label??o??r;return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{type:"button",title:i,"aria-label":s,disabled:l||t.length===0,className:j(y.slots.controlSelectTrigger,f?.trigger,f?.root,g),style:{...y.styles.control,...b},onClick:v=>v.stopPropagation(),children:[n?jsxRuntime.jsx("span",{className:j(y.slots.controlButtonIcon,f?.icon),children:n}):null,jsxRuntime.jsx("span",{className:j(y.slots.controlSelectValue,f?.value),children:w}),jsxRuntime.jsx(CN,{})]})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{align:c,sideOffset:p,className:j(y.slots.menuContent,f?.content),style:y.styles.menuContent,onClick:v=>v.stopPropagation(),children:jsxRuntime.jsx(Bt__namespace.RadioGroup,{value:e,onValueChange:v=>{l||x?.(v);},children:t.map(v=>jsxRuntime.jsxs(Bt__namespace.RadioItem,{value:v.value,title:v.title,disabled:v.disabled,className:j(y.slots.menuItem,f?.item),style:y.styles.menuItem,children:[jsxRuntime.jsx("span",{className:j(y.slots.menuItemIcon,f?.itemIcon),children:v.value===e?jsxRuntime.jsx(SN,{}):v.icon}),jsxRuntime.jsx("span",{className:j(y.slots.menuItemLabel,f?.itemLabel),children:v.label})]},v.value))})})})]})}a(Bd,"DataExplorerSelect");function NN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}a(NN,"ChevronDownIcon");function lm(e,t){return Mt(e.disabled,t)??Mt(e.loading,t)??false}a(lm,"resolveActionDisabled");function RN(e){return e.onAction??e.onClick}a(RN,"getActionCallback");function MN(e,t,o,r){let n=(Mt(e.disabled,t)??false)||(Mt(e.loading,t)??false),i=Mt(e.active,t)??false;return jsxRuntime.jsxs("div",{children:[e.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:o.slots.menuSeparator}):null,jsxRuntime.jsxs(Bt__namespace.Item,{title:e.title,disabled:n,className:j(o.slots.menuItem,Gn(o,e.tone),i&&"bg-accent text-accent-foreground",r),style:o.styles.menuItem,onSelect:()=>{!e.onAction||n||e.onAction(t);},children:[e.icon?jsxRuntime.jsx("span",{className:o.slots.menuItemIcon,children:e.icon}):null,jsxRuntime.jsx("span",{className:o.slots.menuItemLabel,children:e.label})]}),e.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:o.slots.menuSeparator}):null]},e.id)}a(MN,"renderMenuItem");function IN(e,t,o,r,n){let i=lm(e,t),s=Mt(e.active,t)??false,l=(e.items??[]).filter(d=>Mt(d.visible,t)??true);return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx(ws,{title:e.title,ariaLabel:e.triggerLabel,disabled:i||l.length===0,label:e.label,icon:e.icon,endIcon:jsxRuntime.jsx(NN,{}),tone:e.tone,active:s,stopPropagation:true,appearance:n,className:r?.action})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{align:e.align??"end",sideOffset:e.sideOffset??6,className:j(o.slots.menuContent,r?.menuContent),style:o.styles.menuContent,onClick:d=>d.stopPropagation(),children:[e.menuLabel?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Bt__namespace.Label,{className:o.slots.menuLabel,children:e.menuLabel}),jsxRuntime.jsx(Bt__namespace.Separator,{className:o.slots.menuSeparator})]}):null,l.map(d=>MN(d,t,o,r?.menuItem))]})})]},e.id)}a(IN,"renderMenuAction");function DN(e,t,o,r){let n=lm(e,t),i=String(Mt(e.value,t)??""),s=e.options??[];return jsxRuntime.jsx(Bd,{value:i,label:e.label,icon:e.icon,title:e.title,triggerLabel:e.triggerLabel,disabled:n,display:e.selectDisplay??"label-value",align:e.align??"end",sideOffset:e.sideOffset??6,options:s.map(l=>({value:l.value,label:l.label,icon:l.icon,title:l.title,disabled:Mt(l.disabled,t)??false})),appearance:r,classNames:{trigger:o?.action,content:o?.menuContent,item:o?.menuItem},onValueChange:l=>{!e.onValueChange||n||e.onValueChange(l,t);}},e.id)}a(DN,"renderSelectAction");function PN(e,t,o,r){let n=e.kind??"button",i=n==="toggle"?Mt(e.checked,t)??Mt(e.active,t)??false:Mt(e.active,t)??false,s=lm(e,t),l=RN(e);return n==="toggle"?jsxRuntime.jsx(Ed,{checked:i,icon:e.icon,label:e.label,title:e.title,disabled:s,appearance:o,className:r,onCheckedChange:d=>{e.onCheckedChange&&e.onCheckedChange(d,t);}},e.id):jsxRuntime.jsx(ws,{label:e.label,icon:e.icon,title:e.title,ariaLabel:n==="icon-button"?e.triggerLabel||e.title:void 0,tone:e.tone,active:i,iconOnly:n==="icon-button",disabled:s,loading:Mt(e.loading,t)??false,stopPropagation:true,appearance:o,className:r,onClick:()=>{l&&l(t);}},e.id)}a(PN,"renderButtonAction");function cn({context:e,actions:t=[],layout:o="action-bar",appearance:r,empty:n,children:i,className:s,classNames:l}){let d=Ct(Et(r)),c=t.filter(u=>Mt(u.visible,e)??true).map(u=>{if(u.render)return jsxRuntime.jsx("div",{children:u.render(e)},u.id);if(u.renderTrigger)return jsxRuntime.jsx("div",{children:u.renderTrigger(e)},u.id);let g=u.kind==="menu"?IN(u,e,d,l,r):u.kind==="select"?DN(u,e,l,r):PN(u,e,r,l?.action);return u.wrapTrigger?jsxRuntime.jsx("div",{children:u.wrapTrigger(g,e)},u.id):g});if(c.length===0&&!i&&!n)return null;let p=o==="action-bar"?d.slots.actionBarActions:o==="toolbar"?d.slots.toolbarActions:"flex items-center gap-2";return jsxRuntime.jsxs("div",{className:j(p,l?.root,s),children:[c,i,c.length===0&&!i?n:null]})}a(cn,"DataExplorerToolbarActions");function Ah({context:e,actions:t=[],leading:o,trailing:r,children:n,empty:i,appearance:s,className:l,classNames:d}){let c=Ct(Et(s)),p=!!o||!!r||!!n||t.length>0;return p||!!i?jsxRuntime.jsxs("div",{className:j(c.slots.actionBarRoot,d?.root,l),children:[o?jsxRuntime.jsx("div",{className:j(c.slots.actionBarLeading,d?.leading),children:o}):null,jsxRuntime.jsx(cn,{context:e,actions:t,layout:"action-bar",appearance:s,empty:p?void 0:i,classNames:{root:d?.actions,action:d?.action},children:n}),r?jsxRuntime.jsx("div",{className:j(c.slots.actionBarTrailing,d?.trailing),children:r}):null]}):null}a(Ah,"DataExplorerActionBar");function Bh(e,t){let o=new WeakMap,r=new Map,n=1;return (...i)=>{let s=i.slice(0,-1),l=i[i.length-1],d=s.map(u=>{if(!u)return 0;let g=o.get(u);return g===void 0&&(g=n++,o.set(u,g)),g}).join(":"),c=r.get(d);if(!c){let u={};for(let g of e)u[g]=t(...s.map(f=>f?.[g]));c=Object.freeze(u),r.size>=64&&r.delete(r.keys().next().value),r.set(d,c);}let p={...c};if(l)for(let u of e){let g=l[u];g&&(p[u]=t(...s.map(f=>f?.[u]),g));}return p}}a(Bh,"createStaticSlotMerger");var BN={},to="motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",xr="motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",Ld="motion-safe:transition-transform motion-safe:duration-300 motion-safe:ease-out",Lh=m("[scrollbar-width:thin]","[scrollbar-color:hsl(var(--muted-foreground)/0.45)_transparent]","[&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2","[&::-webkit-scrollbar-button]:hidden [&::-webkit-scrollbar-button]:h-0 [&::-webkit-scrollbar-button]:w-0 [&::-webkit-scrollbar-button]:bg-transparent","[&::-webkit-scrollbar-button:single-button]:hidden [&::-webkit-scrollbar-button:single-button]:h-0 [&::-webkit-scrollbar-button:single-button]:w-0","[&::-webkit-scrollbar-button:double-button]:hidden [&::-webkit-scrollbar-button:double-button]:h-0 [&::-webkit-scrollbar-button:double-button]:w-0","[&::-webkit-scrollbar-corner]:bg-transparent","[&::-webkit-scrollbar-track]:bg-transparent","[&:has(thead.sticky)::-webkit-scrollbar-track]:mt-[var(--base-table-header-height)]","[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/40","hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/55"),LN=m("[&.sticky_th]:sticky [&.sticky_th]:top-0 [&.sticky_th]:z-[2]","[&.sticky_th]:bg-[var(--base-table-sticky-header-bg)]","[&.sticky_th]:shadow-[inset_0_-1px_0_var(--base-table-header-separator)]"),Fh={buttonBase:m("group/button inline-flex min-w-0 items-center justify-center gap-2 rounded-md border px-3 text-sm font-medium focus-visible:outline-hidden","cursor-pointer disabled:!cursor-not-allowed",xr),buttonDefault:"border-border bg-background text-foreground hover:bg-accent/60",buttonPrimary:"border-primary/20 bg-primary/10 text-primary hover:bg-primary/15",buttonSuccess:"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-[hsl(var(--success,142_72%_29%))] hover:bg-[hsl(var(--success,142_72%_29%)_/_0.15)]",buttonWarning:"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))] hover:bg-[hsl(var(--warning,45_93%_47%)_/_0.15)]",buttonDanger:"border-destructive/20 bg-destructive/10 text-destructive-text hover:bg-destructive/15",buttonMuted:"border-border/60 bg-muted/45 text-muted-foreground hover:bg-muted/70 hover:text-foreground",buttonActive:"border-primary/35 bg-primary/10 text-primary",buttonDisabled:"!cursor-not-allowed opacity-60",buttonIconOnly:"w-9 px-0",buttonIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current [&_svg_*]:!stroke-current",buttonLabel:"min-w-0 truncate",badgeBase:m("inline-flex max-w-full items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium",to),badgeDefault:"border-border/60 bg-background text-foreground",badgePrimary:"border-primary/30 bg-primary/10 text-primary",badgeSuccess:"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-[hsl(var(--success,142_72%_29%))]",badgeWarning:"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))]",badgeDanger:"border-destructive/30 bg-destructive/10 text-destructive-text",badgeMuted:"border-border/60 bg-muted text-muted-foreground",badgeIcon:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",badgeLabel:"min-w-0 truncate",textRoot:"min-w-0 break-words leading-6",textSizeXs:"text-xs",textSizeSm:"text-sm",textSizeMd:"text-base",textSizeLg:"text-lg",textSizeXl:"text-xl",typographyToneDefault:"text-foreground",typographyToneMuted:"text-muted-foreground",typographyTonePrimary:"text-primary",typographyToneSuccess:"text-emerald-700 dark:text-emerald-400",typographyToneWarning:"text-amber-700 dark:text-amber-400",typographyToneDanger:"text-destructive-text",typographyToneInherit:"text-inherit",headingRoot:"min-w-0 break-words font-semibold tracking-tight",headingSizeXs:"text-sm leading-5",headingSizeSm:"text-base leading-6",headingSizeMd:"text-lg leading-7",headingSizeLg:"text-xl leading-7",headingSizeXl:"text-2xl leading-8",headingSize2xl:"text-3xl leading-9",linkRoot:"inline break-words underline decoration-current/40 underline-offset-4 hover:decoration-current focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",codeInline:"rounded border border-border/70 bg-muted/60 px-1.5 py-0.5 font-mono text-[0.875em] leading-[1.45] text-foreground",codeBlock:"m-0 max-w-full overflow-x-auto rounded-md border border-border/70 bg-muted/60 p-4 text-foreground",codeContent:"font-mono text-sm leading-6",kbdRoot:"inline-flex min-h-5 items-center rounded border border-border bg-muted/70 px-1.5 font-mono text-[0.75em] font-medium leading-5 text-foreground shadow-[inset_0_-1px_0_hsl(var(--monkeys-color-border))]",listRoot:"m-0 min-w-0 list-outside break-words ps-5 text-foreground",listSpacingCompact:"[&>li+li]:mt-1",listSpacingDefault:"[&>li+li]:mt-2",listSpacingRelaxed:"[&>li+li]:mt-3",listMarkerNone:"list-none ps-0",listMarkerDisc:"list-disc",listMarkerCircle:"list-[circle]",listMarkerSquare:"list-[square]",listMarkerDecimal:"list-decimal",listMarkerLowerAlpha:"list-[lower-alpha]",listMarkerUpperAlpha:"list-[upper-alpha]",listItem:"min-w-0 ps-1 leading-6 marker:text-muted-foreground",stackRoot:"flex min-w-0 flex-col",inlineRoot:"flex min-w-0 flex-row",gridRoot:"grid min-w-0",containerRoot:"mx-auto w-full min-w-0",aspectRatioRoot:"relative min-w-0 overflow-hidden [&>*]:h-full [&>*]:w-full",spinnerRoot:"inline-flex shrink-0 items-center justify-center text-current align-middle",spinnerIndicator:"h-5 w-5 rounded-full border-2 border-current border-r-transparent motion-safe:animate-spin motion-reduce:animate-none",visuallyHiddenRoot:"sr-only",visuallyHiddenFocusable:"focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-[1000] focus:rounded-md focus:bg-background focus:px-4 focus:py-2 focus:text-foreground focus:shadow-lg focus:outline-hidden focus:ring-2 focus:ring-ring focus-within:not-sr-only focus-within:fixed focus-within:left-4 focus-within:top-4 focus-within:z-[1000] focus-within:rounded-md focus-within:bg-background focus-within:px-4 focus-within:py-2 focus-within:text-foreground focus-within:shadow-lg focus-within:ring-2 focus-within:ring-ring",fieldsetRoot:"min-w-0 border-0 p-0 text-foreground",fieldsetLegend:"min-w-0 text-sm font-semibold leading-6 text-foreground",fieldsetDescription:"mt-1 text-sm leading-5 text-muted-foreground",fieldsetError:"mt-1 text-sm leading-5 text-destructive-text",fieldsetContent:"mt-3 grid min-w-0 gap-3",stepsRoot:"m-0 min-w-0 list-none p-0 text-foreground",stepsHorizontal:"flex w-full max-w-full items-start overflow-x-auto pb-2",stepsVertical:"grid",stepsItem:"relative min-w-0",stepsItemHorizontal:"flex min-w-52 flex-1 items-start",stepsItemVertical:"pb-6 last:pb-0",stepsTrigger:"flex min-w-0 flex-1 items-start gap-3 rounded-md border-0 bg-transparent p-1 text-start text-inherit",stepsTriggerInteractive:"cursor-pointer hover:bg-accent/50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",stepsTriggerDisabled:"!cursor-not-allowed opacity-60",stepsIndicator:"relative z-[1] inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border text-xs font-semibold",stepsIndicatorPending:"border-border bg-background text-muted-foreground",stepsIndicatorCurrent:"border-primary/50 bg-primary/10 text-primary",stepsIndicatorCompleted:"border-primary bg-primary text-primary-foreground",stepsIndicatorError:"border-destructive bg-destructive text-destructive-foreground",stepsContent:"grid min-w-0 gap-1 pt-0.5",stepsLabel:"min-w-0 break-words text-sm font-medium leading-5",stepsDescription:"min-w-0 break-words text-sm leading-5 text-muted-foreground",stepsStatus:"sr-only",stepsConnector:"shrink-0 bg-border",stepsConnectorHorizontal:"mt-3.5 h-px w-8",stepsConnectorVertical:"absolute bottom-0 top-8 start-3.5 w-px -translate-x-1/2",stepsConnectorCompleted:"bg-primary/60",stepsConnectorError:"bg-destructive/60",scrollAreaViewport:"min-h-0 min-w-0",numberInputControl:"tabular-nums",numberInputStepControls:"me-1 flex shrink-0 self-stretch overflow-hidden border-s border-border",numberInputStepButton:"flex min-h-6 w-7 cursor-pointer items-center justify-center border-0 bg-transparent px-1 text-xs leading-none text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:z-[1] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:!cursor-not-allowed disabled:opacity-40",passwordInputControl:"pe-2",passwordInputToggle:"me-1 inline-flex min-h-7 shrink-0 cursor-pointer items-center justify-center rounded px-2 text-xs font-medium text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:!cursor-not-allowed disabled:opacity-40",inputGroupRoot:m("relative flex min-w-0 items-stretch overflow-hidden rounded-md border border-border bg-background text-foreground focus-within:border-primary/50 focus-within:ring-2 focus-within:ring-ring/30",to),inputGroupInvalid:"border-destructive/55 focus-within:border-destructive/70 focus-within:ring-destructive/25",inputGroupDisabled:"!cursor-not-allowed bg-muted/35",inputGroupContent:"flex min-w-0 flex-1 items-stretch [&>*]:min-w-0",inputGroupStartElement:"inline-flex shrink-0 items-center justify-center ps-3 pe-1 text-foreground/75",inputGroupEndElement:"inline-flex shrink-0 items-center justify-center ps-1 pe-3 text-foreground/75",inputGroupStartAddon:"inline-flex max-w-[min(40%,16rem)] shrink-0 items-center overflow-hidden border-e border-border bg-muted/60 px-3 text-sm text-foreground/75 text-ellipsis whitespace-nowrap [&>*]:min-w-0",inputGroupEndAddon:"inline-flex max-w-[min(40%,16rem)] shrink-0 items-center overflow-hidden border-s border-border bg-muted/60 px-3 text-sm text-foreground/75 text-ellipsis whitespace-nowrap [&>*]:min-w-0",panelRoot:m("group relative flex min-w-0 flex-col overflow-hidden rounded-lg border border-border/70 bg-background",xr),panelInteractive:"cursor-pointer hover:shadow-md",panelSelected:"border-primary/45 bg-primary/5",panelDisabled:"!cursor-not-allowed opacity-60",panelMedia:"shrink-0 overflow-hidden",panelHeader:"min-w-0 p-token-lg",panelTitle:"min-w-0 truncate text-sm font-semibold leading-none text-foreground",panelDescription:"mt-1 text-sm leading-5 text-foreground/75",panelBody:"min-w-0 px-token-lg pb-token-lg text-sm text-foreground",panelBodyStandalone:"pt-token-lg",panelFooter:"shrink-0 border-t border-border/60 px-token-lg py-token-md",stateRoot:m("flex min-h-48 flex-col items-center justify-center rounded-lg border border-border/70 bg-background px-6 py-10 text-center",to),stateIcon:"mb-token-lg flex h-12 w-12 items-center justify-center rounded-full bg-muted text-muted-foreground motion-safe:animate-in motion-safe:fade-in",stateTitle:"text-sm font-semibold text-foreground",stateDescription:"mt-2 max-w-md text-sm leading-6 text-muted-foreground",stateActions:"mt-token-xl flex flex-wrap items-center justify-center gap-token-sm",loadingSpinner:"h-5 w-5 motion-safe:animate-spin motion-reduce:animate-none",fieldRoot:"grid min-w-0 gap-token-md",fieldLabelRow:"flex min-w-0 items-center justify-between gap-token-md",fieldLabel:"min-w-0 text-sm font-medium leading-none text-foreground",fieldRequired:"text-destructive-text",fieldDescription:"text-sm leading-5 text-muted-foreground",fieldMessage:"text-sm leading-5 text-muted-foreground",fieldControl:"min-w-0",controlWrapper:m("relative flex min-w-0 items-center rounded-md border border-border bg-background text-foreground focus-within:border-primary/35",to),controlBase:"min-w-0 flex-1 bg-transparent px-3 text-sm text-foreground outline-hidden placeholder:text-muted-foreground disabled:!cursor-not-allowed",controlInput:"h-9",controlTextarea:"min-h-24 resize-y py-2 leading-6",controlSelect:"h-9 cursor-pointer appearance-none pr-9 disabled:!cursor-not-allowed",controlIcon:"pointer-events-none ml-3 inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",controlTrailing:"mr-3 inline-flex shrink-0 items-center justify-center text-muted-foreground",controlInvalid:"border-destructive/45 focus-within:border-destructive/60",controlDisabled:"!cursor-not-allowed opacity-60",controlReadOnly:"bg-muted/35",selectChevron:m("pointer-events-none absolute right-3 top-1/2 h-2 w-2 -translate-y-1/2 rotate-45 border-b border-r border-current text-muted-foreground",Ld),selectMenu:"absolute left-0 right-0 top-[calc(100%+0.375rem)] z-50 max-h-60 overflow-auto rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg outline-hidden",selectOption:m("flex min-h-8 w-full min-w-0 cursor-pointer items-center rounded-sm px-2.5 py-1.5 text-left text-sm text-foreground",xr),selectOptionActive:"bg-accent text-accent-foreground",selectOptionSelected:"bg-primary/10 text-primary",selectOptionDisabled:"!cursor-not-allowed opacity-50",selectPlaceholder:"text-muted-foreground",selectNative:"sr-only",switchRoot:"inline-flex min-w-0 cursor-pointer items-start gap-3",switchInput:"sr-only",switchTrack:m("relative mt-0.5 inline-flex h-6 w-10 shrink-0 items-center rounded-full border border-border bg-muted focus-within:border-primary/35",to),switchThumb:m("h-4 w-4 translate-x-1 rounded-full bg-background shadow-sm",Ld),switchChecked:"border-primary/40 bg-primary/80 text-primary-foreground",switchDisabled:"!cursor-not-allowed opacity-60",switchContent:"grid min-w-0 gap-1",switchLabel:"text-sm font-medium leading-none text-foreground",switchDescription:"text-sm leading-5 text-muted-foreground",checkboxRoot:"inline-flex min-w-0 cursor-pointer items-start gap-3",checkboxInput:"sr-only",checkboxBox:m("mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border border-border bg-background text-primary focus-within:border-primary/40",to),checkboxBoxChecked:"border-primary/45 bg-primary text-primary-foreground",checkboxBoxInvalid:"border-destructive/50",checkboxIndicator:"text-xs font-bold leading-none",checkboxDisabled:"!cursor-not-allowed opacity-60",checkboxContent:"grid min-w-0 gap-1",checkboxLabel:"text-sm font-medium leading-none text-foreground",checkboxDescription:"text-sm leading-5 text-muted-foreground",radioGroupRoot:"grid min-w-0 gap-2",radioOption:m("inline-flex min-w-0 cursor-pointer items-start gap-3 rounded-md border border-border/60 bg-background px-3 py-2 text-sm",xr,"hover:bg-muted/35"),radioInput:"sr-only",radioMarker:m("mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-border bg-background text-primary focus-within:border-primary/40",to),radioMarkerChecked:"border-primary/50 bg-primary/10",radioIndicator:"h-2 w-2 rounded-full bg-primary",radioOptionDisabled:"!cursor-not-allowed opacity-60 hover:bg-background",radioContent:"grid min-w-0 gap-1",radioLabel:"text-sm font-medium leading-none text-foreground",radioDescription:"text-sm leading-5 text-muted-foreground",dialogRoot:"relative",dialogTrigger:"",dialogTriggerDisabled:"!cursor-not-allowed opacity-60",dialogOverlay:"fixed inset-0 z-50 bg-background/70 backdrop-blur-sm motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",dialogContent:"pointer-events-none fixed inset-0 z-50 flex min-h-0 items-center justify-center p-4",dialogPanel:m("pointer-events-auto relative flex max-h-[min(85vh,720px)] w-full max-w-lg min-w-0 flex-col overflow-hidden rounded-lg border border-border/70 bg-background text-foreground shadow-xl","motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-out"),dialogHeader:"grid min-w-0 gap-1 border-b border-border/60 px-5 py-4",dialogTitle:"min-w-0 pr-8 text-base font-semibold leading-6 text-foreground",dialogDescription:"text-sm leading-6 text-muted-foreground",dialogBody:"min-h-0 min-w-0 overflow-auto px-5 py-4 text-sm text-foreground",dialogFooter:"flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border/60 px-5 py-4",dialogClose:m("absolute right-3 top-3 inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-muted/60 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",xr),dropdownRoot:"relative inline-flex min-w-0",dropdownTrigger:"",dropdownTriggerDisabled:"!cursor-not-allowed opacity-60",dropdownMenu:"z-50 min-w-48 overflow-hidden rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",dropdownMenuTop:"bottom-[calc(100%+0.375rem)] top-auto",dropdownMenuEnd:"left-auto right-0",dropdownLabel:"px-2.5 py-1.5 text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground",dropdownSeparator:"my-1 h-px bg-border/70",dropdownItem:m("flex min-w-0 cursor-pointer items-center gap-2 rounded-sm px-2.5 py-2 text-left text-sm text-foreground hover:bg-accent/60 focus:bg-accent/60 data-[highlighted]:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",xr),dropdownItemDanger:"text-destructive-text hover:bg-destructive/10 focus:bg-destructive/10 data-[highlighted]:bg-destructive/10",dropdownItemDisabled:"!cursor-not-allowed opacity-50 hover:bg-transparent focus:bg-transparent data-[highlighted]:bg-transparent",dropdownItemIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center",dropdownItemContent:"grid min-w-0 flex-1 gap-0.5",dropdownItemLabel:"min-w-0 truncate",dropdownItemDescription:"min-w-0 truncate text-xs leading-4 text-muted-foreground",dropdownItemShortcut:"ml-3 shrink-0 text-xs font-medium text-muted-foreground",tooltipRoot:"relative inline-flex min-w-0",tooltipTrigger:"inline-flex min-w-0",tooltipContent:"pointer-events-none z-50 max-w-xs rounded-md border border-border bg-popover px-2.5 py-1.5 text-xs leading-5 text-popover-foreground shadow-lg motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",noticeBase:m("flex min-w-0 gap-3 rounded-lg border px-4 py-3 text-sm",to,"motion-safe:animate-in motion-safe:fade-in"),noticeDefault:"border-border bg-background text-foreground",noticePrimary:"border-primary/25 bg-primary/10 text-primary",noticeSuccess:"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-foreground",noticeWarning:"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))]",noticeDanger:"border-destructive/30 bg-destructive/10 text-destructive-text",noticeMuted:"border-border/60 bg-muted/35 text-muted-foreground",noticeIcon:"mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center motion-safe:animate-in motion-safe:fade-in",noticeTitle:"font-semibold leading-5",noticeDescription:"leading-6",noticeActions:"mt-3 flex flex-wrap items-center gap-2",dividerRoot:m("shrink-0 border-border/70",to),dividerLabel:"mx-3 shrink-0 text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground motion-safe:animate-in motion-safe:fade-in",sectionHeaderRoot:"flex min-w-0 flex-wrap items-start justify-between gap-token-md motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",sectionHeaderContent:"grid min-w-0 gap-1",sectionHeaderEyebrow:"text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground",sectionHeaderTitle:"text-base font-semibold leading-6 text-foreground",sectionHeaderDescription:"max-w-2xl text-sm leading-6 text-muted-foreground",sectionHeaderActions:"flex shrink-0 flex-wrap items-center gap-2",tabsRoot:"grid min-w-0 gap-token-md",tabsList:m("inline-flex min-w-0 flex-wrap items-center gap-token-xs rounded-lg border border-border/70 bg-muted/30 p-token-xs",to),tabsTrigger:m("inline-flex min-w-0 cursor-pointer items-center justify-center rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground hover:bg-background/70 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:ring-offset-1 motion-reduce:transition-none",xr),tabsTriggerActive:"bg-background text-foreground shadow-sm",tabsTriggerDisabled:"!cursor-not-allowed opacity-50 hover:bg-transparent",tabsPanel:"min-w-0 rounded-lg border border-border/70 bg-background p-4 text-sm text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out motion-reduce:transition-none",segmentedRoot:m("inline-flex min-w-0 items-center gap-1 rounded-lg border border-border/70 bg-muted/30 p-1",to),segmentedItem:m("inline-flex min-w-0 cursor-pointer items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground hover:bg-background/70 hover:text-foreground focus-visible:outline-hidden",xr),segmentedItemActive:"bg-background text-foreground shadow-sm",segmentedItemDisabled:"!cursor-not-allowed opacity-50 hover:bg-transparent",progressRoot:"grid min-w-0 gap-2",progressTrack:"h-2 w-full overflow-hidden rounded-full bg-muted",progressIndicator:"h-full rounded-full bg-primary motion-safe:transition-[width] motion-safe:duration-500 motion-safe:ease-out",progressLabelRow:"flex min-w-0 items-center justify-between gap-3",progressLabel:"min-w-0 truncate text-sm font-medium text-foreground",progressValue:"shrink-0 text-xs font-medium text-muted-foreground",skeletonRoot:"relative overflow-hidden rounded-md bg-muted/70",avatarRoot:"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full border border-border bg-muted text-sm font-semibold text-muted-foreground motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",avatarImage:"h-full w-full object-cover",avatarFallback:"flex h-full w-full items-center justify-center bg-muted text-foreground",avatarStatus:"absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-muted-foreground motion-safe:animate-pulse",avatarText:"min-w-0 truncate text-sm font-medium text-foreground",toolbarRoot:m("flex min-w-0 flex-wrap items-center justify-between gap-token-md rounded-lg border border-border/70 bg-background px-token-lg py-token-md",to),toolbarLeading:"flex min-w-0 items-center gap-token-md",toolbarTitle:"min-w-0 truncate text-sm font-semibold text-foreground",toolbarDescription:"mt-0.5 text-sm leading-5 text-muted-foreground",toolbarContent:"min-w-0 flex-1",toolbarActions:"flex shrink-0 flex-wrap items-center gap-token-sm",breadcrumbRoot:"min-w-0 text-sm text-muted-foreground",breadcrumbList:"flex min-w-0 flex-wrap items-center gap-1.5",breadcrumbItem:"inline-flex min-w-0 items-center gap-1.5",breadcrumbLink:"min-w-0 cursor-pointer truncate text-muted-foreground hover:text-foreground disabled:!cursor-not-allowed disabled:opacity-50 aria-disabled:!cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:text-muted-foreground motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",breadcrumbCurrent:"min-w-0 truncate font-medium text-foreground",breadcrumbSeparator:"shrink-0 text-muted-foreground/70",paginationRoot:"flex min-w-0 flex-wrap items-center justify-between gap-3 text-sm",paginationInfo:"min-w-0 text-muted-foreground",paginationControls:"flex min-w-0 flex-wrap items-center justify-end gap-1.5",paginationButton:"inline-flex h-8 min-w-8 cursor-pointer items-center justify-center whitespace-nowrap rounded-md border border-border bg-background px-2.5 text-sm font-medium text-foreground hover:bg-accent/60 disabled:!cursor-not-allowed disabled:opacity-50 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",paginationButtonDisabled:"!cursor-not-allowed opacity-50",paginationPage:"inline-flex h-8 min-w-8 cursor-default items-center justify-center rounded-md bg-muted/50 px-2.5 text-sm font-medium text-foreground hover:bg-muted/50",paginationEllipsis:"inline-flex h-8 min-w-6 items-center justify-center px-1 text-sm text-muted-foreground",descriptionListRoot:"grid min-w-0 gap-3 text-sm",descriptionListItem:"grid min-w-0 gap-1 rounded-md border border-border/60 bg-background px-3 py-2 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out hover:shadow-sm",descriptionListTerm:"min-w-0 truncate text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",descriptionListValue:"min-w-0 text-sm leading-6 text-foreground",accordionRoot:"grid min-w-0 gap-2",accordionItem:"overflow-hidden rounded-lg border border-border/70 bg-background motion-safe:transition motion-safe:duration-300 motion-safe:ease-out motion-reduce:transition-none",accordionTrigger:"flex w-full min-w-0 cursor-pointer items-center justify-between gap-3 px-4 py-3 text-start text-sm font-medium text-foreground hover:bg-muted/40 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:!cursor-not-allowed disabled:opacity-50 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out motion-reduce:transition-none",accordionTriggerIcon:m("h-2 w-2 shrink-0 rotate-45 border-b border-r border-current text-muted-foreground",Ld,"motion-reduce:transition-none"),accordionPanel:"border-t border-border/60 px-4 py-3 text-sm leading-6 text-muted-foreground motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out motion-reduce:animate-none",menuTrigger:"inline-flex min-w-0",menuContent:"z-50 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg outline-hidden motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-out",menuLabel:"px-2 py-1.5 text-xs font-medium text-muted-foreground",menuSeparator:"-mx-1 my-1 h-px bg-border",menuItem:m("relative flex min-h-8 min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm px-2.5 py-1.5 text-sm text-foreground outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:!cursor-not-allowed data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",xr),menuItemDefault:"text-foreground",menuItemPrimary:"text-primary focus:text-primary data-[highlighted]:text-primary",menuItemSuccess:"text-[hsl(var(--success,142_72%_29%))] focus:text-[hsl(var(--success,142_72%_29%))] data-[highlighted]:text-[hsl(var(--success,142_72%_29%))]",menuItemWarning:"text-[hsl(var(--warning-foreground,28_73%_26%))] focus:text-[hsl(var(--warning-foreground,28_73%_26%))] data-[highlighted]:text-[hsl(var(--warning-foreground,28_73%_26%))]",menuItemDanger:"text-destructive-text focus:text-destructive-text data-[highlighted]:text-destructive-text",menuItemMuted:"text-muted-foreground focus:text-foreground data-[highlighted]:text-foreground",menuItemDisabled:"!cursor-not-allowed opacity-50 data-[disabled]:pointer-events-none",menuItemIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center",menuItemLabel:"min-w-0 flex-1 truncate",menuItemShortcut:"ml-4 shrink-0 text-xs font-medium text-muted-foreground",menuCheckboxIndicator:"absolute left-2 inline-flex h-4 w-4 items-center justify-center text-current",menuRadioIndicator:"absolute left-2 inline-flex h-4 w-4 items-center justify-center text-current",menuSubTrigger:m("relative flex min-h-8 min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm px-2.5 py-1.5 text-sm text-foreground outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:!cursor-not-allowed data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",xr),menuSubTriggerIcon:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",menuSubContent:"z-50 min-w-40 overflow-hidden rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg outline-hidden motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-out",tableContainer:m("relative isolate min-w-0 overflow-auto rounded-lg border border-border/70 bg-background/95 bg-clip-padding [scrollbar-gutter:stable]","[--base-table-header-height:2.75rem] [--base-table-split-scrollbar-gutter:0.75rem]","[--base-table-sticky-header-bg:hsl(var(--background))] [--base-table-header-separator:hsl(var(--border)_/_0.7)]",Lh,to),tableContainerFooterAttached:"!rounded-b-none !shadow-none",tableRoot:"w-full caption-bottom border-separate border-spacing-0 text-sm text-foreground",tableCaption:"mt-3 text-sm text-muted-foreground",tableHeader:m("relative z-[2] bg-transparent [&_tr]:bg-transparent",LN),tableBody:"[&_tr:last-child>*]:border-b-0",tableFooter:"bg-muted/30 font-medium [&_tr>*]:border-t [&_tr>*]:border-border/70",tableFooterBar:m("flex min-w-0 flex-wrap items-center justify-between gap-3 rounded-lg border border-border/70 bg-muted/20 px-4 py-3 text-sm text-foreground shadow-none",to),tableFooterBarAttached:"-mt-px rounded-t-none border-t border-border/70 shadow-none",tableFooterBarLeading:"flex min-w-0 items-center gap-2",tableFooterBarContent:"min-w-0 flex-1",tableFooterBarActions:"ms-auto flex shrink-0 flex-wrap items-center gap-2",tableSplitRoot:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-[auto_minmax(0,1fr)_auto] caption-bottom border-separate border-spacing-0 text-sm text-foreground",tableSplitHeader:"block w-full min-w-0 shrink-0 overflow-x-hidden overflow-y-hidden bg-transparent",tableSplitBody:m("block min-h-0 w-full min-w-0 max-w-full justify-self-stretch overflow-auto [scrollbar-gutter:stable]",Lh),tableSplitFooter:"block w-full min-w-0 shrink-0 overflow-x-hidden overflow-y-hidden",tableSplitRow:"grid w-max min-w-full [grid-template-columns:var(--base-table-column-template)]",tableSplitHead:"flex min-w-0 overflow-hidden",tableSplitCell:"block min-w-0 overflow-hidden [overflow-wrap:anywhere]",tableRow:m("[&>*]:border-b [&>*]:border-border/60 data-[state=selected]:bg-primary/5 data-[state=selected]:[&>*]:bg-primary/5",to),tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--muted)_/_0.35)] hover:bg-[var(--base-table-row-hover-bg)] hover:[&>*]:bg-[var(--base-table-row-hover-bg)]",tableRowSelected:"bg-primary/5 [&>*]:bg-primary/5",tableRowDisabled:"!cursor-not-allowed opacity-60",tableHead:"relative h-11 whitespace-nowrap px-3 py-2 text-left align-middle text-xs font-semibold text-muted-foreground shadow-[inset_0_-1px_0_var(--base-table-header-separator)]",tableHeadContent:"flex min-w-0 items-center justify-between gap-2",tableHeadMain:"flex min-w-0 items-center gap-2",tableHeadIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",tableHeadText:"grid min-w-0 gap-0.5",tableHeadLabel:"min-w-0 truncate text-xs font-semibold leading-4 text-foreground",tableHeadDescription:"min-w-0 truncate text-xs font-normal leading-4 text-muted-foreground",tableHeadMeta:"shrink-0 text-xs font-medium text-muted-foreground",tableHeadActions:"flex shrink-0 items-center gap-1",tableHeadSortButton:m("inline-flex min-w-0 cursor-pointer items-center gap-1 rounded-sm text-left focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed disabled:opacity-60",to),tableHeadSortIcon:m("inline-flex h-3 w-3 shrink-0 items-center justify-center text-muted-foreground",Ld),tableHeadDragHandle:m("inline-flex h-5 w-4 shrink-0 cursor-grab items-center justify-center rounded-sm text-muted-foreground hover:bg-muted active:cursor-grabbing focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed disabled:opacity-50",to),tableHeadResizeHandle:m("absolute end-0 top-1/2 h-7 w-2 -translate-y-1/2 cursor-col-resize touch-none rounded-sm after:absolute after:start-1/2 after:top-1/2 after:h-5 after:w-px after:-translate-x-1/2 after:-translate-y-1/2 after:bg-border hover:after:bg-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed disabled:opacity-50",to),tableCell:"min-w-0 px-3 py-2 align-middle text-sm text-foreground [overflow-wrap:anywhere]",tableCellAlignCenter:"text-center",tableCellAlignRight:"text-right",tableEmptyRow:"[&>*]:border-b [&>*]:border-border/60",tableEmptyCell:"px-4 py-10 text-center",tableEmptyContent:"mx-auto flex max-w-md flex-col items-center justify-center text-center",tableEmptyIcon:"mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-muted text-muted-foreground",tableEmptyTitle:"text-sm font-semibold text-foreground",tableEmptyDescription:"mt-1 text-sm leading-6 text-muted-foreground",tableEmptyActions:"mt-4 flex flex-wrap items-center justify-center gap-2",tableLoadingRow:"[&>*]:border-b [&>*]:border-border/60",tableLoadingCell:"px-3 py-2",tableLoadingSkeleton:"h-4 w-full rounded-md bg-muted/70",layoutRoot:m("grid min-w-0 overflow-hidden grid-rows-[auto_minmax(0,1fr)_auto] gap-3 rounded-lg border border-border/70 bg-background p-3 text-foreground",to),layoutRootFull:"h-full min-h-0",layoutHeader:"min-w-0",layoutBody:"grid min-h-0 min-w-0 overflow-hidden gap-token-md",layoutSidebar:"min-h-0 min-w-0 overflow-hidden",layoutMain:"min-h-0 min-w-0 overflow-hidden",layoutAside:"min-h-0 min-w-0 overflow-hidden",layoutFooter:"min-w-0",layoutPane:m("h-full max-h-full min-h-0 min-w-0 overflow-hidden rounded-lg bg-background text-foreground",to),layoutPaneScrollable:"overflow-auto",layoutPaneBordered:"border border-border/70",layoutPaneMuted:"bg-muted/25",layoutPaneSoft:"bg-background/95 shadow-sm",layoutPaneTransparent:"bg-transparent shadow-none",layoutSplitRoot:"grid min-h-0 min-w-0 overflow-hidden",layoutSplitHorizontal:"grid-flow-col",layoutSplitVertical:"grid-flow-row",layoutSplitPane:"min-h-0 min-w-0 overflow-hidden",layoutSplitPrimary:"",layoutSplitSecondary:"",layoutResizeHandle:m("group/resize relative z-10 flex shrink-0 items-center justify-center bg-transparent text-muted-foreground hover:bg-border/60 active:bg-border/70 focus-visible:bg-border/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",xr),layoutResizeHandleHorizontal:"w-2 cursor-col-resize",layoutResizeHandleVertical:"h-2 cursor-row-resize",layoutResizeHandleDisabled:"cursor-default opacity-60",layoutResizeHandleIndicator:"rounded-full bg-muted-foreground/45 group-hover/resize:bg-primary/70"},WN={compact:{buttonBase:"h-8 px-2.5 text-xs",buttonIconOnly:"h-8 w-8 px-0",badgeBase:"px-1.5 py-0 text-xs",panelHeader:"p-token-md",panelBody:"px-token-md pb-token-md text-xs",panelBodyStandalone:"pt-token-md",panelFooter:"px-token-md py-token-md",stateRoot:"min-h-36 px-4 py-7",stateIcon:"mb-3 h-10 w-10",fieldRoot:"gap-token-sm",fieldLabel:"text-xs",fieldDescription:"text-xs leading-5",fieldMessage:"text-xs leading-5",controlInput:"h-8 text-xs",controlTextarea:"min-h-20 text-xs",controlSelect:"h-8 text-xs",selectMenu:"text-xs",selectOption:"min-h-7 px-2 py-1 text-xs",switchTrack:"h-5 w-9",switchThumb:"h-3.5 w-3.5",checkboxBox:"h-3.5 w-3.5",checkboxLabel:"text-xs",checkboxDescription:"text-xs leading-5",radioOption:"px-2 py-1.5 text-xs",radioMarker:"h-3.5 w-3.5",radioIndicator:"h-1.5 w-1.5",radioLabel:"text-xs",radioDescription:"text-xs leading-5",dialogPanel:"max-w-md",dialogHeader:"px-4 py-3",dialogTitle:"text-sm leading-5",dialogDescription:"text-xs leading-5",dialogBody:"px-4 py-3 text-xs",dialogFooter:"px-4 py-3",dropdownMenu:"min-w-44 text-xs",dropdownItem:"px-2 py-1.5 text-xs",tooltipContent:"text-xs leading-4",noticeBase:"px-3 py-2 text-xs",dividerLabel:"text-xs",sectionHeaderRoot:"gap-token-sm",sectionHeaderTitle:"text-sm leading-5",sectionHeaderDescription:"text-xs leading-5",tabsList:"gap-token-xs p-token-xs",tabsTrigger:"px-2 py-1 text-xs",tabsPanel:"p-3 text-xs",segmentedRoot:"gap-token-xs p-token-xs",segmentedItem:"px-2 py-1 text-xs",progressTrack:"h-1.5",avatarRoot:"text-xs",toolbarRoot:"gap-token-sm px-token-md py-token-md",toolbarTitle:"text-xs",toolbarDescription:"text-xs leading-5",paginationButton:"h-7 min-w-7 px-2 text-xs",paginationPage:"h-7 min-w-7 px-2 text-xs",descriptionListRoot:"gap-2 text-xs",descriptionListItem:"px-2 py-1.5",descriptionListTerm:"text-xs",descriptionListValue:"text-xs leading-5",accordionTrigger:"px-3 py-2 text-xs",accordionPanel:"px-3 py-2 text-xs leading-5",menuContent:"min-w-40 p-0.5 text-xs",menuSubContent:"min-w-36 p-0.5 text-xs",menuLabel:"px-2 py-1 text-xs",menuItem:"min-h-7 px-2 py-1 text-xs",menuSubTrigger:"min-h-7 px-2 py-1 text-xs",menuItemShortcut:"text-xs",tableContainer:"[--base-table-header-height:2.25rem]",tableHead:"h-9 px-2 py-1.5 text-xs",tableCell:"px-2 py-1.5 text-xs",tableHeadLabel:"text-xs",tableHeadDescription:"text-xs leading-3",tableLoadingCell:"px-2 py-1.5",layoutRoot:"gap-token-md p-token-md",layoutBody:"gap-token-md",layoutPane:"rounded-md text-xs",layoutResizeHandleHorizontal:"w-1.5",layoutResizeHandleVertical:"h-1.5"},default:{buttonBase:"h-9"},comfortable:{buttonBase:"h-10 px-3.5",buttonIconOnly:"h-10 w-10 px-0",badgeBase:"px-2.5 py-1",panelHeader:"p-token-xl",panelBody:"px-token-xl pb-token-xl",panelBodyStandalone:"pt-token-xl",panelFooter:"px-token-xl py-token-lg",stateRoot:"min-h-56 px-8 py-12",stateIcon:"mb-5 h-14 w-14",fieldRoot:"gap-token-md",controlInput:"h-10",controlTextarea:"min-h-28",controlSelect:"h-10",selectMenu:"p-1.5",selectOption:"min-h-9 px-3 py-2",switchTrack:"h-7 w-12",switchThumb:"h-5 w-5",checkboxBox:"h-5 w-5",radioOption:"px-4 py-3",radioMarker:"h-5 w-5",radioIndicator:"h-2.5 w-2.5",dialogPanel:"max-w-xl",dialogHeader:"px-6 py-5",dialogBody:"px-6 py-5",dialogFooter:"px-6 py-5",dropdownMenu:"min-w-56",dropdownItem:"px-3 py-2.5",noticeBase:"px-5 py-4",sectionHeaderTitle:"text-lg leading-7",tabsTrigger:"px-3.5 py-2",tabsPanel:"p-5",segmentedItem:"px-3.5 py-2",progressTrack:"h-2.5",toolbarRoot:"px-token-xl py-token-lg",paginationButton:"h-9 min-w-9 px-3",paginationPage:"h-9 min-w-9 px-3",descriptionListItem:"px-4 py-3",accordionTrigger:"px-5 py-4",accordionPanel:"px-5 py-4",menuContent:"min-w-48 p-1.5",menuSubContent:"min-w-44 p-1.5",menuItem:"min-h-9 px-3 py-2",menuSubTrigger:"min-h-9 px-3 py-2",tableContainer:"[--base-table-header-height:3rem]",tableHead:"h-12 px-4 py-3",tableCell:"px-4 py-3",tableLoadingCell:"px-4 py-3",layoutRoot:"gap-token-lg p-token-lg",layoutBody:"gap-token-lg",layoutPane:"rounded-xl",layoutResizeHandleHorizontal:"w-2.5",layoutResizeHandleVertical:"h-2.5"}},zN={none:{buttonBase:"rounded-none",badgeBase:"rounded-none",panelRoot:"rounded-none",stateRoot:"rounded-none",stateIcon:"rounded-none",controlWrapper:"rounded-none",selectMenu:"rounded-none",selectOption:"rounded-none",switchTrack:"rounded-none",switchThumb:"rounded-none",checkboxBox:"rounded-none",radioOption:"rounded-none",dialogPanel:"rounded-none",dialogClose:"rounded-none",dropdownMenu:"rounded-none",dropdownItem:"rounded-none",tooltipContent:"rounded-none",noticeBase:"rounded-none",tabsList:"rounded-none",tabsTrigger:"rounded-none",tabsPanel:"rounded-none",segmentedRoot:"rounded-none",segmentedItem:"rounded-none",progressTrack:"rounded-none",progressIndicator:"rounded-none",skeletonRoot:"rounded-none",avatarRoot:"rounded-none",avatarStatus:"rounded-none",toolbarRoot:"rounded-none",paginationButton:"rounded-none",paginationPage:"rounded-none",descriptionListItem:"rounded-none",accordionItem:"rounded-none",menuContent:"rounded-none",menuItem:"rounded-none",menuSubTrigger:"rounded-none",menuSubContent:"rounded-none",tableContainer:"rounded-none",tableEmptyIcon:"rounded-none",tableLoadingSkeleton:"rounded-none",layoutRoot:"rounded-none",layoutPane:"rounded-none"},sm:{buttonBase:"rounded-sm",badgeBase:"rounded-sm",panelRoot:"rounded-sm",stateRoot:"rounded-sm",stateIcon:"rounded-sm",controlWrapper:"rounded-sm",selectMenu:"rounded-sm",selectOption:"rounded-sm",switchTrack:"rounded-sm",switchThumb:"rounded-sm",checkboxBox:"rounded-sm",radioOption:"rounded-sm",dialogPanel:"rounded-sm",dialogClose:"rounded-sm",dropdownMenu:"rounded-sm",dropdownItem:"rounded-sm",tooltipContent:"rounded-sm",noticeBase:"rounded-sm",tabsList:"rounded-sm",tabsTrigger:"rounded-sm",tabsPanel:"rounded-sm",segmentedRoot:"rounded-sm",segmentedItem:"rounded-sm",progressTrack:"rounded-sm",progressIndicator:"rounded-sm",skeletonRoot:"rounded-sm",avatarRoot:"rounded-sm",avatarStatus:"rounded-sm",toolbarRoot:"rounded-sm",paginationButton:"rounded-sm",paginationPage:"rounded-sm",descriptionListItem:"rounded-sm",accordionItem:"rounded-sm",menuContent:"rounded-sm",menuItem:"rounded-sm",menuSubTrigger:"rounded-sm",menuSubContent:"rounded-sm",tableContainer:"rounded-sm",tableEmptyIcon:"rounded-sm",tableLoadingSkeleton:"rounded-sm",layoutRoot:"rounded-sm",layoutPane:"rounded-sm"},md:{},lg:{buttonBase:"rounded-lg",badgeBase:"rounded-lg",panelRoot:"rounded-xl",stateRoot:"rounded-xl",stateIcon:"rounded-xl",controlWrapper:"rounded-lg",selectMenu:"rounded-lg",selectOption:"rounded-md",switchTrack:"rounded-full",switchThumb:"rounded-full",checkboxBox:"rounded-md",radioOption:"rounded-xl",dialogPanel:"rounded-xl",dialogClose:"rounded-lg",dropdownMenu:"rounded-lg",dropdownItem:"rounded-md",tooltipContent:"rounded-md",noticeBase:"rounded-xl",tabsList:"rounded-xl",tabsTrigger:"rounded-lg",tabsPanel:"rounded-xl",segmentedRoot:"rounded-xl",segmentedItem:"rounded-lg",skeletonRoot:"rounded-lg",toolbarRoot:"rounded-xl",descriptionListItem:"rounded-lg",accordionItem:"rounded-xl",menuContent:"rounded-lg",menuItem:"rounded-md",menuSubTrigger:"rounded-md",menuSubContent:"rounded-lg",tableContainer:"rounded-xl",tableEmptyIcon:"rounded-xl",tableLoadingSkeleton:"rounded-lg",layoutRoot:"rounded-xl",layoutPane:"rounded-xl"},xl:{buttonBase:"rounded-xl",badgeBase:"rounded-xl",panelRoot:"rounded-2xl",stateRoot:"rounded-2xl",stateIcon:"rounded-2xl",controlWrapper:"rounded-xl",selectMenu:"rounded-xl",selectOption:"rounded-lg",switchTrack:"rounded-full",switchThumb:"rounded-full",checkboxBox:"rounded-lg",radioOption:"rounded-2xl",dialogPanel:"rounded-2xl",dialogClose:"rounded-xl",dropdownMenu:"rounded-xl",dropdownItem:"rounded-lg",tooltipContent:"rounded-lg",noticeBase:"rounded-2xl",tabsList:"rounded-2xl",tabsTrigger:"rounded-xl",tabsPanel:"rounded-2xl",segmentedRoot:"rounded-2xl",segmentedItem:"rounded-xl",skeletonRoot:"rounded-xl",toolbarRoot:"rounded-2xl",paginationButton:"rounded-xl",paginationPage:"rounded-xl",descriptionListItem:"rounded-xl",accordionItem:"rounded-2xl",menuContent:"rounded-xl",menuItem:"rounded-lg",menuSubTrigger:"rounded-lg",menuSubContent:"rounded-xl",tableContainer:"rounded-2xl",tableEmptyIcon:"rounded-2xl",tableLoadingSkeleton:"rounded-xl",layoutRoot:"rounded-2xl",layoutPane:"rounded-2xl"},full:{buttonBase:"rounded-full",badgeBase:"rounded-full",panelRoot:"rounded-2xl",stateRoot:"rounded-2xl",stateIcon:"rounded-full",controlWrapper:"rounded-full",selectMenu:"rounded-2xl",selectOption:"rounded-full",switchTrack:"rounded-full",switchThumb:"rounded-full",checkboxBox:"rounded-full",radioOption:"rounded-2xl",dialogPanel:"rounded-2xl",dialogClose:"rounded-full",dropdownMenu:"rounded-2xl",dropdownItem:"rounded-full",tooltipContent:"rounded-full",noticeBase:"rounded-2xl",tabsList:"rounded-full",tabsTrigger:"rounded-full",tabsPanel:"rounded-2xl",segmentedRoot:"rounded-full",segmentedItem:"rounded-full",progressTrack:"rounded-full",progressIndicator:"rounded-full",skeletonRoot:"rounded-full",avatarRoot:"rounded-full",avatarStatus:"rounded-full",toolbarRoot:"rounded-2xl",paginationButton:"rounded-full",paginationPage:"rounded-full",descriptionListItem:"rounded-2xl",accordionItem:"rounded-2xl",menuContent:"rounded-2xl",menuItem:"rounded-full",menuSubTrigger:"rounded-full",menuSubContent:"rounded-2xl",tableContainer:"rounded-2xl",tableEmptyIcon:"rounded-full",tableLoadingSkeleton:"rounded-full",layoutRoot:"rounded-2xl",layoutPane:"rounded-2xl"}},ON={none:{buttonBase:"border-transparent",badgeBase:"border-transparent",panelRoot:"border-transparent",panelFooter:"border-transparent",stateRoot:"border-transparent",controlWrapper:"border-transparent",selectMenu:"border-transparent",switchTrack:"border-transparent",checkboxBox:"border-transparent",radioOption:"border-transparent",radioMarker:"border-transparent",dialogPanel:"border-transparent",dialogHeader:"border-transparent",dialogFooter:"border-transparent",dropdownMenu:"border-transparent",tooltipContent:"border-transparent",noticeBase:"border-transparent",dividerRoot:"border-transparent",tabsList:"border-transparent",tabsPanel:"border-transparent",segmentedRoot:"border-transparent",avatarRoot:"border-transparent",toolbarRoot:"border-transparent",paginationButton:"border-transparent",descriptionListItem:"border-transparent",accordionItem:"border-transparent",accordionPanel:"border-transparent",menuContent:"border-transparent",menuSeparator:"bg-transparent",menuSubContent:"border-transparent",tableContainer:"border-transparent [--base-table-header-separator:transparent]",tableHeader:"border-transparent",tableFooter:"[&_tr>*]:border-transparent",tableFooterBar:"border-transparent",tableFooterBarAttached:"border-t border-transparent",tableRow:"[&>*]:border-transparent",tableEmptyRow:"[&>*]:border-transparent",tableLoadingRow:"[&>*]:border-transparent",layoutRoot:"border-transparent",layoutPaneBordered:"border-transparent",layoutResizeHandle:"bg-transparent hover:bg-transparent active:bg-transparent focus-visible:bg-transparent"},subtle:{buttonDefault:"border-border/60",badgeDefault:"border-border/60",panelRoot:"border-border/60",panelFooter:"border-border/60",stateRoot:"border-border/60",controlWrapper:"border-border/60",selectMenu:"border-border/60",switchTrack:"border-border/60",checkboxBox:"border-border/60",radioOption:"border-border/60",radioMarker:"border-border/60",dialogPanel:"border-border/60",dialogHeader:"border-border/60",dialogFooter:"border-border/60",dropdownMenu:"border-border/60",tooltipContent:"border-border/60",noticeDefault:"border-border/60",dividerRoot:"border-border/60",tabsList:"border-border/60",tabsPanel:"border-border/60",segmentedRoot:"border-border/60",avatarRoot:"border-border/60",toolbarRoot:"border-border/60",paginationButton:"border-border/60",descriptionListItem:"border-border/60",accordionItem:"border-border/60",accordionPanel:"border-border/60",menuContent:"border-border/60",menuSeparator:"bg-border/60",menuSubContent:"border-border/60",tableContainer:"border-border/60 [--base-table-header-separator:hsl(var(--border)_/_0.6)]",tableHeader:"border-border/60",tableFooter:"[&_tr>*]:border-border/60",tableFooterBar:"border-border/60",tableFooterBarAttached:"border-t border-border/60",tableRow:"[&>*]:border-border/50",tableEmptyRow:"[&>*]:border-border/50",tableLoadingRow:"[&>*]:border-border/50",layoutRoot:"border-border/60",layoutPaneBordered:"border-border/60"},solid:{},strong:{buttonDefault:"border-foreground/20",badgeDefault:"border-foreground/20",panelRoot:"border-foreground/20",panelFooter:"border-foreground/20",stateRoot:"border-foreground/20",controlWrapper:"border-foreground/20",selectMenu:"border-foreground/20",switchTrack:"border-foreground/20",checkboxBox:"border-foreground/20",radioOption:"border-foreground/20",radioMarker:"border-foreground/20",dialogPanel:"border-foreground/20",dialogHeader:"border-foreground/15",dialogFooter:"border-foreground/15",dropdownMenu:"border-foreground/20",tooltipContent:"border-foreground/20",noticeDefault:"border-foreground/20",dividerRoot:"border-foreground/20",tabsList:"border-foreground/20",tabsPanel:"border-foreground/20",segmentedRoot:"border-foreground/20",avatarRoot:"border-foreground/20",toolbarRoot:"border-foreground/20",paginationButton:"border-foreground/20",descriptionListItem:"border-foreground/20",accordionItem:"border-foreground/20",accordionPanel:"border-foreground/20",menuContent:"border-foreground/20",menuSeparator:"bg-foreground/15",menuSubContent:"border-foreground/20",tableContainer:"border-foreground/20 [--base-table-header-separator:hsl(var(--foreground)_/_0.15)]",tableHeader:"border-foreground/20",tableFooter:"[&_tr>*]:border-foreground/20",tableFooterBar:"border-foreground/20",tableFooterBarAttached:"border-t border-foreground/20",tableRow:"[&>*]:border-foreground/15",tableEmptyRow:"[&>*]:border-foreground/15",tableLoadingRow:"[&>*]:border-foreground/15",layoutRoot:"border-foreground/20",layoutPaneBordered:"border-foreground/20",layoutResizeHandle:"hover:bg-foreground/15 active:bg-foreground/20 focus-visible:bg-foreground/15"}},FN={plain:{},muted:{buttonDefault:"bg-muted/20 hover:bg-muted/45",panelRoot:"bg-card",panelFooter:"bg-muted/20",stateRoot:"bg-muted/20",controlWrapper:"bg-background",selectMenu:"bg-background",selectOptionActive:"bg-muted/70 text-foreground",checkboxBox:"bg-background",radioOption:"bg-card hover:bg-muted/45",radioMarker:"bg-background",dialogPanel:"bg-card",dropdownMenu:"bg-background",dropdownItem:"hover:bg-muted/60",tooltipContent:"bg-popover",noticeDefault:"bg-muted/20",tabsList:"bg-muted/35",tabsTriggerActive:"bg-background",tabsPanel:"bg-card",segmentedRoot:"bg-muted/35",segmentedItemActive:"bg-background",progressTrack:"bg-muted/60",skeletonRoot:"bg-muted",toolbarRoot:"bg-card",paginationButton:"bg-background hover:bg-muted/60",paginationPage:"bg-muted/60",descriptionListItem:"bg-card",accordionItem:"bg-card",menuContent:"bg-background",menuItem:"focus:bg-muted/70 data-[highlighted]:bg-muted/70",menuSubTrigger:"focus:bg-muted/70 data-[highlighted]:bg-muted/70 data-[state=open]:bg-muted/70",menuSubContent:"bg-background",tableContainer:"bg-background/95 [scrollbar-gutter:stable]",tableFooter:"bg-muted/35",tableFooterBar:"bg-muted/30 shadow-none",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--muted)_/_0.45)]",tableLoadingSkeleton:"bg-muted",layoutRoot:"bg-card",layoutPane:"bg-card",layoutPaneMuted:"bg-muted/35",layoutResizeHandle:"hover:bg-border/70 active:bg-border/80 focus-visible:bg-border/70"},soft:{buttonDefault:"bg-muted/30 hover:bg-muted/55",panelRoot:"bg-background/95 shadow-sm",stateRoot:"bg-background/95 shadow-sm",controlWrapper:"bg-background/95",selectMenu:"bg-background/95 shadow-xl",selectOptionActive:"bg-muted/60 text-foreground",checkboxBox:"bg-background/95",radioOption:"bg-background/95 shadow-sm hover:bg-muted/35",radioMarker:"bg-background/95",dialogPanel:"bg-background/95 shadow-xl",dropdownMenu:"bg-background/95 shadow-xl",dropdownItem:"hover:bg-muted/55",tooltipContent:"bg-popover shadow-xl",noticeDefault:"bg-background/95 shadow-sm",tabsList:"bg-background/60 shadow-sm",tabsTriggerActive:"bg-background",tabsPanel:"bg-background/95 shadow-sm",segmentedRoot:"bg-background/60 shadow-sm",segmentedItemActive:"bg-background",skeletonRoot:"bg-background/80",toolbarRoot:"bg-background/95 shadow-sm",paginationButton:"bg-background/95 hover:bg-muted/55",descriptionListItem:"bg-background/95 shadow-sm",accordionItem:"bg-background/95 shadow-sm",menuContent:"bg-background/95 shadow-xl",menuItem:"focus:bg-muted/60 data-[highlighted]:bg-muted/60",menuSubTrigger:"focus:bg-muted/60 data-[highlighted]:bg-muted/60 data-[state=open]:bg-muted/60",menuSubContent:"bg-background/95 shadow-xl",tableContainer:"bg-background/95 shadow-sm [scrollbar-gutter:stable]",tableFooter:"bg-muted/25",tableFooterBar:"bg-muted/25 shadow-none",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--muted)_/_0.35)]",tableLoadingSkeleton:"bg-muted/65",layoutRoot:"bg-background/95 shadow-sm",layoutPane:"bg-background/95 shadow-sm",layoutPaneSoft:"bg-background/95 shadow-md"},glass:{buttonBase:"backdrop-blur-md",buttonDefault:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",badgeDefault:"border-white/10 bg-white/[0.08] text-foreground",panelRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",panelFooter:"border-white/10 bg-white/[0.05]",stateRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",stateIcon:"bg-white/10 text-foreground",controlWrapper:"border-white/10 bg-white/[0.08] text-foreground backdrop-blur-md",selectMenu:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",selectOption:"text-foreground",selectOptionActive:"bg-white/[0.14] text-foreground",selectOptionSelected:"bg-white/[0.18] text-foreground",switchTrack:"border-white/10 bg-white/[0.12] backdrop-blur-md",checkboxBox:"border-white/10 bg-white/[0.08] backdrop-blur-md",checkboxBoxChecked:"border-white/20 bg-white/[0.22] text-foreground",radioOption:"border-white/10 bg-white/[0.06] backdrop-blur-md hover:bg-white/[0.10]",radioMarker:"border-white/10 bg-white/[0.08] backdrop-blur-md",radioMarkerChecked:"border-white/25 bg-white/[0.16]",dialogOverlay:"bg-background/45 backdrop-blur-md",dialogPanel:"border-white/10 bg-white/[0.08] shadow-2xl backdrop-blur-md",dialogHeader:"border-white/10",dialogFooter:"border-white/10",dropdownMenu:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",dropdownItem:"text-foreground hover:bg-white/[0.14]",tooltipContent:"border-foreground/10 bg-background/15 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",noticeDefault:"border-white/10 bg-white/[0.08] text-foreground backdrop-blur-md",dividerRoot:"border-white/15",tabsList:"border-white/10 bg-white/[0.08] backdrop-blur-md",tabsTrigger:"text-muted-foreground hover:bg-white/[0.12] hover:text-foreground",tabsTriggerActive:"bg-white/[0.16] text-foreground shadow-none",tabsPanel:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",segmentedRoot:"border-white/10 bg-white/[0.08] backdrop-blur-md",segmentedItem:"text-muted-foreground hover:bg-white/[0.12] hover:text-foreground",segmentedItemActive:"bg-white/[0.16] text-foreground shadow-none",progressTrack:"bg-white/[0.12]",skeletonRoot:"bg-white/[0.16]",avatarRoot:"border-white/10 bg-white/[0.12] text-foreground",avatarFallback:"bg-white/[0.12] text-foreground",avatarStatus:"border-background",toolbarRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",paginationButton:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",paginationPage:"bg-white/[0.12] text-foreground",descriptionListItem:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",accordionItem:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",accordionPanel:"border-white/10",menuContent:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",menuSeparator:"bg-white/10",menuItem:"text-foreground focus:bg-white/[0.14] focus:text-foreground data-[highlighted]:bg-white/[0.14] data-[highlighted]:text-foreground",menuSubTrigger:"text-foreground focus:bg-white/[0.14] focus:text-foreground data-[highlighted]:bg-white/[0.14] data-[highlighted]:text-foreground data-[state=open]:bg-white/[0.16]",menuSubContent:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",tableContainer:"border-foreground/10 bg-background/[0.06] shadow-none backdrop-blur-md [scrollbar-gutter:stable] [--base-table-sticky-header-bg:hsl(var(--background)/0.94)] [--base-table-header-separator:hsl(var(--foreground)/0.24)]",tableHeader:"border-white/10",tableFooter:"bg-white/[0.05] [&_tr>*]:border-white/10",tableFooterBar:"border-white/10 bg-white/[0.05] shadow-none backdrop-blur-md",tableFooterBarAttached:"border-t border-white/10",tableRow:"[&>*]:border-white/10",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--foreground)/0.08)]",tableHeadLabel:"text-foreground",tableLoadingSkeleton:"bg-white/[0.16]",layoutRoot:"border-white/10 bg-white/[0.05] shadow-none backdrop-blur-md",layoutPane:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",layoutPaneMuted:"bg-white/[0.08]",layoutPaneSoft:"bg-white/[0.10] shadow-none backdrop-blur-md",layoutResizeHandle:"text-foreground/65 hover:bg-white/10 active:bg-white/15 focus-visible:bg-white/10",layoutResizeHandleIndicator:"bg-white/45 group-hover/resize:bg-white/75"},dark:{buttonBase:"border-white/15 text-white shadow-lg backdrop-blur",buttonDefault:"bg-black/30 hover:bg-black/[0.45]",buttonPrimary:"border-white/25 bg-white/20 text-white hover:bg-white/25",buttonMuted:"border-white/10 bg-black/20 text-white/70 hover:bg-black/[0.35] hover:text-white",badgeDefault:"border-white/10 bg-white/[0.08] text-white",badgeMuted:"border-white/10 bg-black/20 text-white/70",panelRoot:"border-white/10 bg-slate-950 text-white shadow-none",panelTitle:"text-white",panelDescription:"text-white/65",panelBody:"text-white/85",panelFooter:"border-white/10 bg-white/[0.04]",stateRoot:"border-white/10 bg-slate-950 text-white shadow-none",stateIcon:"bg-white/10 text-white/75",stateTitle:"text-white",stateDescription:"text-white/65",fieldLabel:"text-white",fieldDescription:"text-white/65",fieldMessage:"text-white/65",controlWrapper:"border-white/15 bg-black/30 text-white shadow-lg backdrop-blur focus-within:border-white/35",controlBase:"text-white placeholder:text-white/45",selectChevron:"text-white/65",selectMenu:"border-white/15 bg-slate-950 text-white shadow-2xl",selectOption:"text-white",selectOptionActive:"bg-white/[0.12] text-white",selectOptionSelected:"bg-white/[0.16] text-white",selectPlaceholder:"text-white/45",switchTrack:"border-white/15 bg-black/30 shadow-lg backdrop-blur",switchChecked:"border-white/25 bg-white/25 text-white",switchLabel:"text-white",switchDescription:"text-white/65",checkboxBox:"border-white/15 bg-black/30 text-white shadow-lg backdrop-blur",checkboxBoxChecked:"border-white/25 bg-white/25 text-white",checkboxLabel:"text-white",checkboxDescription:"text-white/65",radioOption:"border-white/10 bg-white/[0.06] text-white hover:bg-white/[0.08]",radioMarker:"border-white/15 bg-black/30 text-white shadow-lg backdrop-blur",radioMarkerChecked:"border-white/25 bg-white/25",radioIndicator:"bg-white",radioLabel:"text-white",radioDescription:"text-white/65",dialogOverlay:"bg-slate-950/75",dialogPanel:"border-white/10 bg-slate-950 text-white shadow-2xl",dialogHeader:"border-white/10",dialogTitle:"text-white",dialogDescription:"text-white/65",dialogBody:"text-white/85",dialogFooter:"border-white/10",dialogClose:"text-white/65 hover:bg-white/[0.08] hover:text-white",dropdownMenu:"border-white/15 bg-slate-950 text-white shadow-2xl",dropdownLabel:"text-white/55",dropdownSeparator:"bg-white/15",dropdownItem:"text-white hover:bg-white/[0.10]",dropdownItemDescription:"text-white/55",dropdownItemShortcut:"text-white/55",tooltipContent:"border-white/15 bg-slate-950 text-white shadow-2xl",noticeDefault:"border-white/10 bg-white/[0.08] text-white",noticeMuted:"border-white/10 bg-black/20 text-white/70",dividerRoot:"border-white/15",dividerLabel:"text-white/55",sectionHeaderEyebrow:"text-white/55",sectionHeaderTitle:"text-white",sectionHeaderDescription:"text-white/65",tabsList:"border-white/10 bg-white/[0.08]",tabsTrigger:"text-white/65 hover:bg-white/[0.12] hover:text-white",tabsTriggerActive:"bg-white/[0.16] text-white shadow-none",tabsPanel:"border-white/10 bg-white/[0.06] text-white",segmentedRoot:"border-white/10 bg-white/[0.08]",segmentedItem:"text-white/65 hover:bg-white/[0.12] hover:text-white",segmentedItemActive:"bg-white/[0.16] text-white shadow-none",progressTrack:"bg-white/[0.12]",progressLabel:"text-white",progressValue:"text-white/65",skeletonRoot:"bg-white/[0.14]",avatarRoot:"border-white/15 bg-white/[0.10] text-white",avatarFallback:"bg-white/[0.10] text-white/75",avatarText:"text-white",avatarStatus:"border-slate-950",toolbarRoot:"border-white/10 bg-white/[0.06] text-white",toolbarTitle:"text-white",toolbarDescription:"text-white/65",breadcrumbLink:"text-white/65 hover:text-white",breadcrumbCurrent:"text-white",breadcrumbSeparator:"text-white/45",paginationInfo:"text-white/65",paginationButton:"border-white/10 bg-white/[0.08] text-white hover:bg-white/[0.14]",paginationPage:"bg-white/[0.14] text-white",descriptionListItem:"border-white/10 bg-white/[0.06]",descriptionListTerm:"text-white/55",descriptionListValue:"text-white",accordionItem:"border-white/10 bg-white/[0.06]",accordionTrigger:"text-white hover:bg-white/[0.08]",accordionPanel:"border-white/10 text-white/70",tableContainer:"border-foreground/10 bg-background text-foreground shadow-none [scrollbar-gutter:stable] [--base-table-sticky-header-bg:hsl(var(--background)/0.98)] [--base-table-header-separator:hsl(var(--foreground)/0.16)]",tableRoot:"text-white",tableHeader:"border-white/10",tableFooter:"bg-white/[0.05] [&_tr>*]:border-white/10",tableFooterBar:"border-white/10 bg-white/[0.05] text-white/65",tableFooterBarAttached:"border-t border-white/10",tableRow:"[&>*]:border-white/10",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--foreground)/0.06)]",tableHead:"text-white/65",tableHeadLabel:"text-white",tableHeadDescription:"text-white/55",tableHeadMeta:"text-white/55",tableHeadIcon:"text-white/55",tableHeadSortIcon:"text-white/55",tableHeadDragHandle:"text-white/55 hover:bg-white/[0.08]",tableHeadResizeHandle:"after:bg-white/20 hover:after:bg-white/60",tableCell:"text-white/85",tableEmptyIcon:"bg-white/10 text-white/65",tableEmptyTitle:"text-white",tableEmptyDescription:"text-white/60",menuContent:"border-white/10 bg-slate-950 text-white shadow-2xl",menuLabel:"text-white/55",menuSeparator:"bg-white/10",menuItem:"text-white focus:bg-white/[0.10] focus:text-white data-[highlighted]:bg-white/[0.10] data-[highlighted]:text-white",menuItemDefault:"text-white",menuItemPrimary:"text-primary focus:text-primary data-[highlighted]:text-primary",menuItemSuccess:"text-[hsl(var(--success,142_69%_58%))] focus:text-[hsl(var(--success,142_69%_58%))] data-[highlighted]:text-[hsl(var(--success,142_69%_58%))]",menuItemWarning:"text-[hsl(var(--warning-foreground,53_98%_77%))] focus:text-[hsl(var(--warning-foreground,53_98%_77%))] data-[highlighted]:text-[hsl(var(--warning-foreground,53_98%_77%))]",menuItemDanger:"text-destructive-text focus:text-destructive-text data-[highlighted]:text-destructive-text",menuItemMuted:"text-white/65 focus:text-white data-[highlighted]:text-white",menuItemShortcut:"text-white/45",menuSubTrigger:"text-white focus:bg-white/[0.10] focus:text-white data-[highlighted]:bg-white/[0.10] data-[highlighted]:text-white data-[state=open]:bg-white/[0.12]",menuSubTriggerIcon:"text-white/55",menuSubContent:"border-white/10 bg-slate-950 text-white shadow-2xl",tableLoadingSkeleton:"bg-white/[0.14]",layoutRoot:"border-white/10 bg-slate-950 text-white shadow-none",layoutPane:"border-white/10 bg-slate-950 text-white shadow-none",layoutPaneMuted:"bg-white/[0.06]",layoutPaneSoft:"bg-white/[0.08] shadow-none",layoutResizeHandle:"text-white/65 hover:bg-white/10 active:bg-white/15 focus-visible:bg-white/10",layoutResizeHandleIndicator:"bg-white/45 group-hover/resize:bg-white/75"}},Wh={default:{density:"default",radius:"md",border:"solid",background:"plain"},soft:{density:"default",radius:"lg",border:"subtle",background:"soft"},compact:{density:"compact",radius:"md",border:"subtle",background:"muted"},"tinted-glass":{density:"default",radius:"lg",border:"subtle",background:"glass"},glass:{density:"default",radius:"xl",border:"subtle",background:"glass"},"hard-edge":{density:"compact",radius:"none",border:"strong",background:"plain"}},HN={soft:{buttonBase:"font-medium",panelRoot:"border-border/70",controlWrapper:"font-medium",tabsTrigger:"font-medium",segmentedItem:"font-medium",toolbarRoot:"border-border/70",tableContainer:"border-border/70",tableFooterBar:"border-border/70",tableHeadLabel:"font-semibold",menuItemLabel:"font-medium"},compact:{buttonBase:"text-xs",badgeBase:"text-xs",fieldLabel:"text-xs",controlBase:"text-xs",selectOption:"text-xs",menuItem:"text-xs",menuSubTrigger:"text-xs",noticeBase:"text-xs",sectionHeaderTitle:"text-sm",tabsTrigger:"text-xs",segmentedItem:"text-xs",toolbarTitle:"text-xs",paginationRoot:"text-xs"},"tinted-glass":{buttonPrimary:"border-primary/25 bg-primary/15 text-primary-foreground hover:bg-primary/20",badgePrimary:"border-primary/25 bg-primary/15 text-primary-foreground",noticePrimary:"border-primary/25 bg-primary/15 text-primary-foreground",progressIndicator:"bg-primary",avatarStatus:"border-background"},glass:{panelRoot:"shadow-[0_24px_80px_hsl(var(--foreground)/0.12)]",stateRoot:"shadow-[0_24px_80px_hsl(var(--foreground)/0.12)]",noticeBase:"shadow-[0_18px_60px_hsl(var(--foreground)/0.10)]",tabsPanel:"shadow-[0_18px_60px_hsl(var(--foreground)/0.10)]",toolbarRoot:"shadow-[0_18px_60px_hsl(var(--foreground)/0.10)]",descriptionListItem:"shadow-[0_12px_40px_hsl(var(--foreground)/0.08)]",accordionItem:"shadow-[0_12px_40px_hsl(var(--foreground)/0.08)]"},"hard-edge":{buttonBase:"shadow-none",panelRoot:"shadow-none",stateRoot:"shadow-none",controlWrapper:"shadow-none",selectMenu:"shadow-none",menuContent:"shadow-none",menuSubContent:"shadow-none",noticeBase:"shadow-none",tabsList:"shadow-none",tabsTriggerActive:"shadow-none",tabsPanel:"shadow-none",segmentedRoot:"shadow-none",segmentedItemActive:"shadow-none",toolbarRoot:"shadow-none",descriptionListItem:"shadow-none",accordionItem:"shadow-none"}};function VN(e){return Wh[e]??Wh.default}a(VN,"getPresetDefaults");var _N=Object.keys(Fh),GN=Bh(_N,m);function $N(...e){return Object.assign({},...e.filter(Boolean))}a($N,"mergeStyles");function Ne(e){let t=e?.preset??"default",o=e?.variant??"default",r=VN(t),n=e?.density??r.density??"default",i=e?.state??"idle",s=e?.radius??r.radius??"md",l=e?.border??r.border??"solid",d=e?.background??r.background??"plain";return {preset:t,variant:o,density:n,state:i,radius:s,border:l,background:d,styles:$N(BN,e?.styles),slots:GN(Fh,HN[t],WN[n],zN[s],ON[l],FN[d],e?.slots)}}a(Ne,"resolveBaseAppearance");function jn(e,t="default",o=false){return m(t==="default"&&e.slots.buttonDefault,t==="primary"&&e.slots.buttonPrimary,t==="success"&&e.slots.buttonSuccess,t==="warning"&&e.slots.buttonWarning,t==="danger"&&e.slots.buttonDanger,t==="muted"&&e.slots.buttonMuted,o&&e.slots.buttonActive)}a(jn,"getBaseButtonToneClassName");function Wd(e,t="default"){return m(t==="default"&&e.slots.badgeDefault,t==="primary"&&e.slots.badgePrimary,t==="success"&&e.slots.badgeSuccess,t==="warning"&&e.slots.badgeWarning,t==="danger"&&e.slots.badgeDanger,t==="muted"&&e.slots.badgeMuted)}a(Wd,"getBaseBadgeToneClassName");function zd(e,t="default"){return m(t==="default"&&e.slots.noticeDefault,t==="primary"&&e.slots.noticePrimary,t==="success"&&e.slots.noticeSuccess,t==="warning"&&e.slots.noticeWarning,t==="danger"&&e.slots.noticeDanger,t==="muted"&&e.slots.noticeMuted)}a(zd,"getBaseNoticeToneClassName");function Da(e,t="default"){return m(t==="default"&&e.slots.menuItemDefault,t==="primary"&&e.slots.menuItemPrimary,t==="success"&&e.slots.menuItemSuccess,t==="warning"&&e.slots.menuItemWarning,t==="danger"&&e.slots.menuItemDanger,t==="muted"&&e.slots.menuItemMuted)}a(Da,"getBaseMenuItemToneClassName");function gi(e,t="default"){return m(t==="default"&&e.slots.typographyToneDefault,t==="muted"&&e.slots.typographyToneMuted,t==="primary"&&e.slots.typographyTonePrimary,t==="success"&&e.slots.typographyToneSuccess,t==="warning"&&e.slots.typographyToneWarning,t==="danger"&&e.slots.typographyToneDanger,t==="inherit"&&e.slots.typographyToneInherit)}a(gi,"getBaseTypographyToneClassName");function Od(e,t="md"){return m(t==="xs"&&e.slots.textSizeXs,t==="sm"&&e.slots.textSizeSm,t==="md"&&e.slots.textSizeMd,t==="lg"&&e.slots.textSizeLg,t==="xl"&&e.slots.textSizeXl)}a(Od,"getBaseTextSizeClassName");function Hh(e,t="lg"){return m(t==="xs"&&e.slots.headingSizeXs,t==="sm"&&e.slots.headingSizeSm,t==="md"&&e.slots.headingSizeMd,t==="lg"&&e.slots.headingSizeLg,t==="xl"&&e.slots.headingSizeXl,t==="2xl"&&e.slots.headingSize2xl)}a(Hh,"getBaseHeadingSizeClassName");function Vh(e,t="default"){return m(t==="compact"&&e.slots.listSpacingCompact,t==="default"&&e.slots.listSpacingDefault,t==="relaxed"&&e.slots.listSpacingRelaxed)}a(Vh,"getBaseListSpacingClassName");function _h(e,t){return m(t==="none"&&e.slots.listMarkerNone,t==="disc"&&e.slots.listMarkerDisc,t==="circle"&&e.slots.listMarkerCircle,t==="square"&&e.slots.listMarkerSquare,t==="decimal"&&e.slots.listMarkerDecimal,t==="lower-alpha"&&e.slots.listMarkerLowerAlpha,t==="upper-alpha"&&e.slots.listMarkerUpperAlpha)}a(_h,"getBaseListMarkerClassName");var Gh=/^(?:0+(?:\.0+)?|(?:\d+(?:\.\d+)?|\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw))$/i,jN=new Set(["calc","clamp","max","min","var"]),$h=/[;{}<>"'\\\u0000-\u001f\u007f]/,UN=/(?:\b(?:auto|fit-content|max-content|min-content|subgrid)\b|(?:calc|clamp|max|min|minmax|repeat|var)\s*\(|(?:^|[\s,(])(?:0+(?:\.0+)?|(?:\d+(?:\.\d+)?|\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|fr|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw))(?:$|[\s,)\]]))/i;function jh(e){let t={")":"(","]":"["},o=[];for(let r of e)if(r==="("||r==="[")o.push(r);else if((r===")"||r==="]")&&o.pop()!==t[r])return false;return o.length===0}a(jh,"hasBalancedDelimiters");function KN(e){let t=/^([a-z]+)\(([\s\S]+)\)$/i.exec(e);return !t||!jN.has(t[1].toLowerCase())||!t[2].trim()||!jh(e)?false:t[1].toLowerCase()==="var"?/^\s*--[a-z0-9_-]+(?:\s*,[\s\S]+)?\s*$/i.test(t[2]):Gh.test(t[2].trim())||/\b(?:calc|clamp|max|min|var)\s*\(/i.test(t[2])||/(?:^|[\s,(])(?:0+(?:\.0+)?|(?:\d+(?:\.\d+)?|\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw))(?:$|[\s,)])/i.test(t[2])}a(KN,"isSupportedCssLengthFunction");function nr(e,t,o){if(typeof o=="number"){if(!Number.isFinite(o)||o<0)throw new RangeError(`${e} ${t} must be a finite, non-negative number or a supported CSS length string.`);return `${o}px`}if(typeof o!="string")throw new TypeError(`${e} ${t} must be a finite, non-negative number or a supported CSS length string.`);let r=o.trim();if(!r||$h.test(r)||!Gh.test(r)&&!KN(r))throw new TypeError(`${e} ${t} must be a non-empty, non-negative CSS length (for example 12px, 1rem, 5%, or var(--space)).`);return r}a(nr,"resolveBaseLayoutLength");function Uh(e){if(typeof e=="number"){if(!Number.isInteger(e)||e<=0)throw new RangeError("BaseGrid columns must be a positive integer or a supported CSS grid-template-columns string.");return `repeat(${e}, minmax(0, 1fr))`}if(typeof e!="string")throw new TypeError("BaseGrid columns must be a positive integer or a supported CSS grid-template-columns string.");let t=e.trim();if(!t||$h.test(t)||/\burl\s*\(/i.test(t)||!jh(t)||!UN.test(t))throw new TypeError('BaseGrid columns must be a non-empty CSS grid-template-columns value such as "12rem minmax(0, 1fr)" or "repeat(3, minmax(0, 1fr))".');return t}a(Uh,"resolveBaseGridColumns");var zh={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},Oh={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"};function hi(e,t){if(!Object.prototype.hasOwnProperty.call(zh,t))throw new TypeError(`${e} align must be one of: start, center, end, stretch, baseline.`);return zh[t]}a(hi,"resolveBaseLayoutAlign");function yi(e,t){if(!Object.prototype.hasOwnProperty.call(Oh,t))throw new TypeError(`${e} justify must be one of: start, center, end, between, around, evenly.`);return Oh[t]}a(yi,"resolveBaseLayoutJustify");var XN=new Set(["compact","pages"]);function Kh(e,t){return Math.min(Math.max(e,1),Math.max(t,1))}a(Kh,"clampPage");function Fd(e,t){if(!Number.isSafeInteger(e)||e<1)throw new RangeError(`BasePagination ${t} must be a positive safe integer.`)}a(Fd,"assertPositiveInteger");function cm(e,t){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`BasePagination ${t} must be a non-negative safe integer.`)}a(cm,"assertNonNegativeInteger");function Hd(e,t){if(typeof e=="string"&&!e.trim())throw new TypeError(`BasePagination ${t} must be a non-empty string when provided.`)}a(Hd,"assertOptionalControlLabel");function QN(e,t){if(e!==void 0&&(typeof e!="string"||!e.trim()))throw new TypeError("BasePagination aria-label must be a non-empty string when provided.");if(t!==void 0&&(typeof t!="string"||!t.trim()))throw new TypeError("BasePagination aria-labelledby must contain at least one valid ID token.");if(typeof t=="string"&&t.trim().split(/\s+/).some(r=>/[\u0000-\u001f\u007f]/u.test(r)))throw new TypeError("BasePagination aria-labelledby must contain only valid ID tokens.")}a(QN,"assertAccessibleName");function Pa(e,t){if(typeof e!="string"||!e.trim())throw new TypeError(`BasePagination locale ${t} must resolve to a non-empty string.`);return e}a(Pa,"assertLocaleString");function Vd(e,t){return V(e)?e:t}a(Vd,"getControlContent");function _d(e,t){return typeof e=="string"&&e.trim()?e:t}a(_d,"getControlAriaLabel");function ZN(e,t,o,r){let n=new Set,i=a(d=>{d>=1&&d<=t&&n.add(d);},"addPage");for(let d=0;d<o;d+=1)i(1+d),i(t-d);for(let d=-r;d<=r;d+=1)i(e+d);let s=[...n].sort((d,c)=>d-c),l=[];return s.forEach((d,c)=>{let p=s[c-1];if(p!==void 0){let u=d-p;u===2&&l.push(p+1),u>2&&l.push("ellipsis");}l.push(d);}),l}a(ZN,"getPageItems");var $d=ho.forwardRef(a(function({page:t,defaultPage:o,pageSize:r=20,total:n=0,pageCount:i,hasNext:s,hasPrevious:l,mode:d="compact",siblingCount:c=1,boundaryCount:p=1,label:u,firstLabel:g,previousLabel:f,nextLabel:b,lastLabel:x,appearance:y,className:k,classNames:w,style:v,onPageChange:h,role:S="navigation","aria-label":T,"aria-labelledby":C,...R},M){let I=Ye().pagination,A=Pe(y),N=ke(),D=Ne(A),[E,P]=ho.useState(()=>o??1);if(t!==void 0&&Fd(t,"page"),o!==void 0&&Fd(o,"defaultPage"),Fd(r,"pageSize"),cm(n,"total"),i!==void 0&&Fd(i,"pageCount"),cm(c,"siblingCount"),cm(p,"boundaryCount"),!XN.has(d))throw new TypeError('BasePagination mode must be "compact" or "pages".');if(h!==void 0&&typeof h!="function")throw new TypeError("BasePagination onPageChange must be a function.");Hd(g,"firstLabel"),Hd(f,"previousLabel"),Hd(b,"nextLabel"),Hd(x,"lastLabel"),QN(T,C);let W=Pa(I.navigation,"navigation"),H=Pa(I.first,"first"),B=Pa(I.previous,"previous"),L=Pa(I.next,"next"),F=Pa(I.last,"last"),_=i??Math.max(Math.ceil(n/r),1),$=t!==void 0,G=!$&&o!==void 0,z=Kh($?t:G?E:1,_),re=n>0?(z-1)*r+1:0,Z=Math.min(z*r,n),ae=l??z>1,ee=s??z<_,q=d==="pages"?ZN(z,_,p,c):[],U=a(O=>{let K=Kh(O,_);K!==z&&(G&&P(K),h?.(K));},"requestPage"),X=a((O,K,ne,fe,he)=>jsxRuntime.jsx("button",{type:"button",disabled:!ne,"aria-label":he,"data-slot":O,className:m(D.slots.paginationButton,!ne&&D.slots.paginationButtonDisabled,w?.button),onClick:()=>U(K),children:fe}),"renderControl");return jsxRuntime.jsxs("div",{...N,...R,ref:M,role:S,"aria-label":T??(C===void 0?W:void 0),"aria-labelledby":C,"data-monkeys-component":"pagination","data-slot":"root","data-mode":d,"data-controlled":$||void 0,"data-uncontrolled":G||void 0,className:m(D.slots.paginationRoot,w?.root,k),style:{...D.styles.pagination,...v},children:[jsxRuntime.jsx("div",{"aria-live":"polite","data-slot":"info",className:m(D.slots.paginationInfo,w?.info),children:V(u)?u:n>0?I.range({start:re,end:Z,total:n}):I.emptyResults}),jsxRuntime.jsxs("div",{"data-slot":"controls",className:m(D.slots.paginationControls,w?.controls),children:[d==="pages"?X("first",1,ae,Vd(g,H),_d(g,H)):null,X("previous",z-1,ae,Vd(f,B),_d(f,B)),d==="compact"?jsxRuntime.jsxs("span",{"aria-current":"page","aria-label":Pa(I.currentPage({page:z,pageCount:_}),"currentPage"),"data-slot":"page","data-page":z,className:m(D.slots.paginationPage,w?.page),children:[z," / ",_]}):q.map((O,K)=>{if(O==="ellipsis")return jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"ellipsis",className:m(D.slots.paginationEllipsis,w?.ellipsis),children:"\u2026"},`ellipsis-${K}`);let ne=O===z;return jsxRuntime.jsx("button",{type:"button","aria-current":ne?"page":void 0,"aria-label":Pa(ne?I.currentPage({page:O,pageCount:_}):I.page({page:O,pageCount:_}),ne?"currentPage":"page"),"data-slot":"page","data-page":O,"data-current":ne||void 0,className:m(D.slots.paginationButton,ne&&D.slots.paginationPage,w?.button,ne&&w?.page),onClick:()=>U(O),children:O},O)}),X("next",z+1,ee,Vd(b,L),_d(b,L)),d==="pages"?X("last",_,ee,Vd(x,F),_d(x,F)):null]})]})},"BasePagination"));function JN(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"ml-1 inline-block h-3 w-3 animate-spin",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(JN,"LoadingIcon");function Ud({total:e=0,loadedStart:t,loadedEnd:o,selectedCount:r,page:n=1,pageCount:i,pageSize:s=20,pageSizeOptions:l,showTotal:d,showPageSize:c,paginationMode:p,hasNext:u,hasPrevious:g,loading:f=false,totalLabel:b,selectedLabel:x,pageSizeLabel:y,appearance:k,className:w,classNames:v,onPageChange:h,onPageSizeChange:S,onSummaryClick:T,...C}){let R=Td(),M=Ye().pagination,I=[...new Set(l??R.pageSizeOptions??[10,20,50,100])].filter(L=>Number.isSafeInteger(L)&&L>0),A=d??R.showTotal??true,N=c??R.showPageSize??true,D=p??R.paginationMode??"auto",E=D==="auto"?e>0?"pages":"compact":D,P=t!==void 0&&t>0&&o!==void 0&&o>=t,W=A?b??(P?M.range({start:t,end:o,total:e}):M.range({start:e>0?(n-1)*s+1:0,end:o??0,total:e})):void 0,H=!!h&&(u!==void 0||g!==void 0?!!(u||g||e>s):e>s),B=R.alignment==="end"?"justify-end":R.alignment==="start"?"justify-start":"justify-between";return jsxRuntime.jsx("div",{...C,className:m("flex min-w-0 flex-wrap items-center gap-3 py-2 text-sm",B,v?.root,w),"data-monkeys-component":"list-footer","data-density":R.density,children:jsxRuntime.jsxs("div",{className:"monkeys-list-footer-groups contents",children:[jsxRuntime.jsx("div",{className:m("min-w-0 text-muted-foreground",v?.summary),children:(()=>{let L=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[x??(r!==void 0?M.selected({count:r}):null),r!==void 0&&W?jsxRuntime.jsx("span",{className:"mx-2",children:"\xB7"}):null,W,f?jsxRuntime.jsx(JN,{}):null]});return T?jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center",onClick:T,children:L}):L})()}),H?jsxRuntime.jsx($d,{page:n,pageCount:i,pageSize:s,total:e,mode:E,hasNext:u,hasPrevious:g,onPageChange:h,appearance:k,className:v?.pagination,classNames:{info:"sr-only"}}):null,N&&S&&I.length>0?jsxRuntime.jsxs("label",{className:m("inline-flex items-center gap-2 whitespace-nowrap text-muted-foreground",v?.pageSize),children:[jsxRuntime.jsx("span",{className:"sr-only",children:y??M.pageSize}),jsxRuntime.jsx("select",{"aria-label":typeof y=="string"?y:M.pageSize,value:String(s),className:"h-8 rounded-md border border-border bg-background px-2 text-sm text-foreground",onChange:L=>S(Number(L.currentTarget.value)),children:I.map(L=>jsxRuntime.jsx("option",{value:L,children:L},L))})]}):null]})})}a(Ud,"BaseListFooter");var qh=Symbol.for("@inf-monkeys-tech/monkeys-design/bento-depth@1"),Yh=globalThis,Xh=Yh[qh]??(Yh[qh]=ho.createContext(0));function Go(){return ho.useContext(Xh)}a(Go,"useBentoDepth");function pm({children:e,depth:t}){return jsxRuntime.jsx(Xh.Provider,{value:t,children:e})}a(pm,"BentoDepthProvider");function Cs({children:e}){return jsxRuntime.jsx(pm,{depth:0,children:e})}a(Cs,"BentoScope");var Zh="rounded-[var(--monkeys-bento-radius)] border-[length:var(--monkeys-bento-border-width)] border-[color:var(--monkeys-bento-border-color)] [border-style:var(--monkeys-bento-border-style)] bg-[var(--monkeys-bento-background)] shadow-[shadow:var(--monkeys-bento-shadow)] p-[var(--monkeys-bento-padding)] gap-[var(--monkeys-bento-gap)]";function Jh(){let e=Go(),t=e+1,o=uh(Hn(),t),r=Object.fromEntries(vd.map(n=>[`--monkeys-bento-${n.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`,o.values[n]]));return {parentDepth:e,level:t,variables:r}}a(Jh,"useBentoSurface");function ty({as:e="article",title:t,description:o,media:r,header:n,footer:i,children:s,interactive:l,selected:d,disabled:c,appearance:p,variant:u,density:g,state:f,className:b,classNames:x,style:y,...k}){let w=Ne({...p,variant:u,density:g,state:f}),v=e,h=n!==void 0?V(n):V(t)||V(o),S=r!=null,T=!h&&!S;return jsxRuntime.jsxs(v,{...k,"aria-disabled":c||void 0,"data-variant":w.variant,"data-density":w.density,"data-state":f??(c?"disabled":d?"selected":"idle"),"data-monkeys-component":"panel","data-slot":"root","data-interactive":l||void 0,"data-selected":d||void 0,"data-disabled":c||void 0,className:m(w.slots.panelRoot,l&&!c&&w.slots.panelInteractive,d&&w.slots.panelSelected,c&&w.slots.panelDisabled,x?.root,b),style:{...w.styles.panel,...y},children:[S?jsxRuntime.jsx("div",{"data-slot":"media",className:m(w.slots.panelMedia,x?.media),children:r}):null,h?jsxRuntime.jsx("div",{"data-slot":"header",className:m(w.slots.panelHeader,x?.header),style:w.styles.panelHeader,children:n!==void 0?n:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V(t)?jsxRuntime.jsx("div",{"data-slot":"title",className:m(w.slots.panelTitle,x?.title),children:t}):null,V(o)?jsxRuntime.jsx("div",{"data-slot":"description",className:m(w.slots.panelDescription,x?.description),children:o}):null]})}):null,s!=null?jsxRuntime.jsx("div",{"data-slot":"body",className:m(w.slots.panelBody,T&&w.slots.panelBodyStandalone,x?.body),style:w.styles.panelBody,children:s}):null,i!=null?jsxRuntime.jsx("div",{"data-slot":"footer",className:m(w.slots.panelFooter,x?.footer),style:w.styles.panelFooter,children:i}):null]})}a(ty,"BasePanel");var nR={menu:"monkeys-overlay-surface--menu bg-menu-surface text-popover-foreground",dialog:"monkeys-overlay-surface--dialog bg-dialog-surface text-foreground"};function un(e,t={}){return ["monkeys-overlay-surface",nR[e],t.rounded===false?void 0:"monkeys-overlay-surface--rounded"].filter(Boolean).join(" ")}a(un,"getOverlaySurfaceClassName");var dR=ho__namespace.forwardRef(({className:e,style:t,...o},r)=>jsxRuntime.jsx(pn__namespace.Item,{ref:r,className:m("border-b",e),style:{borderColor:"var(--monkeys-component-accordion-item-border-color, hsl(var(--border)))",...t},...o}));dR.displayName="AccordionItem";var cR=ho__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsx(pn__namespace.Header,{className:"flex",children:jsxRuntime.jsxs(pn__namespace.Trigger,{ref:r,className:m("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...o,children:[t,jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));cR.displayName="AccordionTrigger";var uR=ho__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsx(pn__namespace.Content,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...o,children:jsxRuntime.jsx("div",{className:m("pb-4 pt-0",e),children:t})}));uR.displayName="AccordionContent";var pR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Kd__namespace.Root,{ref:o,className:m("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:jsxRuntime.jsx(Kd__namespace.Indicator,{className:"flex items-center justify-center text-current",children:jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"})})}));pR.displayName="Checkbox";var mR=classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_[data-slot=icon]]:text-[inherit] [&_[data-slot=icon]_*]:!text-[inherit] [&_[data-slot=icon]_svg]:!stroke-current [&_[data-slot=icon]_svg_*]:!stroke-current [&_[data-slot=end-icon]]:text-[inherit] [&_[data-slot=end-icon]_*]:!text-[inherit] [&_[data-slot=end-icon]_svg]:!stroke-current [&_[data-slot=end-icon]_svg_*]:!stroke-current [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-control-surface shadow-sm ring-offset-control-surface hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-sm px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),mt=ho__namespace.forwardRef(({className:e,variant:t,size:o,asChild:r=false,...n},i)=>jsxRuntime.jsx(r?reactSlot.Slot:"button",{ref:i,className:mR({variant:t,size:o,className:e}),...n}));mt.displayName="Button";var fR=ho__namespace.forwardRef(({className:e,children:t,viewportClassName:o,viewportRef:r,onViewportScroll:n,scrollbar:i=true,scrollbarOrientation:s="vertical",scrollBarDisabled:l=false,type:d,...c},p)=>{let u=Go();return jsxRuntime.jsxs(Fr__namespace.Root,{ref:p,type:d??(u>0?"auto":void 0),className:m("group relative overflow-hidden",l&&"no-scrollbar",e),...c,children:[jsxRuntime.jsx(Fr__namespace.Viewport,{ref:r,onScroll:n,className:m("h-full w-full rounded-[inherit]",o),children:t}),i?jsxRuntime.jsx(oy,{orientation:s,className:m(l&&"size-0 p-0")}):null,jsxRuntime.jsx(Fr__namespace.Corner,{})]})});fR.displayName="ScrollArea";var oy=ho__namespace.forwardRef(({className:e,orientation:t="vertical",...o},r)=>jsxRuntime.jsx(Fr__namespace.ScrollAreaScrollbar,{ref:r,"data-monkeys-scrollbar":"",orientation:t,className:m("flex touch-none select-none opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 data-[state=visible]:opacity-100",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e),...o,children:jsxRuntime.jsx(Fr__namespace.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));oy.displayName="ScrollBar";var bR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(qd__namespace.Root,{ref:o,className:m("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,children:jsxRuntime.jsx(qd__namespace.Thumb,{className:"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"})}));bR.displayName="Switch";var Ea=ho__namespace.forwardRef(({variant:e="default",...t},o)=>jsxRuntime.jsx(Un__namespace.Root,{ref:o,"data-variant":e,...t}));Ea.displayName="Tabs";var Aa=ho__namespace.forwardRef(({className:e,gap:t,style:o,...r},n)=>jsxRuntime.jsx(Un__namespace.List,{ref:n,className:m("inline-flex h-10 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),style:{gap:t,...o},...r}));Aa.displayName="TabsList";var Kn=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Un__namespace.Trigger,{ref:o,className:m("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Kn.displayName="TabsTrigger";var mn=ho__namespace.forwardRef(({className:e,...t},o)=>{let r=Go();return jsxRuntime.jsx(Un__namespace.Content,{ref:o,className:m("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r>0&&"gap-[var(--monkeys-bento-gap)]",e),...t})});mn.displayName="TabsContent";var ry=fr__namespace.Provider,ny=fr__namespace.Root,ay=fr__namespace.Trigger,mm=ho__namespace.forwardRef(({className:e,sideOffset:t=4,...o},r)=>{let n=ke();return jsxRuntime.jsx(fr__namespace.Portal,{children:jsxRuntime.jsx(fr__namespace.Content,{...n,...o,ref:r,sideOffset:t,"data-monkeys-component":"tooltip","data-slot":"content","data-surface":"menu",className:m("z-50 overflow-hidden border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",un("menu"),e)})})});mm.displayName="TooltipContent";var wr=ho__namespace.forwardRef(({className:e,appearance:t="standard",type:o,...r},n)=>jsxRuntime.jsx("input",{ref:n,type:o,className:m("flex w-full border border-input bg-control-surface px-3 text-foreground ring-offset-control-surface transition-[border-color,background-color,color,box-shadow] file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t==="compact"?"h-9 rounded-md py-1 text-sm shadow-sm":"h-10 rounded-md py-2 text-sm shadow-sm",t==="shadow"&&"rounded-lg shadow-sm shadow-black/[0.02] dark:border-white/10 dark:bg-white/[0.04] dark:shadow-none",e),...r}));wr.displayName="Input";var bm=ho__namespace.forwardRef(({className:e,appearance:t="standard",...o},r)=>jsxRuntime.jsx("textarea",{ref:r,className:m("flex w-full border border-input bg-control-surface px-3 py-2 text-foreground ring-offset-control-surface placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t==="compact"?"min-h-[60px] rounded-md text-sm shadow-sm":"min-h-[80px] rounded-md text-sm",t==="shadow"&&"rounded-lg shadow-sm shadow-black/[0.02] dark:border-white/10 dark:bg-white/[0.04] dark:shadow-none",e),...o}));bm.displayName="Textarea";function dy({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"input-group",role:"group",className:m("group/input-group shadow-xs relative flex w-full items-center rounded-md border border-input outline-hidden transition-[color,box-shadow] dark:bg-input/30","h-9 has-[>textarea]:h-auto","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col","has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot=input-group-control]:focus-visible]:ring-ring","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}a(dy,"InputGroup");var gR=classVarianceAuthority.cva("text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]","block-start":"[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5","block-end":"[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function Yd({className:e,align:t="inline-start",...o}){return jsxRuntime.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:m(gR({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus();},...o})}a(Yd,"InputGroupAddon");var hR=classVarianceAuthority.cva("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",sm:"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function cy({className:e,type:t="button",variant:o="ghost",size:r="xs",...n}){return jsxRuntime.jsx(mt,{type:t,"data-size":r,variant:o,className:m(hR({size:r}),e),...n})}a(cy,"InputGroupButton");var hm=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(wr,{ref:o,"data-slot":"input-group-control",className:m("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent",e),...t}));hm.displayName="InputGroupInput";var yR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(bm,{ref:o,"data-slot":"input-group-control",className:m("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent",e),...t}));yR.displayName="InputGroupTextarea";var Ts="relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",ym=`z-50 min-w-[8rem] overflow-hidden border p-1 ${un("menu")} data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,Ns=Bt__namespace.Root,Rs=Bt__namespace.Trigger;var my=Bt__namespace.RadioGroup,kR=ho__namespace.forwardRef(({className:e,inset:t,children:o,...r},n)=>jsxRuntime.jsxs(Bt__namespace.SubTrigger,{ref:n,className:m(Ts,"data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[o,jsxRuntime.jsx(lucideReact.ChevronRight,{"aria-hidden":"true",className:"ml-auto"})]}));kR.displayName="DropdownMenuSubTrigger";var CR=ho__namespace.forwardRef(({className:e,...t},o)=>{let r=ke();return jsxRuntime.jsx(Bt__namespace.SubContent,{...r,...t,ref:o,"data-monkeys-component":"dropdown-menu","data-slot":"content","data-surface":"menu",className:m(ym,e)})});CR.displayName="DropdownMenuSubContent";var vi=ho__namespace.forwardRef(({className:e,sideOffset:t=4,...o},r)=>{let n=ke();return jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{...n,...o,ref:r,sideOffset:t,"data-monkeys-component":"dropdown-menu","data-slot":"content","data-surface":"menu",className:m(ym,e)})})});vi.displayName="DropdownMenuContent";var Ms=ho__namespace.forwardRef(({className:e,inset:t,...o},r)=>jsxRuntime.jsx(Bt__namespace.Item,{ref:r,className:m(Ts,t&&"pl-8",e),...o}));Ms.displayName="DropdownMenuItem";var SR=ho__namespace.forwardRef(({className:e,children:t,checked:o,...r},n)=>jsxRuntime.jsxs(Bt__namespace.CheckboxItem,{ref:n,className:m(Ts,"pl-8",e),checked:o,...r,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(Bt__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"})})}),t]}));SR.displayName="DropdownMenuCheckboxItem";var xm=ho__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsxs(Bt__namespace.RadioItem,{ref:r,className:m(Ts,"pl-8",e),...o,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(Bt__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Circle,{"aria-hidden":"true",className:"h-2 w-2 fill-current"})})}),t]}));xm.displayName="DropdownMenuRadioItem";var vm=ho__namespace.forwardRef(({className:e,inset:t,...o},r)=>jsxRuntime.jsx(Bt__namespace.Label,{ref:r,className:m("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));vm.displayName="DropdownMenuLabel";var wm=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Bt__namespace.Separator,{ref:o,className:m("-mx-1 my-1 h-px bg-muted",e),...t}));wm.displayName="DropdownMenuSeparator";var TR=a(({className:e,...t})=>jsxRuntime.jsx("span",{className:m("ml-auto text-xs tracking-widest opacity-60",e),...t}),"DropdownMenuShortcut");TR.displayName="DropdownMenuShortcut";var NR=ho__namespace.forwardRef(({className:e,children:t,iconClassName:o,size:r="default",...n},i)=>jsxRuntime.jsxs(At__namespace.Trigger,{ref:i,className:m("flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-control-surface px-3 py-2 text-left text-sm text-foreground shadow-sm ring-offset-control-surface data-[placeholder]:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:min-w-0 [&>span]:flex-1 [&>span]:text-left",r==="sm"&&"h-8 px-2 py-1 text-xs",e),...n,children:[t,jsxRuntime.jsx(At__namespace.Icon,{asChild:true,children:jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:m("h-4 w-4 opacity-50",o)})})]}));NR.displayName="SelectTrigger";var fy=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.ScrollUpButton,{ref:o,className:m("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(lucideReact.ChevronUp,{"aria-hidden":"true",className:"h-4 w-4"})}));fy.displayName="SelectScrollUpButton";var by=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.ScrollDownButton,{ref:o,className:m("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4"})}));by.displayName="SelectScrollDownButton";var RR=ho__namespace.forwardRef(({className:e,children:t,position:o="popper",viewportClassName:r,disableTriggerViewportSizing:n=false,...i},s)=>{let l=ke();return jsxRuntime.jsx(At__namespace.Portal,{children:jsxRuntime.jsxs(At__namespace.Content,{...l,...i,ref:s,position:o,"data-monkeys-component":"select","data-slot":"content","data-surface":"menu",className:m(ym,"relative max-h-[var(--radix-select-content-available-height)] overflow-y-auto overflow-x-hidden",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),children:[jsxRuntime.jsx(fy,{}),jsxRuntime.jsx(At__namespace.Viewport,{className:m("p-1",o==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]",o==="popper"&&!n&&"h-[var(--radix-select-trigger-height)]",r),children:t}),jsxRuntime.jsx(by,{})]})})});RR.displayName="SelectContent";var MR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.Label,{ref:o,className:m("px-2 py-1.5 text-sm font-semibold",e),...t}));MR.displayName="SelectLabel";var IR=ho__namespace.forwardRef(({className:e,children:t,indicatorClassName:o,itemText:r,hideIndicator:n=false,...i},s)=>jsxRuntime.jsxs(At__namespace.Item,{ref:s,className:m(Ts,"w-full",n?"px-2":"pl-8 pr-2",e),...i,children:[n?null:jsxRuntime.jsx("span",{className:m("absolute left-2 flex h-3.5 w-3.5 items-center justify-center",o),children:jsxRuntime.jsx(At__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"})})}),r?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(At__namespace.ItemText,{asChild:true,children:jsxRuntime.jsx("span",{className:"sr-only",children:r})}),t]}):jsxRuntime.jsx(At__namespace.ItemText,{children:t})]}));IR.displayName="SelectItem";var DR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.Separator,{ref:o,className:m("-mx-1 my-1 h-px bg-muted",e),...t}));DR.displayName="SelectSeparator";function qn(e){if(!e)return;let t=/^data:image\/svg\+xml(?:[;,]|$)/i.test(e.trim());if(!t)try{t=/\.svgz?$/i.test(decodeURIComponent(new URL(e,"https://preview.invalid").pathname));}catch{return}return t?{backgroundColor:"var(--monkeys-media-svg-background)",objectFit:"contain"}:void 0}a(qn,"svgPreviewSurface");var ER=a(({aspectRatio:e="square",maxSquareHeight:t=true,className:o}={})=>m("w-full overflow-hidden bg-muted",(e==="square"||e==="1:1")&&"aspect-square",(e==="square"||e==="1:1")&&t&&"max-h-[300px]",e==="4:3"&&"aspect-[4/3]",e==="3:4"&&"aspect-[3/4]",(e==="video"||e==="16:9")&&"aspect-video",e==="9:16"&&"aspect-[9/16]",o),"mediaPreviewFrameClassName"),Is=ho__namespace.forwardRef(({aspectRatio:e="square",maxSquareHeight:t=true,className:o,...r},n)=>jsxRuntime.jsx("div",{ref:n,className:ER({aspectRatio:e,maxSquareHeight:t,className:o}),...r}));Is.displayName="MediaPreviewFrame";var Ds=ho__namespace.forwardRef(({fit:e="contain",className:t,style:o,...r},n)=>{let i=qn(r.src);return jsxRuntime.jsx("img",{ref:n,className:m("block size-full",e==="contain"?"object-contain":"object-cover",t),style:{...i,...i?{objectFit:e}:{},...o},...r})});Ds.displayName="MediaPreviewImage";var Sm=xo__namespace.Root;var AR=xo__namespace.Portal,hy=ho__namespace.forwardRef(({className:e,...t},o)=>{let r=ke();return jsxRuntime.jsx(xo__namespace.Overlay,{...r,...t,ref:o,"data-monkeys-component":"sheet","data-slot":"overlay","data-monkeys-overlay":true,className:m("theme-overlay-backdrop fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e)})});hy.displayName="SheetOverlay";var BR={top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm"},Xd=ho__namespace.forwardRef(({side:e="right",className:t,children:o,...r},n)=>{let i=ke();return jsxRuntime.jsxs(AR,{children:[jsxRuntime.jsx(hy,{}),jsxRuntime.jsxs(xo__namespace.Content,{...i,...r,ref:n,"data-monkeys-component":"sheet","data-slot":"content","data-surface":"dialog","data-monkeys-dialog-content":true,className:m("fixed z-50 gap-4 p-6 transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",un("dialog",{rounded:false}),BR[e],t),children:[jsxRuntime.jsxs(xo__namespace.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-dialog-surface transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[jsxRuntime.jsx("svg",{"aria-hidden":"true",className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]}),jsxRuntime.jsx(Cs,{children:o})]})]})});Xd.displayName="SheetContent";var Qd=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(xo__namespace.Title,{ref:o,className:m("text-lg font-semibold text-foreground",e),...t}));Qd.displayName="SheetTitle";var LR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(xo__namespace.Description,{ref:o,className:m("text-sm text-muted-foreground",e),...t}));LR.displayName="SheetDescription";var yy=["pulse","shimmer","shimmer-soft","shimmer-diagonal","shimmer-vertical","drift","outline","none"];function vy(e,t=false){if(!(e===void 0||yy.includes(e))&&!(t&&(e==="shimmer-shared"||e==="shimmer-stagger")))throw new TypeError(`Skeleton animation must be ${yy.join(", ")}${t?", shimmer-shared, or shimmer-stagger":""}.`)}a(vy,"validateSkeletonAnimation");var Nm=ho.createContext(null),As=ho.createContext(void 0);function Rm(e){delete e.dataset.skeletonReady;for(let t of ["width","offset","delay"])e.style.removeProperty(`--monkeys-skeleton-${t}`);}a(Rm,"clearGeometry");function zR(e,t,o,r){let n=ho.useMemo(()=>({nodes:new Map,update:a(()=>{},"update")}),[]);return ho.useEffect(()=>{if(!o||t||e!=="shimmer-shared"&&e!=="shimmer-stagger")return;let i=window.matchMedia("(prefers-reduced-motion: reduce)"),s,l,d=false,c=new Set,p=a(()=>{if(l=void 0,!d)return;let b=[...n.nodes.keys()].filter(S=>S.isConnected);if(b.sort((S,T)=>S.compareDocumentPosition(T)&2?1:-1),e==="shimmer-stagger"){b.forEach((S,T)=>{let C=n.nodes.get(S)?.item??T;S.style.setProperty("--monkeys-skeleton-delay",`${Math.min(C*80,400)}ms`);});return}let x=r?.current??b[0]?.parentElement;for(let S of b)for(;x&&!x.contains(S);)x=x.parentElement;let y=new Set(b);for(let S of b)for(let T=S.parentElement;T&&(y.add(T),T!==x);T=T.parentElement);x&&y.add(x);for(let S of c)y.has(S)||(s?.unobserve(S),c.delete(S));for(let S of y)c.has(S)||(s?.observe(S),c.add(S));let k=b.map(S=>S.getBoundingClientRect()),w=b.map((S,T)=>{let C=getComputedStyle(S),R=C.boxSizing==="border-box"?0:parseFloat(C.paddingLeft)+parseFloat(C.paddingRight)+parseFloat(C.borderLeftWidth)+parseFloat(C.borderRightWidth),M=parseFloat(C.width)+R,I=M?k[T].width/M:1;return Math.abs(I-1)<1e-4?1:I}),v=Math.min(...k.map(S=>S.left)),h=Math.max(...k.map(S=>S.right));b.forEach((S,T)=>{let C=k[T];if(!C.width||!C.height){Rm(S);return}let R=w[T];S.style.setProperty("--monkeys-skeleton-width",`${(h-v)/R}px`),S.style.setProperty("--monkeys-skeleton-offset",`${(v-C.left)/R}px`),S.dataset.skeletonReady||(S.style.setProperty("--monkeys-skeleton-delay",`${-(performance.now()%2600)}ms`),S.dataset.skeletonReady="true");});},"measure"),u=a(()=>{d&&l===void 0&&(l=window.requestAnimationFrame(p));},"schedule"),g=a(()=>{d=false,s?.disconnect(),s=void 0,c.clear(),l!==void 0&&window.cancelAnimationFrame(l),l=void 0,window.removeEventListener("resize",u),window.removeEventListener("scroll",u,true),n.nodes.forEach((b,x)=>Rm(x));},"stop"),f=a(()=>{g(),!(i.matches||e==="shimmer-shared"&&typeof ResizeObserver>"u")&&(d=true,e==="shimmer-shared"&&(s=new ResizeObserver(u),window.addEventListener("resize",u),window.addEventListener("scroll",u,{capture:true,passive:true})),u());},"start");return n.update=u,f(),i.addEventListener("change",f),()=>{g(),i.removeEventListener("change",f),n.update=()=>{};}},[e,t,o,n,r]),ho.useEffect(()=>{n.update();}),n}a(zR,"useGroupRegistry");function Xn({animation:e,animated:t,children:o,independent:r=false,containerRef:n}){if(vy(e,true),t!==void 0&&typeof t!="boolean")throw new TypeError("SkeletonGroup animated must be a boolean.");let i=ho.useContext(Nm),s=ho.useContext(As),l=r||e!==void 0||!i,d=e??i?.animation??"pulse",c=!!i?.disabled||t===false||d==="none",p=zR(d,c,l,n),u=ho.useMemo(()=>({animation:d,disabled:c,registry:l?p:i.registry}),[d,c,l,p,i]),g=jsxRuntime.jsx(Nm.Provider,{value:u,children:o});return jsxRuntime.jsx(As.Provider,{value:l?void 0:s,children:g})}a(Xn,"SkeletonScope");function Zd({index:e,children:t}){let o=ho.useContext(As);return jsxRuntime.jsx(As.Provider,{value:o??e,children:t})}a(Zd,"SkeletonItem");function Dm(e,t){return ho.useMemo(()=>{let o;return r=>{if(e(r),typeof t=="function"){if(o)o(),o=void 0;else if(r===null){t(null);return}if(r!==null){let n=t(r);typeof n=="function"&&(o=n);}}else t&&(t.current=r);}},[e,t])}a(Dm,"useSkeletonRef");function Jd(e,t=true,o){vy(e);let r=ho.useContext(Nm),n=ho.useContext(As),i=!t||r?.disabled?"none":e??r?.animation??"pulse",[s,l]=ho.useState(null),d=Dm(l,o),c=e===void 0&&(i==="shimmer-shared"||i==="shimmer-stagger")?r?.registry:void 0;return ho.useEffect(()=>{if(!(!s||!c))return c.nodes.set(s,{item:n}),c.update(),()=>{c.nodes.delete(s),Rm(s),c.update();}},[s,c,n,i]),{ref:d,mode:i,style:i==="shimmer-stagger"&&n!==void 0?{"--monkeys-skeleton-delay":`${Math.min(n*80,400)}ms`}:void 0}}a(Jd,"useSkeletonMotion");var VR=ho.forwardRef(a(function({animation:t,animated:o,children:r,...n},i){let s=ho.useRef(null),l=ho.useCallback(c=>{s.current=c;},[]),d=Dm(l,i);return jsxRuntime.jsx(Xn,{animation:t,animated:o,independent:true,containerRef:s,children:jsxRuntime.jsx("div",{...n,ref:d,children:r})})},"SkeletonGroup"));function Ty({selectedCount:e,loadedStart:t,loadedEnd:o,total:r,currentPage:n=1,pageSize:i=Math.max(1,o||1),pageSizeOptions:s=[],loading:l,selectedLabel:d,loadedLabel:c,pageSizeLabel:p,pageText:u,tone:g="default",className:f,classNames:b,onJump:x,onJumpToPage:y,onPageSizeChange:k}){let w=Ye().pagination,v=typeof t=="number"&&t>0&&o>=t,h=c??(v?w.range({start:t,end:o,total:r}):w.range({start:0,end:o,total:r})),[S,T]=ho.useState(false),[C,R]=ho.useState(String(n)),M=ho.useRef(null),I=r>0?Math.max(1,Math.ceil(r/Math.max(1,i))):1;if(ho.useEffect(()=>{S||R(String(n));},[n,S]),ho.useEffect(()=>{if(!S)return;let A=window.setTimeout(()=>{M.current?.focus(),M.current?.select();},0);return ()=>window.clearTimeout(A)},[S]),g==="hard-edge"){let A=a(()=>{let N=Math.floor(Number(C));if(!Number.isFinite(N)||Number.isNaN(N)){R(String(n)),T(false);return}let D=Math.min(I,Math.max(1,N));T(false),D!==n&&y?.(D);},"confirmJump");return jsxRuntime.jsxs("div",{className:m("flex items-center border-t bg-background px-4 py-3",b?.root,f),"data-monkeys-component":"collection-footer","data-tone":"hard-edge",children:[jsxRuntime.jsxs("div",{className:m("flex min-w-0 items-center gap-1 whitespace-nowrap text-sm text-muted-foreground",b?.summary),children:[e!==void 0?jsxRuntime.jsxs("span",{children:[d??w.selected({count:e})," \xB7"]}):null,y&&r>0?S?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:w.jumpToPage}),jsxRuntime.jsx(wr,{ref:M,type:"number",inputMode:"numeric",min:1,max:I,value:C,onChange:N=>R(N.currentTarget.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),N.currentTarget.blur()),N.key==="Escape"&&(N.preventDefault(),T(false),R(String(n)));},onBlur:A,className:"h-7 w-20 px-2 text-xs","aria-label":w.jumpToPage}),jsxRuntime.jsxs("span",{className:"text-xs text-muted-foreground",children:["/ ",I," ",w.pages]})]}):jsxRuntime.jsxs("button",{type:"button",className:m("inline-flex items-center text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",b?.jumpButton),onClick:()=>{R(String(n)),T(true),x?.();},title:w.clickToJump,children:[h,u?` (${u})`:null,l?jsxRuntime.jsx(lucideReact.Loader2,{"aria-hidden":"true",className:"ml-1 inline-block h-3 w-3 animate-spin"}):null]}):jsxRuntime.jsxs("span",{className:"inline-flex items-center",children:[h,u?` (${u})`:null,l?jsxRuntime.jsx(lucideReact.Loader2,{"aria-hidden":"true",className:"ml-1 h-3 w-3 animate-spin"}):null]})]}),k&&s.length>0?jsxRuntime.jsx("div",{className:m("ml-auto",b?.pageSizeControl),children:jsxRuntime.jsxs(Ns,{children:[jsxRuntime.jsx(Rs,{asChild:true,children:jsxRuntime.jsxs(mt,{type:"button",variant:"outline",size:"sm",className:m("h-8 gap-1 px-2",b?.pageSizeButton),"aria-label":typeof p=="string"?p:w.perLoad,children:[i,jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4"})]})}),jsxRuntime.jsxs(vi,{align:"end",className:"w-32",children:[jsxRuntime.jsx(vm,{children:p??w.perLoad}),jsxRuntime.jsx(wm,{}),jsxRuntime.jsx(my,{value:String(i),onValueChange:N=>{let D=Number(N);Number.isFinite(D)&&k(D);},children:s.map(N=>jsxRuntime.jsx(xm,{value:String(N),children:N},N))})]})]})}):null]})}return jsxRuntime.jsx(Ud,{total:r,loadedStart:t,loadedEnd:o,selectedCount:e,page:n,pageSize:i,pageSizeOptions:s,loading:l,totalLabel:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[h," ",u?`(${u})`:null]}),selectedLabel:d,pageSizeLabel:p,className:f,classNames:{root:b?.root,summary:b?.summary,pageSize:b?.pageSizeControl},onSummaryClick:x,onPageSizeChange:k})}a(Ty,"DataExplorerCollectionFooter");function jR(e){return typeof e=="number"?`${e}px`:e}a(jR,"toCssSize");function Ry({label:e,leading:t,children:o,actions:r,maxFieldsHeight:n=80,className:i,classNames:s,style:l,...d}){let c={maxHeight:jR(n)};return jsxRuntime.jsx("div",{className:j("border-b border-border/60 bg-background px-8 py-3",s?.root,i),style:l,...d,children:jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-start gap-2 text-sm",s?.layout),children:[e?jsxRuntime.jsx("div",{className:j("flex h-9 shrink-0 items-center font-semibold text-foreground",s?.label),children:e}):null,jsxRuntime.jsx("div",{className:j("min-w-0 flex-1 overflow-y-auto overscroll-contain",s?.fieldsViewport),style:c,children:jsxRuntime.jsxs("div",{className:j("flex flex-wrap items-center gap-2",s?.fields),children:[t,o]})}),r?jsxRuntime.jsx("div",{className:j("flex shrink-0 items-center gap-2",s?.actions),children:r}):null]})})}a(Ry,"DataExplorerFilterBar");function My(e){return e!=null&&e!==false&&e!==""}a(My,"hasContent");function tc({field:e,label:t=e?.label,icon:o=e?.icon,value:r=e?.value,helperText:n=e?.helperText,error:i=e?.error,required:s=e?.required??false,disabled:l=e?.disabled??false,children:d,context:c,className:p,valueClassName:u=e?.valueClassName,classNames:g,dataAttributes:f=e?.dataAttributes,labelDataAttributes:b=e?.labelDataAttributes,valueDataAttributes:x=e?.valueDataAttributes,helperDataAttributes:y=e?.helperDataAttributes,errorDataAttributes:k=e?.errorDataAttributes}){let w={...e?.classNames,...g},v=d??(e?.render?e.render(c):r),h=My(i);return jsxRuntime.jsxs("div",{...f,title:e?.title,"aria-disabled":l||void 0,"data-disabled":l||void 0,"data-invalid":h||void 0,"data-required":s||void 0,className:j("min-w-0 space-y-1",l&&"opacity-60",w.root,e?.className,p),children:[jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-center gap-1.5 text-[13px] font-medium text-muted-foreground",w.label),children:[o?jsxRuntime.jsx("span",{className:j("inline-flex shrink-0 items-center justify-center",w.icon),children:o}):null,jsxRuntime.jsx("span",{...b,className:"min-w-0 truncate",children:t}),s?jsxRuntime.jsx("span",{"aria-hidden":"true",className:j("text-destructive-text",w.required),children:"*"}):null]}),jsxRuntime.jsx("div",{...x,className:j("min-w-0 max-w-full text-[15px] leading-6 text-foreground [overflow-wrap:anywhere]",w.value,u),children:v}),My(n)?jsxRuntime.jsx("div",{...y,"data-slot":"helper",className:j("min-w-0 max-w-full text-xs leading-5 text-muted-foreground [overflow-wrap:anywhere]",w.helper),children:n}):null,h?jsxRuntime.jsx("div",{...k,role:"alert","data-slot":"error",className:j("min-w-0 max-w-full text-xs leading-5 text-destructive-text [overflow-wrap:anywhere]",w.error),children:i}):null]})}a(tc,"DataExplorerDetailField");function oc({section:e,title:t=e?.title,fields:o=e?.fields,children:r,context:n,className:i,classNames:s,fieldClassNames:l}){let d={...e?.classNames,...s},c=(o||[]).filter(g=>!(Mt(g.hidden,n)??false)),p=r??(typeof e?.children=="function"?e.children(n):e?.children);return !(!!p||c.length>0)||Mt(e?.hidden,n)?null:jsxRuntime.jsxs("section",{className:j("border-b border-border pb-6 last:border-b-0 last:pb-0",d.root,e?.className,i),children:[t?jsxRuntime.jsx("div",{className:j("mb-4 text-[15px] font-semibold text-foreground",d.title),children:t}):null,jsxRuntime.jsxs("div",{className:j("space-y-4",d.body),children:[p,c.map((g,f)=>jsxRuntime.jsx(tc,{field:g,context:n,classNames:l},g.id||String(f)))]})]})}a(oc,"DataExplorerDetailSection");function UR(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-[18px] w-[18px]",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M18 6 6 18"}),jsxRuntime.jsx("path",{d:"m6 6 12 12"})]})}a(UR,"DefaultCloseIcon");function Ey(){return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m15 18-6-6 6-6"})})}a(Ey,"DefaultChevronLeftIcon");function Ay(){return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m9 18 6-6-6-6"})})}a(Ay,"DefaultChevronRightIcon");function By({title:e,subtitle:t,leading:o,actions:r,preview:n,previewVisible:i=true,previewStyle:s,previewPadded:l=false,previewCentered:d=true,sections:c=[],rightPanel:p,context:u,navigation:g,closeLabel:f="Close",closeIcon:b,closeVisible:x=true,onClose:y,appearance:k,className:w,classNames:v}){let h=Ct(Et(k)),S=(g?.visible??true)&&typeof g?.count=="number"&&g.count>1,T=c.filter(C=>!(Mt(C.hidden,u)??false));return jsxRuntime.jsxs("div",{className:j(h.slots.detailRoot,v?.root,w),style:h.styles.detailRoot,children:[jsxRuntime.jsxs("div",{className:j(h.slots.detailHeader,v?.header),children:[jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-center gap-3",v?.headerMain),children:[o?jsxRuntime.jsx("div",{className:j(h.slots.detailLeading,v?.leading),children:o}):null,jsxRuntime.jsxs("div",{className:j("min-w-0",v?.titleGroup),children:[jsxRuntime.jsx("div",{className:j("truncate text-[20px] font-semibold leading-tight text-foreground",v?.title),children:e}),t?jsxRuntime.jsx("div",{className:j("mt-1 min-w-0 truncate text-sm text-muted-foreground",v?.subtitle),children:t}):null]})]}),jsxRuntime.jsxs("div",{className:j("flex items-center gap-2",v?.headerActions),children:[r,S?jsxRuntime.jsxs("div",{className:j(h.slots.detailNavigation,v?.navigation),children:[jsxRuntime.jsx("button",{type:"button","aria-label":g?.previousLabel||"Previous",className:j(h.slots.detailNavigationButton,v?.navigationButton),disabled:!g?.onPrevious,onClick:g?.onPrevious,children:jsxRuntime.jsx(Ey,{})}),jsxRuntime.jsxs("div",{className:j("min-w-[74px] text-center text-xs font-medium text-muted-foreground",v?.navigationCount),children:[g.index+1," / ",g.count]}),jsxRuntime.jsx("button",{type:"button","aria-label":g?.nextLabel||"Next",className:j(h.slots.detailNavigationButton,v?.navigationButton),disabled:!g?.onNext,onClick:g?.onNext,children:jsxRuntime.jsx(Ay,{})})]}):null,x?jsxRuntime.jsx("button",{type:"button","aria-label":f,className:j(h.slots.detailCloseButton,v?.closeButton),onClick:y,children:b??jsxRuntime.jsx(UR,{})}):null]})]}),jsxRuntime.jsxs("div",{className:j("grid min-h-0 flex-1",i?"xl:grid-cols-[minmax(0,1fr)_380px] 2xl:grid-cols-[minmax(0,1fr)_400px]":"grid-cols-1",v?.body),children:[i?jsxRuntime.jsx("div",{className:j(h.slots.detailPreviewPanel,v?.previewPanel),children:jsxRuntime.jsxs("div",{className:j("flex h-full min-h-0 flex-col",v?.previewStack),children:[S?jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsxs("div",{className:j("text-xs text-muted-foreground xl:hidden",v?.previewMobileCount),children:[g.index+1," / ",g.count]})}):null,jsxRuntime.jsx("div",{className:j("flex min-h-0 flex-1 justify-center",d&&"items-stretch",v?.previewWrapper),children:jsxRuntime.jsxs("div",{className:j(h.slots.detailPreviewFrame,v?.previewFrame),style:s,children:[jsxRuntime.jsx("div",{className:j("relative flex h-full w-full items-center justify-center",l&&"p-4",v?.previewContent),children:n}),S?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button","aria-label":g?.previousLabel||"Previous",className:j(h.slots.previewNavigationButton,"left-4",v?.previewNavigationButton),disabled:!g?.onPrevious,onClick:g?.onPrevious,children:jsxRuntime.jsx(Ey,{})}),jsxRuntime.jsx("button",{type:"button","aria-label":g?.nextLabel||"Next",className:j(h.slots.previewNavigationButton,"right-4",v?.previewNavigationButton),disabled:!g?.onNext,onClick:g?.onNext,children:jsxRuntime.jsx(Ay,{})})]}):null]})})]})}):null,jsxRuntime.jsx("div",{className:j(h.slots.detailRightPanel,v?.rightPanel),children:jsxRuntime.jsx("div",{className:j(h.slots.detailRightPanelBody,v?.rightPanelBody),style:{scrollbarGutter:"stable"},children:p??jsxRuntime.jsx("div",{className:j("space-y-6",v?.sections),children:T.map(C=>jsxRuntime.jsx(oc,{section:C,context:u,className:v?.section,fieldClassNames:{root:v?.field}},C.id))})})})]})]})}a(By,"DataExplorerDetailShell");function Wy(e){if(e===null)return null;if(typeof e=="string"&&e.trim().length>0)return e;throw new TypeError("BaseField validate must return a non-empty error string or null.")}a(Wy,"resolveBaseFieldValidationResult");var Pm=ho.createContext(null);function Qn(){let e=ho.useContext(Pm),t=ho.useRef(null);t.current===null&&(t.current=Symbol("BaseFieldControl"));let o=e?.registerControl;ho.useEffect(()=>{if(!(!o||t.current===null))return o(t.current)},[o]);let r=e?.notifyBlur,n=e?.notifyChange;return {invalid:e?.invalid??false,notifyBlur:ho.useCallback(i=>r?.(i),[r]),notifyChange:ho.useCallback(i=>n?.(i),[n])}}a(Qn,"useBaseFieldControl");var oM={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"},rM={sm:"text-[10px]",md:"text-[11px]",lg:"text-xs"};function nM(e,...t){for(let o of t)if(o){if(typeof o=="function"){o(e);continue}o.current=e;}}a(nM,"setRefs");var ki=ho.forwardRef(a(function({label:t,description:o,indeterminate:r=false,invalid:n=false,disabled:i=false,controlSize:s,appearance:l,className:d,classNames:c,style:p,checked:u,defaultChecked:g,onBlur:f,onChange:b,"aria-invalid":x,...y},k){for(let[L,F]of [["indeterminate",r],["invalid",n],["disabled",i]])if(typeof F!="boolean")throw new TypeError(`BaseCheckbox ${L} must be a boolean.`);if(s!==void 0&&s!=="sm"&&s!=="md"&&s!=="lg")throw new TypeError('BaseCheckbox controlSize must be "sm", "md", or "lg".');let w=Pe(l),v=ke(),h=Ne(w),S=Qn(),T=n||S.invalid,C=V(t),R=Md(o),M=ho.useRef(null),I=ho.useRef(r);I.current=r;let[A,N]=ho.useState(g??false),D=u!==void 0,E=!!(D?u:A),P=r||E,W=r?"mixed":E?"checked":"unchecked",H=ho.useCallback(L=>{M.current=L,L&&(L.indeterminate=I.current),nM(L,k);},[k]);ho.useEffect(()=>{M.current&&(M.current.indeterminate=r);},[r]);let B=a(L=>{i||(D||N(L.currentTarget.checked),b?.(L),S.notifyChange(L.currentTarget.checked),M.current&&(M.current.indeterminate=r));},"handleChange");return jsxRuntime.jsxs("label",{...v,"data-monkeys-component":"checkbox","data-slot":"root","data-state":W,"data-size":s,"data-invalid":T||void 0,"data-disabled":i||void 0,className:m(h.slots.checkboxRoot,!R&&"items-center",i&&h.slots.checkboxDisabled,c?.root,d),style:{...h.styles.checkboxRoot,...p},children:[jsxRuntime.jsxs("span",{"data-slot":"box","data-state":W,"data-size":s,className:m(h.slots.checkboxBox,!R&&"mt-0",P&&h.slots.checkboxBoxChecked,T&&h.slots.checkboxBoxInvalid,s&&oM[s],c?.box),style:{...h.styles.checkboxBox},children:[jsxRuntime.jsx("input",{...y,ref:H,type:"checkbox",disabled:i,checked:u,defaultChecked:g,"aria-invalid":x??(T||void 0),"aria-checked":r?"mixed":E,"data-slot":"input","data-state":W,"data-size":s,"data-invalid":T||void 0,"data-disabled":i||void 0,className:m(h.slots.checkboxInput,c?.input),onBlur:L=>{f?.(L),S.notifyBlur(L.currentTarget.checked);},onChange:B}),P?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator","data-state":W,"data-size":s,className:m(h.slots.checkboxIndicator,s&&rM[s],c?.indicator),children:r?"\u2013":"\u2713"}):null]}),C||R?jsxRuntime.jsxs("span",{"data-slot":"content",className:m(h.slots.checkboxContent,c?.content),children:[C?jsxRuntime.jsx("span",{"data-slot":"label",className:m(h.slots.checkboxLabel,c?.label),children:t}):null,R?jsxRuntime.jsx("span",{"data-slot":"description",className:m(h.slots.checkboxDescription,c?.description),children:o}):null]}):null]})},"BaseCheckbox"));function iM(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"19",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"5",cy:"12",r:"1"})]})}a(iM,"MoreIcon");function nc({item:e,itemId:t=e?.id,source:o=e?.source,actions:r=[],label:n="Actions",triggerLabel:i="Open actions",triggerIcon:s,align:l="end",sideOffset:d=6,appearance:c,className:p,classNames:u}){let[g,f]=ho.useState(false),b=Ct(Et(c)),x={itemId:t,item:e,source:o},y=r.filter(k=>Mt(k.visible,x)??true);return y.length===0?null:jsxRuntime.jsx("span",{className:j("inline-flex",u?.root),children:jsxRuntime.jsxs(Bt__namespace.Root,{open:g,onOpenChange:f,children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{type:"button","aria-label":i,className:j(b.slots.menuTrigger,u?.trigger,p),onClick:k=>k.stopPropagation(),children:[s??jsxRuntime.jsx(iM,{}),jsxRuntime.jsx("span",{className:"sr-only",children:i})]})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{align:l,sideOffset:d,className:j(b.slots.menuContent,u?.content),style:b.styles.menuContent,onClick:k=>k.stopPropagation(),children:[n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Bt__namespace.Label,{className:j(b.slots.menuLabel,u?.label),children:n}),jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)})]}):null,y.map(k=>{let w=(Mt(k.disabled,x)??false)||(Mt(k.loading,x)??false);return k.render?jsxRuntime.jsxs("div",{children:[k.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)}):null,k.render(x),k.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)}):null]},k.id):jsxRuntime.jsxs("div",{children:[k.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:j("-mx-1 my-1 h-px bg-border",u?.separator)}):null,jsxRuntime.jsxs(Bt__namespace.Item,{title:k.title,disabled:w,className:j(b.slots.menuItem,Gn(b,k.tone),u?.item,k.className),style:b.styles.menuItem,onSelect:()=>{!k.onAction||w||k.onAction(x);},onContextMenu:v=>{!k.onContextAction||w||(v.preventDefault(),v.stopPropagation(),f(false),k.onContextAction(x));},children:[k.icon?jsxRuntime.jsx("span",{className:j(b.slots.menuItemIcon,u?.itemIcon),children:k.icon}):null,jsxRuntime.jsx("span",{className:j(b.slots.menuItemLabel,u?.itemLabel),children:k.label})]}),k.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)}):null]},k.id)})]})})]})})}a(nc,"DataExplorerDisplayActionMenu");function lM(e){return e?Array.isArray(e)?e.filter(Boolean):[e]:[]}a(lM,"normalizeMedia");function dM(e){return String(e||"unknown").toLowerCase()}a(dM,"resolveMediaKind");function Ci({media:e,fallbackTitle:t,empty:o,className:r,classNames:n,onOpen:i}){let l=lM(e)[0];if(!l)return o?jsxRuntime.jsx("div",{className:j("flex min-h-24 items-center justify-center bg-muted/30 text-sm text-muted-foreground",n?.placeholder,r),children:o}):null;if(l.node)return jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",n?.root,r),children:l.node});let d=dM(l.kind),c=String(l.src||l.thumbnail||"").trim(),p=l.title??t,u=l.alt||(typeof p=="string"?p:"preview"),g=typeof i=="function",f=c?d==="image"||d==="unknown"?jsxRuntime.jsx("img",{src:c,style:qn(c),alt:u,className:j("h-auto w-full object-contain",n?.media),loading:"lazy",decoding:"async",draggable:false}):d==="video"?jsxRuntime.jsx("video",{src:c,className:j("h-auto w-full",n?.media),controls:true,preload:"metadata"}):d==="audio"?jsxRuntime.jsx("audio",{src:c,className:j("w-full",n?.media),controls:true,preload:"metadata"}):jsxRuntime.jsxs("div",{className:j("flex min-h-24 flex-col items-center justify-center gap-1 bg-muted/30 p-4 text-center text-sm text-muted-foreground",n?.placeholder),children:[p?jsxRuntime.jsx("span",{className:j("max-w-full truncate",n?.title),children:p}):null,jsxRuntime.jsx("span",{className:"max-w-full truncate",children:c})]}):jsxRuntime.jsx("div",{className:j("flex min-h-24 items-center justify-center bg-muted/30 text-sm text-muted-foreground",n?.placeholder),children:p||"No preview"});return g?jsxRuntime.jsx("button",{type:"button",className:j("block min-w-0 overflow-hidden text-left",n?.root,r),onClick:()=>i?.(l,0),children:f}):jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",n?.root,r),children:f})}a(Ci,"DataExplorerDisplayMedia");function uM(e){return e?Array.isArray(e)?e.every(t=>!!t&&typeof t=="object"&&("src"in t||"thumbnail"in t||"node"in t||"kind"in t)):typeof e=="object"&&("src"in e||"thumbnail"in e||"node"in e||"kind"in e):false}a(uM,"isDisplayMedia");function pM(e){if(e?.length)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map((t,o)=>jsxRuntime.jsx("span",{title:t.title,className:j("inline-flex max-w-full items-center rounded-full border border-border/60 px-2 py-0.5 text-xs font-medium",t.tone==="primary"&&"border-primary/30 bg-primary/10 text-primary",t.tone==="success"&&"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-[hsl(var(--success,142_72%_29%))]",t.tone==="warning"&&"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))]",t.tone==="danger"&&"border-destructive/30 bg-destructive/10 text-destructive-text",t.tone==="muted"&&"bg-muted text-muted-foreground"),children:jsxRuntime.jsx("span",{className:"truncate",children:t.label})},t.id??o))})}a(pM,"renderBadges");function mM(e){if(e?.length)return jsxRuntime.jsx("dl",{className:"grid min-w-0 grid-cols-1 gap-2 text-xs sm:grid-cols-2",children:e.map((t,o)=>jsxRuntime.jsxs("div",{className:"min-w-0",children:[t.label?jsxRuntime.jsx("dt",{className:"truncate text-muted-foreground",title:t.title,children:t.label}):null,jsxRuntime.jsx("dd",{className:"mt-0.5 min-w-0 truncate text-foreground",children:t.value})]},t.id??o))})}a(mM,"renderMetadata");function fM(e){if(e?.length)return jsxRuntime.jsx("div",{className:"flex min-w-0 flex-wrap gap-1.5",children:e.map((t,o)=>jsxRuntime.jsx("span",{className:"max-w-full truncate rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:t},o))})}a(fM,"renderKeywords");function Jn({item:e,title:t=e?.title,description:o=e?.description,badges:r=pM(e?.badges),meta:n=e?.status,actions:i,media:s=e?.media,header:l,headerLeading:d,headerContent:c,overlay:p,footer:u,children:g,selected:f=e?.selected,disabled:b=e?.disabled,interactive:x,role:y,tabIndex:k,appearance:w,className:v,classNames:h,onClick:S,onKeyDown:T}){let C=Ct(Et(w)),R=x??!!(S||T),I=l!==void 0?!!l:!!(d||c||t||o||r||n||i),A=uM(s)?jsxRuntime.jsx(Ci,{media:s,fallbackTitle:t}):s,N=mM(e?.metadata),D=fM(e?.keywords),E=g!==void 0?g:N||D?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[N,D]}):void 0,P=!!E;return jsxRuntime.jsxs("article",{className:j(C.slots.cardRoot,R&&!b&&C.slots.cardInteractive,f&&C.slots.cardSelected,b&&C.slots.cardDisabled,h?.root,v),"aria-disabled":b||void 0,role:y,tabIndex:k,style:C.styles.cardRoot,onClick:b?void 0:S,onKeyDown:b?void 0:T,children:[p?jsxRuntime.jsx("div",{className:j(h?.overlay),children:p}):null,I?jsxRuntime.jsx("div",{className:j(C.slots.cardHeader,h?.header),children:l!==void 0?l:jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-start justify-between gap-3",h?.headerMain),children:[d?jsxRuntime.jsx("div",{className:j("flex shrink-0 items-center gap-2",h?.headerLeading),children:d}):null,jsxRuntime.jsx("div",{className:j("min-w-0 flex-1",h?.headerContent),children:c??jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t?jsxRuntime.jsx("div",{className:j("truncate text-sm font-semibold leading-none text-foreground",h?.title),children:t}):null,o?jsxRuntime.jsx("div",{className:j("mt-1 min-w-0 text-sm text-muted-foreground [overflow-wrap:anywhere]",h?.description),children:o}):null,r?jsxRuntime.jsx("div",{className:j("mt-2 flex flex-wrap items-center gap-2",h?.badges),children:r}):null]})}),n||i?jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n?jsxRuntime.jsx("div",{className:j("min-w-0 max-w-[12rem] truncate text-sm text-muted-foreground",h?.meta),children:n}):null,i?jsxRuntime.jsx("div",{className:j("flex shrink-0 items-center gap-2",h?.actions),children:i}):null]}):null]})}):null,A?jsxRuntime.jsx("div",{className:j(C.slots.cardMedia,h?.media),children:A}):null,P?jsxRuntime.jsx("div",{className:j("min-w-0 px-4 pb-4",h?.body),children:E}):null,u?jsxRuntime.jsx("div",{className:j(C.slots.cardFooter,h?.footer),children:u}):null]})}a(Jn,"DataExplorerDisplayCard");function ac({media:e,title:t,description:o,meta:r,badges:n,actions:i,footer:s,children:l,className:d,classNames:c}){let p=!!t||!!o||!!r||!!n||!!i;return jsxRuntime.jsxs("article",{className:j("flex min-w-0 flex-col overflow-hidden rounded-lg border border-border/60 bg-background",c?.root,d),children:[e?jsxRuntime.jsx("div",{className:j("shrink-0 overflow-hidden",c?.media),children:e}):null,p?jsxRuntime.jsxs("div",{className:j("flex flex-col gap-3 p-4",c?.header),children:[jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[t?jsxRuntime.jsx("div",{className:j("truncate text-sm font-semibold text-foreground",c?.title),children:t}):null,o?jsxRuntime.jsx("div",{className:j("mt-1 text-sm text-muted-foreground",c?.description),children:o}):null]}),r||i?jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r?jsxRuntime.jsx("div",{className:j("text-sm text-muted-foreground",c?.meta),children:r}):null,i?jsxRuntime.jsx("div",{className:j("flex items-center gap-2",c?.actions),children:i}):null]}):null]}),n?jsxRuntime.jsx("div",{className:j("flex flex-wrap items-center gap-2",c?.badges),children:n}):null]}):null,l?jsxRuntime.jsx("div",{className:j("min-w-0 px-4 pb-4",c?.body),children:l}):null,s?jsxRuntime.jsx("div",{className:j("shrink-0 border-t border-border/60 px-4 py-3",c?.footer),children:s}):null]})}a(ac,"DataExplorerViewItemShell");function ic(e){let{item:t,index:o,itemId:r,context:n,capabilities:i,itemDefinition:s,className:l,selected:d,actions:c,onOpen:p,onSelectionChange:u}=e;if(s?.render)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:s.render(e)});let g=typeof s?.shellProps=="function"?s.shellProps({item:t,index:o,itemId:r,context:n,capabilities:i,itemDefinition:s,className:l,selected:d,actions:c,onOpen:p,onSelectionChange:u}):s?.shellProps;return jsxRuntime.jsx(ac,{...g,className:l})}a(ic,"DataExplorerViewItem");function xM(e){switch(e){case "list":return "flex min-h-0 flex-col gap-3";case "waterfall":return "columns-1 gap-4 sm:columns-2 lg:columns-3";default:return "grid min-h-0 gap-4"}}a(xM,"getItemsClassName");function vM(e){if(e==="waterfall")return "mb-4 break-inside-avoid"}a(vM,"getDefaultItemClassName");function wM(e,t){return String(t)}a(wM,"defaultResolveItemId");function kM(e){return typeof e=="number"?`${Bm(e,220)}px`:e}a(kM,"resolveMeasuredGridMinColumnWidth");function Hy(e,t,o){return Math.max(1,Math.ceil((e+o)/(t+o)))}a(Hy,"resolveMeasuredGridSpan");function Bm(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}a(Bm,"resolvePositiveNumber");function CM(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:t}a(CM,"resolveNonNegativeNumber");function Ti({items:e,activeViewId:t,context:o,capabilities:r,className:n,classNames:i,empty:s,loading:l,loadingNode:d,footer:c,overlay:p,layout:u="grid",scrollable:g=true,wrapItems:f=true,measuredGrid:b,itemsStyle:x,itemStyle:y,selectedIds:k=[],getItemId:w,itemDefinition:v,renderItem:h,getItemClassName:S,onOpenItem:T,onSelectionChange:C}){let R=Array.isArray(e)?e:[],M=new Set(k),I=w??wM,A=b===true?{}:b&&typeof b=="object"?b:void 0,N=u==="grid"&&!!(A?.enabled??b),D=Bm(A?.rowHeight,4),E=CM(A?.gap,8),P=A?.minColumnWidth??"220px",W=ho.useRef(new Map),H=ho.useRef(new Map),B=ho.useRef(new Map),L=ho.useRef(null),[,F]=ho.useState(0),_=typeof y=="function"?ae=>y(ae):()=>y;ho.useEffect(()=>{if(!N||typeof ResizeObserver>"u")return;let ae=new ResizeObserver(ee=>{let q=false;for(let U of ee){let O=U.target.dataset.dataExplorerItemId;if(!O)continue;let K=Math.ceil(U.contentRect.height),ne=Hy(K,D,E);B.current.get(O)!==ne&&(B.current.set(O,ne),q=true);}q&&F(U=>U+1);});L.current=ae;for(let ee of W.current.values())ae.observe(ee);return ()=>{ae.disconnect(),L.current===ae&&(L.current=null);}},[N,E,D]),ho.useEffect(()=>{if(!N){W.current.clear(),H.current.clear(),B.current.clear();return}let ae=new Set(R.map((q,U)=>I(q,U))),ee=false;for(let q of B.current.keys())ae.has(q)||(B.current.delete(q),ee=true);for(let[q,U]of W.current.entries())ae.has(q)||(L.current?.unobserve(U),W.current.delete(q));for(let q of H.current.keys())ae.has(q)||H.current.delete(q);ee&&F(q=>q+1);},[N,R,I]);let $=ho.useCallback(ae=>{let ee=H.current.get(ae);if(ee)return ee;let q=a(U=>{let X=W.current.get(ae);X&&X!==U&&(L.current?.unobserve(X),W.current.delete(ae)),U&&(U.dataset.dataExplorerItemId=ae,W.current.set(ae,U),L.current?.observe(U));},"callback");return H.current.set(ae,q),q},[]),G=a(ae=>{let ee=ae.itemId;if(ee){let O=B.current.get(ee);if(O)return O}let q=A?.estimateItemHeight,U=typeof q=="function"?q(ae):typeof q=="number"?q:240,X=Bm(U,240);return Hy(X,D,E)},"getMeasuredGridSpan"),z=a(()=>N?{...x,gap:E,gridAutoFlow:"dense",gridAutoRows:D,gridTemplateColumns:`repeat(auto-fill, minmax(${kM(P)}, 1fr))`}:x,"resolveMeasuredItemsStyle"),re=a(()=>l&&d?jsxRuntime.jsx("div",{className:j("flex items-center justify-center p-6 text-sm text-muted-foreground",i?.loading),children:d}):s?jsxRuntime.jsx("div",{className:j("flex items-center justify-center p-6 text-sm text-muted-foreground",i?.empty),children:s}):null,"renderStatus"),Z=a((ae,ee,q,U)=>{if(!C)return;let X=w?w(ae,ee):q,O=U?Array.from(new Set([...k,X])):k.filter(K=>K!==X);C(O);},"handleSelectionChange");return R.length===0&&!c&&!p?re():jsxRuntime.jsxs("div",{className:j("relative flex min-h-0 flex-1 flex-col overflow-hidden",i?.root,n),"data-view-id":t||void 0,children:[R.length>0?jsxRuntime.jsx("div",{className:j(xM(u),g&&"overflow-auto",i?.items),style:z(),children:R.map((ae,ee)=>{let q=I(ae,ee),U=M.has(q),O={item:ae,index:ee,itemId:q,context:o,capabilities:r,itemDefinition:v,selected:U,onOpen:T,onSelectionChange:a((ie,be)=>{Z(ie,ee,q,be);},"selectionChange")},K=j(vM(u),i?.item,S?.({...O,className:i?.item})),ne={...O,className:K},fe=h?h(ne):jsxRuntime.jsx(ic,{...ne}),he=_(ne),me=N?{...he,gridRowEnd:`span ${G(ne)}`}:he;return f?jsxRuntime.jsx("div",{className:K,style:me,children:N?jsxRuntime.jsx("div",{ref:$(q),children:fe}):fe},q):N?jsxRuntime.jsx("div",{className:K,style:me,children:jsxRuntime.jsx("div",{ref:$(q),children:fe})},q):jsxRuntime.jsx(ho.Fragment,{children:fe},q)})}):re(),l&&d&&R.length>0?jsxRuntime.jsx("div",{className:j("shrink-0 p-3 text-sm text-muted-foreground",i?.loading),children:d}):null,c?jsxRuntime.jsx("div",{className:j("shrink-0",i?.footer),children:c}):null,p?jsxRuntime.jsx("div",{className:j("absolute inset-0 z-10",i?.overlay),children:p}):null]})}a(Ti,"DataExplorerViewCollection");function lc({className:e,classNames:t,...o}){return jsxRuntime.jsx(Jn,{...o,className:j("rounded-md",e),classNames:{...t,root:j("flex-row items-stretch",t?.root),media:j("w-28 shrink-0",t?.media),header:j("flex min-w-0 flex-1 items-center p-3",t?.header),body:j("px-3 pb-3",t?.body)}})}a(lc,"DataExplorerDisplayListItem");function Vy(e,t){if(e)return typeof e=="function"?e(t):e}a(Vy,"resolveDisplayItemProps");function NM(e,t,o){let{item:r,layout:n}=e,i=!!t&&!r.disabled,s=o?.renderActions?o.renderActions(e):r.actions?.length?jsxRuntime.jsx(nc,{item:r,actions:r.actions,appearance:o?.appearance}):void 0,l={media:o?.renderMedia?o.renderMedia(e):void 0,actions:s,appearance:o?.appearance,interactive:i,onClick:i?()=>t?.(r):void 0};if(n==="list"){let c=Vy(o?.listItemProps,e);return jsxRuntime.jsx(lc,{...l,...c,item:r,className:j(l.className,c?.className)})}let d=Vy(o?.cardProps,e);return jsxRuntime.jsx(Jn,{...l,...d,item:r,className:j(l.className,d?.className)})}a(NM,"renderDefaultItem");function _y({items:e,activeViewId:t="display",layout:o="grid",appearance:r,selectedIds:n,empty:i,loading:s,loadingNode:l,footer:d,overlay:c,className:p,classNames:u,scrollable:g,wrapItems:f,measuredGrid:b,itemsStyle:x,itemStyle:y,getItemClassName:k,cardProps:w,listItemProps:v,renderMedia:h,renderActions:S,renderItem:T,onOpenItem:C,onSelectionChange:R}){return jsxRuntime.jsx(Ti,{activeViewId:t,items:e,layout:o,selectedIds:n,className:p,classNames:u,empty:i,loading:s,loadingNode:l,footer:d,overlay:c,scrollable:g,wrapItems:f,measuredGrid:b,itemsStyle:x,itemStyle:typeof y=="function"?({item:M,index:I=0,itemId:A="",selected:N=false})=>y({item:M,index:I,itemId:A,selected:N,activeViewId:t,layout:o}):y,getItemId:M=>M.id,getItemClassName:k?({item:M,index:I=0,itemId:A="",selected:N=false})=>k({item:M,index:I,itemId:A,selected:N,activeViewId:t,layout:o}):void 0,renderItem:({item:M,index:I})=>(()=>{let A={item:M,index:I??0,itemId:M.id,selected:n?.includes(M.id)??false,activeViewId:t,layout:o};return T?T(M,A.index,A):NM(A,C,{cardProps:w,listItemProps:v,appearance:r,renderMedia:h,renderActions:S})})(),onOpenItem:C,onSelectionChange:R})}a(_y,"DataExplorerDisplayCollectionView");function Lm(e,t){let o=typeof e=="function"?e():e;if(o===null)return null;if(!o||typeof o!="object"||o.nodeType!==1)throw new TypeError(`${t} must resolve to an Element or null.`);return o}a(Lm,"resolveContainerValue");function Wm({explicitProvided:e,explicitContainer:t,providerProvided:o,providerContainer:r,getDocument:n}){if(e)return Lm(t,"BasePortal container");if(o)return Lm(r,"MonkeysProvider portal.container");if(!n)return null;let i=n();if(i===null)return null;if(!i||typeof i!="object"||!("body"in i))throw new TypeError("MonkeysProvider environment.getDocument must resolve to a Document or null.");return Lm(i.body,"MonkeysProvider environment.getDocument().body")}a(Wm,"resolveBasePortalContainer");function DM(e){let t=ui(),o=pi(),[r,n]=ho.useState(false);if(ho.useEffect(()=>{n(true);},[]),e.disabled!==void 0&&typeof e.disabled!="boolean")throw new TypeError("BasePortal disabled must be a boolean.");if(e.inline!==void 0&&typeof e.inline!="boolean")throw new TypeError("BasePortal inline must be a boolean.");let i=e.disabled??o.disabled??false;if(!r||i||e.inline)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.children});let s=Wm({explicitProvided:e.container!==void 0,explicitContainer:e.container,providerProvided:o.container!==void 0,providerContainer:o.container,getDocument:t.getDocument});return s?reactDom.createPortal(e.children,s):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.children})}a(DM,"BasePortal");function BM({mounted:e,explicitDisabled:t,explicitContainer:o,providerDisabled:r,providerContainer:n,getDocument:i}){let s=t??r??false;if(!e||s)return {mounted:e,disabled:s,shouldPortal:false,container:null,radixPortalProps:void 0};let l=Wm({explicitProvided:o!==void 0,explicitContainer:o,providerProvided:n!==void 0,providerContainer:n,getDocument:i});return l?{mounted:true,disabled:false,shouldPortal:true,container:l,radixPortalProps:Object.freeze({container:l})}:{mounted:true,disabled:false,shouldPortal:false,container:null,radixPortalProps:void 0}}a(BM,"resolveBaseOverlayPortalState");function LM(){return globalThis.document??null}a(LM,"getDefaultDocument");function Cr(e={}){let t=ui(),o=pi(),[r,n]=ho.useState(false);return ho.useEffect(()=>{n(true);},[]),BM({mounted:r,explicitDisabled:e.disabled,explicitContainer:e.container,providerDisabled:o.disabled,providerContainer:o.container,getDocument:t.getDocument??LM})}a(Cr,"useBaseOverlayPortal");function jy(e,t){return t.shouldPortal?reactDom.createPortal(e,t.container):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}a(jy,"renderBaseOverlayPortalContent");function cc(e,t){if(typeof e!="boolean")throw new TypeError(`BaseTooltip ${t} must be a boolean.`)}a(cc,"validateBoolean");function _M(e){if(e!=="top"&&e!=="bottom"&&e!=="left"&&e!=="right")throw new TypeError('BaseTooltip placement must be "top", "bottom", "left", or "right".')}a(_M,"validatePlacement");function GM(e,t){return ho.isValidElement(e)&&e.type!==ho.Fragment?e:jsxRuntime.jsx("span",{tabIndex:!t&&V(e)?0:void 0,children:e})}a(GM,"normalizeTrigger");var To=ho.forwardRef(a(function({content:t,children:o,open:r,defaultOpen:n=false,placement:i="top",disabled:s=false,portal:l=false,appearance:d,className:c,classNames:p,style:u,onOpenChange:g,...f},b){r!==void 0&&cc(r,"open"),cc(n,"defaultOpen"),cc(s,"disabled"),cc(l,"portal"),_M(i);let x=Pe(d),y=ke(),k=Ne(x),w=Cr({disabled:!l}),[v,h]=ho.useState(n),S=r!==void 0,T=!s&&V(t),R=T&&(S?r:v),M=l&&w.shouldPortal?"portaled":"inline",I=a(D=>{D&&!T||(S||h(D),g?.(D));},"handleOpenChange"),A=GM(o,s),N=T?jsxRuntime.jsx(fr__namespace.Content,{...y,side:i,sideOffset:8,collisionPadding:8,"data-monkeys-component":"tooltip","data-slot":"content","data-placement":i,"data-portal":M,"data-disabled":s||void 0,className:m(k.slots.tooltipContent,p?.content),style:k.styles.tooltip,children:t}):null;return jsxRuntime.jsx("span",{...y,...f,ref:b,"data-monkeys-component":"tooltip","data-slot":"root","data-state":R?"open":"closed","data-placement":i,"data-portal":M,"data-disabled":s||void 0,className:m(k.slots.tooltipRoot,p?.root,c),style:u,children:jsxRuntime.jsx(fr__namespace.Provider,{delayDuration:0,skipDelayDuration:0,disableHoverableContent:true,children:jsxRuntime.jsxs(fr__namespace.Root,{open:R,onOpenChange:I,delayDuration:0,disableHoverableContent:true,children:[jsxRuntime.jsx("span",{...y,"data-monkeys-component":"tooltip","data-slot":"trigger-wrapper","data-state":R?"open":"closed","data-placement":i,"data-portal":M,"data-disabled":s||void 0,className:m(k.slots.tooltipTrigger,p?.trigger),children:jsxRuntime.jsx(fr__namespace.Trigger,{asChild:true,...y,"data-monkeys-component":"tooltip","data-slot":"trigger","data-placement":i,"data-portal":M,"data-disabled":s||void 0,children:A})}),l&&w.shouldPortal?jsxRuntime.jsx(fr__namespace.Portal,{...w.radixPortalProps,children:N}):N]})})})},"BaseTooltip"));var Ky=1.18,qy=16,Yy=1e6,Om=1e-6,Xy={topLeft:"left-4 top-4",top:"left-1/2 top-4 -translate-x-1/2",topRight:"right-4 top-4",left:"left-4 top-1/2 -translate-y-1/2",right:"right-4 top-1/2 -translate-y-1/2",bottomLeft:"bottom-4 left-4",bottom:"bottom-4 left-1/2 -translate-x-1/2",bottomRight:"bottom-4 right-4"},Ls=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp"),pc=a(e=>e instanceof Element&&!!e.closest('[data-no-drag="true"],button,a,input,textarea,select,[contenteditable="true"],[role="button"]'),"isNoDragTarget");function qM(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),jsxRuntime.jsx("path",{d:"M3 4v6h6"})]})}a(qM,"ResetIcon");function YM(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 5v14"}),jsxRuntime.jsx("path",{d:"M5 12h14"})]})}a(YM,"PlusIcon");function XM(){return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M5 12h14"})})}a(XM,"MinusIcon");var Qy=ho.forwardRef(a(function({src:t,rotation:o=0,flipX:r=false,flipY:n=false,alt:i="Preview image",empty:s="No image preview",actions:l,actionContext:d,toolbarActions:c,zoomStep:p=Ky,stagePadding:u=qy,minScale:g=Om,maxScale:f=Yy,wheelZoom:b="plain",doubleClickAction:x="reset",panEnabled:y=true,keyboardEnabled:k=true,slots:w,overlay:v,imageOverlay:h,controlsPosition:S="bottomRight",renderControls:T,onScaleChange:C,controlsVisible:R=true,zoomLabelVisible:M=false,resetLabel:I="Reset image view",zoomInLabel:A="Zoom in",zoomOutLabel:N="Zoom out",originalSizeLabel:D="Original size",appearance:E,className:P,classNames:W,onLoad:H,onError:B},L){let F=Ct(E??{background:"dark-stage"}),_=typeof t=="string"?t.trim():"",$=ho.useRef(null),G=ho.useRef(null),z=ho.useRef({scale:1,translateX:u,translateY:u}),re=ho.useRef(void 0),[Z,ae]=ho.useState(null),[ee,q]=ho.useState(false),U=ho.useRef("page"),[{scale:X,translateX:O,translateY:K},ne]=ho.useState(()=>({scale:1,translateX:u,translateY:u}));ho.useLayoutEffect(()=>{z.current={scale:X,translateX:O,translateY:K};},[X,O,K]),ho.useLayoutEffect(()=>{ae(null),U.current="page";let le=re.current?.pointerId;le!==void 0&&$.current?.hasPointerCapture(le)&&$.current.releasePointerCapture(le),re.current=void 0,q(false),ne({scale:1,translateX:0,translateY:0});},[_]);let fe=ho.useRef(C);fe.current=C,ho.useEffect(()=>{Z&&fe.current?.(X);},[X,Z]);let he=Number.isFinite(g)?Math.max(Om,g):Om,me=Number.isFinite(f)?Math.max(he,f):Yy,ie=Number.isFinite(p)&&p>1?p:Ky,be=Number.isFinite(u)&&u>=0?u:qy,He=Number.isFinite(o)?o%360:0,We=ho.useCallback(le=>{let Me=He*Math.PI/180,Ae=Math.abs(Math.cos(Me)),J=Math.abs(Math.sin(Me));return {width:Math.round((le.width*Ae+le.height*J)*1e6)/1e6,height:Math.round((le.width*J+le.height*Ae)*1e6)/1e6}},[He]),Ke=Z?We(Z):null,ce=ho.useCallback((le,Me="page")=>{U.current=Me;let Ae=$.current,J=le??Z;if(!Ae||!J)return;let $e=We(J),ue=Math.max(0,Ae.clientWidth-be*2),Re=Math.max(0,Ae.clientHeight-be*2);if(ue<=0||Re<=0||$e.width<=0||$e.height<=0)return;let se=Me==="width"?ue/$e.width:Math.min(ue/$e.width,Re/$e.height),te=Ls(se,he,me),Te=$e.width*te,ze=$e.height*te;ne({scale:te,translateX:(Ae.clientWidth-Te)/2,translateY:(Ae.clientHeight-ze)/2});},[Z,me,he,be,We]),Q=ho.useCallback((le,Me)=>{if(!Number.isFinite(le)||!Number.isFinite(Me)||le<=0||Me<=0)return;let Ae=G.current;if(G.current={width:le,height:Me},!Ae||!_)return;if(U.current&&Z){ce(Z,U.current);return}let J=(le-Ae.width)/2,$e=(Me-Ae.height)/2;J===0&&$e===0||ne(ue=>({scale:ue.scale,translateX:ue.translateX+J,translateY:ue.translateY+$e}));},[_,Z,ce]);ho.useLayoutEffect(()=>{let le=$.current;if(!le)return;if(Q(le.clientWidth,le.clientHeight),typeof ResizeObserver<"u"){let Ae=new ResizeObserver(J=>{let $e=J[0];$e&&Q($e.contentRect.width,$e.contentRect.height);});return Ae.observe(le),()=>Ae.disconnect()}let Me=a(()=>{Q(le.clientWidth,le.clientHeight);},"handleResize");return window.addEventListener("resize",Me),()=>window.removeEventListener("resize",Me)},[Q]);let ge=ho.useCallback((le,Me,Ae)=>{!Number.isFinite(le)||le===1||!Number.isFinite(Me)||!Number.isFinite(Ae)||(U.current=null,ne(J=>{let $e=Ls(J.scale*le,he,me);if(!Number.isFinite($e)||$e===J.scale)return J;let ue=$e/J.scale;return {scale:$e,translateX:Me-(Me-J.translateX)*ue,translateY:Ae-(Ae-J.translateY)*ue}}));},[me,he]);ho.useEffect(()=>{let le=$.current;if(!le||!_||!Z)return;let Me=a(Ae=>{if(pc(Ae.target)||b==="disabled"||b==="modifier"&&!(Ae.ctrlKey||Ae.metaKey)||b==="plain"&&(Ae.ctrlKey||Ae.metaKey))return;Ae.preventDefault();let J=le.getBoundingClientRect(),$e=Ae.clientX-J.left,ue=Ae.clientY-J.top,Re=Ae.deltaY*(Ae.deltaMode===1?16:Ae.deltaMode===2?le.clientHeight:1),se=Math.pow(ie,-Ls(Re,-1e3,1e3)/100);ge(se,$e,ue);},"handleWheel");return le.addEventListener("wheel",Me,{passive:false}),()=>le.removeEventListener("wheel",Me)},[_,Z,ie,ge,b]),ho.useLayoutEffect(()=>{let le=$.current;if(!le||!Z)return;let Me=z.current.scale,Ae=Ls(Me,he,me);Ae!==Me&&ge(Ae/Me,le.clientWidth/2,le.clientHeight/2);},[Z,he,me,ge]);let we=ho.useCallback(le=>{if(le.button!==0||!y||!_||!Z||pc(le.target))return;let Me=$.current;Me&&(le.preventDefault(),Me.setPointerCapture(le.pointerId),Me.focus({preventScroll:true}),U.current=null,re.current={pointerId:le.pointerId,startClientX:le.clientX,startClientY:le.clientY,startTranslateX:z.current.translateX,startTranslateY:z.current.translateY},q(true));},[_,Z,y]),Ie=ho.useCallback(le=>{let Me=re.current;!Me||Me.pointerId!==le.pointerId||(le.preventDefault(),ne({scale:z.current.scale,translateX:Me.startTranslateX+le.clientX-Me.startClientX,translateY:Me.startTranslateY+le.clientY-Me.startClientY}));},[]),oe=ho.useCallback(le=>{let Me=re.current;if(!Me||Me.pointerId!==le.pointerId)return;re.current=void 0,q(false);let Ae=$.current;Ae?.hasPointerCapture(le.pointerId)&&Ae.releasePointerCapture(le.pointerId);},[]),xe=ho.useCallback(()=>{let le=$.current;if(!le||!Z)return;U.current=null;let Me=We(Z),Ae=Ls(1,he,me);ne({scale:Ae,translateX:(le.clientWidth-Me.width*Ae)/2,translateY:(le.clientHeight-Me.height*Ae)/2});},[Z,he,me,We]),Ve=ho.useCallback(le=>{!_||!Z||pc(le.target)||(x==="reset"&&ce(),x==="original-size"&&xe());},[_,Z,ce,xe,x]),_e=ho.useCallback(le=>{let Me=$.current;!Me||!Z||ge(le,Me.clientWidth/2,Me.clientHeight/2);},[Z,ge]),Ge={scale:X,ready:!!(_&&Z),canZoomIn:!!(Z&&X<me),canZoomOut:!!(Z&&X>he),zoomIn:a(()=>_e(ie),"zoomIn"),zoomOut:a(()=>_e(1/ie),"zoomOut"),reset:a(()=>ce(),"reset"),fitWidth:a(()=>ce(void 0,"width"),"fitWidth"),originalSize:xe};return ho.useImperativeHandle(L,()=>Ge),jsxRuntime.jsxs("div",{ref:$,"data-image-preview":true,tabIndex:k?0:void 0,onKeyDown:le=>{if(!k||!Ge.ready||pc(le.target))return;let Me=le.key==="+"||le.key==="="?Ge.zoomIn:le.key==="-"?Ge.zoomOut:le.key==="0"?Ge.reset:le.key==="1"?Ge.originalSize:void 0;Me&&(le.preventDefault(),le.stopPropagation(),Me());},className:tailwindMerge.twMerge(F.slots.previewRoot,_&&Z&&y?ee?"cursor-grabbing":"cursor-grab":"cursor-default",W?.root,P),onPointerDown:we,onPointerMove:Ie,onPointerUp:oe,onPointerCancel:oe,onLostPointerCapture:oe,onDoubleClick:Ve,style:{touchAction:y?"none":void 0,...F.styles.previewRoot},children:[_?jsxRuntime.jsx("div",{"data-image-transform":true,className:tailwindMerge.twMerge("absolute left-0 top-0 will-change-transform",W?.imageLayer),style:{visibility:Z?"visible":"hidden",width:Ke?.width,height:Ke?.height,transform:`translate(${O}px, ${K}px) scale(${X})`,transformOrigin:"0 0"},children:jsxRuntime.jsxs("div",{"data-image-orientation":true,className:"absolute left-1/2 top-1/2",style:{width:Z?.width,height:Z?.height,transform:`translate(-50%, -50%) rotate(${He}deg) scaleX(${r?-1:1}) scaleY(${n?-1:1})`},children:[jsxRuntime.jsx("img",{src:_,style:qn(_),alt:i,draggable:false,className:tailwindMerge.twMerge("pointer-events-none max-h-none max-w-none select-none",W?.image),onLoad:le=>{let Me=le.currentTarget.naturalWidth,Ae=le.currentTarget.naturalHeight;if(!Me||!Ae)return;let J={width:Me,height:Ae};ae(J),ce(J),H?.(J);},onError:le=>{ae(null),B?.(le);}},_),h?jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0","data-image-coordinate-overlay":true,children:h}):null]})}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(F.slots.previewPlaceholder,W?.placeholder),children:s}),v?jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0","data-no-drag":"true",children:v}):null,Object.keys(Xy).map(le=>{let Me=le==="topRight"&&(c?.length||l),Ae=le===S&&R;return !w?.[le]&&!Me&&!Ae?null:jsxRuntime.jsxs("div",{"data-image-slot":le,"data-no-drag":"true",className:tailwindMerge.twMerge("absolute z-20 flex max-h-full max-w-full flex-col gap-2",Xy[le]),children:[w?.[le],Me?jsxRuntime.jsxs("div",{"data-no-drag":"true",className:tailwindMerge.twMerge(F.slots.previewActions,"static",W?.actions),children:[c?.length?jsxRuntime.jsx(cn,{context:d,actions:c,layout:"inline",appearance:E??{background:"dark-stage"}}):null,l]}):null,Ae?T?T(Ge):jsxRuntime.jsxs("div",{"data-no-drag":"true",className:tailwindMerge.twMerge(F.slots.previewControls,"static",W?.controls),children:[M?jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge(F.slots.previewZoomLabel,W?.zoomLabel),children:[Math.round(X*100),"%"]}):null,jsxRuntime.jsx(To,{content:N,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":N,disabled:!Ge.canZoomOut,className:tailwindMerge.twMerge(F.slots.previewControlButton,"disabled:cursor-not-allowed disabled:opacity-40",W?.controlButton),onClick:()=>_e(1/ie),children:jsxRuntime.jsx(XM,{})})}),jsxRuntime.jsx(To,{content:A,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":A,disabled:!Ge.canZoomIn,className:tailwindMerge.twMerge(F.slots.previewControlButton,"disabled:cursor-not-allowed disabled:opacity-40",W?.controlButton),onClick:()=>_e(ie),children:jsxRuntime.jsx(YM,{})})}),jsxRuntime.jsx(To,{content:I,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":I,disabled:!_||!Z,className:tailwindMerge.twMerge(F.slots.previewControlButton,"disabled:cursor-not-allowed disabled:opacity-40",W?.controlButton),onClick:()=>ce(),children:jsxRuntime.jsx(qM,{})})}),jsxRuntime.jsx(To,{content:D,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":D,disabled:!Ge.ready,className:tailwindMerge.twMerge(F.slots.previewControlButton,W?.controlButton),onClick:xe,children:jsxRuntime.jsx(lucideReact.Scan,{className:"h-4 w-4","aria-hidden":"true"})})})]}):null]},le)})]})},"DataExplorerImagePreview"));function fn(e,t){if(typeof e!="string")return;let o=e.trim();if(!o||/[\u0000-\u001f\u007f\\]/.test(o)||/^https?:/i.test(o)&&!/^https?:\/\//i.test(o))return;let r;try{r=new URL(o,"https://monkeys.invalid/");}catch{return}if(!(r.username||r.password)){if(r.protocol==="http:"||r.protocol==="https:"||t==="link"&&(r.protocol==="mailto:"||r.protocol==="tel:"))return o;if(r.protocol==="blob:"){if(r.pathname.startsWith("null/"))return o;try{let n=new URL(r.pathname);if(["https:","http:"].includes(n.protocol)&&!n.username&&!n.password)return o}catch{}}}}a(fn,"safeDisplayUrl");function Zy(e){if(typeof e!="string"||!e.trim())return;let t=e.split(",");for(let o of t){let r=o.trim().split(/\s+/);if(!fn(r[0],"media")||r.length>2||r.length===2&&!/^(?:[1-9]\d*w|(?:\d+(?:\.\d+)?|\.\d+)x)$/.test(r[1]))return}return e}a(Zy,"safeDisplaySrcSet");function Jy({kind:e}){return jsxRuntime.jsx(e==="image"?lucideReact.Image:e==="video"?lucideReact.Video:e==="audio"?lucideReact.Music2:lucideReact.FileText,{className:"h-6 w-6","aria-hidden":"true"})}a(Jy,"PreviewIcon");function tx({src:e,kind:t="image",alt:o="Preview",title:r,aspectRatio:n="auto",fit:i="contain",controls:s=true,loading:l=false,empty:d="No preview available",error:c="Preview is unavailable right now.",className:p,style:u,classNames:g,mediaAttributes:f,onLoad:b,onError:x}){let[y,k]=ho.useState(false),w=fn(e,"media")??"",v=Object.fromEntries(Object.entries(f??{}).flatMap(([C,R])=>{let M=C.toLowerCase();return M==="src"||M==="srcdoc"||M==="dangerouslysetinnerhtml"?[]:M==="srcset"?[["srcSet",Zy(R)]]:M==="poster"?[["poster",fn(R,"media")]]:[[C,R]]}));ho.useEffect(()=>{k(false);},[w,t]);let h=a((C,R)=>jsxRuntime.jsx("div",{className:j("flex min-h-24 flex-col items-center justify-center gap-2 bg-muted/30 p-4 text-center text-sm text-muted-foreground",g?.placeholder,R),role:l?"status":"img","aria-label":typeof C=="string"?C:void 0,children:C}),"renderPlaceholder");if(l)return jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",g?.root,p),style:u,"aria-busy":"true",children:jsxRuntime.jsxs("div",{className:j("flex min-h-24 flex-col items-center justify-center gap-2 bg-muted/30 p-4 text-sm text-muted-foreground",g?.loading),children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-5 w-5 animate-spin","aria-hidden":"true"}),r||"Loading preview..."]})});if(!w||y)return jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",g?.root,p),style:u,children:h(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Jy,{kind:t}),jsxRuntime.jsx("span",{className:j("max-w-full truncate",y?g?.error:void 0),children:y?c:d}),r?jsxRuntime.jsx("span",{className:"max-w-full truncate text-xs",children:r}):null]}))});let S=a(()=>{k(true),x?.();},"handleError"),T=t==="image"?jsxRuntime.jsx(Ds,{...v,src:w,alt:o,fit:i,className:g?.media,loading:"lazy",decoding:"async",draggable:false,onLoad:b,onError:S}):t==="video"?jsxRuntime.jsx("video",{...v,src:w,className:j("block h-auto w-full",i==="cover"?"object-cover":"object-contain",g?.media),controls:s,preload:"metadata",onLoadedData:b,onError:S}):t==="audio"?jsxRuntime.jsx("audio",{...v,src:w,className:j("w-full",g?.media),controls:s,preload:"metadata",onCanPlay:b,onError:S}):h(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Jy,{kind:"file"}),jsxRuntime.jsx("span",{className:"max-w-full truncate",children:r||w})]}));return t==="image"?jsxRuntime.jsx(Is,{aspectRatio:n,className:j(g?.root,p),style:u,children:T}):jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",g?.root,p),style:u,children:T})}a(tx,"DataExplorerMediaPreview");function rx({sidebar:e,tree:t,toolbar:o,controls:r,notices:n,content:i,view:s,detail:l,appearance:d,className:c,classNames:p}){let u=Et(d),g=u?Ct(u):void 0,f=t??e,b=r??o,x=s??i;return jsxRuntime.jsx(Ih,{appearance:u,children:jsxRuntime.jsxs("div",{className:j("flex h-full min-h-0 overflow-hidden",g?.slots.surfaceRoot,p?.root,c),style:g?.styles.surfaceRoot,children:[f?jsxRuntime.jsx("div",{className:j("min-h-0 shrink-0 overflow-hidden",p?.sidebar,p?.tree),children:f}):null,jsxRuntime.jsxs("div",{className:j("relative flex min-h-0 flex-1 flex-col overflow-hidden",p?.main),children:[b?jsxRuntime.jsx("div",{className:j("shrink-0",p?.toolbar,p?.controls),children:b}):null,n?jsxRuntime.jsx("div",{className:j("shrink-0",p?.notices),children:n}):null,jsxRuntime.jsx("div",{className:j("flex min-h-0 flex-1 flex-col overflow-hidden",p?.content,p?.view),children:x}),l?jsxRuntime.jsx("div",{className:j(p?.detail),children:l}):null]})]})})}a(rx,"DataExplorerPage");function n2({item:e,selected:t,label:o,className:r,onToggleSelection:n}){return n?jsxRuntime.jsx("input",{type:"checkbox",checked:t,"aria-label":o,className:j("h-4 w-4 shrink-0 accent-primary",r),onChange:()=>n(e),onClick:i=>i.stopPropagation()}):null}a(n2,"DefaultCheckbox");function a2({item:e,active:t,label:o,className:r,onToggleFavorite:n}){return n?jsxRuntime.jsxs("button",{type:"button","aria-pressed":t,title:o,className:j("inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",t&&"text-[hsl(var(--warning,45_93%_47%))]",r),onClick:i=>{i.stopPropagation(),n(e);},children:[jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:t?"currentColor":"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.8-6.2-3.3L5.8 21 7 14.2 2 9.3l6.9-1L12 2Z"})}),jsxRuntime.jsx("span",{className:"sr-only",children:o})]}):null}a(a2,"DefaultFavorite");function i2({item:e,limit:t,classNames:o}){let r=e.keywords??[];if(r.length===0)return null;let n=r.slice(0,t),i=Math.max(0,r.length-n.length);return jsxRuntime.jsxs("div",{className:j("mt-2 flex flex-wrap gap-2",o?.keywords),children:[n.map((s,l)=>jsxRuntime.jsx("span",{className:j("max-w-full truncate rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",o?.keyword),title:typeof s=="string"?s:void 0,children:s},l)),i>0?jsxRuntime.jsxs("span",{className:j("rounded-full border border-border px-2 py-0.5 text-xs text-muted-foreground",o?.keywordOverflow),children:["+",i]}):null]})}a(i2,"renderKeywords");function nx({item:e,selected:t=e.selected??false,active:o,disabled:r=e.disabled,hasMedia:n,showHeaderWithMedia:i=false,selectionVisible:s,favoriteVisible:l,overlayControlsAlwaysVisible:d,favoriteActive:c=false,favoriteLabel:p="Favorite",favoriteActiveLabel:u="Unfavorite",selectLabel:g="Select item",unselectLabel:f="Unselect item",actions:b,media:x,footer:y,checkbox:k,favorite:w,keywordLimit:v=3,appearance:h,className:S,classNames:T,onClick:C,onToggleSelection:R,onToggleFavorite:M}){let I=Ct(Et(h)),A=n??!!(x??e.media),N=!A||i,D=s??!!(t||R),E=l??!!(w||M),P=c?u:p,H=k??(D?jsxRuntime.jsx(n2,{item:e,selected:t,label:t?f:g,className:T?.selectionControl,onToggleSelection:R}):null),B=w??(E?jsxRuntime.jsx(a2,{item:e,active:c,label:P,className:T?.favoriteControl,onToggleFavorite:M}):null),L=x??(e.media?jsxRuntime.jsx(Ci,{media:e.media,fallbackTitle:e.title}):void 0),F=N?jsxRuntime.jsxs("div",{className:j("flex flex-col",T?.header),children:[jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-center justify-between gap-2",T?.headerMain),children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[H,jsxRuntime.jsx("div",{className:"min-w-0 flex-1",children:e.title?jsxRuntime.jsx("h3",{className:j("truncate text-sm font-semibold leading-none",T?.title),children:e.title}):null})]}),B||b?jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[B,b]}):null]}),i2({item:e,limit:v,classNames:T})]}):null,_=A&&(H||B||b)?jsxRuntime.jsx("div",{className:j("absolute inset-x-2 top-2 z-10",T?.overlay),children:jsxRuntime.jsxs("div",{className:j("flex items-start justify-between gap-1 transition-opacity",t||d?"opacity-100":"opacity-0 group-hover:opacity-100",T?.overlayControls),children:[H??jsxRuntime.jsx("span",{}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[B,b?jsxRuntime.jsx("div",{className:j(T?.floatingActions),children:b}):null]})]})}):null;return jsxRuntime.jsx(Jn,{item:e,selected:t,disabled:r,appearance:h,className:j(I.slots.recordCardRoot,o&&I.slots.recordCardActive,T?.root,S),classNames:{overlay:T?.overlay,header:j(A?"p-3":"p-3 pb-2",T?.header),media:j("p-0 bg-muted/30",T?.media),footer:T?.footer},header:F,overlay:_,media:L?jsxRuntime.jsx("div",{className:j("relative overflow-hidden",T?.mediaFrame),children:L}):void 0,footer:y,children:null,onClick:C})}a(nx,"DataExplorerRecordCard");var p2=a((e,t)=>{let o=t?Array.isArray(e)?e:e?[e]:[]:typeof e=="string"?[e]:[];return Array.from(new Set(o.filter(r=>typeof r=="string"&&r.length>0)))},"normalizeValues"),Hm=a(e=>e.textValue??(typeof e.label=="string"?e.label:e.value),"getOptionText");function lx({value:e,activeValue:t,options:o=[],createOption:r,multiple:n=false,placeholder:i="Select a record",triggerLabel:s,triggerIcon:l,searchPlaceholder:d="Search records",emptyState:c="No records found",loadingState:p,loadingMoreState:u,errorState:g,loading:f=false,loadingMore:b=false,disabled:x=false,open:y,defaultOpen:k=false,searchValue:w,defaultSearchValue:v="",appearance:h,className:S,classNames:T,triggerProps:C,dataAttributes:R,onOpenChange:M,onListScroll:I,onSearchValueChange:A,onValueChange:N}){let D=Ct(Et(h)),[E,P]=ho.useState(k),[W,H]=ho.useState(v),B=y!==void 0,L=B?y:E,F=w!==void 0,_=F?w:W,$=ho.useMemo(()=>p2(e,n),[n,e]),G=ho.useMemo(()=>new Set($),[$]),z=$.map(X=>o.find(O=>O.value===X)).filter(X=>!!X),re=r?[r,...o]:o,Z=z.length?n&&z.length>1?`${z.slice(0,2).map(X=>Hm(X)).join(", ")} +${z.length-2}`:Hm(z[0]):i;ho.useEffect(()=>{if(!L)return;let X=a(O=>{O.key==="Escape"&&M?.(false);},"handleKeyDown");return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[L,M]);let ae=a(X=>{x||(B||P(X),M?.(X));},"setOpen"),ee=a(X=>{F||H(X),A?.(X);},"setQuery"),q=a(X=>{if(!(x||X.disabled)){if(n){let O=G.has(X.value)?$.filter(K=>K!==X.value):[...$,X.value];N?.(O);return}N?.(X.value),ae(false);}},"handleOptionClick"),U=a(X=>{x||N?.($.filter(O=>O!==X));},"removeValue");return jsxRuntime.jsxs("div",{...R?.root,className:j("relative min-w-0 w-full",T?.root,S),children:[jsxRuntime.jsxs(_n__namespace.Root,{open:L,onOpenChange:ae,children:[jsxRuntime.jsx(_n__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{...C,...R?.trigger,type:"button",disabled:x,"aria-label":s,"aria-expanded":L,className:j(D.slots.controlSelectTrigger,T?.trigger),children:[l,jsxRuntime.jsx("span",{...R?.triggerValue,className:j(D.slots.controlSelectValue,!z.length&&"text-muted-foreground",T?.triggerValue),children:Z}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 shrink-0","aria-hidden":"true"})]})}),jsxRuntime.jsx(_n__namespace.Portal,{children:jsxRuntime.jsxs(_n__namespace.Content,{...R?.content,align:"start",sideOffset:6,className:j("z-50 w-[min(30rem,calc(100vw-2rem))] rounded-md border border-border bg-popover p-2 text-popover-foreground shadow-md",T?.content),onOpenAutoFocus:X=>X.preventDefault(),children:[jsxRuntime.jsxs("label",{className:j("flex h-9 items-center gap-2 rounded-md border border-border bg-background px-2 text-sm",T?.search),children:[jsxRuntime.jsx(lucideReact.Search,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("input",{autoFocus:true,value:_,onChange:X=>ee(X.target.value),placeholder:d,"aria-label":d,className:"min-w-0 flex-1 bg-transparent outline-hidden placeholder:text-muted-foreground"})]}),jsxRuntime.jsx("div",{className:j("mt-2 max-h-72 overflow-y-auto",T?.list),...R?.list,role:"listbox","aria-multiselectable":n||void 0,onScroll:I,children:f?jsxRuntime.jsxs("div",{...R?.loading,className:j("flex min-h-16 items-center justify-center gap-2 px-3 py-4 text-sm text-muted-foreground",T?.status),children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),p??"Loading records..."]}):g?jsxRuntime.jsx("div",{...R?.error,className:j("px-3 py-4 text-sm text-destructive-text",T?.status),children:g}):re.length===0?jsxRuntime.jsx("div",{...R?.empty,className:j("px-3 py-4 text-sm text-muted-foreground",T?.status),children:c}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[re.map(X=>{let O=G.has(X.value);return jsxRuntime.jsxs("button",{...R?.option,type:"button",role:"option","aria-selected":O,"aria-current":t!==void 0&&X.value===t?"true":void 0,disabled:X.disabled,onClick:()=>q(X),className:j("flex w-full items-start gap-2 rounded-sm px-2.5 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50",O&&"bg-accent/60",T?.option),children:[jsxRuntime.jsx("span",{className:j("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center",T?.optionIndicator),children:O?jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4","aria-hidden":"true"}):null}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:j("block truncate",T?.optionLabel),children:X.label}),X.description?jsxRuntime.jsx("span",{className:j("mt-0.5 block truncate text-xs text-muted-foreground",T?.optionDescription),children:X.description}):null]})]},X.value)}),b?jsxRuntime.jsxs("div",{...R?.loadingMore,className:j("flex items-center justify-center gap-2 px-3 py-2 text-xs text-muted-foreground",T?.status),children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}),u??"Loading more records..."]}):null]})})]})})]}),n&&z.length>0?jsxRuntime.jsx("div",{className:j("mt-2 flex flex-wrap gap-1.5",T?.selectedList),children:z.map(X=>jsxRuntime.jsxs("span",{className:j("inline-flex max-w-full items-center gap-1 rounded-full border border-border bg-muted px-2 py-1 text-xs",T?.selectedItem),children:[jsxRuntime.jsx("span",{className:j("min-w-0 truncate",T?.selectedItemLabel),children:X.label}),jsxRuntime.jsx("button",{type:"button","aria-label":`Remove ${Hm(X)}`,onClick:()=>U(X.value),className:j("inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",T?.selectedItemRemove),children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3","aria-hidden":"true"})})]},X.value))}):null]})}a(lx,"DataExplorerRecordPicker");function h2({items:e,value:t,defaultValue:o,allowCollapse:r,keyboardNavigation:n}){if(!Array.isArray(e))throw new TypeError("BaseAccordion items must be an array.");if(t!==void 0&&(typeof t!="string"||!t.trim()))throw new TypeError("BaseAccordion value must be a non-empty string when provided.");if(o!==void 0&&(typeof o!="string"||!o.trim()))throw new TypeError("BaseAccordion defaultValue must be a non-empty string when provided.");if(typeof r!="boolean")throw new TypeError("BaseAccordion allowCollapse must be a boolean.");if(typeof n!="boolean")throw new TypeError("BaseAccordion keyboardNavigation must be a boolean.");let i=new Set;e.forEach((s,l)=>{if(!s||typeof s!="object")throw new TypeError(`BaseAccordion item at index ${l} must be an object.`);if(typeof s.value!="string"||!s.value.trim())throw new TypeError(`BaseAccordion item value at index ${l} must be a non-empty string.`);if(i.has(s.value))throw new TypeError(`BaseAccordion items must use unique values; duplicate value ${JSON.stringify(s.value)} at index ${l}.`);if(s.disabled!==void 0&&typeof s.disabled!="boolean")throw new TypeError(`BaseAccordion item disabled at index ${l} must be a boolean.`);i.add(s.value);});}a(h2,"validateBaseAccordionProps");function y2(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(y2,"toDomId");function x2(e){let t=new Set;return e.map((o,r)=>{let n=y2(o.value)||`item-${r}`,i=n;if(t.has(i))for(i=`${n}-${r}`;t.has(i);)i=`${i}-${r}`;return t.add(i),i})}a(x2,"getDomIdFragments");var ux=ho.forwardRef(a(function({items:t=[],value:o,defaultValue:r,allowCollapse:n=true,keyboardNavigation:i=true,appearance:s,className:l,classNames:d,style:c,onValueChange:p,id:u,onFocusCapture:g,onBlurCapture:f,...b},x){h2({items:t,value:o,defaultValue:r,allowCollapse:n,keyboardNavigation:i});let y=Pe(s),k=ke(),w=Ne(y),v=ho.useId(),h=u??v,[S,T]=ho.useState(r),[C,R]=ho.useState(),M=ho.useRef(new Map),I=ho.useRef(false),A=o!==void 0,N=A?o:S,D=x2(t),E=t.filter(G=>!G.disabled),P=t.find(G=>G.value===N),W=typeof b.dir=="string"?b.dir:k.dir;ho.useEffect(()=>{if(!I.current||C===void 0)return;let G=t.find(re=>re.value===C);if(G&&!G.disabled)return;let z=E.find(re=>re.value===N)??E[0];if(!z){I.current=false;return}R(z.value),M.current.get(z.value)?.focus();},[E,C,t,N]);let H=a(G=>{if(G.disabled)return;let z=N===G.value;if(z&&!n){p?.(G.value);return}let re=z?void 0:G.value;A||T(re),p?.(re);},"handleToggle"),B=a((G,z,re)=>{if(!i||E.length===0)return;let Z;if(re==="first")Z=E[0];else if(re==="last")Z=E[E.length-1];else {let ee=(E.findIndex(q=>q.value===z.value)+re+E.length)%E.length;Z=E[ee];}Z&&(G.preventDefault(),R(Z.value),M.current.get(Z.value)?.focus());},"moveFocus"),L=a((G,z)=>{z.disabled||(G.key==="ArrowDown"?B(G,z,1):G.key==="ArrowUp"?B(G,z,-1):G.key==="Home"?B(G,z,"first"):G.key==="End"&&B(G,z,"last"));},"handleKeyDown"),F=a(G=>G instanceof HTMLElement&&G.dataset.accordionOwner===h,"isOwnedTrigger"),_=a(G=>{F(G.target)&&(I.current=true),g?.(G);},"handleFocusCapture"),$=a(G=>{F(G.target)&&!F(G.relatedTarget)&&(I.current=false),f?.(G);},"handleBlurCapture");return jsxRuntime.jsx("div",{...k,...b,ref:x,id:u,dir:W,"data-monkeys-component":"accordion","data-slot":"root","data-state":P?"open":"closed","data-collapsible":n,"data-keyboard-navigation":i,className:m(w.slots.accordionRoot,d?.root,l),style:{...w.styles.accordion,...c},onFocusCapture:_,onBlurCapture:$,children:t.map((G,z)=>{let re=D[z],Z=`${h}-${re}-trigger`,ae=`${h}-${re}-panel`,ee=G.value===N,q=ee?"open":"closed";return ho.createElement("div",{...k,key:G.value,dir:W,"data-monkeys-component":"accordion","data-slot":"item","data-state":q,"data-disabled":G.disabled||void 0,className:m(w.slots.accordionItem,d?.item)},jsxRuntime.jsxs("button",{...k,ref:U=>{U?M.current.set(G.value,U):M.current.delete(G.value);},id:Z,type:"button","aria-expanded":ee,"aria-controls":ae,"aria-disabled":G.disabled||void 0,disabled:G.disabled,dir:W,"data-accordion-owner":h,"data-monkeys-component":"accordion","data-slot":"trigger","data-state":q,"data-disabled":G.disabled||void 0,className:m(w.slots.accordionTrigger,d?.trigger),onFocus:()=>R(G.value),onKeyDown:U=>L(U,G),onClick:()=>H(G),children:[jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:G.title}),jsxRuntime.jsx("span",{"aria-hidden":"true","data-monkeys-component":"accordion","data-slot":"trigger-icon","data-state":q,className:m(w.slots.accordionTriggerIcon,ee&&"rotate-[225deg]",d?.triggerIcon)})]}),ee?jsxRuntime.jsx("div",{...k,id:ae,role:"region","aria-labelledby":Z,dir:W,"data-monkeys-component":"accordion","data-slot":"panel","data-state":"open",className:m(w.slots.accordionPanel,d?.panel),children:V(G.content)?G.content:null}):null)})})},"BaseAccordion"));var T2={sm:"h-7 w-7 text-xs",md:"h-9 w-9 text-sm",lg:"h-12 w-12 text-base"},mx={online:"bg-[hsl(var(--success,142_72%_29%))]",busy:"bg-[hsl(var(--warning,45_93%_47%))]",offline:"bg-muted-foreground",neutral:"bg-muted-foreground"};function px(e){return typeof e=="string"&&e in mx}a(px,"isStatusPreset");function N2(e){if(!e)return;let t=e.trim().split(/\s+/).filter(Boolean);if(t.length)return t.slice(0,2).map(o=>o[0]?.toUpperCase()).join("")}a(N2,"getInitials");var bc=ho.forwardRef(a(function({src:t,alt:o,name:r,initials:n,icon:i,status:s,size:l="md",appearance:d,className:c,classNames:p,style:u,children:g,title:f,...b},x){if(l!=="sm"&&l!=="md"&&l!=="lg")throw new TypeError('BaseAvatar size must be "sm", "md", or "lg".');let y=Pe(d),k=ke(),w=Ne(y),[v,h]=ho.useState(),T=!!t&&!!!(t&&v===t),C=N2(r),R=V(g)?"children":V(n)?"initials":V(C)?"name":V(i)?"icon":"default",M=V(g)?g:V(n)?n:V(C)?C:V(i)?i:"?",I=px(s)?s:V(s)?"custom":void 0;return ho.useEffect(()=>{h(void 0);},[t]),jsxRuntime.jsxs("div",{...k,...b,ref:x,title:f??r,"data-monkeys-component":"avatar","data-slot":"root","data-state":T?"image":"fallback","data-size":l,"data-status":I,"data-fallback":T?void 0:R,className:m(w.slots.avatarRoot,T2[l],p?.root,c),style:{...w.styles.avatar,...u},children:[T?jsxRuntime.jsx("img",{src:t,alt:o??r??"","data-slot":"image","data-size":l,"data-status":I,className:m(w.slots.avatarImage,p?.image),onError:()=>h(t)}):jsxRuntime.jsx("span",{"data-slot":"fallback","data-size":l,"data-status":I,"data-fallback":R,className:m(w.slots.avatarFallback,p?.fallback,p?.text),children:M}),px(s)?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"status","data-size":l,"data-status":s,className:m(w.slots.avatarStatus,mx[s],p?.status)}):V(s)?jsxRuntime.jsx("span",{"data-slot":"status","data-size":l,"data-status":"custom",className:m(w.slots.avatarStatus,p?.status),children:s}):null]})},"BaseAvatar"));function I2(e){if(!Number.isFinite(e)||e<=0)throw new RangeError("BaseAspectRatio ratio must be a positive finite number.");return String(e)}a(I2,"resolveAspectRatio");var D2=ho.forwardRef(a(function({children:t,ratio:o=16/9,appearance:r,className:n,classNames:i,style:s,...l},d){let c=Pe(r),p=ke(),u=Ne(c);return jsxRuntime.jsx("div",{...p,...l,ref:d,"data-monkeys-component":"aspect-ratio","data-slot":"root","data-ratio":o,className:m(u.slots.aspectRatioRoot,i?.root,n),style:{...u.styles.aspectRatio,aspectRatio:I2(o),...s},children:t})},"BaseAspectRatio"));var gc=ho.forwardRef(a(function({children:t,label:o,icon:r,tone:n,appearance:i,variant:s,density:l,state:d,className:c,classNames:p,style:u,...g},f){if(n!==void 0&&n!=="default"&&n!=="primary"&&n!=="success"&&n!=="warning"&&n!=="danger"&&n!=="muted")throw new TypeError('BaseBadge tone must be "default", "primary", "success", "warning", "danger", or "muted".');let b=Pe(i),x=ke(),y=Ne({...b,variant:s,density:l,state:d}),k=t??o,w=n??"default";return jsxRuntime.jsxs("span",{...x,...g,ref:f,"data-monkeys-component":"badge","data-slot":"root","data-tone":w,"data-variant":y.variant,"data-density":y.density,"data-state":y.state,className:m(y.slots.badgeBase,Wd(y,n),p?.root,c),style:{...y.styles.badge,...u},children:[r?jsxRuntime.jsx("span",{"data-slot":"icon","data-tone":w,className:m(y.slots.badgeIcon,p?.icon),children:r}):null,k!=null?jsxRuntime.jsx("span",{"data-slot":"label","data-tone":w,className:m(y.slots.badgeLabel,p?.label),children:k}):null]})},"BaseBadge"));function B2(e,t,o){return e.current??t===o-1}a(B2,"isCurrentItem");function bx({items:e=[],separator:t="/",appearance:o,className:r,classNames:n,style:i,onSelect:s,...l}){let d=Ne(o),c=a((p,u,g)=>{if(u.disabled){p.preventDefault();return}s?.(u,g);},"handleClick");return jsxRuntime.jsx("nav",{...l,"aria-label":l["aria-label"]??"Breadcrumb",className:m(d.slots.breadcrumbRoot,n?.root,r),style:{...d.styles.breadcrumb,...i},children:jsxRuntime.jsx("ol",{className:m(d.slots.breadcrumbList,n?.list),children:e.map((p,u)=>{let g=B2(p,u,e.length);return jsxRuntime.jsxs("li",{className:m(d.slots.breadcrumbItem,n?.item),children:[g?jsxRuntime.jsx("span",{"aria-current":"page",className:m(d.slots.breadcrumbCurrent,n?.current),children:p.label}):p.href?jsxRuntime.jsx("a",{href:p.href,"aria-disabled":p.disabled||void 0,className:m(d.slots.breadcrumbLink,n?.link),onClick:f=>c(f,p,u),children:p.label}):jsxRuntime.jsx("button",{type:"button",disabled:p.disabled,className:m(d.slots.breadcrumbLink,"bg-transparent p-0",n?.link),onClick:f=>c(f,p,u),children:p.label}),u<e.length-1?jsxRuntime.jsx("span",{"aria-hidden":"true",className:m(d.slots.breadcrumbSeparator,n?.separator),children:t}):null]},`${u}-${p.value??p.href??String(p.label)}`)})})})}a(bx,"BaseBreadcrumb");var z2={sm:"h-8 px-2.5 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-3.5 text-base"},O2={sm:"h-8 w-8 px-0",md:"h-9 w-9 px-0",lg:"h-10 w-10 px-0"},Vm={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"};function hc(e){return typeof e=="string"&&e.trim()?e:void 0}a(hc,"nonEmptyText");function F2(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-full w-full motion-safe:animate-spin motion-reduce:animate-none",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(F2,"LoadingIcon");var dt=ho.forwardRef(a(function({children:t,label:o,icon:r,endIcon:n,type:i="button",title:s,ariaLabel:l,tone:d,size:c,active:p=false,iconOnly:u=false,disabled:g=false,loading:f=false,stopPropagation:b=false,appearance:x,variant:y,density:k,state:w,className:v,classNames:h,style:S,onClick:T,"aria-label":C,"aria-pressed":R,...M},I){for(let[z,re]of [["active",p],["iconOnly",u],["disabled",g],["loading",f],["stopPropagation",b]])if(typeof re!="boolean")throw new TypeError(`BaseButton ${z} must be a boolean.`);if(c!==void 0&&c!=="sm"&&c!=="md"&&c!=="lg")throw new TypeError('BaseButton size must be "sm", "md", or "lg".');if(d!==void 0&&d!=="default"&&d!=="primary"&&d!=="success"&&d!=="warning"&&d!=="danger"&&d!=="muted")throw new TypeError('BaseButton tone must be "default", "primary", "success", "warning", "danger", or "muted".');let A=Pe(x),N=ke(),D=Ne({...A,variant:y,density:k,state:w}),E=t??o,P=V(E)&&(typeof E!="string"||!!E.trim()),W=hc(l)??hc(C),H=typeof E=="string"?hc(E):void 0,B=hc(s);if(u&&!P&&!W&&!B)throw new TypeError("BaseButton iconOnly requires ariaLabel, aria-label, title, or a renderable label.");let L=W??H??B,F=g||f,_=d??"default",$=w??(f?"loading":g?"disabled":p?"active":"idle"),G=a(z=>{b&&z.stopPropagation(),!F&&T?.(z);},"handleClick");return jsxRuntime.jsxs("button",{...N,...M,ref:I,type:i,title:s,"aria-label":L,"aria-pressed":R??(p||void 0),"aria-busy":f||void 0,"data-variant":D.variant,"data-density":D.density,disabled:F,"data-monkeys-component":"button","data-slot":"root","data-state":$,"data-tone":_,"data-size":c,"data-active":p||void 0,"data-loading":f||void 0,"data-disabled":F||void 0,"data-icon-only":u||void 0,className:m(D.slots.buttonBase,u&&D.slots.buttonIconOnly,c&&z2[c],u&&c&&O2[c],jn(D,d,p),F&&D.slots.buttonDisabled,h?.root,v),style:{...D.styles.button,...p?D.styles.buttonActive:void 0,...F?D.styles.buttonDisabled:void 0,...S},onClick:G,children:[f?jsxRuntime.jsx("span",{"data-slot":"icon","data-state":$,"data-tone":_,"data-size":c,className:m(D.slots.buttonIcon,c&&Vm[c],h?.icon),children:jsxRuntime.jsx(F2,{})}):r?jsxRuntime.jsx("span",{"data-slot":"icon","data-state":$,"data-tone":_,"data-size":c,className:m(D.slots.buttonIcon,c&&Vm[c],h?.icon),children:r}):null,u?V(E)?jsxRuntime.jsx("span",{"data-slot":"label","data-state":$,"data-tone":_,"data-size":c,className:"sr-only",children:E}):null:V(E)?jsxRuntime.jsx("span",{"data-slot":"label","data-state":$,"data-tone":_,"data-size":c,className:m(D.slots.buttonLabel,h?.label),children:E}):null,!f&&n?jsxRuntime.jsx("span",{"data-slot":"end-icon","data-state":$,"data-tone":_,"data-size":c,className:m(D.slots.buttonIcon,c&&Vm[c],h?.icon,h?.endIcon),children:n}):null]})},"BaseButton"));var V2=ho.forwardRef(a(function({children:t,display:o="inline",appearance:r,className:n,classNames:i,style:s,...l},d){let c=Pe(r),p=ke(),u=Ne(c);return o==="block"?jsxRuntime.jsx("pre",{...p,...l,ref:d,"data-monkeys-component":"code","data-slot":"root","data-display":"block",className:m(u.slots.codeBlock,i?.root,n),style:{...u.styles.code,...s},children:jsxRuntime.jsx("code",{"data-slot":"code",className:m(u.slots.codeContent,i?.code),style:u.styles.codeContent,children:t})}):jsxRuntime.jsx("code",{...p,...l,ref:d,"data-monkeys-component":"code","data-slot":"root","data-display":"inline",className:m(u.slots.codeInline,u.slots.codeContent,i?.root,i?.code,n),style:{...u.styles.code,...u.styles.codeContent,...s},children:t})},"BaseCode"));function hx(e,t){let o=Number.isFinite(t?.speed)?Math.max(-1,Math.min(1,t.speed)):0,r=Number.isFinite(t?.maxOffset)?Math.max(0,Math.min(200,t.maxOffset)):16;ho.useEffect(()=>{let n=e.current;if(!n||!o||!r)return;let i=n.ownerDocument.defaultView;if(!i)return;let s=n.parentElement;for(;s&&!/(auto|scroll|overlay)/.test(i.getComputedStyle(s).overflowY);)s=s.parentElement;let l=s,d=l??i,c=i.matchMedia("(prefers-reduced-motion: reduce)"),p=n.style.translate,u,g=false,f=a(()=>{u=void 0;let k=Math.max(-r,Math.min(r,Math.max(0,l?l.scrollTop:i.scrollY)*o));n.style.translate=`0 ${k}px`;},"update"),b=a(()=>{u===void 0&&(u=i.requestAnimationFrame(f));},"schedule"),x=a(()=>{d.removeEventListener("scroll",b),g=false,u!==void 0&&i.cancelAnimationFrame(u),u=void 0,n.style.translate=p;},"stop"),y=a(()=>{c.matches?x():g||(d.addEventListener("scroll",b,{passive:true}),g=true,f());},"syncPreference");return c.addEventListener("change",y),y(),()=>{x(),c.removeEventListener("change",y);}},[e,o,r]);}a(hx,"useScrollMotion");var U2=ho.forwardRef(a(function({children:t,maxWidth:o="80rem",padding:r="1rem",scrollMotion:n,appearance:i,className:s,classNames:l,style:d,...c},p){let u=ho.useRef(null),g=ho.useCallback(w=>{u.current=w,typeof p=="function"?p(w):p&&(p.current=w);},[p]);hx(u,n);let f=Pe(i),b=ke(),x=Ne(f),y=nr("BaseContainer","maxWidth",o),k=nr("BaseContainer","padding",r);return jsxRuntime.jsx("div",{...b,...c,ref:g,"data-monkeys-component":"container","data-slot":"root",className:m(x.slots.containerRoot,l?.root,s),style:{...x.styles.container,maxWidth:y,paddingInline:k,...d},children:t})},"BaseContainer"));var q2=["default","primary","success","warning","danger","muted"];function Lo(e,t){if(typeof e!="boolean")throw new TypeError(`BaseContextMenu ${t} must be a boolean.`)}a(Lo,"validateBoolean");function yc(e){if(e!==void 0&&!q2.includes(e))throw new TypeError('BaseContextMenu tone must be "default", "primary", "success", "warning", "danger", or "muted".')}a(yc,"validateTone");function Y2(e){if(e!==void 0&&e!=="ltr"&&e!=="rtl")throw new TypeError('BaseContextMenu dir must be "ltr" or "rtl".')}a(Y2,"validateDirection");function X2(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M3.5 8.5 6.5 11.5 12.5 4.5"})})}a(X2,"CheckIcon");function Q2(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"currentColor",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"3"})})}a(Q2,"DotIcon");function Z2(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 4 4 4-4 4"})})}a(Z2,"ChevronRightIcon");function Gm({label:e,icon:t,shortcut:o,children:r,classNames:n,inset:i,indicator:s}){let l=r??e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s||null,V(t)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m(n?.icon),children:t}):i?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"icon",className:"h-4 w-4 shrink-0"}):null,V(l)?jsxRuntime.jsx("span",{"data-slot":"label",className:m(n?.label),children:l}):null,V(o)?jsxRuntime.jsx("span",{"data-slot":"shortcut",className:m(n?.shortcut),children:o}):null]})}a(Gm,"renderItemContent");function xc({children:e,trigger:t,content:o,disabled:r=false,modal:n=true,dir:i,appearance:s,className:l,classNames:d,onOpenChange:c}){Lo(r,"disabled"),Lo(n,"modal"),Y2(i);let p=ci(),u=Pe(s);return jsxRuntime.jsxs(Tt__namespace.Root,{onOpenChange:c,modal:n,dir:i??p,children:[t?jsxRuntime.jsx(Ws,{disabled:r,appearance:u,className:m(d?.trigger,l),children:t}):null,o?jsxRuntime.jsx(zs,{appearance:u,className:d?.content,children:o}):null,e]})}a(xc,"BaseContextMenu");var Ws=ho.forwardRef(a(function({children:t,disabled:o=false,asChild:r=false,appearance:n,className:i,style:s,...l},d){Lo(o,"Trigger disabled"),Lo(r,"Trigger asChild");let c=Pe(n),p=ke(),u=Ne(c);return jsxRuntime.jsx(Tt__namespace.Trigger,{...p,...l,ref:d,asChild:r,disabled:o,"data-monkeys-component":"context-menu","data-slot":"trigger","data-disabled":o||void 0,className:m(!r&&u.slots.menuTrigger,o&&!r&&u.slots.menuItemDisabled,i),style:s,children:t})},"BaseContextMenuTrigger")),zs=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,...s},l){let d=Pe(o),c=ke(),p=Ne(d),u=Cr(),g=jsxRuntime.jsx(Tt__namespace.Content,{...c,...s,ref:l,"data-monkeys-component":"context-menu","data-slot":"content",className:m(p.slots.menuContent,n?.root,r),style:{...p.styles.menuContent,...i},children:t});return u.shouldPortal?jsxRuntime.jsx(Tt__namespace.Portal,{...u.radixPortalProps,children:g}):g},"BaseContextMenuContent")),vc=ho.forwardRef(a(function({children:t,appearance:o,className:r,style:n,...i},s){let l=Pe(o),d=ke(),c=Ne(l);return jsxRuntime.jsx(Tt__namespace.Label,{...d,...i,ref:s,"data-monkeys-component":"context-menu","data-slot":"label",className:m(c.slots.menuLabel,r),style:n,children:t})},"BaseContextMenuLabel")),wc=ho.forwardRef(a(function({appearance:t,className:o,style:r,...n},i){let s=Pe(t),l=ke(),d=Ne(s);return jsxRuntime.jsx(Tt__namespace.Separator,{...l,...n,ref:i,"data-monkeys-component":"context-menu","data-slot":"separator",className:m(d.slots.menuSeparator,o),style:r})},"BaseContextMenuSeparator")),na=ho.forwardRef(a(function({children:t,label:o,icon:r,shortcut:n,tone:i,disabled:s=false,inset:l=false,appearance:d,className:c,classNames:p,style:u,onSelect:g,...f},b){Lo(s,"Item disabled"),Lo(l,"Item inset"),yc(i);let x=i??"default",y=Pe(d),k=ke(),w=Ne(y);return jsxRuntime.jsx(Tt__namespace.Item,{...k,...f,ref:b,disabled:s,"data-monkeys-component":"context-menu","data-slot":"item","data-tone":x,"data-disabled":s||void 0,className:m(w.slots.menuItem,Da(w,i),s&&w.slots.menuItemDisabled,p?.root,c),style:{...w.styles.menuItem,...u},onSelect:v=>{if(s){v.preventDefault();return}g?.(v);},children:Gm({children:t,label:o,icon:r,shortcut:n,inset:l,classNames:{icon:m(w.slots.menuItemIcon,p?.icon),label:m(w.slots.menuItemLabel,p?.label),shortcut:m(w.slots.menuItemShortcut,p?.shortcut)}})})},"BaseContextMenuItem")),yx=ho.forwardRef(a(function({children:t,label:o,icon:r,shortcut:n,tone:i,disabled:s=false,inset:l=false,checked:d,onCheckedChange:c,appearance:p,className:u,classNames:g,style:f,onSelect:b,...x},y){if(Lo(s,"CheckboxItem disabled"),Lo(l,"CheckboxItem inset"),yc(i),d!==void 0&&d!=="indeterminate"&&typeof d!="boolean")throw new TypeError('BaseContextMenu CheckboxItem checked must be a boolean or "indeterminate".');let k=i??"default",w=Pe(p),v=ke(),h=Ne(w);return jsxRuntime.jsx(Tt__namespace.CheckboxItem,{...v,...x,ref:y,checked:d,disabled:s,"data-monkeys-component":"context-menu","data-slot":"checkbox-item","data-tone":k,"data-disabled":s||void 0,"data-checked":d==="indeterminate"?"mixed":d===void 0?void 0:String(d),onCheckedChange:S=>{s||c?.(S);},className:m(h.slots.menuItem,"pl-8",Da(h,i),s&&h.slots.menuItemDisabled,g?.root,u),style:{...h.styles.menuItem,...f},onSelect:S=>{if(s){S.preventDefault();return}b?.(S);},children:Gm({children:t,label:o,icon:r,shortcut:n,inset:l,classNames:{icon:m(h.slots.menuItemIcon,g?.icon),label:m(h.slots.menuItemLabel,g?.label),shortcut:m(h.slots.menuItemShortcut,g?.shortcut)},indicator:jsxRuntime.jsx(Tt__namespace.ItemIndicator,{"data-slot":"indicator",className:m(h.slots.menuCheckboxIndicator,g?.indicator),children:jsxRuntime.jsx(X2,{})})})})},"BaseContextMenuCheckboxItem"));function xx({children:e,value:t,onValueChange:o}){return jsxRuntime.jsx(Tt__namespace.RadioGroup,{value:t,onValueChange:o,children:e})}a(xx,"BaseContextMenuRadioGroup");var vx=ho.forwardRef(a(function({children:t,label:o,icon:r,shortcut:n,tone:i,disabled:s=false,inset:l=false,value:d,appearance:c,className:p,classNames:u,style:g,onSelect:f,...b},x){Lo(s,"RadioItem disabled"),Lo(l,"RadioItem inset"),yc(i);let y=i??"default",k=Pe(c),w=ke(),v=Ne(k);return jsxRuntime.jsx(Tt__namespace.RadioItem,{...w,...b,ref:x,value:d,disabled:s,"data-monkeys-component":"context-menu","data-slot":"radio-item","data-tone":y,"data-value":d,"data-disabled":s||void 0,className:m(v.slots.menuItem,"pl-8",Da(v,i),s&&v.slots.menuItemDisabled,u?.root,p),style:{...v.styles.menuItem,...g},onSelect:h=>{if(s){h.preventDefault();return}f?.(h);},children:Gm({children:t,label:o,icon:r,shortcut:n,inset:l,classNames:{icon:m(v.slots.menuItemIcon,u?.icon),label:m(v.slots.menuItemLabel,u?.label),shortcut:m(v.slots.menuItemShortcut,u?.shortcut)},indicator:jsxRuntime.jsx(Tt__namespace.ItemIndicator,{"data-slot":"indicator",className:m(v.slots.menuRadioIndicator,u?.indicator),children:jsxRuntime.jsx(Q2,{})})})})},"BaseContextMenuRadioItem"));function wx({children:e,open:t,defaultOpen:o,onOpenChange:r}){return t!==void 0&&Lo(t,"Sub open"),o!==void 0&&Lo(o,"Sub defaultOpen"),jsxRuntime.jsx(Tt__namespace.Sub,{open:t,defaultOpen:o,onOpenChange:r,children:e})}a(wx,"BaseContextMenuSub");var kx=ho.forwardRef(a(function({children:t,label:o,icon:r,tone:n,disabled:i=false,inset:s=false,appearance:l,className:d,classNames:c,style:p,...u},g){Lo(i,"SubTrigger disabled"),Lo(s,"SubTrigger inset"),yc(n);let f=n??"default",b=Pe(l),x=ke(),y=Ne(b),k=t??o;return jsxRuntime.jsxs(Tt__namespace.SubTrigger,{...x,...u,ref:g,disabled:i,"data-monkeys-component":"context-menu","data-slot":"sub-trigger","data-tone":f,"data-disabled":i||void 0,className:m(y.slots.menuSubTrigger,Da(y,n),i&&y.slots.menuItemDisabled,c?.root,d),style:{...y.styles.menuItem,...p},children:[V(r)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m(y.slots.menuItemIcon,c?.icon),children:r}):s?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"icon",className:"h-4 w-4 shrink-0"}):null,V(k)?jsxRuntime.jsx("span",{"data-slot":"label",className:m(y.slots.menuItemLabel,c?.label),children:k}):null,jsxRuntime.jsx("span",{"data-slot":"sub-indicator",className:m(y.slots.menuSubTriggerIcon,c?.shortcut,"rtl:rotate-180"),children:jsxRuntime.jsx(Z2,{})})]})},"BaseContextMenuSubTrigger")),Cx=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,sideOffset:s=6,...l},d){let c=Pe(o),p=ke(),u=Ne(c),g=Cr(),f=jsxRuntime.jsx(Tt__namespace.SubContent,{...p,...l,ref:d,sideOffset:s,"data-monkeys-component":"context-menu","data-slot":"sub-content",className:m(u.slots.menuSubContent,n?.root,r),style:{...u.styles.menuContent,...i},children:t});return g.shouldPortal?jsxRuntime.jsx(Tt__namespace.Portal,{...g.radixPortalProps,children:f}):f},"BaseContextMenuSubContent"));var eI={1:"grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-2 xl:grid-cols-3"};function kc({items:e,columns:t=1,appearance:o,className:r,classNames:n,style:i,children:s,...l}){let d=Ne(o);return jsxRuntime.jsxs("dl",{...l,className:m(d.slots.descriptionListRoot,eI[t],n?.root,r),style:{...d.styles.descriptionList,...i},children:[e?.map((c,p)=>jsxRuntime.jsxs("div",{className:m(d.slots.descriptionListItem,n?.item),children:[jsxRuntime.jsx("dt",{className:m(d.slots.descriptionListTerm,n?.term),children:c.term}),jsxRuntime.jsx("dd",{className:m(d.slots.descriptionListValue,n?.value),children:c.value})]},p)),s]})}a(kc,"BaseDescriptionList");var nI=["default","primary","success","warning","danger","muted"];function $r(e,t){if(typeof e!="boolean")throw new TypeError(`BaseDialog ${t} must be a boolean.`)}a($r,"validateBoolean");function aI(e){if(!nI.includes(e))throw new TypeError('BaseDialog triggerTone must be "default", "primary", "success", "warning", "danger", or "muted".')}a(aI,"validateTriggerTone");function iI({trigger:e,triggerLabel:t,triggerIcon:o,triggerTone:r,triggerDisabled:n,theme:i}){return V(e)?jsxRuntime.jsx("span",{role:"button",tabIndex:n?-1:0,"aria-disabled":n||void 0,onKeyDown:s=>{n||(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),s.currentTarget.click());},children:e}):V(t)?jsxRuntime.jsxs("button",{type:"button",disabled:n,"aria-label":typeof t=="string"&&t.trim()?t:void 0,className:m(i.slots.buttonBase,jn(i,r),n&&i.slots.buttonDisabled),style:{...i.styles.button,...n?i.styles.buttonDisabled:void 0},children:[V(o)?jsxRuntime.jsx("span",{"data-slot":"icon",className:i.slots.buttonIcon,children:o}):null,jsxRuntime.jsx("span",{"data-slot":"label",className:i.slots.buttonLabel,children:t})]}):null}a(iI,"renderTrigger");var aa=ho.forwardRef(a(function({open:t,defaultOpen:o=false,size:r="default",title:n,description:i,header:s,footer:l,trigger:d,triggerLabel:c,triggerIcon:p,triggerTone:u="default",triggerDisabled:g=false,closeLabel:f,closeOnEscape:b=true,closeOnOverlayClick:x=true,showCloseButton:y=true,keepMounted:k=false,trapFocus:w=true,restoreFocus:v=true,initialFocus:h="first-interactive",initialFocusRef:S,zIndex:T,portal:C=false,appearance:R,className:M,classNames:I,style:A,children:N,onOpenChange:D,id:E,...P},W){if(t!==void 0&&$r(t,"open"),$r(o,"defaultOpen"),!["default","viewport","page"].includes(r))throw new TypeError("BaseDialog size must be default, viewport or page.");if($r(g,"triggerDisabled"),$r(b,"closeOnEscape"),$r(x,"closeOnOverlayClick"),$r(y,"showCloseButton"),$r(k,"keepMounted"),$r(w,"trapFocus"),$r(v,"restoreFocus"),$r(C,"portal"),aI(u),h!=="first-interactive"&&h!=="container"&&h!=="explicit")throw new TypeError('BaseDialog initialFocus must be "first-interactive", "container", or "explicit".');if(T!==void 0&&!Number.isFinite(T))throw new TypeError("BaseDialog zIndex must be a finite number.");let H=Ye().dialog,B=Pe(R),L=ke(),F=f===void 0?H.close:f,_=Ne(B),$=Cr({disabled:!C}),[G,z]=ho.useState(o),re=ho.useRef(null),Z=ho.useRef(null),ae=t!==void 0,ee=ae?t:G,q=C&&$.shouldPortal?"portaled":"inline",U=V(n),X=V(i),O=V(s);if(y&&(typeof F!="string"||!F.trim()))throw new TypeError("BaseDialog closeLabel must be a non-empty string when showCloseButton is true.");let K=a(me=>{ae||z(me),D?.(me);},"handleOpenChange");ho.useEffect(()=>{if(!ee||!k)return;let me=re.current,ie=me?.ownerDocument,be=ie?.defaultView;if(!me||!ie||!be)return;Z.current=ie.activeElement instanceof be.HTMLElement?ie.activeElement:null;let He=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),We=a(()=>{let Q=me.querySelector(He);(h==="container"?me:h==="explicit"?S?.current??me:Q??me).focus();},"focusInitial"),Ke=be.requestAnimationFrame(We),ce=a(Q=>{if(Q.key==="Escape"&&b){Q.preventDefault(),Q.stopPropagation(),K(false);return}if(Q.key!=="Tab"||!w)return;let ge=Array.from(me.querySelectorAll(He));if(ge.length===0){Q.preventDefault(),me.focus();return}let we=ge[0],Ie=ge[ge.length-1];Q.shiftKey&&ie.activeElement===we?(Q.preventDefault(),Ie.focus()):!Q.shiftKey&&ie.activeElement===Ie&&(Q.preventDefault(),we.focus());},"handleKeyDown");return be.addEventListener("keydown",ce),()=>{be.cancelAnimationFrame(Ke),be.removeEventListener("keydown",ce),v&&Z.current?.isConnected&&Z.current.focus();}},[b,h,S,ee,k,v,w]);let ne=O||U||X?jsxRuntime.jsxs("div",{...L,"data-monkeys-component":"dialog","data-slot":"header","data-state":ee?"open":"closed","data-portal":q,className:m(_.slots.dialogHeader,I?.header,r==="page"&&"sr-only"),children:[O?s:null,U?jsxRuntime.jsx(xo__namespace.Title,{...L,"data-monkeys-component":"dialog","data-slot":"title","data-state":ee?"open":"closed","data-portal":q,className:O?"sr-only":m(_.slots.dialogTitle,I?.title),children:n}):null,X?jsxRuntime.jsx(xo__namespace.Description,{...L,"data-monkeys-component":"dialog","data-slot":"description","data-state":ee?"open":"closed","data-portal":q,className:O?"sr-only":m(_.slots.dialogDescription,I?.description),children:i}):null]}):null,fe=iI({trigger:d,triggerLabel:c,triggerIcon:p,triggerTone:u,triggerDisabled:g,theme:_}),he=ee||k?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(xo__namespace.Overlay,{forceMount:k||void 0,hidden:!ee,...L,"aria-hidden":"true","data-monkeys-component":"dialog","data-slot":"overlay","data-portal":q,className:m(_.slots.dialogOverlay,I?.overlay),style:{..._.styles.dialogOverlay,zIndex:T,...r==="page"?{background:"transparent",backdropFilter:"none"}:{}}}),jsxRuntime.jsx("div",{...L,hidden:!ee,"data-monkeys-component":"dialog","data-slot":"content","data-state":ee?"open":"closed","data-portal":q,className:m(_.slots.dialogContent,I?.content),style:{zIndex:T,...r==="page"?{padding:0,inset:0}:{}},children:jsxRuntime.jsx(xo__namespace.Content,{forceMount:k||void 0,...L,...U?{}:{"aria-labelledby":void 0},...X?{}:{"aria-describedby":void 0},asChild:true,onOpenAutoFocus:me=>{if(k){me.preventDefault();return}let ie=re.current;Z.current=ie?.ownerDocument.activeElement,(h==="container"||h==="explicit")&&(me.preventDefault(),(h==="explicit"?S?.current??ie:ie)?.focus({preventScroll:true}));},onCloseAutoFocus:me=>{if(k||!v){me.preventDefault();return}let ie=Z.current;ie?.isConnected&&(me.preventDefault(),ie.focus({preventScroll:true}));},onEscapeKeyDown:me=>{(k||!b)&&me.preventDefault();},onPointerDownOutside:me=>{x||me.preventDefault();},children:jsxRuntime.jsxs("div",{...L,ref:re,tabIndex:-1,"aria-modal":"true","data-monkeys-component":"dialog","data-slot":"panel","data-portal":q,className:m(_.slots.dialogPanel,I?.panel),"data-presentation":r,style:{..._.styles.dialogPanel,...r!=="default"?{width:r==="page"?"100vw":"96vw",maxWidth:"none",height:r==="page"?"100dvh":"94dvh",maxHeight:r==="page"?"100dvh":"94dvh",display:"flex",flexDirection:"column"}:{},...r==="page"?{borderRadius:0,border:0,boxShadow:"none",margin:0,animation:"none"}:{}},children:[ne,y?jsxRuntime.jsx(xo__namespace.Close,{asChild:true,children:jsxRuntime.jsx("button",{...L,type:"button","aria-label":F,title:F,"data-monkeys-component":"dialog","data-slot":"close","data-state":ee?"open":"closed","data-portal":q,className:m(_.slots.dialogClose,I?.close),children:"\xD7"})}):null,jsxRuntime.jsx("div",{...L,"data-monkeys-component":"dialog","data-slot":"body","data-state":ee?"open":"closed","data-portal":q,className:m(_.slots.dialogBody,I?.body),style:r!=="default"?{minHeight:0,flex:"1 1 0%",overflow:"hidden",padding:0}:void 0,children:N}),V(l)?jsxRuntime.jsx("div",{...L,"data-monkeys-component":"dialog","data-slot":"footer","data-state":ee?"open":"closed","data-portal":q,className:m(_.slots.dialogFooter,I?.footer),children:l}):null]})})})]}):null;return jsxRuntime.jsx("div",{...L,...P,ref:W,id:E,"data-monkeys-component":"dialog","data-slot":"root","data-state":ee?"open":"closed","data-portal":q,className:m(_.slots.dialogRoot,I?.root,M),style:A,children:jsxRuntime.jsxs(xo__namespace.Root,{open:ee,onOpenChange:K,modal:!k&&w,children:[fe?jsxRuntime.jsx(xo__namespace.Trigger,{...L,asChild:true,disabled:g,"data-monkeys-component":"dialog","data-slot":"trigger","data-portal":q,"data-tone":u,"data-disabled":g||void 0,className:m(_.slots.dialogTrigger,g&&_.slots.dialogTriggerDisabled,I?.trigger),children:fe}):null,C&&$.shouldPortal?jsxRuntime.jsx(Cs,{children:jsxRuntime.jsx(xo__namespace.Portal,{...$.radixPortalProps,forceMount:k||void 0,children:he})}):jsxRuntime.jsx(Cs,{children:he})]})})},"BaseDialog"));var Rx=ho.forwardRef(a(function({orientation:t="horizontal",label:o,appearance:r,className:n,classNames:i,style:s,...l},d){if(t!=="horizontal"&&t!=="vertical")throw new TypeError('BaseDivider orientation must be "horizontal" or "vertical".');let c=Pe(r),p=ke(),u=Ne(c),g=t==="vertical",f=V(o)&&!g,b={...u.styles.divider,...s};return f?jsxRuntime.jsxs("div",{...p,...l,ref:d,role:"separator","aria-orientation":t,"data-monkeys-component":"divider","data-slot":"root","data-orientation":t,"data-state":"labeled",className:m("flex min-w-0 items-center",i?.root,n),style:b,children:[jsxRuntime.jsx("div",{"data-slot":"line","data-orientation":t,className:m("min-w-0 flex-1 border-t",u.slots.dividerRoot,i?.line)}),jsxRuntime.jsx("span",{"data-slot":"label","data-orientation":t,className:m(u.slots.dividerLabel,i?.label),children:o}),jsxRuntime.jsx("div",{"data-slot":"line","data-orientation":t,className:m("min-w-0 flex-1 border-t",u.slots.dividerRoot,i?.line)})]}):jsxRuntime.jsx("div",{...p,...l,ref:d,role:"separator","aria-orientation":t,"data-monkeys-component":"divider","data-slot":"root","data-orientation":t,"data-state":"unlabeled",className:m(u.slots.dividerRoot,g?"min-h-full self-stretch border-l":"w-full border-t",i?.root,n),style:b})},"BaseDivider"));function Ii(e,t){if(typeof e!="boolean")throw new TypeError(`BaseDropdownMenu ${t} must be a boolean.`)}a(Ii,"validateBoolean");function pI(e){if(e!=="bottom-start"&&e!=="bottom-end"&&e!=="top-start"&&e!=="top-end")throw new TypeError('BaseDropdownMenu placement must be "bottom-start", "bottom-end", "top-start", or "top-end".')}a(pI,"validatePlacement");function mI(e){if(e!==void 0&&e!=="ltr"&&e!=="rtl")throw new TypeError('BaseDropdownMenu dir must be "ltr" or "rtl".')}a(mI,"validateDirection");function fI(e){if(!Array.isArray(e))throw new TypeError("BaseDropdownMenu items must be an array.");let t=new Set;for(let[o,r]of e.entries()){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError(`BaseDropdownMenu items[${o}] must be an object.`);if(typeof r.value!="string"||!r.value.trim())throw new TypeError(`BaseDropdownMenu items[${o}].value must be a non-empty string.`);if(t.has(r.value))throw new TypeError(`BaseDropdownMenu item value "${r.value}" must be unique.`);t.add(r.value);for(let n of ["disabled","danger","separatorBefore"]){let i=r[n];i!==void 0&&Ii(i,`items[${o}].${n}`);}if(r.onSelect!==void 0&&typeof r.onSelect!="function")throw new TypeError(`BaseDropdownMenu items[${o}].onSelect must be a function.`)}}a(fI,"validateItems");function bI(e){let[t,o]=e.split("-");return {side:t,align:o}}a(bI,"resolvePlacement");function gI({trigger:e,triggerLabel:t,triggerIcon:o,disabled:r,theme:n}){return V(e)?jsxRuntime.jsx("span",{role:"button",tabIndex:r?-1:0,"aria-disabled":r||void 0,children:e}):jsxRuntime.jsxs("button",{type:"button",disabled:r,"aria-label":typeof t=="string"&&t.trim()?t:void 0,className:m(n.slots.buttonBase,jn(n),r&&n.slots.buttonDisabled),style:{...n.styles.button,...r?n.styles.buttonDisabled:void 0},children:[V(o)?jsxRuntime.jsx("span",{"data-slot":"icon",className:n.slots.buttonIcon,children:o}):null,V(t)?jsxRuntime.jsx("span",{"data-slot":"label",className:n.slots.buttonLabel,children:t}):null]})}a(gI,"renderTrigger");var Mx=ho.forwardRef(a(function({items:t=[],label:o,trigger:r,triggerLabel:n,triggerIcon:i,disabled:s=false,open:l,defaultOpen:d=false,placement:c="bottom-start",closeOnSelect:p=true,portal:u=false,dir:g,appearance:f,className:b,classNames:x,style:y,children:k,onOpenChange:w,onSelect:v,...h},S){l!==void 0&&Ii(l,"open"),Ii(d,"defaultOpen"),Ii(s,"disabled"),Ii(p,"closeOnSelect"),Ii(u,"portal"),pI(c),mI(g),fI(t);let T=ci(),C=g??T,R=Pe(f),M=ke(),I=Ye().dropdownMenu,A=Ne(R),N=Cr({disabled:!u}),[D,E]=ho.useState(d),P=l!==void 0,W=P?l:D,H=n===void 0?I.actions:n,B=u&&N.shouldPortal?"portaled":"inline",{side:L,align:F}=bI(c);if(n===void 0&&(typeof I.actions!="string"||!I.actions.trim()))throw new TypeError("BaseDropdownMenu locale actions message must be a non-empty string.");let _=a(G=>{s||(P||E(G),w?.(G));},"handleOpenChange"),$=jsxRuntime.jsxs(Bt__namespace.Content,{...M,side:L,align:F,sideOffset:6,collisionPadding:8,"data-monkeys-component":"dropdown-menu","data-slot":"content","data-placement":c,"data-portal":B,"data-tone":"default","data-disabled":s||void 0,className:m(A.slots.dropdownMenu,x?.menu),style:A.styles.dropdownMenu,children:[V(o)?jsxRuntime.jsx(Bt__namespace.Label,{...M,"data-monkeys-component":"dropdown-menu","data-slot":"label","data-state":"static",className:m(A.slots.dropdownLabel,x?.label),children:o}):null,t.map(G=>{let z=G.disabled??false,re=G.danger?"danger":"default";return jsxRuntime.jsxs("div",{"data-monkeys-component":"dropdown-menu","data-slot":"item-wrapper",children:[G.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{...M,"data-monkeys-component":"dropdown-menu","data-slot":"separator","data-state":"static",className:m(A.slots.dropdownSeparator,x?.separator)}):null,jsxRuntime.jsx(Bt__namespace.Item,{asChild:true,disabled:z,onSelect:Z=>{G.onSelect?.(G),v?.(G),p||Z.preventDefault();},children:jsxRuntime.jsxs("button",{...M,type:"button",disabled:z,"data-monkeys-component":"dropdown-menu","data-slot":"item","data-state":z?"disabled":"enabled","data-value":G.value,"data-placement":c,"data-portal":B,"data-tone":re,"data-disabled":z||void 0,className:m(A.slots.dropdownItem,G.danger&&A.slots.dropdownItemDanger,z&&A.slots.dropdownItemDisabled,x?.item),style:A.styles.dropdownItem,children:[V(G.icon)?jsxRuntime.jsx("span",{"data-slot":"item-icon",className:m(A.slots.dropdownItemIcon,x?.itemIcon),children:G.icon}):null,jsxRuntime.jsxs("span",{"data-slot":"item-content",className:m(A.slots.dropdownItemContent,x?.itemContent),children:[jsxRuntime.jsx("span",{"data-slot":"item-label",className:m(A.slots.dropdownItemLabel,x?.itemLabel),children:G.label}),V(G.description)?jsxRuntime.jsx("span",{"data-slot":"item-description",className:m(A.slots.dropdownItemDescription,x?.itemDescription),children:G.description}):null]}),V(G.shortcut)?jsxRuntime.jsx("span",{"data-slot":"item-shortcut",className:m(A.slots.dropdownItemShortcut,x?.itemShortcut),children:G.shortcut}):null]})})]},G.value)}),k]});return jsxRuntime.jsx("div",{...M,...h,ref:S,dir:C,"data-monkeys-component":"dropdown-menu","data-slot":"root","data-state":W?"open":"closed","data-placement":c,"data-portal":B,"data-tone":"default","data-disabled":s||void 0,className:m(A.slots.dropdownRoot,x?.root,b),style:y,children:jsxRuntime.jsxs(Bt__namespace.Root,{open:W,onOpenChange:_,dir:C,modal:false,children:[jsxRuntime.jsx(Bt__namespace.Trigger,{...M,asChild:true,disabled:s,"data-monkeys-component":"dropdown-menu","data-slot":"trigger","data-placement":c,"data-portal":B,"data-tone":"default","data-disabled":s||void 0,className:m(A.slots.dropdownTrigger,s&&A.slots.dropdownTriggerDisabled,x?.trigger),children:gI({trigger:r,triggerLabel:H,triggerIcon:i,disabled:s,theme:A})}),u&&N.shouldPortal?jsxRuntime.jsx(Bt__namespace.Portal,{...N.radixPortalProps,children:$}):$]})})},"BaseDropdownMenu"));function yI(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",children:[jsxRuntime.jsx("rect",{width:"16",height:"12",x:"4",y:"6",rx:"2"}),jsxRuntime.jsx("path",{d:"M8 10h8"}),jsxRuntime.jsx("path",{d:"M8 14h5"})]})}a(yI,"DefaultEmptyIcon");var Pi=ho.forwardRef(a(function({icon:t=jsxRuntime.jsx(yI,{}),title:o,description:r,actions:n,variant:i,appearance:s,className:l,classNames:d,style:c,...p},u){let g=Pe(s),f=ke(),b=Or(),x=i??b.empty?.variant??"default",y=b.density==="compact"?"min-h-0 px-3 py-3":b.density==="comfortable"?"min-h-56 px-8 py-12":void 0,k=Ne(g);return jsxRuntime.jsxs("div",{...f,...p,ref:u,"data-monkeys-component":"empty-state","data-slot":"root","data-state":"empty","data-variant":x,"data-density":b.density,className:m(k.slots.stateRoot,y,x==="compact"&&"min-h-0 gap-1 py-3",d?.root,l),style:{...k.styles.stateRoot,...c},children:[V(t)?jsxRuntime.jsx("div",{"data-slot":"icon","data-state":"empty",className:m(k.slots.stateIcon,d?.icon),style:k.styles.stateIcon,children:t}):null,V(o)?jsxRuntime.jsx("div",{"data-slot":"title","data-state":"empty",className:m(k.slots.stateTitle,d?.title),children:o}):null,V(r)?jsxRuntime.jsx("div",{"data-slot":"description","data-state":"empty",className:m(k.slots.stateDescription,d?.description),children:r}):null,V(n)?jsxRuntime.jsx("div",{"data-slot":"actions","data-state":"empty",className:m(k.slots.stateActions,d?.actions),children:n}):null]})},"BaseEmptyState"));var Dx=ho.createContext(false);function Px({children:e}){let{locale:t}=Co();return e==null||e===""?null:jsxRuntime.jsx(To,{content:e,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":typeof e=="string"?e:t.startsWith("zh")?"\u8BF4\u660E":"Help","data-form-help":true,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:jsxRuntime.jsx(lucideReact.HelpCircle,{className:"h-4 w-4","aria-hidden":"true"})})})}a(Px,"BaseFormHelp");function NI(...e){let t=e.flatMap(o=>o?.split(/\s+/).filter(Boolean)??[]);return t.length?Array.from(new Set(t)).join(" "):void 0}a(NI,"mergeAriaIds");function Um(e,t,o){if(e===void 0)return t;if(!e.trim()||/\s/.test(e))throw new TypeError(`BaseField ${o} must be a non-empty ID without whitespace.`);return e}a(Um,"resolveOptionalId");var jr=ho.forwardRef(a(function({label:t,description:o,message:r,error:n,required:i=false,disabled:s=false,htmlFor:l,descriptionId:d,messageId:c,errorId:p,validate:u,validationMode:g="onBlur",children:f,appearance:b,className:x,classNames:y,style:k,...w},v){for(let[K,ne]of [["required",i],["disabled",s]])if(typeof ne!="boolean")throw new TypeError(`BaseField ${K} must be a boolean.`);if(u!==void 0&&typeof u!="function")throw new TypeError("BaseField validate must be a function.");if(g!=="onBlur"&&g!=="onChange")throw new TypeError('BaseField validationMode must be "onBlur" or "onChange".');let h=ho.useContext(Dx)?"tooltip":"inline",S=ho.useId(),T=Pe(b),C=ke(),R=Ne(T),M=V(o),[I,A]=ho.useState(null),N=ho.useRef(new Set),D=ho.useRef(u),E=ho.useRef(g),P=ho.useRef(s);D.current=u,E.current=g,P.current=s;let W=u!==void 0;ho.useEffect(()=>{(!W||s)&&A(null);},[s,W]),ho.useEffect(()=>{if(W&&N.current.size!==1)throw new TypeError("BaseField with validate must contain exactly one compatible Base control.")},[W]);let H=ho.useCallback(K=>{let ne=N.current;if(D.current!==void 0&&!ne.has(K)&&ne.size>0)throw new TypeError("BaseField with validate supports exactly one compatible Base control. Use BaseFieldset for control groups.");return ne.add(K),()=>{ne.delete(K);}},[]),B=ho.useCallback((K,ne)=>{let fe=D.current;if(P.current||fe===void 0||E.current!==K)return;let he=Wy(fe(ne));if(he===null){A(null);return}A(he);},[]),L=ho.useCallback(K=>B("onBlur",K),[B]),F=ho.useCallback(K=>B("onChange",K),[B]),$=V(n)?n:I,G=V($),z=!G&&V(r),re=G?$:r,Z=l??`${S}-control`,ae=M?Um(d,`${S}-description`,"descriptionId"):void 0,ee=z?Um(c,`${S}-message`,"messageId"):void 0,q=G?Um(p,`${S}-error`,"errorId"):void 0,U={id:Z,"aria-describedby":NI(ae,ee),"aria-errormessage":q,"aria-invalid":G?true:void 0,"aria-required":i?true:void 0,required:i||void 0,disabled:s||void 0},X=typeof f=="function"?f(U):f,O=ho.useMemo(()=>({invalid:G,registerControl:H,notifyBlur:L,notifyChange:F}),[G,L,F,H]);return jsxRuntime.jsxs("div",{...C,...w,ref:v,"aria-disabled":s||void 0,"data-monkeys-component":"field","data-slot":"root","data-required":i||void 0,"data-disabled":s||void 0,"data-invalid":G||void 0,className:m(R.slots.fieldRoot,s&&R.slots.controlDisabled,y?.root,x),style:{...R.styles.field,...k},children:[V(t)?jsxRuntime.jsxs("div",{"data-slot":"label-row",className:m(R.slots.fieldLabelRow,y?.labelRow),children:[jsxRuntime.jsxs("label",{htmlFor:typeof f=="function"?Z:l,"data-slot":"label",className:m(R.slots.fieldLabel,y?.label),children:[t,i?jsxRuntime.jsxs("span",{"aria-hidden":"true","data-slot":"required-indicator",className:m(R.slots.fieldRequired,y?.required),children:[" ","*"]}):null]}),h==="tooltip"&&M?jsxRuntime.jsx(Px,{children:o}):null]}):null,M?jsxRuntime.jsx("div",{id:ae,"data-slot":"description",className:m(R.slots.fieldDescription,y?.description,h==="tooltip"&&"sr-only"),children:o}):null,V(X)?jsxRuntime.jsx("div",{"data-slot":"control",className:m(R.slots.fieldControl,y?.control),style:R.styles.fieldControl,children:jsxRuntime.jsx(Pm.Provider,{value:O,children:X})}):null,V(re)?jsxRuntime.jsx("div",{id:G?q:ee,role:G?"alert":void 0,"data-slot":G?"error":"message",className:m(R.slots.fieldMessage,G&&"text-destructive-text",y?.message),children:re}):null]})},"BaseField"));function Ax(...e){let t=e.flatMap(o=>o?.split(/\s+/).filter(Boolean)??[]);return t.length?Array.from(new Set(t)).join(" "):void 0}a(Ax,"mergeAriaIds");function Bx(e,t,o){if(e===void 0)return t;if(!e.trim()||/\s/.test(e))throw new TypeError(`BaseFieldset ${o} must be a non-empty ID without whitespace.`);return e}a(Bx,"resolveOptionalId");var II=ho.forwardRef(a(function({children:t,legend:o,description:r,descriptionId:n,error:i,errorId:s,disabled:l,appearance:d,className:c,classNames:p,style:u,"aria-describedby":g,"aria-errormessage":f,...b},x){let y=ho.useId(),k=Pe(d),w=ke(),v=Ne(k);if(!V(o)||typeof o=="string"&&!o.trim())throw new TypeError("BaseFieldset legend must contain an accessible name.");if(l!==void 0&&typeof l!="boolean")throw new TypeError("BaseFieldset disabled must be a boolean.");let h=V(r),S=V(i),T=h?Bx(n,`${y}-description`,"descriptionId"):void 0,C=S?Bx(s,`${y}-error`,"errorId"):void 0;return jsxRuntime.jsxs("fieldset",{...w,...b,ref:x,disabled:l,"aria-describedby":Ax(g,T),"aria-errormessage":Ax(f,C),"data-monkeys-component":"fieldset","data-slot":"root",className:m(v.slots.fieldsetRoot,p?.root,c),style:{...v.styles.fieldset,...u},children:[jsxRuntime.jsx("legend",{"data-slot":"legend",className:m(v.slots.fieldsetLegend,p?.legend),style:v.styles.fieldsetLegend,children:o}),h?jsxRuntime.jsx("div",{id:T,"data-slot":"description",className:m(v.slots.fieldsetDescription,p?.description),style:v.styles.fieldsetDescription,children:r}):null,S?jsxRuntime.jsx("div",{id:C,"data-slot":"error",className:m(v.slots.fieldsetError,p?.error),style:v.styles.fieldsetError,children:i}):null,jsxRuntime.jsx("div",{"data-slot":"content",className:m(v.slots.fieldsetContent,p?.content),style:v.styles.fieldsetContent,children:t})]})},"BaseFieldset"));function AI(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=6}a(AI,"isHeadingLevel");var BI=ho.forwardRef(a(function({level:t=2,children:o,size:r="lg",tone:n="default",appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u);if(!AI(t))throw new RangeError("BaseHeading level must be an integer from 1 to 6.");return ho.createElement(`h${t}`,{...g,...c,ref:p,"data-monkeys-component":"heading","data-slot":"root","data-level":t,"data-size":r,"data-tone":n,className:m(f.slots.headingRoot,Hh(f,r),gi(f,n),l?.root,s),style:{...f.styles.heading,...d}},o)},"BaseHeading"));var WI=ho.forwardRef(a(function({children:t,columns:o=1,gap:r,align:n="stretch",justify:i="start",appearance:s,className:l,classNames:d,style:c,...p},u){let g=Go(),f=Pe(s),b=ke(),x=Ne(f),y=r===void 0?void 0:nr("BaseGrid","gap",r);return jsxRuntime.jsx("div",{...b,...p,ref:u,"data-monkeys-component":"grid","data-slot":"root","data-align":n,"data-justify":i,"data-columns":o,className:m(x.slots.gridRoot,g>0&&r===void 0&&"gap-[var(--monkeys-bento-gap)]",f?.slots?.gridRoot,d?.root,l),style:{...x.styles.grid,gridTemplateColumns:Uh(o),gap:y??x.styles.grid?.gap,alignItems:hi("BaseGrid",n),justifyContent:yi("BaseGrid",i),...c},children:t})},"BaseGrid"));var FI={sm:"h-8 px-2.5 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-3.5 text-base"},Mc=ho.forwardRef(a(function({icon:t,trailing:o,invalid:r=false,disabled:n=false,readOnly:i=false,controlSize:s,appearance:l,className:d,classNames:c,style:p,"aria-invalid":u,onBlur:g,onChange:f,...b},x){for(let[S,T]of [["invalid",r],["disabled",n],["readOnly",i]])if(typeof T!="boolean")throw new TypeError(`BaseInput ${S} must be a boolean.`);if(s!==void 0&&s!=="sm"&&s!=="md"&&s!=="lg")throw new TypeError('BaseInput controlSize must be "sm", "md", or "lg".');let y=Pe(l),k=ke(),w=Ne(y),v=Qn(),h=r||v.invalid;return jsxRuntime.jsxs("div",{...k,"data-monkeys-component":"input","data-slot":"root","data-size":s,"data-invalid":h||void 0,"data-disabled":n||void 0,"data-readonly":i||void 0,className:m(w.slots.controlWrapper,h&&w.slots.controlInvalid,n&&w.slots.controlDisabled,i&&w.slots.controlReadOnly,c?.root,d),style:{...w.styles.control,...h?w.styles.controlInvalid:void 0,...n?w.styles.controlDisabled:void 0,...p},children:[V(t)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m(w.slots.controlIcon,c?.icon),children:t}):null,jsxRuntime.jsx("input",{...b,ref:x,disabled:n,readOnly:i,"aria-invalid":u??(h||void 0),"data-slot":"control","data-size":s,"data-invalid":h||void 0,"data-disabled":n||void 0,"data-readonly":i||void 0,className:m(w.slots.controlBase,w.slots.controlInput,s&&FI[s],c?.control),onBlur:S=>{g?.(S),v.notifyBlur(S.currentTarget.value);},onChange:S=>{f?.(S),v.notifyChange(S.currentTarget.value);}}),V(o)?jsxRuntime.jsx("span",{"data-slot":"trailing",className:m(w.slots.controlTrailing,c?.trailing),children:o}):null]})},"BaseInput"));var _I=ho.forwardRef(a(function({children:t,startElement:o,endElement:r,startAddon:n,endAddon:i,invalid:s=false,disabled:l=false,appearance:d,className:c,classNames:p,style:u,...g},f){for(let[k,w]of [["invalid",s],["disabled",l]])if(typeof w!="boolean")throw new TypeError(`BaseInputGroup ${k} must be a boolean.`);let b=Pe(d),x=ke(),y=Ne(b);return jsxRuntime.jsxs("div",{...x,...g,ref:f,"data-monkeys-component":"input-group","data-slot":"root","data-invalid":s||void 0,"data-disabled":l||void 0,className:m(y.slots.inputGroupRoot,s&&y.slots.inputGroupInvalid,l&&y.slots.inputGroupDisabled,p?.root,c),style:{...y.styles.inputGroup,...s?y.styles.inputGroupInvalid:void 0,...l?y.styles.inputGroupDisabled:void 0,...u},children:[V(n)?jsxRuntime.jsx("span",{"data-slot":"start-addon","data-placement":"start",className:m(y.slots.inputGroupStartAddon,p?.startAddon),style:y.styles.inputGroupAddon,children:n}):null,V(o)?jsxRuntime.jsx("span",{"data-slot":"start-element","data-placement":"start",className:m(y.slots.inputGroupStartElement,p?.startElement),style:y.styles.inputGroupElement,children:o}):null,jsxRuntime.jsx("div",{"data-slot":"content",className:m(y.slots.inputGroupContent,p?.content),style:y.styles.inputGroupContent,children:t}),V(r)?jsxRuntime.jsx("span",{"data-slot":"end-element","data-placement":"end",className:m(y.slots.inputGroupEndElement,p?.endElement),style:y.styles.inputGroupElement,children:r}):null,V(i)?jsxRuntime.jsx("span",{"data-slot":"end-addon","data-placement":"end",className:m(y.slots.inputGroupEndAddon,p?.endAddon),style:y.styles.inputGroupAddon,children:i}):null]})},"BaseInputGroup"));var jI=ho.forwardRef(a(function({children:t,gap:o,align:r="center",justify:n="start",wrap:i=true,appearance:s,className:l,classNames:d,style:c,...p},u){let g=Go(),f=Pe(s),b=ke(),x=Ne(f);if(typeof i!="boolean")throw new TypeError("BaseInline wrap must be a boolean.");let y=o===void 0?void 0:nr("BaseInline","gap",o);return jsxRuntime.jsx("div",{...b,...p,ref:u,"data-monkeys-component":"inline","data-slot":"root","data-align":r,"data-justify":n,"data-wrap":i?"wrap":"nowrap",className:m(x.slots.inlineRoot,g>0&&o===void 0&&"gap-[var(--monkeys-bento-gap)]",f?.slots?.inlineRoot,d?.root,l),style:{...x.styles.inline,gap:y??x.styles.inline?.gap,alignItems:hi("BaseInline",r),justifyContent:yi("BaseInline",n),flexWrap:i?"wrap":"nowrap",...c},children:t})},"BaseInline"));var qI=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,...s},l){let d=Pe(o),c=ke(),p=Ne(d);return jsxRuntime.jsx("kbd",{...c,...s,ref:l,"data-monkeys-component":"kbd","data-slot":"root",className:m(p.slots.kbdRoot,n?.root,r),style:{...p.styles.kbd,...i},children:t})},"BaseKbd"));var ZI=50,JI=20,eD=80,tD=2.5;function oD(e,t){typeof e=="function"?e(t):e&&(e.current=t);}a(oD,"assignRef");function Wa(e,t){if(typeof t!="boolean")throw new TypeError(`BaseLayout ${e} must be a boolean.`)}a(Wa,"assertBoolean");function Ox(e){if(e!=="horizontal"&&e!=="vertical")throw new TypeError('BaseLayout orientation must be "horizontal" or "vertical".')}a(Ox,"assertOrientation");function Dc(e,t){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error("BaseLayout size and gap props must be finite, non-negative numbers.");return `${e}px`}if(typeof e=="string"){if(e.trim().length===0)throw new TypeError("BaseLayout size and gap string props must not be empty.");return e}return t}a(Dc,"toCssSize");function Ei(e,t){if(!Number.isFinite(t))throw new Error(`BaseLayoutSplit ${e} must be a finite number.`);if(t<0||t>100)throw new Error(`BaseLayoutSplit ${e} must be between 0 and 100.`);return t}a(Ei,"assertPercent");function Ym(e,t,o){return Math.min(Math.max(e,t),o)}a(Ym,"clamp");function rD({minSize:e=JI,maxSize:t=eD,keyboardStep:o=tD}){let r=Ei("minSize",e),n=Ei("maxSize",t);if(r>n)throw new Error("BaseLayoutSplit minSize cannot be greater than maxSize.");if(!Number.isFinite(o)||o<=0)throw new Error("BaseLayoutSplit keyboardStep must be a finite positive number.");return {min:r,max:n,keyboardStep:o}}a(rD,"resolveSplitBounds");function Wx(e,t,o,r,n){return Ym(Ei(e,t??o),r,n)}a(Wx,"resolveSplitSize");function nD(e){return e==="horizontal"?"vertical":"horizontal"}a(nD,"getSeparatorOrientation");function zx(e){let t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).direction==="rtl":e.closest('[dir="rtl"]')!==null}a(zx,"isRtl");function aD(e,t){if(e.setPointerCapture)try{e.setPointerCapture(t);}catch(o){let r=e.ownerDocument.defaultView?.DOMException;if(r&&o instanceof r&&o.name==="NotFoundError")return;throw o}}a(aD,"setPointerCaptureIfAvailable");var Fx=ho.forwardRef(a(function({header:t,sidebar:o,aside:r,sidebarLabel:n,asideLabel:i,footer:s,children:l,sidebarSize:d,asideSize:c,gap:p,fullHeight:u=false,appearance:g,className:f,classNames:b,style:x,...y},k){Wa("fullHeight",u);let w=Pe(g),v=ke(),h=Ne(w),S=V(t),T=V(o),C=V(r),R=V(s),M=[T?"var(--base-layout-sidebar-size)":void 0,"minmax(0, 1fr)",C?"var(--base-layout-aside-size)":void 0].filter(Boolean).join(" "),I=[S?"auto":void 0,"minmax(0, 1fr)",R?"auto":void 0].filter(Boolean).join(" "),A=p!==void 0?Dc(p,"0px"):void 0,N={...h.styles.layout,"--base-layout-sidebar-size":Dc(d,"16rem"),"--base-layout-aside-size":Dc(c,"20rem"),gridTemplateRows:I,...A!==void 0?{gap:A}:{},...x},D={...h.styles.layoutBody,gridTemplateColumns:M,...A!==void 0?{gap:A}:{}};return jsxRuntime.jsxs("div",{...v,...y,ref:k,"data-monkeys-component":"layout","data-slot":"root","data-full-height":u?"true":"false",className:m(h.slots.layoutRoot,u&&h.slots.layoutRootFull,b?.root,f),style:N,children:[S?jsxRuntime.jsx("div",{"data-slot":"header",className:m(h.slots.layoutHeader,b?.header),style:h.styles.layoutHeader,children:t}):null,jsxRuntime.jsxs("div",{"data-slot":"body",className:m(h.slots.layoutBody,b?.body),style:D,children:[T?jsxRuntime.jsx("aside",{"aria-label":n,"data-slot":"sidebar",className:m(h.slots.layoutSidebar,b?.sidebar),style:h.styles.layoutSidebar,children:o}):null,jsxRuntime.jsx("main",{"data-slot":"main",className:m(h.slots.layoutMain,b?.main),style:h.styles.layoutMain,children:l}),C?jsxRuntime.jsx("aside",{"aria-label":i,"data-slot":"aside",className:m(h.slots.layoutAside,b?.aside),style:h.styles.layoutAside,children:r}):null]}),R?jsxRuntime.jsx("div",{"data-slot":"footer",className:m(h.slots.layoutFooter,b?.footer),style:h.styles.layoutFooter,children:s}):null]})},"BaseLayout")),Hx=ho.forwardRef(a(function({as:t="div",scrollable:o=false,bordered:r=true,surface:n="default",children:i,appearance:s,className:l,classNames:d,style:c,...p},u){Wa("scrollable",o),Wa("bordered",r);let g=Pe(s),f=ke(),b=Ne(g);return jsxRuntime.jsx(t,{...f,...p,ref:u,"data-monkeys-component":"layout-pane","data-slot":"root","data-scrollable":o?"true":"false","data-surface":n,className:m(b.slots.layoutPane,o&&b.slots.layoutPaneScrollable,r&&b.slots.layoutPaneBordered,n==="muted"&&b.slots.layoutPaneMuted,n==="soft"&&b.slots.layoutPaneSoft,n==="transparent"&&b.slots.layoutPaneTransparent,d?.root,l),style:{...b.styles.layoutPane,...c},children:i})},"BaseLayoutPane")),Xm=ho.forwardRef(a(function({orientation:t="horizontal",resizable:o=false,disabled:r=false,size:n,minSize:i,maxSize:s,label:l,appearance:d,className:c,classNames:p,style:u,tabIndex:g,...f},b){Ox(t),Wa("resizable",o),Wa("disabled",r);let x=i===void 0?void 0:Ei("minSize",i),y=s===void 0?void 0:Ei("maxSize",s);if(x!==void 0&&y!==void 0&&x>y)throw new Error("BaseLayoutSplit minSize cannot be greater than maxSize.");let k=n===void 0?void 0:Ym(Ei("size",n),x??0,y??100),w=Pe(d),v=ke(),h=Ye().layout,S=Ne(w),T=l??h.resizePanels;if(o&&(typeof T!="string"||T.trim().length===0))throw new TypeError("BaseLayoutResizeHandle label must be a non-empty string.");let C=o&&!r,R=nD(t);return jsxRuntime.jsx("div",{...v,...f,ref:b,"data-monkeys-component":"layout-resize-handle","data-slot":"handle","data-orientation":t,"data-state":C?"enabled":r?"disabled":"static",role:o?"separator":void 0,"aria-label":o?T:void 0,"aria-orientation":o?R:void 0,"aria-valuemin":o?x:void 0,"aria-valuemax":o?y:void 0,"aria-valuenow":o?k:void 0,"aria-disabled":o&&r?true:void 0,tabIndex:C?g??0:void 0,className:m(S.slots.layoutResizeHandle,t==="horizontal"?S.slots.layoutResizeHandleHorizontal:S.slots.layoutResizeHandleVertical,!C&&S.slots.layoutResizeHandleDisabled,p?.root,c),style:{...S.styles.layoutResizeHandle,...u},children:jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator",className:m(S.slots.layoutResizeHandleIndicator,t==="horizontal"?"h-8 w-px":"h-px w-8",p?.indicator)})})},"BaseLayoutResizeHandle")),Vx=ho.forwardRef(a(function({orientation:t="horizontal",primary:o,secondary:r,children:n,resizable:i=false,disabled:s=false,size:l,defaultSize:d,minSize:c,maxSize:p,gap:u,keyboardStep:g,resizeLabel:f,appearance:b,className:x,classNames:y,style:k,onSizeChange:w,...v},h){Ox(t),Wa("resizable",i),Wa("disabled",s);let S=Pe(b),T=ke(),C=Ne(S),R=rD({minSize:c,maxSize:p,keyboardStep:g}),M=Wx("defaultSize",d,ZI,R.min,R.max),[I,A]=ho.useState(M),N=ho.useRef(null),D=ho.useRef(null),E=l!==void 0,P=i&&!s,W=Wx("size",E?l:I,M,R.min,R.max),H=v.dir??T.dir,B=ho.useCallback(ee=>{N.current=ee,oD(h,ee);},[h]),L=ho.useCallback(ee=>{let q=Ym(ee,R.min,R.max);E||A(q),w?.(q);},[R.max,R.min,E,w]),F=ho.useCallback(ee=>{let q=N.current;if(!q)return;let U=q.getBoundingClientRect(),X=t==="horizontal"?U.width:U.height;if(!Number.isFinite(X)||X<=0)return;let O=t==="horizontal"?zx(q)?U.right-ee.clientX:ee.clientX-U.left:ee.clientY-U.top;L(O/X*100);},[L,t]),_=ho.useCallback(()=>{let ee=D.current;D.current=null,ee?.();},[]);ho.useEffect(()=>(P||_(),_),[P,_]);let $=a(ee=>{if(!P||ee.button!==0&&ee.pointerType!=="touch")return;ee.preventDefault(),_(),F(ee);let q=ee.pointerId,U=ee.currentTarget,X=U.ownerDocument,O=a(fe=>{fe.pointerId===q&&F(fe);},"handleMove"),K=a(fe=>{fe.pointerId===q&&_();},"handleStop"),ne=a(fe=>{fe.pointerId===q&&_();},"handleLostCapture");X.addEventListener("pointermove",O),X.addEventListener("pointerup",K),X.addEventListener("pointercancel",K),U.addEventListener("lostpointercapture",ne),D.current=()=>{X.removeEventListener("pointermove",O),X.removeEventListener("pointerup",K),X.removeEventListener("pointercancel",K),U.removeEventListener("lostpointercapture",ne),U.hasPointerCapture?.(q)&&U.releasePointerCapture?.(q);},aD(U,q);},"handlePointerDown"),G=a(ee=>{if(!P)return;let q=ee.shiftKey?R.keyboardStep*4:R.keyboardStep,U=t==="horizontal"&&zx(ee.currentTarget),X;ee.key==="Home"&&(X=R.min),ee.key==="End"&&(X=R.max),t==="horizontal"&&ee.key==="ArrowLeft"&&(X=W+(U?q:-q)),t==="horizontal"&&ee.key==="ArrowRight"&&(X=W+(U?-q:q)),t==="vertical"&&ee.key==="ArrowUp"&&(X=W-q),t==="vertical"&&ee.key==="ArrowDown"&&(X=W+q),X!==void 0&&(ee.preventDefault(),L(X));},"handleKeyDown"),z=u!==void 0?Dc(u,"0px"):void 0,re=z!==void 0?"var(--base-layout-split-gap)":"auto",Z=z!==void 0?t==="horizontal"?{width:"var(--base-layout-split-gap)"}:{height:"var(--base-layout-split-gap)"}:void 0,ae={...C.styles.layoutSplit,[t==="horizontal"?"gridTemplateColumns":"gridTemplateRows"]:i?`${W}% ${re} minmax(0, 1fr)`:`${W}% minmax(0, 1fr)`,...i?{gap:0}:{},...z!==void 0?{"--base-layout-split-gap":z,...i?{}:{gap:z}}:{},...k};return jsxRuntime.jsxs("div",{...T,...v,ref:B,"data-monkeys-component":"layout-split","data-slot":"root","data-orientation":t,"data-state":P?"enabled":s?"disabled":"static","data-controlled":E?"true":"false",className:m(C.slots.layoutSplitRoot,t==="horizontal"?C.slots.layoutSplitHorizontal:C.slots.layoutSplitVertical,y?.root,x),style:ae,children:[jsxRuntime.jsx("div",{"data-slot":"primary",className:m(C.slots.layoutSplitPane,C.slots.layoutSplitPrimary,y?.primary),style:C.styles.layoutSplitPane,children:V(o)?o:n}),i?jsxRuntime.jsx(Xm,{orientation:t,resizable:true,disabled:s,size:W,minSize:R.min,maxSize:R.max,label:f,appearance:b,dir:H,className:y?.handle,style:Z,onPointerDown:$,onKeyDown:G}):null,jsxRuntime.jsx("div",{"data-slot":"secondary",className:m(C.slots.layoutSplitPane,C.slots.layoutSplitSecondary,y?.secondary),style:C.styles.layoutSplitPane,children:r})]})},"BaseLayoutSplit"));var sD={line:"h-4 w-full",block:"h-24 w-full",circle:"aspect-square h-10 rounded-full"},Ur=ho.forwardRef(a(function({variant:t="line",animated:o=true,animation:r,appearance:n,className:i,classNames:s,style:l,...d},c){if(t!=="line"&&t!=="block"&&t!=="circle")throw new TypeError('BaseSkeleton variant must be "line", "block", or "circle".');if(typeof o!="boolean")throw new TypeError("BaseSkeleton animated must be a boolean.");let p=Pe(n),u=ke(),g=Ne(p),f=Jd(r,o,c);return jsxRuntime.jsx("div",{...u,...d,ref:f.ref,"aria-hidden":"true","data-monkeys-component":"skeleton","data-slot":"root","data-variant":t,"data-animated":f.mode!=="none","data-state":f.mode!=="none"?"animated":"static","data-skeleton-animation":f.mode,className:m(g.slots.skeletonRoot,sD[t],f.mode==="pulse"&&"motion-safe:animate-pulse motion-reduce:animate-none",s?.root,i),style:{...g.styles.skeleton,...f.style,...l}})},"BaseSkeleton"));function cD({className:e}){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:e,fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(cD,"DefaultLoadingIcon");var Kr=ho.forwardRef(a(function({icon:t,title:o,description:r,actions:n,variant:i,animation:s,appearance:l,className:d,classNames:c,style:p,role:u="status","aria-live":g="polite","aria-busy":f=true,"aria-label":b,"aria-labelledby":x,...y},k){let w=Pe(l),v=ke(),{loading:h}=Ye(),S=Or(),T=i??S.loading?.variant??"spinner",C=S.density==="compact"?"min-h-0 px-3 py-3":S.density==="comfortable"?"min-h-56 px-8 py-12":void 0,R=Ne(w),M=T==="skeleton"&&t===void 0?void 0:t===void 0?jsxRuntime.jsx(cD,{className:R.slots.loadingSpinner}):t,I=b??(x===void 0?typeof o=="string"?o:h.spinner:void 0);return jsxRuntime.jsxs("div",{...v,...y,ref:k,role:u,"aria-live":g,"aria-busy":f,"aria-label":I,"aria-labelledby":x,"data-monkeys-component":"loading-state","data-slot":"root","data-state":"loading","data-variant":T,"data-density":S.density,className:m(R.slots.stateRoot,C,c?.root,d),style:{...R.styles.stateRoot,...p},children:[T==="skeleton"?jsxRuntime.jsx(Xn,{animation:s,children:jsxRuntime.jsxs("div",{className:"flex w-full max-w-sm flex-col gap-3","data-slot":"skeleton",children:[jsxRuntime.jsx(Ur,{variant:"block",className:"h-20"}),jsxRuntime.jsx(Ur,{variant:"line",className:"w-4/5"}),jsxRuntime.jsx(Ur,{variant:"line",className:"w-3/5"})]})}):V(M)?jsxRuntime.jsx("div",{"data-slot":"icon","data-state":"loading",className:m(R.slots.stateIcon,c?.icon),style:R.styles.stateIcon,children:M}):null,T!=="skeleton"&&V(o)?jsxRuntime.jsx("div",{"data-slot":"title","data-state":"loading",className:m(R.slots.stateTitle,c?.title),children:o}):null,T!=="skeleton"&&V(r)?jsxRuntime.jsx("div",{"data-slot":"description","data-state":"loading",className:m(R.slots.stateDescription,c?.description),children:r}):null,V(n)?jsxRuntime.jsx("div",{"data-slot":"actions","data-state":"loading",className:m(R.slots.stateActions,c?.actions),children:n}):null]})},"BaseLoadingState"));var fD=ho.forwardRef(a(function({children:t,openOnMount:o=false,size:r="md",tone:n="primary",appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u),b=fn(c.href,"link"),x=c.href!==void 0&&b===void 0,y=ho.useRef();return ho.useEffect(()=>{!o||!b||c.target!=="_blank"||c["aria-disabled"]===true||c["aria-disabled"]==="true"||y.current===b||(y.current=b,window.open(b,"_blank","noopener,noreferrer"));},[o,b,c.target,c["aria-disabled"]]),jsxRuntime.jsx("a",{...g,...c,href:b,"aria-disabled":x?true:c["aria-disabled"],onClickCapture:k=>{if(x){k.preventDefault(),k.stopPropagation();return}c.onClickCapture?.(k);},onClick:k=>{if(x){k.preventDefault(),k.stopPropagation();return}c.onClick?.(k);},onAuxClickCapture:k=>{if(x){k.preventDefault(),k.stopPropagation();return}c.onAuxClickCapture?.(k);},ref:p,"data-monkeys-component":"link","data-slot":"root","data-size":r,"data-tone":n,className:m(f.slots.linkRoot,Od(f,r),gi(f,n),l?.root,s),style:{...f.styles.link,...d},children:t})},"BaseLink"));var gD=ho.forwardRef(a(function({ordered:t=false,marker:o="auto",spacing:r="default",children:n,appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u),b={...g,...c,"data-monkeys-component":"list","data-slot":"root","data-list-type":t?"ordered":"unordered","data-marker":o,"data-spacing":r,className:m(f.slots.listRoot,Vh(f,r),o!=="auto"&&_h(f,o),l?.root,s),style:{...f.styles.list,...d},children:n};return t?jsxRuntime.jsx("ol",{...b,ref:p}):jsxRuntime.jsx("ul",{...b,ref:p})},"BaseList")),hD=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,...s},l){let d=Pe(o),c=ke(),p=Ne(d);return jsxRuntime.jsx("li",{...c,...s,ref:l,"data-monkeys-component":"list-item","data-slot":"item",className:m(p.slots.listItem,n?.root,r),style:{...p.styles.listItem,...i},children:t})},"BaseListItem"));var vD=500;function wD({options:e,value:t,defaultValue:o,invalid:r,disabled:n,required:i,openForPreview:s,maxTagCount:l}){for(let[d,c]of [["invalid",r],["disabled",n],["required",i],["openForPreview",s]])if(typeof c!="boolean")throw new TypeError(`BaseMultiSelect ${d} must be a boolean.`);if(l!==void 0&&typeof l!="number")throw new TypeError("BaseMultiSelect maxTagCount must be a number.");if(e!==void 0&&!Array.isArray(e))throw new TypeError("BaseMultiSelect options must be an array.");e?.forEach((d,c)=>{if(!d||typeof d!="object")throw new TypeError(`BaseMultiSelect option at index ${c} must be an object.`);if(typeof d.value!="string")throw new TypeError(`BaseMultiSelect option value at index ${c} must be a string.`);if(d.disabled!==void 0&&typeof d.disabled!="boolean")throw new TypeError(`BaseMultiSelect option disabled at index ${c} must be a boolean.`);if(d.textValue!==void 0&&typeof d.textValue!="string")throw new TypeError(`BaseMultiSelect option textValue at index ${c} must be a string.`)});for(let[d,c]of [["value",t],["defaultValue",o]]){if(c!==void 0&&!Array.isArray(c))throw new TypeError(`BaseMultiSelect ${d} must be an array.`);c?.forEach((p,u)=>{if(typeof p!="string")throw new TypeError(`BaseMultiSelect ${d} item at index ${u} must be a string.`)});}}a(wD,"validateMultiSelectProps");function tf(e){let t=[],o=new Set;return e?.forEach(r=>{o.has(r)||(o.add(r),t.push(r));}),t}a(tf,"normalizeValues");function kD(e,t,o){if(!e.length)return -1;let r=t>=0?t:o===1?-1:0;for(let n=1;n<=e.length;n+=1){let i=(r+n*o+e.length)%e.length;if(!e[i]?.disabled)return i}return -1}a(kD,"getNextEnabledIndex");function Ac(e,t){if(t==="first")return e.findIndex(o=>!o.disabled);for(let o=e.length-1;o>=0;o-=1)if(!e[o]?.disabled)return o;return -1}a(Ac,"getBoundaryEnabledIndex");function CD(e,t){return e===void 0||!Number.isFinite(e)?t:Math.max(0,Math.min(t,Math.floor(e)))}a(CD,"getSafeTagCount");function SD(e){return e.textValue!==void 0?e.textValue:typeof e.label=="string"?e.label:e.value}a(SD,"getOptionText");function TD(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(TD,"toDomId");var $x=ho.forwardRef(a(function({options:t,value:o,defaultValue:r,name:n,placeholder:i,icon:s,invalid:l=false,disabled:d=false,required:c=false,openForPreview:p=false,maxTagCount:u,removeLabel:g,emptyLabel:f,appearance:b,className:x,classNames:y,style:k,id:w,"aria-invalid":v,"aria-label":h,"aria-labelledby":S,"aria-describedby":T,"aria-errormessage":C,onValueChange:R,...M},I){wD({options:t,value:o,defaultValue:r,invalid:l,disabled:d,required:c,openForPreview:p,maxTagCount:u});let A=Ye().multiSelect,N=Pe(b),D=ke(),E=Ne(N),P=ho.useId(),W=w??P,H=`${W}-control`,B=`${W}-listbox`,L=ho.useRef(null),F=ho.useRef(null),_=ho.useRef(false),$=ho.useRef(""),G=ho.useRef(null),z=t??[],re=z.map((J,$e)=>`${W}-option-${$e}-${TD(J.value)}`),Z=p,[ae,ee]=ho.useState(false),q=Z||ae,U=ho.useRef(tf(r)),[X,O]=ho.useState(()=>[...U.current]),[K,ne]=ho.useState(()=>Ac(z,"first")),fe=o!==void 0,he=ho.useMemo(()=>tf(fe?o:X),[fe,X,o]),me=ho.useMemo(()=>new Set(he),[he]),ie=ho.useMemo(()=>{let J=new Map;return z.forEach($e=>{J.has($e.value)||J.set($e.value,$e);}),J},[z]),be=ho.useMemo(()=>he.map(J=>ie.get(J)).filter(J=>J!==void 0),[ie,he]),He=Ac(z,"first"),We=K>=0&&!z[K]?.disabled?K:He,Ke=CD(u,be.length),ce=be.slice(0,Ke),Q=be.length-ce.length,ge=be.length===0,we=M.dir??D.dir,Ie=d?"disabled":l?"invalid":q?"open":"closed",oe=a(J=>{L.current=J,typeof I=="function"?I(J):I&&(I.current=J);},"setRootRef"),xe=a(J=>{d||Z||(ee(J),J&&We<0&&ne(He));},"setOpen"),Ve=a(J=>{let $e=tf(J);fe||O($e),R?.($e);},"commitValues"),_e=a(J=>{if(!J||J.disabled||d)return;let $e=me.has(J.value)?he.filter(ue=>ue!==J.value):[...he,J.value];Ve($e);},"toggleOption"),Ge=a(J=>{d||Ve(he.filter($e=>$e!==J.value));},"removeOption"),le=a(J=>{J<0||z[J]?.disabled||(ne(J),q||xe(true));},"moveActive"),Me=a((J,$e)=>{let ue=J.currentTarget.ownerDocument.defaultView;if(!ue)return;let Re=`${$.current}${$e}`.toLocaleLowerCase();$.current=Re,G.current&&G.current.ownerWindow.clearTimeout(G.current.timerId),G.current={ownerWindow:ue,timerId:ue.setTimeout(()=>{$.current="",G.current=null;},vD)};let te=Array.from(Re).every(Te=>Te===Re[0])?$e.toLocaleLowerCase():Re;for(let Te=1;Te<=z.length;Te+=1){let ze=(We+Te+z.length)%z.length,je=z[ze];if(!je?.disabled&&SD(je).trim().toLocaleLowerCase().startsWith(te)){J.preventDefault(),le(ze);return}}},"handleTypeahead"),Ae=a(J=>{if(!(d||_.current||J.nativeEvent.isComposing)){if(J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault(),q?le(kD(z,We,J.key==="ArrowDown"?1:-1)):(ne(He),xe(true));return}if(J.key==="Home"||J.key==="End"){J.preventDefault(),le(Ac(z,J.key==="Home"?"first":"last"));return}if(J.key==="Enter"||J.key===" "){J.preventDefault(),q?_e(z[We]):xe(true);return}if(J.key==="Escape"&&q){J.preventDefault(),xe(false);return}if(J.key==="Tab"&&q){xe(false);return}J.key.length===1&&!J.ctrlKey&&!J.metaKey&&!J.altKey&&!/\s/.test(J.key)&&Me(J,J.key);}},"handleKeyDown");return ho.useEffect(()=>{if(!q||Z)return;let J=L.current?.ownerDocument;if(!J)return;let $e=a(ue=>{L.current?.contains(ue.target)||ee(false);},"handlePointerDown");return J.addEventListener("pointerdown",$e),()=>J.removeEventListener("pointerdown",$e)},[Z,q]),ho.useEffect(()=>{if(fe)return;let J=L.current?.closest("form");if(!J)return;let $e=a(()=>{O([...U.current]),ne(Ac(z,"first")),Z||ee(false);},"handleReset");return J.addEventListener("reset",$e),()=>J.removeEventListener("reset",$e)},[Z,fe,z]),ho.useEffect(()=>()=>{G.current&&G.current.ownerWindow.clearTimeout(G.current.timerId);},[]),jsxRuntime.jsxs("div",{...D,...M,id:w,ref:oe,dir:we,"data-monkeys-component":"multi-select","data-slot":"root","data-state":Ie,"data-disabled":d||void 0,"data-invalid":l||void 0,className:m(E.slots.controlWrapper,"overflow-visible",q&&"z-50",l&&E.slots.controlInvalid,d&&E.slots.controlDisabled,y?.root,x),style:{...E.styles.control,...l?E.styles.controlInvalid:void 0,...d?E.styles.controlDisabled:void 0,...k},children:[V(s)?jsxRuntime.jsx("span",{className:m(E.slots.controlIcon,y?.icon),children:s}):null,jsxRuntime.jsx("div",{...D,ref:F,id:H,role:"combobox",tabIndex:d?-1:0,dir:we,"aria-haspopup":"listbox","aria-expanded":q,"aria-controls":B,"aria-activedescendant":q&&We>=0?re[We]:void 0,"aria-autocomplete":"none","aria-disabled":d||void 0,"aria-required":c||void 0,"aria-invalid":v??(l||void 0),"aria-label":h,"aria-labelledby":S,"aria-describedby":T,"aria-errormessage":C,"data-monkeys-component":"multi-select","data-slot":"control","data-state":Ie,className:m(E.slots.controlBase,"flex min-h-9 cursor-pointer flex-wrap items-center gap-1.5 py-1.5 pr-9 text-left",d&&"!cursor-not-allowed",y?.control),onMouseDown:J=>{d||J.button!==0||(J.preventDefault(),F.current?.focus());},onClick:()=>{F.current?.focus(),xe(!q);},onBlur:J=>{L.current?.contains(J.relatedTarget)||xe(false);},onCompositionStart:()=>{_.current=true;},onCompositionEnd:()=>{_.current=false;},onKeyDown:Ae,children:jsxRuntime.jsxs("span",{"data-monkeys-component":"multi-select","data-slot":"tag-list","data-state":ge?"empty":"filled",className:m("flex min-w-0 flex-1 flex-wrap items-center gap-1.5",y?.tagList),children:[ce.map((J,$e)=>jsxRuntime.jsxs("span",{"data-monkeys-component":"multi-select","data-slot":"tag","data-state":"selected",className:m("inline-flex max-w-full items-center gap-1 rounded-full border border-border/70 bg-muted/65 px-2 py-0.5 text-xs font-medium text-foreground",y?.tag),children:[jsxRuntime.jsx("span",{"data-slot":"tag-label",className:m("max-w-40 truncate",y?.tagLabel),children:J.label}),jsxRuntime.jsx("button",{...D,type:"button",tabIndex:-1,dir:we,"aria-label":g?.(J)??A.removeOption({value:J.value}),disabled:d,"data-monkeys-component":"multi-select","data-slot":"tag-remove","data-state":"selected",className:m("inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background/80 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed",y?.tagRemove),onClick:ue=>{ue.preventDefault(),ue.stopPropagation(),Ge(J),F.current?.focus();},onMouseDown:ue=>{ue.preventDefault(),ue.stopPropagation();},onKeyDown:ue=>ue.stopPropagation(),children:jsxRuntime.jsx("span",{"aria-hidden":"true",children:"x"})})]},`${J.value}-${$e}`)),Q>0?jsxRuntime.jsxs("span",{"data-monkeys-component":"multi-select","data-slot":"tag-overflow","data-state":"selected",className:m("inline-flex max-w-full items-center rounded-full border border-border/70 bg-muted/45 px-2 py-0.5 text-xs font-medium text-muted-foreground",y?.tag),children:["+",Q]}):null,ge?jsxRuntime.jsx("span",{"data-monkeys-component":"multi-select","data-slot":"placeholder","data-state":"empty",className:m("min-w-0 truncate",E.slots.selectPlaceholder,y?.placeholder),children:i===void 0?A.placeholder:i}):null]})}),jsxRuntime.jsx("span",{"data-monkeys-component":"multi-select","data-slot":"chevron","data-state":q?"open":"closed",className:m(E.slots.selectChevron,q&&"rotate-[225deg]",y?.chevron)}),n?he.map(J=>ho.createElement("input",{...D,key:J,type:"hidden",name:n,value:J,disabled:d,dir:we,"data-monkeys-component":"multi-select","data-slot":"hidden-input","data-state":"selected",className:y?.hiddenInput})):null,q?jsxRuntime.jsx("div",{...D,id:B,role:"listbox",dir:we,"aria-multiselectable":"true","aria-labelledby":H,"data-monkeys-component":"multi-select","data-slot":"menu","data-state":"open",className:m(E.slots.selectMenu,y?.menu),style:E.styles.selectMenu,children:z.length>0?z.map((J,$e)=>{let ue=me.has(J.value),Re=$e===We,se=J.disabled?"disabled":Re?"active":ue?"selected":"idle";return ho.createElement("button",{...D,key:`${J.value}-${$e}`,id:re[$e],type:"button",role:"option",tabIndex:-1,dir:we,"aria-selected":ue,disabled:J.disabled,"data-monkeys-component":"multi-select","data-slot":"option","data-state":se,"data-active":Re||void 0,"data-selected":ue||void 0,"data-disabled":J.disabled||void 0,className:m(E.slots.selectOption,"gap-2",Re&&E.slots.selectOptionActive,ue&&E.slots.selectOptionSelected,J.disabled&&E.slots.selectOptionDisabled,y?.option),style:{...E.styles.selectOption,...Re?E.styles.selectOptionActive:void 0,...ue?E.styles.selectOptionSelected:void 0},onMouseEnter:()=>{J.disabled||ne($e);},onMouseDown:te=>te.preventDefault(),onClick:()=>{_e(J),F.current?.focus();}},jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"option-indicator",className:m("inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-border/70 text-[10px]",ue&&"border-primary/40 bg-primary text-primary-foreground",y?.optionIndicator),children:ue?"\u2713":null}),jsxRuntime.jsx("span",{"data-slot":"option-label",className:m("min-w-0 flex-1 truncate",y?.optionLabel),children:J.label}))}):jsxRuntime.jsx("div",{...D,dir:we,role:"option",tabIndex:-1,"aria-disabled":"true","aria-selected":"false","data-monkeys-component":"multi-select","data-slot":"empty","data-state":"empty",className:m("px-2.5 py-2 text-sm text-muted-foreground",y?.empty),children:f===void 0?A.empty:f})}):null]})},"BaseMultiSelect"));var MD=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/;function rf(e){if(!MD.test(e))return null;let t=Number(e);return Number.isFinite(t)?t:null}a(rf,"parseBaseNumberInputValue");function ID(e){let t=/^(?:\d+)(?:\.(\d*))?(?:e([+-]?\d+))?$/i.exec(Math.abs(e).toString());if(!t)return 0;let o=t[1]?.length??0,r=Number(t[2]??0);return Math.min(12,Math.max(0,o-r))}a(ID,"resolveDecimalPlaces");function jx(e,t){let r=10**Math.max(...t.map(ID)),n=Math.round((e+Number.EPSILON)*r)/r;return Object.is(n,-0)?0:n}a(jx,"normalizeSteppedValue");function DD({rawValue:e,direction:t,step:o,min:r,max:n}){let s=rf(e)??0,l=[s,o];r!==void 0&&l.push(r),n!==void 0&&l.push(n);let d=jx(s+t*o,l);return r!==void 0&&(d=Math.max(r,d)),n!==void 0&&(d=Math.min(n,d)),jx(d,l)}a(DD,"resolveBaseNumberInputStep");function Ux(e,t){if(t!==void 0&&!Number.isFinite(t))throw new TypeError(`BaseNumberInput ${e} must be a finite number.`)}a(Ux,"validateBoundary");function Kx(e,t){if(!t.trim())throw new TypeError(`BaseNumberInput ${e} must be a non-empty string.`)}a(Kx,"validateLabel");function PD(e,t,o){return e!==null&&(t===void 0||e>=t)&&(o===void 0||e<=o)}a(PD,"isInRange");var ED=ho.forwardRef(a(function({value:t,defaultValue:o="",min:r,max:n,step:i=1,showStepControls:s=false,incrementLabel:l,decrementLabel:d,invalid:c=false,disabled:p=false,readOnly:u=false,appearance:g,className:f,classNames:b,style:x,onChange:y,onKeyDown:k,onValueChange:w,"aria-invalid":v,...h},S){if(t!==void 0&&typeof t!="string")throw new TypeError("BaseNumberInput value must be a string.");if(typeof o!="string")throw new TypeError("BaseNumberInput defaultValue must be a string.");if(Ux("min",r),Ux("max",n),r!==void 0&&n!==void 0&&r>n)throw new RangeError("BaseNumberInput min must be less than or equal to max.");if(!Number.isFinite(i)||i<=0)throw new TypeError("BaseNumberInput step must be a positive finite number.");for(let[G,z]of [["showStepControls",s],["invalid",c],["disabled",p],["readOnly",u]])if(typeof z!="boolean")throw new TypeError(`BaseNumberInput ${G} must be a boolean.`);let T=Ye(),C=l??T.numberInput.increment,R=d??T.numberInput.decrement;Kx("incrementLabel",C),Kx("decrementLabel",R);let[M,I]=ho.useState(o),A=t!==void 0,N=A?t:M,D=rf(N),E=Pe(g),P=ke(),W=Ne(E),H=a((G,z)=>{A||I(G);let re=rf(G);w?.(re,{rawValue:G,reason:z,inRange:PD(re,r,n)});},"emitValueChange"),B=a(G=>{if(p||u||D!==null&&(G===1&&n!==void 0&&D>=n||G===-1&&r!==void 0&&D<=r))return;let z=DD({rawValue:N,direction:G,step:i,min:r,max:n});H(String(z),G===1?"step-up":"step-down");},"stepValue"),L=a(G=>{y?.(G),H(G.currentTarget.value,"input");},"handleChange"),F=a(G=>{k?.(G),!(G.defaultPrevented||p||u)&&(G.key!=="ArrowUp"&&G.key!=="ArrowDown"||(G.preventDefault(),B(G.key==="ArrowUp"?1:-1)));},"handleKeyDown"),_=p||u||D!==null&&r!==void 0&&D<=r,$=p||u||D!==null&&n!==void 0&&D>=n;return jsxRuntime.jsxs("div",{...P,"data-monkeys-component":"number-input","data-slot":"root","data-invalid":c||void 0,"data-disabled":p||void 0,"data-readonly":u||void 0,className:m(W.slots.controlWrapper,c&&W.slots.controlInvalid,p&&W.slots.controlDisabled,u&&W.slots.controlReadOnly,b?.root,f),style:{...W.styles.control,...c?W.styles.controlInvalid:void 0,...p?W.styles.controlDisabled:void 0,...x},children:[jsxRuntime.jsx("input",{...h,ref:S,type:"text",inputMode:"decimal",role:"spinbutton",value:N,disabled:p,readOnly:u,"aria-invalid":v??(c||void 0),"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":D??void 0,"aria-valuetext":N||void 0,"data-slot":"control",className:m(W.slots.controlBase,W.slots.controlInput,W.slots.numberInputControl,b?.control),onChange:L,onKeyDown:F}),s?jsxRuntime.jsxs("span",{"data-slot":"step-controls",className:m(W.slots.numberInputStepControls,b?.stepControls),style:W.styles.numberInputStepControls,children:[jsxRuntime.jsx("button",{type:"button","aria-label":C,disabled:$,"data-slot":"increment",className:m(W.slots.numberInputStepButton,b?.increment),style:W.styles.numberInputStepButton,onClick:()=>B(1),children:"+"}),jsxRuntime.jsx("button",{type:"button","aria-label":R,disabled:_,"data-slot":"decrement",className:m(W.slots.numberInputStepButton,b?.decrement),style:W.styles.numberInputStepButton,onClick:()=>B(-1),children:"\u2212"})]}):null]})},"BaseNumberInput"));function Xx({tone:e,icon:t,title:o,description:r,actions:n,children:i,appearance:s,className:l,classNames:d,style:c,...p}){let u=Ne(s),g=i??r;return jsxRuntime.jsxs("div",{...p,className:m(u.slots.noticeBase,zd(u,e),d?.root,l),style:{...u.styles.notice,...c},children:[V(t)?jsxRuntime.jsx("div",{className:m(u.slots.noticeIcon,d?.icon),children:t}):null,jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[V(o)?jsxRuntime.jsx("div",{className:m(u.slots.noticeTitle,d?.title),children:o}):null,V(g)?jsxRuntime.jsx("div",{className:m(u.slots.noticeDescription,d?.description),children:g}):null,V(n)?jsxRuntime.jsx("div",{className:m(u.slots.noticeActions,d?.actions),children:n}):null]})]})}a(Xx,"BaseNotice");function WD(e,...t){for(let o of t)o&&(typeof o=="function"?o(e):o.current=e);}a(WD,"setRefs");function Qx(e,t){if(!t.trim())throw new TypeError(`BasePasswordInput ${e} must be a non-empty string.`)}a(Qx,"validateLabel");var zD=ho.forwardRef(a(function({visible:t,defaultVisible:o=false,onVisibleChange:r,showPasswordLabel:n,hidePasswordLabel:i,invalid:s=false,disabled:l=false,readOnly:d=false,appearance:c,className:p,classNames:u,style:g,"aria-invalid":f,...b},x){for(let[E,P]of [["defaultVisible",o],["invalid",s],["disabled",l],["readOnly",d]])if(typeof P!="boolean")throw new TypeError(`BasePasswordInput ${E} must be a boolean.`);if(t!==void 0&&typeof t!="boolean")throw new TypeError("BasePasswordInput visible must be a boolean.");let y=Ye(),k=n??y.passwordInput.showPassword,w=i??y.passwordInput.hidePassword;Qx("showPasswordLabel",k),Qx("hidePasswordLabel",w);let v=ho.useRef(null),[h,S]=ho.useState(o),T=t!==void 0,C=T?t:h,R=Pe(c),M=ke(),I=Ne(R),A=a(E=>{let P=v.current;P&&P.ownerDocument.activeElement===P&&E.preventDefault();},"handleTogglePointerDown"),N=a(()=>{if(l)return;let E=!C;T||S(E),r?.(E);},"handleToggle"),D=C?w:k;return jsxRuntime.jsxs("div",{...M,"data-monkeys-component":"password-input","data-slot":"root","data-visible":C||void 0,"data-invalid":s||void 0,"data-disabled":l||void 0,"data-readonly":d||void 0,className:m(I.slots.controlWrapper,s&&I.slots.controlInvalid,l&&I.slots.controlDisabled,d&&I.slots.controlReadOnly,u?.root,p),style:{...I.styles.control,...s?I.styles.controlInvalid:void 0,...l?I.styles.controlDisabled:void 0,...g},children:[jsxRuntime.jsx("input",{...b,ref:E=>WD(E,v,x),type:C?"text":"password",disabled:l,readOnly:d,"aria-invalid":f??(s||void 0),"data-slot":"control",className:m(I.slots.controlBase,I.slots.controlInput,I.slots.passwordInputControl,u?.control)}),jsxRuntime.jsx("button",{type:"button","aria-label":D,"aria-pressed":C,disabled:l,"data-slot":"toggle","data-state":C?"visible":"hidden",className:m(I.slots.passwordInputToggle,u?.toggle),style:I.styles.passwordInputToggle,onPointerDown:A,onClick:N,children:D})]})},"BasePasswordInput"));function VD(e,t,o){return Math.min(Math.max(e,t),o)}a(VD,"clamp");var ev=ho.forwardRef(a(function({value:t=0,max:o=100,label:r,showValue:n=false,valueFormatter:i,appearance:s,className:l,classNames:d,style:c,"aria-label":p,"aria-labelledby":u,...g},f){let b=`${ho.useId()}-label`;if(typeof o!="number"||!Number.isFinite(o)||o<=0)throw new TypeError("BaseProgress max must be a positive finite number.");if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("BaseProgress value must be a finite number.");let x=Pe(s),y=ke(),k=Ne(x),w=VD(t,0,o),v=w/o*100,h=i?.(w,o)??`${Math.round(v)}%`,S=V(r),T=S||n,C=typeof r=="string"?r:void 0,M=S&&C===void 0&&!(p!==void 0||u!==void 0)?b:void 0,I=w===0?"empty":w===o?"complete":"progress";return jsxRuntime.jsxs("div",{...y,...g,ref:f,role:"progressbar","aria-valuemin":0,"aria-valuemax":o,"aria-valuenow":w,"aria-label":p??(u===void 0?C:void 0),"aria-labelledby":u??M,"data-monkeys-component":"progress","data-slot":"root","data-state":I,"data-value":w,"data-max":o,className:m(k.slots.progressRoot,d?.root,l),style:{...k.styles.progressRoot,...c},children:[T?jsxRuntime.jsxs("div",{"data-slot":"label-row","data-state":I,className:m(k.slots.progressLabelRow,d?.labelRow),children:[S?jsxRuntime.jsx("span",{id:M,"data-slot":"label",className:m(k.slots.progressLabel,d?.label),children:r}):jsxRuntime.jsx("span",{"data-slot":"label"}),n?jsxRuntime.jsx("span",{"data-slot":"value","data-value":w,className:m(k.slots.progressValue,d?.value),children:h}):null]}):null,jsxRuntime.jsx("div",{"data-slot":"track","data-state":I,className:m(k.slots.progressTrack,d?.track),children:jsxRuntime.jsx("div",{"data-slot":"indicator","data-state":I,"data-value":w,className:m(k.slots.progressIndicator,d?.indicator),style:{...k.styles.progressIndicator,width:`${v}%`}})})]})},"BaseProgress"));function jD(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(jD,"toDomId");var UD={sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-3 text-base"},KD={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"},qD={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"},tv=ho.forwardRef(a(function({options:t=[],value:o,defaultValue:r,name:n,form:i,orientation:s="vertical",required:l=false,invalid:d=false,disabled:c=false,controlSize:p,appearance:u,className:g,classNames:f,style:b,children:x,onChange:y,onValueChange:k,id:w,"aria-invalid":v,...h},S){for(let[B,L]of [["required",l],["invalid",d],["disabled",c]])if(typeof L!="boolean")throw new TypeError(`BaseRadioGroup ${B} must be a boolean.`);if(s!=="horizontal"&&s!=="vertical")throw new TypeError('BaseRadioGroup orientation must be "horizontal" or "vertical".');if(p!==void 0&&p!=="sm"&&p!=="md"&&p!=="lg")throw new TypeError('BaseRadioGroup controlSize must be "sm", "md", or "lg".');if(!Array.isArray(t))throw new TypeError("BaseRadioGroup options must be an array.");let T=new Set;t.forEach((B,L)=>{if(!B||typeof B!="object")throw new TypeError(`BaseRadioGroup option at index ${L} must be an object.`);if(typeof B.value!="string")throw new TypeError(`BaseRadioGroup option value at index ${L} must be a string.`);if(T.has(B.value)){let F=JSON.stringify(B.value);throw new TypeError(`BaseRadioGroup options must use unique values; duplicate value ${F} at index ${L}.`)}if(B.disabled!==void 0&&typeof B.disabled!="boolean")throw new TypeError(`BaseRadioGroup option disabled at index ${L} must be a boolean.`);T.add(B.value);});let C=Pe(u),R=ke(),M=Ne(C),I=ho.useId(),A=w??I,N=n??A,[D,E]=ho.useState(r),P=o!==void 0,W=P?o:D,H=a((B,L)=>{if(c||L)return;let F=B.currentTarget.value;P||E(F),y?.(B),k?.(F,B);},"handleSelect");return jsxRuntime.jsxs("div",{...R,...h,ref:S,id:w,role:"radiogroup","aria-orientation":s,"aria-required":l||void 0,"aria-invalid":v??(d||void 0),"aria-disabled":c||void 0,"data-monkeys-component":"radio-group","data-slot":"root","data-state":c?"disabled":"enabled","data-orientation":s,"data-size":p,"data-required":l||void 0,"data-invalid":d||void 0,"data-disabled":c||void 0,className:m(M.slots.radioGroupRoot,s==="horizontal"&&"flex flex-wrap items-center",f?.root,g),style:{...M.styles.radioGroup,...b},children:[t.map((B,L)=>{let F=c||B.disabled,_=B.value===W,$=_?"checked":"unchecked",G=`${A}-${L}-${jD(B.value)}`;return jsxRuntime.jsxs("label",{htmlFor:G,"data-slot":"option","data-state":$,"data-size":p,"data-invalid":d||void 0,"data-disabled":F||void 0,className:m(M.slots.radioOption,F&&M.slots.radioOptionDisabled,p&&UD[p],f?.option),style:M.styles.radioOption,children:[jsxRuntime.jsxs("span",{"data-slot":"marker","data-state":$,"data-size":p,"data-invalid":d||void 0,"data-disabled":F||void 0,className:m(M.slots.radioMarker,_&&M.slots.radioMarkerChecked,p&&KD[p],f?.marker),children:[jsxRuntime.jsx("input",{id:G,type:"radio",name:N,form:i,value:B.value,checked:_,required:l,disabled:F,"aria-invalid":v??(d||void 0),"data-slot":"input","data-state":$,"data-size":p,"data-invalid":d||void 0,"data-disabled":F||void 0,className:m(M.slots.radioInput,f?.input),onChange:z=>H(z,B.disabled)}),_?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator","data-state":$,"data-size":p,className:m(M.slots.radioIndicator,p&&qD[p],f?.indicator)}):null]}),V(B.icon)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m("mt-0.5 shrink-0",f?.icon),children:B.icon}):null,jsxRuntime.jsxs("span",{"data-slot":"content",className:m(M.slots.radioContent,f?.content),children:[jsxRuntime.jsx("span",{"data-slot":"label",className:m(M.slots.radioLabel,f?.label),children:B.label}),V(B.description)?jsxRuntime.jsx("span",{"data-slot":"description",className:m(M.slots.radioDescription,f?.description),children:B.description}):null]})]},B.value)}),x]})},"BaseRadioGroup"));function XD(e){if(e==="x")return {overflowX:"auto",overflowY:"hidden"};if(e==="y")return {overflowX:"hidden",overflowY:"auto"};if(e==="both")return {overflowX:"auto",overflowY:"auto"};throw new TypeError('BaseScrollArea axis must be "x", "y", or "both".')}a(XD,"resolveOverflow");var QD=ho.forwardRef(a(function({children:t,axis:o="y",maxWidth:r,maxHeight:n,appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u),b=XD(o),x=r===void 0?void 0:nr("BaseScrollArea","maxWidth",r),y=n===void 0?void 0:nr("BaseScrollArea","maxHeight",n);return jsxRuntime.jsx("div",{...g,...c,ref:p,"data-monkeys-component":"scroll-area","data-slot":"viewport","data-axis":o,className:m(f.slots.scrollAreaViewport,l?.viewport,s),style:{...f.styles.scrollArea,...b,maxWidth:x,maxHeight:y,...d},children:t})},"BaseScrollArea"));var lP=500;function dP({options:e,value:t,defaultValue:o,invalid:r,disabled:n,openForPreview:i,portal:s,required:l}){for(let[d,c]of [["invalid",r],["disabled",n],["openForPreview",i],["portal",s]])if(typeof c!="boolean")throw new TypeError(`BaseSelect ${d} must be a boolean.`);if(l!==void 0&&typeof l!="boolean")throw new TypeError("BaseSelect required must be a boolean.");if(e!==void 0&&!Array.isArray(e))throw new TypeError("BaseSelect options must be an array.");if(e?.forEach((d,c)=>{if(!d||typeof d!="object")throw new TypeError(`BaseSelect option at index ${c} must be an object.`);if(typeof d.value!="string")throw new TypeError(`BaseSelect option value at index ${c} must be a string.`);if(d.disabled!==void 0&&typeof d.disabled!="boolean")throw new TypeError(`BaseSelect option disabled at index ${c} must be a boolean.`);if(d.textValue!==void 0&&typeof d.textValue!="string")throw new TypeError(`BaseSelect option textValue at index ${c} must be a string.`)}),e?.length){if(t!==void 0&&typeof t!="string"&&typeof t!="number")throw new TypeError("BaseSelect value must be a string or number when options are used.");if(o!==void 0&&typeof o!="string"&&typeof o!="number")throw new TypeError("BaseSelect defaultValue must be a string or number when options are used.")}}a(dP,"validateSelectProps");function nf(e){return typeof e=="string"||typeof e=="number"?String(e):""}a(nf,"normalizeValue");function cP(e,t){if(t!==void 0)return e.find(o=>o.value===t)}a(cP,"findOption");function Gs(e,t){let o=e.findIndex(r=>r.value===t&&!r.disabled);return o>=0?o:e.findIndex(r=>!r.disabled)}a(Gs,"getInitialActiveIndex");function uP(e,t,o){if(!e.length)return -1;let r=t>=0?t:o===1?-1:0;for(let n=1;n<=e.length;n+=1){let i=(r+n*o+e.length)%e.length;if(!e[i]?.disabled)return i}return -1}a(uP,"getNextEnabledIndex");function pP(e,t){if(t==="first")return e.findIndex(o=>!o.disabled);for(let o=e.length-1;o>=0;o-=1)if(!e[o]?.disabled)return o;return -1}a(pP,"getBoundaryEnabledIndex");function ov(e){return e.textValue!==void 0?e.textValue:typeof e.label=="string"?e.label:e.value}a(ov,"getOptionText");function mP(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(mP,"toDomId");var Hc=ho.forwardRef(a(function({options:t,placeholder:o,icon:r,invalid:n=false,disabled:i=false,openForPreview:s=false,portal:l=false,appearance:d,className:c,classNames:p,style:u,children:g,value:f,defaultValue:b,onBlur:x,onChange:y,onFocus:k,onInvalid:w,name:v,id:h,required:S,"aria-invalid":T,"aria-label":C,"aria-labelledby":R,"aria-describedby":M,"aria-errormessage":I,"aria-required":A,...N},D){dP({options:t,value:f,defaultValue:b,invalid:n,disabled:i,openForPreview:s,portal:l,required:S});let E=Pe(d),P=ke(),W=Ne(E),H=Qn(),B=n||H.invalid,L=ho.useId(),F=h??L,_=`${F}-button`,$=`${F}-listbox`,G=ho.useRef(null),z=ho.useRef(null),re=ho.useRef(null),Z=ho.useRef([]),ae=ho.useRef(false),ee=ho.useRef(""),q=ho.useRef(null),U=t??[],X=U.length>0,O=s,[K,ne]=ho.useState(false),[fe,he]=ho.useState(false),me=O||K,ie=Cr({disabled:O||!l?true:void 0}),{refs:be,floatingStyles:He,isPositioned:We,placement:Ke}=react.useFloating({transform:false,open:X&&me&&ie.shouldPortal,placement:"bottom-start",strategy:"fixed",whileElementsMounted:ie.shouldPortal?react.autoUpdate:void 0,middleware:[react.offset(6),react.flip({padding:8}),react.shift({padding:8}),react.size({padding:8,apply({rects:Ce,availableHeight:Xe,elements:de}){Object.assign(de.floating.style,{width:`${Ce.reference.width}px`,maxHeight:`min(15rem, ${Math.max(0,Xe)}px)`});}})]}),ce=ho.useCallback(Ce=>{z.current=Ce,be.setReference(Ce);},[be.setReference]),[Q,ge]=ho.useState(()=>nf(b)),we=f!==void 0,Ie=we?nf(f):Q,oe=cP(U,Ie),[xe,Ve]=ho.useState(()=>Gs(U,Ie)),_e=xe>=0&&!U[xe]?.disabled?xe:Gs(U,Ie),Ge=U.map((Ce,Xe)=>`${F}-option-${Xe}-${mP(Ce.value)}`),le=oe?.label??o,Me=!oe,Ae=N.dir??P.dir,J=i?"disabled":B?"invalid":me?"open":"closed",$e=a(Ce=>{re.current=Ce,typeof D=="function"?D(Ce):D&&(D.current=Ce);},"setSelectRef"),ue=a(Ce=>{x?.(Ce),H.notifyBlur(Ce.currentTarget.value);},"handleNativeBlur"),Re=a(Ce=>{y?.(Ce),H.notifyChange(Ce.currentTarget.value);},"handleNativeChange"),se=a(()=>{Ve(Gs(U,Ie));},"resetActiveIndex"),te=a(()=>{se(),O||ne(false);},"cancelAndClose"),Te=a((Ce,Xe=false)=>{he(Xe),Ve(Ce??Gs(U,Ie)),O||ne(true);},"openMenu"),ze=a(Ce=>{let Xe=re.current;if(!Xe)return;let de=Xe.ownerDocument.defaultView;if(!de)throw new Error("BaseSelect cannot dispatch change without an owning window.");let Ee=Object.getOwnPropertyDescriptor(de.HTMLSelectElement.prototype,"value")?.set;if(!Ee)throw new Error("BaseSelect could not resolve the native select value setter.");Ee.call(Xe,Ce),Xe.dispatchEvent(new de.Event("change",{bubbles:true}));},"notifyChange"),je=a(Ce=>{let Xe=U[Ce];!Xe||Xe.disabled||i||(Ve(Ce),Xe.value!==Ie&&(we||ge(Xe.value),ze(Xe.value)),O||ne(false));},"commitIndex"),it=a(Ce=>{Ce<0||U[Ce]?.disabled||(Ve(Ce),me||Te(Ce));},"moveActive"),Y=a((Ce,Xe)=>{let de=Ce.currentTarget.ownerDocument.defaultView;if(!de)return;let Ee=`${ee.current}${Xe}`.toLocaleLowerCase();ee.current=Ee,q.current&&q.current.ownerWindow.clearTimeout(q.current.timerId),q.current={ownerWindow:de,timerId:de.setTimeout(()=>{ee.current="",q.current=null;},lP)};let Le=Array.from(Ee).every(Je=>Je===Ee[0])?Xe.toLocaleLowerCase():Ee,Se=me?_e:U.findIndex(Je=>Je.value===Ie&&!Je.disabled);for(let Je=1;Je<=U.length;Je+=1){let bt=(Se+Je+U.length)%U.length,xt=U[bt];if(!xt?.disabled&&ov(xt).trim().toLocaleLowerCase().startsWith(Le)){Ce.preventDefault(),it(bt);return}}},"handleTypeahead"),pe=a(Ce=>{if(!(i||ae.current||Ce.nativeEvent.isComposing)){if(Ce.key==="ArrowDown"||Ce.key==="ArrowUp"){Ce.preventDefault();let Xe=U.findIndex(Ee=>Ee.value===Ie&&!Ee.disabled);it(uP(U,me?_e:Xe,Ce.key==="ArrowDown"?1:-1));return}if(Ce.key==="Home"||Ce.key==="End"){Ce.preventDefault(),it(pP(U,Ce.key==="Home"?"first":"last"));return}if(Ce.key==="Enter"||Ce.key===" "){Ce.preventDefault(),me?je(_e):Te();return}if(Ce.key==="Escape"&&me){Ce.preventDefault(),te();return}if(Ce.key==="Tab"&&me){je(_e);return}Ce.key.length===1&&!Ce.ctrlKey&&!Ce.metaKey&&!Ce.altKey&&!/\s/.test(Ce.key)&&Y(Ce,Ce.key);}},"handleKeyDown"),Be=a(Ce=>{k?.(Ce),Ce.defaultPrevented||z.current?.focus();},"handleCustomFocus"),rt=a(Ce=>{w?.(Ce),Ce.preventDefault(),z.current?.focus();},"handleCustomInvalid");return ho.useEffect(()=>{if(!X||!me||O)return;let Ce=G.current?.ownerDocument;if(!Ce)return;let Xe=a(de=>{!G.current?.contains(de.target)&&!be.floating.current?.contains(de.target)&&te();},"handlePointerDown");return Ce.addEventListener("pointerdown",Xe),()=>{Ce.removeEventListener("pointerdown",Xe);}},[O,X,me,U,Ie]),ho.useEffect(()=>{!X||!me||_e<0||Z.current[_e]?.scrollIntoView?.({block:"nearest"});},[X,me,_e]),ho.useEffect(()=>{if(!X||we)return;let Ce=re.current,Xe=Ce?.form,de=Ce?.ownerDocument.defaultView;if(!Xe||!de)return;let Ee=a(()=>{de.setTimeout(()=>{let qe=nf(b);ge(qe),Ve(Gs(U,qe)),O||ne(false);},0);},"handleReset");return Xe.addEventListener("reset",Ee),()=>Xe.removeEventListener("reset",Ee)},[b,O,we,X,U]),ho.useEffect(()=>()=>{q.current&&q.current.ownerWindow.clearTimeout(q.current.timerId);},[]),X?jsxRuntime.jsxs("div",{...P,ref:G,dir:Ae,"data-monkeys-component":"select","data-slot":"root","data-state":J,"data-native":"false",className:m(W.slots.controlWrapper,"overflow-visible",me&&"z-50",B&&W.slots.controlInvalid,i&&W.slots.controlDisabled,p?.root,c),style:{...W.styles.control,...B?W.styles.controlInvalid:void 0,...i?W.styles.controlDisabled:void 0,...u},children:[V(r)?jsxRuntime.jsx("span",{className:m(W.slots.controlIcon,p?.icon),children:r}):null,jsxRuntime.jsx("button",{...P,ref:ce,type:"button",id:_,role:"combobox",disabled:i,dir:Ae,"aria-haspopup":"listbox","aria-expanded":me,"aria-controls":$,"aria-activedescendant":me&&_e>=0?Ge[_e]:void 0,"aria-autocomplete":"none","aria-invalid":T??(B||void 0),"aria-label":C,"aria-labelledby":R,"aria-describedby":M,"aria-errormessage":I,"aria-required":A??(S||void 0),"data-monkeys-component":"select","data-slot":"trigger","data-state":J,className:m(W.slots.controlBase,W.slots.controlSelect,"flex items-center text-left",p?.control),onClick:Ce=>{me?te():Te(void 0,Ce.detail>0);},onBlur:Ce=>{!G.current?.contains(Ce.relatedTarget)&&!be.floating.current?.contains(Ce.relatedTarget)&&(te(),H.notifyBlur(Ie));},onCompositionStart:()=>{ae.current=true;},onCompositionEnd:()=>{ae.current=false;},onKeyDown:pe,children:jsxRuntime.jsx("span",{className:m("min-w-0 flex-1 truncate",Me&&W.slots.selectPlaceholder,Me&&p?.placeholder),children:le})}),jsxRuntime.jsx("span",{className:m(W.slots.selectChevron,me&&"rotate-[225deg]")}),jsxRuntime.jsxs("select",{...P,...N,ref:$e,id:h,name:v,value:Ie,required:S,disabled:i,dir:Ae,"aria-hidden":"true",tabIndex:-1,"data-monkeys-component":"select","data-slot":"native","data-state":J,"data-native":"false",className:W.slots.selectNative,onBlur:x,onFocus:Be,onInvalid:rt,onChange:Re,children:[V(o)?jsxRuntime.jsx("option",{value:"",disabled:true,children:o}):null,U.map(Ce=>jsxRuntime.jsx("option",{value:Ce.value,disabled:Ce.disabled,children:ov(Ce)},Ce.value))]}),me?jy(jsxRuntime.jsx("div",{...P,ref:ie.shouldPortal?be.setFloating:void 0,id:$,role:"listbox",dir:Ae,"aria-labelledby":_,"data-monkeys-component":"select","data-slot":"menu","data-portal":ie.shouldPortal?"portaled":"inline","data-state":"open","data-side":ie.shouldPortal?Ke.split("-")[0]:"bottom",className:m(W.slots.selectMenu,ie.shouldPortal&&Ke.startsWith("top")?"origin-bottom":"origin-top",fe&&!O&&(!ie.shouldPortal||We)&&"motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-150 motion-safe:ease-out",p?.menu),style:{...W.styles.selectMenu,...ie.shouldPortal?{...He,right:"auto",visibility:We?"visible":"hidden"}:void 0},children:U.map((Ce,Xe)=>{let de=Ce.value===Ie,Ee=Xe===_e,qe=Ce.disabled?"disabled":Ee?"active":de?"selected":"idle";return ho.createElement("button",{...P,ref:Le=>{Z.current[Xe]=Le;},key:Ce.value,id:Ge[Xe],type:"button",role:"option",tabIndex:-1,disabled:Ce.disabled,dir:Ae,"aria-selected":de,"data-monkeys-component":"select","data-slot":"option","data-state":qe,"data-active":Ee||void 0,"data-selected":de||void 0,"data-disabled":Ce.disabled||void 0,className:m(W.slots.selectOption,Ee&&W.slots.selectOptionActive,de&&W.slots.selectOptionSelected,Ce.disabled&&W.slots.selectOptionDisabled,p?.option),style:{...W.styles.selectOption,...Ee?W.styles.selectOptionActive:void 0,...de?W.styles.selectOptionSelected:void 0},onMouseDown:Le=>Le.preventDefault(),onClick:()=>je(Xe)},jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:Ce.label}))})}),ie):null]}):jsxRuntime.jsxs("div",{...P,"data-monkeys-component":"select","data-slot":"root","data-state":J,"data-native":"true",className:m(W.slots.controlWrapper,B&&W.slots.controlInvalid,i&&W.slots.controlDisabled,p?.root,c),style:{...W.styles.control,...B?W.styles.controlInvalid:void 0,...i?W.styles.controlDisabled:void 0,...u},children:[V(r)?jsxRuntime.jsx("span",{className:m(W.slots.controlIcon,p?.icon),children:r}):null,jsxRuntime.jsxs("select",{...P,...N,id:h,ref:D,name:v,value:f,defaultValue:b,required:S,disabled:i,"aria-invalid":T??(B||void 0),"aria-label":C,"aria-labelledby":R,"aria-describedby":M,"aria-errormessage":I,"aria-required":A,"data-monkeys-component":"select","data-slot":"native","data-state":J,"data-native":"true",onBlur:ue,onFocus:k,onInvalid:w,onChange:Re,className:m(W.slots.controlBase,W.slots.controlSelect,p?.control),children:[V(o)?jsxRuntime.jsx("option",{value:"",disabled:true,children:o}):null,g]}),jsxRuntime.jsx("span",{className:W.slots.selectChevron})]})},"BaseSelect"));function nv({eyebrow:e,title:t,description:o,actions:r,children:n,appearance:i,className:s,classNames:l,style:d,...c}){let p=Ne(i),u=n??o;return jsxRuntime.jsxs("div",{...c,className:m(p.slots.sectionHeaderRoot,l?.root,s),style:{...p.styles.sectionHeader,...d},children:[jsxRuntime.jsxs("div",{className:m(p.slots.sectionHeaderContent,l?.content),children:[V(e)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderEyebrow,l?.eyebrow),children:e}):null,V(t)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderTitle,l?.title),children:t}):null,V(u)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderDescription,l?.description),children:u}):null]}),V(r)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderActions,l?.actions),children:r}):null]})}a(nv,"BaseSectionHeader");function gP(e,t){return t&&e?.some(o=>o.value===t)&&!e.find(r=>r.value===t)?.disabled?t:e?.find(o=>!o.disabled)?.value??e?.[0]?.value}a(gP,"getInitialSegmentValue");function sa({options:e=[],value:t,defaultValue:o,appearance:r,className:n,classNames:i,style:s,onValueChange:l,...d}){let c=Ne(r),[p,u]=ho.useState(()=>gP(e,o)),g=t!==void 0,f=g?t:p,b=a((y,k)=>{k||(g||u(y),l?.(y));},"handleSelect"),x=a(y=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(y.key))return;let k=e.filter(C=>!C.disabled);if(k.length===0)return;y.preventDefault();let w=Math.max(0,k.findIndex(C=>C.value===f)),v=y.key==="Home"?0:y.key==="End"?k.length-1:y.key==="ArrowLeft"||y.key==="ArrowUp"?(w-1+k.length)%k.length:(w+1)%k.length,h=k[v],S=y.currentTarget.querySelectorAll('[role="radio"]'),T=Array.from(S).find(C=>C.dataset.value===h.value);b(h.value),T?.focus();},"handleKeyDown");return jsxRuntime.jsx("div",{...d,role:"radiogroup","aria-orientation":"horizontal",className:m(c.slots.segmentedRoot,i?.root,n),style:{...c.styles.segmentedRoot,...s},onKeyDown:x,children:e.map(y=>{let k=y.value===f;return jsxRuntime.jsxs("button",{type:"button",role:"radio","data-value":y.value,"aria-checked":k,tabIndex:k?0:-1,disabled:y.disabled,className:m(c.slots.segmentedItem,k&&c.slots.segmentedItemActive,y.disabled&&c.slots.segmentedItemDisabled,i?.item),style:c.styles.segmentedItem,onClick:()=>b(y.value,y.disabled),children:[V(y.icon)?jsxRuntime.jsx("span",{className:m("inline-flex h-4 w-4 shrink-0",i?.icon),children:y.icon}):null,jsxRuntime.jsx("span",{className:m("min-w-0 truncate",i?.label),children:y.label})]},y.value)})})}a(sa,"BaseSegmentedControl");var xP=ho.forwardRef(a(function({decorative:t=false,label:o,appearance:r,className:n,classNames:i,style:s,...l},d){let c=Ye(),p=Pe(r),u=ke(),g=Ne(p);if(typeof t!="boolean")throw new TypeError("BaseSpinner decorative must be a boolean.");if(t&&o!==void 0)throw new TypeError("BaseSpinner label cannot be provided when decorative is true.");let f=t?void 0:o??c.loading.spinner;if(!t&&(typeof f!="string"||!f.trim()))throw new TypeError("BaseSpinner label must be a non-empty string.");return jsxRuntime.jsx("span",{...u,...l,ref:d,role:t?void 0:"status","aria-label":f,"aria-hidden":t?"true":void 0,"data-monkeys-component":"spinner","data-slot":"root","data-decorative":t||void 0,className:m(g.slots.spinnerRoot,i?.root,n),style:{...g.styles.spinner,...s},children:jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator",className:m(g.slots.spinnerIndicator,i?.indicator),style:g.styles.spinnerIndicator})})},"BaseSpinner"));var wP=ho.forwardRef(a(function({children:t,gap:o,align:r="stretch",justify:n="start",appearance:i,className:s,classNames:l,style:d,...c},p){let u=Go(),g=Pe(i),f=ke(),b=Ne(g),x=o===void 0?void 0:nr("BaseStack","gap",o);return jsxRuntime.jsx("div",{...f,...c,ref:p,"data-monkeys-component":"stack","data-slot":"root","data-align":r,"data-justify":n,className:m(b.slots.stackRoot,u>0&&o===void 0&&"gap-[var(--monkeys-bento-gap)]",g?.slots?.stackRoot,l?.root,s),style:{...b.styles.stack,gap:x??b.styles.stack?.gap,alignItems:hi("BaseStack",r),justifyContent:yi("BaseStack",n),...d},children:t})},"BaseStack"));var TP=new Set(["pending","current","completed","error"]),iv=["current","completed","error","disabled"],sv=/[\s\u0000-\u001f\u007f]/u;function lv(e){if(!e||typeof e!="object"||Array.isArray(e))return false;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}a(lv,"isPlainRecord");function dv(e){return V(e)?typeof e=="string"?!!e.trim():Array.isArray(e)?e.some(dv):true:false}a(dv,"hasStepLabel");function NP(e){try{return encodeURIComponent(e)}catch{throw new TypeError(`BaseSteps item id ${JSON.stringify(e)} must contain valid Unicode.`)}}a(NP,"encodeStepId");function RP(e){if(!Array.isArray(e))throw new TypeError("BaseSteps items must be an array.");let t=new Set,o=0,r=e.map((n,i)=>{if(!lv(n))throw new TypeError(`BaseSteps item at index ${i} must be an object.`);let s=n;if(typeof s.id!="string"||!s.id||sv.test(s.id))throw new TypeError(`BaseSteps item at index ${i} must have a non-empty id without whitespace or control characters.`);if(t.has(s.id))throw new TypeError(`BaseSteps item id ${JSON.stringify(s.id)} is duplicated.`);if(t.add(s.id),!dv(s.label))throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} label must contain renderable content.`);let l=s.status??"pending";if(!TP.has(l))throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} status must be one of: pending, current, completed, error.`);if(l==="current"&&(o+=1),s.disabled!==void 0&&typeof s.disabled!="boolean")throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} disabled must be a boolean.`);if(s.selectable!==void 0&&typeof s.selectable!="boolean")throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} selectable must be a boolean.`);return {item:s,encodedId:NP(s.id),status:l}});if(o>1)throw new RangeError("BaseSteps items may contain at most one current step.");return r}a(RP,"validateItems");function MP(e,t){if(t!==void 0&&!lv(t))throw new TypeError("BaseSteps statusLabels must be an object.");let o=t;for(let n of Object.keys(o??{}))if(!iv.includes(n))throw new TypeError(`BaseSteps statusLabels.${n} is not a supported status label.`);let r={current:o?.current??e.current,completed:o?.completed??e.completed,error:o?.error??e.error,disabled:o?.disabled??e.disabled};for(let n of iv){let i=r[n];if(typeof i!="string"||!i.trim())throw new TypeError(`BaseSteps statusLabels.${n} must be a non-empty string.`)}return r}a(MP,"resolveStatusLabels");function IP(e,t){if(e!==void 0&&(typeof e!="string"||!e.trim()))throw new TypeError("BaseSteps aria-label must be a non-empty string when provided.");if(t===void 0)return;if(typeof t!="string"||!t.trim())throw new TypeError("BaseSteps aria-labelledby must contain at least one valid ID token.");if(t.trim().split(/\s+/).some(r=>sv.test(r)))throw new TypeError("BaseSteps aria-labelledby must contain only valid ID tokens.")}a(IP,"validateAccessibleName");function DP(e,t){return e==="completed"?"\u2713":e==="error"?"!":t+1}a(DP,"getIndicator");function PP(e,t){return m(e==="pending"&&t.stepsIndicatorPending,e==="current"&&t.stepsIndicatorCurrent,e==="completed"&&t.stepsIndicatorCompleted,e==="error"&&t.stepsIndicatorError)}a(PP,"getIndicatorClassName");var EP=ho.forwardRef(a(function({items:t,orientation:o="horizontal",statusLabels:r,appearance:n,className:i,classNames:s,style:l,onStepSelect:d,"aria-label":c,"aria-labelledby":p,...u},g){let f=ho.useId(),b=Ye().steps,x=Pe(n),y=ke(),k=Ne(x);if(o!=="horizontal"&&o!=="vertical")throw new TypeError('BaseSteps orientation must be "horizontal" or "vertical".');if(d!==void 0&&typeof d!="function")throw new TypeError("BaseSteps onStepSelect must be a function.");if(typeof b.label!="string"||!b.label.trim())throw new TypeError("BaseSteps locale label must be a non-empty string.");IP(c,p);let w=RP(t),v=MP(b,r);return jsxRuntime.jsx("ol",{...y,...u,ref:g,role:"list","aria-label":c??(p===void 0?b.label:void 0),"aria-labelledby":p,"data-monkeys-component":"steps","data-slot":"root","data-orientation":o,className:m(k.slots.stepsRoot,o==="horizontal"?k.slots.stepsHorizontal:k.slots.stepsVertical,s?.root,i),style:{...k.styles.steps,...l},children:w.map(({item:h,encodedId:S,status:T},C)=>{let R=`${f}-step-${S}`,M=`${R}-label`,I=`${R}-description`,A=`${R}-status`,N=V(h.description),D=T==="pending"?void 0:v[T],E=!!(D||h.disabled),P=d!==void 0&&h.selectable!==false,W=[N?I:void 0,E?A:void 0].filter(Boolean).join(" ")||void 0,H=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator",className:m(k.slots.stepsIndicator,PP(T,k.slots),s?.indicator),style:k.styles.stepsIndicator,children:DP(T,C)}),jsxRuntime.jsxs("span",{"data-slot":"content",className:m(k.slots.stepsContent,s?.content),children:[jsxRuntime.jsx("span",{id:M,"data-slot":"label",className:m(k.slots.stepsLabel,s?.label),children:h.label}),N?jsxRuntime.jsx("span",{id:I,"data-slot":"description",className:m(k.slots.stepsDescription,s?.description),children:h.description}):null,E?jsxRuntime.jsxs("span",{id:A,"data-slot":"status",className:m(k.slots.stepsStatus,s?.status),children:[D,D&&h.disabled?". ":null,h.disabled?v.disabled:null]}):null]})]});return jsxRuntime.jsxs("li",{id:R,"aria-current":T==="current"?"step":void 0,"aria-disabled":h.disabled||void 0,"data-step-id":h.id,"data-status":T,"data-disabled":h.disabled||void 0,"data-selectable":P||void 0,className:m(k.slots.stepsItem,o==="horizontal"?k.slots.stepsItemHorizontal:k.slots.stepsItemVertical,s?.item),style:k.styles.stepsItem,children:[P?jsxRuntime.jsx("button",{type:"button",disabled:h.disabled,"aria-labelledby":M,"aria-describedby":W,"data-slot":"trigger",className:m(k.slots.stepsTrigger,k.slots.stepsTriggerInteractive,h.disabled&&k.slots.stepsTriggerDisabled,s?.trigger),style:k.styles.stepsTrigger,onClick:()=>{h.disabled||d(h.id,h,C);},children:H}):jsxRuntime.jsx("div",{"data-slot":"trigger",className:m(k.slots.stepsTrigger,h.disabled&&k.slots.stepsTriggerDisabled,s?.trigger),style:k.styles.stepsTrigger,children:H}),C<w.length-1?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"connector",className:m(k.slots.stepsConnector,o==="horizontal"?k.slots.stepsConnectorHorizontal:k.slots.stepsConnectorVertical,T==="completed"&&k.slots.stepsConnectorCompleted,T==="error"&&k.slots.stepsConnectorError,s?.connector),style:k.styles.stepsConnector}):null]},h.id)})})},"BaseSteps"));var WP={sm:"h-5 w-9",md:"h-6 w-10",lg:"h-7 w-12"},zP={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"},OP={sm:"translate-x-[18px]",md:"translate-x-5",lg:"translate-x-6"},FP={compact:"sm",default:"md",comfortable:"lg"},cv=ho.forwardRef(a(function({label:t,description:o,disabled:r=false,controlSize:n,appearance:i,className:s,classNames:l,style:d,checked:c,defaultChecked:p,onChange:u,...g},f){if(typeof r!="boolean")throw new TypeError("BaseSwitch disabled must be a boolean.");if(n!==void 0&&n!=="sm"&&n!=="md"&&n!=="lg")throw new TypeError('BaseSwitch controlSize must be "sm", "md", or "lg".');let b=Pe(i),x=ke(),y=Ne(b),k=V(t),w=Md(o),[v,h]=ho.useState(p??false),S=c!==void 0,T=S?c:v,C=T?"checked":"unchecked",R=n??FP[y.density],M=a(I=>{r||(S||h(I.currentTarget.checked),u?.(I));},"handleChange");return jsxRuntime.jsxs("label",{...x,"data-monkeys-component":"switch","data-slot":"root","data-state":C,"data-size":n,"data-disabled":r||void 0,className:m(y.slots.switchRoot,!w&&"items-center",r&&y.slots.switchDisabled,l?.root,s),style:{...y.styles.switchRoot,...d},children:[jsxRuntime.jsxs("span",{"data-slot":"track","data-state":C,"data-size":n,className:m(y.slots.switchTrack,!w&&"mt-0",T&&y.slots.switchChecked,n&&WP[n],l?.track),style:y.styles.switchTrack,children:[jsxRuntime.jsx("input",{...g,ref:f,type:"checkbox",role:"switch",disabled:r,checked:c,defaultChecked:p,"aria-checked":T,"data-slot":"input","data-state":C,"data-size":n,"data-disabled":r||void 0,onChange:M,className:m(y.slots.switchInput,l?.input)}),jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"thumb","data-state":C,"data-size":n,className:m(y.slots.switchThumb,n&&zP[n],T&&OP[R],l?.thumb),style:y.styles.switchThumb})]}),k||w?jsxRuntime.jsxs("span",{"data-slot":"content",className:m(y.slots.switchContent,l?.content),children:[k?jsxRuntime.jsx("span",{"data-slot":"label",className:m(y.slots.switchLabel,l?.label),children:t}):null,w?jsxRuntime.jsx("span",{"data-slot":"description",className:m(y.slots.switchDescription,l?.description),children:o}):null]}):null]})},"BaseSwitch"));function VP({kind:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",children:{error:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9"}),jsxRuntime.jsx("path",{d:"M12 7v6"}),jsxRuntime.jsx("path",{d:"M12 17h.01"})]}),permission:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"}),jsxRuntime.jsx("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"})]}),offline:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 12.5a10 10 0 0 1 14 0"}),jsxRuntime.jsx("path",{d:"M8.5 16a5 5 0 0 1 7 0"}),jsxRuntime.jsx("path",{d:"M12 20h.01"}),jsxRuntime.jsx("path",{d:"m4 4 16 16"})]}),fallback:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9"}),jsxRuntime.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 4.2 1.8c-1 .8-1.7 1.2-1.7 2.7"}),jsxRuntime.jsx("path",{d:"M12 17h.01"})]})}[e]})}a(VP,"SystemStateIcon");var Fa=ho.forwardRef(a(function({kind:t="fallback",icon:o,title:r,description:n,actions:i,appearance:s,className:l,classNames:d,style:c,role:p,"aria-live":u,...g},f){let b=Pe(s),x=ke(),y=Or(),k=y.density==="compact"?"min-h-0 px-3 py-3":y.density==="comfortable"?"min-h-56 px-8 py-12":void 0,w=Ne(b),v=o===void 0?jsxRuntime.jsx(VP,{kind:t}):o,h=p??(t==="error"||t==="offline"?"alert":"status");return jsxRuntime.jsxs("div",{...x,...g,ref:f,role:h,"aria-live":u??(h==="alert"?"assertive":"polite"),"data-monkeys-component":"system-state","data-slot":"root","data-state":t,"data-density":y.density,className:m(w.slots.stateRoot,k,d?.root,l),style:{...w.styles.stateRoot,...c},children:[V(v)?jsxRuntime.jsx("div",{"data-slot":"icon","data-state":t,className:m(w.slots.stateIcon,d?.icon),style:w.styles.stateIcon,children:v}):null,V(r)?jsxRuntime.jsx("div",{"data-slot":"title","data-state":t,className:m(w.slots.stateTitle,d?.title),children:r}):null,V(n)?jsxRuntime.jsx("div",{"data-slot":"description","data-state":t,className:m(w.slots.stateDescription,d?.description),children:n}):null,V(i)?jsxRuntime.jsx("div",{"data-slot":"actions","data-state":t,className:m(w.slots.stateActions,d?.actions),children:i}):null]})},"BaseSystemState"));var lf="application/x-monkeys-base-table-column",jc=8;function pf(e,t){typeof e=="function"?e(t):e&&(e.current=t);}a(pf,"assignRef");function qr(e,t){if(t!==void 0&&typeof t!="boolean")throw new Error(`BaseTable ${e} must be a boolean.`)}a(qr,"assertBoolean");function Bi(e,t,o){if(t!==void 0&&!o.includes(t))throw new Error(`BaseTable ${e} must be one of ${o.map(r=>`"${r}"`).join(", ")}.`)}a(Bi,"assertEnum");function Kc(e,t){if(t!==void 0&&(typeof t!="string"||t.trim().length===0))throw new Error(`BaseTable ${e} must be a non-empty string when provided.`)}a(Kc,"assertOptionalLabel");function uf(e,t){if(t!==void 0&&typeof t!="function")throw new Error(`BaseTable ${e} must be a function when provided.`)}a(uf,"assertOptionalFunction");function yn(e,t,o={}){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable ${t} must be a finite non-negative number${o.stringAllowed?" or a non-empty CSS size string":""}.`);return}if(!(o.stringAllowed&&typeof e=="string"&&e.trim().length>0))throw new Error(`BaseTable ${t} must be ${o.stringAllowed?"a finite non-negative number or a non-empty CSS size string":"a finite non-negative number"}.`)}}a(yn,"validateCssSizeValue");function UP(e){if(e===void 0)return;if(!Array.isArray(e))throw new Error("BaseTable columns must be an array when provided.");let t=new Set;return e.forEach((o,r)=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error(`BaseTable column at index ${r} must be an object.`);let n=o;if(typeof n.id!="string"||n.id.trim().length===0)throw new Error(`BaseTable column id at index ${r} must be a non-empty string.`);let i=n.id.trim();if(n.id!==i)throw new Error(`BaseTable column id "${n.id}" must not contain surrounding whitespace.`);if(t.has(i))throw new Error(`BaseTable columns contain duplicate id "${i}".`);if(t.add(i),yn(n.width,`column "${i}" width`,{stringAllowed:true}),yn(n.minWidth,`column "${i}" minWidth`,{stringAllowed:true}),yn(n.maxWidth,`column "${i}" maxWidth`,{stringAllowed:true}),typeof n.minWidth=="number"&&typeof n.maxWidth=="number"&&n.minWidth>n.maxWidth)throw new Error(`BaseTable column "${i}" minWidth cannot be greater than maxWidth.`)}),t}a(UP,"validateColumns");function KP(e,t){if(e===void 0)return;if(!Array.isArray(e))throw new Error("BaseTable columnOrder must be an array when provided.");let o=new Set;if(e.forEach((r,n)=>{if(typeof r!="string"||r.trim().length===0)throw new Error(`BaseTable columnOrder entry at index ${n} must be a non-empty string.`);let i=r.trim();if(r!==i)throw new Error(`BaseTable columnOrder entry "${r}" must not contain surrounding whitespace.`);if(o.has(i))throw new Error(`BaseTable columnOrder contains duplicate id "${i}".`);if(t&&!t.has(i))throw new Error(`BaseTable columnOrder contains unknown column id "${i}".`);o.add(i);}),t&&o.size!==t.size){let r=[...t].filter(n=>!o.has(n));throw new Error(`BaseTable columnOrder must contain every configured column id; missing ${r.map(n=>`"${n}"`).join(", ")}.`)}}a(KP,"validateColumnOrder");function qP(e,t){if(e!==void 0){if(!e||typeof e!="object"||Array.isArray(e)||![Object.prototype,null].includes(Object.getPrototypeOf(e)))throw new Error("BaseTable columnSizes must be a plain record when provided.");Object.entries(e).forEach(([o,r])=>{let n=o.trim();if(n.length===0)throw new Error("BaseTable columnSizes keys must be non-empty strings.");if(o!==n)throw new Error(`BaseTable columnSizes key "${o}" must not contain surrounding whitespace.`);if(t&&!t.has(n))throw new Error(`BaseTable columnSizes contains unknown column id "${o}".`);yn(r,`columnSizes["${o}"]`);});}}a(qP,"validateColumnSizes");function Uc(e){let t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).direction==="rtl":e.closest('[dir="rtl"]')!==null}a(Uc,"isRtl");function YP(e,t){if(e.setPointerCapture)try{e.setPointerCapture(t);}catch(o){let r=e.ownerDocument.defaultView?.DOMException;if(r&&o instanceof r&&o.name==="NotFoundError")return;throw o}}a(YP,"setPointerCaptureIfAvailable");var fv=ho.createContext(null);function xn(e){let t=ho.useContext(fv),o=Pe(e);if(t){let n=e===void 0?t.appearance:o;return {...t,theme:e===void 0?t.theme:Ne(n),appearance:n}}let r=Ne(o);return {appearance:o,theme:r,layout:"native",setDraggingColumnId:a(()=>{},"setDraggingColumnId")}}a(xn,"useBaseTableContext");function bv(e){let t=false;return ho.Children.forEach(e,o=>{if(t||!ho.isValidElement(o))return;let r=o.props;if(r.layout==="split-scroll"){t=true;return}r.children&&(t=bv(r.children));}),t}a(bv,"hasSplitScrollTable");function qc(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(qc,"toCssSize");function XP(e,t){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable ${t} must be a finite non-negative number when numeric.`);return `${e}px`}if(e.trim().length===0)throw new Error(`BaseTable ${t} must not be an empty CSS size.`);return e}}a(XP,"validateTableCssSize");function df(e,t,o){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable split-scroll column "${t}" has invalid ${o}. Expected a finite non-negative number.`);return `${e}px`}if(e.trim().length===0)throw new Error(`BaseTable split-scroll column "${t}" has an empty ${o} value.`);return e}}a(df,"validateCssSize");function pv(e,t,o){if(!(e===void 0||typeof e!="number")){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable split-scroll column "${t}" has invalid ${o}. Expected a finite non-negative number.`);return e}}a(pv,"validateNumericSize");function QP(e,t){if(!e?.length)throw new Error('BaseTable layout="split-scroll" requires at least one column definition.');let o=new Set;return `${e.map((n,i)=>{let s=n.id.trim();if(!s)throw new Error(`BaseTable split-scroll column at index ${i} requires a non-empty id.`);if(o.has(s))throw new Error(`BaseTable layout="split-scroll" received duplicate column id "${s}".`);o.add(s);let l=t?.[s],d=pv(n.minWidth,s,"minWidth"),c=pv(n.maxWidth,s,"maxWidth");if(d!==void 0&&c!==void 0&&c<d)throw new Error(`BaseTable split-scroll column "${s}" has maxWidth smaller than minWidth.`);let p=df(n.minWidth,s,"minWidth"),u=df(n.maxWidth,s,"maxWidth"),g=l!==void 0?la(l,d,c):n.width,f=df(g,s,"width");return f||`minmax(${p??"0px"}, ${u??"1fr"})`}).join(" ")} var(--base-table-split-scrollbar-gutter)`}a(QP,"buildSplitColumnTemplate");function la(e,t,o){let r=t??48,n=o??Number.POSITIVE_INFINITY;return Math.min(Math.max(e,r),n)}a(la,"clampWidth");function cf(e,t,o){if(!e||t===o)return;let r=e.indexOf(t),n=e.indexOf(o);if(r<0||n<0)return;let i=[...e],[s]=i.splice(r,1);return i.splice(n,0,s),i}a(cf,"getNextColumnOrder");function ZP(e){switch(e){case "asc":return "ascending";case "desc":return "descending";default:return}}a(ZP,"sortAriaValue");function JP(e){switch(e){case "center":return "center";case "right":return "flex-end";default:return "flex-start"}}a(JP,"getSplitHeadJustifyContent");function eE(e){switch(e){case "top":return "flex-start";case "bottom":return "flex-end";default:return "center"}}a(eE,"getSplitHeadAlignItems");function tE({direction:e,className:t}){return jsxRuntime.jsx("span",{"aria-hidden":"true",className:m(t,e==="desc"&&"rotate-180",(!e||e==="none")&&"opacity-45"),children:"\u25B2"})}a(tE,"SortIndicator");function oE(){return jsxRuntime.jsxs("span",{"aria-hidden":"true",className:"grid gap-0.5",children:[jsxRuntime.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-current"}),jsxRuntime.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-current"}),jsxRuntime.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-current"})]})}a(oE,"DragHandleIcon");var Li=ho.forwardRef(a(function({appearance:t,attachedFooter:o=false,children:r,className:n,classNames:i,style:s,...l},d){qr("attachedFooter",o);let c=Pe(t),p=ke(),u=Ne(c),f=bv(r)?{overflow:"hidden",scrollbarGutter:"auto"}:void 0;return jsxRuntime.jsx("div",{...p,...l,ref:d,"data-monkeys-component":"table-container","data-slot":"container","data-base-table-container":"","data-attached-footer":o?"":void 0,className:m(u.slots.tableContainer,o&&u.slots.tableContainerFooterAttached,i?.root,n),style:{...u.styles.tableContainer,...o?u.styles.tableContainerFooterAttached:void 0,...f,...s},children:r})},"BaseTableContainer")),Wi=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,layout:i="native",columns:s,bodyMaxHeight:l,bodyClassName:d,columnOrder:c,columnSizes:p,columnDragEnabled:u=false,columnResizeEnabled:g=false,onColumnOrderChange:f,onColumnSizeChange:b,...x},y){Bi("layout",i,["native","split-scroll"]),qr("columnDragEnabled",u),qr("columnResizeEnabled",g),uf("onColumnOrderChange",f),uf("onColumnSizeChange",b),yn(l,"bodyMaxHeight",{stringAllowed:true});let k=UP(s);KP(c,k),qP(p,k);let w=Pe(t),v=ke(),h=Ne(w),[S,T]=ho.useState(),C=ho.useRef(null),R=ho.useRef(null),M=i==="split-scroll",I=M?QP(s,p):void 0,A={appearance:w,theme:h,layout:i,columnTemplate:I,bodyMaxHeight:l,bodyClassName:d,splitHeaderRef:C,splitFooterRef:R,columnOrder:c,columnSizes:p,columnDragEnabled:u,columnResizeEnabled:g,onColumnOrderChange:f,onColumnSizeChange:b,draggingColumnId:S,setDraggingColumnId:T};return jsxRuntime.jsx(fv.Provider,{value:A,children:jsxRuntime.jsx("table",{...v,...x,ref:y,"data-monkeys-component":"table","data-slot":"root","data-base-table-layout":i,className:m(h.slots.tableRoot,M&&h.slots.tableSplitRoot,r?.root,o),style:{...h.styles.table,...M?h.styles.tableSplitRoot:void 0,...I?{"--base-table-column-template":I}:void 0,...n}})})},"BaseTable")),zi=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,...i},s){let{layout:l,splitHeaderRef:d,theme:c}=xn(t),p=l==="split-scroll";return jsxRuntime.jsx("thead",{...i,ref:a(g=>{d&&(d.current=p?g:null),pf(s,g);},"setHeaderRef"),"data-slot":"header",className:m(c.slots.tableHeader,p&&c.slots.tableSplitHeader,r?.root,o),style:{...c.styles.tableHeader,...p?c.styles.tableSplitHeader:void 0,...n}})},"BaseTableHeader")),Oi=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,onScroll:n,style:i,...s},l){let{bodyClassName:d,bodyMaxHeight:c,layout:p,splitFooterRef:u,splitHeaderRef:g,theme:f}=xn(t),b=p==="split-scroll";return jsxRuntime.jsx("tbody",{...s,ref:l,"data-slot":"body",onScroll:b?y=>{let k=y.currentTarget.scrollLeft;g?.current&&(g.current.scrollLeft=k),u?.current&&(u.current.scrollLeft=k),n?.(y);}:n,className:m(f.slots.tableBody,b&&f.slots.tableSplitBody,b&&d,r?.root,o),style:{...f.styles.tableBody,...b?f.styles.tableSplitBody:void 0,...b&&c!==void 0?{maxHeight:XP(c,"bodyMaxHeight")}:void 0,...i}})},"BaseTableBody")),gv=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,...i},s){let{layout:l,splitFooterRef:d,theme:c}=xn(t),p=l==="split-scroll";return jsxRuntime.jsx("tfoot",{...i,ref:a(g=>{d&&(d.current=p?g:null),pf(s,g);},"setFooterRef"),"data-slot":"footer",className:m(c.slots.tableFooter,p&&c.slots.tableSplitFooter,r?.root,o),style:{...c.styles.tableFooter,...p?c.styles.tableSplitFooter:void 0,...n}})},"BaseTableFooter")),vn=ho.forwardRef(a(function({interactive:t,selected:o,disabled:r,appearance:n,className:i,classNames:s,style:l,...d},c){qr("interactive",t),qr("selected",o),qr("disabled",r);let{layout:p,theme:u}=xn(n),g=p==="split-scroll";return jsxRuntime.jsx("tr",{...d,ref:c,"data-slot":"row","aria-disabled":r||void 0,"data-state":o?"selected":void 0,className:m(u.slots.tableRow,g&&u.slots.tableSplitRow,t&&!r&&u.slots.tableRowInteractive,o&&u.slots.tableRowSelected,r&&u.slots.tableRowDisabled,s?.root,i),style:{...u.styles.tableRow,...g?u.styles.tableSplitRow:void 0,...l}})},"BaseTableRow")),Fi=ho.forwardRef(a(function({presentation:t,columnId:o,align:r,verticalAlign:n,icon:i,label:s,description:l,meta:d,actions:c,trailing:p,sortable:u,sortDirection:g="none",sortLabel:f,onSort:b,draggable:x,dragLabel:y,resizable:k,resizeLabel:w,width:v,minWidth:h,maxWidth:S,appearance:T,className:C,classNames:R,style:M,children:I,onDragOver:A,onDrop:N,...D},E){if(Bi("head presentation",t,["classic-data-grid"]),Bi("head align",r,["left","center","right"]),Bi("head verticalAlign",n,["top","middle","bottom"]),Bi("head sortDirection",g,["asc","desc","none"]),qr("head sortable",u),qr("head draggable",x),qr("head resizable",k),uf("head onSort",b),Kc("head sortLabel",f),Kc("head dragLabel",y),Kc("head resizeLabel",w),o!==void 0&&(typeof o!="string"||o.trim().length===0))throw new Error("BaseTable head columnId must be a non-empty string when provided.");if(yn(v,"head width",{stringAllowed:true}),yn(h,"head minWidth"),yn(S,"head maxWidth"),h!==void 0&&S!==void 0&&h>S)throw new Error("BaseTable head minWidth cannot be greater than maxWidth.");let P=xn(T),{theme:W}=P,H=Ye().table,B=P.layout==="split-scroll",L=t==="classic-data-grid",F=r??(B?"center":"left"),_=n??"middle",$=ho.useRef(null),G=ho.useRef(()=>{}),[z,re]=ho.useState(),Z=a(ce=>{$.current=ce,pf(E,ce);},"setHeadRef"),ae=o&&P.columnSizes?.[o]!==void 0?P.columnSizes[o]:v,ee=!!(o&&x!==false&&(x||P.columnDragEnabled)&&P.columnOrder&&P.onColumnOrderChange),q=!!(o&&k!==false&&(k||P.columnResizeEnabled)&&P.onColumnSizeChange);if(q&&S!==void 0&&S<(h??48))throw new Error("BaseTable resizable head maxWidth cannot be smaller than its effective minWidth.");let U=!!(u||b),X=ZP(g),O=V(s)?s:I,K=V(O)||V(l),ne=f??(K?void 0:H.sortColumn({columnId:o?.trim()||void 0})),fe=ee||V(i)||V(s)||V(l)||V(d)||V(c)||V(p)||U,he=L?jsxRuntime.jsx("div",{className:m("flex h-full min-w-0 select-none items-center",F==="center"?"justify-center":F==="right"?"justify-end":"justify-start",ee&&"cursor-grab active:cursor-grabbing"),...ee?{draggable:true,role:"button",tabIndex:0,"aria-disabled":false,"aria-roledescription":"sortable",onKeyDown:a(ce=>{if(!o||!P.columnOrder||ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;let Q=P.columnOrder.indexOf(o);if(Q<0)return;let ge=Uc(ce.currentTarget),we=ce.key==="ArrowLeft"?-1:1,Ie=Q+(ge?-we:we),oe=P.columnOrder[Ie];if(!oe)return;let xe=cf(P.columnOrder,o,oe);xe&&(ce.preventDefault(),P.onColumnOrderChange?.(xe,{columnId:o,targetColumnId:oe}));},"onKeyDown"),onDragStart:a(ce=>{ce.stopPropagation(),P.setDraggingColumnId(o),ce.dataTransfer.effectAllowed="move",ce.dataTransfer.setData(lf,o);},"onDragStart"),onDragEnd:a(ce=>{ce.stopPropagation(),P.setDraggingColumnId(void 0);},"onDragEnd")}:{},children:O}):fe?jsxRuntime.jsxs("div",{className:m(W.slots.tableHeadContent,R?.content),children:[jsxRuntime.jsxs("div",{className:m(W.slots.tableHeadMain,R?.main),children:[ee?jsxRuntime.jsx("button",{type:"button",draggable:true,title:y,"aria-label":y??H.dragColumn({columnId:o}),className:m(W.slots.tableHeadDragHandle,R?.dragHandle),onClick:ce=>ce.stopPropagation(),onKeyDown:ce=>{if(!o||!P.columnOrder||ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;let Q=P.columnOrder.indexOf(o);if(Q<0)return;let ge=Uc(ce.currentTarget),we=ce.key==="ArrowLeft"?-1:1,Ie=Q+(ge?-we:we),oe=P.columnOrder[Ie];if(!oe)return;let xe=cf(P.columnOrder,o,oe);xe&&(ce.preventDefault(),P.onColumnOrderChange?.(xe,{columnId:o,targetColumnId:oe}));},onDragStart:ce=>{ce.stopPropagation(),P.setDraggingColumnId(o),ce.dataTransfer.effectAllowed="move",ce.dataTransfer.setData(lf,o);},onDragEnd:ce=>{ce.stopPropagation(),P.setDraggingColumnId(void 0);},children:jsxRuntime.jsx(oE,{})}):null,i?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadIcon,R?.icon),children:i}):null,U?jsxRuntime.jsxs("button",{type:"button",disabled:!b,title:f,"aria-label":ne,className:m(W.slots.tableHeadSortButton,R?.sortButton),onClick:ce=>{ce.stopPropagation(),b?.(o);},children:[jsxRuntime.jsxs("span",{className:m(W.slots.tableHeadText,R?.text),children:[V(O)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadLabel,R?.label),children:O}):null,V(l)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadDescription,R?.description),children:l}):null]}),jsxRuntime.jsx(tE,{direction:g,className:m(W.slots.tableHeadSortIcon,R?.sortIcon)})]}):jsxRuntime.jsxs("span",{className:m(W.slots.tableHeadText,R?.text),children:[V(O)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadLabel,R?.label),children:O}):null,V(l)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadDescription,R?.description),children:l}):null]})]}),V(d)||V(c)||V(p)?jsxRuntime.jsxs("div",{className:m(W.slots.tableHeadActions,R?.actions),children:[V(d)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadMeta,R?.meta),children:d}):null,c,p]}):null]}):I,me=a(ce=>{A?.(ce),!(!ee||!P.draggingColumnId||P.draggingColumnId===o)&&(ce.preventDefault(),ce.dataTransfer.dropEffect="move");},"handleDragOver"),ie=a(ce=>{if(N?.(ce),!ee||!o)return;let Q=P.draggingColumnId||ce.dataTransfer.getData(lf);if(!Q||Q===o)return;let ge=cf(P.columnOrder,Q,o);ge&&(ce.preventDefault(),P.onColumnOrderChange?.(ge,{columnId:Q,targetColumnId:o})),P.setDraggingColumnId(void 0);},"handleDrop"),be=a(ce=>{if(!q||!o||!P.onColumnSizeChange||ce.button!==0&&ce.pointerType!=="touch")return;ce.preventDefault(),ce.stopPropagation(),G.current();let Q=ce.clientX,ge=He??$.current?.offsetWidth??h??48,we=la(ge,h,S),Ie=ce.pointerId,oe=ce.currentTarget,xe=oe.ownerDocument,Ve=Uc(oe),_e=a(Me=>{if(Me.pointerId!==Ie)return;let Ae=la(we+(Ve?Q-Me.clientX:Me.clientX-Q),h,S);P.onColumnSizeChange?.(o,Ae,{columnId:o,previousWidth:we,minWidth:h,maxWidth:S});},"handlePointerMove"),Ge=a(Me=>{Me.pointerId===Ie&&G.current();},"handleStop"),le=a(Me=>{Me.pointerId===Ie&&G.current();},"handleLostCapture");G.current=()=>{xe.removeEventListener("pointermove",_e),xe.removeEventListener("pointerup",Ge),xe.removeEventListener("pointercancel",Ge),oe.removeEventListener("lostpointercapture",le),oe.hasPointerCapture?.(Ie)&&oe.releasePointerCapture?.(Ie),G.current=()=>{};},YP(oe,Ie),xe.addEventListener("pointermove",_e),xe.addEventListener("pointerup",Ge),xe.addEventListener("pointercancel",Ge),oe.addEventListener("lostpointercapture",le);},"handleResizePointerDown"),He=typeof ae=="number"?la(ae,h,S):z,We=He??la(h??48,h,S),Ke=a(ce=>{if(!q||!o||!P.onColumnSizeChange)return;let Q=Uc(ce.currentTarget),ge=He??la($.current?.offsetWidth||h||48,h,S),we;ce.key==="ArrowLeft"&&(we=ge+(Q?jc:-jc)),ce.key==="ArrowRight"&&(we=ge+(Q?-jc:jc)),ce.key==="Home"&&h!==void 0&&(we=h),ce.key==="End"&&S!==void 0&&(we=S),we!==void 0&&(ce.preventDefault(),ce.stopPropagation(),P.onColumnSizeChange(o,la(we,h,S),{columnId:o,previousWidth:ge,minWidth:h,maxWidth:S}));},"handleResizeKeyDown");return ho.useEffect(()=>{if(typeof ae=="number"){re(void 0);return}let ce=$.current?.getBoundingClientRect().width;if(ce&&Number.isFinite(ce)){let Q=la(ce,h,S);re(ge=>ge===Q?ge:Q);}},[ae,h,S,q]),ho.useEffect(()=>(q||G.current(),()=>G.current()),[q,o,P.onColumnSizeChange]),jsxRuntime.jsxs("th",{...D,ref:Z,"data-slot":"head","data-v2-header-drag-id":L&&ee?o:void 0,scope:D.scope??"col","aria-sort":X,className:m(W.slots.tableHead,B&&W.slots.tableSplitHead,F==="center"&&W.slots.tableCellAlignCenter,F==="right"&&W.slots.tableCellAlignRight,L&&"!relative !h-9 !px-3 !align-middle !text-sm !font-medium !text-muted-foreground after:pointer-events-none after:absolute after:bottom-2 after:right-0 after:top-2 after:w-px after:bg-border/50 after:content-['']",R?.root,C),style:{...W.styles.tableHead,...B?W.styles.tableSplitHead:void 0,width:B?void 0:qc(ae),minWidth:B?void 0:qc(h),maxWidth:B?void 0:qc(S),...B?{alignItems:eE(_),justifyContent:JP(F),textAlign:F}:n?{verticalAlign:n}:void 0,...M},onDragOver:me,onDrop:ie,children:[he,q&&L?jsxRuntime.jsx("div",{"data-column-resize-handle":"true",className:"absolute right-0 top-0 z-20 h-full w-2 cursor-col-resize touch-none select-none hover:bg-muted",onPointerDown:be}):q?jsxRuntime.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-valuenow":We,"aria-valuemin":h??48,"aria-valuemax":S,"aria-valuetext":`${We}px`,title:w,"aria-label":w??H.resizeColumn({columnId:o}),className:m(W.slots.tableHeadResizeHandle,R?.resizeHandle),onClick:ce=>ce.stopPropagation(),onKeyDown:Ke,onPointerDown:be}):null]})},"BaseTableHead")),Ha=ho.forwardRef(a(function({align:t="left",appearance:o,className:r,classNames:n,style:i,...s},l){Bi("cell align",t,["left","center","right"]);let{layout:d,theme:c}=xn(o),p=d==="split-scroll";return jsxRuntime.jsx("td",{...s,ref:l,"data-slot":"cell",className:m(c.slots.tableCell,p&&c.slots.tableSplitCell,t==="center"&&c.slots.tableCellAlignCenter,t==="right"&&c.slots.tableCellAlignRight,n?.root,r),style:{...c.styles.tableCell,...p?c.styles.tableSplitCell:void 0,...i}})},"BaseTableCell")),hv=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,...i},s){let{theme:l}=xn(t);return jsxRuntime.jsx("caption",{...i,ref:s,"data-slot":"caption",className:m(l.slots.tableCaption,r?.root,o),style:{...l.styles.tableCaption,...n}})},"BaseTableCaption")),Hi=ho.forwardRef(a(function({colSpan:t,icon:o,title:r,description:n,actions:i,children:s,appearance:l,className:d,classNames:c,style:p,...u},g){if(!Number.isSafeInteger(t)||t<1)throw new Error("BaseTable empty colSpan must be a positive safe integer.");let{layout:f,theme:b}=xn(l),x=f==="split-scroll",y=V(o)||V(r)||V(n)||V(i);return jsxRuntime.jsx("tr",{...u,ref:g,"data-slot":"empty-row",className:m(b.slots.tableEmptyRow,x&&b.slots.tableSplitRow,c?.row,d),style:{...b.styles.tableEmpty,...x?b.styles.tableSplitRow:void 0,...p},children:jsxRuntime.jsx("td",{colSpan:t,"data-slot":"empty-cell",className:m(b.slots.tableEmptyCell,x&&b.slots.tableSplitCell,c?.cell),style:x?{gridColumn:"1 / -1"}:void 0,children:y?jsxRuntime.jsxs("div",{className:m(b.slots.tableEmptyContent,c?.content),children:[V(o)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyIcon,c?.icon),children:o}):null,V(r)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyTitle,c?.title),children:r}):null,V(n)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyDescription,c?.description),children:n}):null,V(i)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyActions,c?.actions),children:i}):null]}):s})})},"BaseTableEmpty"));function rE({baseClassName:e,className:t,style:o}){let r=Jd();return jsxRuntime.jsx("div",{ref:r.ref,"aria-hidden":"true","data-slot":"loading-skeleton","data-skeleton-animation":r.mode,className:m(e,r.mode==="pulse"&&"animate-pulse motion-reduce:animate-none",t),style:{...r.style,...o}})}a(rE,"BaseTableLoadingSkeleton");function yv({rows:e=3,columns:t,columnWidths:o=[],animated:r=true,animation:n,rowLabel:i,appearance:s,className:l,classNames:d,style:c}){if(!Number.isSafeInteger(e)||e<0)throw new Error("BaseTable loading rows must be a non-negative safe integer.");if(!Number.isSafeInteger(t)||t<1)throw new Error("BaseTable loading columns must be a positive safe integer.");if(!Array.isArray(o))throw new Error("BaseTable loading columnWidths must be an array.");o.forEach((x,y)=>yn(x,`loading columnWidths[${y}]`,{stringAllowed:true})),qr("loading animated",r),Kc("loading rowLabel",i);let{layout:p,theme:u}=xn(s),g=Ye().table,f=i??g.loadingRow,b=p==="split-scroll";return jsxRuntime.jsx(Xn,{animation:n,animated:r,children:Array.from({length:e}).map((x,y)=>jsxRuntime.jsx(Zd,{index:y,children:jsxRuntime.jsx("tr",{"data-slot":"loading-row","aria-label":`${f} ${y+1}`,"aria-busy":"true",className:m(u.slots.tableLoadingRow,b&&u.slots.tableSplitRow,d?.row,l),style:{...u.styles.tableLoading,...b?u.styles.tableSplitRow:void 0,...c},children:Array.from({length:t}).map((k,w)=>jsxRuntime.jsx("td",{"data-slot":"loading-cell",className:m(u.slots.tableLoadingCell,b&&u.slots.tableSplitCell,d?.cell),children:jsxRuntime.jsx(rE,{baseClassName:u.slots.tableLoadingSkeleton,className:d?.skeleton,style:{width:qc(o[w])}})},w))})},y))})}a(yv,"BaseTableLoading");var xv=ho.forwardRef(a(function({appearance:t,leading:o,actions:r,attached:n=true,children:i,className:s,classNames:l,style:d,...c},p){if(typeof n!="boolean")throw new Error("BaseTableFooterBar attached must be a boolean.");let u=Pe(t),g=ke(),f=Ne(u);return jsxRuntime.jsxs("div",{...g,...c,ref:p,"data-monkeys-component":"table-footer-bar","data-slot":"footer-bar","data-base-table-footer-bar":"","data-attached":n?"":void 0,className:m(f.slots.tableFooterBar,n&&f.slots.tableFooterBarAttached,l?.root,s),style:{...f.styles.tableFooterBar,...d},children:[V(o)?jsxRuntime.jsx("div",{className:m(f.slots.tableFooterBarLeading,l?.leading),children:o}):null,V(i)?jsxRuntime.jsx("div",{className:m(f.slots.tableFooterBarContent,l?.content),children:i}):null,V(r)?jsxRuntime.jsx("div",{className:m(f.slots.tableFooterBarActions,l?.actions),children:r}):null]})},"BaseTableFooterBar"));function dE({items:e,value:t,defaultValue:o,orientation:r,activationMode:n}){if(!Array.isArray(e))throw new TypeError("BaseTabs items must be an array.");if(t!==void 0&&typeof t!="string")throw new TypeError("BaseTabs value must be a string.");if(o!==void 0&&typeof o!="string")throw new TypeError("BaseTabs defaultValue must be a string.");if(r!=="horizontal"&&r!=="vertical")throw new TypeError('BaseTabs orientation must be "horizontal" or "vertical".');if(n!=="automatic"&&n!=="manual")throw new TypeError('BaseTabs activationMode must be "automatic" or "manual".');let i=new Set;e.forEach((s,l)=>{if(!s||typeof s!="object")throw new TypeError(`BaseTabs item at index ${l} must be an object.`);if(typeof s.value!="string")throw new TypeError(`BaseTabs item value at index ${l} must be a string.`);if(i.has(s.value))throw new TypeError(`BaseTabs items must use unique values; duplicate value ${JSON.stringify(s.value)} at index ${l}.`);if(s.disabled!==void 0&&typeof s.disabled!="boolean")throw new TypeError(`BaseTabs item disabled at index ${l} must be a boolean.`);i.add(s.value);});}a(dE,"validateTabsProps");function ff(e,t){return t!==void 0&&e.some(o=>o.value===t&&!o.disabled)?t:e.find(o=>!o.disabled)?.value}a(ff,"getResolvedValue");function cE(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(cE,"toDomId");function uE(e){let t=new Set;return e.map((o,r)=>{let n=cE(o.value),i=n;if(t.has(i))for(i=`${n}-${r}`;t.has(i);)i=`${i}-${r}`;return t.add(i),i})}a(uE,"getDomIdFragments");function pE(e,t){let n=e.currentTarget.ownerDocument.defaultView?.getComputedStyle(e.currentTarget).direction==="rtl";return t==="ArrowRight"?n?-1:1:n?1:-1}a(pE,"getHorizontalStep");var wv=ho.forwardRef(a(function({items:t=[],value:o,defaultValue:r,orientation:n="horizontal",activationMode:i="automatic",appearance:s,className:l,classNames:d,style:c,onValueChange:p,id:u,"aria-label":g,"aria-labelledby":f,...b},x){dE({items:t,value:o,defaultValue:r,orientation:n,activationMode:i});let y=Pe(s),k=ke(),w=Ne(y),v=ho.useId(),h=u??v,S=o!==void 0?o:r,[T,C]=ho.useState(()=>ff(t,r)),[R,M]=ho.useState(()=>ff(t,S)),I=ho.useRef([]),A=o!==void 0,N=ff(t,A?o:T),D=t.findIndex(z=>z.value===N&&!z.disabled),E=D>=0?t[D]:void 0,P=t.reduce((z,re,Z)=>(re.disabled||z.push(Z),z),[]),W=t.findIndex(z=>z.value===R&&!z.disabled),H=W>=0?W:D,B=uE(t),L=E?"active":"disabled",F=typeof b.dir=="string"?b.dir:k.dir,_=a(z=>{z.disabled||(A||C(z.value),p?.(z.value));},"activateItem"),$=a((z,re)=>{let Z=t[re];!Z||Z.disabled||(z.preventDefault(),M(Z.value),I.current[re]?.focus(),i==="automatic"&&_(Z));},"moveFocus"),G=a((z,re,Z)=>{if(re.disabled)return;if(i==="manual"&&(z.key==="Enter"||z.key===" ")){z.preventDefault(),_(re);return}if(P.length===0)return;if(z.key==="Home"){$(z,P[0]);return}if(z.key==="End"){$(z,P[P.length-1]);return}let ae;if(n==="horizontal"&&(z.key==="ArrowLeft"||z.key==="ArrowRight")?ae=pE(z,z.key):n==="vertical"&&z.key==="ArrowUp"?ae=-1:n==="vertical"&&z.key==="ArrowDown"&&(ae=1),ae===void 0)return;let q=(P.indexOf(Z)+ae+P.length)%P.length;$(z,P[q]);},"handleKeyDown");return jsxRuntime.jsxs("div",{...k,...b,ref:x,id:u,"data-monkeys-component":"tabs","data-slot":"root","data-state":L,"data-orientation":n,"data-activation-mode":i,className:m(w.slots.tabsRoot,d?.root,l),style:c,children:[jsxRuntime.jsx("div",{...k,dir:F,role:"tablist","aria-label":g,"aria-labelledby":f,"aria-orientation":n,"data-monkeys-component":"tabs","data-slot":"list","data-state":L,"data-orientation":n,"data-activation-mode":i,className:m(w.slots.tabsList,n==="vertical"&&"flex-col items-stretch",d?.list),style:w.styles.tabsList,children:t.map((z,re)=>{let Z=B[re],ae=re===D,ee=z.disabled?"disabled":ae?"active":"inactive";return ho.createElement("button",{...k,ref:q=>{I.current[re]=q;},key:z.value,id:`${h}-${Z}-tab`,type:"button",role:"tab",tabIndex:!z.disabled&&re===H?0:-1,"aria-selected":ae,"aria-controls":`${h}-${Z}-panel`,disabled:z.disabled,dir:F,"data-monkeys-component":"tabs","data-slot":"trigger","data-state":ee,"data-orientation":n,"data-activation-mode":i,"data-disabled":z.disabled||void 0,className:m(w.slots.tabsTrigger,ae&&w.slots.tabsTriggerActive,z.disabled&&w.slots.tabsTriggerDisabled,d?.trigger),style:w.styles.tabsTrigger,onFocus:()=>M(z.value),onKeyDown:q=>G(q,z,re),onClick:()=>{M(z.value),_(z);}},jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:z.label}))})}),E?jsxRuntime.jsx("div",{...k,id:`${h}-${B[D]}-panel`,role:"tabpanel",tabIndex:0,"aria-labelledby":`${h}-${B[D]}-tab`,dir:F,"data-monkeys-component":"tabs","data-slot":"panel","data-state":"active","data-orientation":n,"data-activation-mode":i,className:m(w.slots.tabsPanel,d?.panel),style:w.styles.tabsPanel,children:V(E.content)?E.content:V(E.description)?jsxRuntime.jsx("p",{className:"m-0 text-muted-foreground",children:E.description}):null}):null]})},"BaseTabs"));var gE={sm:"min-h-20 px-2.5 py-1.5 text-xs leading-5",md:"min-h-24 px-3 py-2 text-sm leading-6",lg:"min-h-28 px-3.5 py-2.5 text-base leading-7"},kv=ho.forwardRef(a(function({invalid:t=false,disabled:o=false,readOnly:r=false,controlSize:n,appearance:i,className:s,classNames:l,style:d,"aria-invalid":c,onBlur:p,onChange:u,...g},f){for(let[v,h]of [["invalid",t],["disabled",o],["readOnly",r]])if(typeof h!="boolean")throw new TypeError(`BaseTextarea ${v} must be a boolean.`);if(n!==void 0&&n!=="sm"&&n!=="md"&&n!=="lg")throw new TypeError('BaseTextarea controlSize must be "sm", "md", or "lg".');let b=Pe(i),x=ke(),y=Ne(b),k=Qn(),w=t||k.invalid;return jsxRuntime.jsx("textarea",{...x,...g,ref:f,disabled:o,readOnly:r,"aria-invalid":c??(w||void 0),"data-monkeys-component":"textarea","data-slot":"control","data-size":n,"data-invalid":w||void 0,"data-disabled":o||void 0,"data-readonly":r||void 0,className:m(y.slots.controlWrapper,y.slots.controlBase,y.slots.controlTextarea,w&&y.slots.controlInvalid,o&&y.slots.controlDisabled,r&&y.slots.controlReadOnly,n&&gE[n],l?.control,s),style:{...y.styles.control,...w?y.styles.controlInvalid:void 0,...o?y.styles.controlDisabled:void 0,...d},onBlur:v=>{p?.(v),k.notifyBlur(v.currentTarget.value);},onChange:v=>{u?.(v),k.notifyChange(v.currentTarget.value);}})},"BaseTextarea"));function Cv(e,t,o,r,n=false){ho.useEffect(()=>{let i=e.current,s=t.current,l=i?.ownerDocument.defaultView;if(!o||!i||!s||!l?.matchMedia||!s.animate)return;let d=i.closest("button, a, [tabindex]")??i,c=l.matchMedia("(prefers-reduced-motion: reduce)"),p=d.matches(":hover"),u=d.contains(i.ownerDocument.activeElement),g,f=a(()=>{g?.cancel(),g=void 0,delete i.dataset.scrolling;},"stop"),b=a(()=>{f();let h=s.scrollWidth-i.clientWidth;if(c.matches&&!(n&&p)||!p&&!u||h<=1)return;let T=h/64*1e3,C=160,R=T+C*2;g=s.animate([{transform:"translateX(0)",offset:0},{transform:"translateX(0)",offset:C/R},{transform:`translateX(-${h}px)`,offset:1-C/R},{transform:`translateX(-${h}px)`,offset:1}],{duration:R,iterations:1/0,direction:"alternate",easing:"linear"}),i.dataset.scrolling="true";},"update"),x=a(()=>{p=true,b();},"enter"),y=a(()=>{p=false,b();},"leave"),k=a(()=>{u=true,b();},"focus"),w=a(h=>{u=h.relatedTarget instanceof l.Node&&d.contains(h.relatedTarget),b();},"blur"),v=l.ResizeObserver?new l.ResizeObserver(b):void 0;return v?.observe(i),v?.observe(s),d.addEventListener("pointerenter",x),d.addEventListener("pointerleave",y),d.addEventListener("focusin",k),d.addEventListener("focusout",w),c.addEventListener("change",b),b(),()=>{f(),v?.disconnect(),d.removeEventListener("pointerenter",x),d.removeEventListener("pointerleave",y),d.removeEventListener("focusin",k),d.removeEventListener("focusout",w),c.removeEventListener("change",b);}},[e,t,o,r,n]);}a(Cv,"useOverflowMotion");var wE=ho.forwardRef(a(function({as:t="p",children:o,size:r="md",tone:n="default",overflowMotion:i,appearance:s,className:l,classNames:d,style:c,...p},u){let g=Pe(s),f=ke(),b=Ne(g),x=ho.useRef(null),y=ho.useRef(null),k=i==="hover-scroll"||i==="hover-scroll-always",w=ho.useCallback(v=>{x.current=v,typeof u=="function"?u(v):u&&(u.current=v);},[u]);return Cv(x,y,k,o,i==="hover-scroll-always"),ho.createElement(t,{...f,...p,ref:w,"data-monkeys-component":"text","data-slot":"root","data-size":r,"data-tone":n,className:m(b.slots.textRoot,Od(b,r),gi(b,n),d?.root,l),style:{...b.styles.text,...k?{display:"block",minWidth:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{},...c}},k?ho.createElement("span",{ref:y,style:{display:"inline-block",whiteSpace:"nowrap"}},o):o)},"BaseText"));function Nv({leading:e,title:t,description:o,actions:r,children:n,appearance:i,className:s,classNames:l,style:d,...c}){let p=Ne(i),u=V(t)||V(o);return jsxRuntime.jsxs("div",{...c,className:m(p.slots.toolbarRoot,l?.root,s),style:{...p.styles.toolbar,...d},children:[jsxRuntime.jsxs("div",{className:m(p.slots.toolbarLeading,l?.leading),children:[V(e)?e:null,u?jsxRuntime.jsxs("div",{className:m(p.slots.toolbarContent,l?.content),children:[V(t)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarTitle,l?.title),children:t}):null,V(o)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarDescription,l?.description),children:o}):null]}):null]}),V(n)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarContent,l?.content),children:n}):null,V(r)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarActions,l?.actions),children:r}):null]})}a(Nv,"BaseToolbar");var CE=ho.forwardRef(a(function({children:t,focusable:o=false,appearance:r,className:n,classNames:i,style:s,...l},d){let c=Pe(r),p=ke(),u=Ne(c);if(typeof o!="boolean")throw new TypeError("BaseVisuallyHidden focusable must be a boolean.");return jsxRuntime.jsx("span",{...p,...l,ref:d,"data-monkeys-component":"visually-hidden","data-slot":"root","data-focusable":o||void 0,className:m(u.slots.visuallyHiddenRoot,o&&u.slots.visuallyHiddenFocusable,i?.root,n),style:{...u.styles.visuallyHidden,...s},children:t})},"BaseVisuallyHidden"));var DE={oneOf:[{type:"object",additionalProperties:false,required:["kind","src"],properties:{kind:{const:"image"},src:{type:"string",minLength:1,maxLength:4096}}},{type:"object",additionalProperties:false,required:["kind","value"],properties:{kind:{const:"emoji"},value:{type:"string",minLength:1,maxLength:64},backgroundColor:{type:"string",maxLength:128}}},{type:"object",additionalProperties:false,required:["kind","name"],properties:{kind:{const:"lucide"},name:{type:"string",minLength:1,maxLength:128}}}]},Mv={path:["d"],circle:["cx","cy","r"],rect:["x","y","width","height","rx","ry"],polyline:["points"],line:["x1","x2","y1","y2"],ellipse:["cx","cy","rx","ry"],polygon:["points"]};function yf(e){if(!Array.isArray(e)||!e.length||e.length>256)return;let t=[];for(let o of e){if(!Array.isArray(o)||o.length!==2||typeof o[0]!="string"||!Object.prototype.hasOwnProperty.call(Mv,o[0]))return;let r=o[0],n=o[1];if(!n||typeof n!="object"||Array.isArray(n)||Object.getPrototypeOf(n)!==Object.prototype)return;let i={};for(let[s,l]of Object.entries(Object.getOwnPropertyDescriptors(n))){if(!("value"in l)||typeof l.value!="string")return;let d=l.value;if(s==="key"){if(d.length>256)return}else if(s==="fill"){if(d!=="currentColor"&&d!=="none")return}else if(Mv[r].includes(s)){if(s==="d"){if(!d.length||d.length>8192||!/^[MmZzLlHhVvCcSsQqTtAa0-9eE+.,\s-]+$/.test(d))return}else if(s==="points"){if(!d.length||d.length>8192||!/^[0-9eE+.,\s-]+$/.test(d))return}else if(!d.trim()||d.length>128||!Number.isFinite(Number(d)))return}else return;i[s]=d;}t.push([r,i]);}return t}a(yf,"parseAssetIconNodes");var xf=ho.forwardRef(a(function({icon:t,alt:o,normalizeImageIcon:r=false,className:n,style:i,...s},l){let d=ke(),c=im()??runtime$1.resolveAssetIconNodes,p=vh(),u=t.kind==="image"?t.src:void 0,[g,f]=ho.useState();ho.useEffect(()=>{if(!u||!p)return;let D=new AbortController;return Promise.resolve().then(()=>p(u,D.signal)).then(E=>{D.signal.aborted||f({reference:u,resolver:p,src:fn(E,"media")});}).catch(()=>{D.signal.aborted||f({reference:u,resolver:p});}),()=>D.abort()},[u,p]);let b=p?g&&g.reference===u&&g.resolver===p?g.src:void 0:fn(u,"media"),[x,y]=ho.useState(),k=ho.useRef(null);ho.useEffect(()=>{let D=k.current;b&&D?.complete&&y({source:b,resolver:p,ready:D.naturalWidth>0});},[b,p]);let w=t.kind==="lucide"?t.name:void 0,v=ho.useMemo(()=>{if(w)try{return c.peek?yf(c.peek(w)):void 0}catch{return}},[w,c]),[h,S]=ho.useState();ho.useEffect(()=>{let D=true;return w&&!v&&Promise.resolve().then(()=>c(w)).then(E=>{D&&S({name:w,resolver:c,nodes:yf(E)});}).catch(()=>{D&&S({name:w,resolver:c,nodes:void 0});}),()=>{D=false;}},[w,c,v]);let T=h?.name===w&&h?.resolver===c,C=v??(T?h?.nodes:void 0),R=!!(u&&p&&!(g?.reference===u&&g?.resolver===p)),M=x?.source===b&&x?.resolver===p,I=!!(w&&!v&&!T),A=t.kind==="emoji"?"ready":t.kind==="image"?b?M?x?.ready?"ready":"error":"loading":R?"loading":"error":C?"ready":I?"loading":"error",N=A==="loading"?jsxRuntime.jsx(Ur,{variant:"block",className:"h-5 w-5 max-h-full max-w-full rounded"}):jsxRuntime.jsx(lucideReact.Wrench,{"aria-hidden":"true",className:"h-5 w-5 max-h-full max-w-full"});return jsxRuntime.jsx("div",{...d,...s,ref:l,role:"img","aria-label":o,"data-icon-state":A,"aria-busy":A==="loading"||void 0,className:m("monkeys-asset-icon flex h-11 w-11 shrink-0 items-center justify-center rounded-xl text-muted-foreground",t.kind==="emoji"?"text-2xl":t.kind==="image"&&!r?"overflow-hidden border":"bg-muted",n),style:{...t.kind==="emoji"&&t.backgroundColor?{backgroundColor:t.backgroundColor}:{},...i},children:t.kind==="image"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b&&A!=="error"&&jsxRuntime.jsx("img",{ref:k,src:b,alt:"","aria-hidden":"true",onLoad:D=>{D.currentTarget===k.current&&y({source:b,resolver:p,ready:true});},onError:D=>{D.currentTarget===k.current&&y({source:b,resolver:p,ready:false});},style:A==="loading"?{display:"none"}:void 0,className:r?"h-5 w-5 object-contain":"h-full w-full object-cover"},b),A!=="ready"&&N]}):t.kind==="emoji"?jsxRuntime.jsx("span",{"aria-hidden":"true",children:t.value}):C?jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"h-5 w-5 max-h-full max-w-full",children:C.map(([D,E],P)=>{let{key:W,...H}=E;return ho.createElement(D,{...H,key:W??P})})}):N})},"BaseAssetIcon"));function Ev(e){try{let t=new URL(e.trim());return ["http:","https:"].includes(t.protocol)?t.href:void 0}catch{return}}a(Ev,"imageLink");function Bv({accept:e,multiple:t=false,disabled:o=false,busy:r=false,title:n="Upload files",description:i,hint:s,busyLabel:l="Uploading...",icon:d,inputProps:c,className:p,classNames:u,onFilesSelected:g,renderPreview:f,replaceLabel:b,clearLabel:x,pasteLabel:y,renderActions:k,onClear:w,onChoose:v,onPasteClick:h,onUrlSelected:S,onInputError:T}){let C=f?.(),R=k?.(),M=ho.useRef(null),[I,A]=ho.useState(false),[N,D]=ho.useState(false),E=ho.useRef(true),P=ho.useRef(0),W=o||r,H=ho.useRef({blocked:W,onFilesSelected:g,onUrlSelected:S,onInputError:T});H.current={blocked:W,onFilesSelected:g,onUrlSelected:S,onInputError:T},ho.useEffect(()=>(E.current=true,()=>{E.current=false,P.current++;}),[]),ho.useEffect(()=>{W&&(P.current++,D(false),A(false));},[W]);let B=a(z=>{let re=Array.from(z);!H.current.blocked&&re.length&&H.current.onFilesSelected?.(t?re:re.slice(0,1));},"emitFiles"),L=a(()=>{W||(P.current++,D(false),v?v():M.current?.click());},"choose"),F=a(z=>{if(W)return false;if(z.files.length&&g)return P.current++,D(false),B(z.files),true;let re=Ev(z.getData("text/plain"));return re&&S?(P.current++,D(false),S(re),true):false},"acceptTransfer"),_=a(async()=>{if(W||N)return;let z=++P.current,re=a(()=>E.current&&!H.current.blocked&&z===P.current,"active");D(true);try{if(!navigator.clipboard?.read)throw new Error("Clipboard reading is unavailable.");let Z=await navigator.clipboard.read();for(let ae of Z){let ee=ae.types.find(q=>q.startsWith("image/"));if(ee&&H.current.onFilesSelected){let q=await ae.getType(ee);re()&&B([new File([q],`clipboard.${ee.split("/")[1]}`,{type:ee})]);return}}for(let ae of Z){if(!ae.types.includes("text/plain"))continue;let ee=Ev(await(await ae.getType("text/plain")).text());if(ee&&H.current.onUrlSelected){re()&&H.current.onUrlSelected(ee);return}}re()&&H.current.onInputError?.("empty-clipboard");}catch{re()&&H.current.onInputError?.("clipboard-unavailable");}finally{E.current&&z===P.current&&D(false);}},"paste"),$=a((z,re,Z)=>z?jsxRuntime.jsx("span",{"data-slot":Z,className:j("max-w-full [overflow-wrap:anywhere]",re),children:z}):null,"renderText"),G=a((z,re,Z)=>z?jsxRuntime.jsx(To,{content:z,portal:true,children:jsxRuntime.jsx(dt,{label:z,iconOnly:true,icon:re,disabled:W||N,onClick:Z})}):null,"action");return jsxRuntime.jsxs("div",{"data-monkeys-component":"data-explorer-upload-surface","data-state":r?"busy":I?"dragging":"idle",className:j("grid min-w-0 gap-global rounded-[var(--radius)] border border-border bg-muted/20 p-global transition-colors",!C&&"border-dashed",I&&"border-primary bg-primary/5",W&&"opacity-60",u?.root,p),tabIndex:W?-1:0,onPaste:z=>{F(z.clipboardData)&&(z.preventDefault(),z.stopPropagation());},onDragEnter:z=>{z.preventDefault(),W||A(true);},onDragOver:z=>z.preventDefault(),onDragLeave:z=>{z.relatedTarget instanceof Node&&z.currentTarget.contains(z.relatedTarget)||A(false);},onDrop:z=>{z.preventDefault(),A(false),F(z.dataTransfer)&&z.stopPropagation();},children:[!v&&jsxRuntime.jsx("input",{...c,ref:M,className:"sr-only",type:"file",accept:e,multiple:t,disabled:W,onChange:z=>{P.current++,D(false),B(z.target.files??[]),z.target.value="";}}),C?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Is,{aspectRatio:"video",className:"rounded-[var(--radius)] bg-background",children:C}),jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-token-sm",children:[G(b,jsxRuntime.jsx(lucideReact.RefreshCw,{className:"h-4 w-4"}),L),G(y,jsxRuntime.jsx(lucideReact.Clipboard,{className:"h-4 w-4"}),h??_),w&&G(x,jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4"}),()=>{P.current++,D(false),w();}),R]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{type:"button",className:j("flex min-w-0 flex-col items-center gap-token-sm rounded-[var(--radius)] py-global text-center focus-visible:outline focus-visible:outline-primary",u?.button),disabled:W,onClick:L,children:[jsxRuntime.jsx("span",{className:j("text-muted-foreground",u?.icon),children:d??jsxRuntime.jsx(lucideReact.UploadCloud,{className:"h-8 w-8","aria-hidden":true})}),$(r?l:n,j("text-sm font-medium text-foreground",u?.title),"title"),$(i,j("text-xs text-muted-foreground",u?.description),"description"),$(s,j("text-xs text-muted-foreground",u?.hint),"hint")]}),y&&jsxRuntime.jsx(dt,{label:y,icon:jsxRuntime.jsx(lucideReact.Clipboard,{className:"h-4 w-4"}),disabled:W||N,onClick:h??_,className:"w-full"}),R]})]})}a(Bv,"DataExplorerUploadSurface");function WE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"7"}),jsxRuntime.jsx("path",{d:"m20 20-3.5-3.5"})]})}a(WE,"DefaultSearchIcon");function Lv({rootRef:e,dataAttributes:t,context:o,leading:r,leadingActions:n,searchVisible:i=true,searchValue:s="",searchPlaceholder:l="Search data...",searchIcon:d,viewOptions:c=[],activeViewId:p,actions:u,toolbarActions:g,appearance:f,children:b,className:x,classNames:y,onSearchChange:k,onSearchSubmit:w,onViewChange:v}){let h=a(C=>{C.preventDefault(),w?.(s);},"handleSubmit"),S=Et(f),T=Ct(S);return jsxRuntime.jsxs("div",{ref:e,...t,className:j(T.slots.toolbarRoot,y?.root,x),style:T.styles.toolbarRoot,children:[r||n?.length?jsxRuntime.jsxs("div",{className:j(T.slots.toolbarLeading,y?.leading),children:[r,n?.length?jsxRuntime.jsx(cn,{context:o,actions:n,layout:"inline",appearance:S,classNames:{action:y?.action,menuContent:y?.menuContent,menuItem:y?.menuItem}}):null]}):null,i?jsxRuntime.jsxs("form",{className:j(T.slots.toolbarSearch,y?.search),style:T.styles.toolbarSearch,onSubmit:h,children:[jsxRuntime.jsx("span",{className:j(T.slots.toolbarSearchIcon,y?.searchIcon),children:d??jsxRuntime.jsx(WE,{})}),jsxRuntime.jsx("input",{value:s,placeholder:l,className:j(T.slots.toolbarSearchInput,y?.searchInput),onChange:C=>k?.(C.currentTarget.value)})]}):null,c.length>0?jsxRuntime.jsx("div",{className:j(T.slots.toolbarViewSwitch,y?.viewSwitch),style:T.styles.toolbarViewSwitch,children:c.map(C=>{let R=C.id===p;return jsxRuntime.jsxs("button",{type:"button",disabled:C.disabled,className:j(T.slots.toolbarViewButton,R&&T.slots.toolbarViewButtonActive,y?.viewButton),onClick:()=>v?.(C.id),children:[C.icon,C.label?jsxRuntime.jsx("span",{children:C.label}):null]},C.id)})}):null,g?.length?jsxRuntime.jsx(cn,{context:o,actions:g,layout:"toolbar",appearance:f,classNames:{root:y?.actions,action:y?.action,menuContent:y?.menuContent,menuItem:y?.menuItem}}):u||b?jsxRuntime.jsxs("div",{className:j(T.slots.toolbarActions,y?.actions),children:[u,b]}):null]})}a(Lv,"DataExplorerToolbarShell");function zE(e){if(!e||typeof e!="object")return;let t=e.children;return Array.isArray(t)?t:void 0}a(zE,"defaultGetChildren");function Wv({nodes:e=[],context:t,capabilities:o,className:r,classNames:n,empty:i,selectedNodeId:s,getNodeId:l,getChildren:d=zE,renderNode:c,onSelect:p}){let u=Array.isArray(e)?e:[],g=a((f,b)=>f.map((x,y)=>{let k=l?l(x,y):`${b}-${y}`,w=d(x,y,b)??[],v=w.length>0,h=String(s??"")===String(k),S=v?g(w,b+1):null;return c?jsxRuntime.jsx("div",{className:"min-w-0",children:c({node:x,index:y,depth:b,context:t,capabilities:o,childNodes:w,hasChildren:v,selected:h,onSelect:p,renderChildren:a(()=>S,"renderChildren")})},k):S}),"renderTreeNodes");return u.length===0?i?jsxRuntime.jsx("div",{className:j(n?.empty),children:i}):null:jsxRuntime.jsx("div",{className:j("min-w-0",n?.root,r),children:g(u,0)})}a(Wv,"DataExplorerTree");function zv({title:e,subtitle:t,toolbar:o,footer:r,children:n,appearance:i,className:s,classNames:l}){let d=Ct(Et(i)),c=!!e||!!t||!!o;return jsxRuntime.jsxs("section",{className:j(d.slots.treeShellRoot,l?.root,s),children:[c?jsxRuntime.jsxs("div",{className:j(d.slots.treeShellHeader,l?.header),children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e?jsxRuntime.jsx("div",{className:j(d.slots.treeShellTitle,l?.title),children:e}):null,t?jsxRuntime.jsx("div",{className:j(d.slots.treeShellSubtitle,l?.subtitle),children:t}):null]}),o?jsxRuntime.jsx("div",{className:j(d.slots.treeShellToolbar,l?.toolbar),children:o}):null]}):null,jsxRuntime.jsx("div",{className:j(d.slots.treeShellBody,l?.body),children:n}),r?jsxRuntime.jsx("div",{className:j(d.slots.treeShellFooter,l?.footer),children:r}):null]})}a(zv,"DataExplorerTreeShell");function Fv({expanded:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:e?"m6 9 6 6 6-6":"m9 18 6-6-6-6"})})}a(Fv,"ChevronIcon");function FE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"12",cy:"5",r:"1"}),jsxRuntime.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}a(FE,"MoreIcon");function HE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"9",cy:"6",r:"1"}),jsxRuntime.jsx("circle",{cx:"9",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"9",cy:"18",r:"1"}),jsxRuntime.jsx("circle",{cx:"15",cy:"6",r:"1"}),jsxRuntime.jsx("circle",{cx:"15",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"15",cy:"18",r:"1"})]})}a(HE,"GripIcon");function _v(e,t){for(let o of e??[])o.defaultExpanded&&t.add(o.id),_v(o.children,t);}a(_v,"collectDefaultExpandedNodeIds");function Hv(e,t){let o=new Set(t??[]);for(let r of e)_v(r.nodes,o);return o}a(Hv,"buildDefaultNodeExpandedSet");function Vv(e,t){let o=new Set(t??[]);for(let r of e)(r.hideHeader||r.defaultExpanded!==false)&&o.add(r.id);return o}a(Vv,"buildDefaultGroupExpandedSet");function Gv(e,t,o,r){for(let[n,i]of (e??[]).entries())r.set(i.id,{node:i,group:t,parentId:o,index:n}),Gv(i.children,t,i.id,r);}a(Gv,"flattenNodes");function VE(e){let t=new Map;for(let o of e)Gv(o.nodes,o,void 0,t);return t}a(VE,"buildFlattenedNodeMap");function _E(e,t){return [...t??[],...e.actions??[]]}a(_E,"getNodeActions");function GE(e,t){return [...t??[],...e.actions??[]]}a(GE,"getGroupActions");function eu({groups:e,nodes:t,context:o,selectedNodeId:r,selectedGroupId:n,expandedNodeIds:i,defaultExpandedNodeIds:s,expandedGroupIds:l,defaultExpandedGroupIds:d,resetExpansionKey:c,nodeActions:p,groupActions:u,indentSize:g=16,indentOffset:f=8,actionIcon:b,empty:x,loading:y=false,loadingNode:k,error:w,labels:v,reorderMode:h="none",appearance:S,className:T,classNames:C,onSelectNode:R,onSelectGroup:M,onExpandedNodeIdsChange:I,onExpandedGroupIdsChange:A,onAction:N,onReorderNodes:D}){let E=Ye().dataExplorer.viewTree,P=Ct(Et(S)),W=v?.actions??E.actions,H=v?.expand??E.expand,B=v?.collapse??E.collapse,L=k??v?.loading??E.loading,F=x??v?.empty??E.empty,_=Array.isArray(e),$=ho.useMemo(()=>_?e:[{id:"__root__",hideHeader:true,defaultExpanded:true,nodes:Array.isArray(t)?t:[]}],[e,_,t]),G=ho.useMemo(()=>VE($),[$]),[z,re]=ho.useState(()=>Hv($,s)),[Z,ae]=ho.useState(()=>Vv($,d)),[ee,q]=ho.useState(),[U,X]=ho.useState();ho.useEffect(()=>{re(Hv($,s)),ae(Vv($,d));},[d,s,c]);let O=i!==void 0?new Set(i):z,K=l!==void 0?new Set(l):Z,ne=a((Q,ge)=>{let we=new Set(O);ge?we.add(Q):we.delete(Q),i===void 0&&re(we),I?.([...we]);},"setNodeExpanded"),fe=a((Q,ge)=>{let we=new Set(K);ge?we.add(Q):we.delete(Q),l===void 0&&ae(we),A?.([...we]);},"setGroupExpanded"),he=a((Q,ge)=>ge.type==="node"?{type:"node",action:Q,node:ge.node,group:ge.group,context:o}:{type:"group",action:Q,group:ge.group,context:o},"createActionContext"),me=a((Q,ge)=>{let we=Q.filter(Ie=>{let oe=he(Ie,ge);return Mt(Ie.visible,oe)??true});return we.length===0?null:jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx("button",{type:"button",title:W,"aria-label":W,className:m(P.slots.menuTrigger,ge.type==="group"?P.slots.treeGroupActions:P.slots.treeNodeActions,ge.type==="group"?C?.groupActions:m(C?.nodeActions,C?.itemActions)),onClick:Ie=>Ie.stopPropagation(),children:b??jsxRuntime.jsx(FE,{})})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{align:"end",sideOffset:6,className:m(P.slots.menuContent,C?.menuContent),style:P.styles.menuContent,onClick:Ie=>Ie.stopPropagation(),children:we.map(Ie=>{let oe=he(Ie,ge),xe=(Mt(Ie.disabled,oe)??false)||(Mt(Ie.loading,oe)??false),Ve=Mt(Ie.active,oe)??false;return Ie.render?jsxRuntime.jsx("div",{children:Ie.render(oe)},Ie.id):jsxRuntime.jsxs("div",{children:[Ie.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:P.slots.menuSeparator}):null,jsxRuntime.jsxs(Bt__namespace.Item,{title:Ie.title,disabled:xe,className:m(P.slots.menuItem,Gn(P,Ie.tone),Ve&&"bg-accent text-accent-foreground",C?.menuItem),style:P.styles.menuItem,onSelect:()=>{xe||(Ie.onAction?.(oe),N?.(oe));},children:[Ie.icon?jsxRuntime.jsx("span",{className:P.slots.menuItemIcon,children:Ie.icon}):null,jsxRuntime.jsx("span",{className:P.slots.menuItemLabel,children:Ie.label})]}),Ie.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:P.slots.menuSeparator}):null]},Ie.id)})})})]})},"renderActions"),ie=a((Q,ge)=>{Q.preventDefault();let we=ee||Q.dataTransfer.getData("application/x-data-explorer-node");if(!we||we===ge.id||!D){q(void 0),X(void 0);return}let Ie=G.get(we),oe=G.get(ge.id);if(!Ie||!oe){q(void 0),X(void 0);return}let xe=Ie.parentId===oe.parentId&&Ie.group?.id===oe.group?.id;if(h==="same-parent"&&!xe){q(void 0),X(void 0);return}let Ve={activeNode:Ie.node,overNode:oe.node,activeGroup:Ie.group,overGroup:oe.group,activeParentId:Ie.parentId,overParentId:oe.parentId,oldIndex:Ie.index,newIndex:oe.index,sameParent:xe,context:o};D(Ve),q(void 0),X(void 0);},"handleDrop"),be=a((Q,ge,we)=>{let Ie=Array.isArray(Q.children)?Q.children:[],oe=Ie.length>0,xe=Q.collapsible===false||O.has(Q.id),Ve=r===Q.id,_e=Q.selectable!==false&&!Q.disabled,Ge=h!=="none"&&!!D&&Q.reorderable!==false,le=ee===Q.id,Me=U===Q.id&&ee!==Q.id,Ae=_E(Q,p);return jsxRuntime.jsxs("div",{"data-data-explorer-entry":"node","data-data-explorer-node-id":Q.id,"data-data-explorer-group-id":ge?.id,className:m(P.slots.treeNode,C?.node,C?.item,Q.className),onDragOver:J=>{!ee||!Ge||(J.preventDefault(),X(Q.id));},onDragLeave:()=>{U===Q.id&&X(void 0);},onDrop:J=>ie(J,Q),children:[jsxRuntime.jsxs("div",{className:m(P.slots.treeNodeButton,Ve&&P.slots.treeNodeSelected,Q.disabled&&P.slots.treeNodeDisabled,le&&P.slots.treeNodeDragging,Me&&"ring-1 ring-primary/30",Ve&&C?.itemSelected,Ve&&C?.nodeSelected,Q.disabled&&C?.nodeDisabled,le&&C?.nodeDragging,C?.nodeButton,C?.itemButton),style:{paddingLeft:`calc(${(Q.indentLevel??we)*g+f}px + var(--data-explorer-tree-group-indent, 0px))`},role:"treeitem","aria-selected":Ve||void 0,"aria-disabled":Q.disabled||void 0,"aria-expanded":oe?xe:void 0,"aria-label":Q.ariaLabel,tabIndex:_e?0:-1,onClick:()=>{_e&&R?.(Q,o);},onKeyDown:J=>{J.target===J.currentTarget&&_e&&(J.key!=="Enter"&&J.key!==" "||(J.preventDefault(),R?.(Q,o)));},children:[Ge?jsxRuntime.jsx("span",{draggable:true,className:m(P.slots.treeNodeDragHandle,C?.nodeDragHandle),onClick:J=>J.stopPropagation(),onDragStart:J=>{J.stopPropagation(),J.dataTransfer.effectAllowed="move",J.dataTransfer.setData("application/x-data-explorer-node",Q.id),q(Q.id);},onDragEnd:()=>{q(void 0),X(void 0);},children:jsxRuntime.jsx(HE,{})}):null,oe?jsxRuntime.jsx("button",{type:"button",className:m(P.slots.treeNodeToggle,C?.nodeToggle,C?.expander),"aria-label":xe?B:H,onClick:J=>{J.stopPropagation(),ne(Q.id,!xe);},children:jsxRuntime.jsx(Fv,{expanded:xe})}):jsxRuntime.jsx("span",{className:m(P.slots.treeNodeToggle,C?.nodeToggle)}),Q.icon?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeIcon,C?.nodeIcon,C?.itemIcon),children:Q.icon}):null,jsxRuntime.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[jsxRuntime.jsx("span",{className:m(P.slots.treeNodeLabel,C?.nodeLabel,C?.itemLabel),children:Q.label}),Q.description?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeDescription,C?.nodeDescription),children:Q.description}):null]}),Q.meta?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeMeta,C?.nodeMeta),children:Q.meta}):null,Q.badge?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeBadge,C?.nodeBadge),children:Q.badge}):null,me(Ae,{type:"node",node:Q,group:ge})]}),oe&&xe?jsxRuntime.jsx("div",{className:m(P.slots.treeNodeChildren,C?.nodeChildren,C?.list),children:Ie.map(J=>be(J,ge,we+1))}):null]},Q.id)},"renderNode"),He=a((Q,ge,we)=>Q===false?null:jsxRuntime.jsx("div",{className:m(ge,we),children:Q}),"renderPlaceholder");if(y)return jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),children:He(L,P.slots.treeLoading,C?.loading)});if(w)return jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),children:He(w??v?.error,P.slots.treeError,C?.error)});let We=$.some(Q=>(Q.nodes??[]).length>0),Ke=$.some(Q=>Q.status==="loading"||Q.error);return !We&&!Ke&&(!_||$.length===0)?jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),children:He(F,P.slots.treeEmpty,C?.empty)}):jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),role:We||$.some(Q=>!Q.hideHeader)?"tree":void 0,children:$.map(Q=>{let ge=Q.hideHeader||Q.collapsible===false||K.has(Q.id),we=Q.nodes?.length??0,Ie=GE(Q,u),oe=n===Q.id,xe=Q.collapsible!==false;return jsxRuntime.jsxs("section",{"data-data-explorer-entry":"group","data-data-explorer-group-id":Q.id,className:m(P.slots.treeGroup,C?.group,Q.className),children:[Q.hideHeader?null:jsxRuntime.jsxs("div",{role:"treeitem","aria-label":typeof Q.label=="string"?Q.label:void 0,"aria-selected":Q.selectable?oe:void 0,"aria-expanded":xe?ge:void 0,className:m(P.slots.treeGroupHeader,P.slots.treeGroupHeaderButton,oe&&P.slots.treeNodeSelected,C?.groupHeader,C?.groupHeaderButton,oe&&C?.itemSelected),children:[jsxRuntime.jsxs("button",{type:"button",className:m("flex min-w-0 flex-1 items-center gap-2 text-left outline-hidden focus-visible:ring-2 focus-visible:ring-ring",C?.groupLabel),"aria-pressed":Q.selectable?oe:void 0,"aria-expanded":!Q.selectable&&xe?ge:void 0,onClick:()=>{if(Q.selectable){M?.(Q,o);return}xe&&fe(Q.id,!ge);},children:[Q.icon?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeIcon,C?.nodeIcon,C?.itemIcon),children:Q.icon}):null,jsxRuntime.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[Q.label?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeLabel,C?.nodeLabel,C?.itemLabel),children:Q.label}):null,Q.description?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeDescription,C?.nodeDescription),children:Q.description}):null]}),Q.meta?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeMeta,C?.nodeMeta),children:Q.meta}):null,Q.badge?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeBadge,C?.nodeBadge),children:Q.badge}):null]}),xe?jsxRuntime.jsx("button",{type:"button",className:m(P.slots.treeNodeToggle,C?.expander),"aria-label":ge?B:H,"aria-expanded":ge,onClick:()=>fe(Q.id,!ge),children:jsxRuntime.jsx(Fv,{expanded:ge})}):jsxRuntime.jsx("span",{className:m(P.slots.treeNodeToggle,C?.expander)}),me(Ie,{type:"group",group:Q})]}),ge?jsxRuntime.jsx("div",{role:"group",className:m(P.slots.treeGroupContent,C?.groupContent,C?.list),children:Q.loading||Q.status==="loading"?He(L,P.slots.treeLoading,C?.loading):Q.error||Q.status==="error"?He(Q.error??v?.error??E.error,P.slots.treeError,C?.error):we>0?Q.nodes?.map(Ve=>be(Ve,Q,0)):He(Q.empty??F,P.slots.treeEmpty,C?.empty)}):null]},Q.id)})})}a(eu,"DataExplorerViewTree");function $E(e,t,o){let r=e.filter(n=>!n.hidden);if(r.length!==0){if(t){let n=r.find(i=>i.id===t);if(n)return n}if(o){let n=r.find(i=>i.id===o);if(n)return n}return r[0]}}a($E,"resolveActiveViewDefinition");function jv({items:e,views:t=[],activeViewId:o,fallbackViewId:r,context:n,capabilities:i,className:s,classNames:l,empty:d,loading:c,loadingNode:p,footer:u,overlay:g,layout:f,collection:b,selectedIds:x=[],getItemId:y,itemDefinition:k,renderItem:w,onOpenItem:v,onSelectionChange:h}){let S=Array.isArray(e)?e:[],T=$E(t,o,r),C=T?.id??o??r??"",R=b||T?.collection?{...b,...T?.collection,classNames:{...b?.classNames,...T?.collection?.classNames}}:void 0,M=T?.layout??T?.collection?.layout??f??b?.layout,I=T?.collection?.loading??b?.loading??c,A=T?.collection?.loadingNode??b?.loadingNode??p,N=T?.collection?.footer??b?.footer??u,D=T?.collection?.overlay??b?.overlay??g,E=typeof T?.empty=="function"?T.empty({items:S,activeViewId:C,context:n,capabilities:i,className:s,empty:d,loading:c,loadingNode:p,footer:u,overlay:g,layout:f,collection:R,selectedIds:x,getItemId:y,itemDefinition:k,renderItem:w,onOpenItem:v,onSelectionChange:h}):T?.empty??d,P={items:S,activeViewId:C,context:n,capabilities:i,className:s,empty:E,loading:I,loadingNode:A,footer:N,overlay:D,layout:M,collection:R,selectedIds:x,getItemId:y,itemDefinition:T?.itemDefinition??k,renderItem:T?.renderItem??w,onOpenItem:v,onSelectionChange:h};return T?.render?jsxRuntime.jsx(jsxRuntime.Fragment,{children:T.render(P)}):jsxRuntime.jsx(Ti,{items:S,activeViewId:C,context:n,capabilities:i,className:R?.className??s,classNames:{...l,...R?.classNames},empty:E,loading:P.loading,loadingNode:P.loadingNode,footer:P.footer,overlay:P.overlay,layout:P.layout,scrollable:R?.scrollable,wrapItems:R?.wrapItems,measuredGrid:R?.measuredGrid,itemsStyle:R?.itemsStyle,itemStyle:R?.itemStyle,selectedIds:x,getItemId:y,itemDefinition:P.itemDefinition,renderItem:P.renderItem,getItemClassName:T?.getItemClassName,onOpenItem:v,onSelectionChange:h})}a(jv,"DataExplorerView");function Uv({header:e,footer:t,overlay:o,empty:r,isEmpty:n=false,children:i,className:s,classNames:l}){return jsxRuntime.jsxs("section",{className:j("relative flex min-h-0 flex-1 flex-col overflow-hidden",l?.root,s),children:[e?jsxRuntime.jsx("div",{className:j("shrink-0",l?.header),children:e}):null,jsxRuntime.jsx("div",{className:j("flex min-h-0 flex-1 flex-col overflow-hidden",l?.body),children:n&&r?jsxRuntime.jsx("div",{className:j("flex h-full items-center justify-center p-6 text-sm text-muted-foreground",l?.empty),children:r}):i}),t?jsxRuntime.jsx("div",{className:j("shrink-0",l?.footer),children:t}):null,o?jsxRuntime.jsx("div",{className:j("absolute inset-0",l?.overlay),children:o}):null]})}a(Uv,"DataExplorerViewShell");var Ys="gap-2 rounded-[var(--radius)] border border-transparent text-sm font-medium motion-reduce:transition-none",Xs="size-[var(--monkeys-component-navigation-sidebar-icon-size,1.125rem)] shrink-0 text-inherit [&_svg]:size-full",kf="text-foreground hover:border-transparent hover:bg-[var(--navigation-internal-hover-background)] hover:text-[var(--navigation-internal-hover-foreground)]",Cf="border-[var(--navigation-internal-selected-border)] bg-[var(--navigation-internal-selected-background)] text-[var(--navigation-internal-selected-foreground)] hover:border-[var(--navigation-internal-selected-border)] hover:bg-[var(--navigation-internal-selected-background)] hover:text-[var(--navigation-internal-selected-foreground)]",Kv="[--navigation-internal-theme-selected-background:color-mix(in_srgb,hsl(var(--monkeys-color-primary,var(--primary)))_10%,transparent)] [--navigation-internal-theme-selected-foreground:hsl(var(--monkeys-color-primary,var(--primary)))] dark:[--navigation-internal-theme-selected-background:hsl(var(--monkeys-color-accent,var(--accent)))] dark:[--navigation-internal-theme-selected-foreground:hsl(var(--monkeys-color-foreground,var(--foreground)))]";function qv(e){let t={muted:"hsl(var(--monkeys-color-accent,var(--accent)))",soft:"color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 10%,transparent)",solid:"hsl(var(--monkeys-color-primary,var(--primary)))",outline:"hsl(var(--monkeys-color-background,var(--background)))"}[e??"muted"];return {"--navigation-internal-default-selected-background":e===void 0?"var(--navigation-internal-theme-selected-background)":t,"--navigation-internal-default-selected-foreground":e===void 0?"var(--navigation-internal-theme-selected-foreground)":e==="solid"?"hsl(var(--monkeys-color-primary-foreground,var(--primary-foreground)))":"hsl(var(--monkeys-color-foreground,var(--foreground)))","--navigation-internal-selected-background":"var(--monkeys-component-navigation-sidebar-row-selected-background,var(--navigation-internal-default-selected-background))","--navigation-internal-selected-foreground":"var(--monkeys-component-navigation-sidebar-row-selected-foreground,var(--navigation-internal-default-selected-foreground))","--navigation-internal-selected-border":`var(--monkeys-component-navigation-sidebar-row-selected-border,${e===void 0||e==="muted"?"transparent":e==="soft"?"color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 25%,transparent)":e==="outline"?"color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 55%,transparent)":"hsl(var(--monkeys-color-primary,var(--primary)))"})`,"--navigation-internal-hover-background":"var(--monkeys-component-navigation-sidebar-row-hover-background,color-mix(in srgb,hsl(var(--monkeys-color-accent,var(--accent))) 65%,transparent))","--navigation-internal-hover-foreground":"var(--monkeys-component-navigation-sidebar-row-hover-foreground,hsl(var(--monkeys-color-foreground,var(--foreground))))"}}a(qv,"unifiedStyle");var KE="[--navigation-internal-selected-background:var(--monkeys-component-navigation-sidebar-row-selected-background,var(--monkeys-component-navigation-sidebar-tree-row-selected-background,var(--navigation-internal-default-selected-background)))] [--navigation-internal-selected-foreground:var(--monkeys-component-navigation-sidebar-row-selected-foreground,var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,var(--navigation-internal-default-selected-foreground)))] [--navigation-internal-hover-background:var(--monkeys-component-navigation-sidebar-row-hover-background,var(--monkeys-component-navigation-sidebar-tree-row-hover-background,color-mix(in_srgb,hsl(var(--monkeys-color-accent,var(--accent)))_65%,transparent)))] [--navigation-internal-hover-foreground:var(--monkeys-component-navigation-sidebar-row-hover-foreground,var(--monkeys-component-navigation-sidebar-tree-row-hover-foreground,hsl(var(--monkeys-color-foreground,var(--foreground)))))]",qE="aria-selected:border-[var(--navigation-internal-selected-border)] aria-selected:bg-[var(--navigation-internal-selected-background)] aria-selected:text-[var(--navigation-internal-selected-foreground)] aria-selected:hover:border-[var(--navigation-internal-selected-border)] aria-selected:hover:bg-[var(--navigation-internal-selected-background)] aria-selected:hover:text-[var(--navigation-internal-selected-foreground)]",qs="rounded-[var(--monkeys-component-navigation-sidebar-action-radius,0.25rem)] text-inherit hover:bg-foreground/10 hover:text-inherit focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none";function Yv(e,t,o={}){let r=m(Ys,e,t,kf);return {...o,root:m(KE,"space-y-0.5",o.root),group:m("space-y-0.5","[&>[role=treeitem]+[role=group]]:[--data-explorer-tree-group-indent:var(--monkeys-component-navigation-sidebar-tree-group-indent,1rem)]",o.group),groupHeaderButton:m("h-auto",r,o.groupHeaderButton),nodeButton:m(r,qE,o.nodeButton),itemSelected:m(Cf,o.itemSelected),nodeIcon:m(Xs,"group-hover/tree-node:text-inherit",o.nodeIcon),nodeLabel:m("font-medium",o.nodeLabel),nodeDescription:m("text-inherit",o.nodeDescription),nodeDisabled:m("opacity-50",o.nodeDisabled),groupActions:m(qs,"order-2 size-5 p-0 group-focus-within/tree-group:opacity-100",o.groupActions),nodeActions:m(qs,"order-2 size-5 p-0 group-focus-within/tree-node:opacity-100",o.nodeActions),nodeToggle:m(qs,"order-1 empty:hidden",o.nodeToggle),expander:m(qs,"order-1 empty:hidden",o.expander),nodeDragHandle:m(qs,o.nodeDragHandle)}}a(Yv,"unifiedTreeClassNames");function QE({collapsed:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4",fill:"none",children:jsxRuntime.jsx("path",{d:e?"M4 4.5h12M4 15.5h12M5 7.5 7.5 10 5 12.5M15 7.5 12.5 10l2.5 2.5":"M4 4.5h12M4 15.5h12M7.5 7.5 5 10l2.5 2.5M12.5 7.5 15 10l-2.5 2.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}a(QE,"CollapseIcon");function ZE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8.5",cy:"8.5",r:"5",stroke:"currentColor",strokeWidth:"1.6"}),jsxRuntime.jsx("path",{d:"m12.2 12.2 3.3 3.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}a(ZE,"SearchIcon");function JE(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5",fill:"none",children:jsxRuntime.jsx("path",{d:"m6 6 8 8m0-8-8 8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}a(JE,"ClearIcon");function eA(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4",fill:"currentColor",children:[jsxRuntime.jsx("circle",{cx:"5",cy:"10",r:"1.2"}),jsxRuntime.jsx("circle",{cx:"10",cy:"10",r:"1.2"}),jsxRuntime.jsx("circle",{cx:"15",cy:"10",r:"1.2"})]})}a(eA,"MoreIcon");function ou({expanded:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:m("h-4 w-4 transition-transform motion-reduce:transition-none",e&&"rotate-180"),fill:"none",children:jsxRuntime.jsx("path",{d:"m6 8 4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}a(ou,"DisclosureIcon");function tA(e,t){typeof e=="function"?e(t):e&&(e.current=t);}a(tA,"assignRef");function Gi(e,t){if(!Number.isFinite(t))throw new RangeError(`NavigationSidebar ${e} must be a finite number.`)}a(Gi,"requireFiniteNumber");function oA(e){let t=e.minWidth??180,o=e.maxWidth??420,r=e.defaultWidth??256,n=e.collapsedWidth??60,i=e.collapseThreshold??140;if(Gi("minWidth",t),Gi("maxWidth",o),Gi("defaultWidth",r),Gi("collapsedWidth",n),Gi("collapseThreshold",i),t<=0)throw new RangeError("NavigationSidebar minWidth must be greater than zero.");if(o<t)throw new RangeError("NavigationSidebar maxWidth must be greater than or equal to minWidth.");if(n<0)throw new RangeError("NavigationSidebar collapsedWidth cannot be negative.");if(i<0)throw new RangeError("NavigationSidebar collapseThreshold cannot be negative.");return {defaultWidth:r,minWidth:t,maxWidth:o,collapsedWidth:n,collapseThreshold:i}}a(oA,"resolveLayoutBounds");function ru(e,t){return Math.min(Math.max(e,t.minWidth),t.maxWidth)}a(ru,"clampWidth");function ew(e,t){if(t){t(e);return}typeof console<"u"&&console.warn("NavigationSidebar could not persist layout state.",e);}a(ew,"reportStorageError");function tw(e){if(e)return e;if(!(typeof window>"u"))return window.localStorage}a(tw,"resolveStorage");function rA(e,t){let o={collapsed:e.defaultCollapsed??false,width:ru(t.defaultWidth,t)};if(!e.storageKey)return o;let r=tw(e.storage);if(!r)return o;try{let n=r.getItem(e.storageKey);if(!n)return o;let i=JSON.parse(n);return {collapsed:typeof i.collapsed=="boolean"?i.collapsed:o.collapsed,width:typeof i.width=="number"&&Number.isFinite(i.width)?ru(i.width,t):o.width}}catch(n){return ew(n,e.onStorageError),o}}a(rA,"readStoredLayout");function Tf(e,t){return t||(typeof e=="string"?e:void 0)}a(Tf,"getNodeTitle");function nA(e){return e==="solid"?"border-primary bg-primary text-primary-foreground shadow-sm":e==="outline"?"border-primary/55 bg-background text-foreground ring-1 ring-primary/20":e==="muted"?"border-transparent bg-muted text-foreground":"border-primary/25 bg-primary/10 text-foreground"}a(nA,"activeVariantClassName");function aA(e){if(e?.preset!==void 0&&e.preset!=="unified")throw new TypeError(`Unknown NavigationSidebar preset "${e.preset}". Supported preset: unified.`);let t=e?.preset==="unified",o=e?.density??(t?"compact":"default"),r=e?.surface??"panel",n=e?.activeVariant??(t?"muted":"soft");return {unified:t,density:o,surface:r,activeVariant:n,selected:t?Cf:nA(n),inactive:t?kf:"text-muted-foreground hover:border-border/70 hover:bg-muted/60 hover:text-foreground",root:m(r==="plain"&&"border-transparent bg-transparent shadow-none",r==="panel"&&"border-border/70 bg-card text-card-foreground shadow-sm",r==="frosted"&&"border-border/55 bg-card/80 text-card-foreground shadow-sm backdrop-blur-xl",r==="outlined"&&"border-border bg-background text-foreground shadow-none",t&&"rounded-[var(--radius)] shadow-none",t&&Kv,t&&r==="panel"&&"border-[var(--monkeys-component-navigation-sidebar-border,hsl(var(--monkeys-color-border,var(--border))))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--monkeys-color-card,var(--card))))] text-foreground"),itemHeight:o==="compact"?t?"min-h-[var(--monkeys-component-navigation-sidebar-row-height,2.5rem)]":"min-h-9":o==="comfortable"?"min-h-14":"min-h-11",itemPadding:o==="compact"?t?"px-2 py-2":"px-2 py-1.5":o==="comfortable"?"px-3 py-3":"px-3 py-2",searchHeight:o==="compact"?t?"h-[var(--monkeys-component-navigation-sidebar-row-height,2.5rem)]":"h-8":o==="comfortable"?"h-10":"h-9"}}a(aA,"resolveAppearance");var Jv="hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-hover-background,hsl(var(--muted)))] hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-hover-foreground,hsl(var(--foreground)))]",iA="bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))] hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))]",Qs="hover:!bg-transparent hover:!text-inherit focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring";function sA(e){return {...e,groupHeader:m(Jv,e?.groupHeader),itemSelected:m(iA,e?.itemSelected),nodeButton:m(Jv,"aria-selected:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] aria-selected:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))] aria-selected:hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] aria-selected:hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))]",e?.nodeButton),expander:m(Qs,e?.expander),nodeToggle:m(Qs,e?.nodeToggle),groupActions:m(Qs,e?.groupActions),nodeActions:m(Qs,e?.nodeActions),nodeDragHandle:m(Qs,e?.nodeDragHandle)}}a(sA,"resolveNavigationTreeClassNames");function Nf({item:e,active:t,collapsed:o,mobile:r,embedded:n=false,appearance:i,classNames:s,domClassName:l}){return m("group/navigation-item relative flex w-full min-w-0 items-center gap-3 rounded-[var(--radius)] border border-transparent text-left text-sm outline-hidden transition-[background-color,border-color,color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",i.itemHeight,i.itemPadding,i.unified&&Ys,n?"min-h-0 self-stretch border-0 bg-transparent text-inherit hover:bg-transparent hover:text-inherit":t?i.selected:i.inactive,o&&!r&&"justify-center px-0",e.disabled&&"pointer-events-none opacity-50",s?.item,t&&s?.itemActive,r&&s?.mobileItem,l,e.className)}a(Nf,"entryClassName");function Rf({item:e,collapsed:t,mobile:o,classNames:r,endIndicator:n,appearance:i}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V(e.icon)?jsxRuntime.jsx("span",{className:m("flex size-5 shrink-0 items-center justify-center [&_svg]:size-full",i.unified&&Xs,r?.itemIcon),"aria-hidden":"true",children:e.icon}):null,o||!t?jsxRuntime.jsxs("span",{className:m("flex min-w-0 flex-1 flex-col",r?.itemContent),children:[jsxRuntime.jsx("span",{className:m("min-w-0 truncate font-semibold",i.unified&&"font-medium",r?.itemLabel),children:e.label}),V(e.description)?jsxRuntime.jsx("span",{className:m("mt-0.5 truncate text-xs font-normal",i.unified&&"text-inherit",r?.itemDescription),children:e.description}):null]}):null,(o||!t)&&V(e.meta)?jsxRuntime.jsx("span",{className:m("shrink-0 text-xs text-muted-foreground",r?.itemMeta),children:e.meta}):null,(o||!t)&&V(e.endContent)?jsxRuntime.jsx("span",{className:m("shrink-0",r?.itemEndContent),children:e.endContent}):null,(o||!t)&&V(n)?jsxRuntime.jsx("span",{className:"flex shrink-0 items-center justify-center",children:n}):null]})}a(Rf,"EntryContent");function nu({item:e,active:t,collapsed:o,itemAs:r,appearance:n,classNames:i,mobile:s=false,embedded:l=false,onSelect:d,ariaControls:c,ariaExpanded:p,endIndicator:u}){let g=r??(e.href?"a":"button"),f=Tf(e.label,e.title),b=e.domProps??{},x=a(k=>{if(e.disabled){k.preventDefault();return}e.onClick?.(k),d?.();},"handleClick"),y={...b,...e.to?{to:e.to}:{},...e.href?{href:e.href}:{},...g==="button"?{type:"button",disabled:e.disabled}:{},title:f,"aria-current":t?"page":void 0,"aria-disabled":e.disabled||void 0,"aria-controls":c,"aria-expanded":p,tabIndex:e.disabled?-1:b.tabIndex,onClick:x};return jsxRuntime.jsx(g,{...y,"data-navigation-sidebar-item-id":e.id,"data-active":t?"true":"false","data-expanded":p===void 0?void 0:String(p),className:Nf({item:e,active:t,collapsed:o,mobile:s,embedded:l,appearance:n,classNames:i,domClassName:b.className}),children:jsxRuntime.jsx(Rf,{appearance:n,item:e,collapsed:o,mobile:s,classNames:i,endIndicator:u})})}a(nu,"EntryButton");function lA({item:e,appearance:t,classNames:o}){let r=e.domProps??{};return jsxRuntime.jsx("div",{...r,"data-navigation-sidebar-item-id":e.id,"aria-disabled":e.disabled||void 0,title:Tf(e.label,e.title),className:Nf({item:e,active:false,collapsed:false,mobile:true,embedded:true,appearance:t,classNames:o,domClassName:r.className}),children:jsxRuntime.jsx(Rf,{appearance:t,item:e,collapsed:false,mobile:true,classNames:o})})}a(lA,"EntryPresentation");function au({active:e,appearance:t}){return m("flex w-full min-w-0 items-center gap-0.5 rounded-[var(--radius)] border border-transparent pr-1 text-sm transition-[background-color,border-color,color,box-shadow] motion-reduce:transition-none",t.itemHeight,t.unified&&Ys,e?t.selected:t.inactive)}a(au,"routeRowClassName");function iu(e,t){return t?e.filter(o=>!o.filterIds?.length||o.filterIds.includes(t)):e}a(iu,"filterCatalogItems");function dA({props:e,collapsed:t,appearance:o}){let{items:r=[],sections:n=[],filters:i=[],activeFilterId:s,activeItemId:l,onFilterSelect:d,itemAs:c,layout:p="single",empty:u,ariaLabel:g,classNames:f}=e,b=iu(r,s),x=n.map(v=>({...v,items:iu(v.items,s)})).filter(v=>v.items.length>0),y=b.length>0||x.length>0,k=i.length>0&&!t?jsxRuntime.jsx("div",{role:"group",className:m(p==="split"?"flex min-w-32 flex-col gap-1 border-r border-border/60 pr-2":"flex flex-wrap gap-1",f?.filterList),"aria-label":g?`${g} filters`:void 0,children:i.map(v=>{let h=v.id===s;return jsxRuntime.jsxs("button",{type:"button",title:v.title??(typeof v.label=="string"?v.label:void 0),"aria-pressed":h,disabled:v.disabled,className:m("inline-flex min-h-8 items-center gap-2 rounded-md px-2.5 text-xs font-medium text-muted-foreground outline-hidden transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",h&&"bg-muted text-foreground",f?.filterItem,h&&f?.filterItemActive),onClick:()=>d?.(v),children:[V(v.icon)?jsxRuntime.jsx("span",{"aria-hidden":"true",children:v.icon}):null,jsxRuntime.jsx("span",{className:"truncate",children:v.label})]},v.id)})}):null,w=y?jsxRuntime.jsxs("div",{className:m("min-w-0 flex-1",f?.list),children:[b.length>0?jsxRuntime.jsx("ul",{className:"grid list-none gap-1 p-0",children:b.map(v=>jsxRuntime.jsx("li",{children:jsxRuntime.jsx(nu,{item:v,active:v.active??v.id===l,collapsed:t,itemAs:c,appearance:o,classNames:f})},v.id))}):null,x.map(v=>jsxRuntime.jsxs("section",{className:m("mt-3 first:mt-0",f?.section,v.className),children:[!t&&V(v.label)?jsxRuntime.jsx("div",{className:m("mb-1 px-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",f?.sectionLabel,v.labelClassName),children:v.label}):null,jsxRuntime.jsx("ul",{className:"grid list-none gap-1 p-0",children:v.items.map(h=>jsxRuntime.jsx("li",{children:jsxRuntime.jsx(nu,{item:h,active:h.active??h.id===l,collapsed:t,itemAs:c,appearance:o,classNames:f})},h.id))})]},v.id))]}):jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:u});return jsxRuntime.jsxs("nav",{"aria-label":g,className:m(p==="split"&&!t&&"flex min-w-0 gap-2"),children:[k,w]})}a(dA,"CatalogContent");function cA({child:e,parent:t,active:o,interactive:r,onSelect:n,appearance:i,classNames:s,embedded:l=false}){let d=r?"button":"div",c=e.domProps??{};return jsxRuntime.jsxs(d,{...c,...r?{type:"button"}:{},"data-navigation-sidebar-child-id":e.id,"aria-current":r&&o?"page":void 0,"aria-disabled":e.disabled||void 0,title:Tf(e.label,e.title),disabled:r?e.disabled:void 0,className:m("flex w-full min-w-0 flex-1 items-center gap-3 rounded-[var(--radius)] border border-transparent text-left text-sm font-semibold outline-hidden transition-[background-color,border-color,color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",i.itemHeight,i.itemPadding,i.unified&&Ys,l?"min-h-0 self-stretch border-0 bg-transparent text-inherit hover:bg-transparent hover:text-inherit":o?i.selected:i.inactive,e.disabled&&"pointer-events-none opacity-50",s?.childItem,o&&s?.childItemActive,c.className,e.className),onClick:r&&!e.disabled?()=>n?.(e,t):void 0,children:[V(e.icon)?jsxRuntime.jsx("span",{className:m("flex size-5 shrink-0 items-center justify-center [&_svg]:size-full",i.unified&&Xs),"aria-hidden":"true",children:e.icon}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:e.label})]})}a(cA,"ChildEntry");function su({itemId:e,actions:t,kind:o,className:r,mobile:n=false}){return V(t)?jsxRuntime.jsx("div",{"data-navigation-sidebar-item-actions":o==="item"?e:void 0,"data-navigation-sidebar-child-actions":o==="child"?e:void 0,"data-navigation-sidebar-actions-mobile":n?"true":void 0,className:m("ml-auto flex shrink-0 items-center gap-1 [&>button]:border-0 [&>button]:bg-transparent [&>button]:shadow-none [&>button:hover]:bg-muted",r),children:t}):null}a(su,"RouteActions");function Mf(e){return e.interaction==="disclosure"}a(Mf,"isDisclosureRouteItem");function uA(e){let t=new Set,o=new Set,r=new Set;for(let n of e){let i=n.id;if(t.has(i))throw new RangeError(`NavigationSidebar route item ids must be unique; received "${i}" more than once.`);if(t.add(i),Mf(n)){if(!n.children.length)throw new RangeError(`NavigationSidebar disclosure item "${n.id}" must include at least one child.`);if(n.href!==void 0||n.to!==void 0||n.onClick!==void 0)throw new TypeError(`NavigationSidebar disclosure item "${i}" cannot define href, to, or onClick.`);r.add(n.id);}else if(n.childrenPresentation==="collapsible"){if(!n.children?.length)throw new RangeError(`NavigationSidebar collapsible route item "${n.id}" must include at least one child.`);r.add(n.id);}for(let l of n.children??[]){if(o.has(l.id))throw new RangeError(`NavigationSidebar route child ids must be unique; received "${l.id}" more than once.`);o.add(l.id);}}return r}a(uA,"validateRouteItems");function pA({item:e,expanded:t,controls:o,label:r,onToggle:n,classNames:i}){let s=typeof e.label=="string"?e.label:e.id;return jsxRuntime.jsx("button",{type:"button",disabled:e.disabled,"aria-expanded":t,"aria-controls":o,"aria-label":`${r}: ${s}`,title:r,"data-navigation-sidebar-disclosure-trigger":e.id,className:m("inline-flex h-8 w-7 shrink-0 items-center justify-center rounded-md border-0 bg-transparent text-muted-foreground shadow-none outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",i?.childMenuTrigger),onClick:n,children:jsxRuntime.jsx(ou,{expanded:t})})}a(pA,"RouteChildrenToggle");function lu({item:e,activeChildId:t,label:o,onChildSelect:r,classNames:n,appearance:i,triggerVariant:s="submenu",mobile:l=false}){let d=(e.children??[]).filter(g=>!g.disabled);if(!e.children?.length||s==="submenu"&&(!r||d.length===0))return null;let c=typeof e.label=="string"?e.label:e.id,p=!!e.disabled||!r||d.length===0,u=e.domProps??{};return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:s==="item"&&i?jsxRuntime.jsx("button",{...u,type:"button",disabled:p,"aria-label":`${o}: ${c}`,title:o,"data-navigation-sidebar-item-id":e.id,"data-navigation-sidebar-disclosure-menu":"true",className:Nf({item:e,active:false,collapsed:!l,mobile:l,appearance:i,classNames:n,domClassName:u.className}),children:jsxRuntime.jsx(Rf,{appearance:i,item:e,collapsed:!l,mobile:l,classNames:n,endIndicator:l?jsxRuntime.jsx(ou,{expanded:false}):void 0})}):jsxRuntime.jsx("button",{type:"button",disabled:s==="disclosure"?p:void 0,"data-navigation-sidebar-disclosure-trigger":s==="disclosure"?e.id:void 0,className:m("inline-flex h-8 shrink-0 items-center justify-center rounded-md border-0 bg-transparent text-muted-foreground shadow-none outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",s==="disclosure"?"w-7":"w-6",n?.childMenuTrigger),"aria-label":`${o}: ${c}`,title:o,children:s==="disclosure"?jsxRuntime.jsx(ou,{expanded:false}):jsxRuntime.jsx(eA,{})})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{side:"right",align:"start",sideOffset:8,className:m("z-50 min-w-40 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-hidden",n?.childMenuContent),children:e.children?.map(g=>jsxRuntime.jsxs(Bt__namespace.Item,{disabled:g.disabled,"data-navigation-sidebar-child-id":g.id,"data-active":g.id===t?"true":"false",className:m("flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",g.id===t&&"bg-accent text-accent-foreground"),onSelect:()=>r?.(g,e),children:[V(g.icon)?jsxRuntime.jsx("span",{"aria-hidden":"true",children:g.icon}):null,jsxRuntime.jsx("span",{className:"truncate",children:g.label})]},g.id))})})]})}a(lu,"CollapsedChildMenu");function mA({props:e,collapsed:t,appearance:o}){let{routeItems:r,activeItemId:n,activeChildId:i,expandedItemIds:s,defaultExpandedItemIds:l=[],itemAs:d,onItemSelect:c,onChildSelect:p,onExpandedItemIdsChange:u,collapsedChildMenuLabel:g="Open submenu",disclosureLabel:f="Toggle submenu",ariaLabel:b,classNames:x}=e,y=ho.useId(),k=ho.useMemo(()=>uA(r),[r]),[w,v]=ho.useState(()=>l),h=s!==void 0,S=s??w,T=ho.useMemo(()=>S.filter(M=>k.has(M)),[k,S]),C=ho.useMemo(()=>new Set(T),[T]),R=ho.useCallback(M=>{if(M.disabled||!k.has(M.id))return;let I=C.has(M.id)?T.filter(A=>A!==M.id):[...T,M.id];h||v(I),u?.(I);},[k,C,h,T,u]);return jsxRuntime.jsx("nav",{"aria-label":b,children:jsxRuntime.jsx("ul",{className:m("grid list-none gap-2 p-0",o.unified&&"gap-0.5",x?.list),children:r.map((M,I)=>{let A=Mf(M),N=!A&&M.id===n,D=!!M.children?.length,E=k.has(M.id),P=!E||C.has(M.id),W=!t&&V(M.actions),H=t&&D&&!!p||!t&&E&&!A||W,B=`${y}-route-children-${I}`;return jsxRuntime.jsxs("li",{className:"grid min-w-0 gap-1",children:[t&&A?jsxRuntime.jsx(lu,{item:M,activeChildId:i,label:g,onChildSelect:p,classNames:x,appearance:o,triggerVariant:"item"}):jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-row":H?M.id:void 0,"data-active":H?String(N):void 0,className:H?au({active:N,appearance:o}):void 0,children:[jsxRuntime.jsx(nu,{item:M,active:N,collapsed:t,embedded:H,itemAs:A?"button":d,appearance:o,classNames:x,onSelect:A?()=>R(M):c?()=>c(M):void 0,ariaControls:!t&&E&&A?B:void 0,ariaExpanded:!t&&E&&A?P:void 0,endIndicator:!t&&A&&!W?jsxRuntime.jsx(ou,{expanded:P}):void 0}),W?jsxRuntime.jsx(su,{itemId:M.id,actions:M.actions,kind:"item",className:x?.itemActions}):null,t&&p?jsxRuntime.jsx(lu,{item:M,activeChildId:i,label:g,onChildSelect:p,classNames:x}):null,!t&&E&&(!A||W)?jsxRuntime.jsx(pA,{item:M,expanded:P,controls:B,label:f,onToggle:()=>R(M),classNames:x}):null]}),!t&&D?jsxRuntime.jsx("ul",{id:B,hidden:!P,style:P?void 0:{display:"none"},className:m("ml-5 grid list-none gap-0.5 border-l border-border/70 py-1 pl-3",o.unified&&"border-border",x?.childList),children:M.children?.map(L=>{let F=V(L.actions),_=L.id===i,$=jsxRuntime.jsx(cA,{child:L,parent:M,active:_,interactive:!!p,onSelect:p,appearance:o,classNames:x,embedded:F});return jsxRuntime.jsx("li",{children:F?jsxRuntime.jsxs("div",{"data-navigation-sidebar-child-row":L.id,"data-active":String(_),className:au({active:_,appearance:o}),children:[$,jsxRuntime.jsx(su,{itemId:L.id,actions:L.actions,kind:"child",className:x?.childActions})]}):$},L.id)})}):null]},M.id)})})})}a(mA,"RouteContent");function fA(e,t,o){return [...iu(e,o),...t.flatMap(r=>iu(r.items,o))]}a(fA,"flattenCatalogItems");function bA({props:e,appearance:t}){if(!e.mobile||e.mobile.mode!=="horizontal")return null;let o=e.classNames,r=e.kind==="catalog"?fA(e.items??[],e.sections??[],e.activeFilterId):e.routeItems;return jsxRuntime.jsx("nav",{"aria-label":e.ariaLabel,className:m("flex gap-2 overflow-x-auto pb-1",o?.mobileNav,e.mobile.className),children:r.map(n=>{let i={...o,mobileItem:m(o?.mobileItem,e.mobile?.itemClassName)},s=e.kind==="route"?n:void 0,l=s!==void 0&&V(s.actions);if(e.kind==="route"&&Mf(n))return l?jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-row":n.id,"data-active":"false",className:m(au({active:false,appearance:t}),"shrink-0"),children:[jsxRuntime.jsx(lA,{item:n,appearance:t,classNames:i}),jsxRuntime.jsx(su,{itemId:n.id,actions:n.actions,kind:"item",className:o?.itemActions,mobile:true}),jsxRuntime.jsx(lu,{item:n,activeChildId:e.activeChildId,label:e.collapsedChildMenuLabel??"Open submenu",onChildSelect:e.onChildSelect,classNames:i,appearance:t,triggerVariant:"disclosure",mobile:true})]},n.id):jsxRuntime.jsx(ho.Fragment,{children:jsxRuntime.jsx(lu,{item:n,activeChildId:e.activeChildId,label:e.collapsedChildMenuLabel??"Open submenu",onChildSelect:e.onChildSelect,classNames:i,appearance:t,triggerVariant:"item",mobile:true})},n.id);let d=e.kind==="catalog"?n.active??n.id===e.activeItemId:n.id===e.activeItemId,c=jsxRuntime.jsx(nu,{item:n,active:d,collapsed:false,embedded:l,itemAs:e.itemAs,appearance:t,classNames:i,mobile:true,onSelect:e.kind==="route"&&e.onItemSelect?()=>e.onItemSelect?.(n):void 0});return l&&s?jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-row":n.id,"data-active":String(d),className:m(au({active:d,appearance:t}),"shrink-0"),children:[c,jsxRuntime.jsx(su,{itemId:s.id,actions:s.actions,kind:"item",className:o?.itemActions,mobile:true})]},n.id):jsxRuntime.jsx(ho.Fragment,{children:c},n.id)})})}a(bA,"MobileNavigation");function gA(e,t){let o=oA(e);e.width!==void 0&&Gi("width",e.width);let r=ho.useRef(null);r.current||(r.current=rA(e,o));let n=ho.useRef(null),[i,s]=ho.useState(r.current.collapsed),[l,d]=ho.useState(r.current.width),[c,p]=ho.useState(e.search?.defaultValue??""),[u,g]=ho.useState(false),f=e.collapsed??i,b=ru(e.width??l,o),x=e.search?.value??c,y=e.collapsed!==void 0,k=e.width!==void 0,w=ho.useMemo(()=>aA(e.appearance),[e.appearance]),v=e.collapsible??true,h=e.resizable??true,S=v?e.collapsePlacement??"header":"none",T=e.collapseLabel??"Collapse sidebar",C=e.expandLabel??"Expand sidebar",R=e.resizeLabel??"Resize sidebar",M=!f||o.collapsedWidth>0,I=a(H=>{n.current=H,tA(t,H);},"setSidebarRef"),A=ho.useCallback(H=>{!v&&H||(y||s(H),e.onCollapsedChange?.(H));},[v,y,e.onCollapsedChange]),N=ho.useCallback(H=>{let B=ru(H,o);k||d(B),e.onWidthChange?.(B);},[o.maxWidth,o.minWidth,k,e.onWidthChange]);ho.useEffect(()=>{if(!e.storageKey)return;let H=tw(e.storage);if(H)try{H.setItem(e.storageKey,JSON.stringify({collapsed:f,width:b}));}catch(B){ew(B,e.onStorageError);}},[e.onStorageError,e.storage,e.storageKey,f,b]),ho.useEffect(()=>{if(!u)return;let H=document.body.style.cursor,B=document.body.style.userSelect,L=a(_=>{let $=n.current;if(!$)return;let G=_.clientX-$.getBoundingClientRect().left;if(v&&G<o.collapseThreshold){A(true);return}A(false),N(G);},"handlePointerMove"),F=a(()=>g(false),"handlePointerUp");return window.addEventListener("pointermove",L),window.addEventListener("pointerup",F),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",F),document.body.style.cursor=H,document.body.style.userSelect=B;}},[o.collapseThreshold,v,u,A,N]);let D=a(H=>{if(!(H.key!=="ArrowLeft"&&H.key!=="ArrowRight")){if(H.preventDefault(),H.key==="ArrowLeft"){let B=b-24;v&&B<o.collapseThreshold?A(true):N(B);return}f&&A(false),N(Math.max(b+24,o.minWidth));}},"handleResizeKeyDown"),E=a(H=>jsxRuntime.jsx("button",{type:"button",className:m("inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-hidden transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",e.classNames?.collapseButton,H),"aria-label":f?C:T,title:f?C:T,"aria-expanded":!f,onClick:()=>A(!f),children:jsxRuntime.jsx(QE,{collapsed:f})}),"collapseButton"),P=V(e.title)||V(e.headerLeading)||V(e.headerActions)||S==="header",W=a(()=>{if(e.kind==="catalog")return jsxRuntime.jsx(dA,{props:e,collapsed:f,appearance:w});if(e.kind==="route")return jsxRuntime.jsx(mA,{props:e,collapsed:f,appearance:w});let H=e.tree;return jsxRuntime.jsx(eu,{...H,classNames:w.unified?Yv(w.itemHeight,w.itemPadding,H.classNames):sA(H.classNames)})},"renderContent");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("aside",{...e.rootDomProps,ref:I,"aria-label":e.ariaLabel,"data-monkeys-component":e.dataComponent??"navigation-sidebar","data-navigation-sidebar-kind":e.kind,"data-navigation-sidebar-preset":e.appearance?.preset,"data-collapsed":f?"true":"false",className:m("relative flex h-full min-h-0 shrink-0 flex-col overflow-visible rounded-[calc(var(--radius)+0.25rem)] border transition-[width,opacity] duration-300 motion-reduce:transition-none",w.root,e.desktopClassName,e.classNames?.root,e.rootDomProps?.className,e.className),style:{...w.unified?qv(e.appearance?.activeVariant):{},...e.style,width:e.widthMode==="fill"?void 0:f?o.collapsedWidth:b,transition:u?"none":e.style?.transition},children:[h?jsxRuntime.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-valuemin":o.minWidth,"aria-valuemax":o.maxWidth,"aria-valuenow":b,"aria-label":R,title:R,className:m("group/resize absolute -right-1.5 bottom-0 top-0 z-40 w-3 cursor-col-resize bg-transparent outline-hidden focus-visible:ring-2 focus-visible:ring-ring",e.classNames?.resizeHandle),onPointerDown:H=>{H.preventDefault(),g(true);},onKeyDown:D,children:jsxRuntime.jsx("span",{className:"pointer-events-none absolute bottom-3 right-1/2 top-3 w-px translate-x-1/2 rounded-full bg-border opacity-0 transition-opacity group-hover/resize:opacity-100 group-focus-visible/resize:opacity-100"})}):null,S==="edge"?E("absolute -right-3 top-1/2 z-50 -translate-y-1/2 border border-border bg-background shadow-sm"):null,M?jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden",children:[P?jsxRuntime.jsxs("div",{className:m("flex min-h-12 min-w-0 items-center gap-2 border-b border-border/60 px-3",w.unified&&"min-h-14 border-border px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))]",f&&"justify-center px-1",e.classNames?.header),children:[V(e.headerLeading)?jsxRuntime.jsx("span",{className:m("flex shrink-0 items-center justify-center",e.classNames?.headerLeading),children:e.headerLeading}):null,!f&&V(e.title)?jsxRuntime.jsx("div",{className:m("min-w-0 flex-1 truncate text-sm font-semibold",e.classNames?.title),children:e.title}):null,!f&&V(e.headerActions)?jsxRuntime.jsx("div",{className:m("flex shrink-0 items-center gap-1",e.classNames?.headerActions),children:e.headerActions}):null,S==="header"?E():null]}):null,!f&&e.search?jsxRuntime.jsx("div",{className:m("px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] pb-2 pt-3",w.unified&&"pb-1",e.classNames?.search),children:jsxRuntime.jsxs("div",{className:m("flex items-center gap-2 rounded-md border border-input bg-[var(--monkeys-component-navigation-sidebar-search-background,hsl(var(--monkeys-color-control-surface)))] px-3 text-muted-foreground ring-offset-control-surface focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",w.searchHeight,w.unified&&"rounded-[var(--radius)] border-border bg-[var(--monkeys-component-navigation-sidebar-search-background,transparent)] px-2"),children:[jsxRuntime.jsx("span",{className:m("flex shrink-0",w.unified&&Xs,e.classNames?.searchIcon),"aria-hidden":"true",children:e.search.icon??jsxRuntime.jsx(ZE,{})}),jsxRuntime.jsx("input",{type:"search",value:x,placeholder:e.search.placeholder,"aria-label":e.search.ariaLabel,className:m("min-w-0 flex-1 bg-transparent text-sm text-foreground outline-hidden placeholder:text-muted-foreground",e.classNames?.searchInput),onChange:H=>{let B=H.currentTarget.value;e.search?.value===void 0&&p(B),e.search?.onValueChange?.(B);}}),x&&e.search.clearLabel?jsxRuntime.jsx("button",{type:"button",className:m("inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",e.classNames?.searchClear),"aria-label":e.search.clearLabel,title:e.search.clearLabel,onClick:()=>{e.search?.value===void 0&&p(""),e.search?.onValueChange?.("");},children:jsxRuntime.jsx(JE,{})}):null]})}):null,jsxRuntime.jsx("div",{className:m("min-h-0 flex-1 overflow-y-auto px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] py-3",w.unified&&e.search&&"pt-1",f&&"px-1.5",e.classNames?.content),children:W()}),V(e.footer)||S==="footer"?jsxRuntime.jsxs("div",{className:m("flex shrink-0 items-center gap-2 border-t border-border/70 p-3",w.unified&&"border-border",f&&"justify-center px-1",e.classNames?.footer),children:[!f&&V(e.footer)?jsxRuntime.jsx("div",{className:"min-w-0 flex-1",children:e.footer}):null,S==="footer"?E():null]}):null]}):null]}),e.kind!=="tree"?jsxRuntime.jsx(bA,{props:e,appearance:w}):null]})}a(gA,"NavigationSidebarInner");var $i=ho.forwardRef(gA);var rw=ho.forwardRef(a(function({title:t,items:o,sections:r=[],activeItemId:n,onItemSelect:i,itemAs:s,collapsed:l,defaultCollapsed:d=false,onCollapsedChange:c,width:p,onWidthChange:u,defaultWidth:g=220,minWidth:f=180,maxWidth:b=420,collapsedWidth:x=60,collapseThreshold:y=140,storageKey:k,resizable:w=true,collapsible:v=true,collapseLabel:h="Collapse sidebar",expandLabel:S="Expand sidebar",resizeLabel:T="Resize sidebar",desktopClassName:C="hidden md:flex",mobileClassName:R="flex md:hidden",className:M,classNames:I,style:A,...N},D){let{level:E,variables:P}=Jh(),W=a(H=>({...H,icon:H.icon??(H.iconName?jsxRuntime.jsx(xf,{icon:{kind:"lucide",name:H.iconName},alt:"",className:"h-4 w-4 rounded-none bg-transparent"}):void 0),endContent:H.endContent??(H.count!==void 0?jsxRuntime.jsx(gc,{children:H.count}):void 0),onClick:a(B=>{H.disabled||(H.onClick?.(B),B.defaultPrevented||i?.({itemId:H.id}));},"onClick")}),"project");return jsxRuntime.jsx(pm,{depth:E,children:jsxRuntime.jsx($i,{ref:D,kind:"catalog",title:t,items:o.map(W),sections:r.map(H=>({...H,items:H.items.map(W)})),activeItemId:n,itemAs:s,collapsed:l,defaultCollapsed:d,onCollapsedChange:c,width:p,onWidthChange:u,defaultWidth:g,minWidth:f,maxWidth:b,collapsedWidth:x,collapseThreshold:y,storageKey:k,resizable:w,collapsible:v,collapsePlacement:"header",collapseLabel:h,expandLabel:S,resizeLabel:T,desktopClassName:C,dataComponent:"workbench-resizable-sidebar",rootDomProps:{...N,"data-workbench-resizable-sidebar":"","data-monkeys-bento-level":E},appearance:{density:"compact",surface:"panel",activeVariant:"soft"},mobile:{mode:"horizontal",className:R},className:m(Zh,"[&>div]:gap-[var(--monkeys-bento-gap)] [--monkeys-sidebar-item-padding:var(--monkeys-bento-gap)] data-[collapsed=true]:[--monkeys-sidebar-item-padding:0px]",I?.root,M),classNames:{root:I?.root,header:m("min-h-0 gap-[var(--monkeys-bento-gap)] border-0 p-0",I?.header),title:m("text-xs font-medium uppercase text-muted-foreground",I?.title),collapseButton:m("h-8 w-8",I?.collapseButton),content:m("space-y-[var(--monkeys-bento-gap)] p-0",I?.list),list:"[&_ul]:gap-[var(--monkeys-bento-gap)]",section:m("mt-[var(--monkeys-bento-gap)]",I?.section),sectionLabel:m("mb-[var(--monkeys-bento-gap)] px-[var(--monkeys-bento-gap)]",I?.sectionLabel),item:m("h-auto min-h-9 gap-[var(--monkeys-bento-gap)] rounded-md px-[var(--monkeys-sidebar-item-padding)] py-[calc(var(--monkeys-bento-gap)/2)] text-sm shadow-none",I?.item),itemIcon:m("[&_svg]:h-3.5 [&_svg]:w-3.5",I?.itemIcon),itemLabel:I?.itemLabel,resizeHandle:I?.resizeHandle,mobileNav:m("gap-[var(--monkeys-bento-gap,var(--global-spacing,0.75rem))] pb-0",I?.mobileNav),mobileItem:m("h-auto min-h-9 w-auto shrink-0 gap-[var(--monkeys-bento-gap,var(--global-spacing,0.75rem))] px-[var(--monkeys-bento-gap,var(--global-spacing,0.75rem))] py-[calc(var(--monkeys-bento-gap,var(--global-spacing,0.75rem))/2)] text-sm",I?.mobileItem)},style:{...P,...A}})})},"WorkbenchResizableSidebar"));function xA(e){return !!(e.header||e.footer||e.bodyAs||e.bodyClassName||e.bodyProps||e.classNames?.body)}a(xA,"shouldRenderBodyWrapper");var nw=ho.forwardRef(a(function({as:t="section",bodyAs:o="div",header:r,footer:n,children:i,className:s,headerClassName:l,bodyClassName:d,footerClassName:c,bodyProps:p,classNames:u,style:g,...f},b){let x=xA({header:r,footer:n,bodyAs:o==="div"?void 0:o,bodyClassName:d,bodyProps:p,classNames:u}),{className:y,...k}=p??{};return jsxRuntime.jsxs(t,{ref:b,"data-workbench-content-pane":true,className:m("workbench-surface-subtle flex h-full min-w-0 flex-1 flex-col overflow-hidden rounded-lg border border-border/50 transition-all duration-300 dark:border-border/40",u?.root,s),style:g,...f,children:[r?jsxRuntime.jsx("div",{className:m("shrink-0 border-b border-border/40 px-4 py-3 dark:border-border/30",u?.header,l),children:r}):null,x?jsxRuntime.jsx(o,{className:m("min-h-0 flex-1 overflow-hidden",u?.body,d,y),...k,children:i}):i,n?jsxRuntime.jsx("div",{className:m("shrink-0 border-t border-border/40 px-4 py-3 dark:border-border/30",u?.footer,c),children:n}):null]})},"WorkbenchContentPane"));var sw={settingsButton:"Gallery settings",title:"Gallery settings",visibleColumns:"Visible fields",coverField:"Cover field",autoDetect:"Auto",cardDensity:"Card density",cardColumns:"Cards per row",detailColumns:"Detail columns",fieldVisibility:"Field visibility",fieldLimit:"Field limit",fieldLimitHint:"Uses current field order",layout:"Gallery layout",compact:"Compact",comfortable:"Standard",detailed:"Detailed",autoColumns:"Auto",columns:a(e=>`${e}`,"columns"),bentoColumns:a(e=>`${e}`,"bentoColumns"),topLimit:"First fields",allFields:"All fields",adaptiveGrid:"Grid",masonry:"Masonry"};function da(e){return String(e?.key||"")}a(da,"normalizeColumnKey");function CA(e){return e.label??e.key}a(CA,"getDefaultColumnLabel");function SA(e){return e.filter(t=>da(t)&&t.hidden!==true).map(t=>da(t))}a(SA,"getDefaultVisibleColumnKeys");function TA({columns:e,visibleColumnKeys:t,allowEmptyVisibleColumns:o}){let r=new Set(e.map(da).filter(Boolean)),n=Array.isArray(t)?t.filter(i=>r.has(String(i))):null;return n&&(n.length||o)?n:SA(e)}a(TA,"getResolvedVisibleColumnKeys");function NA(e){return [{value:"compact",label:e.compact},{value:"comfortable",label:e.comfortable},{value:"detailed",label:e.detailed}]}a(NA,"getDefaultDensityOptions");function RA(e){return [{value:"auto",label:e.autoColumns},{value:1,label:e.columns(1)},{value:2,label:e.columns(2)},{value:3,label:e.columns(3)},{value:4,label:e.columns(4)}]}a(RA,"getDefaultGridColumnOptions");function MA(e){return [{value:1,label:e.bentoColumns(1)},{value:2,label:e.bentoColumns(2)},{value:3,label:e.bentoColumns(3)}]}a(MA,"getDefaultBentoColumnOptions");function IA(e){return [{value:"limit",label:e.topLimit},{value:"all",label:e.allFields}]}a(IA,"getDefaultDetailVisibilityOptions");function DA(e){return [{value:"fixed",label:e.adaptiveGrid},{value:"masonry",label:e.masonry}]}a(DA,"getDefaultLayoutOptions");function Js(e){return String(e)}a(Js,"normalizeOptionValue");function el(e,t,o){let r=String(t??o);return e.some(n=>String(n.value)===r)?r:String(o)}a(el,"getOptionValue");function iw(e){let t=Number.parseInt(e,10);return Number.isFinite(t)?t:1}a(iw,"parseNumberOption");var tl={root:"flex w-full flex-wrap",item:"min-w-[58px] flex-1 px-2 text-[11px]",label:"text-[11px]"};function Df({columns:e=[],galleryFieldOptions:t,value:o,onValueChange:r,labels:n,densityOptions:i,gridColumnOptions:s,bentoColumnOptions:l,detailVisibilityOptions:d,layoutOptions:c,getColumnLabel:p=CA,getColumnDescription:u,showColumnVisibility:g=true,showGalleryControls:f=true,showLayoutControl:b=true,showGridColumns:x=true,showDetailColumns:y=true,allowEmptyVisibleColumns:k=false,className:w,classNames:v}){let h={...sw,...n},S=o||{},T=e.filter(F=>da(F)),C=TA({columns:T,visibleColumnKeys:S.visibleColumnKeys,allowEmptyVisibleColumns:k}),R=new Set(C),M=(t||T).filter(F=>da(F)),I=i||NA(h),A=s||RA(h),N=l||MA(h),D=d||IA(h),E=c||DA(h),P=typeof r=="function",W=a(F=>{r?.({...S,...F},F);},"updateValue"),H=a(F=>{if(!P)return;let _=new Set(C);_.has(F)?_.delete(F):_.add(F);let $=T.map(da).filter(G=>_.has(G));!$.length&&!k&&($=[F]),W({visibleColumnKeys:$});},"toggleColumn"),B=g&&T.length>0,L=f;return jsxRuntime.jsxs("div",{className:m("space-y-3 text-foreground",v?.root,w),children:[B?jsxRuntime.jsxs("section",{className:m("space-y-2",v?.section),children:[jsxRuntime.jsx("div",{className:m("text-[10px] font-medium uppercase tracking-wide text-muted-foreground",v?.sectionHeader),children:h.visibleColumns}),jsxRuntime.jsx("div",{className:m("max-h-[220px] space-y-1 overflow-y-auto pr-1",v?.columnList),children:T.map(F=>{let _=da(F);return jsxRuntime.jsx(ki,{checked:R.has(_),disabled:!P,label:p(F),description:u?.(F),onChange:()=>H(_),className:m("flex w-full rounded-lg px-2 py-1.5 hover:bg-muted/50",v?.columnItem)},`workbench-gallery-column-${_}`)})})]}):null,L?jsxRuntime.jsxs("section",{className:m("space-y-3 border-t border-border/60 pt-3",v?.section),children:[jsxRuntime.jsx(jr,{label:h.coverField,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(Hc,{value:String(S.galleryFieldKey||"auto"),options:[{value:"auto",label:h.autoDetect},...M.map(F=>({value:da(F),label:p(F)}))],disabled:!P,onChange:F=>W({galleryFieldKey:F.currentTarget.value||"auto"}),className:v?.control})}),jsxRuntime.jsx(jr,{label:h.cardDensity,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(sa,{value:el(I,S.galleryDensity,"comfortable"),options:I.map(F=>({value:Js(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryDensity:F}),className:m("w-full",v?.control),classNames:tl})}),x?jsxRuntime.jsx(jr,{label:h.cardColumns,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(sa,{value:el(A,S.galleryGridColumns,"auto"),options:A.map(F=>({value:Js(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryGridColumns:F==="auto"?"auto":iw(F)}),className:m("w-full",v?.control),classNames:tl})}):null,y?jsxRuntime.jsx(jr,{label:h.detailColumns,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(sa,{value:el(N,S.galleryBentoColumns,2),options:N.map(F=>({value:Js(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryBentoColumns:iw(F)}),className:m("w-full",v?.control),classNames:tl})}):null,jsxRuntime.jsx(jr,{label:h.fieldVisibility,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(sa,{value:el(D,S.galleryDetailVisibility,"limit"),options:D.map(F=>({value:Js(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryDetailVisibility:F}),className:m("w-full",v?.control),classNames:tl})}),S.galleryDetailVisibility!=="all"?jsxRuntime.jsx(jr,{label:h.fieldLimit,description:h.fieldLimitHint,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground",description:"text-[10px]"},children:jsxRuntime.jsx(Mc,{type:"number",min:1,step:1,value:String(S.galleryDetailLimit||4),disabled:!P,onChange:F=>W({galleryDetailLimit:F.currentTarget.value}),className:v?.control})}):null,b?jsxRuntime.jsx(jr,{label:h.layout,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(sa,{value:el(E,S.galleryLayout,"fixed"),options:E.map(F=>({value:Js(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryLayout:F}),className:m("w-full",v?.control),classNames:tl})}):null]}):null]})}a(Df,"WorkbenchGallerySettingsPanel");function rl({open:e,defaultOpen:t=false,onOpenChange:o,triggerIcon:r,triggerLabel:n,triggerTitle:i,align:s="end",popoverWidth:l=320,panelHeader:d,panelBefore:c,panelAfter:p,panelClassName:u,buttonClassName:g,popoverClassName:f,buttonClassNames:b,labels:x,className:y,classNames:k,...w}){let v={...sw,...x},h=ho.useRef(null),[S,T]=ho.useState(t),[C,R]=ho.useState({}),M=e!==void 0,I=M?!!e:S,A=a(E=>{M||T(E),o?.(E);},"setOpen");ho.useLayoutEffect(()=>{if(!I)return;let E=a(()=>{let H=h.current?.getBoundingClientRect();if(!H||typeof window>"u")return;let B=12,L=Math.max(window.innerWidth-B*2,0),F=Math.min(l,L||l),_=s==="start"?H.left:H.right-F,$=Math.min(Math.max(_,B),Math.max(window.innerWidth-F-B,B)),G=Math.min(H.bottom+8,Math.max(window.innerHeight-80,B));R({left:$,top:G,width:F,maxHeight:`calc(100vh - ${Math.round(G+B)}px)`});},"updatePopoverPosition"),P=a(H=>{h.current?.contains(H.target)||A(false);},"handlePointerDown"),W=a(H=>{H.key==="Escape"&&A(false);},"handleKeyDown");return E(),window.addEventListener("resize",E),window.addEventListener("scroll",E,true),window.addEventListener("pointerdown",P),window.addEventListener("keydown",W),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,true),window.removeEventListener("pointerdown",P),window.removeEventListener("keydown",W);}},[s,I,l]);let N=n??v.settingsButton,D=d??v.title;return jsxRuntime.jsxs("div",{ref:h,className:m("relative inline-flex",b?.root,y),children:[jsxRuntime.jsx(dt,{icon:r,label:N,title:i||(typeof N=="string"?N:void 0),iconOnly:!!r,active:I,tone:"muted","aria-haspopup":"dialog","aria-expanded":I,className:m(b?.trigger,g),onClick:()=>A(!I)}),I?jsxRuntime.jsxs("div",{role:"dialog","aria-label":typeof D=="string"?D:void 0,className:m("fixed z-50 overflow-y-auto rounded-xl border border-border bg-card p-3 text-foreground shadow-lg",s==="start"?"origin-top-left":"origin-top-right",b?.popover,f),style:C,children:[D?jsxRuntime.jsx("div",{className:m("mb-3 text-[11px] font-medium text-foreground",b?.header),children:D}):null,c,jsxRuntime.jsx(Df,{...w,labels:v,className:m(b?.panel,u),classNames:k}),p]}):null]})}a(rl,"WorkbenchGallerySettingsButton");function uw(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),jsxRuntime.jsx("path",{d:"M3 10h18M9 4v16"})]})}a(uw,"TableViewIcon");function pw(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),jsxRuntime.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),jsxRuntime.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}),jsxRuntime.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1.5"})]})}a(pw,"GalleryViewIcon");function lw(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 7h-9M7 7H4M14 17H4M20 17h-3"}),jsxRuntime.jsx("circle",{cx:"9",cy:"7",r:"2"}),jsxRuntime.jsx("circle",{cx:"16",cy:"17",r:"2"})]})}a(lw,"SettingsIcon");function LA({open:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:m("h-3 w-3 opacity-55 transition-transform",e&&"rotate-180"),fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}a(LA,"ChevronDownIcon");var WA=[{value:"list",label:"Table view",icon:jsxRuntime.jsx(uw,{})},{value:"gallery",label:"Gallery view",icon:jsxRuntime.jsx(pw,{})}];function dw(e){return e.icon!==void 0?e.icon:e.value==="list"||e.value==="table"?jsxRuntime.jsx(uw,{}):e.value==="gallery"?jsxRuntime.jsx(pw,{}):null}a(dw,"getViewModeOptionIcon");function cw(e){return e.triggerLabel??e.labels?.settingsButton??"Settings"}a(cw,"getSettingsTriggerLabel");function zA({value:e,options:t,onValueChange:o,classNames:r}){let n=ho.useRef(null),[i,s]=ho.useState(false),l=t.find(c=>c.value===e)||t.find(c=>!c.disabled)||t[0],d=l?dw(l):null;return ho.useEffect(()=>{if(!i)return;let c=a(u=>{n.current?.contains(u.target)||s(false);},"handlePointerDown"),p=a(u=>{u.key==="Escape"&&s(false);},"handleKeyDown");return window.addEventListener("pointerdown",c),window.addEventListener("keydown",p),()=>{window.removeEventListener("pointerdown",c),window.removeEventListener("keydown",p);}},[i]),l?jsxRuntime.jsxs("div",{ref:n,className:m("relative inline-flex",r?.viewModeRoot),children:[jsxRuntime.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-expanded":i,className:m("inline-flex h-7 min-w-0 items-center justify-center gap-1.5 rounded-md border border-border/70 bg-card px-2 text-xs font-medium text-foreground shadow-none transition-colors hover:bg-muted/50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/25",r?.viewModeTrigger),onClick:()=>s(c=>!c),children:[d?jsxRuntime.jsx("span",{className:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center text-muted-foreground",children:d}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:l.label}),jsxRuntime.jsx(LA,{open:i})]}),i?jsxRuntime.jsx("div",{role:"listbox",className:m("absolute left-0 top-full z-50 mt-2 min-w-[160px] overflow-hidden rounded-xl border border-border/60 bg-card/95 p-1.5 text-xs text-foreground shadow-lg backdrop-blur-xl",r?.viewModeMenu),children:t.map(c=>{let p=c.value===l.value,u=dw(c);return jsxRuntime.jsxs("button",{type:"button",role:"option","aria-selected":p,disabled:c.disabled,className:m("flex min-h-8 w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/55 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",p&&"bg-muted/60 text-foreground",r?.viewModeItem),onClick:()=>{c.disabled||(o?.(c.value,c),s(false));},children:[u?jsxRuntime.jsx("span",{className:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:u}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:c.label})]},c.value)})}):null]}):null}a(zA,"WorkbenchContentToolbarViewModeControl");var cu=ho.forwardRef(a(function({as:t="div",children:o,end:r,viewMode:n,viewModeOptions:i,onViewModeChange:s,gallerySettings:l,gallerySettingsPlacement:d="start",className:c,startClassName:p,endClassName:u,classNames:g,...f},b){let x=i||(n?WA:[]),y=l&&typeof l=="object"?l:null,k=!!x.length,w=!!y,v=w&&d!=="end",h=w&&d==="end",S=k||v||!!o,T=!!r||h;return jsxRuntime.jsxs(t,{ref:b,"data-workbench-content-toolbar":true,className:m("flex min-h-[46px] shrink-0 flex-col gap-2 border-b border-border/60 px-4 py-2 md:flex-row md:items-center md:justify-between",g?.root,c),...f,children:[S?jsxRuntime.jsxs("div",{className:m("flex flex-wrap items-center gap-2",g?.start,p),children:[k?jsxRuntime.jsx(zA,{value:n,options:x,onValueChange:s,classNames:g}):null,v&&y?jsxRuntime.jsx(rl,{align:"end",triggerIcon:jsxRuntime.jsx(lw,{}),triggerLabel:cw(y),...y,buttonClassName:m("!h-7 !w-7 !min-h-0 !rounded-md !p-0 text-xs",g?.settings,y.buttonClassName)}):null,o]}):null,T?jsxRuntime.jsxs("div",{className:m("flex shrink-0 items-center gap-2",g?.end,u),children:[r,h&&y?jsxRuntime.jsx(rl,{align:"end",triggerIcon:jsxRuntime.jsx(lw,{}),triggerLabel:cw(y),...y,buttonClassName:m("!h-7 !w-7 !min-h-0 !rounded-md !p-0 text-xs",g?.settings,y.buttonClassName)}):null]}):null]})},"WorkbenchContentToolbar"));function HA(e){return !!(e.header||e.footer||e.bodyAs||e.bodyClassName||e.bodyProps||e.classNames?.body)}a(HA,"shouldRenderBodyWrapper");function gw(e){if(e==null||typeof e=="boolean")return false;if(typeof e=="string")return e.trim().length>0;if(Array.isArray(e))return e.some(gw);let t=ho.Children.toArray(e);return t.length?t.some(o=>typeof o=="string"?o.trim().length>0:true):false}a(gw,"hasRenderableChildren");function VA(e,t){return t===void 0?{}:e===void 0?{width:t}:{width:e?t:0,opacity:e?1:0}}a(VA,"resolveWidthStyle");function mw(e){return e.label??e.key}a(mw,"getFallbackFieldLabel");function _A(e){let t=["text","label","title","display","value","recordId"];for(let o of t){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let r=e[o];if(r!=null&&r!=="")return r}}a(_A,"getObjectDisplayValue");function fw(e){return e==null||e===""}a(fw,"isEmptyDetailValue");function bw(e){return ["string","number","boolean"].includes(typeof e)}a(bw,"isPlainDisplayValue");function hw(e){if(!e)return null;if(typeof e=="string"){let r=e.startsWith("data:image/"),n=/\.(avif|gif|jpe?g|png|svg|webp)(\?.*)?$/i.test(e);return r||n?{src:e}:null}if(typeof e!="object"||ho.isValidElement(e))return null;let t=e,o=t.src||t.url||t.thumbnail||t.preview||t.image;return o?{src:String(o),alt:t.alt||t.label||t.title||"",caption:t.caption||t.description||t.label||t.title}:null}a(hw,"getMediaDisplayData");function GA(e,t){let o=String(e?.renderType||"").toLowerCase();return ["image","media","preview","thumbnail"].includes(o)||!!hw(t)}a(GA,"shouldRenderAsMedia");function $A(e,t){return e?typeof e=="string"||typeof e=="number"?jsxRuntime.jsx("span",{className:m("inline-flex h-3.5 min-w-3.5 shrink-0 items-center justify-center rounded-sm text-[10px] font-semibold text-primary",t),children:e}):typeof e=="boolean"?null:ho.isValidElement(e)?e:jsxRuntime.jsx(e,{className:m("h-3.5 w-3.5 shrink-0 text-primary",t)}):jsxRuntime.jsxs("span",{className:m("relative inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",t),children:[jsxRuntime.jsx("span",{className:"absolute inset-0 rounded-full border border-primary/25 bg-primary/10"}),jsxRuntime.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary"})]})}a($A,"renderMaybeFieldIcon");function jA(e,t,o){return jsxRuntime.jsxs("span",{className:m("inline-flex min-w-0 items-center gap-1.5 text-[11px] font-semibold text-foreground",o?.fieldLabel),children:[$A(t.labelIcon||t.icon,o?.fieldLabelIcon),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:e})]})}a(jA,"renderDetailFieldLabel");function UA({media:e,classNames:t}){return jsxRuntime.jsxs("div",{className:m("grid gap-2",t?.mediaValue),children:[jsxRuntime.jsx("div",{className:"overflow-hidden rounded-md border border-border/55 bg-muted/20 dark:border-border/45 dark:bg-muted/10",children:jsxRuntime.jsx("img",{src:e.src,alt:String(e.alt||""),className:m("block aspect-[16/9] w-full object-cover",t?.mediaImage)})}),e.caption?jsxRuntime.jsx("div",{className:m("truncate text-[11px] leading-4 text-muted-foreground",t?.mediaCaption),children:e.caption}):null]})}a(UA,"WorkbenchDetailSidebarMediaValue");function Pf(e,t,o,r){if(fw(e))return t;if(ho.isValidElement(e))return e;if(GA(o,e)){let n=hw(e);if(n)return jsxRuntime.jsx(UA,{media:n,classNames:r})}if(Array.isArray(e)){let n=e.map(i=>Pf(i,"",void 0,r)).filter(i=>!fw(i));return n.length?n.every(bw)?n.map(String).join(" \xB7 "):jsxRuntime.jsx("span",{className:"inline-flex flex-wrap items-center gap-1",children:n.map((i,s)=>jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1",children:[s>0?jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"\xB7"}):null,bw(i)?String(i):i]},s))}):t}if(typeof e=="object"){let n=_A(e);return n===void 0?t:Pf(n,t,o,r)}return String(e)}a(Pf,"getDefaultDetailDisplayValue");function KA(e,t){return Object.prototype.hasOwnProperty.call(e,"value")?typeof e.value=="function"?e.value(t,e):e.value:t?t?.[e.key]:void 0}a(KA,"getDefaultFieldValue");function qA(e,t){return typeof e.hidden=="function"?e.hidden(e,t):!!e.hidden}a(qA,"shouldHideField");function YA(e,t){return typeof e.hidden=="function"?e.hidden(e,t):!!e.hidden}a(YA,"shouldHideSection");function XA({record:e,fields:t,sections:o,fieldColumns:r=1,emptyValue:n="\u2014",emptyState:i,getFieldValue:s,renderFieldValue:l,formatFieldValue:d,formatFieldLabel:c,classNames:p}){let g=(o?.length?o:t?.length?[{fields:t,columns:r}]:[]).filter(f=>!YA(f,e));return g.length?jsxRuntime.jsx("div",{className:m("space-y-3",p?.autoBody),children:g.map((f,b)=>{let x=(f.fields||[]).filter(w=>!qA(w,e)),y=f.id||`section-${b}`;if(!x.length&&!f.emptyState)return null;let k=x.map((w,v)=>{let h={field:w,fieldIndex:v,section:f,sectionIndex:b,record:e},S=s?s(w,e,h):KA(w,e),T=l?l(w,e,h):d?d(S,h):Pf(S,w.emptyValue??n,w,p),C=c?c(mw(w),h):mw(w);return {term:jA(C,w,p),value:T}});return jsxRuntime.jsxs("section",{className:m("min-w-0 space-y-3",p?.section),children:[f.title||f.description?jsxRuntime.jsxs("div",{className:m("min-w-0 space-y-1.5",p?.sectionHeader),children:[f.title?jsxRuntime.jsx("div",{className:m("inline-flex max-w-full items-center gap-2 rounded-md border border-primary/20 bg-primary/5 px-2.5 py-1.5 text-xs font-medium text-primary dark:border-primary/25 dark:bg-primary/10",p?.sectionTitle),children:f.title}):null,f.description?jsxRuntime.jsx("div",{className:m("text-[11px] leading-5 text-muted-foreground",p?.sectionDescription),children:f.description}):null]}):null,k.length?jsxRuntime.jsx(kc,{items:k,columns:f.columns||r,className:m("gap-3",p?.descriptionList),classNames:{item:m("!border-0 !bg-transparent !p-0 !shadow-none !gap-1.5",p?.descriptionListItem),term:m("!normal-case !tracking-normal !text-foreground",p?.descriptionListTerm),value:m("min-h-10 rounded-md border border-border/55 bg-muted/25 px-3 py-2 text-xs leading-5 text-foreground shadow-[inset_0_1px_0_hsl(var(--background)/0.8)] dark:border-border/45 dark:bg-white/[0.035]",p?.fieldValue,p?.descriptionListValue)}}):jsxRuntime.jsx("div",{className:m("py-3 text-center text-xs text-muted-foreground",p?.emptyState),children:f.emptyState})]},y)})}):i?jsxRuntime.jsx("div",{className:m("rounded-lg border border-dashed border-border/60 px-3 py-6 text-center text-xs text-muted-foreground",p?.emptyState),children:i}):null}a(XA,"WorkbenchDetailSidebarAutoContent");var yw=ho.forwardRef(a(function({as:t="aside",bodyAs:o="div",open:r,width:n,header:i,footer:s,resizeHandle:l,children:d,record:c,fields:p,sections:u,fieldColumns:g,emptyValue:f,emptyState:b,getFieldValue:x,renderFieldValue:y,formatFieldValue:k,formatFieldLabel:w,className:v,headerClassName:h,bodyClassName:S,footerClassName:T,resizeHandleClassName:C,bodyProps:R,classNames:M,style:I,...A},N){let D=gw(d)?d:jsxRuntime.jsx(XA,{record:c,fields:p,sections:u,fieldColumns:g,emptyValue:f,emptyState:b,getFieldValue:x,renderFieldValue:y,formatFieldValue:k,formatFieldLabel:w,classNames:M}),E=HA({header:i,footer:s,bodyAs:o==="div"?void 0:o,bodyClassName:S,bodyProps:R,classNames:M}),{className:P,...W}=R??{};return jsxRuntime.jsxs(t,{ref:N,"data-workbench-detail-sidebar":true,"data-open":r===void 0?void 0:r?"true":"false",className:m("workbench-surface-subtle relative flex flex-shrink-0 flex-col self-stretch overflow-hidden rounded-lg border border-border/50 transition-all duration-300 dark:border-border/40",r===false&&"pointer-events-none",M?.root,v),style:{...VA(r,n),...I},...A,children:[l?jsxRuntime.jsx("div",{className:m(M?.resizeHandle,C),children:l}):null,i?jsxRuntime.jsx("div",{className:m("shrink-0 border-b border-border/40 px-4 py-3 dark:border-border/30",M?.header,h),children:i}):null,E?jsxRuntime.jsx(o,{className:m("min-h-0 flex-1 overflow-y-auto",M?.body,S,P),...W,children:D}):D,s?jsxRuntime.jsx("div",{className:m("shrink-0 border-t border-border/40 px-4 py-3 dark:border-border/30",M?.footer,T),children:s}):null]})},"WorkbenchDetailSidebar"));function vw(e){return typeof e=="function"?true:typeof e=="object"&&e!==null&&!ho.isValidElement(e)&&"$$typeof"in e}a(vw,"isWorkbenchIconComponent");function nl(e,t){return e?ho.isValidElement(e)?e:vw(e)?jsxRuntime.jsx(e,{className:t}):e:null}a(nl,"renderWorkbenchIcon");function ww(e){return !e||!vw(e)?null:e}a(ww,"getWorkbenchIconComponent");function JA(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(JA,"toCssSize");var eB=160,tB=56,oB=128;function kw(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return;let t=e.trim().match(/^(\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}a(kw,"numericCssSize");function Tw(e,t){return e.renderType==="icon"?tB:t?oB:eB}a(Tw,"defaultWorkbenchColumnWidth");function Cw(e,t,o){return t??kw(e.width)??kw(e.minWidth)??Tw(e,o)}a(Cw,"resolvedWorkbenchColumnWidth");function rB(e){return e==null||e===false?null:e}a(rB,"defaultFormatLabel");function Sw(e){if(typeof e=="string"||typeof e=="number")return String(e)}a(Sw,"toTitle");function nB(e,t){return e?.id??e?.key??e?.linkKey??t}a(nB,"defaultGetRowKey");function aB(e){return e?.linkKey??e?.id??e?.key}a(aB,"defaultGetRowSelectionKey");function iB(e,t){if(!t?.length)return e;let o=new Map(e.map(s=>[s.key,s])),r=t.map(s=>o.get(s)).filter(Boolean),n=new Set(r.map(s=>s.key)),i=e.filter(s=>!n.has(s.key));return [...r,...i]}a(iB,"getOrderedColumns");function Lf(e,t){let o=new Set(e),r=(t||[]).filter(s=>o.has(s)),n=new Set(r),i=e.filter(s=>!n.has(s));return [...r,...i]}a(Lf,"normalizeColumnOrder");function sB({helperText:e,className:t}){return V(e)?jsxRuntime.jsxs("span",{className:m("group relative inline-flex items-center",t),children:[jsxRuntime.jsx("button",{type:"button",title:Sw(e),"aria-label":Sw(e)||"Field help",className:"inline-flex h-4 w-4 items-center justify-center rounded-md border border-border/60 bg-background text-xs font-semibold normal-case tracking-normal text-muted-foreground shadow-sm transition-colors hover:border-primary/40 hover:text-primary focus-visible:border-primary/40 focus-visible:text-primary focus-visible:outline-hidden",onClick:o=>o.stopPropagation(),children:"?"}),jsxRuntime.jsx("span",{role:"tooltip",className:"pointer-events-none absolute left-1/2 top-full z-40 mt-2 hidden w-72 -translate-x-1/2 whitespace-pre-line rounded-lg border border-border/60 bg-card px-3 py-2 text-xs font-normal normal-case leading-5 tracking-normal text-foreground shadow-sm backdrop-blur-sm group-hover:block group-focus-within:block",children:e})]}):null}a(sB,"WorkbenchTableHeaderHelper");function Nw({rows:e=[],columns:t=[],onRowClick:o,selectedRowKey:r,selectedLinkKey:n,activePrimaryColumn:i,activeTablePrimaryColumn:s,renderedRowCount:l,totalRowCount:d,tableMinWidth:c,minWidth:p,bodyMaxHeight:u="min(58vh, 38rem)",stickyFirstColumn:g=true,appearance:f,headerPresentation:b,fillRemainingWidthColumnKey:x,columnOrder:y,columnSizes:k,columnDragEnabled:w,columnResizeEnabled:v,className:h,tableClassName:S,rowClassName:T,classNames:C,style:R,renderCell:M,renderFieldValue:I,renderColumnHeader:A,onColumnOrderChange:N,onColumnSizeChange:D,onSort:E,formatLabel:P=rB,getColumnDataType:W,getColumnIcon:H,getColumnTypeIcon:B,getRowKey:L=nB,getRowSelectionKey:F=aB,isActionColumn:_,isActionField:$,isRowDisabled:G,isWorkbenchPlaceholderRow:z,emptyState:re="-",hiddenRowsMessage:Z,scrollFooter:ae,scrollRestoration:ee}){let q=t.map(se=>se.key).join(""),U=ho.useMemo(()=>q?q.split(""):[],[q]),[X,O]=ho.useState(U),[K,ne]=ho.useState({}),fe=ho.useRef(null),he=ho.useRef(new Map),me=ho.useRef(ee);me.current=ee;let ie=ho.useRef(void 0),be=ho.useCallback(()=>{let se=fe.current,te=me.current;if(!se||!te||ie.current!==te.key)return;let Te=se.getBoundingClientRect().top,ze=Array.from(he.current.entries()).find(([,je])=>je.getBoundingClientRect().bottom>Te);te.write({x:se.scrollLeft,y:se.scrollTop,...ze?{rowKey:ze[0],rowOffset:ze[1].getBoundingClientRect().top-Te}:{}});},[]);ho.useEffect(()=>{let se=fe.current,te=me.current;if(!se||!te||ie.current===te.key||e.length===0)return;let Te=te.read(),ze=a(()=>{let Y=Te?.rowKey?he.current.get(Te.rowKey):void 0,pe=Y&&typeof Te?.rowOffset=="number"?se.scrollTop+Y.getBoundingClientRect().top-se.getBoundingClientRect().top-Te.rowOffset:Te?.y??0;se.scrollTo({left:Te?.x??0,top:Math.max(0,pe),behavior:"auto"}),ie.current=te.key;},"restore"),je=se.ownerDocument.defaultView;if(!je){ze();return}let it=je.requestAnimationFrame(ze);return ()=>je.cancelAnimationFrame(it)},[e,ee?.key]),ho.useEffect(()=>{let se=fe.current?.ownerDocument.defaultView;return se?.addEventListener("pagehide",be),()=>{se?.removeEventListener("pagehide",be),be();}},[be]);let[He,We]=ho.useState();ho.useEffect(()=>{O(se=>Lf(U,se));},[U]);let Ke=y?Lf(U,y):X,ce=k??K,Q=ho.useCallback((se,te)=>{let Te=Lf(U,se);y||O(Te),N?.(Te,te);},[y,U,N]),ge=ho.useCallback((se,te,Te)=>{k||ne(ze=>({...ze,[se]:te})),D?.(se,te,Te);},[k,D]),we=r??n,Ie=i??s,oe=iB(t,Ke),xe=x?oe.reduce((se,te)=>te.key===x?se:se+Cw(te,ce[te.key],_?.(te)??$?.(te)??false),0):void 0,Ve=x&&xe!==void 0&&He!==void 0?Math.max(0,Math.round(He-xe)):void 0,_e=oe.flatMap(se=>se.key!==x?[se]:Ve===0?[]:Ve===void 0?[se]:[{...se,width:Ve,minWidth:Ve,maxWidth:Ve}]),Ge=Math.max(0,Number(d||e.length)-Number(l||e.length)),le=M??I??((se,te)=>te?.[se.key]),Me=_??$??(()=>false),Ae=G??z??(()=>false),J=H??B,$e=xe!==void 0&&Ve!==void 0?xe+Ve:void 0,ue=$e??c??p??Math.max(760,_e.reduce((se,te)=>se+Cw(te,ce[te.key],Me(te)),0));ho.useEffect(()=>{if(!x){We(void 0);return}let se=fe.current;if(!se)return;let te=se.ownerDocument.defaultView,Te=a(()=>{let it=Math.round(se.getBoundingClientRect().width);!Number.isFinite(it)||it<=0||We(Y=>Y===it?Y:it);},"updateWidth");Te();let ze=te?.ResizeObserver,je=ze?new ze(Te):void 0;return je?.observe(se),te?.addEventListener("resize",Te),()=>{je?.disconnect(),te?.removeEventListener("resize",Te);}},[x]);let Re=Ge>0&&Z?typeof Z=="function"?Z(Ge,l||e.length,d||e.length):Z:null;return jsxRuntime.jsxs(Li,{appearance:f,className:m("w-full overflow-hidden rounded-lg border border-border/40 bg-muted/15 dark:border-border/35 dark:bg-muted/10",C?.root,h),style:u==="100%"?{display:"flex",minHeight:0,flex:1,flexDirection:"column",...R}:R,children:[jsxRuntime.jsxs("div",{ref:fe,onScroll:be,className:m("w-full overflow-auto",C?.scrollArea),style:{maxHeight:JA(u),...u==="100%"?{minHeight:0,flex:1}:{}},children:[jsxRuntime.jsxs(Wi,{appearance:f,columnOrder:Ke,columnSizes:ce,columnDragEnabled:w,columnResizeEnabled:v,onColumnOrderChange:Q,onColumnSizeChange:ge,className:m("w-full table-auto text-left text-xs",C?.table,S),style:{width:$e,minWidth:ue},children:[jsxRuntime.jsx(zi,{appearance:f,className:m("z-20 text-xs font-sans text-muted-foreground",C?.header),children:jsxRuntime.jsx(vn,{className:m("hover:bg-transparent",C?.headerRow),children:_e.map((se,te)=>{let Te=Tw(se,Me(se)),ze=se.renderType||se.type||W?.(se.key,e,se),je=nl(J?.(ze,se),"h-3.5 w-3.5 shrink-0 text-primary"),Y=_e[te-1]?.renderType==="icon"&&se.key===Ie?.key,pe=A?A(se,{column:se,columnIndex:te,columns:_e,rows:e,columnType:ze}):P(se.label,{column:se}),Be=!A&&(V(se.trailing)||V(se.helperText))?jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[V(se.trailing)?P(se.trailing,{column:se}):null,jsxRuntime.jsx(sB,{helperText:P(se.helperText,{column:se}),className:C?.helper})]}):void 0,rt=!!se.sortable,Ce=rt&&E?()=>E(se.key,se):void 0;return jsxRuntime.jsx(Fi,{appearance:f,presentation:b,columnId:se.key,align:se.align,icon:A?void 0:je,label:pe,description:A?void 0:P(se.description,{column:se}),meta:A?void 0:P(se.meta,{column:se}),actions:se.actions,trailing:Be,sortable:rt,sortDirection:se.sortDirection,sortLabel:se.sortLabel,onSort:Ce,draggable:se.draggable,dragLabel:se.dragLabel,resizable:se.resizable,resizeLabel:se.resizeLabel,width:se.width??Te,minWidth:typeof se.minWidth=="number"?se.minWidth:void 0,maxWidth:typeof se.maxWidth=="number"?se.maxWidth:void 0,className:m("sticky top-0 z-20 h-auto whitespace-nowrap bg-card/95 px-4 py-3 font-medium backdrop-blur-sm supports-[backdrop-filter]:bg-card/90",g&&te===0&&"md:left-0 md:z-30 md:shadow-[1px_0_0_0_hsl(var(--border)/0.35)]",se.compactHeaderClassName,se.renderType==="icon"&&"pl-3 pr-1",Y&&"pl-2",C?.headerCell,se.headerClassName),style:{minWidth:typeof se.minWidth=="string"?se.minWidth:void 0,maxWidth:typeof se.maxWidth=="string"?se.maxWidth:void 0,...se.headerStyle}},se.key)})})}),jsxRuntime.jsx(Oi,{appearance:f,className:m("divide-y divide-border/35 dark:divide-border/30",C?.body),children:e.length?e.map((se,te)=>{let Te=L(se,te),ze=Ae(se,te),je=F(se,te),it=!!(we&&String(je)===String(we)),Y=typeof T=="function"?T(se,te):T;return jsxRuntime.jsx(vn,{appearance:f,ref:pe=>{pe?he.current.set(String(Te),pe):he.current.delete(String(Te));},interactive:!!o&&!ze,"data-item-key":String(Te),tabIndex:o&&!ze?0:void 0,selected:it,disabled:ze,onClick:pe=>{ze||(o&&pe.currentTarget.focus({preventScroll:true}),o?.(se,te));},onKeyDown:pe=>{pe.target!==pe.currentTarget||ze||!o||!["Enter"," "].includes(pe.key)||(pe.preventDefault(),o(se,te));},className:m(o&&!ze?"cursor-pointer":"cursor-default",it?"bg-primary/10 hover:bg-primary/15":ze?"":"hover:bg-muted/25 dark:hover:bg-muted/15",C?.row,Y),children:_e.map((pe,Be)=>{let rt=Me(pe)||pe.wrap===true,Xe=_e[Be-1]?.renderType==="icon"&&pe.key===Ie?.key;return jsxRuntime.jsx(Ha,{appearance:f,align:pe.align,className:m(rt?"align-top whitespace-normal":"whitespace-nowrap","px-4 py-3 text-muted-foreground",!rt&&"overflow-hidden text-ellipsis",g&&Be===0&&"md:sticky md:left-0 md:z-10 md:bg-card/95 md:text-foreground md:shadow-[1px_0_0_0_hsl(var(--border)/0.3)]",pe.compactCellClassName,pe.renderType==="icon"&&"pl-3 pr-1",Xe&&"pl-2",C?.cell,pe.cellClassName),style:pe.cellStyle,children:le(pe,se,{row:se,rowIndex:te,column:pe,columnIndex:Be,compact:true,surface:"list"})},`${Te}-${pe.key}`)})},Te)}):jsxRuntime.jsx(Hi,{appearance:f,colSpan:Math.max(_e.length,1),classNames:{cell:"px-4 py-10 text-center text-sm text-muted-foreground"},children:re})})]}),V(ae)?jsxRuntime.jsx("div",{style:{minWidth:ue},children:ae}):null]}),Re?jsxRuntime.jsx("div",{className:m("border-t border-border/40 px-4 py-2 text-xs text-muted-foreground dark:border-border/30",C?.footer),children:Re}):null]})}a(Nw,"WorkbenchTableView");function Wf(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(Wf,"toCssSize");function Ki(){return typeof window<"u"}a(Ki,"isBrowser");function Mw(e,t){return e?.id??e?.key??t}a(Mw,"defaultGetRowKey");function fu(e){return typeof e.width=="number"?e.width:typeof e.minWidth=="number"?e.minWidth:160}a(fu,"getColumnDefaultSize");function lB(e,t){return e.reduce((o,r)=>(o[r.key]=t?.[r.key]??fu(r),o),{})}a(lB,"buildDefaultColumnSizes");function Iw(e,t){if(!e||!Ki())return t;try{let o=JSON.parse(window.localStorage.getItem(e)||"{}");return Object.keys(t).reduce((r,n)=>{let i=Number(o?.[n]);return r[n]=Number.isFinite(i)?i:t[n],r},{})}catch{return t}}a(Iw,"loadStoredColumnSizes");function Dw(e,t){!e||!Ki()||window.localStorage.setItem(e,JSON.stringify(t));}a(Dw,"persistColumnSizes");function Ww(e){return e?`${e}.frozenColumnCount`:void 0}a(Ww,"getFrozenColumnStorageKey");function zw(e){return e?`${e}.frozenEndColumnCount`:void 0}a(zw,"getFrozenEndColumnStorageKey");function ca(e,t){return Number.isFinite(e)?Math.max(0,Math.min(Math.round(e),t)):0}a(ca,"clampFrozenColumnCount");function dB(e,t,o){let r=ca(e,o),n=ca(t,Math.max(0,o-r));return {startCount:r,endCount:n}}a(dB,"normalizeFrozenColumnCounts");function Pw(e,t,o){let r=ca(t,o),n=Ww(e);if(!n||!Ki())return r;try{let i=window.localStorage.getItem(n);if(i===null)return r;let s=Number(i);return Number.isFinite(s)?ca(s,o):r}catch{return r}}a(Pw,"loadStoredFrozenColumnCount");function cB(e,t){let o=Ww(e);!o||!Ki()||window.localStorage.setItem(o,String(t));}a(cB,"persistFrozenColumnCount");function Ew(e,t,o){let r=ca(t,o),n=zw(e);if(!n||!Ki())return r;try{let i=window.localStorage.getItem(n);if(i===null)return r;let s=Number(i);return Number.isFinite(s)?ca(s,o):r}catch{return r}}a(Ew,"loadStoredFrozenEndColumnCount");function uB(e,t){let o=zw(e);!o||!Ki()||window.localStorage.setItem(o,String(t));}a(uB,"persistFrozenEndColumnCount");function mu(e,t){let o=new Set(e),r=(t||[]).filter(s=>o.has(s)),n=new Set(r),i=e.filter(s=>!n.has(s));return [...r,...i]}a(mu,"normalizeColumnOrder");function pB(e,t){let o=mu(e.map(n=>n.key),t),r=new Map(e.map(n=>[n.key,n]));return o.map(n=>r.get(n)).filter(Boolean)}a(pB,"getOrderedColumns");function ll(e,t){let o=t[e.key];return typeof o=="number"?o:fu(e)}a(ll,"getColumnNumericWidth");function mB(e,t,o){let r=new Map,n=0;return e.slice(0,Math.max(0,o)).forEach(i=>{r.set(i.key,n),n+=ll(i,t);}),r}a(mB,"buildFrozenOffsets");function fB(e,t,o){let r=new Map,n=0;return e.slice(Math.max(0,e.length-o)).reverse().forEach(i=>{r.set(i.key,n),n+=ll(i,t);}),r}a(fB,"buildFrozenEndOffsets");function Aw(e,t,o){return typeof e=="function"?e(t,o):e}a(Aw,"resolveRowClassName");function Bw(e,t){let o=t?.[e.key];return o==null||o===""?"\u2014":String(o)}a(Bw,"renderDefaultCell");function Lw({children:e,wrap:t}){return jsxRuntime.jsx("div",{className:m("min-w-0 max-w-full overflow-auto overscroll-contain [scrollbar-width:thin]",t?"max-h-20 whitespace-pre-wrap break-words leading-5":"whitespace-nowrap"),children:e})}a(Lw,"InteractiveTableCellContent");function bB({className:e}){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:e,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",children:[jsxRuntime.jsx("path",{d:"M5.25 2.75h5.5"}),jsxRuntime.jsx("path",{d:"M6.25 2.75v4L4.5 9.25h7L9.75 6.75v-4"}),jsxRuntime.jsx("path",{d:"M8 9.25v4"})]})}a(bB,"PinIcon");function Ow({rows:e=[],columns:t=[],pinnedTopRows:o=[],getRowKey:r=Mw,getPinnedTopRowKey:n=Mw,renderCell:i,renderPinnedTopCell:s,renderColumnHeader:l,onRowClick:d,getRowState:c,rowClassName:p,pinnedTopRowClassName:u,emptyState:g="\u2014",columnMenuLabels:f,columnStorageKey:b,columnOrder:x,columnSizes:y,defaultColumnSizes:k,columnDragEnabled:w=false,columnResizeEnabled:v=true,frozenColumnCount:h=0,frozenEndColumnCount:S=0,tableMinWidth:T,bodyMaxHeight:C="min(60vh, 42rem)",appearance:R,className:M,tableClassName:I,classNames:A,style:N,onColumnOrderChange:D,onColumnSizeChange:E,onResetColumnSizes:P,onFrozenColumnCountChange:W,onFrozenEndColumnCountChange:H,onSort:B}){let L=Ye().workbench.interactiveTable,F=t.map(oe=>oe.key).join(""),_=ho.useMemo(()=>F?F.split(""):[],[F]),$=ho.useMemo(()=>lB(t,k),[t,k]),[G,z]=ho.useState(_),[re,Z]=ho.useState(()=>Iw(b,$)),[ae,ee]=ho.useState(()=>Pw(b,h,t.length)),[q,U]=ho.useState(()=>Ew(b,S,t.length));ho.useEffect(()=>{z(oe=>mu(_,oe));},[_]),ho.useEffect(()=>{y||Z(Iw(b,$));},[y,b,$]),ho.useEffect(()=>{ee(Pw(b,h,t.length));},[b,t.length,h]),ho.useEffect(()=>{U(Ew(b,S,t.length));},[b,t.length,S]);let X=x?mu(_,x):G,O=y??re,K=pB(t,X),{startCount:ne,endCount:fe}=dB(ae,q,K.length),he=mB(K,O,ne),me=fB(K,O,fe),ie=T??Math.max(760,K.reduce((oe,xe)=>oe+ll(xe,O),0)),be={columnActions:f?.columnActions??L.columnActions,freezeColumn:f?.freezeColumn??L.freezeColumn,freezeEndColumn:f?.freezeEndColumn??L.freezeEndColumn,unfreezeColumn:f?.unfreezeColumn??L.unfreezeColumn,unfreezeEndColumn:f?.unfreezeEndColumn??L.unfreezeEndColumn,unfreezeAllColumns:f?.unfreezeAllColumns??L.unfreezeAllColumns,resetColumnWidth:f?.resetColumnWidth??L.resetColumnWidth,frozenColumnTitle:f?.frozenColumnTitle??L.frozenColumnTitle},He=ho.useCallback((oe,xe)=>{let Ve=mu(_,oe);x||z(Ve),D?.(Ve,xe);},[x,_,D]),We=ho.useCallback((oe,xe,Ve)=>{let _e=t.find(J=>J.key===oe),Ge=_e?.minWidth,le=_e?.maxWidth,Me=Math.max(typeof Ge=="number"?Ge:0,Math.min(xe,typeof le=="number"?le:Number.POSITIVE_INFINITY)),Ae={...O,[oe]:Me};y||Z(Ae),Dw(b,Ae),E?.(oe,Me,Ve);},[y,b,t,E,O]),Ke=ho.useCallback(oe=>{let xe=$[oe.key]??fu(oe),Ve=ll(oe,O),_e={...O,[oe.key]:xe};y||Z(_e),Dw(b,_e),E?.(oe.key,xe,{columnId:oe.key,previousWidth:Ve,minWidth:oe.minWidth,maxWidth:oe.maxWidth}),P?.(_e);},[y,b,$,E,P,O]),ce=ho.useCallback(oe=>{let xe=ca(oe,Math.max(0,K.length-fe));ee(xe),cB(b,xe),W?.(xe);},[b,W,K.length,fe]),Q=ho.useCallback(oe=>{let xe=ca(oe,Math.max(0,K.length-ne));U(xe),uB(b,xe),H?.(xe);},[b,H,K.length,ne]),ge=a(oe=>{if(oe<ne)return "start";if(oe>=K.length-fe)return "end"},"getFrozenPosition"),we=a((oe,xe,Ve=false)=>{let _e=ge(xe);if(_e)return m("sticky",_e==="start"?"shadow-[1px_0_0_0_hsl(var(--border)/0.45)]":"shadow-[-1px_0_0_0_hsl(var(--border)/0.45)]",Ve?"bg-muted/60":"bg-inherit",Ve?"z-40":"z-20",(xe===0||xe===K.length-1)&&(Ve?"z-50":"z-30"))},"getFrozenClassName"),Ie=a((oe,xe)=>{let Ve=ge(xe);if(Ve==="start")return {left:he.get(oe.key)??0};if(Ve==="end")return {right:me.get(oe.key)??0}},"getFrozenStyle");return jsxRuntime.jsx(Li,{appearance:R,className:m("flex h-full min-h-0 flex-col overflow-hidden rounded-lg border border-border/60 bg-card",A?.root,M),style:N,children:jsxRuntime.jsx("div",{className:m("min-h-0 flex-1 overflow-auto",A?.scrollArea),style:{maxHeight:Wf(C)},children:jsxRuntime.jsxs(Wi,{appearance:R,columnOrder:X,columnSizes:O,columnDragEnabled:w,columnResizeEnabled:v,onColumnOrderChange:He,onColumnSizeChange:We,className:m("w-full table-fixed text-left text-xs",A?.table,I),style:{minWidth:ie},children:[jsxRuntime.jsx("colgroup",{children:K.map(oe=>jsxRuntime.jsx("col",{style:{width:Wf(O[oe.key]??oe.width),minWidth:Wf(oe.minWidth)}},oe.key))}),jsxRuntime.jsx(zi,{appearance:R,className:m("border-b border-border/60 bg-muted/60 text-[11px] font-medium text-muted-foreground",A?.tableHeader),children:jsxRuntime.jsx(vn,{appearance:R,className:m("hover:bg-transparent",A?.headerRow),children:K.map((oe,xe)=>{let Ve=l?l(oe,{column:oe,columnIndex:xe,columns:K,rows:e}):oe.label,_e=!!oe.sortable,Ge=_e&&B?()=>B(oe.key,oe):void 0,le=xe<ne,Me=xe>=K.length-fe,Ae=le||Me,J=ll(oe,O)===($[oe.key]??fu(oe));return jsxRuntime.jsxs(xc,{modal:false,children:[jsxRuntime.jsx(Ws,{asChild:true,appearance:R,children:jsxRuntime.jsx(Fi,{appearance:R,columnId:oe.key,align:oe.align,label:Ve,description:oe.description,trailing:Ae?jsxRuntime.jsx("span",{title:be.frozenColumnTitle,className:"inline-flex h-5 w-5 items-center justify-center rounded text-primary",children:jsxRuntime.jsx(bB,{className:"h-3.5 w-3.5"})}):null,sortable:_e,sortDirection:oe.sortDirection,sortLabel:oe.sortLabel,onSort:Ge,draggable:oe.draggable,resizable:oe.resizable,width:oe.width,minWidth:oe.minWidth,maxWidth:oe.maxWidth,className:m("sticky top-0 h-9 whitespace-nowrap border-r border-border/50 bg-muted/60 px-2.5 py-2 backdrop-blur",we(oe,xe,true),oe.headerClassName,oe.className,A?.headerCell),style:Ie(oe,xe)})}),jsxRuntime.jsxs(zs,{appearance:R,alignOffset:-4,className:"min-w-44",children:[jsxRuntime.jsx(vc,{appearance:R,children:be.columnActions}),Ae?jsxRuntime.jsx(na,{appearance:R,onSelect:()=>{Me?Q(K.length-xe-1):ce(xe);},children:Me?be.unfreezeEndColumn:be.unfreezeColumn}):jsxRuntime.jsx(na,{appearance:R,onSelect:()=>ce(xe+1),children:be.freezeColumn}),Ae?null:jsxRuntime.jsx(na,{appearance:R,onSelect:()=>Q(K.length-xe),children:be.freezeEndColumn}),jsxRuntime.jsx(na,{appearance:R,disabled:ne===0&&fe===0,onSelect:()=>{ce(0),Q(0);},children:be.unfreezeAllColumns}),jsxRuntime.jsx(wc,{appearance:R}),jsxRuntime.jsx(na,{appearance:R,disabled:J,onSelect:()=>Ke(oe),children:be.resetColumnWidth})]})]},oe.key)})})}),jsxRuntime.jsxs(Oi,{appearance:R,className:m("divide-y divide-border/50",A?.body),children:[o.map((oe,xe)=>{let Ve=n(oe,xe),_e=Aw(u,oe,xe);return jsxRuntime.jsx(vn,{appearance:R,className:m("bg-card/95",A?.pinnedTopRow,_e),children:K.map((Ge,le)=>jsxRuntime.jsx(Ha,{appearance:R,align:Ge.align,className:m("h-[52px] border-r border-border/50 px-2.5 py-1.5 align-middle",Ge.wrap?"whitespace-normal":"whitespace-nowrap",we(Ge,le),Ge.cellClassName,A?.cell),style:Ie(Ge,le),children:jsxRuntime.jsx(Lw,{wrap:Ge.wrap,children:s?s(Ge,oe,{row:oe,rowIndex:xe,column:Ge,columnIndex:le,isPinnedTopRow:true}):Bw(Ge,oe)})},`pinned-${Ve}-${Ge.key}`))},`pinned-${Ve}`)}),e.length?e.map((oe,xe)=>{let Ve=r(oe,xe),_e=c?.(oe,xe)||{},Ge=Aw(p,oe,xe);return jsxRuntime.jsx(vn,{appearance:R,interactive:!!d&&!_e.disabled,selected:_e.selected,disabled:_e.disabled,onClick:()=>{_e.disabled||d?.(oe,xe);},className:m("min-h-[52px] bg-card transition-colors",_e.saving&&"bg-primary/5",_e.pending&&"opacity-80",d&&!_e.disabled?"cursor-pointer hover:bg-muted/30":"hover:bg-muted/30",A?.row,Ge),children:K.map((le,Me)=>jsxRuntime.jsx(Ha,{appearance:R,align:le.align,className:m("h-[52px] border-r border-border/50 px-2.5 py-1.5 align-middle",le.wrap?"whitespace-normal":"whitespace-nowrap",we(le,Me),le.cellClassName,A?.cell),style:Ie(le,Me),children:jsxRuntime.jsx(Lw,{wrap:le.wrap,children:i?i(le,oe,{row:oe,rowIndex:xe,column:le,columnIndex:Me,isPinnedTopRow:false}):Bw(le,oe)})},`${Ve}-${le.key}`))},Ve)}):o.length?null:jsxRuntime.jsx(Hi,{appearance:R,colSpan:Math.max(K.length,1),className:A?.empty,children:g})]})]})})})}a(Ow,"InteractiveTable");function Fw({value:e,placeholder:t,disabled:o,multiline:r=false,commitOnBlur:n=true,className:i,inputClassName:s,onCommit:l}){let d=String(e||""),[c,p]=ho.useState(d);ho.useEffect(()=>{p(d);},[d]);let u=ho.useCallback(async()=>{let f=String(c||"").trim(),b=String(d||"").trim();if(f!==b)try{await l?.(f);}catch{p(d);}},[c,d,l]),g=m("w-full resize-none rounded-sm border border-transparent bg-transparent px-1.5 py-1 text-xs text-foreground outline-hidden transition-colors","placeholder:text-muted-foreground/70 hover:border-border/60 hover:bg-background focus:border-primary/45 focus:bg-background",r?"min-h-[42px] leading-5":"h-8",o&&"cursor-not-allowed text-muted-foreground hover:border-transparent hover:bg-transparent",s);return r?jsxRuntime.jsx("textarea",{className:m(g,i),disabled:o,value:c,placeholder:t,onChange:f=>p(f.target.value),onBlur:()=>{n&&u();},onKeyDown:f=>{(f.metaKey||f.ctrlKey)&&f.key==="Enter"&&f.currentTarget.blur(),f.key==="Escape"&&(p(d),f.currentTarget.blur());}}):jsxRuntime.jsx("input",{className:m(g,i),disabled:o,value:c,placeholder:t,onChange:f=>p(f.target.value),onBlur:()=>{n&&u();},onKeyDown:f=>{f.key==="Enter"&&f.currentTarget.blur(),f.key==="Escape"&&(p(d),f.currentTarget.blur());}})}a(Fw,"InteractiveTableEditableTextCell");function Hw({children:e,mono:t=false,className:o}){return jsxRuntime.jsx("div",{className:m("min-w-0 text-xs text-muted-foreground",t&&"font-mono",o),children:V(e)?e:"\u2014"})}a(Hw,"InteractiveTableReadonlyCell");function Vw({value:e,options:t,disabled:o,ariaLabel:r,children:n,className:i,onChange:s}){return jsxRuntime.jsxs("div",{className:m("relative flex w-full items-center",i),children:[n,jsxRuntime.jsx("select",{"aria-label":r,disabled:o,value:e,onChange:l=>s?.(l.target.value),className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",children:t.map(l=>jsxRuntime.jsx("option",{value:l.value,children:l.label},l.value))})]})}a(Vw,"InteractiveTableSelectCell");function _w({children:e,title:t,presentation:o,renderSlot:r}){let n=o.title,i=n?.placement??"none",s=n?.background==="panel"?"div":"span",l=(o.slots??[]).map(p=>({slot:p,content:r?.(p)})).filter(p=>p.content!=null),d=i==="none"?null:jsxRuntime.jsx("div",{className:"monkeys-gallery-cover-title",title:typeof t=="string"||typeof t=="number"?String(t):void 0,"data-placement":i,"data-background":n?.background??(i.startsWith("overlay")?"gradient":"none"),style:{...n?.background==="panel"?{margin:12,borderRadius:"var(--radius)",border:"1px solid hsl(var(--border) / .8)",background:"hsl(var(--card) / .9)",backdropFilter:"blur(12px)",boxShadow:"var(--monkeys-component-overlay-dialog-shadow)"}:{},textAlign:n?.align??"left",padding:n?.padding??12,fontSize:`var(--monkeys-gallery-title-${n?.size??"md"})`,fontWeight:n?.weight==="normal"?400:n?.weight==="medium"?500:600},children:jsxRuntime.jsx(s,{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:n?.background==="panel"?void 0:n?.maxLines??2,overflow:"hidden"},children:t})}),c=a(p=>jsxRuntime.jsx("div",{className:"monkeys-gallery-slot-row","data-row":p,children:l.filter(({slot:u})=>u.position.startsWith(p)).map(({slot:u,content:g})=>jsxRuntime.jsx("div",{"data-card-slot":u.position,"data-visibility":u.visibility??"always",className:u.visibility==="hover"?"monkeys-gallery-hover-actions":void 0,style:{gridColumn:u.position.endsWith("left")?1:u.position.endsWith("center")?2:3,justifySelf:u.position.endsWith("left")?"start":u.position.endsWith("center")?"center":"end",padding:u.inset??12,gap:u.gap??8,flexDirection:u.direction==="vertical"?"column":"row"},children:g},u.position))}),"band");return jsxRuntime.jsxs("div",{className:"monkeys-gallery-card-surface","data-hover-effect":o.hover?.effect??"none",style:{"--monkeys-gallery-hover-scale":o.hover?.scale??1.02},children:[i==="above"&&d,jsxRuntime.jsxs("div",{className:"monkeys-gallery-media-card",children:[jsxRuntime.jsx("div",{className:"monkeys-gallery-card-media",children:e}),jsxRuntime.jsxs("div",{className:"monkeys-gallery-card-overlay",children:[jsxRuntime.jsxs("div",{children:[i==="overlay-top"&&d,c("top")]}),c("middle"),jsxRuntime.jsxs("div",{children:[c("bottom"),i==="overlay-bottom"&&d]})]})]}),i==="below"&&d]})}a(_w,"WorkbenchGalleryCardSurface");var gB=/\.(png|jpe?g|webp|gif|svg|bmp|avif)$/i,hB=/\.(wav|mp3|ogg|m4a|flac|aac)$/i,yB=a(e=>/^https?:\/\//i.test(String(e||"")),"isLikelyUrl"),Gw=a(e=>String(e?.renderType||e?.type||"").toLowerCase(),"getColumnRenderKind"),xB=a(e=>String(e||"").startsWith("data:image/")||gB.test(String(e||"")),"isImageLikeValue"),vB=a(e=>String(e||"").startsWith("data:audio/")||hB.test(String(e||"")),"isAudioLikeValue"),wB=a(e=>String(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),"escapeSvgText"),qi=a((e,t)=>e?t?.[e.key]??null:null,"getDefaultGalleryFieldValue"),ul=a(e=>{if(e==null||e==="")return "\u2014";if(Array.isArray(e))return e.map(o=>{if(typeof o=="string")return o;if(!o||typeof o!="object")return "";let r=o;return r.text||r.label||r.title||r.display||r.value||r.recordId||""}).filter(Boolean).join(" \xB7 ")||"\u2014";if(typeof e=="object"){let t=e;return String(t.text||t.label||t.title||t.display||t.value||"\u2014")}return String(e)},"getDefaultGalleryDisplayText"),pl=a((e={key:""},t)=>Gw(e)==="image"||xB(t),"isDefaultGalleryImageField"),ml=a((e={key:""},t)=>Gw(e)==="audio"||vB(t),"isDefaultGalleryAudioField"),$w=a((e,t,o)=>{if(yB(e)||String(e||"").startsWith("data:image/"))return String(e);let r=wB(e||o||t||""),i=`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 960 540'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0%' stop-color='#0f172a'/><stop offset='55%' stop-color='#1d4ed8'/><stop offset='100%' stop-color='#14b8a6'/></linearGradient></defs><rect width='960' height='540' fill='url(#g)'/><g opacity='0.28'><circle cx='780' cy='130' r='150' fill='#67e8f9'/><circle cx='180' cy='430' r='170' fill='#a78bfa'/></g>${r?`<text x='68' y='450' fill='white' font-family='Inter, Arial' font-size='52' font-weight='700'>${r}</text>`:""}</svg>`;return `data:image/svg+xml;utf8,${encodeURIComponent(i)}`},"getDefaultGalleryImagePreviewSrc"),bu=a((e,t,{getFieldValue:o=qi,shouldEnhanceMultimodal:r=true,isImageField:n=pl,isAudioField:i=ml}={})=>{if(!e||!r)return false;let s=o(e,t);return n(e,s)||i(e,s)},"isDefaultGalleryMediaColumn"),gu=a((e,t,{isMediaColumn:o=a(()=>false,"isMediaColumn")}={})=>!e||e.renderType==="icon"?false:!o(e,t),"isDefaultGalleryTitleCandidate"),hu=a((e,t,{isMediaColumn:o=a(()=>false,"isMediaColumn")}={})=>!e||e.renderType==="icon"?false:!o(e,t),"isDefaultGallerySummaryCandidate"),jw=a((e,t,{compact:o=false,getFieldValue:r=qi,getDisplayText:n=ul}={})=>{let i=r(e,t);return jsxRuntime.jsx("span",{className:m("leading-relaxed",o&&e?.wrap===true&&"line-clamp-2 block"),children:n(i)})},"renderDefaultGalleryFieldValue");var CB=a(e=>e==="compact"?2:e==="detailed"?6:4,"getDefaultGalleryDetailLimit"),SB=a((e,t)=>e===1||e===2||e===3?Number(e):t==="detailed"?1:2,"getNormalizedGalleryBentoColumns"),TB=a(({density:e,visibility:t,limit:o})=>{if(t==="all")return Number.POSITIVE_INFINITY;let r=Number.parseInt(String(o),10);return Number.isFinite(r)&&r>0?r:CB(e)},"getNormalizedGalleryDetailLimit"),NB=a(e=>e==="compact"?"p-3":e==="detailed"?"p-4":"p-3.5","getGalleryCardPaddingClassName"),RB=a((e,t)=>t?"h-auto w-full object-cover":e==="compact"?"h-32 w-full object-cover":e==="detailed"?"h-48 w-full object-cover":"h-40 w-full object-cover","getGalleryPreviewClassName"),MB=a(e=>e===1?"grid-cols-1":e===3?"grid-cols-1 sm:grid-cols-2 2xl:grid-cols-3":"grid-cols-1 sm:grid-cols-2","getGalleryDetailGridClassName");function IB(e){return ww(e)}a(IB,"getIconComponent");function DB(e){return e}a(DB,"defaultFormatLabel");function PB(e){return typeof e=="string"||typeof e=="number"?String(e):""}a(PB,"getLabelText");function yu({row:e,columns:t,onClick:o,cardInteraction:r="button",cardPresentation:n,renderCardSlot:i,renderCoverTitle:s,isSelected:l=false,isMasonry:d=false,galleryFieldKey:c="auto",galleryDensity:p="comfortable",galleryBentoColumns:u,galleryDetailVisibility:g="limit",galleryDetailLimit:f,galleryDetailPresentation:b="tiles",shouldEnhanceMultimodal:x=true,getFieldValue:y,isMediaColumn:k,isTitleCandidate:w,isSummaryCandidate:v,getDisplayText:h,renderFieldValue:S,getImagePreviewSrc:T,isImageField:C,isAudioField:R,AudioPlayerComponent:M,cardVariant:I="default",renderPreview:A,renderMeta:N,renderLeadingVisual:D,resolveRecordVisual:E,hiddenDetailFieldKeys:P=[],labels:W,formatLabel:H=DB,className:B}){let L=y||qi,F=h||ul,_=C||pl,$=R||ml,G=T||$w,z=k||((Se,Je)=>bu(Se,Je,{getFieldValue:L,shouldEnhanceMultimodal:x,isImageField:_,isAudioField:$})),re=w||((Se,Je)=>gu(Se,Je,{isMediaColumn:z})),Z=v||((Se,Je)=>hu(Se,Je,{isMediaColumn:z})),ae=S||((Se,Je,{compact:bt}={})=>jw(Se,Je,{compact:bt,getFieldValue:L,getDisplayText:F})),ee=I==="preview-only",q=I==="image-only",U=I==="chromatic-bento",O=(c!=="auto"?t.find(Se=>Se.key===c&&z(Se,e)):null)||(x?t.find(Se=>z(Se,e)):null),K=t.find(Se=>Se.renderType==="icon"),ne=K&&E?E(e[K.key],e,K):null,fe=IB(ne?.Icon||ne?.icon),he=O?L(O,e):null,me=O?_(O,he):false,ie=O?$(O,he):false,be=t.filter(Se=>Se.key!==O?.key&&Se.renderType!=="icon"),We=be.filter(Se=>{if(!Se||z(Se,e)||!re(Se,e))return false;let Je=L(Se,e);return !(Je==null||Je==="")})[0]||null,Ke=F(We?L(We,e):e.linkKey||e.id),Q=be.filter(Se=>Se&&Se.key!==We?.key&&!z(Se,e)&&Z(Se,e)).map(Se=>({column:Se,text:String(F(L(Se,e)))})),ge=(Q.find(({text:Se})=>Se!=="\u2014"&&Se.length>12)||Q.find(({text:Se})=>Se!=="\u2014"))?.column||null,we=ge?F(L(ge,e)):"",Ie=new Set(P),oe=be.filter(Se=>Se.key!==We?.key&&Se.key!==ge?.key&&!Ie.has(Se.key)),xe=TB({density:p,visibility:g,limit:f}),Ve=Number.isFinite(xe)?oe.slice(0,xe):oe,_e=p==="detailed",Ge=SB(u,p),le=NB(p),Me=MB(Ge),Ae=b==="lines",J=q?n?"block h-auto w-full":"block h-auto w-full transition-transform duration-500 group-hover:scale-[1.02]":RB(p,d),$e=typeof A=="function"?A({row:e,mediaColumn:O,mediaValue:he,isImageMedia:me,isAudioMedia:ie,iconVisual:ne,IconComponent:fe,previewClassName:J}):null,ue={row:e,contentColumns:be,detailColumns:oe,titleColumn:We,summaryColumn:ge,getDisplayText:F,getFieldValue:L},Re=N?.(ue)??null,se=D?.({...ue,iconVisual:ne})??null,te=!se&&ne?jsxRuntime.jsx("div",{className:m("flex h-9 w-9 items-center justify-center rounded-lg border",ne.chipClassName||"border-primary/20 bg-primary/10 text-primary"),children:nl(ne.Icon||ne.icon,m("h-4 w-4",ne.iconClassName||"text-primary"))}):null,Te=se||te,ze=U?"shrink-0 rounded-full border border-border/40 bg-muted/25 px-2.5 py-1 text-[10px] text-muted-foreground transition-all duration-300 group-hover:border-primary/30 group-hover:bg-primary/10 group-hover:text-primary dark:border-border/35 dark:bg-muted/15":"shrink-0 rounded-md border border-border/40 bg-muted/25 px-2 py-1 text-[10px] text-muted-foreground dark:border-border/35 dark:bg-muted/15",je=U?"rounded-xl border border-border/35 bg-muted/20 px-3 py-2.5 transition-all duration-300 group-hover:border-primary/25 group-hover:bg-primary/5 dark:border-border/30 dark:bg-muted/10":"rounded-lg border border-border/35 bg-muted/20 px-2.5 py-2 dark:border-border/30 dark:bg-muted/10",it=U?"text-[10px] uppercase tracking-[0.14em] text-muted-foreground transition-colors duration-300 group-hover:text-foreground":"text-[10px] uppercase tracking-[0.12em] text-muted-foreground",Y=U?"mt-1.5 text-[11px] text-muted-foreground transition-colors duration-300 group-hover:text-foreground [&_*]:max-w-full [&_pre]:text-[11px] [&_pre]:leading-relaxed":"mt-1.5 text-[11px] text-foreground [&_*]:max-w-full [&_pre]:text-[11px] [&_pre]:leading-relaxed",pe=W?.fieldCount?.(be.length),Be=W?.coverOnlyHint,rt=$e==null&&me&&O?G(he,e.id,O.label):void 0,Ce=$e??jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[me&&O?jsxRuntime.jsx("div",{className:m("overflow-hidden bg-card/50",q?"rounded-[inherit] bg-transparent":ee?"rounded-[inherit]":"mb-3 rounded-lg border border-border/70"),children:jsxRuntime.jsx("img",{src:rt,style:qn(rt),alt:typeof he?.alt=="string"?he.alt:typeof he=="string"?he:String(O.label||""),className:J,loading:"lazy",referrerPolicy:"no-referrer",onError:Se=>{Se.currentTarget.onerror=null,Se.currentTarget.src=G("",e.id,O.label);}})}):null,!me&&ne&&ee?jsxRuntime.jsx("div",{className:m("flex items-center justify-center","rounded-[inherit] border py-10",ne.chipClassName||"border-primary/20 bg-primary/5"),children:nl(ne.Icon||ne.icon,m("h-10 w-10",ne.iconClassName||"text-primary"))}):null,ie&&M?jsxRuntime.jsx("div",{className:m(!ee&&"mb-3"),children:jsxRuntime.jsx(M,{filename:String(he)})}):null]}),Xe=n?_w:null,de=n?.title?.fieldId?t.find(Se=>Se.key===n.title?.fieldId):We,Ee=s?s(e):de?F(L(de,e)):Ke,qe=!!n?.slots?.length,Le=qe||r==="container"?"div":"button";return jsxRuntime.jsxs(Le,{"data-gallery-card":true,"data-card-hover-effect":n?.hover?.effect,type:Le==="button"?"button":void 0,role:qe&&r==="button"&&o?"group":void 0,tabIndex:qe&&r==="button"&&o?0:void 0,onKeyDown:qe&&r==="button"&&o?Se=>{Se.target===Se.currentTarget&&(Se.key==="Enter"||Se.key===" ")&&(Se.preventDefault(),o());}:void 0,onClick:r==="button"?Se=>{(!qe||!Se.target.closest("button,a,input,select,textarea,[role=button],[role=menuitem]"))&&o?.();}:void 0,"aria-label":PB(Ke),className:m("group relative w-full rounded-lg text-left transition-all duration-300",q?"overflow-hidden bg-transparent p-0 shadow-none":ee?"overflow-hidden bg-transparent p-0":m("overflow-hidden border",U&&"shadow-none"),!ee&&!q&&le,!ee&&!q&&(l?U?"border-primary/35 bg-background/85 ring-1 ring-primary/20":"border-primary/40 bg-primary/10 ring-1 ring-primary/30":U?n?"workbench-surface-card":"workbench-surface-card hover:-translate-y-1 hover:border-primary/20":n?"workbench-surface-card":"workbench-surface-card hover:border-primary/30"),ee&&l&&"ring-1 ring-primary/30",q&&(l?"ring-1 ring-primary/30":!n&&"hover:-translate-y-0.5"),d?"block h-full w-full min-w-0":"h-full min-w-0",B),children:[U?jsxRuntime.jsx("div",{"aria-hidden":"true",className:m("pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_right,hsl(var(--primary)/0.18),transparent_40%),radial-gradient(circle_at_bottom_left,hsl(var(--accent)/0.18),transparent_45%)] opacity-0 transition-opacity duration-300",l?"opacity-100":"group-hover:opacity-100")}):null,jsxRuntime.jsxs("div",{className:m("relative z-[1]",(q||ee)&&"rounded-[inherit]"),children:[Xe&&n?jsxRuntime.jsx(Xe,{presentation:n,title:Ee,renderSlot:Se=>i?.(Se,ue),children:Ce}):Ce,!ee&&!q?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[Te?jsxRuntime.jsx("div",{className:"shrink-0",children:Te}):null,jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[!n?.title&&jsxRuntime.jsx("div",{className:m("flex items-center gap-2 text-sm font-semibold",U?"text-muted-foreground transition-colors duration-300 group-hover:text-foreground":"text-foreground"),children:jsxRuntime.jsx("span",{className:"truncate",children:r==="container"&&o?jsxRuntime.jsx("button",{type:"button",onClick:o,className:"border-0 bg-transparent p-0 text-left hover:underline",style:{font:"inherit",color:"inherit"},children:Ke}):Ke})}),we&&we!==Ke?jsxRuntime.jsx("div",{className:m("mt-1 text-[11px] leading-5 text-muted-foreground",_e?"line-clamp-4":"line-clamp-2",U&&"transition-colors duration-300 group-hover:text-foreground"),children:we}):null]}),Re??(V(pe)?jsxRuntime.jsx("span",{className:ze,children:pe}):null)]})]}),Ve.length>0?jsxRuntime.jsx("div",{"data-gallery-detail-presentation":b,className:m("mt-3 grid grid-flow-row gap-2",Ae?"grid-cols-1":Me),children:Ve.map(Se=>jsxRuntime.jsxs("div",{className:Ae?"flex min-w-0 items-start gap-2 text-xs":je,children:[Se.label?jsxRuntime.jsx("div",{className:Ae?"shrink-0 text-muted-foreground":it,children:H(Se.label,{column:Se})}):null,jsxRuntime.jsx("div",{className:Ae?"min-w-0 text-foreground":m(Y,!Se.label&&"mt-0"),children:ae(Se,e,{compact:p!=="detailed",surface:"gallery"})})]},`${e.id||e.linkKey}-${Se.key}`))}):null,!We&&!we&&Ve.length===0&&V(Be)?jsxRuntime.jsx("div",{className:m("mt-3 text-[11px] text-muted-foreground",U&&"transition-colors duration-300 group-hover:text-foreground"),children:Be}):null]}):null]})]})}a(yu,"WorkbenchGalleryCard");function Kw(e,t){let o=e==="rail"?"horizontal":"vertical";if(t&&t!=="auto"&&t!==o)throw new TypeError(`Gallery layout ${e} requires ${o} scrolling.`);return o}a(Kw,"resolveGalleryScrollDirection");function BB(e,t,o,r,n){let i=Array.from({length:t},()=>0),s=0,l=0,d=e.map((c,p)=>{if(n==="rail")return {index:p,left:p*(o+r),top:0,width:o,height:c};if(n==="grid")return p>0&&p%t===0&&(s+=l+r,l=0),l=Math.max(l,c),{index:p,left:p%t*(o+r),top:s,width:o,height:c};let u=i.indexOf(Math.min(...i)),g=i[u];return i[u]=g+c+r,{index:p,left:u*(o+r),top:g,width:o,height:c}});return {placements:d,height:Math.max(0,...d.map(c=>c.top+c.height)),width:n==="rail"?Math.max(0,e.length*(o+r)-r):t*(o+r)-r}}a(BB,"placeWindowedItems");function LB(e,t,o,r,n){let i=t-n,s=t+o+n;return e.filter(l=>{let d=r?l.left:l.top;return d<=s&&d+(r?l.width:l.height)>=i})}a(LB,"visibleWindow");function Yw({items:e,getKey:t,layout:o,cardWidth:r,estimateHeight:n,getScrollOwner:i,railRef:s,tailRef:l,containerProps:d,getItemProps:c,renderItem:p}){let u=o.mode==="rail",g=u?1:o.columnCount,f=Math.max(1,u?r??280:o.columnWidth),b=ho.useRef(null),x=ho.useRef(new Map),y=ho.useRef(),[k,w]=ho.useState({width:f,heights:{}}),[v,h]=ho.useState({start:0,length:u?1280:720}),[S,T]=ho.useState(),[C,R]=ho.useState(),M=e.map(t),I=JSON.stringify(M),A=M.map((L,F)=>k.heights[L]??Math.max(1,n(e[F],f))),N=ho.useMemo(()=>BB(A,g,f,o.gap,u?"rail":o.mode==="grid"?"grid":"masonry"),[JSON.stringify(A),g,f,o.gap,u,o.mode]),D=ho.useCallback(()=>{let L=b.current,F=i();if(!L||!F)return;let _=L.getBoundingClientRect(),$=F.getBoundingClientRect(),G=F.offsetHeight>0?$.height/F.offsetHeight:1,z=u?F.scrollLeft:($.top-_.top)/(G||1)+F.clientTop,re=u?F.clientWidth:F.clientHeight;re<=0||h(Z=>Z.start===z&&Z.length===re?Z:{start:z,length:re});},[i,u]);ho.useLayoutEffect(()=>{D();},[D,N.height,N.width]),ho.useEffect(()=>{let L=i();if(!L)return;let F=0,_=a(()=>{F||(F=requestAnimationFrame(()=>{F=0,D();}));},"update");L.addEventListener("scroll",_,{passive:true}),window.addEventListener("resize",_);let $=typeof ResizeObserver=="function"?new ResizeObserver(_):void 0;return $?.observe(L),b.current&&$?.observe(b.current),()=>{L.removeEventListener("scroll",_),window.removeEventListener("resize",_),$?.disconnect(),cancelAnimationFrame(F);}},[i,D]),ho.useEffect(()=>{if(typeof ResizeObserver!="function")return;let L=new ResizeObserver(F=>{w(_=>{let $={..._.heights},G=_.width!==f;for(let z of F){let re=z.target.dataset.windowKey,Z=z.borderBoxSize?.[0]?.blockSize??z.target.offsetHeight;re!==void 0&&Z>0&&$[re]!==Z&&($[re]=Z,G=true);}return G?{width:f,heights:$}:_});});return y.current=L,x.current.forEach(F=>L.observe(F)),()=>{L.disconnect(),y.current=void 0;}},[f]),ho.useEffect(()=>{let L=new Set(M);w(F=>({width:F.width,heights:Object.fromEntries(Object.entries(F.heights).filter(([_])=>L.has(_)))}));},[I]);let E=a((L,F)=>{let _=x.current.get(L);if(_&&y.current?.unobserve(_),!F){x.current.delete(L);return}F.dataset.windowKey=L,x.current.set(L,F),y.current?.observe(F);},"register"),P=v.length,W=LB(N.placements,v.start,v.length,u,P),H=new Set(W.map(L=>L.index));for(let L of [S,C]){let F=L===void 0?-1:M.indexOf(L);F>=0&&H.add(F);}ho.useLayoutEffect(()=>{if(!C)return;let L=x.current.get(C)?.parentElement;L&&(L.focus(),L.scrollIntoView({block:"nearest",inline:"nearest"}),R(void 0));},[C]);let B={...o,columnWidth:f,itemWidth:f};return jsxRuntime.jsxs("div",{...d,ref:L=>{b.current=L,s&&(s.current=L);},"data-collection-windowed":"","data-collection-total":e.length,style:{...d.style,position:"relative",...u?{overflowX:"auto",overflowY:"hidden"}:{height:N.height},overflowAnchor:"none"},children:[u?jsxRuntime.jsx("div",{"aria-hidden":"true",style:{width:N.width,height:N.height,pointerEvents:"none"}}):null,Array.from(H).sort((L,F)=>L-F).map(L=>{let F=e[L],_=M[L],$=N.placements[L],G=c(F,B);return jsxRuntime.jsx("div",{...G,"aria-posinset":L+1,"aria-setsize":e.length,onFocus:z=>{T(_),G.onFocus?.(z);},onBlur:z=>{z.currentTarget.contains(z.relatedTarget)||T(void 0),G.onBlur?.(z);},onKeyDown:z=>{if(z.target===z.currentTarget){let re=u?1:g,Z=z.key==="Home"?0:z.key==="End"?e.length-1:z.key==="ArrowRight"?L+1:z.key==="ArrowLeft"?L-1:z.key==="ArrowDown"?L+re:z.key==="ArrowUp"?L-re:void 0;if(Z!==void 0){z.preventDefault(),R(M[Math.min(e.length-1,Math.max(0,Z))]);return}}G.onKeyDown?.(z);},style:{...G.style,position:"absolute",left:$.left,top:$.top,width:$.width},children:jsxRuntime.jsx("div",{ref:z=>E(_,z),children:p(F,B)})},_)}),l?jsxRuntime.jsx("div",{ref:l,"aria-hidden":"true",style:{position:"absolute",left:Math.max(0,N.width-1),top:0,width:1,height:1}}):null]})}a(Yw,"WorkbenchWindowedLayout");var OB=12,FB=8,Zw=280,ek=240,HB=typeof window>"u"?ho.useEffect:ho.useLayoutEffect;function ku(e,t,o){return Math.min(Math.max(e,t),o)}a(ku,"clamp");function VB(e){if(typeof window>"u")return 16;let t=e||document.documentElement,o=Number.parseFloat(window.getComputedStyle(t).fontSize);return Number.isFinite(o)&&o>0?o:16}a(VB,"getRootFontSize");function Cu(e,t,o){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return t;let r=e.trim().toLowerCase();if(!r)return t;if(/^\d+(\.\d+)?$/.test(r)){let n=Number.parseFloat(r);return Number.isFinite(n)&&n>0?n:t}if(r.endsWith("px")){let n=Number.parseFloat(r);return Number.isFinite(n)&&n>0?n:t}if(r.endsWith("rem")){let n=Number.parseFloat(r);return !Number.isFinite(n)||n<=0?t:n*VB(o)}return t}a(Cu,"resolveLengthToPixels");function Jw(e,t){let o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return false;for(let n of r)if(e[n]!==t[n])return false;return true}a(Jw,"areMeasurementMapsEqual");function _B({containerWidth:e,itemCount:t,targetColumnWidth:o,gap:r}){if(!e)return 1;let n=Math.max(t,1),i=Math.max(1,Math.min(n,Math.ceil((e+r)/(Math.max(o*.58,1)+r)))),s=1,l=Number.POSITIVE_INFINITY;for(let d=1;d<=i;d+=1){let c=(e-r*Math.max(d-1,0))/d;if(!Number.isFinite(c)||c<=0)continue;let p=Math.max(0,o*.78-c),u=Math.max(0,c-o*1.35),g=Math.abs(c-o)+p*3+u*2;g<l&&(l=g,s=d);}return s}a(_B,"getMasonryColumnCount");function GB({size:e,columnWidth:t,columnCount:o,gap:r}){if(Number.isFinite(e?.columnSpan)&&Number(e?.columnSpan)>0)return ku(Math.round(Number(e?.columnSpan)),1,o);let n=Cu(e?.width,t,null);return ku(Math.ceil((n+r)/(t+r)),1,o)}a(GB,"getItemColumnSpan");function $B({size:e,measuredHeight:t,rowHeight:o,gap:r}){if(Number.isFinite(e?.rowSpan)&&Number(e?.rowSpan)>0)return Math.max(1,Math.round(Number(e?.rowSpan)));let n=Number.isFinite(t)&&Number(t)>0?Number(t):Cu(e?.height,ek,null);return Math.max(1,Math.ceil((n+r)/(o+r)))}a($B,"getItemRowSpan");function jB({size:e,measuredHeight:t}){return Number.isFinite(t)&&Number(t)>0?Number(t):Cu(e?.height,ek,null)}a(jB,"getResolvedItemHeight");function Xi({items:e=[],renderItem:t,getItemKey:o=a((g,f)=>g?.id??g?.key??f,"getItemKey"),getItemSize:r,columnWidth:n=Zw,columnCount:i,gap:s=OB,rowHeight:l=FB,placementStrategy:d="shelf",containerProps:c,getItemProps:p,className:u}){let g=ho.useRef(null),f=ho.useRef(new Map),b=ho.useRef(null),[x,y]=ho.useState(0),[k,w]=ho.useState({}),v=ho.useMemo(()=>e.map((N,D)=>String(o(N,D))),[o,e]),h=v.join("|");ho.useEffect(()=>{let N=g.current;if(!N)return;let D=a(()=>{let E=Math.round(N.getBoundingClientRect().width);y(P=>P===E?P:E);},"updateWidth");if(D(),typeof ResizeObserver=="function"){let E=new ResizeObserver(()=>D());return E.observe(N),()=>E.disconnect()}return window.addEventListener("resize",D),()=>window.removeEventListener("resize",D)},[]),ho.useEffect(()=>{w(N=>{let D=new Set(v),E=Object.fromEntries(Object.entries(N).filter(([P])=>D.has(P)));return Jw(N,E)?N:E});},[v,h]);let S=Cu(n,Zw,g.current),T=d==="dense",R=(Number.isFinite(i)&&Number(i)>0?ku(Math.round(Number(i)),1,24):void 0)||_B({containerWidth:x,itemCount:e.length,targetColumnWidth:S,gap:s}),M=x>0?(x-s*Math.max(R-1,0))/R:S,I=ho.useMemo(()=>e.map((N,D)=>{let E=v[D],P=typeof r=="function"?r(N,{columnCount:R,columnWidth:M,containerWidth:x,gap:s,placementStrategy:d,rowHeight:l})||{}:{};return {key:E,item:N,size:P,columnSpan:GB({size:P,columnWidth:M,columnCount:R,gap:s}),rowSpan:$B({size:P,measuredHeight:k[E],rowHeight:l,gap:s})}}),[R,x,s,r,v,e,k,d,M,l]);HB(()=>{let N={};f.current.forEach((D,E)=>{let P=Math.ceil(D.getBoundingClientRect().height);Number.isFinite(P)&&P>0&&(N[E]=P);}),w(D=>{if(!Object.keys(N).length)return D;let E={...D,...N};return Jw(D,E)?D:E});},[R,T,h,M]),ho.useEffect(()=>{if(typeof ResizeObserver!="function")return;let N=new ResizeObserver(D=>{w(E=>{let P={...E},W=false;for(let H of D){let B=H.target.dataset.masonryKey;if(!B)continue;let L=Math.ceil(H.contentRect.height);!Number.isFinite(L)||L<=0||P[B]===L||(P[B]=L,W=true);}return W?P:E});});return b.current=N,f.current.forEach(D=>N.observe(D)),()=>{N.disconnect(),b.current=null;}},[T,h]);let A=a((N,D)=>{let E=f.current,P=E.get(N);if(P&&P!==D&&b.current&&b.current.unobserve(P),!D){E.delete(N);return}D.dataset.masonryKey=N,E.set(N,D),b.current&&b.current.observe(D);},"registerItemNode");if(!T){let N=(()=>{let D=Array.from({length:R},()=>0),E=0,P=0,W=I.map(({key:H,item:B,columnSpan:L,rowSpan:F,size:_})=>{let $=ku(L,1,R),G=E;if(d==="shortest"){let q=Number.POSITIVE_INFINITY;for(let U=0;U<=R-$;U+=1){let X=Math.max(...D.slice(U,U+$));X<q&&(q=X,G=U);}}else G+$>R&&(G=0),G=Math.min(G,R-$);let z=M*$+s*Math.max($-1,0),re=jB({size:_,measuredHeight:k[H]}),Z=Math.max(...D.slice(G,G+$)),ae=G*(M+s),ee=Z+re;for(let q=G;q<G+$;q+=1)D[q]=ee+s;return P=Math.max(P,ee),d!=="shortest"&&(E=G+$,E>=R&&(E=0)),{key:H,item:B,columnSpan:$,itemHeight:re,itemWidth:z,left:ae,rowSpan:F,size:_,top:Z}});return {containerHeight:Math.max(0,P),positionedItems:W}})();return jsxRuntime.jsx("div",{ref:g,...c,className:m("relative w-full",u,c?.className),style:{...c?.style,height:`${N.containerHeight}px`},children:N.positionedItems.map(({key:D,item:E,columnSpan:P,rowSpan:W,size:H,itemWidth:B,left:L,top:F})=>{let _=x<=0&&R===1,$=_?"100%":`${B}px`,G={columnCount:R,columnSpan:P,columnWidth:M,containerWidth:x,gap:s,itemWidth:B,placementStrategy:d,rowSpan:W,rowHeight:l,size:H},z=p?.(E,G);return jsxRuntime.jsx("div",{...z,className:m("absolute min-w-0",z?.className),style:{...z?.style,left:_?0:`${L}px`,top:`${F}px`,width:$,maxWidth:$},children:jsxRuntime.jsx("div",{ref:re=>A(D,re),role:"presentation",className:"min-w-0",children:t(E,G)})},D)})})}return jsxRuntime.jsx("div",{ref:g,...c,className:m("grid w-full items-start",u,c?.className),style:{...c?.style,gap:`${s}px`,gridAutoFlow:"row dense",gridAutoRows:`${l}px`,gridTemplateColumns:`repeat(${R}, minmax(0, 1fr))`},children:I.map(({key:N,item:D,columnSpan:E,rowSpan:P,size:W})=>{let H={columnCount:R,columnSpan:E,columnWidth:M,containerWidth:x,gap:s,placementStrategy:d,rowSpan:P,rowHeight:l,size:W},B=p?.(D,H);return jsxRuntime.jsx("div",{...B,className:m("min-w-0",B?.className),style:{...B?.style,gridColumn:`span ${E}`,gridRow:`span ${P}`},children:jsxRuntime.jsx("div",{ref:L=>A(N,L),role:"presentation",className:"min-w-0",children:t(D,H)})},N)})})}a(Xi,"WorkbenchMasonryLayout");var KB=12,qB=[1],YB=[4/3],XB=[1,4/5,3/2,3/4,5/4],QB=.5,ZB=2,JB="hsl(var(--monkeys-color-muted, var(--muted)))";function Su(e,t,o){return Math.min(Math.max(e,t),o)}a(Su,"clamp");function Hf(e,t,o){return typeof e!="number"||!Number.isFinite(e)||e<=0?t:Su(Math.round(e),1,o)}a(Hf,"normalizeCount");function e5(e){return e==="masonry"||e==="dense"?XB:e==="rail"?YB:qB}a(e5,"getDefaultAspectRatios");function t5(e,t){let o=t?.filter(r=>typeof r=="number"&&Number.isFinite(r)&&r>0).map(r=>Su(r,QB,ZB));return o?.length?o:e5(e)}a(t5,"resolveAspectRatios");function ok(e){return Hf(e?.count,KB,48)}a(ok,"resolveWorkbenchCollectionSkeletonCapacity");function rk(e){if(e===void 0)return "skeleton";if(e==="skeleton"||e==="spinner")return e;throw new TypeError('WorkbenchCollection loading.variant must be "skeleton" or "spinner".')}a(rk,"resolveWorkbenchCollectionLoadingVariant");function o5({columnCount:e,config:t,phase:o}){if(o==="initial"){let n=Su(e*2,6,24);return Hf(t?.count,n,48)}let r=Su(e,1,12);return Hf(t?.loadMoreCount,r,24)}a(o5,"resolveSkeletonCount");function tk(e,t){return Math.max(1,e/t)}a(tk,"getSkeletonHeight");function Vf({mode:e,phase:t,columnCount:o,columnWidth:r,cardWidth:n,gap:i,rowHeight:s,config:l,ariaLabel:d,className:c}){let p=o5({columnCount:o,config:l,phase:t}),u=t5(e,l?.aspectRatios),g=l?.animated??true,f=ho.useMemo(()=>Array.from({length:p},(x,y)=>({aspectRatio:u[y%u.length],key:`${t}-${y}`,index:y})),[u,p,t]),b=a((x,y)=>jsxRuntime.jsx(Zd,{index:x.index,children:jsxRuntime.jsx(Ur,{variant:"block",animated:g,className:"h-auto w-full rounded-lg",style:{backgroundColor:JB,...y??{aspectRatio:String(x.aspectRatio)}},"data-collection-skeleton-item":"","data-skeleton-aspect-ratio":x.aspectRatio})}),"renderSkeleton");return jsxRuntime.jsx(Xn,{animation:l?.animation,animated:g,children:jsxRuntime.jsx("div",{role:"status","aria-label":d,"aria-atomic":"true","data-collection-loading":t,"data-layout-mode":e,className:"min-w-0",children:e==="masonry"||e==="dense"?jsxRuntime.jsx(Xi,{items:f,columnCount:o,columnWidth:r,gap:i,rowHeight:s,placementStrategy:e==="dense"?"dense":"shortest",className:c,containerProps:{"aria-hidden":true},getItemKey:x=>x.key,getItemSize:(x,y)=>({height:tk(y.columnWidth,x.aspectRatio)}),renderItem:(x,y)=>b(x,{height:`${tk(y.columnWidth,x.aspectRatio)}px`})}):e==="rail"?jsxRuntime.jsx("div",{"aria-hidden":"true",className:m("grid min-w-0 grid-flow-col items-start overflow-x-auto",c),style:{gap:i,gridAutoColumns:typeof n=="number"?`${n}px`:n??`${r}px`},children:f.map(x=>jsxRuntime.jsx("div",{children:b(x)},x.key))}):jsxRuntime.jsx("div",{"aria-hidden":"true",className:m("grid min-w-0 items-start",c),style:{gap:i,gridTemplateColumns:`repeat(${o}, minmax(0, 1fr))`},children:f.map(x=>jsxRuntime.jsx("div",{children:b(x)},x.key))})})})}a(Vf,"WorkbenchCollectionSkeleton");function n5(e,t){if(e.size!==t.size)return false;for(let o of e)if(!t.has(o))return false;return true}a(n5,"setsEqual");function a5(e){return String(e)}a(a5,"getComparableKey");function i5(e){return e==="multiple"?"toggle":"replace"}a(i5,"getDefaultBehavior");function Tu({items:e,getItemKey:t,mode:o="none",behavior:r,selectedKeys:n,defaultSelectedKeys:i,isItemDisabled:s,onSelectionChange:l}){let d=n!==void 0,[c,p]=ho.useState(()=>new Set(i??[])),u=ho.useRef(null),g=ho.useRef(l);g.current=l;let f=ho.useMemo(()=>{let h=new Map;return e.map((S,T)=>{let C=t(S,T),R=a5(C),M=h.get(R);if(M!==void 0)throw new TypeError(`useWorkbenchCollectionSelection received duplicate item key "${R}" at indices ${M} and ${T}.`);return h.set(R,T),{item:S,index:T,key:C}})},[t,e]),b=ho.useMemo(()=>{let h=new Map;return f.forEach(S=>h.set(S.key,S)),h},[f]),x=ho.useMemo(()=>o==="none"?new Set:d?new Set(n??[]):c,[d,n,c,o]),y=ho.useRef(x);y.current=x;let k=ho.useCallback(()=>{u.current=null;},[]);ho.useEffect(()=>{if(d)return;let h=new Set(f.map(({key:S})=>S));p(S=>{let T=new Set(Array.from(S).filter(C=>h.has(C)));return n5(S,T)?S:(y.current=T,T)});},[d,f]),ho.useEffect(()=>{let h=u.current;if(o!=="multiple"||x.size===0||h===null){k();return}let S=b.get(h);(!S||s?.(S.item,S.index))&&k();},[s,b,o,k,x.size]);let w=ho.useCallback((h,S={})=>{if(o==="none")return;let T=b.get(h);if(!T||s?.(T.item,T.index))return;let C=new Set(y.current),R=r??i5(o),M=S.shiftKey&&o==="multiple"?"range":S.behavior??R;o==="single"&&(M=M==="toggle"?"toggle":"replace");let I=u.current===null?void 0:b.get(u.current),A=!!(I&&!s?.(I.item,I.index));o==="multiple"&&M==="range"&&!A&&(M=R==="range"?"toggle":R);let N=new Set;if(o==="single")M==="toggle"&&C.has(T.key)||N.add(T.key);else if(M==="range"&&I){C.forEach(P=>N.add(P));let D=Math.min(I.index,T.index),E=Math.max(I.index,T.index);f.slice(D,E+1).forEach(P=>{s?.(P.item,P.index)||N.add(P.key);});}else M==="replace"?N.add(T.key):(C.forEach(D=>N.add(D)),N.has(T.key)?N.delete(T.key):N.add(T.key));u.current=o==="multiple"?T.key:null,d||(y.current=N,p(N)),g.current?.(N,{item:T.item,index:T.index,key:T.key,behavior:M});},[r,d,s,b,o,f]),v=ho.useCallback(h=>x.has(h),[x]);return {mode:o,selectedKeys:x,isSelected:v,selectKey:w,resetAnchor:k}}a(Tu,"useWorkbenchCollectionSelection");var Kf=12,d5=8,Ru=280,c5=640,u5=1024,lk=24;function Mu(e,t,o){return Math.min(Math.max(e,t),o)}a(Mu,"clamp");function Ir(e,t){return typeof e=="function"?e(t):e}a(Ir,"resolveRenderableSlot");function Zi(e,t,o){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return t;let r=e.trim().toLowerCase();if(!r)return t;if(/^\d+(\.\d+)?(px)?$/.test(r)){let n=Number.parseFloat(r);return Number.isFinite(n)&&n>0?n:t}if(r.endsWith("rem")){let n=Number.parseFloat(r),i=typeof window>"u"?16:Number.parseFloat(window.getComputedStyle(o||document.documentElement).fontSize)||16;return Number.isFinite(n)&&n>0?n*i:t}return t}a(Zi,"resolveLengthToPixels");function Nu(e){if(!(typeof e!="number"||!Number.isFinite(e)||e<=0))return Mu(Math.round(e),1,lk)}a(Nu,"normalizeColumns");function ak(e,t){if(e==="auto"||e===void 0)return;if(typeof e=="number")return Nu(e);let o=Nu(e.mobile),r=Nu(e.tablet),n=Nu(e.desktop);return t>=u5?n??r??o:t>=c5?r??o??n:o??r??n}a(ak,"resolveResponsiveColumns");function p5({containerWidth:e,itemCount:t,gap:o,columns:r,underfilledBehavior:n,maxColumns:i,minCardWidth:s,idealCardWidth:l,maxCardWidth:d,node:c}){let p=ak(r,e),u=ak(i,e);if(p)return u?Math.min(p,u):p;if(!e)return 1;let g=Zi(l,Ru,c),f=Zi(s,g*.78,c),b=Math.max(f,Zi(d,g*1.35,c)),x=Math.max(t,1),y=Math.max(1,Math.min(n==="preserve-columns"?lk:x,Math.ceil((e+o)/(Math.max(f*.75,1)+o)))),k=1,w=Number.POSITIVE_INFINITY;for(let v=1;v<=y;v+=1){let h=(e-o*Math.max(v-1,0))/v;if(!Number.isFinite(h)||h<=0)continue;let S=Math.abs(h-g)+Math.max(0,f-h)*3+Math.max(0,h-b)*2;S<w&&(w=S,k=v);}return u?Math.min(k,u):k}a(p5,"resolveColumnCount");function ik(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:Kf}a(ik,"normalizeGap");function m5(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:d5}a(m5,"normalizeRowHeight");function f5(e){return typeof e=="number"&&Number.isFinite(e)?Mu(e,0,1):0}a(f5,"normalizeThreshold");function b5(e,t,o){let r=Number.isFinite(t)&&Number(t)>0?Number(t):void 0,n=e?.height??(r?Math.max(1,o/r):void 0);return {...e,height:n}}a(b5,"normalizeItemSize");function g5(e,t){if(e&&typeof e=="object"){let o=e;if(typeof o.id=="string"||typeof o.id=="number")return o.id;if(typeof o.key=="string"||typeof o.key=="number")return o.key}return t}a(g5,"getDefaultItemKey");function h5(e){return `@inf-monkeys-tech/monkeys-design:workbench-collection:${e}`}a(h5,"getScrollStorageKey");function y5(e){let t=e?.parentElement??null;for(;t;){if(typeof window>"u")return t;let o=window.getComputedStyle(t).overflowY;if(o==="auto"||o==="scroll")return t;t=t.parentElement;}return null}a(y5,"getParentScrollOwner");function sk(e,t){if(typeof Element>"u"||!(e instanceof Element)||e===t)return false;let o=e.closest('a, button, input, select, textarea, summary, [contenteditable="true"], [data-collection-action]');return !!(o&&t.contains(o))}a(sk,"isInteractiveEventTarget");function x5(e){if(!(!Number.isFinite(e)||Number(e)<=0))return Mu(Math.round(Number(e)),1,12)}a(x5,"normalizeTitleMaxLines");function Sn({items:e,config:t,renderItem:o,slots:r,callbacks:n,className:i,classNames:s,style:l,ariaLabel:d}){let c=ke(),p=Ye().workbench.collection,u=Or(),g=Hn(),f=ho.useId().replace(/:/g,""),b=ho.useRef(null),x=ho.useRef(null),y=ho.useRef(null),k=ho.useRef(null),w=ho.useRef(false),v=ho.useRef(false),h=ho.useRef(false),S=ho.useRef(false),T=ho.useRef(null),C=ho.useRef(null),R=ho.useRef(void 0),M=ho.useRef(false),[I,A]=ho.useState(0),[N,D]=ho.useState(Kf),[E,P]=ho.useState(null),W=ho.useRef(n);W.current=n;let H=ho.useCallback(de=>{y.current=de,P(de);},[]),B=t.layout.mode;if(B!=="grid"&&B!=="masonry"&&B!=="dense"&&B!=="rail")throw new TypeError(`WorkbenchCollection layout.mode "${String(B)}" is not supported.`);let L=t.layout.gap===void 0?N:ik(t.layout.gap),F=m5(t.layout.rowHeight),_=t.getItemKey??g5,$=ho.useMemo(()=>e.map((de,Ee)=>{let qe=_(de,Ee);return {item:de,index:Ee,key:qe,stringKey:String(qe)}}),[_,e]),G=$.map(({stringKey:de})=>de).join(""),z=t.state,re=z?.loading===true,Z=z?.loadingMore===true,ae=z?.hasMore===true,ee=rk(t.loading?.variant),q=re&&$.length===0&&ee==="skeleton"?ok(t.loading?.skeleton):$.length,U=t.selection?.mode??"none",X=ho.useCallback(de=>t.selection?.isItemDisabled?.(de.item,de.index)??false,[t.selection?.isItemDisabled]),O=ho.useCallback(de=>de.key,[]),K=ho.useCallback((de,Ee)=>{W.current?.onSelectionChange?.(de,{item:Ee.item.item,key:Ee.key,behavior:Ee.behavior});},[]),{selectedKeys:ne,selectKey:fe}=Tu({items:$,getItemKey:O,mode:U,behavior:t.selection?.behavior,selectedKeys:t.selection?.selectedKeys,defaultSelectedKeys:t.selection?.defaultSelectedKeys,isItemDisabled:X,onSelectionChange:K});ho.useEffect(()=>{let de=E;if(!de)return;let Ee=a(()=>{if(t.layout.gap===void 0&&b.current){let Le=Number.parseFloat(window.getComputedStyle(b.current).columnGap);D(Number.isFinite(Le)&&Le>=0?Le:Kf);}let qe=de.clientWidth;A(Le=>Le===qe?Le:qe);},"updateWidth");if(Ee(),typeof ResizeObserver=="function"){let qe=new ResizeObserver(Ee);return qe.observe(de),()=>qe.disconnect()}if(!(typeof window>"u"))return window.addEventListener("resize",Ee),()=>window.removeEventListener("resize",Ee)},[E,t.layout.gap,l?.gap,g]);let he=p5({containerWidth:I,itemCount:q,gap:L,columns:t.layout.columns,underfilledBehavior:t.layout.underfilledBehavior,maxColumns:t.layout.maxColumns,minCardWidth:t.layout.minCardWidth,idealCardWidth:t.layout.idealCardWidth??t.layout.columnWidth,maxCardWidth:t.layout.maxCardWidth,node:y.current}),me=I>0?Math.max(0,(I-L*Math.max(he-1,0))/he):Zi(t.layout.cardWidth??t.layout.columnWidth??t.layout.idealCardWidth,Ru,y.current),ie=t.layout.placementStrategy??(B==="dense"?"dense":B==="masonry"?"shortest":"shelf"),be=ho.useMemo(()=>({collection:t.labels?.collection??p.label,loading:t.labels?.loading??p.loading,empty:t.labels?.empty??p.empty,loadError:t.labels?.loadError??p.loadError,refreshError:t.labels?.refreshError??p.refreshError,retry:t.labels?.retry??p.retry,loadingMore:t.labels?.loadingMore??p.loadingMore,permission:t.labels?.permission??p.permission,offline:t.labels?.offline??p.offline,requestAccess:t.labels?.requestAccess??p.requestAccess}),[t.labels,p]),He=ho.useMemo(()=>{let de=t.virtualization;return de?.enabled!==true||de.fallback!=="error"?null:de.adapter?de.adapter.supports?.(B)===false?new Error(`WorkbenchCollection virtualization adapter does not support mode "${B}".`):null:new Error("WorkbenchCollection virtualization requires an adapter.")},[t.virtualization,B]),We=ho.useMemo(()=>({mode:B,columnCount:he,columnWidth:me,containerWidth:I,gap:L,itemCount:$.length}),[he,me,I,L,B,$.length]);ho.useEffect(()=>{W.current?.onLayoutChange?.(We),I>0&&!M.current&&(M.current=true,W.current?.onLayoutReady?.(We));},[We,I]),ho.useEffect(()=>{M.current=false;},[B]);let Ke=ho.useCallback(()=>{let de=t.layout.scrollOwner;return de&&de!=="self"&&de!=="parent"?de:B==="rail"?x.current:de==="parent"?y5(b.current):b.current},[t.layout.scrollOwner,B]);ho.useEffect(()=>{let de=t.scrollRestorationKey?.trim();if(!de||typeof window>"u")return;let Ee=Ke();if(!Ee)return;let qe=h5(de);try{let Se=Number.parseFloat(window.sessionStorage.getItem(qe)??"");Number.isFinite(Se)&&Se>=0&&(Ee.scrollTop=Se);}catch{}let Le=a(()=>{try{window.sessionStorage.setItem(qe,String(Ee.scrollTop));}catch{}},"saveScrollPosition");return Ee.addEventListener("scroll",Le,{passive:true}),()=>{Le(),Ee.removeEventListener("scroll",Le);}},[t.scrollRestorationKey,Ke]);let ce=typeof n?.onLoadMore=="function",Q=z?.error??He;ho.useEffect(()=>{(!ce||!ae)&&(v.current=false,h.current=false,S.current=false);},[ce,ae]);let ge=ho.useCallback(()=>{if(!ce||!ae||Z||w.current)return;w.current=true;let de=a(()=>{w.current=false;},"releaseRequest");try{let Ee=W.current?.onLoadMore?.();Ee&&typeof Ee.then=="function"?Ee.then(de,de):de();}catch(Ee){throw de(),Ee}},[ce,ae,Z]);ho.useEffect(()=>{let de=k.current;if((T.current!==de||C.current!==G||R.current!==t.loading?.pageKey)&&(T.current=de,C.current=G,R.current=t.loading?.pageKey,v.current=false,h.current=false,S.current=false),!de||!ce||!ae||typeof IntersectionObserver!="function")return;let Ee=Ke(),qe=false,Le=true,Se=new IntersectionObserver(xt=>{if(!Le)return;let Gt=xt.some(Ca=>Ca.isIntersecting);if(!(Gt&&(Z||w.current))){if(S.current){if(qe=true,S.current=false,v.current=Gt,!Gt){h.current=false;return}if(h.current)return;h.current=true,ge();return}if(!qe){qe=true,v.current=Gt,Gt||(h.current=false),Gt&&t.loading?.autoFill&&!h.current&&(h.current=true,ge());return}if(!Gt){v.current=false,h.current=false;return}v.current||(v.current=true,h.current=true,ge());}},{root:Ee===b.current?Ee:Ee||null,rootMargin:t.loading?.rootMargin??"240px",threshold:f5(t.loading?.threshold)}),Je=Ee??(typeof window>"u"?null:window),bt=a(()=>{!v.current||h.current||S.current||(S.current=true,Se.unobserve(de),Se.takeRecords(),Se.observe(de));},"validateActiveIntersection");return Se.observe(de),Je?.addEventListener("scroll",bt,{passive:true}),()=>{Le=false,Se.disconnect(),Je?.removeEventListener("scroll",bt);}},[ce,t.loading?.autoFill,t.loading?.pageKey,t.loading?.rootMargin,t.loading?.threshold,ae,G,Z,$.length,ge,Ke]),ho.useEffect(()=>{if(!t.loading?.autoFill||!ce||!ae||Z||h.current||w.current||!k.current)return;let Ee=Ke()??(t.layout.scrollOwner==="parent"?b.current?.parentElement??null:null)??b.current;if(!Ee)return;let qe=B==="rail"?Ee.clientWidth:Ee.clientHeight,Le=B==="rail"?Ee.scrollWidth:Ee.scrollHeight;qe<=0||Le<=qe+1&&(h.current=true,ge());},[ce,t.layout.scrollOwner,t.loading?.autoFill,t.loading?.pageKey,ae,G,Z,$.length,ge,Ke,B]);let we=ho.useMemo(()=>{if(!t.grouping)return [{key:"__all__",stringKey:"__all__",items:$}];let de=new Map;return $.forEach(Ee=>{let qe=t.grouping?.getGroupKey(Ee.item,Ee.index)??"__all__",Le=String(qe),Se=de.get(Le);if(Se){Se.items.push(Ee);return}de.set(Le,{key:qe,stringKey:Le,label:t.grouping?.getGroupLabel?.(qe,Ee.item),items:[Ee]});}),Array.from(de.values())},[t.grouping,$]),Ie=ho.useCallback((de,Ee)=>{let qe=t.selection?.isItemDisabled?.(de.item,de.index)??false,Le={item:de.item,index:de.index,key:de.key,status:t.getItemStatus?.(de.item,de.index)??"idle",disabled:qe,selected:ne.has(de.key),selectionMode:U,layout:Ee,select:a(Se=>fe(de.key,{behavior:Se}),"select"),selectFromEvent:a((Se,Je)=>fe(de.key,{behavior:Je,shiftKey:Se.shiftKey}),"selectFromEvent"),preview:a(()=>n?.onItemPreview?.(de.item,Le),"preview"),detail:a(()=>n?.onItemDetail?.(de.item,Le),"detail"),renderSlot:a(Se=>r?.item?.[Se]?.(de.item,Le),"renderSlot"),notifyMediaLoad:a(()=>n?.onMediaLoad?.(de.item,Le),"notifyMediaLoad"),notifyMediaError:a(Se=>n?.onMediaError?.(de.item,Le,Se),"notifyMediaError")};return Le},[n,t.getItemStatus,t.selection,ne,fe,U,r?.item]),oe=ho.useCallback((de,Ee)=>{let qe=a(Le=>{Le.target!==Le.currentTarget||Le.key!=="Enter"&&Le.key!==" "||(Le.preventDefault(),U!=="none"?Ee.selectFromEvent(Le):n?.onItemClick?.(de.item,Ee,Le));},"handleKeyboard");return {id:`${f}-item-${de.index}`,"data-monkeys-collection-item":"","data-item-key":de.stringKey,"data-selected":Ee.selected||void 0,"data-disabled":Ee.disabled||void 0,"data-status":Ee.status,role:U==="none"?"listitem":"option","aria-selected":U==="none"?void 0:Ee.selected,"aria-disabled":Ee.disabled||void 0,tabIndex:n?.onItemClick||U!=="none"||t.item?.title?.visibility==="hover"?0:void 0,draggable:n?.onItemDragStart?true:void 0,className:m("min-w-0 group/workbench-collection-item outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t.appearance?.hover&&t.appearance.hover!=="none"&&"transition-[transform,box-shadow,background-color] duration-200",t.appearance?.hover==="highlight"&&"hover:bg-muted/30",t.appearance?.hover==="lift"&&"hover:-translate-y-0.5 motion-reduce:transform-none",t.appearance?.hover==="scale"&&"hover:scale-[1.01] motion-reduce:transform-none",t.appearance?.hover==="shadow"&&"hover:shadow-md",t.appearance?.hover==="lift-shadow"&&"hover:-translate-y-0.5 hover:shadow-md motion-reduce:transform-none",t.appearance?.selection==="ring"&&Ee.selected&&"ring-2 ring-primary",t.appearance?.selection==="outline"&&Ee.selected&&"outline outline-2 outline-primary",s?.item),onClick:a(Le=>{sk(Le.target,Le.currentTarget)||(U!=="none"&&Ee.selectFromEvent(Le),n?.onItemClick?.(de.item,Ee,Le));},"onClick"),onDoubleClick:a(Le=>{sk(Le.target,Le.currentTarget)||n?.onItemDoubleClick?.(de.item,Ee,Le);},"onDoubleClick"),onMouseEnter:a(Le=>n?.onItemHoverChange?.(de.item,Ee,true,Le),"onMouseEnter"),onMouseLeave:a(Le=>n?.onItemHoverChange?.(de.item,Ee,false,Le),"onMouseLeave"),onKeyDown:qe,onDragStart:a(Le=>n?.onItemDragStart?.(de.item,Ee,Le),"onDragStart"),onDragOver:n?.onItemDrop?Le=>Le.preventDefault():void 0,onDrop:a(Le=>n?.onItemDrop?.(de.item,Ee,Le),"onDrop")}},[n,s?.item,f,t.appearance,t.item?.title?.visibility,U]),xe=ho.useCallback((de,Ee)=>{let qe=o(de.item,Ee),Le=t.item?.title,Se=Le?.visibility??"always",Je=Le&&Se!=="never"?Le.getContent?.(de.item,Ee)??Ee.renderSlot("title"):null,bt=!!(Le&&V(Je)),xt=Le?.placement??"below",Gt=bt&&xt.startsWith("overlay-"),Ca=x5(Le?.maxLines),rn=Le?.surface??(Gt?"scrim":"none"),fs=bt?jsxRuntime.jsx("div",{"data-collection-item-title":"","data-title-placement":xt,"data-title-visibility":Se,className:m("min-w-0 px-1 py-2 text-sm font-medium text-foreground",Le?.align==="center"&&"text-center",Le?.align==="end"&&"text-right",Se==="hover"&&"!opacity-0 transition-opacity group-hover/workbench-collection-item:!opacity-100 group-focus-within/workbench-collection-item:!opacity-100",Gt&&"pointer-events-none absolute inset-x-0 z-10 px-3 py-2",xt==="overlay-top"&&"top-0",xt==="overlay-center"&&"top-1/2 -translate-y-1/2 motion-reduce:transform-none",xt==="overlay-bottom"&&"bottom-0",rn==="surface"&&"bg-background/90 backdrop-blur-sm",rn==="scrim"&&xt==="overlay-top"&&"bg-gradient-to-b from-background/90 to-transparent pb-8",rn==="scrim"&&xt==="overlay-bottom"&&"bg-gradient-to-t from-background/90 to-transparent pt-8",rn==="scrim"&&xt==="overlay-center"&&"bg-background/75 backdrop-blur-sm",!!Ca&&"overflow-hidden [display:-webkit-box] [-webkit-box-orient:vertical]",s?.itemTitle),style:Ca?{WebkitLineClamp:Ca}:void 0,children:Je}):null,Eo=t.item?.actions,ei=Eo?.visibility??"always",bs=Eo&&ei!=="never"?Ee.renderSlot("actions"):null,Sa=!!(Eo&&V(bs)),hr=Eo?.placement??"overlay-bottom",ti=Sa&&hr.startsWith("overlay-"),gs=Sa?jsxRuntime.jsx("div",{"data-collection-item-actions":"","data-actions-placement":hr,"data-actions-align":Eo?.align??"center","data-actions-visibility":ei,className:m("flex min-w-0 items-center gap-2 px-2 py-2",Eo?.align==="start"&&"justify-start",(Eo?.align===void 0||Eo.align==="center")&&"justify-center",Eo?.align==="end"&&"justify-end",Eo?.wrap!==false&&"flex-wrap",ei==="hover"&&"!opacity-0 transition-opacity group-hover/workbench-collection-item:!opacity-100 group-focus-within/workbench-collection-item:!opacity-100 [@media(hover:none)]:!opacity-100",ti&&"pointer-events-none absolute inset-x-0 z-20",hr==="overlay-top"&&"top-1",hr==="overlay-bottom"&&"bottom-1",s?.itemActions),children:jsxRuntime.jsx("div",{className:m("pointer-events-auto flex items-center gap-2",Eo?.wrap!==false&&"flex-wrap"),children:bs})}):null;return !bt&&!Sa?qe:jsxRuntime.jsxs("div",{className:m("min-w-0",(Gt||ti)&&"relative",s?.itemContent),"data-collection-item-content":"",children:[xt==="above"?fs:null,hr==="above"?gs:null,qe,xt==="below"||Gt?fs:null,hr==="below"||ti?gs:null]})},[s?.itemActions,s?.itemContent,s?.itemTitle,t.item,o]),Ve=ho.useCallback((de,Ee,qe=true)=>{let Le=Ie(de,Ee),Se=xe(de,Le);return qe?jsxRuntime.jsx("div",{...oe(de,Le),children:Se}):Se},[Ie,oe,xe]),_e=ho.useMemo(()=>({mode:B,columnCount:he,columnWidth:me,containerWidth:I,gap:L,placementStrategy:ie,rowHeight:F}),[he,me,I,L,B,ie,F]),Ge=a(de=>{if(t.windowed&&B!=="dense"){let Se=de===we[we.length-1];return jsxRuntime.jsx(Yw,{items:de.items,getKey:Je=>Je.stringKey,layout:_e,cardWidth:Zi(t.layout.cardWidth,Ru,b.current),getScrollOwner:Ke,railRef:B==="rail"&&Se?x:void 0,tailRef:B==="rail"&&Se?k:void 0,estimateHeight:(Je,bt)=>{let xt=t.layout.getItemSize?.(Je.item,{..._e,columnWidth:bt}),Gt=t.layout.getItemAspectRatio?.(Je.item,Je.index);return Zi(xt?.height,Gt&&Gt>0?bt/Gt:300,b.current)},containerProps:{role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0,className:s?.layout},getItemProps:(Je,bt)=>oe(Je,Ie(Je,bt)),renderItem:(Je,bt)=>Ve(Je,bt,false)})}let Ee=t.virtualization,qe=Ee?.adapter,Le=Ee?.enabled===true;if(Le&&(!qe||qe.supports?.(B)===false)&&Ee?.fallback==="error")return null;if(Le&&qe&&qe.supports?.(B)!==false)return qe.render({items:de.items.map(({item:Se})=>Se),keys:de.items.map(({key:Se})=>Se),layout:t.layout,scrollOwner:Ke(),renderItem:a((Se,Je,bt)=>{let xt=de.items[Je];return xt?jsxRuntime.jsx(ho.Fragment,{children:Ve(xt,bt)},xt.stringKey):null},"renderItem")});if(B==="masonry"||B==="dense")return jsxRuntime.jsx(Xi,{items:de.items,columnCount:he,columnWidth:t.layout.cardWidth??t.layout.columnWidth??t.layout.idealCardWidth,gap:L,rowHeight:F,placementStrategy:B==="dense"?"dense":ie,className:s?.layout,containerProps:{role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0},getItemProps:(Se,Je)=>{let bt=Ie(Se,{...Je,mode:B});return oe(Se,bt)},getItemKey:Se=>Se.key,getItemSize:(Se,Je)=>{let bt={...Je,mode:B},xt=t.layout.getItemSize?.(Se.item,bt),Gt=t.layout.getItemAspectRatio?.(Se.item,Se.index);return b5(xt,Gt,Je.columnWidth)},renderItem:(Se,Je)=>Ve(Se,{...Je,mode:B},false)});if(B==="rail"){let Se=t.layout.cardWidth??t.layout.idealCardWidth??Ru,Je=de===we[we.length-1];return jsxRuntime.jsx("div",{ref:Je?x:void 0,role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0,className:m("grid min-w-0 grid-flow-col items-start overflow-x-auto",s?.layout),style:{gap:L,gridAutoColumns:typeof Se=="number"?`${Se}px`:Se},children:de.items.map((bt,xt)=>jsxRuntime.jsx("div",{ref:Je&&xt===de.items.length-1?k:void 0,className:"min-w-0",children:Ve(bt,_e)},bt.stringKey))})}return jsxRuntime.jsx("div",{role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0,className:m("grid min-w-0 items-start",s?.layout),style:{gap:L,gridTemplateColumns:`repeat(${he}, minmax(0, 1fr))`},children:de.items.map(Se=>{let Je=t.layout.getItemSize?.(Se.item,_e),bt=Mu(Math.round(Number(Je?.columnSpan)||1),1,he),xt=t.layout.getItemAspectRatio?.(Se.item,Se.index);return jsxRuntime.jsx("div",{...oe(Se,Ie(Se,{..._e,columnSpan:bt,size:Je})),style:{gridColumn:bt>1?`span ${bt}`:void 0,aspectRatio:Number.isFinite(xt)&&Number(xt)>0?String(xt):void 0},children:Ve(Se,{..._e,columnSpan:bt,size:Je},false)},Se.stringKey)})})},"renderGroupItems"),le={items:e,error:Q,loading:re,loadingMore:Z,selectedKeys:ne,retry:a(()=>n?.onRetry?.(),"retry")},Me=Ir(r?.header,le),Ae=Ir(r?.toolbar,le),J=ne.size>0?Ir(r?.selectionToolbar,le):null,$e=Ir(r?.beforeItems,le),ue=Ir(r?.footer,le),Re=z?.permission===true,se=z?.offline===true&&!Re,te=re&&e.length===0&&!Re&&!se,Te=!!Q&&e.length===0&&!Re&&!se&&!te,ze=!Re&&!se&&!te&&!Te&&(z?.empty===true||e.length===0),je=Ir(r?.loading,le),it=Ir(r?.error,le),Y=Ir(r?.permission,le),pe=Ir(r?.offline,le),Be=Ir(r?.empty,le),rt=Ir(r?.loadMore,le),Ce=t.layout.scrollOwner==="self"||t.layout.scrollOwner===void 0&&(t.layout.fillHeight||t.layout.maxHeight),Xe={...l,gap:t.layout.gap===void 0?l?.gap??"var(--monkeys-bento-gap, var(--global-spacing, 0.75rem))":ik(t.layout.gap),padding:t.layout.padding??l?.padding,height:t.layout.fillHeight?"100%":l?.height,maxHeight:t.layout.maxHeight??l?.maxHeight,overflow:Ce?"auto":l?.overflow};return jsxRuntime.jsxs("section",{ref:b,...c,"data-monkeys-component":"workbench-collection","data-layout-mode":B,"data-density":t.appearance?.density,"data-radius":t.appearance?.radius,"data-media-fit":t.appearance?.mediaFit,"data-hover-effect":t.appearance?.hover,"aria-label":d??be.collection,"aria-busy":re||Z||void 0,className:m("min-h-0 min-w-0",t.layout.fillHeight&&"h-full",s?.root,i),style:Xe,children:[V(Me)?jsxRuntime.jsx("div",{className:s?.header,children:Me}):null,V(Ae)?jsxRuntime.jsx("div",{className:s?.toolbar,children:Ae}):null,V(J)?jsxRuntime.jsx("div",{className:s?.selectionToolbar,children:J}):null,V($e)?jsxRuntime.jsx("div",{className:s?.beforeItems,children:$e}):null,Re?V(Y)?Y:jsxRuntime.jsx(Fa,{kind:"permission",title:be.permission,actions:u.permission?.showRequestAccess!==false&&n?.onRequestAccess?jsxRuntime.jsx(dt,{size:"sm",label:be.requestAccess,onClick:n.onRequestAccess}):void 0}):se?V(pe)?pe:jsxRuntime.jsx(Fa,{kind:"offline",title:be.offline,actions:u.error?.showRetry!==false&&n?.onRetry?jsxRuntime.jsx(dt,{size:"sm",label:be.retry,onClick:n.onRetry}):void 0}):te?V(je)?je:ee==="spinner"?jsxRuntime.jsx(Kr,{title:be.loading,variant:"spinner"}):jsxRuntime.jsx("div",{ref:H,className:m("min-w-0",s?.items),children:jsxRuntime.jsx(Vf,{mode:B,phase:"initial",columnCount:he,columnWidth:me,cardWidth:t.layout.cardWidth??t.layout.idealCardWidth,gap:L,rowHeight:F,config:t.loading?.skeleton,ariaLabel:be.loading,className:s?.layout})}):Te?V(it)?it:jsxRuntime.jsx(Fa,{kind:"error",title:be.loadError,actions:u.error?.showRetry!==false&&n?.onRetry?jsxRuntime.jsx(dt,{size:"sm",label:be.retry,onClick:n.onRetry}):void 0}):ze?V(Be)?Be:jsxRuntime.jsx(Pi,{title:be.empty}):jsxRuntime.jsx("div",{ref:H,className:m("min-w-0",s?.items),children:we.map((de,Ee)=>{let qe={key:de.key,label:de.label,items:de.items.map(({item:Je})=>Je),groupIndex:Ee},Le=t.grouping?r?.groupHeading?.(qe,le)??de.label:null,Se=`${f}-group-${Ee}`;return jsxRuntime.jsxs("div",{"data-collection-group":de.stringKey,className:s?.group,children:[V(Le)?jsxRuntime.jsx("div",{id:Se,role:"heading","aria-level":2,className:s?.groupHeading,children:Le}):null,Ge(de)]},de.stringKey)})}),e.length>0&&Q?jsxRuntime.jsx("div",{className:s?.status,children:V(it)?it:jsxRuntime.jsx(Fa,{kind:"error",title:be.refreshError,actions:u.error?.showRetry!==false&&n?.onRetry?jsxRuntime.jsx(dt,{size:"sm",label:be.retry,onClick:n.onRetry}):void 0})}):null,e.length>0&&(ae||Z)?jsxRuntime.jsx("div",{ref:B==="rail"?void 0:k,className:s?.loadMore,"data-collection-load-more":"",children:V(rt)?rt:Z?ee==="spinner"?jsxRuntime.jsx(Kr,{title:be.loadingMore,variant:"spinner"}):jsxRuntime.jsx(Vf,{mode:B,phase:"load-more",columnCount:he,columnWidth:me,cardWidth:t.layout.cardWidth??t.layout.idealCardWidth,gap:L,rowHeight:F,config:t.loading?.skeleton,ariaLabel:be.loadingMore,className:s?.layout}):null}):null,V(ue)?jsxRuntime.jsx("div",{className:s?.footer,children:ue}):null]})}a(Sn,"WorkbenchCollection");function k5(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return `${e}px`;if(typeof e=="string"&&e.trim())return e.trim()}a(k5,"getNormalizedGalleryGridCardWidth");function C5(e){return e==="compact"?2:e==="detailed"?6:4}a(C5,"getDefaultGalleryDetailLimit");function S5(e,t){return e===1||e===2||e===3?Number(e):t==="detailed"?1:2}a(S5,"getNormalizedGalleryBentoColumns");function T5({density:e,visibility:t,limit:o}){if(t==="all")return Number.POSITIVE_INFINITY;let r=Number.parseInt(String(o),10);return Number.isFinite(r)&&r>0?r:C5(e)}a(T5,"getNormalizedGalleryDetailLimit");function dk(e){return e==="compact"?{min:220,ideal:244,max:268}:e==="detailed"?{min:320,ideal:372,max:420}:{min:260,ideal:304,max:348}}a(dk,"getGalleryCardWidthMetrics");function N5(e){if(e==null||e===""||e==="auto")return;let t=Number.parseInt(String(e),10);if(!(!Number.isFinite(t)||t<=0))return Math.max(1,Math.min(t,8))}a(N5,"getNormalizedGalleryGridColumns");function ck(e){if(e==null)return 0;let t=String(e).trim();return t&&t!=="\u2014"?t.length:0}a(ck,"getGalleryTextLength");function fl({column:e,row:t,getFieldValue:o,getDisplayText:r}){if(!e)return "";let n=o(e,t);if(n==null||n==="")return "";let i=r(n);return i==="\u2014"?"":String(i)}a(fl,"getGalleryFieldText");function qf({text:e,charsPerLine:t,maxLines:o}){let r=ck(e);return r?Math.max(1,Math.min(o,Math.ceil(r/t))):0}a(qf,"estimateLineCount");function R5({text:e,density:t,bentoColumns:o}){let r=t==="detailed"?54:t==="compact"?44:48,s=qf({text:e,charsPerLine:o===1?t==="detailed"?32:26:t==="detailed"?18:15,maxLines:t==="detailed"?3:2});return s?r+Math.max(0,s-1)*16:r}a(R5,"estimateGalleryDetailCellHeight");function M5({columns:e,density:t,bentoColumns:o}){if(!e.length)return 0;let r=e.map(i=>R5({text:i.text,density:t,bentoColumns:o}));if(o===1)return 12+r.reduce((i,s)=>i+s,0)+Math.max(0,e.length-1)*8;let n=12;for(let i=0;i<r.length;i+=o){let s=r.slice(i,i+o);n+=Math.max(...s),i+o<r.length&&(n+=8);}return n}a(M5,"estimateGalleryDetailGridHeight");function I5({row:e,columns:t,galleryFieldKey:o,galleryDensity:r,galleryBentoColumns:n,galleryDetailVisibility:i,galleryDetailLimit:s,getFieldValue:l,isMediaColumn:d,isTitleCandidate:c,isSummaryCandidate:p,getDisplayText:u,isImageField:g,isAudioField:f,cardVariant:b,renderPreview:x,renderLeadingVisual:y,hiddenDetailFieldKeys:k,layout:w,resolveRecordVisual:v}){let h=t.find(U=>U.renderType==="icon"),S=h&&v?v(e?.[h.key],e,h):null,C=(o!=="auto"?t.find(U=>U.key===o&&d(U,e)):null)||t.find(U=>d(U,e))||null,R=C?l(C,e):null,M=C?g(C,R):false,I=C?f(C,R):false,N=!!y||!!S,D=t.filter(U=>U.key!==C?.key&&U.renderType!=="icon"),P=D.filter(U=>{if(!U||d(U,e)||!c(U,e))return false;let X=l(U,e);return !(X==null||X==="")})[0]||null,W=P?fl({column:P,row:e,getFieldValue:l,getDisplayText:u}):String(u(e?.linkKey||e?.id||"")),H=D.find(U=>!U||U.key===P?.key||d(U,e)||!p(U,e)?false:fl({column:U,row:e,getFieldValue:l,getDisplayText:u}).length>12)||D.find(U=>!U||U.key===P?.key||d(U,e)||!p(U,e)?false:ck(fl({column:U,row:e,getFieldValue:l,getDisplayText:u}))>0)||null,B=H?fl({column:H,row:e,getFieldValue:l,getDisplayText:u}):"",L=new Set(k),F=D.filter(U=>U.key!==P?.key&&U.key!==H?.key&&!L.has(U.key)).map(U=>({column:U,text:fl({column:U,row:e,getFieldValue:l,getDisplayText:u})})),_=T5({density:r,visibility:i,limit:s}),$=Number.isFinite(_)?F.slice(0,_):F,G=Math.max(F.length-$.length,0),z=S5(n,r),re=w?.columnWidth||dk(r).ideal;if(b==="image-only")return {width:re,height:Math.round(re*1.25)};if(b==="preview-only")return {width:re,height:Math.round(re*.82)};let Z=r==="detailed"?84:r==="compact"?64:72;typeof x=="function"?Z+=r==="detailed"?188:r==="compact"?140:164:M?Z+=Math.round(re*(r==="detailed"?.72:.62))+12:I&&(Z+=92);let ae=qf({text:W,charsPerLine:r==="detailed"?26:24,maxLines:2})||1,ee=qf({text:B,charsPerLine:N?22:r==="detailed"?30:26,maxLines:r==="detailed"?4:2}),q=26+ae*18+(ee>0?ee*16+4:0);return Z+=Math.max(N?56:0,q),Z+=M5({columns:$,density:r,bentoColumns:z}),G>0&&(Z+=18),!B&&$.length===0&&(Z+=24),{width:re,height:Z}}a(I5,"getDefaultGalleryMasonryItemSize");function uk({rows:e=[],children:t,columns:o=[],onRowClick:r,cardInteraction:n="button",selectedLinkKey:i,selectedRowKey:s,selectedRowKeys:l,className:d,isMasonry:c=false,galleryLayoutMode:p="auto",galleryRailCardWidth:u,galleryGap:g,galleryScrollDirection:f,galleryGridColumns:b,galleryGridColumnsResponsive:x,galleryCardWidthMetrics:y,galleryCardAspectRatio:k,galleryCardMinHeight:w,galleryGridCardWidth:v,galleryUnderfilledBehavior:h,galleryMasonryColumnWidth:S,masonryPlacementStrategy:T,pagination:C,onLoadMore:R,scrollOwner:M,windowed:I,galleryFieldKey:A="auto",galleryDensity:N="comfortable",galleryBentoColumns:D=2,galleryDetailVisibility:E="limit",galleryDetailLimit:P,shouldEnhanceMultimodal:W=true,getFieldValue:H,isMediaColumn:B,isTitleCandidate:L,isSummaryCandidate:F,getDisplayText:_,renderFieldValue:$,getImagePreviewSrc:G,isImageField:z,isAudioField:re,AudioPlayerComponent:Z,cardVariant:ae="default",cardPresentation:ee,renderCardSlot:q,renderCoverTitle:U,galleryDetailPresentation:X,renderPreview:O,renderMeta:K,renderLeadingVisual:ne,resolveRecordVisual:fe,hiddenDetailFieldKeys:he=[],labels:me,formatLabel:ie,getMasonryItemSize:be}){let{min:He,ideal:We,max:Ke}=y??dk(N),ce=u||He,Q=N5(b),ge=k5(v),we=S||He,Ie=p==="rail",oe=H||qi,xe=_||ul,Ve=z||pl,_e=re||ml,Ge=B||((ue,Re)=>bu(ue,Re,{getFieldValue:oe,shouldEnhanceMultimodal:W,isImageField:Ve,isAudioField:_e})),le=L||((ue,Re)=>gu(ue,Re,{isMediaColumn:Ge})),Me=F||((ue,Re)=>hu(ue,Re,{isMediaColumn:Ge})),Ae=$||((ue,Re,{compact:se}={})=>jsxRuntime.jsx("span",{children:xe(oe(ue,Re))})),J=a((ue,Re)=>jsxRuntime.jsx(yu,{row:ue,columns:o,cardInteraction:n,onClick:r?()=>r(ue,Re):void 0,isSelected:l?l.has(String(ue?.linkKey||ue?.id||"")):String(ue?.linkKey||ue?.id||"")===String(s||i||""),isMasonry:c,galleryFieldKey:A,galleryDensity:N,galleryBentoColumns:D,galleryDetailVisibility:E,galleryDetailLimit:P,galleryDetailPresentation:X,shouldEnhanceMultimodal:W,getFieldValue:oe,isMediaColumn:Ge,isTitleCandidate:le,isSummaryCandidate:Me,getDisplayText:xe,renderFieldValue:Ae,getImagePreviewSrc:G,isImageField:Ve,isAudioField:_e,AudioPlayerComponent:Z,cardVariant:ae,cardPresentation:ee,renderCardSlot:q,renderCoverTitle:U,renderPreview:O,renderMeta:K,renderLeadingVisual:ne,resolveRecordVisual:fe,hiddenDetailFieldKeys:he,labels:me,formatLabel:ie},ue?.id||ue?.linkKey||Re),"renderGalleryCard"),$e=c?T==="dense"?"dense":"masonry":Ie?"rail":"grid";if(Kw($e,f),t!==void 0){let ue=ho.Children.toArray(t);return jsxRuntime.jsx(Sn,{items:ue,callbacks:{onLoadMore:R},slots:{loadMore:C?.loadingMore?jsxRuntime.jsx(Kr,{variant:"spinner",className:"py-global",style:{minHeight:0}}):void 0},classNames:{layout:d},config:{windowed:I,state:C,loading:{autoFill:true},getItemKey:a((Re,se)=>ho.isValidElement(Re)&&Re.key!=null?Re.key:se,"getItemKey"),layout:{mode:$e,scrollOwner:M??"parent",gap:g,columns:x??(Q?{mobile:1,tablet:Math.min(2,Q),desktop:Q}:"auto"),underfilledBehavior:h,cardWidth:Ie?ce:void 0,minCardWidth:ge??He,idealCardWidth:ge??We,maxCardWidth:ge??Ke}},renderItem:Re=>Re})}return jsxRuntime.jsx(Sn,{items:e,slots:{loadMore:C?.loadingMore?jsxRuntime.jsx(Kr,{variant:"spinner",className:"py-global",style:{minHeight:0}}):void 0},callbacks:{onLoadMore:R,onItemClick:n==="container"&&r?(ue,Re)=>r(ue,Re.index):void 0},classNames:{layout:d},config:{windowed:I,state:C,loading:{autoFill:true},getItemKey:a((ue,Re)=>ue?.id||ue?.linkKey||Re,"getItemKey"),layout:{mode:$e,underfilledBehavior:h,scrollOwner:M,gap:g,columns:x??(Q?{mobile:1,tablet:Math.min(2,Q),desktop:Q}:"auto"),cardWidth:Ie?ce:void 0,minCardWidth:ge??He,idealCardWidth:c?we:ge??We,maxCardWidth:ge??Ke,placementStrategy:T??(ae==="image-only"?"shortest":"shelf"),getItemAspectRatio:ae==="image-only"?ue=>{let Re=o.find(je=>je.key===A)??o.find(je=>Ge(je,ue)),se=Re?oe(Re,ue):void 0,te=se&&typeof se=="object"&&"aspectRatio"in se?se.aspectRatio:void 0;if(typeof te!="string"||!/^\d+(?:\.\d+)?:\d+(?:\.\d+)?$/.test(te))return;let[Te,ze]=te.split(":").map(Number);return Te>0&&ze>0?Te/ze:void 0}:void 0,getItemSize:ae==="image-only"&&k&&k>0?(ue,Re)=>({height:Math.max(w??0,Re.columnWidth/k)}):c?(ue,Re)=>{let se=I5({row:ue,columns:o,galleryFieldKey:A,galleryDensity:N,galleryBentoColumns:D,galleryDetailVisibility:E,galleryDetailLimit:P,getFieldValue:oe,isMediaColumn:Ge,isTitleCandidate:le,isSummaryCandidate:Me,getDisplayText:xe,isImageField:Ve,isAudioField:_e,cardVariant:ae,renderPreview:O,renderLeadingVisual:ne,hiddenDetailFieldKeys:he,layout:Re,resolveRecordVisual:fe});if(typeof be!="function")return se;let te=be(ue,{...Re,placementStrategy:Re.placementStrategy==="dense"?"dense":"shelf",defaultSize:se})||{};return {...se,...te}}:void 0}},renderItem:(ue,Re)=>J(ue,Re.index)})}a(uk,"WorkbenchGalleryView");function pk({layout:e="horizontal",mediaPosition:t="start",detailsSize:o="balanced",sizing:r="content",asidePosition:n="end",detailsVisible:i=true,heading:s,metadata:l,message:d,actions:c,media:p,toolbar:u,aside:g,secondary:f,children:b,className:x,...y}){let k=i&&(V(s)||V(l)||V(b)||V(d)||V(c)),w=e==="horizontal"&&V(p)&&k,v=r==="fill",h=V(f),S=w&&h,T=V(g)?jsxRuntime.jsx("div",{"data-record-part":"aside",className:"flex min-h-0 shrink-0 gap-global",children:g}):null;return jsxRuntime.jsxs("article",{...y,"data-monkeys-component":"record-view","data-record-layout":e,"data-record-sizing":r,className:m("@container flex min-h-0 min-w-0 flex-col gap-global font-[family-name:var(--font-sans)] text-sm leading-5 text-foreground",v&&"h-full",x),children:[V(u)&&jsxRuntime.jsx("div",{"data-record-part":"toolbar",className:"flex shrink-0 flex-wrap items-center gap-global",children:u}),jsxRuntime.jsxs("div",{className:m("flex min-h-0 min-w-0 gap-global",v&&"flex-1"),children:[n==="start"&&T,jsxRuntime.jsxs("div",{"data-record-part":"body",className:m("grid min-h-0 min-w-0 flex-1 grid-cols-1 gap-global",S?"@[48rem]:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)]":w&&(o==="balanced"?"@[48rem]:grid-cols-2":t==="start"?"@[48rem]:grid-cols-[minmax(0,1fr)_minmax(16rem,24rem)]":"@[48rem]:grid-cols-[minmax(16rem,24rem)_minmax(0,1fr)]"),v&&"overflow-auto @[48rem]:overflow-hidden"),children:[V(p)&&jsxRuntime.jsx("div",{"data-record-part":"media",className:m("min-h-0 min-w-0",t==="end"&&w&&"@[48rem]:order-2",v&&"flex flex-col"),children:p}),k&&jsxRuntime.jsxs("div",{"data-record-part":"details",className:m("flex min-h-0 min-w-0 flex-col [&>section]:flex-1",v&&"@[48rem]:overflow-auto"),children:[V(s)&&jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global",children:s}),V(l)&&jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global text-sm tabular-nums text-muted-foreground [&_span]:text-inherit [&_time]:text-inherit",children:l}),b,V(d)&&jsxRuntime.jsx("div",{className:"mt-global break-words text-sm text-destructive-text",children:d}),V(c)&&jsxRuntime.jsx("div",{className:"mt-auto flex shrink-0 flex-wrap gap-global pt-global",children:c})]}),h&&jsxRuntime.jsx("div",{"data-record-part":"secondary",className:m("flex min-h-0 min-w-0 flex-col [&>section]:flex-1",v&&"@[48rem]:overflow-auto"),children:f})]}),n==="end"&&T]})]})}a(pk,"RecordView");function mk(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(mk,"toCssSize");function O5(e,t){return String(e?.id??e?.key??t)}a(O5,"defaultGetRowId");function F5(e){return String(e?.columnId??e?.status??"")}a(F5,"defaultGetColumnId");function H5(e){let t=e?.title??e?.name??e?.id??"Untitled";return jsxRuntime.jsx("div",{className:"rounded-lg border border-border/70 bg-card px-3 py-2 text-sm text-foreground shadow-sm",children:String(t)})}a(H5,"defaultRenderCard");function V5({row:e,rowId:t,rowIndex:o,column:r,classNames:n,renderCard:i}){let{attributes:s,listeners:l,setNodeRef:d,isDragging:c}=core.useDraggable({id:t});return jsxRuntime.jsx("div",{ref:d,...l,...s,className:m("touch-none",n?.cardWrapper),children:i(e,{row:e,rowIndex:o,column:r,isDragging:c,isOverlay:false})})}a(V5,"WorkbenchLaneDraggableCard");function _5({column:e,columnRows:t,columnWidth:o,columnMinHeight:r,emptyColumn:n,classNames:i,renderCard:s}){let{setNodeRef:l,isOver:d}=core.useDroppable({id:e.id});return jsxRuntime.jsxs("section",{className:m("flex shrink-0 flex-col rounded-xl border border-border/60 bg-card p-2 shadow-sm",i?.column,e.className),style:{width:mk(o)??"280px"},children:[jsxRuntime.jsxs("div",{className:m("flex h-10 items-center gap-2 px-1",i?.columnHeader,e.headerClassName),children:[e.icon?jsxRuntime.jsx("span",{className:m("inline-flex h-4 w-4 items-center justify-center text-muted-foreground",i?.columnIcon,e.iconClassName),children:e.icon}):null,jsxRuntime.jsx("span",{className:m("inline-flex items-center rounded px-2 py-0.5 text-xs font-semibold bg-muted text-muted-foreground",i?.columnBadge,e.badgeClassName),children:e.label??e.id}),jsxRuntime.jsx("span",{className:m("text-xs text-muted-foreground",i?.columnCount),children:t.length})]}),jsxRuntime.jsx("div",{ref:l,className:m("mt-1 flex min-h-[200px] flex-1 flex-col gap-2 overflow-y-auto rounded-lg p-1 transition-colors [scrollbar-width:thin]",d&&"bg-accent/60",i?.columnBody,e.bodyClassName),style:{minHeight:mk(r)},children:t.length?t.map(({row:c,rowIndex:p,rowId:u})=>jsxRuntime.jsx(V5,{row:c,rowId:u,rowIndex:p,column:e,classNames:i,renderCard:s},u)):n?jsxRuntime.jsx("div",{className:m("flex min-h-24 items-center justify-center rounded-lg border border-dashed border-border/60 px-3 py-4 text-xs text-muted-foreground",i?.emptyColumn),children:n}):null})]})}a(_5,"WorkbenchLaneColumnView");function fk({rows:e=[],columns:t=[],getRowId:o=O5,getColumnId:r=F5,renderCard:n,renderOverlayCard:i,onMoveRow:s,onSelectRow:l,emptyColumn:d,activationDistance:c=5,columnWidth:p=280,columnMinHeight:u,className:g,classNames:f,style:b}){let x=n??((A,N)=>l?jsxRuntime.jsx(dt,{className:"w-full justify-start whitespace-normal text-left",onClick:()=>l({rowId:o(A,N.rowIndex)}),children:String(A?.title??A?.name??o(A,N.rowIndex))}):H5(A)),[y,k]=ho.useState(null),w=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:c}})),v=ho.useMemo(()=>new Map(t.map(A=>[A.id,A])),[t]),h=ho.useMemo(()=>e.map((A,N)=>({row:A,rowIndex:N,rowId:o(A,N),columnId:r(A,N)})),[r,o,e]),S=y?h.find(A=>A.rowId===y):void 0,T=ho.useMemo(()=>{let A=new Map;return t.forEach(N=>A.set(N.id,[])),h.forEach(({row:N,rowIndex:D,rowId:E,columnId:P})=>{A.get(P)?.push({row:N,rowIndex:D,rowId:E});}),A},[t,h]),C=S?v.get(S.columnId):void 0,R=ho.useCallback(A=>{k(String(A.active.id));},[]),M=ho.useCallback(A=>{k(null);let N=String(A.active.id),D=String(A.over?.id??""),E=h.find(P=>P.rowId===N);!E||!v.has(D)||E.columnId===D||s?.(N,D,E.row);},[v,s,h]),I=ho.useCallback(()=>{k(null);},[]);return jsxRuntime.jsxs(core.DndContext,{sensors:w,onDragStart:R,onDragEnd:M,onDragCancel:I,children:[jsxRuntime.jsx("div",{className:m("flex min-h-0 flex-1 gap-4 overflow-x-auto p-4 [scrollbar-width:thin]",f?.root,g),style:b,children:t.map(A=>jsxRuntime.jsx(_5,{column:A,columnRows:T.get(A.id)||[],columnWidth:p,columnMinHeight:u,emptyColumn:d,classNames:f,renderCard:x},A.id))}),jsxRuntime.jsx(core.DragOverlay,{children:S&&C?jsxRuntime.jsx("div",{className:m(f?.overlayWrapper),children:(i||x)(S.row,{row:S.row,rowIndex:S.rowIndex,column:C,isDragging:false,isOverlay:true})}):null})]})}a(fk,"WorkbenchLaneView");var bk=a(e=>{if(Number.isFinite(e))return Math.min(1,Math.max(0,Number(e)))},"normalizeProgress");function gk({items:e,summary:t,variant:o="bars",density:r="comfortable",emptyState:n=null,ariaLabel:i="Metrics",className:s,itemClassName:l}){if(!e.length)return V(n)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:n}):null;if(o==="radar"&&e.length>=3&&e.length<=12){let d=a((u,g)=>{let f=-Math.PI/2+u*Math.PI*2/e.length;return [180+Math.cos(f)*g,160+Math.sin(f)*g]},"point"),c=e.map((u,g)=>{let f=bk(u.progress);return f===void 0?void 0:d(g,f*100)}),p=c.every(Boolean);return jsxRuntime.jsxs("figure",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":"radar",className:m("m-0 min-w-0",s),children:[jsxRuntime.jsxs("svg",{viewBox:"0 0 360 320",role:"img","aria-label":t?`${i} \xB7 ${t.label} ${t.value}`:i,className:"mx-auto block w-full max-w-sm overflow-visible",children:[[.25,.5,.75,1].map(u=>jsxRuntime.jsx("polygon",{points:e.map((g,f)=>d(f,u*100).join(",")).join(" "),fill:"none",stroke:"hsl(var(--border))"},u)),e.map((u,g)=>{let f=d(g,100),b=d(g,131);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:"180",y1:"160",x2:f[0],y2:f[1],stroke:"hsl(var(--border))"}),typeof u.label=="string"||typeof u.label=="number"?jsxRuntime.jsx("text",{x:b[0],y:b[1]-7,textAnchor:"middle",dominantBaseline:"middle",fontSize:"12",fill:"hsl(var(--muted-foreground))",children:u.label}):null,typeof u.value=="string"||typeof u.value=="number"?jsxRuntime.jsx("text",{"data-metric-axis-value":u.id,x:b[0],y:b[1]+10,textAnchor:"middle",dominantBaseline:"middle",fontSize:"13",fontWeight:"600",fill:"hsl(var(--foreground))",children:u.value}):null]},u.id)}),p?jsxRuntime.jsx("polygon",{"data-metric-radar-series":"complete",points:c.map(u=>u.join(",")).join(" "),fill:"hsl(var(--primary) / .18)",stroke:"hsl(var(--primary))",strokeWidth:"2.5"}):c.map((u,g)=>{let f=c[(g+1)%c.length];return u&&f?jsxRuntime.jsx("line",{"data-metric-radar-series":"partial",x1:u[0],y1:u[1],x2:f[0],y2:f[1],stroke:"hsl(var(--primary))",strokeWidth:"2.5"},e[g].id):null}),c.map((u,g)=>u?jsxRuntime.jsx("circle",{cx:u[0],cy:u[1],r:"3",fill:"hsl(var(--primary))"},e[g].id):null),t?jsxRuntime.jsxs("g",{"data-metric-radar-summary":"true",textAnchor:"middle",paintOrder:"stroke",stroke:"hsl(var(--card))",strokeWidth:"3",strokeLinejoin:"round",children:[jsxRuntime.jsx("text",{x:"180",y:"149",fontSize:"12",fill:"hsl(var(--muted-foreground))",children:t.label}),jsxRuntime.jsx("text",{x:"180",y:"174",fontSize:"23",fontWeight:"700",fill:"hsl(var(--foreground))",children:t.value})]}):null]}),jsxRuntime.jsx("dl",{className:"sr-only",children:e.map(u=>jsxRuntime.jsxs("div",{className:m("flex min-w-0 justify-between gap-2",l),children:[jsxRuntime.jsx("dt",{className:"truncate text-muted-foreground",children:u.label}),jsxRuntime.jsx("dd",{className:"font-semibold tabular-nums",children:u.value})]},u.id))})]})}return o==="list"?jsxRuntime.jsx("dl",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":o,"data-metric-density":r,className:m("grid min-w-0",r==="compact"?"gap-2":"gap-3",s),children:e.map(d=>jsxRuntime.jsxs("div",{className:m("flex min-w-0 items-start justify-between gap-4",r==="compact"?"text-xs":"text-sm",l),children:[jsxRuntime.jsxs("dt",{className:"min-w-0 text-muted-foreground",children:[jsxRuntime.jsx("span",{className:"block truncate",children:d.label}),V(d.description)?jsxRuntime.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-muted-foreground/80",children:d.description}):null]}),jsxRuntime.jsx("dd",{className:"shrink-0 font-semibold tabular-nums text-foreground",children:d.value})]},d.id))}):o==="cards"?jsxRuntime.jsx("dl",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":o,"data-metric-density":r,className:m("grid min-w-0 [grid-template-columns:repeat(auto-fit,minmax(9rem,1fr))]",r==="compact"?"gap-2":"gap-3",s),children:e.map(d=>jsxRuntime.jsxs("div",{className:m("min-w-0 rounded-lg border border-border/70 bg-card text-card-foreground",r==="compact"?"p-3":"p-4",l),children:[jsxRuntime.jsx("dt",{className:"truncate text-xs font-medium text-muted-foreground",children:d.label}),jsxRuntime.jsx("dd",{className:m("font-semibold tabular-nums text-foreground",r==="compact"?"mt-1.5 text-xl":"mt-2 text-2xl"),children:d.value}),V(d.description)?jsxRuntime.jsx("div",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:d.description}):null]},d.id))}):jsxRuntime.jsx("dl",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":o,"data-metric-density":r,className:m("grid min-w-0 [grid-template-columns:repeat(auto-fit,minmax(5.5rem,1fr))]",r==="compact"?"gap-2":"gap-3",s),children:e.map(d=>{let c=bk(d.progress);return jsxRuntime.jsxs("div",{className:m("min-w-0",l),children:[jsxRuntime.jsx("div",{role:c===void 0?void 0:"meter","aria-label":c===void 0?void 0:String(d.label),"aria-valuemin":c===void 0?void 0:0,"aria-valuemax":c===void 0?void 0:100,"aria-valuenow":c===void 0?void 0:Math.round(c*100),className:m("overflow-hidden rounded-full bg-muted",r==="compact"?"h-1.5":"h-2"),children:c===void 0?null:jsxRuntime.jsx("span",{className:"block h-full rounded-full bg-primary transition-[width] duration-200 motion-reduce:transition-none",style:{width:`${Math.max(c>0?4:0,c*100)}%`}})}),jsxRuntime.jsxs("div",{className:"mt-1.5 flex min-w-0 items-baseline justify-between gap-2",children:[jsxRuntime.jsx("dt",{className:"truncate text-xs text-muted-foreground",children:d.label}),jsxRuntime.jsx("dd",{className:"shrink-0 text-xs font-semibold tabular-nums text-foreground",children:d.value})]})]},d.id)})})}a(gk,"WorkbenchMetricGrid");var hk=Math.PI*(3-Math.sqrt(5)),yk=a(e=>Array.from(e).reduce((t,o)=>Math.imul(t^o.charCodeAt(0),16777619)>>>0,2166136261),"hash");function Du(e,t){let o=new Set(e.map(v=>v.id)),r=new Map,n=new Set,i=new Map(e.map(v=>[v.id,new Set])),s=t.filter(v=>o.has(v.sourceId)&&o.has(v.targetId));for(let v of s){let h=r.get(v.sourceId)??[];h.includes(v.targetId)||h.push(v.targetId),r.set(v.sourceId,h),n.add(v.targetId),i.get(v.sourceId).add(v.targetId),i.get(v.targetId).add(v.sourceId);}let d=e.filter(v=>!n.has(v.id))[0]?.id??e[0]?.id,c=new Map,p=d?[d]:[];d&&c.set(d,{depth:0,branch:d,cluster:d});for(let v=0;v<p.length;v++){let h=p[v],S=c.get(h);for(let T of r.get(h)??[])c.has(T)||(c.set(T,{depth:S.depth+1,branch:S.depth===0?T:S.branch,cluster:S.depth<2?T:S.cluster}),p.push(T));}for(let v of e)c.has(v.id)||c.set(v.id,{depth:1,branch:v.id,cluster:v.id});let u=[...new Set([...c.values()].filter(v=>v.depth>0).map(v=>v.branch))],g=new Map;for(let[v,h]of c){if(h.depth<2)continue;let S=g.get(h.cluster)??[];S.push(v),g.set(h.cluster,S);}let f=u.map(v=>Math.sqrt([...c.values()].filter(h=>h.branch===v).length+8)),b=f.reduce((v,h)=>v+h,0)||1,x=-Math.PI/2,y=new Map;u.forEach((v,h)=>{let S=Math.PI*2*f[h]/b,T=x+S/2;y.set(v,{x:Math.cos(T)*12,y:Math.sin(T)*10,z:Math.sin(T*2)*3.2,angle:T}),x+=S;});let k=new Map;for(let v of u){let h=y.get(v),S=[...g.keys()].filter(T=>c.get(T)?.branch===v);S.forEach((T,C)=>{let R=S.length>1?Math.max(3,Math.sqrt(S.length)*1.7):1.5,M=C*hk+h.angle;k.set(T,{x:h.x+Math.cos(M)*R,y:h.y+Math.sin(M)*R,z:h.z+Math.sin(M)*2.5});});}let w=e.map(v=>{let h=c.get(v.id),S=h.depth<2?y.get(h.branch):k.get(h.cluster);if(h.depth===0||!S)return {...v,...h,x:0,y:0,z:0};if(h.depth===1)return {...v,...h,x:S.x*.76,y:S.y*.76,z:S.z};let C=g.get(h.cluster).indexOf(v.id),R=h.depth===2?0:1.5+Math.sqrt(C)*.72,M=C*hk+yk(h.cluster)%360*Math.PI/180;return {...v,...h,x:S.x+Math.cos(M)*R,y:S.y+Math.sin(M)*R*.85,z:S.z+Math.sin(M*1.37)*Math.min(R,3.5)}});for(let v=0;v<30;v++)for(let h=0;h<w.length;h++)for(let S=h+1;S<w.length;S++){let T=w[h],C=w[S],R=C.x-T.x,M=C.y-T.y,I=Math.hypot(R,M),A=T.depth<3||C.depth<3?1.4:.85;if(I>=A)continue;let N=yk(T.id+C.id)%360*Math.PI/180,D=I>.001?R/I:Math.cos(N),E=I>.001?M/I:Math.sin(N),P=(A-I)*.25;T.depth>0&&(T.x-=D*P,T.y-=E*P),C.depth>0&&(C.x+=D*P,C.y+=E*P);}if(w.length)for(let v of ["x","y","z"]){let h=(Math.min(...w.map(S=>S[v]))+Math.max(...w.map(S=>S[v])))/2;w.forEach(S=>{S[v]-=h;});}return {points:w,links:s,neighbors:i,root:d}}a(Du,"buildRelationshipGalaxyLayout");function vk({nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:n,className:i}){let s=Ye(),l=ho.useRef(null),d=ho.useRef(new Map),c=ho.useRef(o),p=ho.useRef(r),[u,g]=ho.useState(false),f=JSON.stringify([e,t]),b=ho.useMemo(()=>Du(e,t),[f]);return c.current=o,p.current=r,ho.useEffect(()=>{let x=l.current;if(!x)return;let y=false,k=a(()=>{},"cleanup");return g(false),Promise.all([import('three'),import('three/examples/jsm/controls/OrbitControls.js')]).then(([w,{OrbitControls:v}])=>{if(y)return;let h=[],S=new w.Scene,T=getComputedStyle(x),C=a((ie,be)=>{let He=document.createElement("span");He.style.color=`hsl(${T.getPropertyValue(ie).trim()||T.getPropertyValue(be).trim()})`,x.append(He);let We=new w.Color(getComputedStyle(He).color);return He.remove(),We},"tokenColor"),R=C("--radar-canvas","--background");S.background=R;let M=new w.PerspectiveCamera(48,1,.1,250),I=new w.WebGLRenderer({antialias:true,alpha:false});I.setPixelRatio(Math.min(devicePixelRatio,2)),I.domElement.style.cssText="position:absolute;inset:0;width:100%;height:100%;touch-action:none",I.domElement.setAttribute("aria-hidden","true"),x.prepend(I.domElement);let A=new v(M,I.domElement);A.enableDamping=true,A.dampingFactor=.08,A.rotateSpeed=.45,A.minDistance=8,A.maxDistance=130,A.autoRotate=false;let N=new Map(b.points.map(ie=>[ie.id,new w.Vector3(ie.x,ie.y,ie.z)])),D={primary:C("--radar-series-one","--primary"),secondary:C("--radar-series-two","--success"),accent:C("--radar-series-three","--warning"),muted:C("--radar-series-four","--muted-foreground")},E=128,P=new Uint8Array(E*E*4);for(let ie=0;ie<E;ie++)for(let be=0;be<E;be++){let He=Math.hypot(be+.5-E/2,ie+.5-E/2)/(E/2),We=He<.09?1:Math.exp(-He*7.5)*.85;P.set([255,255,255,Math.round(We*255)],(ie*E+be)*4);}let W=new w.DataTexture(P,E,E,w.RGBAFormat);W.minFilter=W.magFilter=w.LinearFilter,W.needsUpdate=true,h.push(W);let H=b.points.map(ie=>{let be=new w.SpriteMaterial({map:W,color:D[ie.tone??"primary"],transparent:true,blending:w.AdditiveBlending,depthWrite:false}),He=new w.Sprite(be);return He.position.copy(N.get(ie.id)),S.add(He),h.push(be),He}),B=new w.BufferGeometry;B.setAttribute("position",new w.Float32BufferAttribute(b.links.flatMap(ie=>[...N.get(ie.sourceId).toArray(),...N.get(ie.targetId).toArray()]),3));let L=new Float32Array(b.links.length*6);B.setAttribute("color",new w.BufferAttribute(L,3));let F=new w.LineBasicMaterial({vertexColors:true,transparent:true,opacity:.5,depthWrite:false});S.add(new w.LineSegments(B,F)),h.push(B,F);let _=new Map;b.points.filter(ie=>ie.depth>0).forEach(ie=>{let be=_.get(ie.cluster)??[];be.push(ie),_.set(ie.cluster,be);});for(let ie of _.values()){if(ie.length<3)continue;let be=ie.reduce((Ke,ce)=>Ke.add(N.get(ce.id)),new w.Vector3).multiplyScalar(1/ie.length),He=new w.SpriteMaterial({map:W,color:D[ie[0].tone??"primary"],transparent:true,opacity:.13,blending:w.AdditiveBlending,depthWrite:false}),We=new w.Sprite(He);We.position.copy(be),We.position.z-=1,We.scale.setScalar(8+Math.sqrt(ie.length)*1.2),S.add(We),h.push(He);}let $=Math.max(8,...b.points.map(ie=>Math.abs(ie.x)))+3,G=Math.max(6,...b.points.map(ie=>Math.abs(ie.y)))+3,z=55,re=false,Z=new ResizeObserver(()=>{let{width:ie,height:be}=x.getBoundingClientRect();if(!ie||!be)return;M.aspect=ie/be;let He=Math.max(G,$/M.aspect)/Math.tan(w.MathUtils.degToRad(M.fov/2))+7;re?M.position.sub(A.target).multiplyScalar(He/z).add(A.target):(M.position.set(0,0,He),re=true),z=He,A.update(),M.updateProjectionMatrix(),I.setSize(ie,be,false);});Z.observe(x);let ae=new w.Vector3,ee=new w.Vector2,q={x:0,y:0},U,X,O=a(ie=>{let be=I.domElement.getBoundingClientRect();ee.set(ie.clientX-be.left,ie.clientY-be.top);let He,We=12;for(let Ke of b.points){if(ae.copy(N.get(Ke.id)).project(M),ae.z<-1||ae.z>1)continue;let ce=Math.hypot((ae.x+1)*be.width/2-ee.x,(-ae.y+1)*be.height/2-ee.y);ce<We&&(We=ce,He=Ke);}return He},"nodeAt"),K=a(ie=>{q={x:ie.clientX,y:ie.clientY};},"pointerDown"),ne=a(ie=>{U=O(ie)?.id,I.domElement.style.cursor=U?"pointer":"grab";},"pointerMove"),fe=a(()=>{U=void 0;},"pointerLeave"),he=a(ie=>{if(Math.hypot(ie.clientX-q.x,ie.clientY-q.y)>5)return;let be=O(ie);be&&p.current?.(be);},"pointerUp");I.domElement.addEventListener("pointerdown",K),I.domElement.addEventListener("pointermove",ne),I.domElement.addEventListener("pointerleave",fe),I.domElement.addEventListener("pointerup",he);let me=[...b.points].sort((ie,be)=>ie.depth-be.depth||(b.neighbors.get(be.id)?.size??0)-(b.neighbors.get(ie.id)?.size??0));I.setAnimationLoop(()=>{A.update();let ie=c.current,be=ie?b.neighbors.get(ie):void 0;(X!==ie||!B.userData.initialized)&&(X=ie,B.userData.initialized=true,b.links.forEach((ge,we)=>{let Ie=ge.sourceId===ie||ge.targetId===ie,oe=b.points.find(Ve=>Ve.id===ge.targetId),xe=D[oe.tone??"primary"].clone().multiplyScalar(ie?Ie?1.35:.12:.45);L.set([...xe.toArray(),...xe.toArray()],we*6);}),B.attributes.color.needsUpdate=true),H.forEach((ge,we)=>{let Ie=b.points[we],oe=ie===Ie.id;ge.scale.setScalar((Ie.depth===0?2.2:Ie.depth===1?1.8:Ie.depth===2?1.2:.82)*(oe?1.5:1)),ge.material.opacity=!ie||oe||be?.has(Ie.id)?1:.25;});let He=x.clientWidth,We=x.clientHeight,Ke=z/M.position.distanceTo(A.target),ce=[],Q=[...me].sort((ge,we)=>+(we.id===ie||we.id===U)-+(ge.id===ie||ge.id===U));for(let ge of Q){let we=d.current.get(ge.id);if(!we)continue;let Ie=ge.id===ie,oe=ge.id===U,xe=be?.has(ge.id);ae.copy(N.get(ge.id)).project(M);let Ve=(ae.x+1)*He/2,_e=(-ae.y+1)*We/2+10,Ge={x:Ve-Math.min(ge.label.length*13,170)/2,y:_e,width:Math.min(ge.label.length*13,170),height:21},le=ae.z>-1&&ae.z<1&&Ge.x>4&&Ge.x+Ge.width<He-4&&_e>4&&_e+21<We-4,Me=Ie||oe||xe||ge.depth<=2||Ke>1.65,Ae=ce.some($e=>Ge.x<$e.x+$e.width+8&&Ge.x+Ge.width+8>$e.x&&Ge.y<$e.y+$e.height+5&&Ge.y+Ge.height+5>$e.y),J=le&&Me&&(Ie||oe||!Ae)&&(!ie||Ie||oe||xe||ge.depth<2);we.style.display=J?"block":"none",we.tabIndex=J?0:-1,we.style.transform=`translate(${Ve}px,${_e}px) translate(-50%,0)`,we.style.color="#"+D[ge.tone??"primary"].clone().lerp(D.primary,.45).getHexString(),we.style.opacity=ie&&!Ie&&!xe&&!oe?"0.45":"1",we.style.fontWeight=ge.depth<2||Ie?"var(--monkeys-semantic-font-weight-semibold, 600)":"var(--monkeys-semantic-font-weight-normal, 400)",we.style.zIndex=Ie||oe?"2":"1",J&&ce.push(Ge);}I.render(S,M);}),k=a(()=>{I.domElement.removeEventListener("pointerdown",K),I.domElement.removeEventListener("pointermove",ne),I.domElement.removeEventListener("pointerleave",fe),I.domElement.removeEventListener("pointerup",he),Z.disconnect(),I.setAnimationLoop(null),A.dispose(),h.forEach(ie=>ie.dispose()),I.dispose(),I.domElement.remove();},"cleanup");}).catch(()=>{y||g(true);}),()=>{y=true,k();}},[b]),jsxRuntime.jsxs("div",{ref:l,className:i,role:"group","aria-label":n,"data-monkeys-component":"relationship-galaxy",style:{position:"relative",width:"100%",height:"100%",minHeight:400,overflow:"hidden",background:"hsl(var(--radar-canvas, var(--background)))"},children:[e.map(x=>jsxRuntime.jsx("button",{ref:y=>{y?d.current.set(x.id,y):d.current.delete(x.id);},"aria-pressed":o===x.id,className:"font-sans text-xs",title:x.meta,onClick:()=>p.current?.(x),style:{display:"none",position:"absolute",left:0,top:0,maxWidth:170,border:0,background:"transparent",padding:"calc(var(--global-spacing, 0.75rem) / 6)",cursor:"pointer",textShadow:"0 1px 4px hsl(var(--radar-canvas, var(--foreground)))",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:x.label},x.id)),u&&jsxRuntime.jsx("div",{role:"alert",className:"absolute inset-0 grid place-items-center bg-background text-foreground",children:s.workbench.collection.loadError})]})}a(vk,"RelationshipGalaxy");var es={physics:{repulsion:18e3,linkDistance:100,weakLinkDistance:280,linkStrength:.014,strongLinkStrength:.025,centerStrength:.0015,velocityRetention:.72,maxVelocity:35,collisionPadding:18,collisionPasses:2,cooling:.975,minAlpha:.002,ticksPerFrame:2},nodes:{fontSize:13,iconSize:16,showIcons:true,showLabels:true,focusScale:1.08,borderRadius:999,glow:true,contextOpacity:null},edges:{visible:true,curved:true,widthScale:1,opacityScale:1,glow:true,color:null},interaction:{pan:true,zoom:true,dragNodes:true,keyboard:true,openNodes:true,dragThreshold:4,keyboardStep:15,keyboardFastStep:50},viewport:{minZoom:.08,maxZoom:8,fitMaxZoom:2,fitPadding:60,screenPadding:50,zoomSensitivity:.0012,zoomStep:180,fitOnResize:true},ui:{controls:true,minimap:true,minimapWidth:156,minimapHeight:108,dock:"bottom-left"}};for(let e of Object.values(es))Object.freeze(e);Object.freeze(es);var wk={repulsion:[0,1e6],linkDistance:[0,2e3],weakLinkDistance:[0,3e3],linkStrength:[0,.2],strongLinkStrength:[0,.2],centerStrength:[0,.1],velocityRetention:[0,.99],maxVelocity:[1,100],collisionPadding:[0,200],collisionPasses:[0,8],cooling:[.5,.995],minAlpha:[.001,.1],ticksPerFrame:[1,10],fontSize:[8,48],iconSize:[8,64],focusScale:[.5,2],borderRadius:[0,999],contextOpacity:[0,1],widthScale:[0,8],opacityScale:[0,5],dragThreshold:[0,30],keyboardStep:[1,200],keyboardFastStep:[1,500],minZoom:[.01,20],maxZoom:[.01,20],fitMaxZoom:[.01,20],fitPadding:[0,500],screenPadding:[0,300],zoomSensitivity:[1e-4,.01],zoomStep:[1,1e3],minimapWidth:[140,360],minimapHeight:[60,300]},kk=new Set(["collisionPasses","ticksPerFrame"]),Ck=a(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"record");function bl(e={}){if(!Ck(e))throw new Error("config must be an object");let t=structuredClone(es);for(let[o,r]of Object.entries(e)){if(!Object.prototype.hasOwnProperty.call(t,o))throw new Error(`Unknown config group: ${o}`);if(!Ck(r))throw new Error(`config.${o} must be an object`);let n=t[o];for(let[i,s]of Object.entries(r)){let l=`config.${o}.${i}`;if(!Object.prototype.hasOwnProperty.call(n,i))throw new Error(`Unknown field: ${l}`);if((i==="contextOpacity"||i==="color")&&s===null){n[i]=null;continue}if(i==="dock"){if(typeof s!="string"||!["bottom-left","bottom-right","top-left","top-right"].includes(s))throw new Error(`${l} must be a supported corner`)}else if(i==="color"){if(typeof s!="string"||!/^#[\da-f]{6}$/i.test(s))throw new Error(`${l} must be a #RRGGBB color or null`)}else if(wk[i]){let[d,c]=wk[i];if(typeof s!="number"||!Number.isFinite(s)||s<d||s>c||kk.has(i)&&!Number.isInteger(s))throw new Error(`${l} must be ${kk.has(i)?"an integer":"a number"} in [${d}, ${c}]`)}else if(typeof s!="boolean")throw new Error(`${l} must be a boolean`);n[i]=s;}}if(t.viewport.minZoom>t.viewport.maxZoom)throw new Error("config.viewport.minZoom must not exceed maxZoom");return t}a(bl,"resolveRelationshipGraphConfig");var Zf=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp");function Eu(e,t,o={}){let r=bl({physics:o.physics??{}}).physics,n=[...e].sort((u,g)=>u.id.localeCompare(g.id,"en")).map((u,g)=>({...u,x:Number.isFinite(u.x)?u.x:Math.cos(g*2.39996)*100,y:Number.isFinite(u.y)?u.y:Math.sin(g*2.39996)*100,vx:0,vy:0,...o.fixedNodes?.has(u.id)?{fx:o.fixedNodes.get(u.id).x,fy:o.fixedNodes.get(u.id).y}:{}})),i=new Map(n.map(u=>[u.id,u])),s=t.flatMap(u=>{let g=i.get(u.sourceId),f=i.get(u.targetId);if(!g||!f||g===f)return [];let b=Number.isFinite(u.associationStrength)?Zf(u.associationStrength,0,1):0;return [{source:g,target:f,strength:b,distance:(g.width+f.width)/2+(r.linkDistance+(1-b)*r.weakLinkDistance)}]}).sort((u,g)=>`${u.source.id}:${u.target.id}`.localeCompare(`${g.source.id}:${g.target.id}`,"en")),l=o.center??{x:3800,y:2800},d=n.length?1:0,c=0;function p(u=1){for(let g=0;g<u&&d>0;g++){for(let f=0;f<n.length;f++)for(let b=f+1;b<n.length;b++){let x=n[f],y=n[b],k=y.x-x.x,w=y.y-x.y;if(Math.abs(k)+Math.abs(w)<.01){let C=(f+b+1)*2.39996;k=Math.cos(C),w=Math.sin(C);}let v=Math.max(1,Math.hypot(k,w)),h=Math.min(8,r.repulsion/Math.max(2500,v*v))*d,S=k/v*h,T=w/v*h;x.vx-=S,x.vy-=T,y.vx+=S,y.vy+=T;}for(let{source:f,target:b,strength:x,distance:y}of s){let k=b.x-f.x,w=b.y-f.y,v=Math.max(1,Math.hypot(k,w)),h=(v-y)*(r.linkStrength+x*r.strongLinkStrength)*d,S=k/v*h,T=w/v*h;f.vx+=S,f.vy+=T,b.vx-=S,b.vy-=T;}c=0;for(let f of n)f.vx=Zf((f.vx+(l.x-f.x)*r.centerStrength*d)*r.velocityRetention,-r.maxVelocity,r.maxVelocity),f.vy=Zf((f.vy+(l.y-f.y)*r.centerStrength*d)*r.velocityRetention,-r.maxVelocity,r.maxVelocity),f.fx!==void 0&&f.fy!==void 0?(f.x=f.fx,f.y=f.fy,f.vx=f.vy=0):(f.x+=f.vx,f.y+=f.vy,c+=f.vx*f.vx+f.vy*f.vy);for(let f=0;f<r.collisionPasses;f++)for(let b=0;b<n.length;b++)for(let x=b+1;x<n.length;x++){let y=n[b],k=n[x],w=k.x-y.x,v=k.y-y.y,h=(y.width+k.width)/2+r.collisionPadding-Math.abs(w),S=(y.height+k.height)/2+r.collisionPadding-Math.abs(v);if(h<=0||S<=0)continue;let T=y.fx===void 0,C=k.fx===void 0,R=Number(T)+Number(C);if(R)if(h<S){let M=Math.sign(w||1)*h/R;T&&(y.x-=M),C&&(k.x+=M);}else {let M=Math.sign(v||1)*S/R;T&&(y.y-=M),C&&(k.y+=M);}}d*=r.cooling,d<r.minAlpha&&(d=0);}return d>0}return a(p,"step"),{step:p,get active(){return d>0},get energy(){return c},positions:a(()=>new Map(n.map(({id:u,x:g,y:f})=>[u,{x:g,y:f}])),"positions"),reheat(){n.length&&(d=Math.max(d,.65));},pin(u,g,f){let b=i.get(u);!b||!Number.isFinite(g)||!Number.isFinite(f)||(b.x=b.fx=g,b.y=b.fy=f,b.vx=b.vy=0,d=Math.max(d,.65));},release(u){let g=i.get(u);if(!g)return;let f=o.fixedNodes?.get(u);g.fx=f?.x,g.fy=f?.y,d=Math.max(d,.65);}}}a(Eu,"createForceSimulation");var q5=a((e,t,o,r={})=>{let n=[...e].sort((d,c)=>d.id.localeCompare(c.id,"en")),i=new Map;for(let d of t)i.set(d.sourceId,(i.get(d.sourceId)??0)+1),i.set(d.targetId,(i.get(d.targetId)??0)+1);let s=n.map((d,c)=>{let p=c*Math.PI*(3-Math.sqrt(5)),u=d.role==="focus"?0:130*Math.sqrt(c+1);return {...d,x:3800+Math.cos(p)*u,y:2800+Math.sin(p)*u}}),l=Eu(s,t,r);return l.step(Math.max(1,Math.min(1e3,Number.isFinite(o)?Math.floor(o):280))),new Map([...l.positions()].map(([d,c])=>[d,{...c,degree:i.get(d)??0}]))},"layoutTrendRadarFocusTopology"),Au=a((e,t)=>{if(!e.length)return {x:0,y:0,width:2,height:2};let o=Math.min(...e.map(s=>s.x-s.width/2))-t,r=Math.max(...e.map(s=>s.x+s.width/2))+t,n=Math.min(...e.map(s=>s.y-s.height/2))-t,i=Math.max(...e.map(s=>s.y+s.height/2))+t;return {x:o,y:n,width:Math.max(2,r-o),height:Math.max(2,i-n)}},"calculateTrendRadarFocusTopologyBounds");var Dr={x:0,y:0,width:7600,height:5600};var Y5=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp");var Sk=a(e=>{let t=Number.isFinite(e)?Y5(e,0,1):0,o=.8+Math.pow(t,1.35)*7.2;return {strokeWidth:o,strokeOpacity:.26+t*.7,glowWidth:o+3+t*7,glowOpacity:t<.28?.02:.04+t*.14}},"getTrendRadarFocusTopologyFocusEdgeStyle"),Bu=a((e,t="dark")=>{let o=a((l,d,c)=>`color-mix(in srgb, ${d} ${c}%, ${l})`,"mix"),r=e.role==="context",n=e.role==="focus",i=o("hsl(var(--monkeys-color-background))",e.solidColor,t==="light"?n?16:r?4:10:n?48:40),s=t==="light"?o(r?"hsl(var(--monkeys-color-muted-foreground))":"hsl(var(--monkeys-color-foreground))",e.solidColor,r?10:38):o(e.color,"hsl(var(--monkeys-color-foreground))",n?45:34);return {background:i,foreground:s,border:o(i,s,n?82:67)}},"getTrendRadarFocusTopologyNodeTone"),X5=a((e,t)=>{let o=t.x-e.x,r=t.y-e.y,n=Math.max(Math.hypot(o,r),1),i=Math.min(72,Math.max(18,n*.13)),s=e.id.localeCompare(t.id)>=0?1:-1;return {x:(e.x+t.x)/2+r/n*i*s,y:(e.y+t.y)/2-o/n*i*s}},"getTrendRadarFocusTopologyEdgeControlPoint"),Tk=a((e,t)=>{let o=X5(e,t);return `M ${e.x} ${e.y} Q ${o.x} ${o.y} ${t.x} ${t.y}`},"getTrendRadarFocusTopologyEdgePath");var fL={"align-justify":lucideReact.AlignJustify,grid:lucideReact.Grid3X3,layers:lucideReact.Layers,"map-pin":lucideReact.MapPin,mountain:lucideReact.Mountain,package:lucideReact.Package,paintbrush:lucideReact.Paintbrush,palette:lucideReact.Palette,scissors:lucideReact.Scissors,shield:lucideReact.Shield,"shield-check":lucideReact.ShieldCheck,shirt:lucideReact.Shirt,snowflake:lucideReact.Snowflake,sparkles:lucideReact.Sparkles,user:lucideReact.UserRound,users:lucideReact.UsersRound},bL=a((e,t)=>{if(e.role!=="focus")return "var(--trend-radar-muted-color)";let o=Math.pow(e.associationStrength,1.2)*86;return `color-mix(in srgb, var(--trend-radar-muted-color), ${t.color} ${o}%)`},"edgeStroke");function Rk({model:e,config:t=es,onOpenNode:o,renderNodeAction:r,relationshipLabel:n,colorMode:i="dark",onNodePointerDown:s,onNodeKeyDown:l}){let d=a((u,g)=>t.edges.curved?Tk(u,g):`M ${u.x} ${u.y} L ${g.x} ${g.y}`,"edgePath"),c=ho.useId().replace(/:/g,""),p=ho.useMemo(()=>new Map(e.nodes.map(u=>[u.id,u])),[e.nodes]);return jsxRuntime.jsxs("div",{className:"trend-radar-focus-topology-background pointer-events-none relative size-full overflow-visible","data-radar-focus-topology-surface":"true","data-radar-focus-topology-color-mode":i,children:[t.edges.visible&&jsxRuntime.jsxs("svg",{viewBox:`0 0 ${Dr.width} ${Dr.height}`,className:"absolute inset-0 size-full overflow-visible","aria-hidden":"true",children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("filter",{id:c,x:"-40%",y:"-40%",width:"180%",height:"180%",children:jsxRuntime.jsx("feGaussianBlur",{stdDeviation:"7"})})}),jsxRuntime.jsx("g",{"data-radar-focus-topology-edge-layer":"context",children:e.edges.filter(u=>u.role!=="focus").map(u=>{let g=p.get(u.sourceId),f=p.get(u.targetId);return !g||!f?null:jsxRuntime.jsx("path",{d:d(g,f),fill:"none",stroke:t.edges.color??"var(--trend-radar-muted-color)",strokeWidth:Math.max(.8,.72+Math.pow(u.associationStrength,1.08)*2.2)*t.edges.widthScale,strokeOpacity:Math.min(1,(u.role==="related"?.12:.045)*t.edges.opacityScale),strokeLinecap:"round",strokeLinejoin:"round"},u.id)})}),jsxRuntime.jsx("g",{"data-radar-focus-topology-edge-layer":"focus",children:e.edges.filter(u=>u.role==="focus").map(u=>{let g=p.get(u.sourceId),f=p.get(u.targetId);if(!g||!f)return null;let b=d(g,f),x=t.edges.color??bL(u,g.id===e.subjectId?f:g),y=Sk(u.associationStrength);return jsxRuntime.jsxs("g",{"data-radar-focus-topology-focus-edge":u.id,"data-radar-focus-topology-association-strength":u.associationStrength.toFixed(4),children:[jsxRuntime.jsx("path",{d:b,fill:"none",stroke:x,strokeWidth:y.glowWidth*t.edges.widthScale,strokeOpacity:t.edges.glow?Math.min(1,y.glowOpacity*t.edges.opacityScale):0,strokeLinecap:"round",filter:`url(#${c})`}),jsxRuntime.jsx("path",{d:b,fill:"none",stroke:x,strokeWidth:y.strokeWidth*t.edges.widthScale,strokeOpacity:Math.min(1,y.strokeOpacity*t.edges.opacityScale),strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("title",{children:n(u)})})]},u.id)})})]}),e.nodes.map(u=>{let g=fL[u.iconName]??lucideReact.Palette,f=Bu(u,i),b=u.role==="focus",x=u.role==="context",y=!!(o&&!b);return jsxRuntime.jsxs("div",{className:m("absolute transition-[filter,opacity,transform] duration-200",b?"z-20":u.role==="related"?"z-10":"z-0",x&&i==="dark"&&"opacity-[0.18] brightness-[0.72] saturate-[0.3] hover:!opacity-100 hover:!filter-none"),style:{"--radar-node-background":f.background,"--radar-node-foreground":f.foreground,"--radar-node-border":f.border,left:u.x,opacity:x?t.nodes.contextOpacity??(i==="dark"?u.contextOpacity:void 0):void 0,top:u.y,width:u.width,height:u.height,transform:`translate(-50%, -50%) scale(${b?t.nodes.focusScale:1})`,transformOrigin:"center center"},"data-radar-focus-topology-node-anchor":u.ref.id,children:[jsxRuntime.jsxs("button",{type:"button",disabled:!y&&!s,"aria-label":u.label,title:u.taxonomy?.secondaryLabel?`${u.label} \xB7 ${u.taxonomy.secondaryLabel}`:u.label,onPointerDown:k=>{k.stopPropagation(),s?.(k,u);},onKeyDown:k=>l?.(k,u),onClick:k=>{k.stopPropagation(),y&&o?.(u);},className:m("focus-visible:ring-primary pointer-events-auto flex size-full items-center justify-center gap-2 rounded-full border-0 px-3 text-left text-[0.8125rem] leading-none font-semibold outline-hidden transition-[box-shadow,filter,transform] focus-visible:ring-2",y&&"cursor-pointer hover:brightness-110",!y&&"cursor-default disabled:opacity-100"),style:{fontSize:t.nodes.fontSize,borderRadius:t.nodes.borderRadius,color:f.foreground,backgroundColor:f.background,boxShadow:t.nodes.glow?b?`inset 0 0 0 2px ${f.border}, 0 0 34px ${u.color}66`:u.role==="related"?`inset 0 0 0 1px ${f.border}, 0 0 18px ${u.color}24`:`inset 0 0 0 1px ${f.border}`:`inset 0 0 0 ${b?2:1}px ${f.border}`},"data-radar-focus-topology-node":u.ref.id,"data-world-x":u.x.toFixed(2),"data-world-y":u.y.toFixed(2),"data-radar-focus-topology-node-role":u.role,children:[t.nodes.showIcons&&jsxRuntime.jsx(g,{className:"shrink-0",size:t.nodes.iconSize,color:f.foreground,strokeWidth:1.8,"aria-hidden":"true"}),t.nodes.showLabels&&jsxRuntime.jsx("span",{className:"min-w-0 truncate",style:{color:"inherit"},children:u.label})]}),r?.(u)]},u.id)})]})}a(Rk,"TrendRadarFocusTopologySurface");function Ou({model:e,config:t,onCameraChange:o,colorMode:r="light",ariaLabel:n,onOpenNode:i,renderNodeAction:s,nodeAction:l,onNodeAction:d,relationshipLabel:c,controls:p,onNodePositionChange:u}){if(l?.maxActive!==void 0&&(!Number.isSafeInteger(l.maxActive)||l.maxActive<1))throw new TypeError("Node action maxActive must be a positive integer.");if(l?.size!==void 0&&(!Number.isFinite(l.size)||l.size<16||l.size>48))throw new TypeError("Node action size must be between 16 and 48.");let g=ho.useMemo(()=>bl(t),[t]),f=ho.useMemo(()=>new Set(l?.activeNodeIds??[]),[l?.activeNodeIds]),b=JSON.stringify(g.physics),x=ho.useMemo(()=>JSON.parse(b),[b]),y=JSON.stringify(g.viewport),k=ho.useMemo(()=>JSON.parse(y),[y]),{interaction:w,ui:v}=g,h=ho.useRef(null),S=ho.useRef(),T=JSON.stringify({nodes:e.nodes.map(({id:O,x:K,y:ne,width:fe,height:he})=>({id:O,x:K,y:ne,width:fe,height:he})),edges:e.edges.map(({sourceId:O,targetId:K,associationStrength:ne})=>({sourceId:O,targetId:K,associationStrength:ne}))}),C=ho.useMemo(()=>{let O=JSON.parse(T);return Eu(O.nodes,O.edges,{physics:x})},[T,x]),[R,M]=ho.useState(()=>C.positions()),[I,A]=ho.useState(false),[N,D]=ho.useState({x:0,y:0,z:1}),E=ho.useRef(o);E.current=o,ho.useEffect(()=>{E.current?.(N);},[N]);let P=ho.useRef(N),W=ho.useRef(),H=ho.useRef(false),[B,L]=ho.useState({width:1,height:1}),F=ho.useRef(false),_=ho.useMemo(()=>e.nodes.map(O=>({...O,...R.get(O.id)??{}})),[e.nodes,R]),$=ho.useRef(_);$.current=_;let G=ho.useCallback(O=>{P.current=O,D(O);},[]),z=ho.useCallback(()=>{if(S.current!==void 0)return;if(F.current&&!W.current){C.step(1400),M(C.positions()),A(false);return}A(C.active);let O=a(()=>{C.step(x.ticksPerFrame),M(C.positions()),C.active?S.current=requestAnimationFrame(O):(S.current=void 0,A(false));},"tick");S.current=requestAnimationFrame(O);},[C,x.ticksPerFrame]),re=ho.useCallback(()=>{let O=h.current;if(!O)return;let K=Au($.current,k.fitPadding),ne=Math.max(k.minZoom,Math.min(k.maxZoom,k.fitMaxZoom,(O.clientWidth-k.screenPadding*2)/K.width,(O.clientHeight-k.screenPadding*2)/K.height));G({x:O.clientWidth/(2*ne)-K.x-K.width/2,y:O.clientHeight/(2*ne)-K.y-K.height/2,z:ne});},[G,k]);ho.useEffect(()=>{F.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??false;let O=C.positions();return M(O),$.current=$.current.map(K=>({...K,...O.get(K.id)})),re(),z(),()=>{S.current!==void 0&&cancelAnimationFrame(S.current),S.current=void 0;let K=W.current;K?.target.hasPointerCapture?.(K.pointerId)&&K.target.releasePointerCapture(K.pointerId),W.current=void 0;}},[C,re,z]),ho.useEffect(()=>{let O=h.current;if(!O)return;let K=new ResizeObserver(()=>{L({width:O.clientWidth,height:O.clientHeight}),k.fitOnResize&&re();});return K.observe(O),()=>K.disconnect()},[re,k.fitOnResize]);let Z=ho.useCallback((O,K,ne)=>{if(!w.zoom)return;let fe=P.current,he=Math.max(k.minZoom,Math.min(k.maxZoom,fe.z*Math.exp(-O*k.zoomSensitivity)));G({x:fe.x-K/fe.z+K/he,y:fe.y-ne/fe.z+ne/he,z:he});},[G,k,w.zoom]);ho.useEffect(()=>{let O=h.current;if(!O)return;let K=a(ne=>{if(W.current||!w.zoom)return;ne.preventDefault();let fe=O.getBoundingClientRect();Z(ne.deltaY,ne.clientX-fe.left,ne.clientY-fe.top);},"wheel");return O.addEventListener("wheel",K,{passive:false}),()=>O.removeEventListener("wheel",K)},[Z,w.zoom]);let ae=a((O,K)=>{if(O.button!==0||W.current||(K?!w.dragNodes:!w.pan))return;H.current=false;let ne=P.current;W.current={pointerId:O.pointerId,id:K?.id,startX:O.clientX,startY:O.clientY,x:K?.x??ne.x,y:K?.y??ne.y,moved:false,target:O.currentTarget},O.currentTarget.setPointerCapture(O.pointerId),K&&(C.pin(K.id,K.x,K.y),z());},"begin"),ee=a(O=>{let K=W.current;if(!(!K||K.pointerId!==O.pointerId)){if(W.current=void 0,H.current=K.moved,K.id){let ne=C.positions().get(K.id);C.release(K.id),z(),K.moved&&ne&&u?.(K.id,ne);}K.target.hasPointerCapture(O.pointerId)&&K.target.releasePointerCapture(O.pointerId);}},"end"),q={...e,nodes:_},U=new Map(_.map(O=>[O.id,O])),X=Au([...e.nodes,..._],200);return jsxRuntime.jsxs("section",{ref:h,className:"relationship-graph bg-background relative size-full overflow-hidden",style:{cursor:w.pan?void 0:"default",touchAction:w.pan||w.dragNodes?"none":"auto"},role:"region","aria-label":n,"data-radar-focus-topology":"true","data-graph-engine":"native-force","data-force-running":I,"data-radar-focus-topology-camera":`${N.x.toFixed(2)},${N.y.toFixed(2)},${N.z.toFixed(3)}`,onPointerDown:O=>{O.target.closest("button")||ae(O);},onPointerMove:O=>{let K=W.current;if(!K||K.pointerId!==O.pointerId)return;let ne=O.clientX-K.startX,fe=O.clientY-K.startY;K.moved||(K.moved=Math.hypot(ne,fe)>w.dragThreshold),K.moved&&(K.id?(C.pin(K.id,K.x+ne/P.current.z,K.y+fe/P.current.z),M(C.positions()),z()):G({...P.current,x:K.x+ne/P.current.z,y:K.y+fe/P.current.z}));},onPointerUp:ee,onPointerCancel:ee,onLostPointerCapture:ee,onClickCapture:O=>{H.current&&(O.preventDefault(),O.stopPropagation(),H.current=false);},children:[jsxRuntime.jsx("div",{style:{position:"absolute",left:0,top:0,width:Dr.width,height:Dr.height,transformOrigin:"0 0",transform:`translate(${N.x*N.z}px, ${N.y*N.z}px) scale(${N.z})`},children:jsxRuntime.jsx(Rk,{model:q,config:g,colorMode:r,relationshipLabel:c,onOpenNode:w.openNodes?i:void 0,renderNodeAction:s??(l&&d?O=>{if(l.nodeKinds&&!l.nodeKinds.includes(O.ref.kind))return null;let K=f.has(O.id),ne=l.disabled||!K&&l.maxActive!==void 0&&f.size>=l.maxActive,fe=`${K?l.activeLabel??l.label:l.label}: ${O.label}`,he=K?lucideReact.Check:lucideReact.Plus,me=l.size??24;return jsxRuntime.jsx("button",{type:"button","data-relationship-node-action":O.id,"aria-label":fe,title:fe,"aria-pressed":K,disabled:ne,className:"grid place-items-center rounded-md border border-current bg-card text-foreground shadow-sm outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",style:{position:"absolute",right:0,top:0,width:me,height:me,color:Bu(O,r).foreground,transform:`translate(50%, -50%) scale(${l.keepScreenSize===false?1:1/N.z})`,transformOrigin:"center"},onPointerDown:ie=>ie.stopPropagation(),onKeyDown:ie=>ie.stopPropagation(),onClick:ie=>{ie.stopPropagation(),d(O);},children:jsxRuntime.jsx(he,{size:me*.6,"aria-hidden":"true"})})}:void 0),onNodePointerDown:w.dragNodes?(O,K)=>ae(O,K):void 0,onNodeKeyDown:(O,K)=>{if(!w.keyboard||!w.dragNodes)return;let ne={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[O.key];if(!ne)return;O.preventDefault(),O.stopPropagation();let fe=(O.shiftKey?w.keyboardFastStep:w.keyboardStep)/P.current.z,he={x:K.x+ne[0]*fe,y:K.y+ne[1]*fe};C.pin(K.id,he.x,he.y),M(C.positions()),C.release(K.id),z(),u?.(K.id,he);}})}),(v.controls||v.minimap)&&jsxRuntime.jsxs("div",{className:"relationship-minimap","data-radar-focus-topology-minimap":"true",style:{width:v.minimapWidth,left:v.dock.endsWith("left")?12:"auto",right:v.dock.endsWith("right")?12:"auto",top:v.dock.startsWith("top")?12:"auto",bottom:v.dock.startsWith("bottom")?12:"auto"},children:[v.controls&&jsxRuntime.jsxs("div",{className:"relationship-controls",children:[jsxRuntime.jsx("button",{type:"button","aria-label":p.zoomOut,onClick:()=>Z(k.zoomStep,B.width/2,B.height/2),disabled:!w.zoom||N.z<=k.minZoom,children:jsxRuntime.jsx(lucideReact.Minus,{size:15})}),jsxRuntime.jsxs("output",{children:[Math.round(N.z*100),"%"]}),jsxRuntime.jsx("button",{type:"button","aria-label":p.zoomIn,onClick:()=>Z(-k.zoomStep,B.width/2,B.height/2),disabled:!w.zoom||N.z>=k.maxZoom,children:jsxRuntime.jsx(lucideReact.Plus,{size:15})}),jsxRuntime.jsx("button",{type:"button","aria-label":p.zoomToFit,onClick:re,children:jsxRuntime.jsx(lucideReact.LocateFixed,{size:15})})]}),v.minimap&&jsxRuntime.jsx("button",{type:"button",className:"relationship-minimap-map",disabled:!w.pan,"aria-label":p.minimap,onClick:O=>{if(O.detail===0){re();return}let K=O.currentTarget.getBoundingClientRect(),ne=(O.clientX-K.left)/K.width*X.width+X.x,fe=(O.clientY-K.top)/K.height*X.height+X.y;G({...N,x:B.width/(2*N.z)-ne,y:B.height/(2*N.z)-fe});},children:jsxRuntime.jsxs("svg",{viewBox:`${X.x} ${X.y} ${X.width} ${X.height}`,style:{height:v.minimapHeight},preserveAspectRatio:"none","aria-hidden":"true",children:[e.edges.map(O=>{let K=U.get(O.sourceId),ne=U.get(O.targetId);return K&&ne?jsxRuntime.jsx("line",{x1:K.x,y1:K.y,x2:ne.x,y2:ne.y,stroke:"currentColor",strokeWidth:2,opacity:.2},O.id):null}),_.map(O=>jsxRuntime.jsx("circle",{cx:O.x,cy:O.y,r:O.role==="focus"?14:8,fill:O.color},O.id)),jsxRuntime.jsx("rect",{x:-N.x,y:-N.y,width:B.width/N.z,height:B.height/N.z,fill:"currentColor",fillOpacity:.07,stroke:"currentColor",strokeWidth:4})]})})]})]})}a(Ou,"RelationshipGraph2D");var xL={primary:"hsl(var(--radar-series-one, var(--primary)))",secondary:"hsl(var(--radar-series-two, var(--success)))",accent:"hsl(var(--radar-series-three, var(--warning)))",muted:"hsl(var(--radar-series-four, var(--muted-foreground)))"},vL={nodes:{showIcons:false,glow:false,contextOpacity:1},edges:{glow:false,opacityScale:3,widthScale:.5}};function Dk({nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:n="Relationship graph",className:i,height:s=440}){let l=Ye(),d=Hn(),c=JSON.stringify([e,t]),p=ho.useMemo(()=>Du(e,t),[c]),u=ho.useMemo(()=>({subjectId:o??"",bounds:Dr,focusBounds:Dr,nodes:p.points.map(b=>{let x=Math.max(88,Math.min(240,Array.from(b.label).length*14+32)),y=xL[b.tone??"muted"];return {id:b.id,ref:{kind:"node",id:b.id},label:b.label,x:Dr.width/2+b.x*70,y:Dr.height/2+b.y*70,width:x,height:36,radius:x/2,score:0,degree:p.neighbors.get(b.id)?.size??0,colorKey:b.tone??"muted",color:y,solidColor:y,iconName:"layers",role:b.id===o?"focus":"related"}}),edges:p.links.map((b,x)=>({id:b.id??`${b.sourceId}:${b.targetId}:${x}`,sourceId:b.sourceId,targetId:b.targetId,evidenceRefs:[],evidenceCount:0,associationStrength:1,role:b.sourceId===o||b.targetId===o?"focus":"related"}))}),[p,o]),g=ho.useMemo(()=>new Map(e.map(b=>[b.id,b])),[c]),f=ho.useMemo(()=>new Map(p.links.map((b,x)=>[b.id??`${b.sourceId}:${b.targetId}:${x}`,b.label??`${g.get(b.sourceId)?.label} \u2192 ${g.get(b.targetId)?.label}`])),[p,g]);return jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-relationship-graph","data-workbench-relationship-variant":"force-2d",className:m("relative h-[var(--relationship-height)] min-h-0 min-w-0 overflow-hidden",i),style:{"--relationship-height":`${s}px`},children:jsxRuntime.jsx(Ou,{model:u,config:vL,colorMode:d?.colorMode==="dark"?"dark":"light",ariaLabel:n,controls:l.workbench.relationshipGraph??{zoomOut:"Zoom out",zoomIn:"Zoom in",zoomToFit:"Fit graph",minimap:"Graph overview"},relationshipLabel:b=>f.get(b.id)??"",onOpenNode:r?b=>{let x=g.get(b.id);x&&r(x);}:void 0})})}a(Dk,"RelationshipForce2D");var wL={primary:"fill-primary/10 stroke-primary text-primary",secondary:"fill-secondary stroke-secondary-foreground text-secondary-foreground",accent:"fill-accent stroke-accent-foreground text-accent-foreground",muted:"fill-muted stroke-muted-foreground text-muted-foreground"},kL={primary:"--radar-series-one",secondary:"--radar-series-two",accent:"--radar-series-three",muted:"--radar-series-four"},CL={primary:"var(--primary)",secondary:"var(--secondary-foreground)",accent:"var(--accent-foreground)",muted:"var(--muted-foreground)"},Hu=a((e,t=1)=>`hsl(var(${kL[e]}, ${CL[e]}) / ${t})`,"radarToneColor"),SL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateNode");function Ek({nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,width:n=900,height:i=440,emptyState:s=null,ariaLabel:l="Relationship graph",className:d,variant:c="default"}){if(!e.length)return V(s)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:s}):null;if(c==="galaxy")return jsxRuntime.jsx(vk,{nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:l,className:d});if(c==="force-2d")return jsxRuntime.jsx(Dk,{nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:l,className:d,height:i});let p=c==="radar",u=Math.min(n,i)*(p?.37:.35),g=o?e.findIndex(x=>x.id===o):-1,f=g>=0?e.filter((x,y)=>y!==g):e,b=new Map(e.map((x,y)=>{if(e.length===1)return [x.id,{x:n/2,y:i/2}];if(p&&y===g)return [x.id,{x:n/2,y:i/2}];let k=f.findIndex(v=>v.id===x.id),w=Math.PI*2*k/f.length-Math.PI/2;return [x.id,{x:n/2+Math.cos(w)*u,y:i/2+Math.sin(w)*u}]}));return jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-relationship-graph","data-workbench-relationship-variant":c,className:m("relative min-w-0 overflow-hidden rounded-lg border",p?"min-h-[42rem]":"overflow-x-auto border-border/70 bg-card",d),style:p?{backgroundColor:"hsl(var(--radar-canvas, var(--background)))",borderColor:"hsl(var(--radar-shell-border, var(--border)))",backgroundImage:"linear-gradient(hsl(var(--radar-grid, var(--border)) / 0.28) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--radar-grid, var(--border)) / 0.28) 1px, transparent 1px), radial-gradient(circle at center, hsl(var(--primary) / 0.1), transparent 45%)",backgroundSize:"4rem 4rem, 4rem 4rem, 100% 100%"}:void 0,children:jsxRuntime.jsxs("svg",{viewBox:`0 0 ${n} ${i}`,className:m(p?"absolute inset-0 size-full":"min-w-[42rem]"),preserveAspectRatio:p?"xMidYMid meet":void 0,role:"img","aria-label":l,children:[t.map((x,y)=>{let k=b.get(x.sourceId),w=b.get(x.targetId);return !k||!w?null:jsxRuntime.jsx("line",{x1:k.x,y1:k.y,x2:w.x,y2:w.y,className:p?void 0:"stroke-border",strokeWidth:p?"2":"1.5",style:p?{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.46)",filter:"drop-shadow(0 0 0.35rem hsl(var(--primary) / 0.34))"}:void 0,children:jsxRuntime.jsx("title",{children:x.label||`${x.sourceId} to ${x.targetId}`})},x.id||`${x.sourceId}:${x.targetId}:${y}`)}),e.map(x=>{let y=b.get(x.id),k=x.id===o,w=x.tone||"muted",v=p?{color:Hu(w)}:void 0;return jsxRuntime.jsxs("g",{transform:`translate(${y.x}, ${y.y})`,role:r?"button":void 0,tabIndex:r?0:void 0,"aria-label":x.meta?`${x.label}, ${x.meta}`:x.label,"aria-pressed":r?k:void 0,onClick:r?()=>r(x):void 0,onKeyDown:h=>SL(h,x,r),className:m(p?"outline-hidden":wL[w],r&&"cursor-pointer outline-hidden"),style:v,children:[jsxRuntime.jsx("circle",{r:p&&k?"50":p?"40":"36",className:m("stroke-1 transition-[stroke-width] duration-150 motion-reduce:transition-none",k&&"stroke-[3]"),style:p?{fill:Hu(w,k?.22:.12),stroke:Hu(w,k?1:.78),filter:`drop-shadow(0 0 ${k?"1.4rem":"0.75rem"} ${Hu(w,.62)})`}:void 0}),jsxRuntime.jsx("text",{textAnchor:"middle",y:x.meta?-3:4,className:m("pointer-events-none fill-current font-semibold",p?"text-sm":"text-xs"),children:x.label.slice(0,18)}),x.meta?jsxRuntime.jsx("text",{textAnchor:"middle",y:"16",className:m("pointer-events-none text-xs",p?"fill-current opacity-70":"fill-muted-foreground"),children:x.meta.slice(0,22)}):null]},x.id)})]})})}a(Ek,"WorkbenchRelationshipGraph");var NL={primary:"fill-primary stroke-primary",secondary:"fill-secondary stroke-secondary-foreground",accent:"fill-accent stroke-accent-foreground",muted:"fill-muted stroke-muted-foreground"},RL=a(e=>e.filter(Number.isFinite),"finiteValues"),Jf=a((e,t,o)=>{let r=RL(e),n=Number.isFinite(t)?Number(t):Math.min(...r,0),i=Number.isFinite(o)?Number(o):Math.max(...r,1);return n===i?[n,i+1]:n<i?[n,i]:[i,n]},"getDomain"),yl=a((e,t,o,r)=>o+(e-t[0])/(t[1]-t[0])*(r-o),"scale"),Ga=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp"),ML=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activatePoint");function Bk({points:e,xAxis:t,yAxis:o,thresholds:r,selectedPointId:n,onPointSelect:i,width:s=900,height:l=420,emptyState:d=null,ariaLabel:c=`${t.label} by ${o.label}`,className:p}){let u=e.filter(T=>Number.isFinite(T.x)&&Number.isFinite(T.y));if(!u.length)return V(d)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:d}):null;let g=56,f=Jf(u.map(T=>T.x),t.min,t.max),b=Jf(u.map(T=>T.y),o.min,o.max),x=Jf(u.map(T=>T.size??1)),y=g,k=s-g,w=g,v=l-g,h=Number.isFinite(r?.x)?yl(Number(r?.x),f,y,k):void 0,S=Number.isFinite(r?.y)?yl(Number(r?.y),b,v,w):void 0;return jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-scatter-plot",className:m("min-w-0 overflow-x-auto rounded-lg border border-border/70 bg-card p-3",p),children:jsxRuntime.jsxs("svg",{viewBox:`0 0 ${s} ${l}`,className:"min-w-[42rem]",role:"img","aria-label":c,children:[jsxRuntime.jsx("line",{x1:y,y1:v,x2:k,y2:v,className:"stroke-border"}),jsxRuntime.jsx("line",{x1:y,y1:w,x2:y,y2:v,className:"stroke-border"}),h===void 0?null:jsxRuntime.jsx("line",{x1:Ga(h,y,k),y1:w,x2:Ga(h,y,k),y2:v,className:"stroke-muted-foreground/50",strokeDasharray:"5 5"}),S===void 0?null:jsxRuntime.jsx("line",{x1:y,y1:Ga(S,w,v),x2:k,y2:Ga(S,w,v),className:"stroke-muted-foreground/50",strokeDasharray:"5 5"}),jsxRuntime.jsx("text",{x:s/2,y:l-12,textAnchor:"middle",className:"fill-muted-foreground text-xs",children:t.label}),jsxRuntime.jsx("text",{x:"16",y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/2})`,className:"fill-muted-foreground text-xs",children:o.label}),u.map(T=>{let C=Ga(yl(T.x,f,y,k),y,k),R=Ga(yl(T.y,b,v,w),w,v),M=T.size===void 0?9:Ga(yl(T.size,x,7,18),7,18),I=n===T.id;return jsxRuntime.jsxs("g",{transform:`translate(${C}, ${R})`,role:i?"button":void 0,tabIndex:i?0:void 0,"aria-label":`${T.label}: ${t.label} ${T.x}, ${o.label} ${T.y}`,"aria-pressed":i?I:void 0,onClick:i?()=>i(T):void 0,onKeyDown:A=>ML(A,T,i),className:m(i&&"cursor-pointer outline-hidden"),children:[jsxRuntime.jsx("circle",{r:M,className:m("stroke-1 opacity-80 transition-opacity duration-150 motion-reduce:transition-none",NL[T.tone||"primary"],I?"opacity-100 stroke-[3]":"hover:opacity-100")}),jsxRuntime.jsx("text",{y:-M-7,textAnchor:"middle",className:"pointer-events-none fill-foreground text-[0.6875rem] font-semibold",children:T.label.slice(0,24)}),jsxRuntime.jsx("title",{children:T.description||T.label})]},T.id)})]})})}a(Bk,"WorkbenchScatterPlot");var DL=a((e,t,o)=>{!o||t.disabled||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateItem");function Wk({items:e,onItemSelect:t,ariaLabel:o="Journey",className:r}){return jsxRuntime.jsx("nav",{"aria-label":o,"data-monkeys-component":"workbench-journey-navigation",className:m("min-w-0 overflow-x-auto rounded-lg border border-border/70 bg-card p-2",r),children:jsxRuntime.jsx("ol",{className:"flex min-w-max items-stretch gap-1",children:e.map((n,i)=>{let s=n.state||"upcoming";return jsxRuntime.jsxs("li",{className:"flex items-center",children:[i?jsxRuntime.jsx("span",{className:"mx-1 h-px w-5 bg-border","aria-hidden":"true"}):null,jsxRuntime.jsxs("button",{type:"button",disabled:n.disabled,"aria-current":s==="current"?"page":void 0,onClick:t&&!n.disabled?()=>t(n):void 0,onKeyDown:l=>DL(l,n,t),className:m("min-w-28 rounded-md border px-3 py-2 text-left outline-hidden transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background motion-reduce:transition-none",s==="current"&&"border-primary bg-primary text-primary-foreground",s==="complete"&&"border-primary/30 bg-primary/10 text-foreground",s==="upcoming"&&"border-transparent bg-muted/50 text-muted-foreground",n.disabled&&"cursor-not-allowed opacity-50"),children:[V(n.eyebrow)?jsxRuntime.jsx("span",{className:m("block text-[0.625rem] font-semibold uppercase tracking-[0.14em]",s==="current"?"text-primary-foreground/75":"text-muted-foreground"),children:n.eyebrow}):null,jsxRuntime.jsx("span",{className:"mt-0.5 block text-xs font-semibold",children:n.label})]})]},n.id)})})})}a(Wk,"WorkbenchJourneyNavigation");var PL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateItem");function zk({items:e,selectedItemId:t,onItemSelect:o,emptyState:r=null,ariaLabel:n="Ranked items",className:i}){return e.length?jsxRuntime.jsx("ol",{"aria-label":n,"data-monkeys-component":"workbench-ranked-list",className:m("grid min-w-0 gap-2",i),children:e.map((s,l)=>{let d=t===s.id;return jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{type:"button","aria-pressed":o?d:void 0,onClick:o?()=>o(s):void 0,onKeyDown:c=>PL(c,s,o),className:m("grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-3 rounded-lg border bg-card p-3 text-left text-card-foreground outline-hidden transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",d?"border-primary bg-primary/5":"border-border/70 hover:border-primary/40 hover:bg-accent/50",!o&&"cursor-default"),children:[jsxRuntime.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold tabular-nums text-muted-foreground",children:s.leading||l+1}),jsxRuntime.jsxs("span",{className:"min-w-0",children:[jsxRuntime.jsx("span",{className:"block truncate text-sm font-semibold text-foreground",children:s.label}),V(s.description)?jsxRuntime.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:s.description}):null,s.tags?.length?jsxRuntime.jsx("span",{className:"mt-2 flex flex-wrap gap-1.5",children:s.tags.map((c,p)=>jsxRuntime.jsx("span",{className:"rounded-full bg-secondary px-2 py-0.5 text-[0.625rem] font-medium text-secondary-foreground",children:c},`${s.id}:tag:${p}`))}):null,s.metrics?.length?jsxRuntime.jsx("span",{className:"mt-2 grid grid-cols-2 gap-x-4 gap-y-1 sm:grid-cols-4",children:s.metrics.map(c=>jsxRuntime.jsxs("span",{className:"min-w-0",children:[jsxRuntime.jsx("span",{className:"block truncate text-[0.625rem] text-muted-foreground",children:c.label}),jsxRuntime.jsx("span",{className:"block text-xs font-semibold tabular-nums text-foreground",children:c.value})]},c.id))}):null]}),jsxRuntime.jsxs("span",{className:"shrink-0 text-right",children:[V(s.score)?jsxRuntime.jsx("span",{className:"block text-lg font-semibold tabular-nums text-primary",children:s.score}):null,V(s.trailing)?jsxRuntime.jsx("span",{className:"mt-1 block text-muted-foreground",children:s.trailing}):null]})]})},s.id)})}):V(r)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:r}):null}a(zk,"WorkbenchRankedList");function Ok({title:e,description:t,items:o,onRemove:r,removeLabel:n=a(()=>"Remove","removeLabel"),actions:i,emptyState:s=null,className:l}){return jsxRuntime.jsxs("section",{"data-monkeys-component":"workbench-selection-tray",className:m("rounded-lg border border-border/70 bg-card p-4 text-card-foreground",l),children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:e}),V(t)?jsxRuntime.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:t}):null]}),jsxRuntime.jsx("span",{className:"rounded-full bg-primary/10 px-2.5 py-1 text-xs font-semibold tabular-nums text-primary",children:o.length})]}),o.length?jsxRuntime.jsx("ul",{className:"mt-3 flex flex-wrap gap-2",children:o.map(d=>jsxRuntime.jsxs("li",{className:"flex max-w-full items-center gap-2 rounded-full border border-border bg-background px-3 py-1.5 text-xs text-foreground",children:[jsxRuntime.jsx("span",{className:"min-w-0 truncate font-medium",children:d.label}),V(d.meta)?jsxRuntime.jsx("span",{className:"shrink-0 text-muted-foreground",children:d.meta}):null,r?jsxRuntime.jsx("button",{type:"button","aria-label":n(d),onClick:()=>r(d),className:"rounded-md px-1 text-muted-foreground outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:"\xD7"}):null]},d.id))}):jsxRuntime.jsx("div",{className:"mt-3 rounded-md border border-dashed border-border px-4 py-5 text-center text-xs text-muted-foreground",children:s}),V(i)?jsxRuntime.jsx("div",{className:"mt-4 flex flex-wrap justify-end gap-2 border-t border-border pt-4",children:i}):null]})}a(Ok,"WorkbenchSelectionTray");function Fk(e,t="milliseconds",o){if(t!=="milliseconds"&&t!=="seconds")return "\u2014";let r;if(typeof e=="number")r=t==="seconds"?e*1e3:e;else if(typeof e=="string"){let i=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,3}))?(Z|[+-]\d{2}:\d{2})$/.exec(e);if(!i)return "\u2014";let s=Number(i[1]),l=Number(i[2]),d=Number(i[3]),c=Number(i[4]),p=Number(i[5]),u=Number(i[6]),g=new Date(0);if(g.setUTCFullYear(s,l-1,d),g.getUTCFullYear()!==s||g.getUTCMonth()!==l-1||g.getUTCDate()!==d||c>23||p>59||u>59)return "\u2014";r=Date.parse(e);}else return "\u2014";if(!Number.isFinite(r))return "\u2014";let n=new Date(r);if(!Number.isFinite(n.getTime()))return "\u2014";try{return n.toLocaleString(o)}catch{return "\u2014"}}a(Fk,"renderDateTimeValue");function Hk({items:e,emptyState:t=null,ariaLabel:o="Evidence",className:r,translate:n=a(i=>i,"translate")}){let{locale:i}=Co();return e.length?jsxRuntime.jsx("ol",{"aria-label":o,"data-monkeys-component":"workbench-evidence-list",className:m("grid min-w-0 gap-0",r),children:e.map((s,l)=>jsxRuntime.jsxs("li",{className:"grid min-w-0 grid-cols-[1.25rem_minmax(0,1fr)_auto] gap-3",children:[jsxRuntime.jsxs("span",{className:"flex flex-col items-center","aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:"mt-1 flex size-5 items-center justify-center rounded-full border border-primary/40 bg-primary/10 text-[0.625rem] font-semibold text-primary",children:s.marker||l+1}),l<e.length-1?jsxRuntime.jsx("span",{className:"min-h-8 w-px flex-1 bg-border"}):null]}),jsxRuntime.jsxs("span",{className:"min-w-0 pb-5",children:[jsxRuntime.jsx("span",{className:"block text-sm font-semibold text-foreground",children:s.titleKey?n(s.titleKey):s.title}),V(s.description)||s.descriptionKey?jsxRuntime.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:s.descriptionKey?n(s.descriptionKey):s.description}):null,V(s.source)||s.sourceKey||V(s.timestamp)||s.timestampValue!==void 0?jsxRuntime.jsxs("span",{className:"mt-1.5 flex flex-wrap gap-x-3 gap-y-1 text-[0.6875rem] text-muted-foreground",children:[V(s.source)||s.sourceKey?jsxRuntime.jsx("span",{children:s.sourceKey?n(s.sourceKey):s.source}):null,V(s.timestamp)||s.timestampValue!==void 0?jsxRuntime.jsx("time",{children:s.timestampValue!==void 0?Fk(s.timestampValue,"milliseconds",i):s.timestamp}):null]}):null]}),V(s.action)?jsxRuntime.jsx("span",{className:"pb-5",children:s.action}):null]},s.id))}):V(t)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:t}):null}a(Hk,"WorkbenchEvidenceList");var BL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateItem");function _k({items:e,selectedItemId:t,onItemSelect:o,emptyState:r=null,ariaLabel:n="Assets",className:i}){return e.length?jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-asset-gallery",children:jsxRuntime.jsx(Sn,{items:e,config:{getItemKey:a(s=>s.id,"getItemKey"),layout:{mode:"grid",columns:"auto",minCardWidth:"12rem",idealCardWidth:"16rem",gap:12},appearance:{hover:"none"}},ariaLabel:n,className:i,renderItem:s=>{let l=t===s.id;return jsxRuntime.jsxs("button",{type:"button","aria-pressed":o?l:void 0,onClick:o?()=>o(s):void 0,onKeyDown:d=>BL(d,s,o),className:m("group w-full overflow-hidden rounded-lg border bg-card text-left text-card-foreground outline-hidden transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",l?"border-primary ring-1 ring-primary":"border-border/70 hover:border-primary/40",!o&&"cursor-default"),children:[jsxRuntime.jsx("span",{className:"block aspect-[4/3] overflow-hidden bg-muted",children:jsxRuntime.jsx("img",{src:s.url,alt:s.alt,loading:"lazy",className:"size-full object-cover transition-transform duration-200 group-hover:scale-[1.02] motion-reduce:transition-none"})}),jsxRuntime.jsxs("span",{className:"block p-3",children:[V(s.title)?jsxRuntime.jsx("span",{className:"block truncate text-sm font-semibold text-foreground",children:s.title}):null,V(s.description)?jsxRuntime.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:s.description}):null,s.badges?.length?jsxRuntime.jsx("span",{className:"mt-2 flex flex-wrap gap-1.5",children:s.badges.map((d,c)=>jsxRuntime.jsx("span",{className:"rounded-full bg-secondary px-2 py-0.5 text-[0.625rem] text-secondary-foreground",children:d},`${s.id}:badge:${c}`))}):null]})]})}})}):V(r)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:r}):null}a(_k,"WorkbenchAssetGallery");var Gk={primary:"--radar-series-one",secondary:"--radar-series-two",accent:"--radar-series-three",muted:"--radar-series-four"},$k={primary:"var(--primary)",secondary:"var(--secondary-foreground)",accent:"var(--accent-foreground)",muted:"var(--muted-foreground)"},$a=a(e=>`hsl(var(${Gk[e]}, ${$k[e]}))`,"workbenchVisualizationToneColor"),vl=a((e,t)=>`hsl(var(${Gk[e]}, ${$k[e]}) / ${t})`,"workbenchVisualizationToneColorWithAlpha");var WL={backgroundColor:"hsl(var(--radar-canvas, var(--background)))",color:"hsl(var(--foreground))"},jk={backgroundColor:"hsl(var(--radar-panel, var(--card)))",borderColor:"hsl(var(--radar-border, var(--border)))"};function eb({items:e,activeItemId:t,activeChildId:o,onItemSelect:r,onChildSelect:n,footer:i,ariaLabel:s="Radar navigation"}){return jsxRuntime.jsx($i,{kind:"route",routeItems:e.map(l=>({...l,children:l.children?.map(d=>({...d,domProps:{"data-radar-navigation-child-id":d.id}}))})),activeItemId:t,activeChildId:o,onItemSelect:r?l=>r(l):void 0,onChildSelect:n?(l,d)=>n(l,d):void 0,footer:i,ariaLabel:s,dataComponent:"workbench-radar-navigation",widthMode:"fill",resizable:false,collapsible:false,appearance:{density:"default",surface:"outlined",activeVariant:"solid"},className:"min-w-0 self-stretch rounded-lg",classNames:{content:"p-3",list:"gap-2",item:"min-h-11 px-3 py-2 text-sm font-semibold",itemActive:"bg-primary text-primary-foreground shadow-[0_0_1.25rem_hsl(var(--primary)/0.28)]",childList:"ml-5 gap-0.5 border-l border-border/70 py-1 pl-3",childItem:"min-h-9 px-2 text-xs font-medium",childItemActive:"border-primary/40 bg-primary/15 text-primary",footer:"p-3"},style:jk})}a(eb,"WorkbenchRadarNavigation");function Uk({navigationItems:e=[],activeNavigationId:t,activeNavigationChildId:o,onNavigationSelect:r,onNavigationChildSelect:n,navigationFooter:i,navigation:s,children:l,inspector:d,inspectorLabel:c="Context controls",className:p,contentClassName:u,minimumHeight:g="calc(100dvh - 1rem)",ariaLabel:f="Radar workspace"}){return jsxRuntime.jsxs("section",{"data-monkeys-component":"workbench-radar-workspace","data-radar-active-navigation-id":t,"aria-label":f,className:m("grid min-w-0 gap-3 overflow-hidden p-3 lg:grid-cols-[12.5rem_minmax(0,1fr)] xl:grid-cols-[12.5rem_minmax(0,1fr)_20rem]",p),style:{...WL,minHeight:g},children:[V(s)?s:jsxRuntime.jsx(eb,{items:e,activeItemId:t,activeChildId:o,onItemSelect:r,onChildSelect:n,footer:i}),jsxRuntime.jsx("div",{"data-radar-workspace-region":"content",className:m("relative min-h-[42rem] min-w-0 overflow-hidden rounded-lg border",u),style:{backgroundColor:"hsl(var(--radar-canvas, var(--background)))",borderColor:"hsl(var(--radar-shell-border, var(--border)))",boxShadow:"inset 0 0 0 1px hsl(var(--radar-grid, var(--border)) / 0.22)"},children:l}),V(d)?jsxRuntime.jsx("aside",{"aria-label":c,"data-radar-workspace-region":"inspector",className:"min-h-0 overflow-y-auto rounded-lg border lg:col-span-2 xl:col-span-1",style:jk,children:d}):null]})}a(Uk,"WorkbenchRadarWorkspace");function Kk({title:e,icon:t,description:o,children:r,className:n}){return jsxRuntime.jsxs("section",{"data-monkeys-component":"workbench-radar-inspector-section",className:m("border-b border-border/70 p-4 last:border-b-0",n),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-primary",children:[V(t)?jsxRuntime.jsx("span",{"aria-hidden":"true",children:t}):null,jsxRuntime.jsx("h2",{children:e})]}),V(o)?jsxRuntime.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:o}):null,V(r)?jsxRuntime.jsx("div",{className:"mt-3",children:r}):null]})}a(Kk,"WorkbenchRadarInspectorSection");function zL(e){let{disclosure:t,onSelect:o}=e;if(!t&&!o||t?.mode==="integrated"&&(!!o||e.selected!==void 0)||t?.mode==="separate"&&!o)throw new Error("Invalid WorkbenchRadarFilterRow props.")}a(zL,"assertValidRadarFilterRowProps");function qk(e){zL(e);let{label:t,value:o,icon:r,selected:n,disabled:i=false,tone:s,onSelect:l,disclosure:d,className:c}=e,p=n??false,u=p?void 0:"monkeys-workbench-radar-filter-row--idle",g=i?"monkeys-workbench-radar-filter-disabled":void 0,f=s??"primary",b=$a(f),x={"--workbench-radar-filter-tone":b,"--tw-ring-color":s?b:"hsl(var(--ring))",...p||s?{backgroundColor:vl(f,p?.14:.08),borderColor:b}:{}},y=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V(r)?jsxRuntime.jsx("span",{className:m("flex size-4 shrink-0 items-center justify-center",s?"text-[var(--workbench-radar-filter-tone)]":"text-muted-foreground"),"aria-hidden":"true",children:r}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:t}),V(o)?jsxRuntime.jsx("span",{className:"ml-auto shrink-0 tabular-nums text-muted-foreground",children:o}):null]}),k=d?jsxRuntime.jsx("span",{"aria-hidden":"true",className:m("text-lg leading-none transition-transform motion-reduce:transition-none",d.expanded&&"rotate-90"),children:"\u203A"}):null;if(d?.mode==="separate"){let h=d.expanded?d.collapseLabel:d.expandLabel;return jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-radar-filter-row",className:m("monkeys-workbench-radar-filter-row monkeys-workbench-radar-filter-row--separate",u,g,c),style:x,children:[jsxRuntime.jsx("button",{type:"button","aria-pressed":n,disabled:i,onClick:l,className:m("monkeys-workbench-radar-filter-control monkeys-workbench-radar-filter-row__action",g),children:y}),jsxRuntime.jsx("button",{type:"button","aria-expanded":d.expanded,"aria-controls":d.controls,"aria-label":h,disabled:i,onClick:d.onToggle,className:m("monkeys-workbench-radar-filter-row__disclosure",g),children:k})]})}let w=d?.mode==="integrated"?d:void 0,v=w?w.expanded?w.collapseLabel:w.expandLabel:void 0;return jsxRuntime.jsxs("button",{type:"button","data-monkeys-component":"workbench-radar-filter-row","aria-label":v,"aria-pressed":w?void 0:n,"aria-expanded":w?.expanded,"aria-controls":w?.controls,disabled:i,onClick:w?.onToggle??l,className:m("monkeys-workbench-radar-filter-control monkeys-workbench-radar-filter-row",u,g,c),style:x,children:[y,w?jsxRuntime.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:k}):null]})}a(qk,"WorkbenchRadarFilterRow");function Yk({label:e,value:t,icon:o,selected:r=false,disabled:n=false,onSelect:i,className:s}){let l=!!i||n;return jsxRuntime.jsxs(l?"button":"div",{type:l?"button":void 0,"aria-pressed":i&&!n?r:void 0,disabled:l?n:void 0,onClick:i,className:m("flex min-w-0 items-center border text-xs font-semibold outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none","monkeys-workbench-radar-filter-control rounded-md",r?"border-primary bg-primary/20 text-primary":"border-border bg-background/40 text-foreground hover:border-primary/60 hover:bg-primary/10",n&&"cursor-not-allowed opacity-50",s),children:[V(o)?jsxRuntime.jsx("span",{className:"shrink-0","aria-hidden":"true",children:o}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:e}),V(t)?jsxRuntime.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:t}):null]})}a(Yk,"WorkbenchRadarFilterChip");var FL=a(e=>e.filter(Number.isFinite),"finiteValues"),tb=a((e,t,o)=>{let r=FL(e),n=Number.isFinite(t)?Number(t):Math.min(...r,0),i=Number.isFinite(o)?Number(o):Math.max(...r,1);return n===i?[n,i+1]:n<i?[n,i]:[i,n]},"getDomain"),fa=a((e,t,o,r)=>o+(e-t[0])/(t[1]-t[0])*(r-o),"scale"),ba=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp"),HL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activatePoint"),VL={"low-high":{x:26,y:8,anchor:"start"},"high-high":{x:974,y:8,anchor:"end"},"low-low":{x:26,y:660,anchor:"start"},"high-low":{x:974,y:660,anchor:"end"}};function Xk({points:e,xAxis:t,yAxis:o,thresholds:r,quadrants:n=[],legend:i=[],selectedPointId:s,onPointSelect:l,width:d=1e3,height:c=700,labelLimit:p=18,emptyState:u=null,ariaLabel:g=`${t.label} by ${o.label} radar matrix`,className:f}){let b=e.filter(M=>Number.isFinite(M.x)&&Number.isFinite(M.y));if(!b.length)return V(u)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:u}):null;let x=tb(b.map(M=>M.x),t.min,t.max),y=tb(b.map(M=>M.y),o.min,o.max),k=tb(b.map(M=>M.size??1)),w=0,v=d,h=0,S=c,T=ba(fa(Number.isFinite(r?.x)?Number(r?.x):(x[0]+x[1])/2,x,w,v),w,v),C=ba(fa(Number.isFinite(r?.y)?Number(r?.y):(y[0]+y[1])/2,y,S,h),h,S),R=new Set([...b].sort((M,I)=>(I.size??0)-(M.size??0)).slice(0,p).map(M=>M.id));return jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-radar-matrix",className:m("relative size-full min-h-[42rem] min-w-0 overflow-hidden",f),style:{backgroundColor:"hsl(var(--radar-canvas, var(--background)))",backgroundImage:"radial-gradient(circle at 78% 20%, hsl(var(--primary) / 0.08), transparent 32%), radial-gradient(circle at 18% 82%, hsl(var(--radar-series-two, var(--accent-foreground)) / 0.06), transparent 30%)"},children:[jsxRuntime.jsxs("svg",{viewBox:`0 0 ${d} ${c}`,preserveAspectRatio:"none",className:"absolute inset-0 size-full",role:"img","aria-label":g,children:[jsxRuntime.jsxs("g",{"aria-hidden":"true",children:[Array.from({length:13},(M,I)=>{let A=d/12*I,N=c/12*I;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:A,y1:0,x2:A,y2:c,style:{stroke:"hsl(var(--radar-grid, var(--border)) / 0.36)"}}),jsxRuntime.jsx("line",{x1:0,y1:N,x2:d,y2:N,style:{stroke:"hsl(var(--radar-grid, var(--border)) / 0.36)"}})]},I)}),jsxRuntime.jsx("line",{x1:T,y1:0,x2:T,y2:c,strokeWidth:"1.5",style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.64)"}}),jsxRuntime.jsx("line",{x1:0,y1:C,x2:d,y2:C,strokeWidth:"1.5",style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.64)"}})]}),n.map(M=>{let I=VL[M.id];return jsxRuntime.jsxs("g",{"aria-hidden":"true",children:[jsxRuntime.jsx("text",{x:I.x,y:I.y+20,textAnchor:I.anchor,className:"fill-muted-foreground text-[0.8125rem] font-semibold",children:M.title}),V(M.description)&&typeof M.description=="string"?jsxRuntime.jsx("text",{x:I.x,y:I.y+40,textAnchor:I.anchor,className:"fill-muted-foreground text-[0.6875rem]",children:M.description}):null]},M.id)}),b.map((M,I)=>{let A=ba(fa(M.x,x,40,d-40),40,d-40),N=ba(fa(M.y,y,c-48,54),54,c-48),D=M.tone||(I%2===0?"primary":"accent"),E=s===M.id,P=R.has(M.id),W=P?ba(fa(M.size??1,k,5,9),5,9):3.5,H=P?ba(fa(M.size??1,k,14,31),14,31):0,B={fill:$a(D),stroke:"hsl(var(--foreground) / 0.74)"},L={fill:$a(D),filter:`drop-shadow(0 0 0.65rem ${vl(D,.72)})`};return jsxRuntime.jsxs("g",{transform:`translate(${A}, ${N})`,role:l?"button":void 0,tabIndex:l?0:void 0,"aria-label":`${M.label}: ${t.label} ${M.x}, ${o.label} ${M.y}`,"aria-pressed":l?E:void 0,onClick:l?()=>l(M):void 0,onKeyDown:F=>HL(F,M,l),className:m(l&&"cursor-pointer outline-hidden"),children:[E?jsxRuntime.jsx("circle",{r:W+10,fill:"none",strokeWidth:"2",style:{stroke:vl(D,.48)}}):null,jsxRuntime.jsx("circle",{r:W,strokeWidth:"1.25",style:B}),P?jsxRuntime.jsx("text",{y:-W-8,textAnchor:"middle",fontSize:H,fontWeight:"700",style:L,className:"pointer-events-none",children:M.label.slice(0,22)}):null,jsxRuntime.jsx("title",{children:M.description||M.label})]},M.id)}),jsxRuntime.jsx("circle",{cx:T,cy:C,r:"10",style:{fill:"hsl(var(--radar-axis, var(--primary)))"}}),jsxRuntime.jsx("circle",{cx:T,cy:C,r:"3",className:"fill-primary-foreground"}),jsxRuntime.jsx("text",{x:d/2,y:c-12,textAnchor:"middle",className:"fill-muted-foreground text-[0.6875rem]",children:t.label}),jsxRuntime.jsx("text",{x:"14",y:c/2,textAnchor:"middle",transform:`rotate(-90 14 ${c/2})`,className:"fill-muted-foreground text-[0.6875rem]",children:o.label})]}),jsxRuntime.jsxs("div",{className:"absolute bottom-4 left-4 hidden w-44 overflow-hidden rounded-[var(--radius)] border bg-card/95 shadow-xl sm:block",style:{borderColor:"hsl(var(--radar-border, var(--border)))"},"aria-hidden":"true",children:[jsxRuntime.jsxs("div",{className:"flex h-9 items-center justify-between border-b border-border px-3 text-xs font-semibold text-muted-foreground",children:[jsxRuntime.jsx("span",{children:"\u2212"}),jsxRuntime.jsx("span",{children:"100%"}),jsxRuntime.jsx("span",{children:"\uFF0B"})]}),jsxRuntime.jsxs("svg",{viewBox:`0 0 ${d} ${c}`,className:"h-24 w-full",children:[jsxRuntime.jsx("rect",{width:d,height:c,style:{fill:"hsl(var(--radar-canvas, var(--background)))"}}),jsxRuntime.jsx("line",{x1:T,y1:0,x2:T,y2:c,style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.7)"},strokeWidth:"6"}),jsxRuntime.jsx("line",{x1:0,y1:C,x2:d,y2:C,style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.7)"},strokeWidth:"6"}),b.map((M,I)=>jsxRuntime.jsx("circle",{cx:ba(fa(M.x,x,40,d-40),40,d-40),cy:ba(fa(M.y,y,c-48,54),54,c-48),r:"8",style:{fill:$a(M.tone||(I%2===0?"primary":"accent"))}},M.id)),jsxRuntime.jsx("rect",{x:d*.22,y:c*.12,width:d*.58,height:c*.62,fill:"none",strokeWidth:"8",style:{stroke:"hsl(var(--primary))"}})]})]}),i.length?jsxRuntime.jsx("div",{className:"absolute bottom-4 left-1/2 hidden -translate-x-1/2 items-center gap-4 rounded-full border border-border bg-card/95 px-4 py-2 text-xs font-semibold shadow-xl md:flex",children:i.map(M=>{let I=M.tone||"muted";return jsxRuntime.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[jsxRuntime.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:$a(I)}}),M.label]},M.id)})}):null]})}a(Xk,"WorkbenchRadarMatrix");function Zk({viewMode:e="list",heading:t,metadata:o,message:r,actions:n,outputs:i,children:s,className:l,...d}){return jsxRuntime.jsxs("article",{...d,"data-monkeys-component":"workbench-task-card","data-view-mode":e,className:m("border-border/70 font-[family-name:var(--font-sans)] text-sm leading-5",e==="grid"?"flex h-full flex-col gap-global rounded-lg border bg-card p-global shadow-sm":"grid items-center gap-global border-b py-global last:border-b-0 lg:grid-cols-2",l),children:[jsxRuntime.jsxs("div",{"data-task-part":"details",className:m("flex min-w-0 flex-col",e==="grid"?"flex-1":"min-h-60"),children:[jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global",children:t}),o!=null&&jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global text-sm tabular-nums text-muted-foreground [&_span]:text-inherit [&_time]:text-inherit",children:o}),s,r!=null&&jsxRuntime.jsx("div",{className:"mt-global break-words text-sm text-destructive-text",children:r}),n!=null&&jsxRuntime.jsx("div",{className:"mt-auto flex flex-wrap gap-global pt-global",children:n})]}),i!=null&&jsxRuntime.jsx("div",{"data-task-part":"outputs",className:m("min-w-0 w-full",e==="grid"&&"-order-1"),children:i})]})}a(Zk,"WorkbenchTaskCard");function e0({title:e,filters:t,sortOrder:o,viewMode:r,onSortOrderChange:n,onViewModeChange:i,labels:s,disabled:l,className:d}){return jsxRuntime.jsx(cu,{"data-monkeys-component":"workbench-task-toolbar",classNames:{root:"min-h-0 flex-row flex-wrap items-center gap-global border-0 p-0 font-[family-name:var(--font-sans)] text-sm leading-5",end:"max-w-full flex-wrap gap-global"},className:d,end:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t,jsxRuntime.jsxs("div",{className:"flex items-center gap-global",children:[jsxRuntime.jsx(dt,{type:"button",variant:"outline",disabled:l,title:s.sort,icon:o==="latest"?jsxRuntime.jsx(lucideReact.ArrowDownWideNarrow,{}):jsxRuntime.jsx(lucideReact.ArrowUpNarrowWide,{}),className:"h-10 min-w-28 gap-global rounded-lg bg-muted/40 px-global py-global-1/2 text-sm font-medium shadow-none hover:bg-muted/70",onClick:()=>n(o==="latest"?"oldest":"latest"),children:o==="latest"?s.latest:s.oldest}),jsxRuntime.jsx(dt,{type:"button",variant:"outline",disabled:l,icon:r==="list"?jsxRuntime.jsx(lucideReact.Grid2X2,{}):jsxRuntime.jsx(lucideReact.LayoutList,{}),className:"h-10 gap-global rounded-lg bg-muted/40 px-global py-global-1/2 text-sm font-medium shadow-none hover:bg-muted/70",onClick:()=>i(r==="list"?"grid":"list"),children:r==="list"?s.gridView:s.listView})]})]}),children:e})}a(e0,"WorkbenchTaskToolbar");function t0({items:e=[],children:t,hasOutputs:o,viewMode:r="list",ariaLabel:n,previewLabel:i,processingLabel:s,processing:l=false,emptyState:d,onPreview:c,className:p}){let u=r==="grid"?"aspect-square w-full":"aspect-square w-[calc((100%-3*var(--global-spacing))/4)] min-w-32 max-w-48";return jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-task-outputs",role:"region","aria-label":n,tabIndex:0,className:m("flex w-full min-w-0 snap-x snap-proximity items-center gap-global overflow-x-auto py-global-1/2 font-[family-name:var(--font-sans)] text-sm leading-5 focus-visible:outline focus-visible:outline-2",p),children:[t,e.map(g=>g.kind==="media"?c?jsxRuntime.jsx("button",{type:"button",onClick:()=>c(g),"aria-label":g.previewLabel||i,className:m("flex shrink-0 snap-start items-center justify-center overflow-hidden rounded-lg border bg-muted/20 focus-visible:outline focus-visible:outline-2",u),children:g.content},g.id):jsxRuntime.jsx("div",{className:m("flex shrink-0 snap-start items-center justify-center overflow-hidden rounded-lg border bg-muted/20",u),children:g.content},g.id):jsxRuntime.jsx("pre",{className:"h-60 w-full min-w-0 shrink-0 snap-start overflow-auto whitespace-pre-wrap break-words rounded-lg border bg-muted/20 p-global font-[family-name:var(--font-sans)] text-sm leading-5",children:g.content},g.id)),!(o??(e.length>0||!!t))&&(l?jsxRuntime.jsx("div",{role:"status","aria-label":s,className:m("flex shrink-0 items-center justify-center rounded-lg border bg-gradient-to-br from-muted via-background to-muted",u),children:jsxRuntime.jsx("span",{"aria-hidden":"true",className:"size-16 animate-spin rounded-full border-[8px] border-muted-foreground/40 border-t-foreground motion-reduce:animate-none sm:size-20"})}):jsxRuntime.jsx("div",{className:"flex min-h-60 w-full items-center justify-center rounded-lg border border-dashed bg-muted/20 p-global text-center text-sm text-muted-foreground",children:d}))]})}a(t0,"WorkbenchTaskOutputs");function o0({src:e,kind:t,alt:o,expanded:r=false,loading:n=false,failed:i=false,loadingLabel:s,errorLabel:l,onError:d,renderMedia:c}){return c?jsxRuntime.jsx(jsxRuntime.Fragment,{children:c({src:e,kind:t,alt:o,expanded:r,loadingLabel:s,errorLabel:l})}):n?jsxRuntime.jsx("span",{role:"status","aria-label":s,children:jsxRuntime.jsx(lucideReact.Loader2,{"aria-hidden":"true",className:"size-6 animate-spin text-muted-foreground motion-reduce:animate-none"})}):i||!e||t==="3d"?jsxRuntime.jsx("span",{role:"img","aria-label":l,children:jsxRuntime.jsx(lucideReact.ImageOff,{"aria-hidden":"true",className:"size-6 text-muted-foreground"})}):t==="video"?jsxRuntime.jsxs("span",{className:r?"contents":"relative block size-full",children:[jsxRuntime.jsx("video",{src:e,"aria-label":o,controls:r,playsInline:true,preload:"metadata",onError:d,className:r?"max-h-[75vh] max-w-full":"size-full object-contain"}),!r&&jsxRuntime.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"flex size-12 items-center justify-center rounded-full bg-[hsl(var(--monkeys-color-media-overlay)/0.6)] shadow-md sm:size-14",children:jsxRuntime.jsx(lucideReact.Play,{className:"ml-0.5 size-5 !fill-[hsl(var(--monkeys-color-media-foreground))] !stroke-[hsl(var(--monkeys-color-media-foreground))] sm:size-6"})})})]}):jsxRuntime.jsx(Ds,{src:e,alt:o,loading:"lazy",onError:d,className:r?"h-auto w-auto max-h-[75vh] max-w-full":void 0})}a(o0,"WorkbenchTaskMedia");function i0({text:e,labels:t,className:o}){let r=ho.useId(),n=ho.useRef(null),[i,s]=ho.useState(false),[l,d]=ho.useState(false),c=e||t.empty;return ho.useEffect(()=>{s(false);},[c]),ho.useEffect(()=>{let p=n.current;if(!p)return;let u=a(()=>{let f=Number.parseFloat(getComputedStyle(p).lineHeight);d(p.scrollHeight>f*3+1);},"measure");if(u(),typeof ResizeObserver>"u")return;let g=new ResizeObserver(u);return g.observe(p),()=>g.disconnect()},[c]),jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-task-prompt",className:m("min-w-0 font-[family-name:var(--font-sans)] text-sm leading-5",o),children:[jsxRuntime.jsx("p",{ref:n,id:r,className:m("whitespace-pre-wrap break-words text-sm leading-5 text-foreground [overflow-wrap:anywhere]",!i&&"line-clamp-3"),children:c}),l&&jsxRuntime.jsxs("button",{type:"button","aria-expanded":i,"aria-controls":r,onClick:()=>s(p=>!p),className:"mt-global-1/2 inline-flex min-h-8 items-center gap-global-1/2 rounded-lg px-global-1/2 text-sm font-medium text-foreground underline underline-offset-4 hover:bg-muted focus-visible:outline focus-visible:outline-2",children:[i?t.less:t.more,i?jsxRuntime.jsx(lucideReact.ChevronUp,{"aria-hidden":"true",className:"size-4"}):jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"size-4"})]})]})}a(i0,"WorkbenchTaskPrompt");function cW({item:e,playLabel:t,selectionMode:o}){let[r,n]=ho.useState(false);if(ho.useEffect(()=>n(false),[e.thumbnailSrc,e.src]),e.notice||e.status==="blocked")return jsxRuntime.jsx("div",{className:"flex size-full items-center justify-center bg-muted p-2 text-center text-xs text-muted-foreground",children:e.notice});let i=r?e.src:e.thumbnailSrc||e.src;return i?e.mediaType==="video"?jsxRuntime.jsxs("div",{"data-history-video-surface":true,className:"group relative size-full bg-[hsl(var(--monkeys-color-media-surface))]",children:[jsxRuntime.jsx("video",{src:i,autoPlay:true,muted:true,playsInline:true,preload:"metadata",onLoadedMetadata:({currentTarget:s})=>{Number.isFinite(s.duration)&&s.duration>0&&(s.currentTime=Math.min(.1,s.duration/2));},onLoadedData:({currentTarget:s})=>{s.currentTime>0&&s.pause();},onSeeked:({currentTarget:s})=>s.pause(),className:"size-full object-contain","aria-label":e.alt}),jsxRuntime.jsx("div",{"data-history-video-overlay":true,"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[hsl(var(--monkeys-color-media-overlay)/0)] transition-colors duration-150 group-hover:bg-[hsl(var(--monkeys-color-media-overlay)/.25)] group-focus-within:bg-[hsl(var(--monkeys-color-media-overlay)/.25)]"}),jsxRuntime.jsx(dt,{ariaLabel:t,"data-history-play":true,tabIndex:o?-1:0,variant:"ghost",size:"lg",iconOnly:true,className:"monkeys-media-overlay-action absolute left-1/2 top-1/2 z-10 size-10 -translate-x-1/2 -translate-y-1/2 p-0 [--monkeys-component-media-action-radius:9999px] [--monkeys-component-media-action-opacity:.55] [--monkeys-component-media-action-hover-opacity:.7] focus-visible:ring-2 focus-visible:ring-[hsl(var(--monkeys-color-media-foreground))]",icon:jsxRuntime.jsx(lucideReact.Play,{className:"size-4 fill-current"})})]}):jsxRuntime.jsx("img",{src:i,alt:e.alt??"",loading:"lazy",onError:()=>{!r&&e.src&&i!==e.src&&n(true);},className:"size-full object-contain opacity-100"}):jsxRuntime.jsx("div",{className:"size-full bg-muted","aria-hidden":"true"})}a(cW,"HistoryMedia");function uW({items:e,loading:t=false,loadingMore:o=false,error:r,hasMore:n=false,pageKey:i,expanded:s,selectedIds:l,selectionMode:d,className:c,itemClassName:p,labels:u,busy:g=false,popupScale:f=1,panelClassName:b,buttonClassName:x,buttonVariant:y="outline",onRetry:k,onLoadMore:w,onExpandedChange:v,onSelectionModeChange:h,onSelectedIdsChange:S,onItemActivate:T,onDelete:C,onItemDragStart:R}){let M=ho.useRef(null),[I,A]=ho.useState(),[N,D]=ho.useState(false),[E,P]=ho.useState(false),[W,H]=ho.useState([]),B=s??N,L=d??E,F=l??W,_=ho.useMemo(()=>new Set(F),[F]),$=ho.useRef(F);$.current=F;let G=Number.isFinite(f)&&f>0?f:1;ho.useLayoutEffect(()=>{if(!B||!M.current)return;let O=0,K=a(()=>{let he=M.current?.getBoundingClientRect();he&&A({left:he.left,width:he.width,bottom:Math.max(0,window.innerHeight-he.bottom)});},"measure"),ne=a(()=>{cancelAnimationFrame(O),O=requestAnimationFrame(K);},"schedule");K();let fe=typeof ResizeObserver=="function"?new ResizeObserver(ne):void 0;return fe?.observe(M.current),window.addEventListener("resize",ne),window.addEventListener("scroll",ne,true),()=>{fe?.disconnect(),cancelAnimationFrame(O),window.removeEventListener("resize",ne),window.removeEventListener("scroll",ne,true);}},[B]),ho.useEffect(()=>{let O=new Set(e.map(ne=>ne.id)),K=F.filter(ne=>O.has(ne));K.length!==F.length&&(H(K),S?.(K));},[e,F,S]);let z=a(O=>{s===void 0&&D(O),v?.(O);},"setExpanded"),re=a(O=>{d===void 0&&P(O),h?.(O),O||Z([]);},"setSelection"),Z=a(O=>{$.current=O,l===void 0&&H(O),S?.(O);},"updateSelection"),ae=a(O=>{if(g||O.selectable===false)return;let K=$.current;Z(K.includes(O.id)?K.filter(ne=>ne!==O.id):[...K,O.id]);},"toggle"),ee=a(O=>{let K=_.has(O.id),ne=O.selectable!==false&&!g;return jsxRuntime.jsxs("div",{"data-history-selection-key":O.id,"data-history-item-id":O.id,role:L?"checkbox":"button","aria-checked":L?K:void 0,"aria-label":L?O.label??u.selectItem:O.alt,"aria-disabled":(L?!ne:O.disabled)||void 0,tabIndex:(L?ne:!O.disabled)?0:void 0,draggable:!!(O.draggable&&!L&&!O.disabled),onDragStart:fe=>{if(!O.draggable||L||O.disabled){fe.preventDefault();return}R?.(fe,O);},onClick:fe=>{L?(fe.stopPropagation(),ae(O)):O.disabled||T?.(O);},onKeyDown:fe=>{(fe.key===" "||fe.key==="Enter")&&(fe.preventDefault(),L?ae(O):O.disabled||T?.(O));},...O.dataAttributes,className:m("group relative aspect-square min-w-0 overflow-hidden rounded-md border border-border/60 bg-transparent outline-hidden transition-[box-shadow,border-color,opacity] focus-visible:ring-2 focus-visible:ring-ring",K&&"border-primary ring-2 ring-primary/70",O.disabled&&"opacity-60",L&&ne&&"cursor-pointer",p),children:[jsxRuntime.jsx(cW,{item:O,playLabel:u.playVideo,selectionMode:L}),L&&ne?jsxRuntime.jsx("span",{className:"pointer-events-none absolute right-1 top-1 z-10 rounded-full bg-background/85 p-0.5",children:jsxRuntime.jsx(ki,{checked:K,controlSize:"sm","aria-hidden":"true",tabIndex:-1,readOnly:true})}):null]},O.id)},"renderItem"),q=a(O=>jsxRuntime.jsx(Sn,{items:e,config:{getItemKey:a(K=>K.id,"getItemKey"),layout:{mode:O,cardWidth:O==="rail"?72:void 0,idealCardWidth:72,gap:8,getItemAspectRatio:a(()=>1,"getItemAspectRatio"),scrollOwner:"parent"},state:{loading:t,loadingMore:o&&n,hasMore:n},loading:{rootMargin:"1px",pageKey:i,variant:"spinner",autoFill:true},windowed:true,appearance:{hover:"none"},labels:{collection:u.ariaLabel,loading:u.loading,loadingMore:u.loadingMore,empty:u.empty}},classNames:{loadMore:"h-px min-h-0 overflow-hidden"},slots:{loadMore:jsxRuntime.jsx("span",{"aria-hidden":"true",className:"block h-px"})},callbacks:{onLoadMore:O==="grid"||!B?w:void 0},renderItem:ee}),"collection"),U=a((O,K,ne,fe=false)=>jsxRuntime.jsx(dt,{icon:jsxRuntime.jsx(O,{}),iconOnly:true,ariaLabel:K,size:"md",variant:y,className:x,disabled:fe,onClick:ne}),"button"),X=jsxRuntime.jsxs("div",{role:"alert",className:"flex min-h-20 flex-col items-center justify-center gap-1 p-2 text-center text-sm",children:[jsxRuntime.jsx("span",{children:u.loadError}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:u.loadErrorDescription}),k?jsxRuntime.jsx(dt,{size:"sm",variant:"outline",label:u.retry,onClick:k}):null]});return jsxRuntime.jsxs("div",{ref:M,"data-workbench-history-result":true,className:m("relative w-full min-w-0 max-w-full rounded-lg",b,c),children:[e.length?jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2 p-3",children:[U(B?lucideReact.Minimize2:lucideReact.Maximize2,B?u.collapse:u.expand,()=>z(!B)),jsxRuntime.jsx("div",{className:"min-w-0 flex-1",children:q("rail")})]}):t?jsxRuntime.jsx(Kr,{title:u.loading,variant:"spinner",className:"min-h-20 p-2"}):r?X:jsxRuntime.jsx(Pi,{title:u.empty,className:"min-h-20 p-2"}),B&&typeof document<"u"?reactDom.createPortal(jsxRuntime.jsxs("div",{"data-history-expanded":true,className:m("fixed z-50 rounded-lg border border-border bg-card text-card-foreground shadow-xl",b),style:{left:I?.left??0,width:(I?.width??0)/G,bottom:I?.bottom??0,transform:`scale(${G})`,transformOrigin:"left bottom"},children:[jsxRuntime.jsxs("div",{className:"max-h-[50vh] overflow-y-auto p-3",style:{marginBottom:72,maxHeight:"50vh",overflowY:"auto"},children:[q("grid"),r&&e.length?jsxRuntime.jsxs("div",{role:"alert",className:"flex items-center gap-2 text-xs",children:[u.refreshError,k?jsxRuntime.jsx(dt,{size:"sm",label:u.retry,onClick:k}):null]}):null]}),jsxRuntime.jsxs("div",{className:"absolute inset-x-3 bottom-3 flex items-center justify-between gap-2",children:[U(lucideReact.Minimize2,u.collapse,()=>z(false)),jsxRuntime.jsx("div",{className:"flex items-center gap-1.5",children:L?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"rounded-full border border-border px-2 py-1 text-xs",children:u.selectedCount}),U(lucideReact.X,u.exitSelection,()=>re(false),g),C?U(lucideReact.Trash2,u.deleteSelected,()=>{g||C(F);},!F.length||g):null]}):C?U(lucideReact.Trash2,u.enterSelection,()=>re(true),g):null})]})]}),document.body):null]})}a(uW,"WorkbenchHistoryResult");function bW({open:e,title:t,description:o,name:r,nameLabel:n,namePlaceholder:i,createLabel:s,cancelLabel:l,closeLabel:d,creating:c=false,error:p,showError:u=true,className:g,onOpenChange:f,onNameChange:b,onCreate:x}){let y=ho.useId(),k=ho.useRef(null),[w,v]=ho.useState(false),[h,S]=ho.useState(null),T=ho.useRef(false),C=ho.useRef(false);ho.useEffect(()=>{e||(T.current=false,S(null),v(false));},[e]);let R=c,M=a(N=>{!R&&!C.current&&f?.(N);},"close"),I=a(async()=>{if(!(!r.trim()||R||C.current||T.current||!x)){C.current=true,v(true);try{await x();}finally{C.current=false;}}},"create"),A={radius:"lg"};return jsxRuntime.jsx(aa,{open:e,onOpenChange:M,title:t,description:o,closeLabel:d,closeOnEscape:!R,closeOnOverlayClick:!R,showCloseButton:!R,portal:true,initialFocus:"explicit",initialFocusRef:k,className:g,classNames:{panel:"w-full max-w-[420px] gap-4 p-6",header:"border-0 p-0",title:"text-lg font-semibold leading-tight",description:"text-sm text-muted-foreground",body:"overflow-visible p-0",footer:"border-0 p-0"},footer:jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(dt,{size:"lg",appearance:A,className:"text-sm",disabled:R,onClick:()=>M(false),children:l}),jsxRuntime.jsx(dt,{size:"lg",tone:"primary",appearance:{...A,slots:{buttonPrimary:"border-primary bg-primary text-primary-foreground hover:bg-primary/90"}},className:"text-sm",loading:c,disabled:R||!r.trim(),onClick:I,children:s})]}),children:jsxRuntime.jsxs("div",{className:"space-y-4","data-monkeys-component":"create-collection-dialog",children:[jsxRuntime.jsxs("div",{className:"space-y-2 py-2",children:[jsxRuntime.jsx("label",{htmlFor:y,className:"text-sm font-medium leading-5",children:n}),jsxRuntime.jsx(wr,{ref:k,id:y,maxLength:80,"aria-label":n,placeholder:i,value:h??r,disabled:R,onCompositionStart:N=>{T.current=true,S(N.currentTarget.value);},onCompositionEnd:N=>{T.current=false,S(null),b?.(N.currentTarget.value);},onChange:N=>{T.current?S(N.currentTarget.value):b?.(N.currentTarget.value);},onKeyDown:N=>{N.key==="Enter"&&!N.nativeEvent.isComposing&&!T.current&&(N.preventDefault(),I());}})]}),w&&!c&&u&&p&&jsxRuntime.jsx("div",{role:"alert",className:"text-sm text-destructive-text",children:p})]})})}a(bW,"WorkbenchCreateCollectionDialog");function kW({open:e,items:t,selectedId:o,name:r,title:n,description:i,nameLabel:s,namePlaceholder:l,createLabel:d,confirmLabel:c,cancelLabel:p,closeLabel:u,loadingLabel:g,emptyLabel:f,loading:b=false,creating:x=false,adding:y=false,createError:k,confirmError:w,showCreateError:v=true,showConfirmError:h=true,className:S,onOpenChange:T,onSelectedIdChange:C,onNameChange:R,onCreate:M,onConfirm:I}){let A=ho.useId(),N=ho.useRef(null),D=ho.useRef(false),E=ho.useRef(false),[P,W]=ho.useState(null);ho.useEffect(()=>{e||(D.current=false);},[e]);let H=x||y||P!==null,B=t.some(_=>_.id===o),L=a(_=>{!H&&!E.current&&T?.(_);},"close"),F=a(async _=>{let $=_==="create"?M:I;if(!(H||E.current||!$||(_==="create"?!r.trim()||D.current:!B))){E.current=true,W(_);try{await $();}catch{}finally{E.current=false,W(null);}}},"submit");return jsxRuntime.jsx(aa,{open:e,onOpenChange:L,title:n,description:i,closeLabel:u,portal:true,closeOnEscape:!H,closeOnOverlayClick:!H,showCloseButton:!H,initialFocus:"explicit",initialFocusRef:N,className:S,classNames:{panel:"w-full max-w-[480px] gap-global-2 p-6",header:"border-0 p-0",title:"text-lg font-semibold leading-tight",description:"text-sm text-muted-foreground",body:"-m-1 min-h-0 p-1",footer:"border-0 p-0"},footer:jsxRuntime.jsxs("div",{className:"flex justify-end gap-global",children:[jsxRuntime.jsx(dt,{variant:"outline",className:"h-10",appearance:{radius:"lg"},disabled:H,onClick:()=>L(false),children:p}),jsxRuntime.jsx(dt,{variant:"outline",className:"h-10",appearance:{radius:"lg"},disabled:H||!B,loading:y||P==="confirm",onClick:()=>F("confirm"),children:c})]}),children:jsxRuntime.jsxs("div",{className:"flex min-h-0 flex-col gap-global-2","data-monkeys-component":"add-to-collection-dialog","aria-busy":H||b,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-global",children:[jsxRuntime.jsx(wr,{ref:N,id:A,"aria-label":s,placeholder:l,appearance:"shadow",className:"min-w-0 flex-1",value:r,disabled:H,onChange:_=>R?.(_.currentTarget.value),onCompositionStart:()=>{D.current=true;},onCompositionEnd:()=>{D.current=false;},onKeyDown:_=>{_.key==="Enter"&&!_.nativeEvent.isComposing&&!D.current&&(_.preventDefault(),F("create"));}}),jsxRuntime.jsx(dt,{variant:"outline",appearance:{radius:"lg"},icon:jsxRuntime.jsx(lucideReact.FolderPlus,{}),className:"h-10 shrink-0",disabled:H||!r.trim(),loading:x||P==="create",onClick:()=>F("create"),children:d})]}),v&&k&&jsxRuntime.jsx("p",{role:"alert",className:"text-sm text-destructive-text",children:k}),jsxRuntime.jsx("div",{className:"-m-1 flex max-h-80 min-h-0 flex-col gap-global overflow-y-auto p-1",role:"group","aria-label":n,children:t.length===0?jsxRuntime.jsx("p",{role:"status",className:"rounded-lg border border-dashed border-border px-global-2 py-global-2 text-center text-sm text-muted-foreground",children:b?g:f}):t.map(_=>jsxRuntime.jsx(dt,{variant:"outline",icon:jsxRuntime.jsx(lucideReact.FolderOpen,{className:"size-4 shrink-0","aria-hidden":"true"}),endIcon:o===_.id?jsxRuntime.jsx(lucideReact.Check,{className:"size-4 shrink-0","aria-hidden":"true"}):void 0,label:_.name,classNames:{label:"min-w-0 flex-1 truncate text-left"},"aria-pressed":o===_.id,disabled:H,className:m("flex h-10 w-full shrink-0 items-center justify-start gap-global rounded-lg border px-global-2 py-global text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",o===_.id?"border-foreground bg-muted text-foreground":"border-border bg-background text-foreground hover:bg-muted"),onClick:()=>C?.(_.id)},_.id))}),h&&w&&jsxRuntime.jsx("p",{role:"alert",className:"text-sm text-destructive-text",children:w})]})})}a(kW,"WorkbenchAddToCollectionDialog");var SW={width:"var(--monkeys-component-app-shell-sidebar-width, 16rem)",borderRadius:"var(--monkeys-component-app-shell-sidebar-radius, var(--radius, 0.75rem))",background:"var(--monkeys-component-app-shell-sidebar-background, hsl(var(--card)))",color:"var(--monkeys-component-app-shell-sidebar-foreground, hsl(var(--card-foreground)))",borderColor:"var(--monkeys-component-app-shell-sidebar-border-color, hsl(var(--border)))",boxShadow:"var(--monkeys-component-app-shell-sidebar-shadow, none)"},TW={padding:"var(--monkeys-component-app-shell-sidebar-header-padding, var(--global-spacing, 0.75rem))",borderColor:"var(--monkeys-component-app-shell-sidebar-header-border-color, hsl(var(--border)))"},NW={padding:"var(--monkeys-component-app-shell-sidebar-navigation-padding, var(--global-spacing, 0.75rem))","--monkeys-component-accordion-item-border-color":"transparent"},RW={padding:"var(--monkeys-component-app-shell-sidebar-footer-padding, var(--global-spacing, 0.75rem))",background:"var(--monkeys-component-app-shell-sidebar-footer-background, hsl(var(--muted) / 0.22))",borderColor:"var(--monkeys-component-app-shell-sidebar-footer-border-color, hsl(var(--border)))"},lb=ho.forwardRef(a(function({navigation:t,header:o,footer:r,width:n,className:i,classNames:s,style:l,"aria-label":d="Application navigation",...c},p){return jsxRuntime.jsxs("aside",{ref:p,"aria-label":d,"data-app-shell-sidebar":"",className:m("relative isolate flex h-full min-h-0 shrink-0 flex-col overflow-hidden border",s?.root,i),style:{...SW,...n===void 0?null:{width:n},...l},...c,children:[o?jsxRuntime.jsx("div",{"data-slot":"header",className:m("shrink-0 border-b",s?.header),style:TW,children:o}):null,jsxRuntime.jsx("div",{"data-slot":"navigation",className:m("relative min-h-0 flex-1 overflow-hidden",s?.navigation),style:NW,children:t}),r?jsxRuntime.jsx("div",{"data-slot":"footer",className:m("shrink-0 border-t",s?.footer),style:RW,children:r}):null]})},"AppShellSidebar"));lb.displayName="AppShellSidebar";var IW={preset:"soft",density:"compact",radius:"lg",border:"subtle",background:"soft"},p0={default:"rounded-md",none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"};function DW(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",className:"h-3 w-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M20 6 9 17l-5-5"})})}a(DW,"CheckIcon");function PW(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"19",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"5",cy:"12",r:"1"})]})}a(PW,"MoreIcon");function db(e,t){return e?jsxRuntime.jsx("span",{className:m("inline-flex h-4 w-4 shrink-0 items-center justify-center",t),children:e}):null}a(db,"renderIcon");function EW(e){return e.options.find(t=>t.value===e.value)?.label??e.value}a(EW,"getCurrentOptionLabel");function AW({classNames:e,menuRadius:t,selector:o}){if(o.visible===false||o.options.length===0)return null;let r=p0[t],n=EW(o);return jsxRuntime.jsxs(Bt__namespace.Sub,{children:[jsxRuntime.jsxs(Bt__namespace.SubTrigger,{disabled:o.disabled,className:m("relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[state=open]:bg-[hsl(var(--accent))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r,e?.subTrigger),children:[db(o.icon),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:o.label}),jsxRuntime.jsx("span",{className:"ml-auto min-w-0 max-w-[7rem] truncate text-xs text-[hsl(var(--muted-foreground))]",children:n})]}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.SubContent,{sideOffset:8,className:m("z-50 min-w-40 border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",r,o.contentWidthClassName,e?.subContent),children:jsxRuntime.jsx(Bt__namespace.RadioGroup,{value:o.value,onValueChange:o.onChange,children:o.options.map(i=>jsxRuntime.jsxs(Bt__namespace.RadioItem,{value:i.value,disabled:i.disabled,className:m("relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 pl-8 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r,e?.item),children:[jsxRuntime.jsx(Bt__namespace.ItemIndicator,{className:"absolute left-2 inline-flex h-4 w-4 items-center justify-center",children:jsxRuntime.jsx(DW,{})}),db(i.icon,e?.itemIcon),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:i.label})]},i.value))})})})]})}a(AW,"UserAccountMenuSelector");function m0({align:e="end",appearance:t=IW,ariaLabel:o,className:r,classNames:n,contentWidthClassName:i="w-56",fallbackName:s="User",items:l=[],menuRadius:d="default",selectors:c=[],side:p="bottom",sideOffset:u=8,triggerEndIcon:g,triggerTitle:f,triggerVariant:b="avatar",user:x}){let y=x.name?.trim()||s,k=p0[d],w=c.filter(C=>C.visible!==false&&C.options.length>0),v=l.filter(C=>C.visible!==false),h=w.length>0||v.length>0,S=jsxRuntime.jsx(bc,{appearance:t,alt:x.avatarAlt??y,className:m("h-8 w-8",n?.avatar),initials:x.initials,name:y,size:"sm",src:x.avatarUrl}),T=b==="profile";return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx(dt,{appearance:t,ariaLabel:o??y,className:m(T?"h-auto w-full justify-start rounded-lg border-transparent bg-transparent px-2 py-2 text-left shadow-none transition-all hover:bg-[hsl(var(--muted))]/60":"h-9 w-9 overflow-visible rounded-md border-transparent bg-transparent p-0 shadow-none transition-all hover:ring-2 hover:ring-[hsl(var(--ring))]/20",r,n?.root,n?.trigger),classNames:{icon:"h-8 w-8",label:T?"min-w-0 flex-1 text-left":void 0},endIcon:T?g??jsxRuntime.jsx(PW,{}):void 0,icon:S,iconOnly:!T,label:T?jsxRuntime.jsxs("span",{className:"flex min-w-0 flex-col items-start",children:[jsxRuntime.jsx("span",{className:"max-w-full truncate text-sm font-medium leading-none text-[hsl(var(--foreground))]",children:y}),x.secondaryText?jsxRuntime.jsx("span",{className:"mt-1 max-w-full truncate text-xs leading-none text-[hsl(var(--muted-foreground))]",children:x.secondaryText}):null]}):void 0,title:f??y,tone:"muted"})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{align:e,side:p,sideOffset:u,className:m("z-50 border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",i,k,n?.content),children:[jsxRuntime.jsx(Bt__namespace.Label,{className:m("px-2 py-1.5 font-normal",n?.label),children:jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[S,jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-col",children:[jsxRuntime.jsx("span",{className:m("truncate text-sm font-medium leading-none",n?.userName),children:y}),x.secondaryText?jsxRuntime.jsx("span",{className:m("truncate pt-1 text-xs leading-none text-[hsl(var(--muted-foreground))]",n?.secondaryText),children:x.secondaryText}):null]})]})}),h?jsxRuntime.jsx(Bt__namespace.Separator,{className:m("my-1 h-px bg-[hsl(var(--border))]",n?.separator)}):null,w.map((C,R)=>jsxRuntime.jsx(AW,{classNames:n,menuRadius:d,selector:C},C.id??`selector-${R}`)),w.length>0&&v.length>0?jsxRuntime.jsx(Bt__namespace.Separator,{className:m("my-1 h-px bg-[hsl(var(--border))]",n?.separator)}):null,v.map(C=>jsxRuntime.jsxs("div",{children:[C.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:m("my-1 h-px bg-[hsl(var(--border))]",n?.separator)}):null,jsxRuntime.jsxs(Bt__namespace.Item,{disabled:C.disabled,onSelect:C.disabled?void 0:C.onSelect,className:m("relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",k,C.tone==="danger"&&"text-[hsl(var(--destructive))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--destructive))] focus:text-[hsl(var(--destructive))]",n?.item,C.tone==="danger"&&n?.dangerItem),children:[db(C.icon,n?.itemIcon),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:C.label}),C.shortcut?jsxRuntime.jsx("span",{className:"ml-3 shrink-0 text-xs text-[hsl(var(--muted-foreground))]",children:C.shortcut}):null]})]},C.id))]})})]})}a(m0,"UserAccountMenu");function De(...e){return e.filter(Boolean).join(" ")}a(De,"cn");function Cl({active:e,disabled:t,icon:o,postfix:r,onClick:n,className:i,children:s}){return jsxRuntime.jsxs("button",{type:"button","aria-disabled":t,"aria-pressed":e,disabled:t,className:De("flex w-full cursor-pointer select-none items-center gap-2 rounded-xl border p-2 text-left text-xs text-[hsl(var(--foreground))] transition-colors",e?"border-[hsl(var(--input))] bg-[hsl(var(--muted))] font-bold":t?"border-transparent":"border-transparent hover:border-[hsl(var(--input))]/60 hover:bg-[hsl(var(--muted))]/60",t&&"!cursor-not-allowed opacity-60",i),onClick:n,children:[jsxRuntime.jsx("div",{className:"w-[20px] [&_svg]:h-[16px] [&_svg]:w-[16px]",children:o}),jsxRuntime.jsx("span",{className:"text-sm",children:s}),r]})}a(Cl,"NavButton");function LW({logo:e,tabs:t,activeTab:o,onTabChange:r,user:n,onLogout:i,logoutLabel:s="\u9000\u51FA\u767B\u5F55",userMenuItems:l,extra:d,className:c}){let p=a(u=>u.split(" ").map(g=>g[0]).join("").toUpperCase().slice(0,2),"getUserInitials");return jsxRuntime.jsxs("header",{className:De("flex h-[72px] w-full shrink-0 items-center justify-between gap-4 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]",c),children:[jsxRuntime.jsxs("div",{className:"flex shrink-0 cursor-pointer items-center gap-2",onClick:e.onClick,children:[jsxRuntime.jsx("div",{className:De("flex h-8 w-8 items-center justify-center rounded-lg overflow-hidden",e.url?"bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),children:e.url?jsxRuntime.jsx("img",{src:e.url,alt:e.title,className:"h-full w-full object-contain"}):jsxRuntime.jsx("span",{className:"text-sm font-bold",children:e.title.charAt(0)})}),jsxRuntime.jsx("span",{className:"text-lg font-semibold whitespace-nowrap",children:e.title})]}),t&&t.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"h-1/2 w-px bg-[hsl(var(--border))]"}),jsxRuntime.jsx("div",{className:"flex flex-1 items-center",children:jsxRuntime.jsx("div",{className:"inline-flex h-9 items-center gap-1 rounded-md bg-transparent p-1",children:t.map(u=>jsxRuntime.jsx("button",{className:De("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all",u.id===o?"bg-[hsl(var(--muted))] text-[hsl(var(--foreground))] shadow-sm":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--muted))]/50"),onClick:()=>r?.(u.id),children:u.label},u.id))})})]}),(!t||t.length===0)&&jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-4",children:[d,n&&jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-md hover:ring-2 hover:ring-[hsl(var(--ring))]/20 transition-all overflow-hidden focus-visible:outline-hidden",children:n.photo?jsxRuntime.jsx("img",{src:n.photo,alt:n.name,className:"h-8 w-8 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium",children:n.name?p(n.name):"U"})})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{className:"z-50 w-52 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",sideOffset:5,align:"end",children:[jsxRuntime.jsxs(Bt__namespace.Label,{className:"flex items-center gap-2 px-2 py-1.5 font-normal",children:[n.photo?jsxRuntime.jsx("img",{src:n.photo,alt:n.name,className:"h-8 w-8 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium",children:n.name?p(n.name):"U"}),jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium leading-none",children:n.name}),n.email&&jsxRuntime.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] leading-none mt-1",children:n.email})]})]}),jsxRuntime.jsx(Bt__namespace.Separator,{className:"h-px bg-[hsl(var(--border))] my-1"}),jsxRuntime.jsxs(Bt__namespace.Group,{children:[l,jsxRuntime.jsxs(Bt__namespace.Item,{className:"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-[hsl(var(--destructive))] outline-hidden transition-colors hover:bg-[hsl(var(--accent))]",onSelect:()=>i?.(),children:[jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),jsxRuntime.jsx("polyline",{points:"16 17 21 12 16 7"}),jsxRuntime.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),s]})]})]})})]})]})]})}a(LW,"AppHeader");function WW({logo:e,navItems:t,activeItemId:o,onNavigate:r,account:n,onLogout:i,logoutLabel:s="\u9000\u51FA\u767B\u5F55",footer:l,defaultExpandedGroups:d,className:c}){return jsxRuntime.jsxs("div",{className:De("flex w-[13.7rem] shrink-0 flex-col justify-between gap-[var(--global-spacing,0.75rem)] overflow-y-hidden rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-5",c),children:[e&&jsxRuntime.jsxs("div",{className:"flex shrink-0 cursor-pointer items-center gap-2",onClick:e.onClick,children:[jsxRuntime.jsx("div",{className:De("flex h-8 w-8 items-center justify-center rounded-lg overflow-hidden",e.url?"bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),children:e.url?jsxRuntime.jsx("img",{src:e.url,alt:e.title,className:"h-full w-full object-contain"}):jsxRuntime.jsx("span",{className:"text-sm font-bold",children:e.title.charAt(0)})}),jsxRuntime.jsx("span",{className:"text-lg font-semibold whitespace-nowrap",children:e.title})]}),jsxRuntime.jsx(zW,{items:t,activeItemId:o,onNavigate:r,defaultExpandedGroups:d}),(n||l)&&jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[n&&jsxRuntime.jsx("div",{className:"flex w-full flex-col gap-2 rounded-lg bg-[hsl(var(--muted))] p-2 shadow-sm",children:jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between px-3 py-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[n.photo?jsxRuntime.jsx("img",{src:n.photo,alt:n.name,className:"h-5 w-5 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-[10px] font-medium",children:n.name?n.name.charAt(0).toUpperCase():"U"}),jsxRuntime.jsx("span",{className:"text-xs font-medium truncate max-w-[100px]",children:n.name})]}),i&&jsxRuntime.jsx("button",{onClick:i,className:"flex items-center justify-center text-[hsl(var(--destructive))] hover:opacity-80 transition-opacity",title:s,children:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),jsxRuntime.jsx("polyline",{points:"16 17 21 12 16 7"}),jsxRuntime.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})})]})}),l]})]})}a(WW,"AppSidebar");function zW({items:e,activeItemId:t,onNavigate:o,defaultExpandedGroups:r}){let[n,i]=ho.useState(()=>{let p={};return (r??e.map(u=>u.id)).forEach(u=>{p[u]=true;}),p}),[s,l]=ho.useState(t);ho.useEffect(()=>{t!==void 0&&l(t);},[t]);let d=a(p=>{i(u=>({...u,[p]:!u[p]}));},"toggle"),c=t??s;return jsxRuntime.jsxs("div",{className:"h-full flex-1 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[jsxRuntime.jsx("style",{children:".monkeys-sidebar-nav::-webkit-scrollbar { display: none; }"}),jsxRuntime.jsx("div",{className:"monkeys-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]",children:e.map(p=>{if(p.children&&p.children.length>0){let u=n[p.id]??true;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Cl,{active:p.id===c,disabled:p.disabled,icon:p.icon,onClick:()=>d(p.id),postfix:jsxRuntime.jsx("div",{className:"flex flex-1 justify-end",children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-[hsl(var(--foreground))] transition-transform duration-200",style:{transform:u?"rotate(90deg)":"rotate(0deg)"},children:jsxRuntime.jsx("path",{d:"m9 18 6-6-6-6"})})}),children:p.label}),u&&!p.disabled&&jsxRuntime.jsx("div",{className:"flex flex-col gap-1 mt-1",children:p.children.map(g=>jsxRuntime.jsx(Cl,{active:g.id===c,disabled:g.disabled,onClick:()=>{l(g.id),o?.(g.id);},children:g.label},g.id))})]},p.id)}return jsxRuntime.jsx(Cl,{icon:p.icon,active:p.id===c,disabled:p.disabled,onClick:()=>{l(p.id),o?.(p.id);},children:p.label},p.id)})})]})}a(zW,"SidebarNavList");function y0({header:e,sidebar:t,children:o,flush:r=false,contentFrame:n=true,className:i}){return jsxRuntime.jsxs("div",{className:De("flex h-screen flex-col gap-[var(--global-spacing,0.75rem)] overflow-hidden p-[var(--global-spacing,0.75rem)]",i),style:{backgroundColor:"hsl(var(--muted))"},children:[e||null,jsxRuntime.jsxs("div",{className:"flex flex-1 gap-[var(--global-spacing,0.75rem)] overflow-hidden min-h-0",children:[t||null,jsxRuntime.jsx("main",{className:De("flex-1 min-h-0 overflow-hidden",n&&"rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))]",!r&&"overflow-y-auto"),children:r?o:jsxRuntime.jsx("div",{className:"h-full overflow-y-auto",children:o})})]})]})}a(y0,"AppLayout");var OW="13.7rem",FW="4.25rem",HW="15rem",VW="cubic-bezier(0.22, 1, 0.36, 1)",_W=72,GW=56,$W=120,x0=64,jW=12,UW=8,KW=44,qW=36,ur={preset:"soft",density:"compact",radius:"lg",border:"subtle",background:"soft"},YW={none:{all:"rounded-none",left:"!rounded-none",right:"!rounded-none"},sm:{all:"rounded-sm",left:"!rounded-l-sm !rounded-r-none",right:"!rounded-l-none !rounded-r-sm"},md:{all:"rounded-md",left:"!rounded-l-md !rounded-r-none",right:"!rounded-l-none !rounded-r-md"},lg:{all:"rounded-lg",left:"!rounded-l-lg !rounded-r-none",right:"!rounded-l-none !rounded-r-lg"},xl:{all:"rounded-xl",left:"!rounded-l-xl !rounded-r-none",right:"!rounded-l-none !rounded-r-xl"},full:{all:"rounded-full",left:"!rounded-l-full !rounded-r-none",right:"!rounded-l-none !rounded-r-full"}};function XW(e){return typeof e!="number"||!Number.isFinite(e)?_W:Math.min($W,Math.max(GW,Math.round(e)))}a(XW,"clampHeadbarHeight");function QW(e){return e<=x0?UW:jW}a(QW,"getHeadbarVerticalPaddingPx");function ZW(e){return e<=x0?qW:KW}a(ZW,"getHeadbarLogoSizePx");function ju(e="default",t="all"){return e==="default"?t==="left"?"rounded-l-lg rounded-r-none":t==="right"?"rounded-l-none rounded-r-lg":"rounded-lg":YW[e][t]}a(ju,"getHeadbarMenuRadiusClass");function JW(e="boxed",t="center"){let o=t==="center"?"grid-cols-[minmax(max-content,1fr)_minmax(0,max-content)_minmax(max-content,1fr)]":"grid-cols-[max-content_minmax(0,1fr)_max-content]";return De(e==="full-bleed"?"sticky top-0 z-40 grid w-full shrink-0 items-center gap-4 rounded-none border-b border-x-0 border-t-0 border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]":"sticky top-0 z-40 grid w-full shrink-0 items-center gap-4 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]",o)}a(JW,"getHeadbarFrameClass");function e3(e="boxed",t,o="card"){let r=QW(t),i={height:`var(--monkeys-component-navigation-headbar-height, ${t}px)`,minHeight:`var(--monkeys-component-navigation-headbar-height, ${t}px)`,paddingTop:`${r}px`,paddingBottom:`${r}px`,background:"var(--monkeys-component-navigation-headbar-frame-background, hsl(var(--background)))",color:"var(--monkeys-component-navigation-headbar-frame-foreground, hsl(var(--foreground)))",borderColor:o==="glassy"?"var(--monkeys-component-navigation-headbar-frame-border-color, rgb(255 255 255 / 0.5))":"var(--monkeys-component-navigation-headbar-frame-border-color, hsl(var(--input)))",borderRadius:e==="full-bleed"?"0":"var(--monkeys-component-navigation-headbar-frame-radius, var(--radius, 0.75rem))",boxShadow:o==="glassy"?"var(--monkeys-component-navigation-headbar-frame-shadow, inset 0 0 0 0 rgb(0 0 0 / 0.1))":"var(--monkeys-component-navigation-headbar-frame-shadow, none)",backdropFilter:`blur(var(--monkeys-component-navigation-headbar-frame-backdrop-blur, ${o==="glassy"?"45px":"0px"}))`};return e==="full-bleed"&&(i.marginLeft="calc(var(--global-spacing,0.75rem) * -1)",i.marginRight="calc(var(--global-spacing,0.75rem) * -1)",i.marginTop="calc(var(--global-spacing,0.75rem) * -1)",i.width="calc(100% + (var(--global-spacing,0.75rem) * 2))"),i}a(e3,"getHeadbarFrameStyle");function t3(e="center"){return e==="left"?"justify-start":e==="right"?"justify-end":"justify-center"}a(t3,"getHeadbarNavClass");function Uu(e,t=true){return {height:"var(--monkeys-component-navigation-headbar-item-height, 2.25rem)",borderRadius:t?"var(--monkeys-component-navigation-headbar-item-radius, var(--radius, 0.5rem))":void 0,paddingInline:"var(--monkeys-component-navigation-headbar-item-padding-inline, 0.75rem)",columnGap:"var(--monkeys-component-navigation-headbar-item-gap, 0.375rem)",color:e?"var(--monkeys-component-navigation-headbar-item-active-foreground, hsl(var(--foreground)))":"var(--monkeys-component-navigation-headbar-item-foreground, hsl(var(--muted-foreground)))",background:e?"var(--monkeys-component-navigation-headbar-item-active-background, hsl(var(--muted)))":"transparent",borderColor:e?"var(--monkeys-component-navigation-headbar-item-active-border-color, transparent)":"transparent",fontSize:"var(--monkeys-component-navigation-headbar-item-font-size, 0.875rem)",fontWeight:"var(--monkeys-component-navigation-headbar-item-font-weight, 500)"}}a(Uu,"getHeadbarItemStyle");function o3(e,t=true){return {...Uu(e,t),paddingInline:void 0,columnGap:void 0}}a(o3,"getHeadbarCompoundStyle");function v0(e,t){for(let o of e)if(o.id===t||Tl(o,t))return o.id;return t}a(v0,"findNavigationRootId");function Tl(e,t){return t?e.id===t?true:e.children?.some(o=>Tl(o,t))??false:false}a(Tl,"containsNavigationItem");function r3(e,t){return e.children?.find(o=>Tl(o,t))}a(r3,"findActiveNavigationBranch");function f0(e){return e.title||(typeof e.label=="string"?e.label:void 0)}a(f0,"getNavigationActionTitle");function b0({actions:e,compact:t}){return e.length?t?jsxRuntime.jsx("div",{className:"flex flex-col items-center gap-2",children:e.map(o=>{let r=f0(o);return jsxRuntime.jsx(To,{appearance:ur,content:o.label,placement:"right",portal:true,children:jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",iconOnly:true,icon:o.icon,onClick:o.onClick,title:r,ariaLabel:r,className:De("h-10 w-10 rounded-lg border-transparent text-[hsl(var(--muted-foreground))] shadow-none","hover:-translate-y-0.5 hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]","active:translate-y-0 active:scale-[0.96]")})},o.id)})}):jsxRuntime.jsx("div",{className:"flex flex-col gap-2",children:e.map(o=>jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",icon:o.icon,label:jsxRuntime.jsx("span",{className:"truncate",children:o.label}),onClick:o.onClick,title:f0(o),className:De("h-9 w-full justify-start gap-2.5 rounded-lg border-transparent px-3 text-left text-[13px] text-[hsl(var(--muted-foreground))] shadow-none","hover:-translate-y-0.5 hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))]/70 hover:text-[hsl(var(--foreground))]","active:translate-y-0 active:scale-[0.985]")},o.id))}):null}a(b0,"NavigationLayoutActionButtons");function w0({activeItemId:e,items:t,onNavigate:o,revealRequest:r}){let n=ho.useRef(null),[i,s]=ho.useState({}),l=r?t.some(p=>Tl(p,r.id)&&!p.disabled):false,d=a(p=>{s(u=>({...u,[p]:!u[p]}));},"toggleRoot");ho.useEffect(()=>{if(!r||!l)return;s(u=>({...u,[r.id]:true}));let p=window.requestAnimationFrame(()=>{let u=n.current?.querySelector(`[data-navigation-sidebar-item-id="${CSS.escape(r.id)}"]`);u instanceof HTMLElement&&u.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"});});return ()=>window.cancelAnimationFrame(p)},[l,r]);let c=a((p,u=0)=>p.map(g=>{let f=!!g.children?.length,b=Tl(g,e),x=!g.disabled&&(i[g.id]??b);return jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-id":g.id,children:[jsxRuntime.jsx(Cl,{active:b,className:u>0?"pl-3":void 0,disabled:g.disabled,icon:g.icon,onClick:()=>f?d(g.id):o?.(g.id),postfix:f?jsxRuntime.jsx("div",{className:"flex flex-1 justify-end",children:jsxRuntime.jsx(ub,{open:false,sideways:true,className:"text-[hsl(var(--foreground))] transition-transform duration-200",style:{transform:x?"rotate(90deg)":"rotate(0deg)"}})}):void 0,children:g.label}),f&&x?jsxRuntime.jsx("div",{className:"mt-1 ml-3 flex flex-col gap-1 border-l border-[hsl(var(--input))] pl-2",children:c(g.children??[],u+1)}):null]},g.id)}),"renderItems");return jsxRuntime.jsxs("div",{className:"h-full flex-1 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[jsxRuntime.jsx("style",{children:".monkeys-navigation-sidebar-nav::-webkit-scrollbar { display: none; }"}),jsxRuntime.jsx("div",{ref:n,className:"monkeys-navigation-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]",children:c(t)})]})}a(w0,"SidebarNavigationList");function g0({collapsed:e,logo:t,title:o}){if(!t)return null;let r=o??t.title,n=jsxRuntime.jsx("div",{className:De("flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",t.url?"bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),children:t.url?jsxRuntime.jsx("img",{src:t.url,alt:t.title,className:"h-full w-full object-contain"}):jsxRuntime.jsx("span",{className:"text-sm font-bold",children:t.title.charAt(0)})});return e?jsxRuntime.jsx(To,{appearance:ur,content:r,placement:"right",portal:true,children:jsxRuntime.jsx(dt,{appearance:ur,ariaLabel:typeof r=="string"?r:t.title,className:"h-10 w-10 rounded-lg border-transparent bg-transparent p-0 shadow-none hover:bg-[hsl(var(--muted))]/60",icon:n,iconOnly:true,onClick:t.onClick,title:typeof r=="string"?r:t.title,tone:"muted"})}):jsxRuntime.jsx(dt,{appearance:ur,ariaLabel:t.title,className:"h-auto w-full justify-start gap-3 border-transparent bg-transparent p-0 text-left shadow-none hover:bg-transparent",classNames:{icon:"h-9 w-9"},icon:n,label:jsxRuntime.jsx("span",{className:"min-w-0 truncate text-sm font-semibold text-[hsl(var(--foreground))]",children:r}),onClick:t.onClick,title:typeof r=="string"?r:t.title,tone:"muted"})}a(g0,"SidebarBrand");function n3({accountMenu:e,activeItemId:t,actions:o=[],collapsed:r,collapsedAccountMenu:n,footer:i,header:s,items:l,logo:d,onCollapsedChange:c,onNavigate:p,onRevealRoot:u,revealRequest:g,title:f}){if(r){let b=v0(l,t);return jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col rounded-xl border border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] p-2 shadow-sm",children:[jsxRuntime.jsx("div",{className:"mb-3 flex shrink-0 justify-center",children:s??jsxRuntime.jsx(g0,{collapsed:true,logo:d,title:f})}),jsxRuntime.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center gap-2 overflow-y-auto pb-3",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:l.map(x=>{let y=b===x.id;return jsxRuntime.jsx(To,{appearance:ur,content:x.label,placement:"right",portal:true,children:jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",active:y,disabled:x.disabled,iconOnly:true,icon:x.icon,onClick:()=>{x.disabled||(u?.(x.id),c?.(false),!x.children?.length&&p?.(x.id));},title:typeof x.label=="string"?x.label:void 0,ariaLabel:typeof x.label=="string"?x.label:x.id,className:De("h-10 w-10 rounded-lg border text-[hsl(var(--muted-foreground))] shadow-none","hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.96]",y?"border-[hsl(var(--input))] bg-[hsl(var(--muted))] text-[hsl(var(--foreground))] shadow-sm":"border-transparent hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))]/70 hover:text-[hsl(var(--foreground))]")})},x.id)})}),jsxRuntime.jsxs("div",{className:"-mx-2 mt-2 border-t border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] px-2 pt-2.5 pb-0.5",children:[jsxRuntime.jsx(b0,{actions:o,compact:true}),n?jsxRuntime.jsx("div",{className:"mt-2 flex justify-center border-t border-[hsl(var(--input))] pt-2",children:n}):null]})]})}return jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col justify-between gap-0 overflow-y-hidden rounded-xl border border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] px-5 pt-5 pb-1.5",children:[jsxRuntime.jsx("div",{className:"mb-4 shrink-0",children:s??jsxRuntime.jsx(g0,{logo:d,title:f})}),jsxRuntime.jsx(w0,{activeItemId:t,items:l,onNavigate:p,revealRequest:g}),jsxRuntime.jsxs("div",{className:"-mx-5 mt-2 border-t border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] px-4 pt-2.5 pb-1",children:[jsxRuntime.jsx(b0,{actions:o,compact:false}),i,e?jsxRuntime.jsx("div",{className:"mt-2 border-t border-[hsl(var(--input))] pt-2",children:e}):null]})]})}a(n3,"Sidebar");function ub({className:e,open:t,sideways:o=false,style:r}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",className:De("h-4 w-4 shrink-0",!o&&"transition-transform duration-200",!o&&t&&"rotate-180",e),style:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:o?"m9 18 6-6-6-6":"m6 9 6 6 6-6"})})}a(ub,"HeadbarChevronIcon");function a3(e,t){if(typeof e!="string"||typeof t!="string")return;let o=e.trim(),r=t.trim();return o&&r?`${o} / ${r}`:void 0}a(a3,"getHeadbarSummaryTitle");var h0="relative flex w-full min-w-0 cursor-pointer select-none items-center gap-2.5 px-3 py-2 text-sm outline-hidden transition-colors hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] focus:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] focus:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] data-[highlighted]:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] data-[highlighted]:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))]",k0={width:"max-content",maxWidth:"min(20rem, var(--radix-dropdown-menu-content-available-width))",background:"var(--monkeys-component-navigation-headbar-menu-background, hsl(var(--monkeys-color-menu-surface)))",borderColor:"var(--monkeys-component-navigation-headbar-menu-border-color, var(--monkeys-component-overlay-border-color, hsl(var(--monkeys-color-border))))",color:"var(--monkeys-component-navigation-headbar-menu-foreground, hsl(var(--monkeys-color-popover-foreground)))",boxShadow:"var(--monkeys-component-navigation-headbar-menu-shadow, var(--monkeys-component-overlay-menu-shadow, 0 10px 15px -3px rgb(0 0 0 / 0.1)))",backdropFilter:"blur(var(--monkeys-component-navigation-headbar-menu-backdrop-blur, var(--monkeys-component-overlay-backdrop-blur, 0px)))",WebkitBackdropFilter:"blur(var(--monkeys-component-navigation-headbar-menu-backdrop-blur, var(--monkeys-component-overlay-backdrop-blur, 0px)))"};function C0({activeItemId:e,items:t,menuContentRadiusClass:o,menuItemRadiusClass:r,onNavigate:n,onNavigateComplete:i,useTokenRadius:s}){let l=ke();return t.map(d=>{let c=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[d.icon?jsxRuntime.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[hsl(var(--muted-foreground))]",children:d.icon}):null,jsxRuntime.jsx("span",{className:De("min-w-0 truncate",!!d.children?.length&&"flex-1"),children:d.headbarLabel??d.label})]});return d.children?.length?jsxRuntime.jsxs(Bt__namespace.Sub,{children:[jsxRuntime.jsxs(Bt__namespace.SubTrigger,{disabled:d.disabled,className:De(h0,r),children:[c,jsxRuntime.jsx(ub,{open:false,sideways:true})]}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.SubContent,{...l,sideOffset:4,alignOffset:-6,"data-monkeys-component":"navigation-headbar-menu","data-slot":"content","data-surface":"menu",className:De("z-50 border p-1.5 animate-in fade-in-0 zoom-in-95",un("menu"),o),style:{...k0,minWidth:"12rem"},children:jsxRuntime.jsx(C0,{activeItemId:e,items:d.children,menuContentRadiusClass:o,menuItemRadiusClass:r,onNavigate:n,onNavigateComplete:i,useTokenRadius:s})})})]},d.id):jsxRuntime.jsxs(Bt__namespace.Item,{disabled:d.disabled,className:De(h0,r),style:Uu(d.id===e,s),onSelect:()=>{d.disabled||(i(),n?.(d.id));},children:[c,d.trailing]},d.id)})}a(C0,"HeadbarDropdownItems");function i3({activeItemId:e,compound:t,isActive:o,item:r,label:n,menuButtonRadiusClass:i,menuContentRadiusClass:s,menuItemRadiusClass:l,onNavigate:d,title:c,useTokenRadius:p}){let[u,g]=ho.useState(false),f=ke(),b=!r.disabled&&u,x=ho.useRef(null),y=ho.useRef(false),k=a(()=>{x.current&&(clearTimeout(x.current),x.current=null);},"clearCloseTimer"),w=a(()=>{r.disabled||(k(),g(true));},"openMenu"),v=a(()=>{k(),x.current=setTimeout(()=>{g(false),x.current=null;},120);},"scheduleCloseMenu"),h=a(()=>{let S=r.children?.find(T=>!T.disabled);return S?(g(false),d?.(S.id),true):false},"navigateToFirstEnabledChild");return ho.useEffect(()=>k,[]),jsxRuntime.jsxs(Bt__namespace.Root,{modal:false,open:b,onOpenChange:S=>g(!r.disabled&&S),children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",active:o||b,icon:r.icon,endIcon:jsxRuntime.jsx(ub,{open:b}),label:n,title:c,disabled:r.disabled,onClick:()=>{let S=y.current;y.current=false,!(S&&h())&&g(true);},onPointerDown:()=>{y.current=b;},onPointerCancel:()=>{y.current=false;},onKeyDown:S=>{!b||S.key!=="Enter"&&S.key!==" "||h()&&S.preventDefault();},onMouseEnter:w,onMouseLeave:v,style:Uu(o||b,t?false:p),classNames:{icon:"text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",label:"flex shrink-0 items-center !overflow-visible !text-clip text-[inherit] [&_*]:!text-[inherit]"},className:De("shrink-0 border shadow-none",t&&"!rounded-none !border-0 !bg-transparent",i,o||b?"":"hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]")})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{...f,align:"start",sideOffset:5,"data-monkeys-component":"navigation-headbar-menu","data-slot":"content","data-surface":"menu",onCloseAutoFocus:S=>S.preventDefault(),onMouseEnter:w,onMouseLeave:v,className:De("z-50 border p-1.5 animate-in fade-in-0 zoom-in-95",un("menu"),s),style:{...k0,minWidth:"var(--radix-dropdown-menu-trigger-width)"},children:jsxRuntime.jsx(C0,{activeItemId:e,items:r.children??[],menuContentRadiusClass:s,menuItemRadiusClass:l,onNavigate:d,onNavigateComplete:()=>g(false),useTokenRadius:p})})})]})}a(i3,"HeadbarNavMenuItem");function $u(e){e.preventDefault(),e.stopPropagation();}a($u,"blockEvent");function s3({activeItemId:e,activeRootId:t,items:o,menuRadius:r="default",onNavigate:n}){let i=ju(r),s=ju(r),l=ju(r),d=r==="default";return jsxRuntime.jsx("div",{className:"flex w-max min-w-0 shrink-0 items-center gap-1",children:o.map(c=>{let p=t===c.id||e===c.id,u=!!c.headbarSecondaryAction,g=c.headbarLabel??c.label,f=r3(c,e),b=f?f.headbarLabel??f.label:void 0,x=f?jsxRuntime.jsxs("span",{"data-navigation-headbar-selected-child":f.id,className:"flex shrink-0 items-center gap-1.5 whitespace-nowrap",children:[jsxRuntime.jsx("span",{className:"shrink-0",children:g}),jsxRuntime.jsx("span",{className:"shrink-0",children:"/"}),jsxRuntime.jsx("span",{className:"shrink-0",children:b})]}):jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:g}),y=f?a3(g,b):void 0,k=c.children?.length?jsxRuntime.jsx(i3,{activeItemId:e,compound:u,isActive:p,item:c,label:x,menuButtonRadiusClass:i,menuContentRadiusClass:s,menuItemRadiusClass:l,onNavigate:n,title:y,useTokenRadius:d}):jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",active:p,disabled:c.disabled,icon:c.icon,label:jsxRuntime.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:x}),c.trailing]}),onClick:()=>n?.(c.id),style:Uu(p,u?false:d),classNames:{icon:"text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",label:"shrink-0 !overflow-visible !text-clip text-[inherit] [&_*]:!text-[inherit]"},className:De("shrink-0 border shadow-none",u&&"!rounded-none !border-0 !bg-transparent",i,p?"":"hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]")});return u?jsxRuntime.jsxs("div",{"data-navigation-headbar-compound-item":c.id,"aria-disabled":c.disabled,className:De("inline-flex min-w-0 shrink-0 items-center gap-0 overflow-hidden border shadow-none",i,p?"":"hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]"),style:o3(p,d),children:[jsxRuntime.jsx("span",{"data-navigation-headbar-primary-action":"",className:"inline-flex min-w-0 shrink-0",children:k}),jsxRuntime.jsx("span",{"data-navigation-headbar-secondary-action":c.id,...c.disabled&&{inert:"",onClickCapture:$u,onKeyDownCapture:$u,onKeyUpCapture:$u,onPointerDownCapture:$u},className:De("inline-flex min-w-0 shrink-0 items-center",c.disabled&&"!cursor-not-allowed opacity-60"),children:c.headbarSecondaryAction})]},c.id):jsxRuntime.jsx(ho.Fragment,{children:k},c.id)})})}a(s3,"NavigationHeadbarMenu");function l3({activeItemId:e,activeRootId:t,actions:o,accountMenu:r,className:n,extra:i,layout:s,brand:l,logo:d,navigation:c,navItems:p=[],onNavigate:u}){let g=XW(s?.heightPx),f=s?.layoutMode??"boxed",b=s?.menuRadius??"default",x=s?.surface??"card",y=ZW(g),k=e3(f,g,x),w=!!s?.brandTitle;return jsxRuntime.jsxs("header",{className:De(JW(f,s?.navPosition),n),"data-navigation-headbar":"","data-navigation-headbar-surface":x,style:k,children:[jsxRuntime.jsx("div",{className:"flex min-w-0 items-center justify-start",children:l??(d?jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",icon:jsxRuntime.jsx("div",{className:De("flex items-center justify-center overflow-hidden rounded-lg",d.url?"w-auto max-w-[min(22rem,30vw)] bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),style:d.url?{height:y}:{width:y,height:y},children:d.url?jsxRuntime.jsx("img",{src:d.url,alt:d.title,className:"block h-full w-auto object-contain"}):jsxRuntime.jsx("span",{className:"text-base font-bold",children:d.title.charAt(0)})}),label:w?jsxRuntime.jsx("span",{className:"truncate whitespace-nowrap text-base font-medium text-[hsl(var(--foreground))]",children:s?.brandTitle}):null,ariaLabel:d.title,title:d.title,className:"h-auto min-w-0 justify-start border-transparent bg-transparent p-0 shadow-none hover:bg-transparent",classNames:d.url?{icon:"!h-auto !w-auto shrink-0"}:void 0,onClick:d.onClick}):null)}),jsxRuntime.jsx("div",{className:De("flex min-w-0 items-center",t3(s?.navPosition)),children:jsxRuntime.jsx("div",{className:"no-scrollbar flex max-w-full min-w-0 items-center overflow-x-auto overscroll-x-contain",children:c??jsxRuntime.jsx(s3,{activeItemId:e,activeRootId:t,items:p,menuRadius:b,onNavigate:u})})}),jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center justify-end gap-3",children:[o,i,r]})]})}a(l3,"NavigationHeadbar");function d3({activeItemId:e,activeRootId:t,allowModeSwitch:o=false,accountMenu:r,children:n,className:i,collapsedSidebarAccountMenu:s,collapsedSidebarWidth:l=FW,contextualSidebar:d=false,contextualSidebarHeader:c,contextualSidebarWidth:p=HW,defaultMode:u="headbar",defaultSidebarCollapsed:g=false,expandedSidebarWidth:f=OW,expandSidebarLabel:b="Expand sidebar",flush:x=false,contentFrame:y=true,headbarActions:k,headbarLayout:w,logo:v,mode:h,navItems:S,onModeChange:T,onNavigate:C,onSidebarCollapsedChange:R,renderHeadbarExtra:M,collapseSidebarLabel:I="Collapse sidebar",sidebarCollapsed:A,sidebarAccountMenu:N,sidebarFooter:D,sidebarHeader:E,switchToHeadbarLabel:P="Switch to headbar",switchToSidebarLabel:W="Switch to sidebar"}){let[H,B]=ho.useState(u),[L,F]=ho.useState(g),[_,$]=ho.useState(null),G=h!==void 0,z=A!==void 0,re=G?h:H,Z=z?A:L,ae=re==="headbar",ee=Z?l:f,q=t??v0(S,e),U=S.find(me=>me.id===q),X=U?.children??[];ho.useEffect(()=>{G||B(u);},[u,G]),ho.useEffect(()=>{z||F(g);},[g,z]);let O=a(me=>{G||B(me),T?.(me);},"setNavigationMode"),K=a(me=>{z||F(me),R?.(me);},"setCollapsed"),ne=[];o&&ne.push({id:"toggle-headbar",label:P,onClick:a(()=>O("headbar"),"onClick"),icon:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-[18px] w-[18px] rotate-180",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),jsxRuntime.jsx("path",{d:"M3 9h18"})]})}),ne.push({id:"toggle-sidebar",label:Z?b:I,onClick:a(()=>K(!Z),"onClick"),icon:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-[18px] w-[18px]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),jsxRuntime.jsx("path",{d:"M9 3v18"}),jsxRuntime.jsx("path",{d:Z?"m14 9 3 3-3 3":"m16 15-3-3 3-3"})]})});let fe=ae&&d&&X.length?jsxRuntime.jsx("aside",{className:"relative h-full min-h-0 shrink-0 overflow-hidden","data-navigation-contextual-sidebar":q,style:{width:p},children:jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col gap-3 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] px-4 py-4",children:[jsxRuntime.jsx("div",{className:"shrink-0 px-2 text-sm font-semibold text-[hsl(var(--foreground))]",children:c??U?.label}),jsxRuntime.jsx(w0,{activeItemId:e,items:X,onNavigate:C})]})}):ae?null:jsxRuntime.jsx("div",{className:De("relative h-full min-h-0 shrink-0 transition-[width] duration-260",Z?"z-20 overflow-visible":"z-10 overflow-hidden"),style:{width:ee,transitionTimingFunction:VW},children:jsxRuntime.jsx(n3,{accountMenu:N??r,activeItemId:e,actions:ne,collapsed:Z,collapsedAccountMenu:s??r,footer:D,header:E,items:S,logo:v,onCollapsedChange:K,onNavigate:C,onRevealRoot:me=>$(ie=>({id:me,nonce:(ie?.nonce??0)+1})),revealRequest:_,title:w?.brandTitle})}),he=ae?jsxRuntime.jsx(l3,{activeItemId:e,activeRootId:q,actions:o?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[k,jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",icon:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),jsxRuntime.jsx("path",{d:"M9 3v18"}),jsxRuntime.jsx("path",{d:"m14 9 3 3-3 3"})]}),label:jsxRuntime.jsx("span",{className:"truncate whitespace-nowrap",children:W}),onClick:()=>O("sidebar"),className:De("h-auto min-w-0 shrink px-3 py-2 text-sm font-medium text-[hsl(var(--muted-foreground))] shadow-none hover:border-[hsl(var(--input))]/70 hover:bg-[hsl(var(--muted))]/60 hover:text-[hsl(var(--foreground))]",ju(w?.menuRadius))})]}):k,accountMenu:r,extra:M,layout:w,logo:v,navItems:S,onNavigate:C}):null;return jsxRuntime.jsx(y0,{header:he,sidebar:fe,flush:x,contentFrame:y,className:i,children:n})}a(d3,"NavigationLayout");var m3={variant:"default",density:"default"},f3=ho.createContext(m3);function b3(e,t={}){return {variant:t.variant??e.variant,density:t.density??(t.variant==="trend"?"compact":e.density)}}a(b3,"resolveAgentWorkbenchAppearance");function Nl(e={}){return b3(ho.useContext(f3),e)}a(Nl,"useAgentWorkbenchAppearance");var g3={page:"bg-background text-foreground",panel:"bg-card text-card-foreground",elevated:"border border-border bg-popover text-popover-foreground shadow-sm",subtle:"bg-muted/40 text-foreground",overlay:"border border-border bg-popover text-popover-foreground shadow-lg"};ho.forwardRef(a(function({level:t="panel",variant:o,density:r,className:n,children:i,...s},l){let d=Nl({variant:o,density:r});return jsxRuntime.jsx("div",{...s,ref:l,"data-agent-workbench-surface":t,"data-agent-workbench-variant":d.variant,"data-agent-workbench-density":d.density,className:De(g3[t],n),children:i})},"AgentWorkbenchSurface"));var N0={sparkles:lucideReact.Sparkles,palette:lucideReact.Palette,search:lucideReact.Search,"file-text":lucideReact.FileText,code:lucideReact.Code2,"shopping-bag":lucideReact.ShoppingBag},qa="__quick-start__";function M3({template:e}){let t=N0[e.icon||"sparkles"];return e.coverImageUrl?jsxRuntime.jsx("img",{src:e.coverImageUrl,alt:"",className:"size-full bg-muted object-contain"}):jsxRuntime.jsx("span",{className:"flex size-full items-center justify-center bg-gradient-to-br from-primary/5 via-muted/50 to-primary/15",children:jsxRuntime.jsx("span",{className:"flex size-14 items-center justify-center rounded-2xl border border-primary/10 bg-background/85 text-primary shadow-sm",children:jsxRuntime.jsx(t,{className:"size-7","aria-hidden":"true"})})})}a(M3,"TemplateVisual");function R0({viewModel:e,className:t,onIntent:o}){let r=Ye().agentWorkbench.quickStart,n=ho.useRef(null),[i,s]=ho.useState(),[l,d]=ho.useState(),[c,p]=ho.useState(),u=ho.useMemo(()=>e.categories.map(h=>({...h,sections:h.sections.map(S=>({...S,templates:S.templates.filter(T=>!T.modes||T.modes.includes(e.mode))})).filter(S=>S.templates.length>0)})).filter(h=>h.sections.length>0),[e.categories,e.mode]),g=ho.useMemo(()=>{let h=u.flatMap(S=>S.sections.filter(T=>T.id==="quick-start")).map(S=>S.templates).flat().filter((S,T,C)=>C.findIndex(R=>R.id===S.id)===T);if(h.length!==0)return {id:qa,label:r.label,icon:"sparkles",sections:[{id:"quick-start",label:r.label,templates:h}]}},[u,r.label]),f=i===qa?g:u.find(h=>h.id===i),b=f?.sections.find(h=>h.id===l)||f?.sections[0],x=b?.templates.length?b.templates.every(h=>!h.coverImageUrl):false;if(ho.useEffect(()=>{i&&i!==qa&&!u.some(h=>h.id===i)&&(s(void 0),d(void 0)),i===qa&&!g&&(s(void 0),d(void 0));},[i,u,g]),u.length===0)return null;let y=a(h=>{s(h.id),d(h.sections[0]?.id),o?.({type:"change-category",categoryId:h.id});},"selectCategory"),k=a(()=>{g&&(s(qa),d(g.sections[0]?.id),o?.({type:"change-category"}));},"selectQuickStart"),w=a(h=>{f&&(d(h),o?.({type:"change-section",categoryId:f.id,sectionId:h}));},"selectSection"),v=a(h=>{if(e.disabled)return;if(h.action!=="upload"){o?.({type:"select-template",templateId:h.id,prompt:h.prompt});return}let S=n.current;S&&(S.accept=h.accept||"*/*",S.multiple=h.multiple===true,p(h),S.click());},"selectTemplate");return jsxRuntime.jsxs("section",{className:De("agent-workbench-quick-start min-w-0 max-w-full",t),"aria-label":r.label,children:[jsxRuntime.jsx("input",{ref:n,type:"file",className:"hidden",onChange:h=>{let S=Array.from(h.target.files||[]);c&&S.length>0&&o?.({type:"select-template",templateId:c.id,prompt:c.prompt,files:c.multiple?S:S.slice(0,1)}),p(void 0),h.target.value="";}}),f?jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 max-w-full items-center gap-1 overflow-x-auto pb-1",children:[jsxRuntime.jsxs("button",{type:"button",className:"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-md px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>{s(void 0),d(void 0),o?.({type:"change-category"});},children:[jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"size-4","aria-hidden":"true"}),r.back]}),f.sections.map((h,S)=>jsxRuntime.jsx("button",{type:"button","aria-pressed":b?.id===h.id,className:De("h-9 shrink-0 rounded-md px-4 text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",b?.id===h.id?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"),onClick:()=>w(h.id),children:f.id!==qa&&S===0?f.label:h.label},h.id))]}),jsxRuntime.jsx("div",{"data-quick-start-layout":x?"list":"cards",className:De("grid",x?"grid-cols-1 gap-0":"grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3"),children:b?.templates.map(h=>jsxRuntime.jsxs("button",{type:"button",disabled:e.disabled,"data-quick-start-template-id":h.id,className:De("group min-w-0 overflow-hidden text-left transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",x?"flex min-h-14 items-center rounded-none border-x-0 border-t-0 bg-transparent shadow-none hover:border-border hover:bg-muted/40 last:border-b-0":"rounded-xl border border-border bg-background hover:border-primary/30 hover:bg-muted/20"),onClick:()=>v(h),children:[jsxRuntime.jsxs("span",{className:De(x?"min-w-0 flex-1 px-2 py-2.5":"block px-4 pb-3 pt-4"),children:[jsxRuntime.jsxs("span",{className:De("flex items-center gap-2 text-sm text-foreground",x?"font-medium":"font-semibold"),children:[h.title,h.action==="upload"?jsxRuntime.jsxs("span",{className:"ml-auto inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"size-3","aria-hidden":"true"}),r.addFile]}):null]}),h.description?jsxRuntime.jsx("span",{className:De("line-clamp-2 block text-xs leading-4 text-muted-foreground",x?"mt-0.5 min-h-0 text-muted-foreground/75":"mt-1 min-h-8"),children:h.description}):null]}),x?jsxRuntime.jsx(lucideReact.ArrowUpRight,{className:"mr-2 size-4 shrink-0 text-muted-foreground/45","aria-hidden":"true"}):jsxRuntime.jsx("span",{className:De("block overflow-hidden",h.coverImageUrl?"aspect-[5/2]":"h-28"),children:jsxRuntime.jsx(M3,{template:h})})]},h.id))})]}):jsxRuntime.jsxs("div",{className:"flex max-w-full items-center justify-center gap-2 overflow-x-auto px-1 pb-1",children:[g?jsxRuntime.jsxs("button",{type:"button",className:"inline-flex h-10 shrink-0 items-center gap-2 rounded-md border border-border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring","aria-pressed":i===qa,onClick:k,children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),r.label]}):null,u.map(h=>{let S=N0[h.icon||"sparkles"];return jsxRuntime.jsxs("button",{type:"button",className:"inline-flex h-10 shrink-0 items-center gap-2 rounded-md border border-border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>y(h),children:[jsxRuntime.jsx(S,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),h.label]},h.id)})]})]})}a(R0,"AgentWorkbenchQuickStart");var Ya=ho.forwardRef(a(function({children:t,header:o,search:r,primaryAction:n,actions:i,groups:s,footer:l,className:d,classNames:c,bodyProps:p,bodyScrollable:u=true,status:g="ready",variant:f,density:b,loadingState:x,emptyState:y,errorState:k,...w},v){let h=Nl({variant:f,density:b}),S=h.density==="compact",T=r!==void 0||n!==void 0||i!==void 0,C=g==="loading"?x:g==="empty"?y:g==="error"?k:t;return jsxRuntime.jsxs("nav",{ref:v,"data-agent-workbench-variant":h.variant,"data-agent-workbench-density":h.density,"data-agent-workbench-status":g,className:De("flex h-full min-h-0 flex-col bg-card text-card-foreground",c?.root,d),...w,children:[o!==void 0?jsxRuntime.jsx("div",{className:De("shrink-0",c?.header),children:o}):null,T?jsxRuntime.jsxs("div",{className:De("shrink-0",S?"space-y-2 px-3 pb-2 pt-3":"space-y-3 px-4 pb-2 pt-4",c?.search),children:[r,n!==void 0?jsxRuntime.jsx("div",{className:De(c?.primaryAction),children:n}):null,i!==void 0?jsxRuntime.jsx("div",{className:De("flex min-w-0 items-center gap-2",c?.actions),children:i}):null]}):null,jsxRuntime.jsx("div",{"data-agent-workbench-scroll-region":u?"":void 0,...p,tabIndex:p?.tabIndex??(u?0:void 0),className:De("min-h-0 flex-1",S?"px-3 pb-3":"px-4 pb-4",u&&"overflow-x-hidden overflow-y-auto overscroll-contain",c?.body),children:C}),s!==void 0?jsxRuntime.jsx("div",{className:De("shrink-0",c?.groups),children:s}):null,l!==void 0?jsxRuntime.jsx("div",{className:De("shrink-0",c?.footer),children:l}):null]})},"AgentWorkbenchSidebarContainer"));Ya.displayName="AgentWorkbenchSidebarContainer";function Ku({value:e,label:t,placeholder:o=t,className:r,variant:n="default",onChange:i}){let s=Ye().agentWorkbench.navigation,l=ho.useRef(null);return ho.useEffect(()=>{let d=a(c=>{!(c.ctrlKey||c.metaKey)||c.key.toLocaleLowerCase()!=="k"||(c.preventDefault(),l.current?.focus(),l.current?.select());},"handleShortcut");return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[]),jsxRuntime.jsxs(dy,{className:De(n==="trend"?"h-12 rounded-[var(--radius)] border-border bg-card text-foreground":"h-10 rounded-lg bg-card",r),children:[jsxRuntime.jsx(Yd,{children:jsxRuntime.jsx(lucideReact.Search,{className:"size-4","aria-hidden":"true"})}),jsxRuntime.jsx(hm,{ref:l,type:"search",value:e,"aria-label":t,placeholder:o,className:"min-w-0 [&::-webkit-search-cancel-button]:hidden",onChange:d=>i(d.target.value),onKeyDown:d=>{d.key==="Escape"&&(i(""),d.currentTarget.blur());}}),e?jsxRuntime.jsx(Yd,{align:"inline-end",children:jsxRuntime.jsx(cy,{size:"icon-xs","aria-label":s.clearSearch,onClick:()=>i(""),children:jsxRuntime.jsx(lucideReact.X,{className:"size-3.5","aria-hidden":"true"})})}):jsxRuntime.jsx(Yd,{align:"inline-end",children:jsxRuntime.jsx("kbd",{className:"border border-border px-1.5 py-0.5 text-[10px]",children:"Ctrl K"})})]})}a(Ku,"AgentWorkbenchSidebarSearch");function qu({label:e,className:t,variant:o="default",onClick:r}){return jsxRuntime.jsxs(mt,{type:"button",variant:o==="trend"?"default":"ghost",className:De(o==="trend"?"h-11 w-full justify-center gap-2 rounded-[var(--radius)] border border-primary/60 bg-primary px-3 font-semibold text-primary-foreground hover:bg-primary/90":"h-9 w-full justify-start gap-2 px-3 text-sm",t),onClick:r,children:[jsxRuntime.jsx(lucideReact.SquarePen,{className:"size-4","aria-hidden":"true"}),e]})}a(qu,"AgentWorkbenchSidebarNewSessionButton");function P0({item:e}){let[t,o]=ho.useState(false);return e.thumbnailUrl&&!t?jsxRuntime.jsx("img",{src:e.thumbnailUrl,alt:"",className:"size-full object-cover",loading:"lazy",onError:()=>o(true)}):jsxRuntime.jsx(lucideReact.Image,{className:"size-5","aria-hidden":"true"})}a(P0,"SessionAvatar");function E0({item:e}){let{locale:t}=Co(),o=Ye().agentWorkbench.navigation;return jsxRuntime.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"min-w-0 truncate text-xs text-foreground/80",children:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e.updatedAt))}),e.mode?jsxRuntime.jsx("span",{className:De("shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none",e.mode==="work"?"bg-primary/10 text-primary":"bg-muted text-foreground"),children:e.mode==="work"?o.work:o.chat}):null]})}a(E0,"SessionMeta");function _3({status:e}){let t=Ye().agentWorkbench.navigation;return e==="running"?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 animate-spin text-primary","aria-label":t.running}):e==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"size-4 text-primary","aria-label":t.completed}):e==="error"?jsxRuntime.jsx(lucideReact.AlertCircle,{className:"size-4 text-destructive-text","aria-label":t.failed}):null}a(_3,"StatusIndicator");function Yu({sessions:e,selectedSessionId:t,status:o="ready",error:r,query:n="",emptyLabel:i,noResultsLabel:s,retryLabel:l,groupByMode:d=false,showHeading:c=false,variant:p="default",className:u,itemClassName:g,capabilities:f,onSelect:b,onTogglePin:x,onRename:y,onDelete:k,onRetry:w}){let v=Ye().agentWorkbench.navigation,h=ho.useRef(null),[S,T]=ho.useState(),[C,R]=ho.useState("");ho.useEffect(()=>{S&&(h.current?.focus(),h.current?.select());},[S]);let M=a(()=>{T(void 0),R("");},"cancelRename"),I=a(D=>{let E=C.trim();E&&E!==D.title&&y?.(D.id,E),M();},"saveRename");if(o==="loading"&&e.length===0)return jsxRuntime.jsx("div",{className:"space-y-2 px-1 py-3",role:"status","aria-label":v.loading,children:Array.from({length:4},(D,E)=>jsxRuntime.jsx("div",{"aria-hidden":"true",className:De("animate-pulse rounded-[var(--radius)] bg-muted/70",p==="trend"?"h-10":"h-14")},E))});if(o==="error")return jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-3 px-3 py-8 text-center",children:[jsxRuntime.jsx("p",{className:"max-w-full break-words text-sm text-muted-foreground",role:"alert",children:r}),w?jsxRuntime.jsxs(mt,{type:"button",variant:"ghost",size:"sm",className:"gap-1.5 px-0 text-sm text-primary hover:text-primary",onClick:w,children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"size-3.5","aria-hidden":"true"}),l??v.retry]}):null]});if(e.length===0)return jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:n?s:i});let A=a(D=>jsxRuntime.jsx("div",{className:"space-y-3",children:D.map(E=>jsxRuntime.jsxs("div",{"aria-current":E.id===t?"page":void 0,"data-agent-session-status":E.status??"idle","aria-busy":E.status==="running"?"true":void 0,className:"group flex h-10 w-full min-w-0 items-center rounded-[var(--radius)] border border-transparent bg-muted/60 text-foreground transition hover:bg-muted focus-within:border-ring focus-within:ring-2 focus-within:ring-ring aria-[current=page]:border-primary aria-[current=page]:bg-primary/10",children:[jsxRuntime.jsx("button",{type:"button",title:E.title,className:"h-full min-w-0 flex-1 truncate px-3 text-left text-sm font-semibold",onClick:()=>b(E.id),children:E.title}),f?.delete?jsxRuntime.jsx("span",{"data-agent-workbench-item-actions":true,className:"mr-1 shrink-0 opacity-0 transition-opacity group-aria-[current=page]:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100",onClick:P=>P.stopPropagation(),onKeyDown:P=>P.stopPropagation(),children:jsxRuntime.jsxs(Ns,{children:[jsxRuntime.jsx(Rs,{asChild:true,children:jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon","aria-label":v.actions,className:"size-8 text-muted-foreground",children:jsxRuntime.jsx(lucideReact.Ellipsis,{className:"size-4","aria-hidden":"true"})})}),jsxRuntime.jsx(vi,{align:"end",children:jsxRuntime.jsxs(Ms,{className:"text-destructive-text",onSelect:()=>k?.(E.id),children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"mr-2 size-4","aria-hidden":"true"}),v.delete]})})]})}):null]},E.id))}),"renderTrendItems"),N=a(D=>jsxRuntime.jsx("div",{className:"space-y-1",children:D.map(E=>{let P=E.contextUsage&&E.contextUsage.maxTokens>0?Math.min(100,Math.round(E.contextUsage.usedTokens/E.contextUsage.maxTokens*100)):void 0;return jsxRuntime.jsxs("div",{"aria-current":E.id===t?"page":void 0,className:De("group flex w-full min-w-0 items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted",g),children:[S===E.id?jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[jsxRuntime.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",children:jsxRuntime.jsx(P0,{item:E})}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx(wr,{ref:h,value:C,"aria-label":v.rename,appearance:"compact",className:"h-6 w-full border-primary px-1.5 text-sm font-medium",onChange:W=>R(W.target.value),onClick:W=>W.stopPropagation(),onBlur:()=>I(E),onKeyDown:W=>{W.stopPropagation(),W.key==="Enter"?(W.preventDefault(),I(E)):W.key==="Escape"&&(W.preventDefault(),M());}}),jsxRuntime.jsx(E0,{item:E})]})]}):jsxRuntime.jsxs("button",{type:"button",title:E.title,className:"flex min-w-0 flex-1 items-center gap-3 text-left",onClick:()=>b(E.id),children:[jsxRuntime.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",children:jsxRuntime.jsx(P0,{item:E})}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:"block truncate text-sm font-medium",children:E.title}),jsxRuntime.jsx(E0,{item:E})]})]}),jsxRuntime.jsxs("span",{"data-agent-workbench-item-actions":true,className:"flex shrink-0 items-center gap-1",children:[P!==void 0&&E.status==="idle"?jsxRuntime.jsxs("span",{className:"text-xs text-foreground","aria-label":v.contextUsage({percent:P}),children:[P,"%"]}):jsxRuntime.jsx(_3,{status:E.status}),f?.pin?jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon","aria-label":E.pinned?v.unpin:v.pin,className:De("size-8 text-muted-foreground opacity-0 group-hover:opacity-100",E.pinned&&"text-primary opacity-100"),onClick:W=>{W.stopPropagation(),x?.(E.id,!E.pinned);},children:jsxRuntime.jsx(lucideReact.Pin,{className:De("size-4",E.pinned&&"fill-current")})}):null,f?.rename||f?.delete?jsxRuntime.jsx("span",{onClick:W=>W.stopPropagation(),onKeyDown:W=>W.stopPropagation(),children:jsxRuntime.jsxs(Ns,{children:[jsxRuntime.jsx(Rs,{asChild:true,children:jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon",className:"size-8","aria-label":v.actions,children:jsxRuntime.jsx(lucideReact.Ellipsis,{className:"size-4","aria-hidden":"true"})})}),jsxRuntime.jsxs(vi,{align:"end",children:[f.rename?jsxRuntime.jsxs(Ms,{onSelect:()=>{T(E.id),R(E.title);},children:[jsxRuntime.jsx(lucideReact.Pencil,{className:"mr-2 size-4","aria-hidden":"true"}),v.rename]}):null,f.delete?jsxRuntime.jsxs(Ms,{className:"text-destructive-text",onSelect:()=>k?.(E.id),children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"mr-2 size-4","aria-hidden":"true"}),v.delete]}):null]})]})}):null]})]},E.id)})}),"renderItems");return jsxRuntime.jsxs("div",{className:De("space-y-2",u),children:[c&&!d?jsxRuntime.jsx("h3",{className:"mb-2 px-3 text-xs font-medium text-muted-foreground",children:v.recentSessions}):null,p==="trend"?A(e):d?[{id:"chatbot",label:v.chats,icon:lucideReact.MessageSquare,items:e.filter(D=>D.mode!=="work")},{id:"agent",label:v.agents,icon:lucideReact.Bot,items:e.filter(D=>D.mode==="work")}].map(({id:D,label:E,icon:P,items:W})=>jsxRuntime.jsxs("details",{open:true,"aria-label":E,children:[jsxRuntime.jsxs("summary",{className:"flex h-9 cursor-pointer list-none items-center gap-2 rounded-md px-3 text-sm font-semibold hover:bg-muted",children:[jsxRuntime.jsx(P,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:E})]}),N(W)]},D)):N(e)]})}a(Yu,"AgentWorkbenchSessionList");var Q3={contract:"AgentWorkbenchNavigationViewModel",activeTab:"sessions",searchQuery:"",agents:{status:"loading",items:[]},sessions:{status:"loading",items:[]},capabilities:{createAgent:false,createSession:false,manageCapabilities:false,manageAgentSettings:false,pinAgents:false,pinSessions:false,renameSessions:false,deleteSessions:false}};function Z3({item:e}){let[t,o]=ho.useState(false);if(e.iconUrl&&!t)return jsxRuntime.jsx("img",{src:e.iconUrl,alt:"",className:"size-full object-cover",onError:()=>o(true)});let r=e.name.trim().charAt(0).toLocaleUpperCase();return r?jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:r}):jsxRuntime.jsx(lucideReact.Bot,{className:"size-4"})}a(Z3,"ItemAvatar");function J3({status:e,empty:t,noResults:o,hasItems:r,query:n,error:i,onRetry:s}){let l=Ye().agentWorkbench.navigation;return e==="loading"&&!r?jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:l.loading}):e==="error"?jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-3 px-3 py-8 text-center",children:[jsxRuntime.jsx("p",{className:"max-w-full break-words text-sm text-muted-foreground",role:"alert",children:i}),jsxRuntime.jsxs(mt,{type:"button",variant:"ghost",size:"sm",className:"gap-1.5 px-0 text-sm text-primary hover:text-primary",onClick:s,children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"size-3.5","aria-hidden":"true"}),l.retry]})]}):r?null:jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:n?o:t})}a(J3,"CollectionState");function L0({viewModel:e=Q3,navigationMode:t,config:o,header:r,headerActions:n,footer:i,className:s,classNames:l,onIntent:d}){let c=Ye().agentWorkbench.navigation,p=ho.useMemo(()=>monkeys.resolveAgentWorkbenchSidebarConfig(o),[o]),u=ho.useMemo(()=>new Set(p.visibleSections),[p.visibleSections]),g=t==="sessions-only"||t===void 0&&p.navigationMode!=="default",f=u.has("agents")&&!g,b=u.has("sessions"),x=e.searchQuery.trim().toLocaleLowerCase(),y=ho.useMemo(()=>e.agents.items.filter(w=>!x||`${w.name} ${w.description??""}`.toLocaleLowerCase().includes(x)),[x,e.agents.items]),k=ho.useMemo(()=>e.sessions.items.filter(w=>!x||w.title.toLocaleLowerCase().includes(x)),[x,e.sessions.items]);return jsxRuntime.jsx(Ea,{value:g||!f?"sessions":e.activeTab,onValueChange:w=>{!g&&(w==="agents"||w==="sessions")&&d?.({type:"change-tab",tab:w});},className:"h-full min-h-0",children:jsxRuntime.jsxs(Ya,{"data-sidebar-width-percent":p.widthPercent,"aria-label":c.tabsLabel,header:u.has("header")?r:void 0,search:u.has("search")?jsxRuntime.jsx(Ku,{value:e.searchQuery,label:g?c.searchSessions:c.search,className:l?.search,onChange:w=>d?.({type:"change-search",query:w})}):void 0,actions:f&&b||n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[f&&b?jsxRuntime.jsxs(Aa,{className:De("grid min-w-0 flex-1 grid-cols-2 text-foreground",l?.tabs),"aria-label":c.tabsLabel,children:[jsxRuntime.jsx(Kn,{value:"agents",children:c.agents}),jsxRuntime.jsx(Kn,{value:"sessions",children:c.sessions})]}):null,n?jsxRuntime.jsx("div",{className:"flex shrink-0 items-center",children:n}):null]}):void 0,footer:u.has("footer")&&(!g&&e.capabilities.manageAgentSettings||i)?jsxRuntime.jsxs("div",{className:De("border-t border-border p-4",l?.footer),children:[!g&&e.capabilities.manageAgentSettings?jsxRuntime.jsxs(mt,{type:"button",variant:"ghost",className:"h-10 w-full justify-start gap-2 px-3 text-sm",onClick:()=>d?.({type:"open-agent-settings"}),children:[jsxRuntime.jsx(lucideReact.Settings,{className:"size-4","aria-hidden":"true"}),c.settings]}):null,i]}):void 0,bodyScrollable:false,className:s,classNames:{root:l?.root,body:"flex min-h-0 flex-1 flex-col p-0"},children:[f?jsxRuntime.jsxs(mn,{value:"agents","data-agent-workbench-scroll-region":true,className:De("mt-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-4 pb-4",l?.body),children:[e.capabilities.createAgent?jsxRuntime.jsxs(mt,{type:"button",variant:"ghost",className:"mb-3 h-9 w-full justify-start gap-2 px-3 text-sm",onClick:()=>d?.({type:"create-agent"}),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"size-4","aria-hidden":"true"}),c.newAgent]}):null,jsxRuntime.jsx("h3",{className:"mb-2 px-3 text-xs font-medium text-muted-foreground",children:c.allAgents}),jsxRuntime.jsx(J3,{status:e.agents.status,empty:c.emptyAgents,noResults:c.noResults,hasItems:y.length>0,query:x,error:e.agents.error,onRetry:()=>d?.({type:"retry-agents"})}),jsxRuntime.jsx("div",{className:"space-y-1",children:y.map(w=>jsxRuntime.jsxs("div",{"aria-current":w.id===e.selectedAgentItem?"page":void 0,className:De("group flex w-full min-w-0 items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted",l?.item),children:[jsxRuntime.jsxs("button",{type:"button",title:w.name,className:"flex min-w-0 flex-1 items-center gap-3 text-left",onClick:()=>d?.({type:"select-agent",itemId:w.id}),children:[jsxRuntime.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",children:jsxRuntime.jsx(Z3,{item:w})}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:"block truncate text-sm font-medium",children:w.name}),jsxRuntime.jsx("span",{className:"block truncate text-xs text-foreground/80",children:w.description||c.noDescription})]})]}),w.builtIn?jsxRuntime.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-1 text-[10px] text-foreground",children:c.builtIn}):null,e.capabilities.pinAgents?jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon","aria-label":w.pinned?c.unpin:c.pin,className:De("size-8 text-muted-foreground opacity-0 group-hover:opacity-100",w.pinned&&"text-primary opacity-100"),onClick:v=>{v.stopPropagation(),d?.({type:"toggle-agent-pin",itemId:w.id,pinned:!w.pinned});},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),d?.({type:"toggle-agent-pin",itemId:w.id,pinned:!w.pinned}));},children:jsxRuntime.jsx(lucideReact.Pin,{className:De("size-4",w.pinned&&"fill-current",w.pinPending&&"animate-pulse")})}):null]},w.id))})]}):null,b?jsxRuntime.jsxs(mn,{value:"sessions","data-agent-workbench-scroll-region":true,className:De("mt-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-4 pb-4",l?.body),children:[u.has("new-session")&&e.capabilities.createSession?jsxRuntime.jsx(qu,{label:c.newSession,onClick:()=>d?.({type:"create-session"})}):null,!g&&e.capabilities.manageCapabilities?jsxRuntime.jsxs(mt,{type:"button",variant:"ghost",className:"mb-3 h-9 w-full justify-start gap-2 px-3 text-sm",onClick:()=>d?.({type:"open-capabilities"}),children:[jsxRuntime.jsx(lucideReact.Blocks,{className:"size-4","aria-hidden":"true"}),c.capabilities]}):null,jsxRuntime.jsx(Yu,{sessions:k,selectedSessionId:e.selectedSessionItem,status:e.sessions.status,error:e.sessions.error,query:x,emptyLabel:c.emptySessions,noResultsLabel:c.noResults,groupByMode:g,showHeading:!g,itemClassName:l?.item,capabilities:{pin:e.capabilities.pinSessions,rename:e.capabilities.renameSessions,delete:e.capabilities.deleteSessions},onSelect:w=>d?.({type:"select-session",sessionId:w}),onTogglePin:(w,v)=>d?.({type:"toggle-session-pin",sessionId:w,pinned:v}),onRename:(w,v)=>d?.({type:"rename-session",sessionId:w,title:v}),onDelete:w=>d?.({type:"delete-session",sessionId:w}),onRetry:()=>d?.({type:"retry-sessions"})})]}):null]})})}a(L0,"AgentWorkbenchSidebar");function W0({item:e,src:t=e.imageUrl,className:o,onError:r}){if(!t)return null;let n=e.mediaVariant??"cover",i=n==="logo",s=n==="cover-with-label",l=e.mediaTreatment==="monochrome-light"?"brightness-0 invert":e.mediaTreatment==="invert"?"invert":"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:De(i?"flex size-full items-center justify-center bg-[hsl(var(--monkeys-color-media-surface))] p-token-xl":"block size-full",o),children:jsxRuntime.jsx("img",{src:t,alt:"",className:De("transition-transform duration-300 group-hover/explore-card:scale-[1.03]",i?"max-h-full max-w-full object-contain":"size-full object-cover",l),onError:r})}),s?jsxRuntime.jsxs("span",{className:"pointer-events-none absolute inset-x-0 bottom-0 text-[hsl(var(--monkeys-color-media-foreground))]",style:{paddingInline:"var(--global-spacing, 0.75rem)",paddingBottom:"var(--global-spacing-sm, 0.5rem)",paddingTop:"var(--global-spacing-2xl, 1.5rem)",backgroundImage:"linear-gradient(to top, hsl(var(--monkeys-color-media-overlay) / 0.8), hsl(var(--monkeys-color-media-overlay) / 0.3), transparent)"},children:[jsxRuntime.jsx("span",{className:"block text-base font-semibold",children:e.title}),e.subtitle?jsxRuntime.jsx("span",{className:"block text-xs opacity-75",style:{marginTop:"calc(var(--global-spacing, 0.75rem) / 6)"},children:e.subtitle}):null]}):null]})}a(W0,"AgentWorkbenchExploreCardMedia");function z0({sessions:e,groups:t,config:o,labels:r,selectedSessionId:n,searchQuery:i="",loading:s=false,error:l,showDraftSession:d=!n,deleteSessions:c=false,variant:p="default",defaultGroupId:u,header:g,footer:f,className:b,renderItemMedia:x,onIntent:y}){let k=ho.useMemo(()=>monkeys.resolveAgentWorkbenchSidebarConfig(o),[o]),w=ho.useMemo(()=>new Set(k.visibleSections),[k.visibleSections]),v=t?.length?t:k.groups,h=u??k.defaultGroupId,[S,T]=ho.useState(h??v[0]?.id??""),C=v.find(D=>D.id===S)??v[0],R=i.trim().toLocaleLowerCase(),M=d&&(!R||r.draftSession.toLocaleLowerCase().includes(R)),I=ho.useMemo(()=>e.filter(D=>!R||D.title.toLocaleLowerCase().includes(R)),[R,e]);ho.useEffect(()=>{v.some(D=>D.id===S)||T(h??v[0]?.id??"");},[S,v,h]);let A=a(D=>{T(D),y?.({type:"change-group",groupId:D});},"changeGroup"),N=w.has("groups")&&C?jsxRuntime.jsx("div",{className:"border-t border-border px-4 pb-4 pt-3",children:jsxRuntime.jsxs(Ea,{value:C.id,onValueChange:A,children:[jsxRuntime.jsx(Aa,{className:"grid h-10 w-full rounded-[var(--radius)] bg-muted p-0.5 text-foreground",style:{gridTemplateColumns:`repeat(${v.length}, minmax(0, 1fr))`},children:v.map(D=>jsxRuntime.jsx(Kn,{value:D.id,className:"rounded-md text-sm font-semibold text-foreground data-[state=active]:border data-[state=active]:border-border data-[state=active]:bg-background",children:D.label},D.id))}),v.map(D=>jsxRuntime.jsx(mn,{value:D.id,className:"mt-3",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:D.items.map(E=>jsxRuntime.jsx("button",{type:"button","aria-label":E.title,className:"group/explore-card relative aspect-[1.27] overflow-hidden rounded-[var(--radius)] border border-border bg-card text-left transition hover:border-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",style:Number.isFinite(D.itemAspectRatio)&&Number(D.itemAspectRatio)>0?{aspectRatio:D.itemAspectRatio}:void 0,onClick:()=>y?.({type:"select-item",groupId:D.id,item:E}),children:x?.(E,D)??jsxRuntime.jsx(W0,{item:E})},E.id))})},D.id))]})}):void 0;return jsxRuntime.jsx(Ya,{"data-sidebar-style":"explore","data-sidebar-width-percent":k.widthPercent,"aria-label":r.navigation,variant:p,density:p==="trend"?"compact":void 0,header:w.has("header")?g:void 0,search:w.has("search")?jsxRuntime.jsx(Ku,{value:i,label:r.search,variant:p,onChange:D=>y?.({type:"change-search",query:D})}):void 0,primaryAction:w.has("new-session")?jsxRuntime.jsx(qu,{label:r.newSession,variant:p,onClick:()=>y?.({type:"create-session"})}):void 0,groups:N,footer:w.has("footer")?f:void 0,bodyProps:{"data-agent-workbench-session-scroll-region":""},className:b,classNames:{body:"min-h-[160px] flex-[0_1_280px]"},children:w.has("sessions")?jsxRuntime.jsxs("div",{className:"space-y-2",children:[M?jsxRuntime.jsx("button",{type:"button","aria-current":"page",className:"block h-10 w-full min-w-0 truncate rounded-[var(--radius)] border border-primary bg-primary/10 px-3 text-left text-sm font-semibold text-foreground",onClick:()=>y?.({type:"create-session"}),children:r.draftSession}):null,I.length>0||!M||s||l?jsxRuntime.jsx(Yu,{sessions:I,selectedSessionId:n,status:l?"error":s?"loading":"ready",error:l,query:R,emptyLabel:r.emptySessions,noResultsLabel:r.noResults,retryLabel:r.retry,groupByMode:k.navigationMode!=="default",variant:p,capabilities:{delete:c},onSelect:D=>y?.({type:"select-session",sessionId:D}),onDelete:D=>y?.({type:"delete-session",sessionId:D}),onRetry:r.retry?()=>y?.({type:"retry-sessions"}):void 0}):null]}):null})}a(z0,"AgentWorkbenchExploreSidebar");var a4={reasoning:"reasoning",plan:"plan",task:"tasks",tool:"tools",approval:"approval",artifact:"artifacts",usage:"usage"};function i4(e){let t=e.filter(c=>c.eventType==="status"),o=t.at(-1);if(!o)return;if(o.payload.status!=="stopped"||o.payload.durationMs!==void 0)return o;let r=o.runId?t.filter(c=>c.runId===o.runId&&c.sequence<=o.sequence):t.filter(c=>c.sequence<=o.sequence),n=-1;for(let c=r.length-1;c>=0;c-=1){let p=r[c];if(p.sequence<o.sequence&&p.payload.status==="stopped"){n=c;break}}let i=r.slice(n+1).reverse().find(c=>c.payload.status==="running"||c.payload.status==="queued"),s=i?.payload.startedAt??i?.occurredAt,l=o.payload.stoppedAt??o.occurredAt;if(!s||!l)return o;let d=Date.parse(l)-Date.parse(s);return Number.isFinite(d)&&d>=0?{...o,resolvedDurationMs:d}:o}a(i4,"projectRun");function s4(e,t){let o=a4[e.eventType];return o?t[o]===true:true}a(s4,"isVisible");function as(e,t,o){let r=new Map;for(let n of e){if(n.eventType!==t)continue;let i=n;r.set(o(i),i);}return [...r.values()].sort((n,i)=>n.sequence-i.sequence)}a(as,"latestBy");function Zu(e){let t=e.events.filter(o=>s4(o,e.snapshot.capabilities));return {mode:e.snapshot.mode,status:e.status,reasoning:as(t,"reasoning",o=>o.payload.reasoningId),plans:as(t,"plan",o=>o.payload.planId),tasks:as(t,"task",o=>o.payload.taskId),tools:as(t,"tool",o=>o.payload.toolCallId),approvals:as(t,"approval",o=>o.payload.approvalId),artifacts:as(t,"artifact",o=>o.payload.artifactId),usage:[...t].reverse().find(o=>o.eventType==="usage"),run:i4(t)}}a(Zu,"createAgentWorkbenchActivityModel");function u4({value:e}){if(e===void 0)return null;let t=typeof e=="string"?e:JSON.stringify(e,null,2);return jsxRuntime.jsx("pre",{className:"max-h-48 max-w-full overflow-auto overscroll-contain whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-foreground [overflow-wrap:anywhere]",tabIndex:0,children:t})}a(u4,"JsonValue");function O0({approval:e,className:t,onDecision:o}){let r=Ye().agentWorkbench.approval,n=e.status==="requested",i=e.status==="approved";return jsxRuntime.jsx("article",{className:De("min-w-0 overflow-hidden rounded-lg border border-border bg-card p-3 text-card-foreground",t),"data-agent-approval-status":e.status,children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[n?jsxRuntime.jsx(lucideReact.Clock3,{className:"mt-0.5 size-4 shrink-0 text-warning-foreground","aria-hidden":"true"}):i?jsxRuntime.jsx(lucideReact.Check,{className:"mt-0.5 size-4 shrink-0 text-success","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.X,{className:"mt-0.5 size-4 shrink-0 text-destructive-text","aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("h3",{className:"break-words text-sm font-medium",children:e.title}),e.description?jsxRuntime.jsx("p",{tabIndex:0,className:"mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words text-sm text-muted-foreground [overflow-wrap:anywhere]",children:e.description}):null,e.requestedAction!==void 0?jsxRuntime.jsx("div",{className:"mt-3 min-w-0",children:jsxRuntime.jsx(u4,{value:e.requestedAction})}):null,n?jsxRuntime.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[jsxRuntime.jsx(mt,{type:"button",size:"sm",className:"h-auto px-3 py-1.5 text-sm",disabled:!o,onClick:()=>o?.({approvalId:e.approvalId,approved:true}),children:r.approve}),jsxRuntime.jsx(mt,{type:"button",variant:"outline",size:"sm",className:"h-auto px-3 py-1.5 text-sm",disabled:!o,onClick:()=>o?.({approvalId:e.approvalId,approved:false}),children:r.reject})]}):jsxRuntime.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:i?r.approved:r.rejected})]})]})})}a(O0,"AgentWorkbenchApproval");function F0({value:e,className:t}){if(e===void 0)return null;let o=typeof e=="string"?e:JSON.stringify(e,null,2);return jsxRuntime.jsx("pre",{tabIndex:0,className:De("max-h-64 max-w-full overflow-auto overscroll-contain whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-foreground [overflow-wrap:anywhere]",t),children:o})}a(F0,"JsonValue");function x4({status:e}){Ye().agentWorkbench.tool.status;let o="size-3.5 shrink-0";return e==="pending"?jsxRuntime.jsx(lucideReact.Clock3,{className:o,"aria-hidden":"true"}):e==="running"?jsxRuntime.jsx(lucideReact.Loader2,{className:De(o,"animate-spin"),"aria-hidden":"true"}):e==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:De(o,"text-primary"),"aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.XCircle,{className:De(o,"text-destructive-text"),"aria-hidden":"true"})}a(x4,"ToolStatus");function Ju({event:e,expanded:t,defaultExpanded:o=e.payload.status==="failed",className:r,classNames:n,onExpandedChange:i}){let s=Ye().agentWorkbench.tool,[l,d]=ho.useState(o),c=t!==void 0,p=t??l,u=e.payload.status,g=a(f=>{c||d(f),i?.(f);},"setExpanded");return jsxRuntime.jsxs("details",{open:p,className:De("group min-w-0 overflow-hidden rounded-lg border border-border bg-card text-card-foreground",n?.root,r),"data-tool-status":u,children:[jsxRuntime.jsxs("summary",{className:De("flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",n?.trigger),onClick:f=>{f.preventDefault(),g(!p);},children:[jsxRuntime.jsx(lucideReact.TerminalSquare,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:e.payload.toolName}),jsxRuntime.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-foreground",children:[jsxRuntime.jsx(x4,{status:u}),s.status[u]]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180","aria-hidden":"true"})]}),jsxRuntime.jsxs("div",{className:De("min-w-0 space-y-3 border-t border-border px-3 py-3 text-sm",n?.content),children:[e.payload.input!==void 0?jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s.input}),jsxRuntime.jsx(F0,{value:e.payload.input,className:n?.input})]}):null,e.payload.output!==void 0?jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s.output}),jsxRuntime.jsx(F0,{value:e.payload.output,className:n?.output})]}):null,e.payload.error?jsxRuntime.jsx("p",{tabIndex:0,className:"max-h-32 overflow-auto whitespace-pre-wrap break-words text-sm text-destructive-text [overflow-wrap:anywhere]",role:"alert",children:e.payload.error}):null]})]})}a(Ju,"AgentWorkbenchTool");function D4({artifact:e,label:t,onDownload:o}){let r=ho.useRef(false),[n,i]=ho.useState(false);return jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon","aria-label":t,title:t,disabled:n,className:"text-muted-foreground hover:text-foreground",onClick:async s=>{if(s.preventDefault(),s.stopPropagation(),!r.current){r.current=true,i(true);try{await o(e);}finally{r.current=false,i(false);}}},children:n?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Download,{className:"size-4","aria-hidden":"true"})})}a(D4,"ArtifactDownloadButton");function hb({icon:e,title:t,open:o,streaming:r,className:n,triggerClassName:i,contentClassName:s,children:l}){return jsxRuntime.jsxs("details",{className:De("group min-w-0 overflow-hidden rounded-lg border border-border bg-card text-card-foreground",n),open:o,children:[jsxRuntime.jsxs("summary",{className:De("flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm font-medium outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",i),children:[r?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 shrink-0 animate-spin","aria-hidden":"true"}):jsxRuntime.jsx(e,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180","aria-hidden":"true"})]}),jsxRuntime.jsx("div",{className:De("min-w-0 border-t border-border px-3 py-3 text-sm",s),children:l})]})}a(hb,"ActivityDetails");function H0({status:e}){return e==="completed"||e==="passed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"size-4 text-success","aria-hidden":"true"}):e==="failed"?jsxRuntime.jsx(lucideReact.XCircle,{className:"size-4 text-destructive-text","aria-hidden":"true"}):e==="running"?jsxRuntime.jsx(lucideReact.Clock3,{className:"size-4 animate-pulse text-warning-foreground","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Circle,{className:"size-4 text-muted-foreground","aria-hidden":"true"})}a(H0,"StatusIcon");function P4(e){if(e<1e3)return "<1s";let t=Math.floor(e/1e3),o=Math.floor(t/60),r=t%60;return o>0?`${o}m ${r}s`:`${r}s`}a(P4,"formatDuration");function E4({event:e}){let t=Ye().agentWorkbench,o=e.payload.status;return o!=="stopping"&&o!=="stopped"?null:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",role:"status",children:[o==="stopping"?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.CircleStop,{className:"size-4","aria-hidden":"true"}),jsxRuntime.jsx("span",{children:o==="stopping"?t.run.stopping:t.run.stoppedAfter({duration:P4(e.payload.durationMs??e.resolvedDurationMs??0)})})]})}a(E4,"RunStatus");function V0({viewModel:e,ariaLabel:t,hiddenToolCallIds:o,hideReasoning:r=false,hideStoppedRun:n=false,className:i,classNames:s,onApprovalDecision:l,onArtifactOpen:d,onArtifactDownload:c}){let p=Ye().agentWorkbench;if(!e)return null;let u=Zu(e),g=r?[]:u.reasoning,f=u.tools.filter(v=>!o?.has(v.payload.toolCallId)),b=u.approvals.filter(v=>!v.payload.toolCallId||!o?.has(v.payload.toolCallId)),x=u.usage?.payload,y=typeof x?.contextWindow=="number"&&x.contextWindow>0?x.contextWindow:void 0,k=u.run?.payload.status==="stopping"||u.run?.payload.status==="stopped"&&!n;return g.length>0||u.plans.length>0||u.tasks.length>0||f.length>0||b.length>0||u.artifacts.length>0||k||y!==void 0?jsxRuntime.jsxs("section",{className:De("space-y-3",s?.root,i),"aria-label":t??p.label,"data-agent-workbench-mode":u.mode,"data-agent-workbench-status":u.status,children:[g.map(v=>jsxRuntime.jsx(hb,{icon:lucideReact.Circle,title:p.reasoning,open:v.payload.status==="streaming",streaming:v.payload.status==="streaming",className:s?.item,triggerClassName:s?.trigger,contentClassName:s?.content,children:jsxRuntime.jsx("div",{tabIndex:0,className:"max-h-64 overflow-auto whitespace-pre-wrap break-words text-muted-foreground [overflow-wrap:anywhere]",children:v.payload.text})},v.payload.reasoningId)),u.plans.map(v=>jsxRuntime.jsx(hb,{icon:lucideReact.Circle,title:v.payload.title||p.plan,open:v.payload.status==="running",streaming:v.payload.status==="running",className:s?.item,triggerClassName:s?.trigger,contentClassName:s?.content,children:jsxRuntime.jsx("ol",{className:"space-y-2",children:v.payload.steps.map(h=>jsxRuntime.jsxs("li",{className:"flex min-w-0 items-start gap-2",children:[jsxRuntime.jsx(H0,{status:h.status}),jsxRuntime.jsx("span",{className:"min-w-0 break-words [overflow-wrap:anywhere]",children:h.title})]},h.id))})},v.payload.planId)),u.tasks.map(v=>jsxRuntime.jsx(hb,{icon:lucideReact.Circle,title:v.payload.title,open:v.payload.status==="running",streaming:v.payload.status==="running",className:s?.item,triggerClassName:s?.trigger,contentClassName:s?.content,children:jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[jsxRuntime.jsx(H0,{status:v.payload.status}),jsxRuntime.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-words text-muted-foreground [overflow-wrap:anywhere]",children:v.payload.detail||p.taskNoDetail})]})},v.payload.taskId)),f.map(v=>jsxRuntime.jsx(Ju,{event:v,defaultExpanded:v.payload.status==="failed",classNames:{root:s?.item,trigger:s?.trigger,content:s?.content}},v.payload.toolCallId)),b.map(v=>jsxRuntime.jsx(O0,{approval:v.payload,className:s?.approval,onDecision:l},v.payload.approvalId)),u.artifacts.map(v=>{let h=!!(v.payload.url&&d);return jsxRuntime.jsxs("article",{className:De("flex items-center gap-3 rounded-lg border border-border bg-card p-3 text-card-foreground",s?.artifact),children:[jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:"truncate text-sm font-medium",children:v.payload.name}),jsxRuntime.jsx("div",{className:"text-xs text-muted-foreground",children:p.artifact[v.payload.status]})]}),v.payload.url?jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground","aria-label":p.artifact.open({name:v.payload.name}),title:p.artifact.open({name:v.payload.name}),disabled:!h,onClick:S=>{S.preventDefault(),S.stopPropagation(),v.payload.url&&d?.({artifactId:v.payload.artifactId,name:v.payload.name,url:v.payload.url});},children:jsxRuntime.jsx(lucideReact.PanelRightOpen,{className:"size-4","aria-hidden":"true"})}):null,v.payload.url&&v.payload.status==="ready"&&c?jsxRuntime.jsx(D4,{artifact:{artifactId:v.payload.artifactId,name:v.payload.name,url:v.payload.url},label:p.artifactWorkspace.download({name:v.payload.name}),onDownload:c}):null]},v.payload.artifactId)}),k&&u.run?jsxRuntime.jsx(E4,{event:u.run}):null,x&&y!==void 0?jsxRuntime.jsx("div",{className:De("flex justify-end",s?.usage),"aria-label":p.usage.label,children:jsxRuntime.jsx("span",{className:"rounded-full border border-border bg-muted px-2.5 py-1 text-xs text-foreground",children:p.usage.context({used:x.contextTokens??x.totalTokens??0,total:y})})}):null]}):null}a(V0,"AgentWorkbenchActivity");var A4={diff:"diff","workspace-file":"workspaceFiles",terminal:"terminal","test-result":"testResults",artifact:"artifacts"};function tp(e,t,o){let r=new Map;for(let n of e){if(n.eventType!==t)continue;let i=n;r.set(o(i),i);}return [...r.values()].sort((n,i)=>n.sequence-i.sequence)}a(tp,"latestBy");function B4(e){let t=new Map;for(let o of e){let r=t.get(o.payload.terminalId)??{terminalId:o.payload.terminalId,stdin:"",stdout:"",stderr:"",status:"",sequence:o.sequence},n=o.payload.stream;t.set(o.payload.terminalId,{...r,...n==="status"?{status:o.payload.chunk}:{[n]:`${r[n]}${o.payload.chunk}`},...o.payload.exitCode===void 0?{}:{exitCode:o.payload.exitCode},sequence:o.sequence});}return [...t.values()].sort((o,r)=>o.sequence-r.sequence)}a(B4,"projectTerminals");function op(e){let t=e.snapshot.capabilities,o=e.events.filter(s=>{let l=A4[s.eventType];return l?t[l]===true:false}),r=[...e.events].reverse().find(s=>s.eventType==="status"),n=r?.runId,i=[...e.events].reverse().find(s=>s.eventType==="summary"&&t.summary===true&&(!n||s.runId===n));return {mode:e.snapshot.mode,modelId:e.snapshot.modelId,permissionProfile:e.snapshot.permissionProfile,status:e.status,sessionId:e.sessionId,capabilities:t,resumable:t.resume===true&&e.resumable,summary:i,error:[...e.events].reverse().find(s=>s.eventType==="error"),run:r,usage:t.usage?[...e.events].reverse().find(s=>s.eventType==="usage"):void 0,workspace:{diffs:tp(o,"diff",s=>s.payload.path),files:tp(o,"workspace-file",s=>s.payload.path),terminals:B4(o.filter(s=>s.eventType==="terminal")),tests:tp(o,"test-result",s=>s.payload.testId),artifacts:tp(o,"artifact",s=>s.payload.artifactId)}}}a(op,"createAgentWorkbenchDetailsModel");function G0(e){if(e===void 0)return "-";let t=Math.max(0,Math.round(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}a(G0,"formatDuration");function Z4(e,t){if(!e)return "-";let o=new Date(e);return Number.isNaN(o.getTime())?"-":new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"short"}).format(o)}a(Z4,"formatDate");function $0({value:e}){return jsxRuntime.jsx("span",{className:"rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-semibold text-foreground",children:e})}a($0,"Count");function Rl({title:e,count:t,icon:o,className:r,children:n}){return t===0?null:jsxRuntime.jsxs("details",{className:De("group rounded-lg border border-border bg-card text-card-foreground",r),open:true,children:[jsxRuntime.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm font-medium outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:[jsxRuntime.jsx(o,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:e}),jsxRuntime.jsx($0,{value:t}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-180","aria-hidden":"true"})]}),jsxRuntime.jsx("div",{className:"border-t border-border p-3",children:n})]})}a(Rl,"DetailsSection");function j0({status:e}){return e==="completed"||e==="passed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"size-4 text-primary","aria-hidden":"true"}):e==="failed"?jsxRuntime.jsx(lucideReact.XCircle,{className:"size-4 text-destructive-text","aria-hidden":"true"}):e==="running"?jsxRuntime.jsx(lucideReact.Clock3,{className:"size-4 animate-pulse","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Circle,{className:"size-4 text-muted-foreground","aria-hidden":"true"})}a(j0,"StatusIcon");function _0({state:e}){let t=Ye().agentWorkbench.details,o=e==="error";return jsxRuntime.jsxs("div",{className:"flex min-h-48 flex-col items-center justify-center gap-2 px-6 text-center",role:o?"alert":e==="loading"?"status":void 0,"aria-busy":e==="loading"||void 0,children:[e==="loading"?jsxRuntime.jsx(lucideReact.RefreshCw,{className:"size-5 animate-spin text-muted-foreground","aria-hidden":"true"}):o?jsxRuntime.jsx(lucideReact.AlertCircle,{className:"size-5 text-destructive-text","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-5 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"text-sm font-medium",children:t.state[e].title}),jsxRuntime.jsx("div",{className:"text-xs text-muted-foreground",children:t.state[e].description})]})}a(_0,"StateContent");function J4({model:e,onIntent:t}){let o=Ye().agentWorkbench,r=o.details,n=Co().locale,i=e.summary,s=e.run?.payload,l=e.error,d=e.status==="failed"&&l?.payload.retryable,c=e.resumable&&["stopped","completed","failed"].includes(e.status),p=e.capabilities.threadForking,u=e.capabilities.editAndRerun,g=e.usage?.payload.totalTokens??(e.usage?.payload.inputTokens!==void 0||e.usage?.payload.outputTokens!==void 0?(e.usage.payload.inputTokens??0)+(e.usage.payload.outputTokens??0):void 0);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("section",{className:"rounded-lg border border-border bg-muted/40 p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(j0,{status:e.status}),jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:r.status[e.status]})]}),jsxRuntime.jsxs("dl",{className:"mt-3 grid grid-cols-2 gap-3 text-xs",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.duration}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:G0(s?.durationMs)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.updated}),jsxRuntime.jsx("dd",{className:"mt-0.5 truncate font-medium",children:Z4(s?.stoppedAt??s?.completedAt??s?.failedAt,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.model}),jsxRuntime.jsx("dd",{className:"mt-0.5 truncate font-medium",children:e.modelId})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.mode}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:o.modes[e.mode]})]}),e.permissionProfile?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.permissions}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:o.composer.permissionOptions[e.permissionProfile]})]}):null,g!==void 0?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.tokenUsage}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:new Intl.NumberFormat(n).format(g)})]}):null]}),l?jsxRuntime.jsx("div",{className:"mt-3 rounded-md border border-destructive/30 bg-destructive/5 p-2.5 text-sm text-destructive-text",role:"alert",children:l.payload.message}):null,d||c?jsxRuntime.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[d?jsxRuntime.jsx(mt,{type:"button",variant:"outline",size:"sm",className:"h-auto px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"retry",eventId:l.eventId}),children:r.actions.retry}):null,c?jsxRuntime.jsx(mt,{type:"button",size:"sm",className:"h-auto px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"resume",sessionId:e.sessionId}),children:r.actions.resume}):null]}):null]}),jsxRuntime.jsxs("section",{className:"flex flex-wrap gap-2 rounded-lg border border-border bg-card p-3 text-card-foreground",children:[p?jsxRuntime.jsxs(mt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"continue-in-new-task",sessionId:e.sessionId}),children:[jsxRuntime.jsx(lucideReact.GitFork,{className:"size-3.5","aria-hidden":"true"}),r.actions.continueInNewTask]}):null,u?jsxRuntime.jsxs(mt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"edit-and-rerun",sessionId:e.sessionId}),children:[jsxRuntime.jsx(lucideReact.PencilLine,{className:"size-3.5","aria-hidden":"true"}),r.actions.editAndRerun]}):null,jsxRuntime.jsxs(mt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"export",sessionId:e.sessionId}),children:[jsxRuntime.jsx(lucideReact.Download,{className:"size-3.5","aria-hidden":"true"}),r.actions.export]})]}),jsxRuntime.jsxs("section",{className:"rounded-lg border border-border bg-card p-3 text-card-foreground",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold",children:r.summary}),i?.payload.text?jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon",className:"size-8 text-muted-foreground hover:text-foreground","aria-label":r.actions.copySummary,disabled:!t,onClick:()=>t?.({type:"copy-summary",summaryId:i.payload.summaryId,text:i.payload.text}),children:jsxRuntime.jsx(lucideReact.Copy,{className:"size-4","aria-hidden":"true"})}):null]}),i?.payload.status==="failed"?jsxRuntime.jsxs("div",{className:"mt-3 space-y-2",children:[jsxRuntime.jsx("p",{className:"text-sm text-destructive-text",role:"alert",children:r.summaryFailed}),jsxRuntime.jsxs(mt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"retry-summary",eventId:i.eventId}),children:[jsxRuntime.jsx(lucideReact.RotateCcw,{className:"size-3.5","aria-hidden":"true"}),r.actions.retrySummary]})]}):i?.payload.text?jsxRuntime.jsxs("div",{className:"mt-3 space-y-3 text-sm",children:[jsxRuntime.jsx("p",{className:"whitespace-pre-wrap text-muted-foreground",children:i.payload.text}),i.payload.highlights.length>0?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h4",{className:"text-xs font-medium",children:r.highlights}),jsxRuntime.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-5 text-muted-foreground",children:i.payload.highlights.map(f=>jsxRuntime.jsx("li",{children:f},f))})]}):null,i.payload.pendingItems.length>0?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h4",{className:"text-xs font-medium",children:r.pendingItems}),jsxRuntime.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-5 text-muted-foreground",children:i.payload.pendingItems.map(f=>jsxRuntime.jsx("li",{children:f},f))})]}):null]}):jsxRuntime.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:r.summaryEmpty})]})]})}a(J4,"SummaryPanel");function ez({model:e,sectionClassName:t,codeClassName:o}){let r=Ye().agentWorkbench.details.workspace,n=e.workspace;return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx(Rl,{title:r.diffs,count:n.diffs.length,icon:lucideReact.FileCode2,className:t,children:jsxRuntime.jsx("div",{className:"space-y-3",children:n.diffs.map(i=>jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[jsxRuntime.jsx("span",{className:"truncate font-medium",children:i.payload.path}),jsxRuntime.jsx("span",{className:"shrink-0 text-muted-foreground",children:r.diffStatus[i.payload.status]})]}),i.payload.patch?jsxRuntime.jsx("pre",{className:De("mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs",o),children:i.payload.patch}):null]},i.payload.path))})}),jsxRuntime.jsx(Rl,{title:r.files,count:n.files.length,icon:lucideReact.Files,className:t,children:jsxRuntime.jsx("ul",{className:"space-y-2 text-xs",children:n.files.map(i=>jsxRuntime.jsxs("li",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-3.5 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.payload.path}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r.fileOperation[i.payload.operation]})]},i.payload.path))})}),jsxRuntime.jsx(Rl,{title:r.terminals,count:n.terminals.length,icon:lucideReact.TerminalSquare,className:t,children:jsxRuntime.jsx("div",{className:"space-y-3",children:n.terminals.map(i=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between gap-2 text-xs font-medium",children:[jsxRuntime.jsx("span",{children:i.terminalId}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i.exitCode===void 0?i.status:r.exitCode({code:i.exitCode})})]}),jsxRuntime.jsx("pre",{className:De("mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs",o),children:[i.stdin,i.stdout,i.stderr].filter(Boolean).join(`
|
|
66
|
+
var FS=Object.defineProperty;var a=(e,t)=>FS(e,"name",{value:t,configurable:true});var Wr=a((e,t=0,o=1)=>ni(ai(t,e),o),"default");var Na=a(e=>{e._clipped=false,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=true),e[t]=Wr(e[t],0,255)):t===3&&(e[t]=Wr(e[t],0,1));return e},"default");var dg={};for(let e of ["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])dg[`[object ${e}]`]=e.toLowerCase();function Qe(e){return dg[Object.prototype.toString.call(e)]||"object"}a(Qe,"default");var Ue=a((e,t=null)=>e.length>=3?Array.prototype.slice.call(e):Qe(e[0])=="object"&&t?t.split("").filter(o=>e[0][o]!==void 0).map(o=>e[0][o]):e[0],"default");var nn=a(e=>{if(e.length<2)return null;let t=e.length-1;return Qe(e[t])=="string"?e[t].toLowerCase():null},"default");var{PI:ql,min:ni,max:ai}=Math,tr=ql*2,Yl=ql/3,cg=ql/180,ug=180/ql;var Ze={format:{},autodetect:[]};var Ip=class Ip{constructor(...t){let o=this;if(Qe(t[0])==="object"&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];let r=nn(t),n=false;if(!r){n=true,Ze.sorted||(Ze.autodetect=Ze.autodetect.sort((i,s)=>s.p-i.p),Ze.sorted=true);for(let i of Ze.autodetect)if(r=i.test(...t),r)break}if(Ze.format[r]){let i=Ze.format[r].apply(null,n?t:t.slice(0,-1));o._rgb=Na(i);}else throw new Error("unknown format: "+t);o._rgb.length===3&&o._rgb.push(1);}toString(){return Qe(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};a(Ip,"Color");var Mp=Ip,ye=Mp;var pg="2.6.0";var Xl=a((...e)=>new Xl.Color(...e),"chroma");Xl.Color=ye;Xl.version=pg;var ot=Xl;var HS=a((...e)=>{e=Ue(e,"cmyk");let[t,o,r,n]=e,i=e.length>4?e[4]:1;return n===1?[0,0,0,i]:[t>=1?0:255*(1-t)*(1-n),o>=1?0:255*(1-o)*(1-n),r>=1?0:255*(1-r)*(1-n),i]},"cmyk2rgb"),mg=HS;var{max:fg}=Math,VS=a((...e)=>{let[t,o,r]=Ue(e,"rgb");t=t/255,o=o/255,r=r/255;let n=1-fg(t,fg(o,r)),i=n<1?1/(1-n):0,s=(1-t-n)*i,l=(1-o-n)*i,d=(1-r-n)*i;return [s,l,d,n]},"rgb2cmyk"),bg=VS;ye.prototype.cmyk=function(){return bg(this._rgb)};ot.cmyk=(...e)=>new ye(...e,"cmyk");Ze.format.cmyk=mg;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"cmyk"),Qe(e)==="array"&&e.length===4)return "cmyk"},"test")});var Dp=a(e=>Math.round(e*100)/100,"rnd"),_S=a((...e)=>{let t=Ue(e,"hsla"),o=nn(e)||"lsa";return t[0]=Dp(t[0]||0),t[1]=Dp(t[1]*100)+"%",t[2]=Dp(t[2]*100)+"%",o==="hsla"||t.length>3&&t[3]<1?(t[3]=t.length>3?t[3]:1,o="hsla"):t.length=3,`${o}(${t.join(",")})`},"hsl2css"),gg=_S;var GS=a((...e)=>{e=Ue(e,"rgba");let[t,o,r]=e;t/=255,o/=255,r/=255;let n=ni(t,o,r),i=ai(t,o,r),s=(i+n)/2,l,d;return i===n?(l=0,d=Number.NaN):l=s<.5?(i-n)/(i+n):(i-n)/(2-i-n),t==i?d=(o-r)/(i-n):o==i?d=2+(r-t)/(i-n):r==i&&(d=4+(t-o)/(i-n)),d*=60,d<0&&(d+=360),e.length>3&&e[3]!==void 0?[d,l,s,e[3]]:[d,l,s]},"rgb2hsl"),Ql=GS;var{round:Pp}=Math,$S=a((...e)=>{let t=Ue(e,"rgba"),o=nn(e)||"rgb";return o.substr(0,3)=="hsl"?gg(Ql(t),o):(t[0]=Pp(t[0]),t[1]=Pp(t[1]),t[2]=Pp(t[2]),(o==="rgba"||t.length>3&&t[3]<1)&&(t[3]=t.length>3?t[3]:1,o="rgba"),`${o}(${t.slice(0,o==="rgb"?3:4).join(",")})`)},"rgb2css"),hg=$S;var{round:Ep}=Math,jS=a((...e)=>{e=Ue(e,"hsl");let[t,o,r]=e,n,i,s;if(o===0)n=i=s=r*255;else {let l=[0,0,0],d=[0,0,0],c=r<.5?r*(1+o):r+o-r*o,p=2*r-c,u=t/360;l[0]=u+1/3,l[1]=u,l[2]=u-1/3;for(let g=0;g<3;g++)l[g]<0&&(l[g]+=1),l[g]>1&&(l[g]-=1),6*l[g]<1?d[g]=p+(c-p)*6*l[g]:2*l[g]<1?d[g]=c:3*l[g]<2?d[g]=p+(c-p)*(2/3-l[g])*6:d[g]=p;[n,i,s]=[Ep(d[0]*255),Ep(d[1]*255),Ep(d[2]*255)];}return e.length>3?[n,i,s,e[3]]:[n,i,s,1]},"hsl2rgb"),ys=jS;var xg=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,vg=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,wg=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,kg=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Cg=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Sg=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,{round:yg}=Math,Tg=a(e=>{e=e.toLowerCase().trim();let t;if(Ze.format.named)try{return Ze.format.named(e)}catch{}if(t=e.match(xg)){let o=t.slice(1,4);for(let r=0;r<3;r++)o[r]=+o[r];return o[3]=1,o}if(t=e.match(vg)){let o=t.slice(1,5);for(let r=0;r<4;r++)o[r]=+o[r];return o}if(t=e.match(wg)){let o=t.slice(1,4);for(let r=0;r<3;r++)o[r]=yg(o[r]*2.55);return o[3]=1,o}if(t=e.match(kg)){let o=t.slice(1,5);for(let r=0;r<3;r++)o[r]=yg(o[r]*2.55);return o[3]=+o[3],o}if(t=e.match(Cg)){let o=t.slice(1,4);o[1]*=.01,o[2]*=.01;let r=ys(o);return r[3]=1,r}if(t=e.match(Sg)){let o=t.slice(1,4);o[1]*=.01,o[2]*=.01;let r=ys(o);return r[3]=+t[4],r}},"css2rgb");Tg.test=e=>xg.test(e)||vg.test(e)||wg.test(e)||kg.test(e)||Cg.test(e)||Sg.test(e);var Ap=Tg;ye.prototype.css=function(e){return hg(this._rgb,e)};ot.css=(...e)=>new ye(...e,"css");Ze.format.css=Ap;Ze.autodetect.push({p:5,test:a((e,...t)=>{if(!t.length&&Qe(e)==="string"&&Ap.test(e))return "css"},"test")});Ze.format.gl=(...e)=>{let t=Ue(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};ot.gl=(...e)=>new ye(...e,"gl");ye.prototype.gl=function(){let e=this._rgb;return [e[0]/255,e[1]/255,e[2]/255,e[3]]};var{floor:US}=Math,KS=a((...e)=>{e=Ue(e,"hcg");let[t,o,r]=e,n,i,s;r=r*255;let l=o*255;if(o===0)n=i=s=r;else {t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let d=US(t),c=t-d,p=r*(1-o),u=p+l*(1-c),g=p+l*c,f=p+l;switch(d){case 0:[n,i,s]=[f,g,p];break;case 1:[n,i,s]=[u,f,p];break;case 2:[n,i,s]=[p,f,g];break;case 3:[n,i,s]=[p,u,f];break;case 4:[n,i,s]=[g,p,f];break;case 5:[n,i,s]=[f,p,u];break}}return [n,i,s,e.length>3?e[3]:1]},"hcg2rgb"),Ng=KS;var qS=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),n=ni(t,o,r),i=ai(t,o,r),s=i-n,l=s*100/255,d=n/(255-s)*100,c;return s===0?c=Number.NaN:(t===i&&(c=(o-r)/s),o===i&&(c=2+(r-t)/s),r===i&&(c=4+(t-o)/s),c*=60,c<0&&(c+=360)),[c,l,d]},"rgb2hcg"),Rg=qS;ye.prototype.hcg=function(){return Rg(this._rgb)};ot.hcg=(...e)=>new ye(...e,"hcg");Ze.format.hcg=Ng;Ze.autodetect.push({p:1,test:a((...e)=>{if(e=Ue(e,"hcg"),Qe(e)==="array"&&e.length===3)return "hcg"},"test")});var YS=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,XS=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,QS=a(e=>{if(e.match(YS)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let t=parseInt(e,16),o=t>>16,r=t>>8&255,n=t&255;return [o,r,n,1]}if(e.match(XS)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);let t=parseInt(e,16),o=t>>24&255,r=t>>16&255,n=t>>8&255,i=Math.round((t&255)/255*100)/100;return [o,r,n,i]}throw new Error(`unknown hex color: ${e}`)},"hex2rgb"),Zl=QS;var{round:Jl}=Math,ZS=a((...e)=>{let[t,o,r,n]=Ue(e,"rgba"),i=nn(e)||"auto";n===void 0&&(n=1),i==="auto"&&(i=n<1?"rgba":"rgb"),t=Jl(t),o=Jl(o),r=Jl(r);let l="000000"+(t<<16|o<<8|r).toString(16);l=l.substr(l.length-6);let d="0"+Jl(n*255).toString(16);switch(d=d.substr(d.length-2),i.toLowerCase()){case "rgba":return `#${l}${d}`;case "argb":return `#${d}${l}`;default:return `#${l}`}},"rgb2hex"),ed=ZS;ye.prototype.hex=function(e){return ed(this._rgb,e)};ot.hex=(...e)=>new ye(...e,"hex");Ze.format.hex=Zl;Ze.autodetect.push({p:4,test:a((e,...t)=>{if(!t.length&&Qe(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return "hex"},"test")});var{cos:ii}=Math,JS=a((...e)=>{e=Ue(e,"hsi");let[t,o,r]=e,n,i,s;return isNaN(t)&&(t=0),isNaN(o)&&(o=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(s=(1-o)/3,n=(1+o*ii(tr*t)/ii(Yl-tr*t))/3,i=1-(s+n)):t<2/3?(t-=1/3,n=(1-o)/3,i=(1+o*ii(tr*t)/ii(Yl-tr*t))/3,s=1-(n+i)):(t-=2/3,i=(1-o)/3,s=(1+o*ii(tr*t)/ii(Yl-tr*t))/3,n=1-(i+s)),n=Wr(r*n*3),i=Wr(r*i*3),s=Wr(r*s*3),[n*255,i*255,s*255,e.length>3?e[3]:1]},"hsi2rgb"),Mg=JS;var{min:e1,sqrt:t1,acos:o1}=Math,r1=a((...e)=>{let[t,o,r]=Ue(e,"rgb");t/=255,o/=255,r/=255;let n,i=e1(t,o,r),s=(t+o+r)/3,l=s>0?1-i/s:0;return l===0?n=NaN:(n=(t-o+(t-r))/2,n/=t1((t-o)*(t-o)+(t-r)*(o-r)),n=o1(n),r>o&&(n=tr-n),n/=tr),[n*360,l,s]},"rgb2hsi"),Ig=r1;ye.prototype.hsi=function(){return Ig(this._rgb)};ot.hsi=(...e)=>new ye(...e,"hsi");Ze.format.hsi=Mg;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"hsi"),Qe(e)==="array"&&e.length===3)return "hsi"},"test")});ye.prototype.hsl=function(){return Ql(this._rgb)};ot.hsl=(...e)=>new ye(...e,"hsl");Ze.format.hsl=ys;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"hsl"),Qe(e)==="array"&&e.length===3)return "hsl"},"test")});var{floor:n1}=Math,a1=a((...e)=>{e=Ue(e,"hsv");let[t,o,r]=e,n,i,s;if(r*=255,o===0)n=i=s=r;else {t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let l=n1(t),d=t-l,c=r*(1-o),p=r*(1-o*d),u=r*(1-o*(1-d));switch(l){case 0:[n,i,s]=[r,u,c];break;case 1:[n,i,s]=[p,r,c];break;case 2:[n,i,s]=[c,r,u];break;case 3:[n,i,s]=[c,p,r];break;case 4:[n,i,s]=[u,c,r];break;case 5:[n,i,s]=[r,c,p];break}}return [n,i,s,e.length>3?e[3]:1]},"hsv2rgb"),Dg=a1;var{min:i1,max:s1}=Math,l1=a((...e)=>{e=Ue(e,"rgb");let[t,o,r]=e,n=i1(t,o,r),i=s1(t,o,r),s=i-n,l,d,c;return c=i/255,i===0?(l=Number.NaN,d=0):(d=s/i,t===i&&(l=(o-r)/s),o===i&&(l=2+(r-t)/s),r===i&&(l=4+(t-o)/s),l*=60,l<0&&(l+=360)),[l,d,c]},"rgb2hsl"),Pg=l1;ye.prototype.hsv=function(){return Pg(this._rgb)};ot.hsv=(...e)=>new ye(...e,"hsv");Ze.format.hsv=Dg;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"hsv"),Qe(e)==="array"&&e.length===3)return "hsv"},"test")});var ao={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452};var{pow:d1}=Math,c1=a((...e)=>{e=Ue(e,"lab");let[t,o,r]=e,n,i,s,l,d,c;return i=(t+16)/116,n=isNaN(o)?i:i+o/500,s=isNaN(r)?i:i-r/200,i=ao.Yn*Lp(i),n=ao.Xn*Lp(n),s=ao.Zn*Lp(s),l=Bp(3.2404542*n-1.5371385*i-.4985314*s),d=Bp(-0.969266*n+1.8760108*i+.041556*s),c=Bp(.0556434*n-.2040259*i+1.0572252*s),[l,d,c,e.length>3?e[3]:1]},"lab2rgb"),Bp=a(e=>255*(e<=.00304?12.92*e:1.055*d1(e,1/2.4)-.055),"xyz_rgb"),Lp=a(e=>e>ao.t1?e*e*e:ao.t2*(e-ao.t0),"lab_xyz"),td=c1;var{pow:Eg}=Math,u1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=p1(t,o,r),l=116*i-16;return [l<0?0:l,500*(n-i),200*(i-s)]},"rgb2lab"),Wp=a(e=>(e/=255)<=.04045?e/12.92:Eg((e+.055)/1.055,2.4),"rgb_xyz"),zp=a(e=>e>ao.t3?Eg(e,1/3):e/ao.t2+ao.t0,"xyz_lab"),p1=a((e,t,o)=>{e=Wp(e),t=Wp(t),o=Wp(o);let r=zp((.4124564*e+.3575761*t+.1804375*o)/ao.Xn),n=zp((.2126729*e+.7151522*t+.072175*o)/ao.Yn),i=zp((.0193339*e+.119192*t+.9503041*o)/ao.Zn);return [r,n,i]},"rgb2xyz"),od=u1;ye.prototype.lab=function(){return od(this._rgb)};ot.lab=(...e)=>new ye(...e,"lab");Ze.format.lab=td;Ze.autodetect.push({p:2,test:a((...e)=>{if(e=Ue(e,"lab"),Qe(e)==="array"&&e.length===3)return "lab"},"test")});var{sin:m1,cos:f1}=Math,b1=a((...e)=>{let[t,o,r]=Ue(e,"lch");return isNaN(r)&&(r=0),r=r*cg,[t,f1(r)*o,m1(r)*o]},"lch2lab"),rd=b1;var g1=a((...e)=>{e=Ue(e,"lch");let[t,o,r]=e,[n,i,s]=rd(t,o,r),[l,d,c]=td(n,i,s);return [l,d,c,e.length>3?e[3]:1]},"lch2rgb"),nd=g1;var h1=a((...e)=>{let t=Ue(e,"hcl").reverse();return nd(...t)},"hcl2rgb"),Ag=h1;var{sqrt:y1,atan2:x1,round:v1}=Math,w1=a((...e)=>{let[t,o,r]=Ue(e,"lab"),n=y1(o*o+r*r),i=(x1(r,o)*ug+360)%360;return v1(n*1e4)===0&&(i=Number.NaN),[t,n,i]},"lab2lch"),ad=w1;var k1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=od(t,o,r);return ad(n,i,s)},"rgb2lch"),Op=k1;ye.prototype.lch=function(){return Op(this._rgb)};ye.prototype.hcl=function(){return Op(this._rgb).reverse()};ot.lch=(...e)=>new ye(...e,"lch");ot.hcl=(...e)=>new ye(...e,"hcl");Ze.format.lch=nd;Ze.format.hcl=Ag;["lch","hcl"].forEach(e=>Ze.autodetect.push({p:2,test:a((...t)=>{if(t=Ue(t,e),Qe(t)==="array"&&t.length===3)return e},"test")}));var C1={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Bn=C1;ye.prototype.name=function(){let e=ed(this._rgb,"rgb");for(let t of Object.keys(Bn))if(Bn[t]===e)return t.toLowerCase();return e};Ze.format.named=e=>{if(e=e.toLowerCase(),Bn[e])return Zl(Bn[e]);throw new Error("unknown color name: "+e)};Ze.autodetect.push({p:5,test:a((e,...t)=>{if(!t.length&&Qe(e)==="string"&&Bn[e.toLowerCase()])return "named"},"test")});var S1=a(e=>{if(Qe(e)=="number"&&e>=0&&e<=16777215){let t=e>>16,o=e>>8&255,r=e&255;return [t,o,r,1]}throw new Error("unknown num color: "+e)},"num2rgb"),Bg=S1;var T1=a((...e)=>{let[t,o,r]=Ue(e,"rgb");return (t<<16)+(o<<8)+r},"rgb2num"),Lg=T1;ye.prototype.num=function(){return Lg(this._rgb)};ot.num=(...e)=>new ye(...e,"num");Ze.format.num=Bg;Ze.autodetect.push({p:5,test:a((...e)=>{if(e.length===1&&Qe(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return "num"},"test")});var{round:Wg}=Math;ye.prototype.rgb=function(e=true){return e===false?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Wg)};ye.prototype.rgba=function(e=true){return this._rgb.slice(0,4).map((t,o)=>o<3?e===false?t:Wg(t):t)};ot.rgb=(...e)=>new ye(...e,"rgb");Ze.format.rgb=(...e)=>{let t=Ue(e,"rgba");return t[3]===void 0&&(t[3]=1),t};Ze.autodetect.push({p:3,test:a((...e)=>{if(e=Ue(e,"rgba"),Qe(e)==="array"&&(e.length===3||e.length===4&&Qe(e[3])=="number"&&e[3]>=0&&e[3]<=1))return "rgb"},"test")});var{log:id}=Math,N1=a(e=>{let t=e/100,o,r,n;return t<66?(o=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*id(r),n=t<20?0:-254.76935184120902+.8274096064007395*(n=t-10)+115.67994401066147*id(n)):(o=351.97690566805693+.114206453784165*(o=t-55)-40.25366309332127*id(o),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*id(r),n=255),[o,r,n,1]},"temperature2rgb"),sd=N1;var{round:R1}=Math,M1=a((...e)=>{let t=Ue(e,"rgb"),o=t[0],r=t[2],n=1e3,i=4e4,s=.4,l;for(;i-n>s;){l=(i+n)*.5;let d=sd(l);d[2]/d[0]>=r/o?i=l:n=l;}return R1(l)},"rgb2temperature"),zg=M1;ye.prototype.temp=ye.prototype.kelvin=ye.prototype.temperature=function(){return zg(this._rgb)};ot.temp=ot.kelvin=ot.temperature=(...e)=>new ye(...e,"temp");Ze.format.temp=Ze.format.kelvin=Ze.format.temperature=sd;var{pow:ld,sign:I1}=Math,D1=a((...e)=>{e=Ue(e,"lab");let[t,o,r]=e,n=ld(t+.3963377774*o+.2158037573*r,3),i=ld(t-.1055613458*o-.0638541728*r,3),s=ld(t-.0894841775*o-1.291485548*r,3);return [255*Fp(4.0767416621*n-3.3077115913*i+.2309699292*s),255*Fp(-1.2684380046*n+2.6097574011*i-.3413193965*s),255*Fp(-0.0041960863*n-.7034186147*i+1.707614701*s),e.length>3?e[3]:1]},"oklab2rgb"),dd=D1;function Fp(e){let t=Math.abs(e);return t>.0031308?(I1(e)||1)*(1.055*ld(t,1/2.4)-.055):e*12.92}a(Fp,"lrgb2rgb");var{cbrt:Hp,pow:P1,sign:E1}=Math,A1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=[Vp(t/255),Vp(o/255),Vp(r/255)],l=Hp(.4122214708*n+.5363325363*i+.0514459929*s),d=Hp(.2119034982*n+.6806995451*i+.1073969566*s),c=Hp(.0883024619*n+.2817188376*i+.6299787005*s);return [.2104542553*l+.793617785*d-.0040720468*c,1.9779984951*l-2.428592205*d+.4505937099*c,.0259040371*l+.7827717662*d-.808675766*c]},"rgb2oklab"),cd=A1;function Vp(e){let t=Math.abs(e);return t<.04045?e/12.92:(E1(e)||1)*P1((t+.055)/1.055,2.4)}a(Vp,"rgb2lrgb");ye.prototype.oklab=function(){return cd(this._rgb)};ot.oklab=(...e)=>new ye(...e,"oklab");Ze.format.oklab=dd;Ze.autodetect.push({p:3,test:a((...e)=>{if(e=Ue(e,"oklab"),Qe(e)==="array"&&e.length===3)return "oklab"},"test")});var B1=a((...e)=>{e=Ue(e,"lch");let[t,o,r]=e,[n,i,s]=rd(t,o,r),[l,d,c]=dd(n,i,s);return [l,d,c,e.length>3?e[3]:1]},"oklch2rgb"),Og=B1;var L1=a((...e)=>{let[t,o,r]=Ue(e,"rgb"),[n,i,s]=cd(t,o,r);return ad(n,i,s)},"rgb2oklch"),Fg=L1;ye.prototype.oklch=function(){return Fg(this._rgb)};ot.oklch=(...e)=>new ye(...e,"oklch");Ze.format.oklch=Og;Ze.autodetect.push({p:3,test:a((...e)=>{if(e=Ue(e,"oklch"),Qe(e)==="array"&&e.length===3)return "oklch"},"test")});ye.prototype.alpha=function(e,t=false){return e!==void 0&&Qe(e)==="number"?t?(this._rgb[3]=e,this):new ye([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]};ye.prototype.clipped=function(){return this._rgb._clipped||false};ye.prototype.darken=function(e=1){let t=this,o=t.lab();return o[0]-=ao.Kn*e,new ye(o,"lab").alpha(t.alpha(),true)};ye.prototype.brighten=function(e=1){return this.darken(-e)};ye.prototype.darker=ye.prototype.darken;ye.prototype.brighter=ye.prototype.brighten;ye.prototype.get=function(e){let[t,o]=e.split("."),r=this[t]();if(o){let n=t.indexOf(o)-(t.substr(0,2)==="ok"?2:0);if(n>-1)return r[n];throw new Error(`unknown channel ${o} in mode ${t}`)}else return r};var{pow:W1}=Math,z1=1e-7,O1=20;ye.prototype.luminance=function(e,t="rgb"){if(e!==void 0&&Qe(e)==="number"){if(e===0)return new ye([0,0,0,this._rgb[3]],"rgb");if(e===1)return new ye([255,255,255,this._rgb[3]],"rgb");let o=this.luminance(),r=O1,n=a((s,l)=>{let d=s.interpolate(l,.5,t),c=d.luminance();return Math.abs(e-c)<z1||!r--?d:c>e?n(s,d):n(d,l)},"test"),i=(o>e?n(new ye([0,0,0]),this):n(this,new ye([255,255,255]))).rgb();return new ye([...i,this._rgb[3]])}return F1(...this._rgb.slice(0,3))};var F1=a((e,t,o)=>(e=_p(e),t=_p(t),o=_p(o),.2126*e+.7152*t+.0722*o),"rgb2luminance"),_p=a(e=>(e/=255,e<=.03928?e/12.92:W1((e+.055)/1.055,2.4)),"luminance_x");var Pt={};var Ln=a((e,t,o=.5,...r)=>{let n=r[0]||"lrgb";if(!Pt[n]&&!r.length&&(n=Object.keys(Pt)[0]),!Pt[n])throw new Error(`interpolation mode ${n} is not defined`);return Qe(e)!=="object"&&(e=new ye(e)),Qe(t)!=="object"&&(t=new ye(t)),Pt[n](e,t,o).alpha(e.alpha()+o*(t.alpha()-e.alpha()))},"default");ye.prototype.mix=ye.prototype.interpolate=function(e,t=.5,...o){return Ln(this,e,t,...o)};ye.prototype.premultiply=function(e=false){let t=this._rgb,o=t[3];return e?(this._rgb=[t[0]*o,t[1]*o,t[2]*o,o],this):new ye([t[0]*o,t[1]*o,t[2]*o,o],"rgb")};ye.prototype.saturate=function(e=1){let t=this,o=t.lch();return o[1]+=ao.Kn*e,o[1]<0&&(o[1]=0),new ye(o,"lch").alpha(t.alpha(),true)};ye.prototype.desaturate=function(e=1){return this.saturate(-e)};ye.prototype.set=function(e,t,o=false){let[r,n]=e.split("."),i=this[r]();if(n){let s=r.indexOf(n)-(r.substr(0,2)==="ok"?2:0);if(s>-1){if(Qe(t)=="string")switch(t.charAt(0)){case "+":i[s]+=+t;break;case "-":i[s]+=+t;break;case "*":i[s]*=+t.substr(1);break;case "/":i[s]/=+t.substr(1);break;default:i[s]=+t;}else if(Qe(t)==="number")i[s]=t;else throw new Error("unsupported value for Color.set");let l=new ye(i,r);return o?(this._rgb=l._rgb,this):l}throw new Error(`unknown channel ${n} in mode ${r}`)}else return i};ye.prototype.tint=function(e=.5,...t){return Ln(this,"white",e,...t)};ye.prototype.shade=function(e=.5,...t){return Ln(this,"black",e,...t)};var H1=a((e,t,o)=>{let r=e._rgb,n=t._rgb;return new ye(r[0]+o*(n[0]-r[0]),r[1]+o*(n[1]-r[1]),r[2]+o*(n[2]-r[2]),"rgb")},"rgb");Pt.rgb=H1;var{sqrt:Gp,pow:si}=Math,V1=a((e,t,o)=>{let[r,n,i]=e._rgb,[s,l,d]=t._rgb;return new ye(Gp(si(r,2)*(1-o)+si(s,2)*o),Gp(si(n,2)*(1-o)+si(l,2)*o),Gp(si(i,2)*(1-o)+si(d,2)*o),"rgb")},"lrgb");Pt.lrgb=V1;var _1=a((e,t,o)=>{let r=e.lab(),n=t.lab();return new ye(r[0]+o*(n[0]-r[0]),r[1]+o*(n[1]-r[1]),r[2]+o*(n[2]-r[2]),"lab")},"lab");Pt.lab=_1;var or=a((e,t,o,r)=>{let n,i;r==="hsl"?(n=e.hsl(),i=t.hsl()):r==="hsv"?(n=e.hsv(),i=t.hsv()):r==="hcg"?(n=e.hcg(),i=t.hcg()):r==="hsi"?(n=e.hsi(),i=t.hsi()):r==="lch"||r==="hcl"?(r="hcl",n=e.hcl(),i=t.hcl()):r==="oklch"&&(n=e.oklch().reverse(),i=t.oklch().reverse());let s,l,d,c,p,u;(r.substr(0,1)==="h"||r==="oklch")&&([s,d,p]=n,[l,c,u]=i);let g,f,b,x;return !isNaN(s)&&!isNaN(l)?(l>s&&l-s>180?x=l-(s+360):l<s&&s-l>180?x=l+360-s:x=l-s,f=s+o*x):isNaN(s)?isNaN(l)?f=Number.NaN:(f=l,(p==1||p==0)&&r!="hsv"&&(g=c)):(f=s,(u==1||u==0)&&r!="hsv"&&(g=d)),g===void 0&&(g=d+o*(c-d)),b=p+o*(u-p),r==="oklch"?new ye([b,g,f],r):new ye([f,g,b],r)},"default");var Hg=a((e,t,o)=>or(e,t,o,"lch"),"lch");Pt.lch=Hg;Pt.hcl=Hg;var G1=a((e,t,o)=>{let r=e.num(),n=t.num();return new ye(r+o*(n-r),"num")},"num");Pt.num=G1;var $1=a((e,t,o)=>or(e,t,o,"hcg"),"hcg");Pt.hcg=$1;var j1=a((e,t,o)=>or(e,t,o,"hsi"),"hsi");Pt.hsi=j1;var U1=a((e,t,o)=>or(e,t,o,"hsl"),"hsl");Pt.hsl=U1;var K1=a((e,t,o)=>or(e,t,o,"hsv"),"hsv");Pt.hsv=K1;var q1=a((e,t,o)=>{let r=e.oklab(),n=t.oklab();return new ye(r[0]+o*(n[0]-r[0]),r[1]+o*(n[1]-r[1]),r[2]+o*(n[2]-r[2]),"oklab")},"oklab");Pt.oklab=q1;var Y1=a((e,t,o)=>or(e,t,o,"oklch"),"oklch");Pt.oklch=Y1;var{pow:$p,sqrt:jp,PI:Up,cos:Vg,sin:_g,atan2:X1}=Math,Gg=a((e,t="lrgb",o=null)=>{let r=e.length;o||(o=Array.from(new Array(r)).map(()=>1));let n=r/o.reduce(function(u,g){return u+g});if(o.forEach((u,g)=>{o[g]*=n;}),e=e.map(u=>new ye(u)),t==="lrgb")return Q1(e,o);let i=e.shift(),s=i.get(t),l=[],d=0,c=0;for(let u=0;u<s.length;u++)if(s[u]=(s[u]||0)*o[0],l.push(isNaN(s[u])?0:o[0]),t.charAt(u)==="h"&&!isNaN(s[u])){let g=s[u]/180*Up;d+=Vg(g)*o[0],c+=_g(g)*o[0];}let p=i.alpha()*o[0];e.forEach((u,g)=>{let f=u.get(t);p+=u.alpha()*o[g+1];for(let b=0;b<s.length;b++)if(!isNaN(f[b]))if(l[b]+=o[g+1],t.charAt(b)==="h"){let x=f[b]/180*Up;d+=Vg(x)*o[g+1],c+=_g(x)*o[g+1];}else s[b]+=f[b]*o[g+1];});for(let u=0;u<s.length;u++)if(t.charAt(u)==="h"){let g=X1(c/l[u],d/l[u])/Up*180;for(;g<0;)g+=360;for(;g>=360;)g-=360;s[u]=g;}else s[u]=s[u]/l[u];return p/=r,new ye(s,t).alpha(p>.99999?1:p,true)},"default"),Q1=a((e,t)=>{let o=e.length,r=[0,0,0,0];for(let n=0;n<e.length;n++){let i=e[n],s=t[n]/o,l=i._rgb;r[0]+=$p(l[0],2)*s,r[1]+=$p(l[1],2)*s,r[2]+=$p(l[2],2)*s,r[3]+=l[3]*s;}return r[0]=jp(r[0]),r[1]=jp(r[1]),r[2]=jp(r[2]),r[3]>.9999999&&(r[3]=1),new ye(Na(r))},"_average_lrgb");var{pow:Z1}=Math;function Wn(e){let t="rgb",o=ot("#ccc"),r=0,n=[0,1],i=[],s=[0,0],l=false,d=[],c=false,p=0,u=1,g=false,f={},b=true,x=1,y=a(function(C){if(C=C||["#fff","#000"],C&&Qe(C)==="string"&&ot.brewer&&ot.brewer[C.toLowerCase()]&&(C=ot.brewer[C.toLowerCase()]),Qe(C)==="array"){C.length===1&&(C=[C[0],C[0]]),C=C.slice(0);for(let R=0;R<C.length;R++)C[R]=ot(C[R]);i.length=0;for(let R=0;R<C.length;R++)i.push(R/(C.length-1));}return S(),d=C},"setColors"),k=a(function(C){if(l!=null){let R=l.length-1,M=0;for(;M<R&&C>=l[M];)M++;return M-1}return 0},"getClass"),w=a(C=>C,"tMapLightness"),v=a(C=>C,"tMapDomain"),h=a(function(C,R){let M,I;if(R==null&&(R=false),isNaN(C)||C===null)return o;R?I=C:l&&l.length>2?I=k(C)/(l.length-2):u!==p?I=(C-p)/(u-p):I=1,I=v(I),R||(I=w(I)),x!==1&&(I=Z1(I,x)),I=s[0]+I*(1-s[0]-s[1]),I=Wr(I,0,1);let A=Math.floor(I*1e4);if(b&&f[A])M=f[A];else {if(Qe(d)==="array")for(let N=0;N<i.length;N++){let D=i[N];if(I<=D){M=d[N];break}if(I>=D&&N===i.length-1){M=d[N];break}if(I>D&&I<i[N+1]){I=(I-D)/(i[N+1]-D),M=ot.interpolate(d[N],d[N+1],I,t);break}}else Qe(d)==="function"&&(M=d(I));b&&(f[A]=M);}return M},"getColor");var S=a(()=>f={},"resetCache");y(e);let T=a(function(C){let R=ot(h(C));return c&&R[c]?R[c]():R},"f");return T.classes=function(C){if(C!=null){if(Qe(C)==="array")l=C,n=[C[0],C[C.length-1]];else {let R=ot.analyze(n);C===0?l=[R.min,R.max]:l=ot.limits(R,"e",C);}return T}return l},T.domain=function(C){if(!arguments.length)return n;p=C[0],u=C[C.length-1],i=[];let R=d.length;if(C.length===R&&p!==u)for(let M of Array.from(C))i.push((M-p)/(u-p));else {for(let M=0;M<R;M++)i.push(M/(R-1));if(C.length>2){let M=C.map((A,N)=>N/(C.length-1)),I=C.map(A=>(A-p)/(u-p));I.every((A,N)=>M[N]===A)||(v=a(A=>{if(A<=0||A>=1)return A;let N=0;for(;A>=I[N+1];)N++;let D=(A-I[N])/(I[N+1]-I[N]);return M[N]+D*(M[N+1]-M[N])},"tMapDomain"));}}return n=[p,u],T},T.mode=function(C){return arguments.length?(t=C,S(),T):t},T.range=function(C,R){return y(C,R),T},T.out=function(C){return c=C,T},T.spread=function(C){return arguments.length?(r=C,T):r},T.correctLightness=function(C){return C==null&&(C=true),g=C,S(),g?w=a(function(R){let M=h(0,true).lab()[0],I=h(1,true).lab()[0],A=M>I,N=h(R,true).lab()[0],D=M+(I-M)*R,E=N-D,P=0,W=1,H=20;for(;Math.abs(E)>.01&&H-- >0;)(function(){return A&&(E*=-1),E<0?(P=R,R+=(W-R)*.5):(W=R,R+=(P-R)*.5),N=h(R,true).lab()[0],E=N-D})();return R},"tMapLightness"):w=a(R=>R,"tMapLightness"),T},T.padding=function(C){return C!=null?(Qe(C)==="number"&&(C=[C,C]),s=C,T):s},T.colors=function(C,R){arguments.length<2&&(R="hex");let M=[];if(arguments.length===0)M=d.slice(0);else if(C===1)M=[T(.5)];else if(C>1){let I=n[0],A=n[1]-I;M=J1(0,C,false).map(N=>T(I+N/(C-1)*A));}else {e=[];let I=[];if(l&&l.length>2)for(let A=1,N=l.length,D=1<=N;D?A<N:A>N;D?A++:A--)I.push((l[A-1]+l[A])*.5);else I=n;M=I.map(A=>T(A));}return ot[R]&&(M=M.map(I=>I[R]())),M},T.cache=function(C){return C!=null?(b=C,T):b},T.gamma=function(C){return C!=null?(x=C,T):x},T.nodata=function(C){return C!=null?(o=ot(C),T):o},T}a(Wn,"default");function J1(e,t,o){let r=[],n=e<t,i=o?n?t+1:t-1:t;for(let s=e;n?s<i:s>i;n?s++:s--)r.push(s);return r}a(J1,"__range__");var eT=a(function(e){let t=[1,1];for(let o=1;o<e;o++){let r=[1];for(let n=1;n<=t.length;n++)r[n]=(t[n]||0)+t[n-1];t=r;}return t},"binom_row"),tT=a(function(e){let t,o,r,n;if(e=e.map(i=>new ye(i)),e.length===2)[o,r]=e.map(i=>i.lab()),t=a(function(i){let s=[0,1,2].map(l=>o[l]+i*(r[l]-o[l]));return new ye(s,"lab")},"I");else if(e.length===3)[o,r,n]=e.map(i=>i.lab()),t=a(function(i){let s=[0,1,2].map(l=>(1-i)*(1-i)*o[l]+2*(1-i)*i*r[l]+i*i*n[l]);return new ye(s,"lab")},"I");else if(e.length===4){let i;[o,r,n,i]=e.map(s=>s.lab()),t=a(function(s){let l=[0,1,2].map(d=>(1-s)*(1-s)*(1-s)*o[d]+3*(1-s)*(1-s)*s*r[d]+3*(1-s)*s*s*n[d]+s*s*s*i[d]);return new ye(l,"lab")},"I");}else if(e.length>=5){let i,s,l;i=e.map(d=>d.lab()),l=e.length-1,s=eT(l),t=a(function(d){let c=1-d,p=[0,1,2].map(u=>i.reduce((g,f,b)=>g+s[b]*c**(l-b)*d**b*f[u],0));return new ye(p,"lab")},"I");}else throw new RangeError("No point in running bezier with only one color.");return t},"bezier"),$g=a(e=>{let t=tT(e);return t.scale=()=>Wn(t),t},"default");var yr=a((e,t,o)=>{if(!yr[o])throw new Error("unknown blend mode "+o);return yr[o](e,t)},"blend"),zn=a(e=>(t,o)=>{let r=ot(o).rgb(),n=ot(t).rgb();return ot.rgb(e(r,n))},"blend_f"),On=a(e=>(t,o)=>{let r=[];return r[0]=e(t[0],o[0]),r[1]=e(t[1],o[1]),r[2]=e(t[2],o[2]),r},"each"),oT=a(e=>e,"normal"),rT=a((e,t)=>e*t/255,"multiply"),nT=a((e,t)=>e>t?t:e,"darken"),aT=a((e,t)=>e>t?e:t,"lighten"),iT=a((e,t)=>255*(1-(1-e/255)*(1-t/255)),"screen"),sT=a((e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),"overlay"),lT=a((e,t)=>255*(1-(1-t/255)/(e/255)),"burn"),dT=a((e,t)=>e===255?255:(e=255*(t/255)/(1-e/255),e>255?255:e),"dodge");yr.normal=zn(On(oT));yr.multiply=zn(On(rT));yr.screen=zn(On(iT));yr.overlay=zn(On(sT));yr.darken=zn(On(nT));yr.lighten=zn(On(aT));yr.dodge=zn(On(dT));yr.burn=zn(On(lT));var jg=yr;var{pow:cT,sin:uT,cos:pT}=Math;function Kp(e=300,t=-1.5,o=1,r=1,n=[0,1]){let i=0,s;Qe(n)==="array"?s=n[1]-n[0]:(s=0,n=[n,n]);let l=a(function(d){let c=tr*((e+120)/360+t*d),p=cT(n[0]+s*d,r),g=(i!==0?o[0]+d*i:o)*p*(1-p)/2,f=pT(c),b=uT(c),x=p+g*(-0.14861*f+1.78277*b),y=p+g*(-0.29227*f-.90649*b),k=p+g*(1.97294*f);return ot(Na([x*255,y*255,k*255,1]))},"f");return l.start=function(d){return d==null?e:(e=d,l)},l.rotations=function(d){return d==null?t:(t=d,l)},l.gamma=function(d){return d==null?r:(r=d,l)},l.hue=function(d){return d==null?o:(o=d,Qe(o)==="array"?(i=o[1]-o[0],i===0&&(o=o[1])):i=0,l)},l.lightness=function(d){return d==null?n:(Qe(d)==="array"?(n=d,s=d[1]-d[0]):(n=[d,d],s=0),l)},l.scale=()=>ot.scale(l),l.hue(o),l}a(Kp,"default");var mT="0123456789abcdef",{floor:fT,random:bT}=Math,Ug=a(()=>{let e="#";for(let t=0;t<6;t++)e+=mT.charAt(fT(bT()*16));return new ye(e,"hex")},"default");var{log:Kg,pow:gT,floor:hT,abs:yT}=Math;function qp(e,t=null){let o={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Qe(e)==="object"&&(e=Object.values(e)),e.forEach(r=>{t&&Qe(r)==="object"&&(r=r[t]),r!=null&&!isNaN(r)&&(o.values.push(r),o.sum+=r,r<o.min&&(o.min=r),r>o.max&&(o.max=r),o.count+=1);}),o.domain=[o.min,o.max],o.limits=(r,n)=>Yp(o,r,n),o}a(qp,"analyze");function Yp(e,t="equal",o=7){Qe(e)=="array"&&(e=qp(e));let{min:r,max:n}=e,i=e.values.sort((l,d)=>l-d);if(o===1)return [r,n];let s=[];if(t.substr(0,1)==="c"&&(s.push(r),s.push(n)),t.substr(0,1)==="e"){s.push(r);for(let l=1;l<o;l++)s.push(r+l/o*(n-r));s.push(n);}else if(t.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");let l=Math.LOG10E*Kg(r),d=Math.LOG10E*Kg(n);s.push(r);for(let c=1;c<o;c++)s.push(gT(10,l+c/o*(d-l)));s.push(n);}else if(t.substr(0,1)==="q"){s.push(r);for(let l=1;l<o;l++){let d=(i.length-1)*l/o,c=hT(d);if(c===d)s.push(i[c]);else {let p=d-c;s.push(i[c]*(1-p)+i[c+1]*p);}}s.push(n);}else if(t.substr(0,1)==="k"){let l,d=i.length,c=new Array(d),p=new Array(o),u=true,g=0,f=null;f=[],f.push(r);for(let y=1;y<o;y++)f.push(r+y/o*(n-r));for(f.push(n);u;){for(let k=0;k<o;k++)p[k]=0;for(let k=0;k<d;k++){let w=i[k],v=Number.MAX_VALUE,h;for(let S=0;S<o;S++){let T=yT(f[S]-w);T<v&&(v=T,h=S),p[h]++,c[k]=h;}}let y=new Array(o);for(let k=0;k<o;k++)y[k]=null;for(let k=0;k<d;k++)l=c[k],y[l]===null?y[l]=i[k]:y[l]+=i[k];for(let k=0;k<o;k++)y[k]*=1/p[k];u=false;for(let k=0;k<o;k++)if(y[k]!==f[k]){u=true;break}f=y,g++,g>200&&(u=false);}let b={};for(let y=0;y<o;y++)b[y]=[];for(let y=0;y<d;y++)l=c[y],b[l].push(i[y]);let x=[];for(let y=0;y<o;y++)x.push(b[y][0]),x.push(b[y][b[y].length-1]);x=x.sort((y,k)=>y-k),s.push(x[0]);for(let y=1;y<x.length;y+=2){let k=x[y];!isNaN(k)&&s.indexOf(k)===-1&&s.push(k);}}return s}a(Yp,"limits");var qg=a((e,t)=>{e=new ye(e),t=new ye(t);let o=e.luminance(),r=t.luminance();return o>r?(o+.05)/(r+.05):(r+.05)/(o+.05)},"default");var{sqrt:an,pow:eo,min:xT,max:vT,atan2:Yg,abs:Xg,cos:ud,sin:Qg,exp:wT,PI:Zg}=Math;function Xp(e,t,o=1,r=1,n=1){var i=a(function(G){return 360*G/(2*Zg)},"rad2deg"),s=a(function(G){return 2*Zg*G/360},"deg2rad");e=new ye(e),t=new ye(t);let[l,d,c]=Array.from(e.lab()),[p,u,g]=Array.from(t.lab()),f=(l+p)/2,b=an(eo(d,2)+eo(c,2)),x=an(eo(u,2)+eo(g,2)),y=(b+x)/2,k=.5*(1-an(eo(y,7)/(eo(y,7)+eo(25,7)))),w=d*(1+k),v=u*(1+k),h=an(eo(w,2)+eo(c,2)),S=an(eo(v,2)+eo(g,2)),T=(h+S)/2,C=i(Yg(c,w)),R=i(Yg(g,v)),M=C>=0?C:C+360,I=R>=0?R:R+360,A=Xg(M-I)>180?(M+I+360)/2:(M+I)/2,N=1-.17*ud(s(A-30))+.24*ud(s(2*A))+.32*ud(s(3*A+6))-.2*ud(s(4*A-63)),D=I-M;D=Xg(D)<=180?D:I<=M?D+360:D-360,D=2*an(h*S)*Qg(s(D)/2);let E=p-l,P=S-h,W=1+.015*eo(f-50,2)/an(20+eo(f-50,2)),H=1+.045*T,B=1+.015*T*N,L=30*wT(-eo((A-275)/25,2)),_=-(2*an(eo(T,7)/(eo(T,7)+eo(25,7))))*Qg(2*s(L)),$=an(eo(E/(o*W),2)+eo(P/(r*H),2)+eo(D/(n*B),2)+_*(P/(r*H))*(D/(n*B)));return vT(0,xT(100,$))}a(Xp,"default");function Qp(e,t,o="lab"){e=new ye(e),t=new ye(t);let r=e.get(o),n=t.get(o),i=0;for(let s in r){let l=(r[s]||0)-(n[s]||0);i+=l*l;}return Math.sqrt(i)}a(Qp,"default");var Jg=a((...e)=>{try{return new ye(...e),!0}catch{return false}},"default");var eh={cool(){return Wn([ot.hsl(180,1,.9),ot.hsl(250,.7,.4)])},hot(){return Wn(["#000","#f00","#ff0","#fff"]).mode("rgb")}};var pd={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]};for(let e of Object.keys(pd))pd[e.toLowerCase()]=pd[e];var th=pd;Object.assign(ot,{average:Gg,bezier:$g,blend:jg,cubehelix:Kp,mix:Ln,interpolate:Ln,random:Ug,scale:Wn,analyze:qp,contrast:qg,deltaE:Xp,distance:Qp,limits:Yp,valid:Jg,scales:eh,input:Ze,colors:Bn,brewer:th});var sn=ot;var Zp=500,zr={xs:.01,sm:.02,md:.03,lg:.08,xl:.14},kT=a((e,t)=>(e%t+t)%t,"normalizeHue"),md=a(e=>{let t=sn(e).hsv();return sn(t[0],t[1]*.92,Math.min(t[2]+.01,1),"hsv").hex()},"markDarkColor"),fd=a((e,t,o)=>{o===void 0&&(o=Zp);let r=t-o,n;return t<=o?e[0]>80&&e[0]<260?n=r*zr.xs:n=-r*zr.sm:e[0]>20&&e[0]<48?n=-r*zr.md:e[0]>=48&&e[0]<260?n=r*zr.xs:n=-r*zr.sm,kT(e[0]+n,360)},"calculateHue"),bd=a((e,t,o)=>{o===void 0&&(o=Zp);let r=(t-o)/100,n=0;t<o?(n=r*e[1]/5,t<100&&(n-=zr.sm)):t>o&&(e[0]<30||e[0]>200?n=r*zr.md:n=r*zr.xs,e[1]===0&&(n=0));let i=e[1]+n;return i>1?1:i<0?0:i},"calculateSaturation"),gd=a((e,t,o)=>{o===void 0&&(o=Zp);let r=(t-o)/100,n=0;t<o?e[1]<.1?n=r*(1-e[2])/5*1.06:n=r*(1-e[2])/5:t>o&&((e[0]<30||e[0]>200)&&e[0]>0?(n=r*zr.lg,e[2]>.8&&(n=r*zr.xl)):n=r*e[2]/6);let i=e[2]-n;return i>1?1:i<0?0:i},"calculateLightness");var Jp=[50,100,200,300,400,500,600,700,800,900],hd=a((e,t="light")=>{let o=t==="dark",r=o?md(e):e,n=sn(r).luminance();n<.1?r=sn(r).set("hsl.l",.4).hex():n>.9&&(r=sn(r).set("hsl.l",.6).hex());let i=sn(r).hsv(),s=Jp.map(l=>{let d=fd(i,l,500),c=bd(i,l,500),p=gd(i,l,500);return sn(d,c,p,"hsv")});return o?s.reverse():s},"createSolidColorScale"),em=a(e=>{let t=hd(e,"light"),o=hd(e,"dark"),r={};return ["monkeys","monkeys-dark"].forEach((n,i)=>{let s={};i?o.map((l,d)=>Object.assign(s,{[Jp[d]]:l.rgb().join(" ")})):t.map((l,d)=>Object.assign(s,{[Jp[d]]:l.rgb().join(" ")})),Object.assign(r,{[n]:s});}),r},"genTailwindTheme"),oh=CT__default.default(e=>{let t=em(e),o="";Object.entries(t).forEach(([n,i])=>{o+=(n==="monkeys-dark"?".dark":":root,::selection")+"{",Object.entries(i).forEach(([s,l])=>{o+=`--monkeys-${s}:${l};`;}),o+="}";});let r=document.getElementById("monkeys-theme");if(r)r.innerHTML=o;else {let n=document.createElement("style");n.id="monkeys-theme",document.head.appendChild(n),n.innerHTML=o;}},64);var TT="com.infmonkeys.css",yd=new WeakMap;function om(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}a(om,"isRecord");function NT(e){let t=e?.[TT];return om(t)?t:void 0}a(NT,"readCssExtension");function fo(e){return Number.isInteger(e)?String(e):String(Number(e.toFixed(6)))}a(fo,"formatNumber");function Fn(e){return `${fo(e.value)}${e.unit}`}a(Fn,"formatDimension");function tm(e){return `${fo(e.value)}${e.unit}`}a(tm,"formatDuration");function Ra(e){return e==="none"?e:fo(e)}a(Ra,"formatColorComponent");function RT(e){return [Number.parseInt(e.slice(1,3),16)/255,Number.parseInt(e.slice(3,5),16)/255,Number.parseInt(e.slice(5,7),16)/255]}a(RT,"hexToSrgb");function MT(e){if(e.colorSpace==="srgb"&&e.components.every(t=>typeof t=="number"))return e.components;if(e.hex)return RT(e.hex);throw new TypeError(`Web semantic colors in ${e.colorSpace} require a six-digit hex fallback for hsl(var(--token)) consumers.`)}a(MT,"colorSrgbComponents");function IT([e,t,o]){let r=Math.max(e,t,o),n=Math.min(e,t,o),i=(r+n)/2;if(r===n)return [0,0,i*100];let s=r-n,l=i>.5?s/(2-r-n):s/(r+n),d;return r===e?d=(t-o)/s+(t<o?6:0):r===t?d=(o-e)/s+2:d=(e-t)/s+4,[d/6*360,l*100,i*100]}a(IT,"srgbToHsl");function DT(e){if(e.colorSpace==="hsl"&&e.components.every(n=>typeof n=="number")){let[n,i,s]=e.components;return `${fo(n)} ${fo(i)}% ${fo(s)}%`}let[t,o,r]=IT(MT(e));return `${fo(t)} ${fo(o)}% ${fo(r)}%`}a(DT,"formatHslTriplet");function xd(e){let t=e.alpha??1;if(e.hex&&t===1)return e.hex;let o=e.components.map(Ra).join(" "),r=t===1?"":` / ${fo(t)}`;switch(e.colorSpace){case "srgb":return `rgb(${e.components.map(i=>i==="none"?"none":fo(i*255)).join(" ")}${r})`;case "hsl":return `hsl(${Ra(e.components[0])} ${Ra(e.components[1])}% ${Ra(e.components[2])}%${r})`;case "hwb":return `hwb(${Ra(e.components[0])} ${Ra(e.components[1])}% ${Ra(e.components[2])}%${r})`;case "lab":case "lch":case "oklab":case "oklch":return `${e.colorSpace}(${o}${r})`;default:return `color(${e.colorSpace} ${o}${r})`}}a(xd,"formatColor");function rh(e){let t=Array.isArray(e)?e:[e],o=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]);return t.map(r=>o.has(r)||/^[a-zA-Z][\w-]*$/.test(r)?r:`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`).join(", ")}a(rh,"formatFontFamily");function PT(e){return (Array.isArray(e)?e:[e]).map(o=>{if(!om(o))throw new TypeError("DTCG shadow values must be objects.");return [Fn(o.offsetX),Fn(o.offsetY),Fn(o.blur),Fn(o.spread),xd(o.color),o.inset===true?"inset":""].filter(Boolean).join(" ")}).join(", ")}a(PT,"formatShadow");function ET(e,t){if(!Array.isArray(e))throw new TypeError("DTCG gradient values must be arrays.");let o=e.map(n=>{if(!om(n))throw new TypeError("DTCG gradient stops must be objects.");return `${xd(n.color)} ${fo(Number(n.position)*100)}%`}).join(", "),r=NT(t)?.gradient;return r?.kind==="radial"?`radial-gradient(${o})`:`linear-gradient(${fo(r?.angle??90)}deg, ${o})`}a(ET,"formatGradient");function nh(e){switch(e.type){case "color":return xd(e.value);case "dimension":return Fn(e.value);case "fontFamily":return rh(e.value);case "fontWeight":case "number":return String(e.value);case "duration":return tm(e.value);case "cubicBezier":return `cubic-bezier(${e.value.map(fo).join(", ")})`;case "strokeStyle":return typeof e.value=="string"?e.value:e.value.dashArray.map(Fn).join(" ");case "border":{let t=e.value,o={...e,type:"strokeStyle",value:t.style};return `${Fn(t.width)} ${nh(o)} ${xd(t.color)}`}case "transition":{let t=e.value;return `${tm(t.duration)} cubic-bezier(${t.timingFunction.map(fo).join(", ")}) ${tm(t.delay)}`}case "shadow":return PT(e.value);case "gradient":return ET(e.value,e.extensions);case "typography":{let t=e.value;return `${t.fontWeight} ${Fn(t.fontSize)}/${fo(t.lineHeight)} ${rh(t.fontFamily)}`}}}a(nh,"formatTokenValue");function ah(e,t){let o=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase();return `--${t}-${o}`}a(ah,"toCssVariableName");function AT(e){if(!/^[a-zA-Z][a-zA-Z0-9-]*$/.test(e))throw new TypeError("Theme token variablePrefix must start with a letter and contain only letters, numbers, or hyphens.")}a(AT,"assertCssVariablePrefix");function ih(e,t,o){let r=`${t}.${o}`;return e.has(r)?r:e.has(t)?t:void 0}a(ih,"selectModePath");var BT={"semantic.color.background":"--background","semantic.color.foreground":"--foreground","semantic.color.card":"--card","semantic.color.card-foreground":"--card-foreground","semantic.color.popover":"--popover","semantic.color.popover-foreground":"--popover-foreground","semantic.color.primary":"--primary","semantic.color.primary-foreground":"--primary-foreground","semantic.color.secondary":"--secondary","semantic.color.secondary-foreground":"--secondary-foreground","semantic.color.muted":"--muted","semantic.color.muted-foreground":"--muted-foreground","semantic.color.accent":"--accent","semantic.color.accent-foreground":"--accent-foreground","semantic.color.destructive":"--destructive","semantic.color.destructive-foreground":"--destructive-foreground","semantic.color.success":"--success","semantic.color.success-foreground":"--success-foreground","semantic.color.warning":"--warning","semantic.color.warning-foreground":"--warning-foreground","semantic.color.border":"--border","semantic.color.input":"--input","semantic.color.ring":"--ring","semantic.color.media-surface":"--media-surface","semantic.color.media-foreground":"--media-foreground","semantic.color.media-overlay":"--media-overlay","semantic.color.radar-canvas":"--radar-canvas","semantic.color.radar-panel":"--radar-panel","semantic.color.radar-border":"--radar-border","semantic.color.radar-shell-border":"--radar-shell-border","semantic.color.radar-grid":"--radar-grid","semantic.color.radar-axis":"--radar-axis","semantic.color.radar-series-one":"--radar-series-one","semantic.color.radar-series-two":"--radar-series-two","semantic.color.radar-series-three":"--radar-series-three","semantic.color.radar-series-four":"--radar-series-four"},sh=Object.freeze({...Object.fromEntries(Object.entries(BT).map(([e,t])=>[e,{variableName:t,axis:"colorMode",expectedType:"color",format:"hsl"}])),"semantic.color.neocard":{variableName:"--neocard",axis:"colorMode",expectedType:"color",format:"css"},"semantic.radius.base":{variableName:"--radius",axis:"colorMode",expectedType:"dimension",format:"css"},"semantic.spacing.global":{variableName:"--global-spacing",axis:"density",expectedType:"dimension",format:"css"},"semantic.gradient.brand":{variableName:"--monkeys-gradient",axis:"colorMode",expectedType:"gradient",format:"css"},"semantic.font.body":{variableName:"--font-sans",axis:"colorMode",expectedType:"fontFamily",format:"css"}});function rm(e){let t=e.startsWith("$")?e.slice(1).trim():e.trim();if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/i.test(t))throw new TypeError(`Invalid Design Token path ${e}.`);let o=sh[t];return o?o.format==="hsl"?`hsl(var(${o.variableName}))`:`var(${o.variableName})`:`var(${ah(t,"monkeys")})`}a(rm,"resolveThemeTokenCssVariable");function lh(e,t){let o=ih(new Set(Object.keys(e.cssValues)),t,e.colorMode);return o?e.cssValues[o]:void 0}a(lh,"getThemeTokenCssValue");function xs(e,t={}){let o=runtime.resolveThemeTokens(e),r=o.document,n=t.colorMode??"light",i=t.density??"default",s=t.variablePrefix??"monkeys";AT(s);let l={},d={},c={},p=new Map;for(let[f,b]of o.tokens){l[f]=b.value;let x=nh(b);d[f]=x;let y=ah(f,s),k=p.get(y);if(k)throw new TypeError(`Theme token paths ${k} and ${f} both compile to ${y}. Rename one token.`);p.set(y,f),c[y]=x;}let u=new Set(o.tokens.keys());for(let[f,b]of Object.entries(sh)){let x=b.axis==="density"?i:n,y=ih(u,f,x);if(!y)continue;let k=o.tokens.get(y);if(!k||k.type!==b.expectedType)throw new TypeError(`${y} must be a ${b.expectedType} token to drive ${b.variableName}.`);c[b.variableName]=b.format==="hsl"?DT(k.value):d[y];}let g=Object.entries(c).sort(([f],[b])=>f.localeCompare(b)).map(([f,b])=>`${f}:${b};`).join("");return {contract:r,colorMode:n,density:i,values:Object.freeze(l),cssValues:Object.freeze(d),cssVariables:Object.freeze(c),cssText:g}}a(xs,"compileThemeTokens");function dh(e,t={}){let o=xs(e,t),r=t.target??(typeof document>"u"?null:document.documentElement);if(!r)return o;let n=yd.get(r)??new Set,i=new Set(Object.keys(o.cssVariables));for(let s of n)i.has(s)||r.style.removeProperty(s);for(let[s,l]of Object.entries(o.cssVariables))r.style.setProperty(s,l);return yd.set(r,i),t.themeId?r.dataset.monkeysTheme=t.themeId:delete r.dataset.monkeysTheme,r.dataset.monkeysColorMode=o.colorMode,r.dataset.monkeysDensity=o.density,o}a(dh,"applyThemeTokens");function ch(e={}){let t=e.target??(typeof document>"u"?null:document.documentElement);if(!t)return;let o=yd.get(t)??new Set;for(let r of o)t.style.removeProperty(r);yd.delete(t),delete t.dataset.monkeysTheme,delete t.dataset.monkeysColorMode,delete t.dataset.monkeysDensity;}a(ch,"clearThemeTokens");var vd=["background","glowColor","borderColor","borderWidth","borderStyle","radius","shadow","padding","gap"],LT={background:"hsl(var(--card, 0 0% 100%))",glowColor:"var(--monkeys-bento-glow-default)",borderColor:"hsl(var(--border, 214.3 31.8% 91.4%))",borderWidth:"1px",borderStyle:"solid",radius:"var(--radius, 0.75rem)",shadow:"none",padding:"var(--global-spacing, 0.75rem)",gap:"var(--global-spacing, 0.75rem)"},nm=new WeakMap;function uh(e,t){if(!Number.isSafeInteger(t)||t<1)throw new RangeError("Bento level must be a positive safe integer.");let o=e&&nm.get(e)?.get(t);if(o)return o;let r={...LT},n=Object.fromEntries(vd.map(s=>[s,"builtin"]));for(let s of vd){let l=s==="padding"||s==="gap"?e?.density:e?.colorMode,d=s==="glowColor"?"component.bento":"semantic.bento",c=[`${d}.levels.level${t}.${s}`,`${d}.default.${s}`];for(let p of c){let u=l&&e?.cssValues[`${p}.${l}`]!==void 0?`${p}.${l}`:p,g=e?.cssValues[u];if(g!==void 0){r[s]=g,n[s]=u;break}}}let i=Object.freeze({values:Object.freeze(r),sources:Object.freeze(n)});if(e){let s=nm.get(e)??new Map;s.set(t,i),nm.set(e,s);}return i}a(uh,"resolveBentoTokens");var ln={locale:"en-US",messages:{pagination:{navigation:"Pagination",first:"First",previous:"Previous",next:"Next",last:"Last",page:a(({page:e,pageCount:t})=>`Page ${e} of ${t}`,"page"),currentPage:a(({page:e,pageCount:t})=>`Page ${e} of ${t}, current page`,"currentPage"),emptyResults:"0 results",range:a(({start:e,end:t,total:o})=>`${e}-${t} of ${o}`,"range"),selected:a(({count:e})=>`${e} selected`,"selected"),pageSize:"Items per page",loadBatchSize:"Items per load",perLoad:"Items per load",jumpToPage:"Jump to page",pages:"pages",clickToJump:"Click to jump to a page"},dialog:{close:"Close dialog"},dropdownMenu:{actions:"Actions"},loading:{spinner:"Loading"},layout:{resizePanels:"Resize panels",expandPanel:"Expand",collapsePanel:"Collapse",movePanel:"Move",moveBefore:"Move earlier",moveAfter:"Move later"},steps:{label:"Progress",current:"Current",completed:"Completed",error:"Error",disabled:"Disabled"},numberInput:{increment:"Increase value",decrement:"Decrease value"},passwordInput:{showPassword:"Show password",hidePassword:"Hide password"},multiSelect:{placeholder:"Select options",empty:"No options",removeOption:a(({value:e})=>`Remove ${e}`,"removeOption")},table:{dragColumn:a(({columnId:e})=>`Drag column ${e}`,"dragColumn"),resizeColumn:a(({columnId:e})=>`Resize column ${e}`,"resizeColumn"),sortColumn:a(({columnId:e})=>e?`Sort column ${e}`:"Sort column","sortColumn"),loadingRow:"Loading table row"},toolbar:{theme:{label:"Appearance",toggle:"Toggle theme",auto:"Auto",light:"Light",dark:"Dark"},language:{label:"Language",switch:"Switch language"}},toast:{errorTitle:"Error",warningTitle:"Warning",defaultErrorDescription:"Something went wrong.",defaultWarningDescription:"Please check and try again."},dataExplorer:{viewTree:{actions:"More actions",expand:"Expand",collapse:"Collapse",loading:"Loading...",empty:"No views",error:"Unable to load views"}},workbench:{relationshipGraph:{zoomOut:"Zoom out",zoomIn:"Zoom in",zoomToFit:"Fit graph",minimap:"Graph overview"},collection:{label:"Collection",loading:"Loading items",empty:"No items",loadError:"Unable to load items",refreshError:"Unable to refresh items",retry:"Retry",loadingMore:"Loading more items",permission:"You do not have permission to view this content",offline:"You appear to be offline",requestAccess:"Request access"},interactiveTable:{columnActions:"Column actions",freezeColumn:"Freeze to left",freezeEndColumn:"Freeze to right",unfreezeColumn:"Unfreeze from left",unfreezeEndColumn:"Unfreeze from right",unfreezeAllColumns:"Unfreeze all columns",resetColumnWidth:"Reset column width",frozenColumnTitle:"Frozen column"}},agentWorkbench:{label:"Session activity",reasoning:"Reasoning",plan:"Plan",taskNoDetail:"No additional details",modes:{chat:"Chat",work:"Work"},composer:{send:"Send message",stop:"Stop generating",queue:"Queue message",attach:"Add photos or files",voice:"Start voice input",webSearch:"Web search",chatMode:"Chat mode",model:"Model",reasoning:"Reasoning effort",permissions:"Permissions",removeAttachment:"Remove attachment",editQueued:"Edit queued message",deleteQueued:"Delete queued message",moveUp:"Move message up",moveDown:"Move message down",queued:"Queued messages",uploading:"Uploading",uploadFailed:"Upload failed",retryAttachment:"Retry attachment upload",noModels:"No models available",message:"Message",attachmentOnly:"Attachment",reasoningOptions:{low:"Low",medium:"Medium",high:"High",xhigh:"Extra high"},permissionOptions:{"approval-required":"Approval required","auto-approve":"Auto approve","full-access":"Full access"}},quickStart:{label:"Quick start",back:"Back",addFile:"Add file"},tool:{input:"Input",output:"Output",status:{pending:"Pending",running:"Running",completed:"Completed",failed:"Error",denied:"Denied"}},approval:{approve:"Approve",reject:"Reject",approved:"Approved",rejected:"Rejected"},artifact:{pending:"Preparing",ready:"Ready",failed:"Failed",open:a(({name:e})=>`Open ${e}`,"open")},run:{stopping:"Stopping...",stoppedAfter:a(({duration:e})=>`You stopped after ${e}`,"stoppedAfter")},process:{running:"Working",queued:"Queued",waitingApproval:"Waiting for approval",failed:"Failed",stopped:"Stopped",processed:"Processed",processedFor:a(({duration:e})=>`Worked for ${e}`,"processedFor"),completedCount:a(({completed:e,total:t})=>`${e}/${t} completed`,"completedCount")},artifactWorkspace:{outputs:"Outputs",sources:"Sources",viewAll:"View all",toggleSummary:"Toggle files",tabs:"Open files",closeTab:a(({name:e})=>`Close ${e}`,"closeTab"),closeWorkspace:"Close workspace",download:a(({name:e})=>`Download ${e}`,"download"),openExternal:a(({name:e})=>`Open ${e} in a new window`,"openExternal"),loading:"Loading preview...",failed:"Preview unavailable",retry:"Try again"},usage:{label:"Context usage",context:a(({used:e,total:t})=>`${e} / ${t} tokens`,"context")},navigation:{search:"Search agents and sessions",searchSessions:"Search sessions",searchShortcut:"Focus search",clearSearch:"Clear search",tabsLabel:"Agent workbench navigation",agents:"Agents",sessions:"Sessions",newAgent:"New Agent",newSession:"New Session",capabilities:"Capabilities & Extensions",settings:"Agent Settings",allAgents:"All Agents",recentSessions:"Recent Sessions",chat:"Chat",work:"Work",chats:"Chats",builtIn:"Built-in",noDescription:"No description",loading:"Loading...",emptyAgents:"No agents yet",emptySessions:"No sessions yet",noResults:"No matching results",retry:"Retry",pin:"Pin",unpin:"Unpin",rename:"Rename",delete:"Delete",actions:"Actions",save:"Save",cancel:"Cancel",running:"Running",completed:"Completed",failed:"Failed",contextUsage:a(({percent:e})=>`${e}% context used`,"contextUsage")},details:{title:"Task details",description:"Summary and workspace activity",duration:"Duration",updated:"Updated",model:"Model",mode:"Mode",permissions:"Permissions",tokenUsage:"Token usage",summary:"Summary",summaryEmpty:"No summary is available yet.",summaryFailed:"The summary could not be generated.",highlights:"Highlights",pendingItems:"Pending items",tabs:{label:"Task detail views",summary:"Summary",workspace:"Workspace"},status:{queued:"Queued",running:"Running",waiting_approval:"Waiting for approval",stopping:"Stopping",stopped:"Stopped",completed:"Completed",failed:"Failed"},state:{loading:{title:"Loading task details",description:"Restoring the latest session activity."},empty:{title:"No task selected",description:"Select a task to inspect its details."},error:{title:"Unable to load task details",description:"Try again after the session is available."}},actions:{close:"Close task details",copySummary:"Copy summary",retry:"Retry",retrySummary:"Retry summary",resume:"Resume",continueInNewTask:"Continue in new task",editAndRerun:"Edit and rerun",export:"Export"},workspace:{diffs:"Code changes",files:"Files",terminals:"Terminals",tests:"Tests",artifacts:"Artifacts",exitCode:a(({code:e})=>`Exit code ${e}`,"exitCode"),diffStatus:{added:"Added",modified:"Modified",deleted:"Deleted",renamed:"Renamed"},fileOperation:{upsert:"Updated",delete:"Deleted"}}}}}};var wd={locale:"zh-CN",messages:{pagination:{navigation:"\u5206\u9875\u5BFC\u822A",first:"\u9996\u9875",previous:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",last:"\u672B\u9875",page:a(({page:e,pageCount:t})=>`\u7B2C ${e} \u9875\uFF0C\u5171 ${t} \u9875`,"page"),currentPage:a(({page:e,pageCount:t})=>`\u7B2C ${e} \u9875\uFF0C\u5171 ${t} \u9875\uFF0C\u5F53\u524D\u9875`,"currentPage"),emptyResults:"\u5171 0 \u6761",range:a(({start:e,end:t,total:o})=>`\u7B2C ${e}-${t} \u6761\uFF0C\u5171 ${o} \u6761`,"range"),selected:a(({count:e})=>`\u5DF2\u9009\u62E9 ${e} \u9879`,"selected"),pageSize:"\u6BCF\u9875\u663E\u793A\u6570\u91CF",loadBatchSize:"\u6BCF\u6B21\u52A0\u8F7D\u6570\u91CF",perLoad:"\u6BCF\u6B21\u52A0\u8F7D",jumpToPage:"\u8DF3\u8F6C\u5230\u9875\u7801",pages:"\u9875",clickToJump:"\u70B9\u51FB\u8DF3\u8F6C\u9875\u7801"},dialog:{close:"\u5173\u95ED\u5BF9\u8BDD\u6846"},dropdownMenu:{actions:"\u64CD\u4F5C"},loading:{spinner:"\u6B63\u5728\u52A0\u8F7D"},layout:{resizePanels:"\u8C03\u6574\u9762\u677F\u5927\u5C0F",expandPanel:"\u5C55\u5F00",collapsePanel:"\u6536\u8D77",movePanel:"\u79FB\u52A8",moveBefore:"\u5411\u524D\u79FB\u52A8",moveAfter:"\u5411\u540E\u79FB\u52A8"},steps:{label:"\u8FDB\u5EA6",current:"\u5F53\u524D\u6B65\u9AA4",completed:"\u5DF2\u5B8C\u6210",error:"\u9519\u8BEF",disabled:"\u5DF2\u7981\u7528"},numberInput:{increment:"\u589E\u52A0\u6570\u503C",decrement:"\u51CF\u5C11\u6570\u503C"},passwordInput:{showPassword:"\u663E\u793A\u5BC6\u7801",hidePassword:"\u9690\u85CF\u5BC6\u7801"},multiSelect:{placeholder:"\u8BF7\u9009\u62E9",empty:"\u6682\u65E0\u9009\u9879",removeOption:a(({value:e})=>`\u79FB\u9664 ${e}`,"removeOption")},table:{dragColumn:a(({columnId:e})=>`\u62D6\u52A8\u5217 ${e}`,"dragColumn"),resizeColumn:a(({columnId:e})=>`\u8C03\u6574\u5217\u5BBD ${e}`,"resizeColumn"),sortColumn:a(({columnId:e})=>e?`\u6392\u5E8F\u5217 ${e}`:"\u6392\u5E8F\u5217","sortColumn"),loadingRow:"\u6B63\u5728\u52A0\u8F7D\u8868\u683C\u884C"},toolbar:{theme:{label:"\u5916\u89C2",toggle:"\u5207\u6362\u4E3B\u9898",auto:"\u8DDF\u968F\u7CFB\u7EDF",light:"\u6D45\u8272\u6A21\u5F0F",dark:"\u6DF1\u8272\u6A21\u5F0F"},language:{label:"\u8BED\u8A00",switch:"\u5207\u6362\u8BED\u8A00"}},toast:{errorTitle:"\u9519\u8BEF",warningTitle:"\u63D0\u793A",defaultErrorDescription:"\u53D1\u751F\u9519\u8BEF\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",defaultWarningDescription:"\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002"},dataExplorer:{viewTree:{actions:"\u66F4\u591A\u64CD\u4F5C",expand:"\u5C55\u5F00",collapse:"\u6536\u8D77",loading:"\u6B63\u5728\u52A0\u8F7D...",empty:"\u6682\u65E0\u89C6\u56FE",error:"\u65E0\u6CD5\u52A0\u8F7D\u89C6\u56FE"}},workbench:{relationshipGraph:{zoomOut:"\u7F29\u5C0F",zoomIn:"\u653E\u5927",zoomToFit:"\u9002\u5E94\u753B\u5E03",minimap:"\u56FE\u8C31\u6982\u89C8"},collection:{label:"\u5185\u5BB9\u96C6\u5408",loading:"\u6B63\u5728\u52A0\u8F7D\u5185\u5BB9",empty:"\u6682\u65E0\u5185\u5BB9",loadError:"\u65E0\u6CD5\u52A0\u8F7D\u5185\u5BB9",refreshError:"\u65E0\u6CD5\u5237\u65B0\u5185\u5BB9",retry:"\u91CD\u8BD5",loadingMore:"\u6B63\u5728\u52A0\u8F7D\u66F4\u591A\u5185\u5BB9",permission:"\u4F60\u6CA1\u6709\u6743\u9650\u67E5\u770B\u6B64\u5185\u5BB9",offline:"\u7F51\u7EDC\u8FDE\u63A5\u5DF2\u65AD\u5F00",requestAccess:"\u7533\u8BF7\u6743\u9650"},interactiveTable:{columnActions:"\u5217\u64CD\u4F5C",freezeColumn:"\u56FA\u5B9A\u5230\u5DE6\u4FA7",freezeEndColumn:"\u56FA\u5B9A\u5230\u53F3\u4FA7",unfreezeColumn:"\u53D6\u6D88\u5DE6\u4FA7\u56FA\u5B9A",unfreezeEndColumn:"\u53D6\u6D88\u53F3\u4FA7\u56FA\u5B9A",unfreezeAllColumns:"\u53D6\u6D88\u5168\u90E8\u56FA\u5B9A",resetColumnWidth:"\u91CD\u7F6E\u5217\u5BBD",frozenColumnTitle:"\u5DF2\u56FA\u5B9A\u5217"}},agentWorkbench:{label:"\u4F1A\u8BDD\u6D3B\u52A8",reasoning:"\u601D\u8003\u8FC7\u7A0B",plan:"\u6267\u884C\u8BA1\u5212",taskNoDetail:"\u6682\u65E0\u66F4\u591A\u8BE6\u60C5",modes:{chat:"\u5BF9\u8BDD",work:"\u5DE5\u4F5C"},composer:{send:"\u53D1\u9001\u6D88\u606F",stop:"\u505C\u6B62\u751F\u6210",queue:"\u6392\u961F\u53D1\u9001",attach:"\u6DFB\u52A0\u7167\u7247\u6216\u6587\u4EF6",voice:"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165",webSearch:"\u8054\u7F51\u641C\u7D22",chatMode:"\u5BF9\u8BDD\u6A21\u5F0F",model:"\u6A21\u578B",reasoning:"\u601D\u8003\u5F3A\u5EA6",permissions:"\u6743\u9650",removeAttachment:"\u79FB\u9664\u9644\u4EF6",editQueued:"\u7F16\u8F91\u6392\u961F\u6D88\u606F",deleteQueued:"\u5220\u9664\u6392\u961F\u6D88\u606F",moveUp:"\u4E0A\u79FB\u6D88\u606F",moveDown:"\u4E0B\u79FB\u6D88\u606F",queued:"\u6392\u961F\u6D88\u606F",uploading:"\u4E0A\u4F20\u4E2D",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",retryAttachment:"\u91CD\u8BD5\u9644\u4EF6\u4E0A\u4F20",noModels:"\u6682\u65E0\u53EF\u7528\u6A21\u578B",message:"\u6D88\u606F",attachmentOnly:"\u9644\u4EF6",reasoningOptions:{low:"\u4F4E",medium:"\u4E2D",high:"\u9AD8",xhigh:"\u6700\u9AD8"},permissionOptions:{"approval-required":"\u9700\u8981\u6279\u51C6","auto-approve":"\u81EA\u52A8\u6279\u51C6","full-access":"\u5B8C\u5168\u8BBF\u95EE"}},quickStart:{label:"\u5FEB\u901F\u5F00\u59CB",back:"\u8FD4\u56DE",addFile:"\u6DFB\u52A0\u6587\u4EF6"},tool:{input:"\u8F93\u5165",output:"\u8F93\u51FA",status:{pending:"\u7B49\u5F85\u4E2D",running:"\u8FD0\u884C\u4E2D",completed:"\u5DF2\u5B8C\u6210",failed:"\u9519\u8BEF",denied:"\u5DF2\u62D2\u7EDD"}},approval:{approve:"\u5141\u8BB8",reject:"\u62D2\u7EDD",approved:"\u5DF2\u5141\u8BB8",rejected:"\u5DF2\u62D2\u7EDD"},artifact:{pending:"\u51C6\u5907\u4E2D",ready:"\u5DF2\u5C31\u7EEA",failed:"\u5931\u8D25",open:a(({name:e})=>`\u6253\u5F00 ${e}`,"open")},run:{stopping:"\u6B63\u5728\u505C\u6B62...",stoppedAfter:a(({duration:e})=>`\u4F60\u5728 ${e} \u540E\u505C\u6B62\u4E86\u4EFB\u52A1`,"stoppedAfter")},process:{running:"\u6267\u884C\u8FC7\u7A0B",queued:"\u6392\u961F\u4E2D",waitingApproval:"\u7B49\u5F85\u5BA1\u6279",failed:"\u5931\u8D25",stopped:"\u5DF2\u505C\u6B62",processed:"\u5DF2\u5904\u7406",processedFor:a(({duration:e})=>`\u8017\u65F6 ${e.replace(/(\d+)h/g,"$1\u5C0F\u65F6").replace(/(\d+)m/g,"$1\u5206\u949F").replace(/(\d+)s/g,"$1\u79D2").replace(/\s+/g,"")}`,"processedFor"),completedCount:a(({completed:e,total:t})=>`${e}/${t} \u5DF2\u5B8C\u6210`,"completedCount")},artifactWorkspace:{outputs:"\u8F93\u51FA",sources:"\u6765\u6E90",viewAll:"\u67E5\u770B\u5168\u90E8",toggleSummary:"\u5207\u6362\u6587\u4EF6\u6458\u8981",tabs:"\u5DF2\u6253\u5F00\u6587\u4EF6",closeTab:a(({name:e})=>`\u5173\u95ED ${e}`,"closeTab"),closeWorkspace:"\u5173\u95ED\u5DE5\u4F5C\u533A",download:a(({name:e})=>`\u4E0B\u8F7D ${e}`,"download"),openExternal:a(({name:e})=>`\u5728\u65B0\u7A97\u53E3\u6253\u5F00 ${e}`,"openExternal"),loading:"\u6B63\u5728\u52A0\u8F7D\u9884\u89C8...",failed:"\u9884\u89C8\u4E0D\u53EF\u7528",retry:"\u91CD\u8BD5"},usage:{label:"\u4E0A\u4E0B\u6587\u7528\u91CF",context:a(({used:e,total:t})=>`${e} / ${t} tokens`,"context")},navigation:{search:"\u641C\u7D22\u667A\u80FD\u4F53\u548C\u4F1A\u8BDD",searchSessions:"\u641C\u7D22\u4F1A\u8BDD",searchShortcut:"\u805A\u7126\u641C\u7D22\u6846",clearSearch:"\u6E05\u9664\u641C\u7D22",tabsLabel:"\u667A\u80FD\u4F53\u5DE5\u4F5C\u53F0\u5BFC\u822A",agents:"\u667A\u80FD\u4F53",sessions:"\u4F1A\u8BDD",newAgent:"\u65B0\u5EFA\u667A\u80FD\u4F53",newSession:"\u65B0\u5EFA\u4F1A\u8BDD",capabilities:"\u80FD\u529B\u4E0E\u6269\u5C55",settings:"\u667A\u80FD\u4F53\u8BBE\u7F6E",allAgents:"\u5168\u90E8\u667A\u80FD\u4F53",recentSessions:"\u6700\u8FD1\u4F1A\u8BDD",chat:"\u5BF9\u8BDD",work:"\u5DE5\u4F5C",chats:"\u804A\u5929",builtIn:"\u5185\u7F6E",noDescription:"\u6682\u65E0\u63CF\u8FF0",loading:"\u52A0\u8F7D\u4E2D...",emptyAgents:"\u6682\u65E0\u667A\u80FD\u4F53",emptySessions:"\u6682\u65E0\u4F1A\u8BDD",noResults:"\u6CA1\u6709\u5339\u914D\u7ED3\u679C",retry:"\u91CD\u8BD5",pin:"\u7F6E\u9876",unpin:"\u53D6\u6D88\u7F6E\u9876",rename:"\u91CD\u547D\u540D",delete:"\u5220\u9664",actions:"\u64CD\u4F5C",save:"\u4FDD\u5B58",cancel:"\u53D6\u6D88",running:"\u8FD0\u884C\u4E2D",completed:"\u5DF2\u5B8C\u6210",failed:"\u5931\u8D25",contextUsage:a(({percent:e})=>`\u5DF2\u4F7F\u7528 ${e}% \u4E0A\u4E0B\u6587`,"contextUsage")},details:{title:"\u4EFB\u52A1\u8BE6\u60C5",description:"\u6458\u8981\u4E0E\u5DE5\u4F5C\u533A\u6D3B\u52A8",duration:"\u8017\u65F6",updated:"\u66F4\u65B0\u65F6\u95F4",model:"\u6A21\u578B",mode:"\u6A21\u5F0F",permissions:"\u6743\u9650",tokenUsage:"Token \u7528\u91CF",summary:"\u6458\u8981",summaryEmpty:"\u6682\u65F6\u6CA1\u6709\u53EF\u7528\u6458\u8981\u3002",summaryFailed:"\u6458\u8981\u751F\u6210\u5931\u8D25\u3002",highlights:"\u91CD\u70B9",pendingItems:"\u5F85\u5904\u7406\u4E8B\u9879",tabs:{label:"\u4EFB\u52A1\u8BE6\u60C5\u89C6\u56FE",summary:"\u6458\u8981",workspace:"\u5DE5\u4F5C\u533A"},status:{queued:"\u6392\u961F\u4E2D",running:"\u8FD0\u884C\u4E2D",waiting_approval:"\u7B49\u5F85\u5BA1\u6279",stopping:"\u6B63\u5728\u505C\u6B62",stopped:"\u5DF2\u505C\u6B62",completed:"\u5DF2\u5B8C\u6210",failed:"\u5931\u8D25"},state:{loading:{title:"\u6B63\u5728\u52A0\u8F7D\u4EFB\u52A1\u8BE6\u60C5",description:"\u6B63\u5728\u6062\u590D\u6700\u65B0\u7684\u4F1A\u8BDD\u6D3B\u52A8\u3002"},empty:{title:"\u672A\u9009\u62E9\u4EFB\u52A1",description:"\u9009\u62E9\u4EFB\u52A1\u540E\u67E5\u770B\u8BE6\u7EC6\u4FE1\u606F\u3002"},error:{title:"\u65E0\u6CD5\u52A0\u8F7D\u4EFB\u52A1\u8BE6\u60C5",description:"\u4F1A\u8BDD\u6062\u590D\u53EF\u7528\u540E\u8BF7\u91CD\u8BD5\u3002"}},actions:{close:"\u5173\u95ED\u4EFB\u52A1\u8BE6\u60C5",copySummary:"\u590D\u5236\u6458\u8981",retry:"\u91CD\u8BD5",retrySummary:"\u91CD\u65B0\u751F\u6210\u6458\u8981",resume:"\u7EE7\u7EED\u8FD0\u884C",continueInNewTask:"\u5728\u65B0\u4EFB\u52A1\u4E2D\u7EE7\u7EED",editAndRerun:"\u7F16\u8F91\u5E76\u91CD\u65B0\u8FD0\u884C",export:"\u5BFC\u51FA"},workspace:{diffs:"\u4EE3\u7801\u53D8\u66F4",files:"\u6587\u4EF6",terminals:"\u7EC8\u7AEF",tests:"\u6D4B\u8BD5",artifacts:"\u4EA7\u7269",exitCode:a(({code:e})=>`\u9000\u51FA\u7801 ${e}`,"exitCode"),diffStatus:{added:"\u65B0\u589E",modified:"\u4FEE\u6539",deleted:"\u5220\u9664",renamed:"\u91CD\u547D\u540D"},fileOperation:{upsert:"\u5DF2\u66F4\u65B0",delete:"\u5DF2\u5220\u9664"}}}}}};var WT={"en-US":ln,"zh-CN":wd};function ph(e){if(typeof e!="string"||!e.trim())throw new TypeError("Monkeys locale must be a non-empty BCP 47 string.");try{return Intl.getCanonicalLocales(e)[0]}catch{throw new RangeError(`Monkeys locale "${e}" is not a valid BCP 47 identifier.`)}}a(ph,"normalizeLocaleId");function mh(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}a(mh,"isRecord");function fh(e,t,o){if(!mh(e)||!mh(t))throw new TypeError(`${o} must be an object.`);for(let[r,n]of Object.entries(e)){if(n===void 0)continue;if(!(r in t))throw new TypeError(`${o}.${r} is not a supported Monkeys message.`);let i=t[r],s=`${o}.${r}`;if(typeof i=="function"){if(typeof n!="function")throw new TypeError(`${s} must be a function.`)}else if(typeof i=="string"){if(typeof n!="string")throw new TypeError(`${s} must be a string.`)}else fh(n,i,s);}}a(fh,"validateMessageOverride");function bh(e,t){fh(e,ln.messages,t);}a(bh,"assertMessagesOverride");function gh(e){return e==="en-US"||e==="zh-CN"}a(gh,"isBuiltInLocale");function zT(e){if(e===void 0)return {locale:void 0,messages:void 0,hasExplicitLocale:false};if(typeof e=="string"){let o=ph(e);if(!gh(o))throw new RangeError(`Unsupported built-in Monkeys locale "${o}". Provide a locale pack object for custom locales.`);return {locale:o,messages:void 0,hasExplicitLocale:true}}if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError("Monkeys locale must be a locale id or locale pack object.");let t=ph(e.locale);return bh(e.messages,"Monkeys locale messages"),{locale:t,messages:e.messages,hasExplicitLocale:true}}a(zT,"normalizeLocaleInput");function Ma(e,t){return t?{pagination:{...e.pagination,...t.pagination},dialog:{...e.dialog,...t.dialog},dropdownMenu:{...e.dropdownMenu,...t.dropdownMenu},loading:{...e.loading,...t.loading},layout:{...e.layout,...t.layout},steps:{...e.steps,...t.steps},numberInput:{...e.numberInput,...t.numberInput},passwordInput:{...e.passwordInput,...t.passwordInput},multiSelect:{...e.multiSelect,...t.multiSelect},table:{...e.table,...t.table},toolbar:{theme:{...e.toolbar.theme,...t.toolbar?.theme},language:{...e.toolbar.language,...t.toolbar?.language}},toast:{...e.toast,...t.toast},dataExplorer:{viewTree:{...e.dataExplorer.viewTree,...t.dataExplorer?.viewTree}},workbench:{relationshipGraph:{zoomOut:"Zoom out",zoomIn:"Zoom in",zoomToFit:"Fit graph",minimap:"Graph overview",...e.workbench.relationshipGraph,...t.workbench?.relationshipGraph},collection:{...e.workbench.collection,...t.workbench?.collection},interactiveTable:{...e.workbench.interactiveTable,...t.workbench?.interactiveTable}},agentWorkbench:{...e.agentWorkbench,...t.agentWorkbench,modes:{...e.agentWorkbench.modes,...t.agentWorkbench?.modes},composer:{...e.agentWorkbench.composer,...t.agentWorkbench?.composer},quickStart:{...e.agentWorkbench.quickStart,...t.agentWorkbench?.quickStart},tool:{...e.agentWorkbench.tool,...t.agentWorkbench?.tool,status:{...e.agentWorkbench.tool.status,...t.agentWorkbench?.tool?.status}},approval:{...e.agentWorkbench.approval,...t.agentWorkbench?.approval},artifact:{...e.agentWorkbench.artifact,...t.agentWorkbench?.artifact},run:{...e.agentWorkbench.run,...t.agentWorkbench?.run},process:{...e.agentWorkbench.process,...t.agentWorkbench?.process},artifactWorkspace:{...e.agentWorkbench.artifactWorkspace,...t.agentWorkbench?.artifactWorkspace},usage:{...e.agentWorkbench.usage,...t.agentWorkbench?.usage},navigation:{...e.agentWorkbench.navigation,...t.agentWorkbench?.navigation},details:{...e.agentWorkbench.details,...t.agentWorkbench?.details,tabs:{...e.agentWorkbench.details.tabs,...t.agentWorkbench?.details?.tabs},status:{...e.agentWorkbench.details.status,...t.agentWorkbench?.details?.status},state:{loading:{...e.agentWorkbench.details.state.loading,...t.agentWorkbench?.details?.state?.loading},empty:{...e.agentWorkbench.details.state.empty,...t.agentWorkbench?.details?.state?.empty},error:{...e.agentWorkbench.details.state.error,...t.agentWorkbench?.details?.state?.error}},actions:{...e.agentWorkbench.details.actions,...t.agentWorkbench?.details?.actions},workspace:{...e.agentWorkbench.details.workspace,...t.agentWorkbench?.details?.workspace,diffStatus:{...e.agentWorkbench.details.workspace.diffStatus,...t.agentWorkbench?.details?.workspace?.diffStatus},fileOperation:{...e.agentWorkbench.details.workspace.fileOperation,...t.agentWorkbench?.details?.workspace?.fileOperation}}}}}:e}a(Ma,"mergeMonkeysLocaleMessages");var li={locale:ln.locale,messages:Ma(ln.messages)};function kd(e,t,o){t!==void 0&&bh(t,"MonkeysProvider messages");let r=zT(e),n=r.locale??o?.locale??ln.locale,i=gh(n)?WT[n].messages:void 0,s=Ma(ln.messages,i);return o&&(!r.hasExplicitLocale||o.locale===n)&&(s=Ma(s,o.messages)),s=Ma(s,r.messages),s=Ma(s,t),{locale:n,messages:s}}a(kd,"resolveMonkeysLocale");var OT=Object.freeze({}),FT=Object.freeze({}),hh=Symbol.for("@inf-monkeys-tech/monkeys-design/provider-context@1");function HT(){return Object.freeze({locale:ho.createContext({...li,provided:false}),theme:ho.createContext({provided:false}),direction:ho.createContext({provided:false}),environment:ho.createContext({provided:false,environment:OT,portal:FT})})}a(HT,"createMonkeysProviderContexts");function VT(){let e=globalThis,t=e[hh];if(t)return t;let o=HT();return Object.defineProperty(e,hh,{value:o,enumerable:false,configurable:false,writable:false}),o}a(VT,"getMonkeysProviderContexts");var Sd=VT(),di=Sd.locale,dn=Sd.theme,vs=Sd.direction,Ia=Sd.environment;function yh(e,t){return t===void 0?e:e===void 0?t:{...e,...t,slots:e.slots||t.slots?{...e.slots,...t.slots}:void 0,styles:e.styles||t.styles?{...e.styles,...t.styles}:void 0}}a(yh,"mergeAppearance");function Co(){try{return ho.useContext(di)??{...li,provided:!1}}catch{return {...li,provided:false}}}a(Co,"useMonkeysLocale");function Ye(){return ho.useContext(di).messages}a(Ye,"useMonkeysLocaleMessages");function Hn(){return ho.useContext(dn).resolvedTheme}a(Hn,"useMonkeysResolvedTheme");function Pe(e){let t=ho.useContext(dn).baseAppearance;return ho.useMemo(()=>yh(t,e),[e,t])}a(Pe,"useMonkeysBaseAppearance");function xh(e){let t=ho.useContext(dn).dataExplorerAppearance;return ho.useMemo(()=>yh(t,e),[e,t])}a(xh,"useMonkeysDataExplorerAppearance");function Or(){return ho.useContext(dn).statusStates??{}}a(Or,"useMonkeysStatusStates");function Td(){return ho.useContext(dn).listFooter??{}}a(Td,"useMonkeysListFooter");function ci(){return ho.useContext(vs).direction}a(ci,"useMonkeysDirection");function ui(){return ho.useContext(Ia).environment}a(ui,"useMonkeysEnvironment");function pi(){return ho.useContext(Ia).portal}a(pi,"useMonkeysPortalOptions");function ke(){let e=ho.useContext(di),t=ho.useContext(dn),o=ho.useContext(vs),r=e.provided||t.provided||o.provided;return ho.useMemo(()=>r?{dir:o.direction,"data-monkeys-direction":o.direction,"data-monkeys-locale":e.locale,"data-monkeys-theme":t.themeId,"data-monkeys-theme-mode":t.resolvedTheme?.colorMode}:{},[o.direction,e.locale,r,t.resolvedTheme?.colorMode,t.themeId])}a(ke,"useMonkeysComponentAttributes");function im(){return ho.useContext(Ia).iconResolver}a(im,"useMonkeysAssetIconResolver");function vh(){return ho.useContext(Ia).imageResolver}a(vh,"useMonkeysAssetImageResolver");function wh(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}a(wh,"isRecord");function _T(e){if(e!==void 0&&e!=="ltr"&&e!=="rtl")throw new TypeError('MonkeysProvider direction must be "ltr" or "rtl".')}a(_T,"validateDirection");function GT(e){if(e!==void 0){if(!wh(e))throw new TypeError("MonkeysProvider environment must be an object.");if(e.getDocument!==void 0&&typeof e.getDocument!="function")throw new TypeError("MonkeysProvider environment.getDocument must be a function.");if(e.getWindow!==void 0&&typeof e.getWindow!="function")throw new TypeError("MonkeysProvider environment.getWindow must be a function.")}}a(GT,"validateEnvironment");function $T(e){if(e!==void 0){if(!wh(e))throw new TypeError("MonkeysProvider portal must be an object.");if(e.disabled!==void 0&&typeof e.disabled!="boolean")throw new TypeError("MonkeysProvider portal.disabled must be a boolean.");if(e.container!=null&&typeof e.container!="function"&&typeof e.container!="object")throw new TypeError("MonkeysProvider portal.container must be an Element, null, or a function.")}}a($T,"validatePortal");function jT(e,t,o,r){return e?xs(e,{colorMode:t,density:o}):r}a(jT,"resolveProviderTheme");function kh({children:e,locale:t,messages:o,direction:r,theme:n,themeId:i,colorMode:s,density:l,appearance:d,environment:c,iconResolver:p,imageResolver:u,portal:g,statusStates:f,listFooter:b}){let x=ho.useContext(di),y=ho.useContext(dn),k=ho.useContext(vs),w=ho.useContext(Ia);if(_T(r),GT(c),p!==void 0&&typeof p!="function")throw new TypeError("MonkeysProvider iconResolver must be a function.");if(u!==void 0&&typeof u!="function")throw new TypeError("MonkeysProvider imageResolver must be a function.");$T(g);let v=ho.useMemo(()=>kd(t,o,x),[t,o,x]),h=ho.useMemo(()=>({...v,provided:true}),[v]),S=ho.useMemo(()=>jT(n,s,l,y.resolvedTheme),[s,l,y.resolvedTheme,n]),T=ho.useMemo(()=>({provided:true,resolvedTheme:S,themeId:i??y.themeId,baseAppearance:{...y.baseAppearance,...d?.base,...l?{density:l}:void 0,slots:{...y.baseAppearance?.slots,...d?.base?.slots},styles:{...y.baseAppearance?.styles,...d?.base?.styles}},dataExplorerAppearance:{...y.dataExplorerAppearance,...d?.dataExplorer,...l?{density:l}:void 0,slots:{...y.dataExplorerAppearance?.slots,...d?.dataExplorer?.slots},styles:{...y.dataExplorerAppearance?.styles,...d?.dataExplorer?.styles}},statusStates:{...y.statusStates,...f,loading:{...y.statusStates?.loading,...f?.loading},empty:{...y.statusStates?.empty,...f?.empty},error:{...y.statusStates?.error,...f?.error},permission:{...y.statusStates?.permission,...f?.permission}},listFooter:{...y.listFooter,...b,...b?.pageSizeOptions?{pageSizeOptions:[...b.pageSizeOptions]}:void 0}}),[d?.base,d?.dataExplorer,l,y.baseAppearance,y.dataExplorerAppearance,y.statusStates,y.themeId,S,f,b,i]),C=ho.useMemo(()=>({provided:true,direction:r??k.direction??"ltr"}),[r,k.direction]),R=ho.useMemo(()=>({provided:true,iconResolver:p??w.iconResolver,imageResolver:u??w.imageResolver,environment:{...w.environment,...c},portal:{...w.portal,...g}}),[c,w.environment,w.iconResolver,p,u,w.imageResolver,w.portal,g]);return jsxRuntime.jsx(di.Provider,{value:h,children:jsxRuntime.jsx(dn.Provider,{value:T,children:jsxRuntime.jsx(vs.Provider,{value:C,children:jsxRuntime.jsx(Ia.Provider,{value:R,children:e})})})})}a(kh,"MonkeysProvider");function m(...e){return tailwindMerge.twMerge(e.filter(Boolean).join(" "))}a(m,"cn");function V(e){return e!=null&&typeof e!="boolean"}a(V,"hasRenderableNode");function Md(e){return typeof e=="string"?e.trim().length>0:V(e)}a(Md,"hasNonEmptyRenderableNode");var JT={"bottom-start":{side:"bottom",align:"start"},"bottom-end":{side:"bottom",align:"end"},"top-start":{side:"top",align:"start"},"top-end":{side:"top",align:"end"}};function sm(e,t=0){return e.flatMap(o=>[{...o,depth:t},...o.children?sm(o.children,t+1):[]])}a(sm,"flattenOptions");function eN(e){let t=new Set;sm(e).forEach(o=>{if(!o||typeof o!="object")throw new TypeError("UnifiedDropdown options must contain objects.");if(typeof o.value!="string"||!o.value.trim())throw new TypeError("UnifiedDropdown option value must be a non-empty string.");if(t.has(o.value))throw new TypeError(`UnifiedDropdown option value "${o.value}" must be unique.`);t.add(o.value);});}a(eN,"validateOptions");function tN(e){let t=Array.isArray(e)?e:e===void 0?[]:[e];return [...new Set(t.filter(o=>typeof o=="string"))]}a(tN,"normalizeValues");function Nh(e){return e.textValue?e.textValue:typeof e.label=="string"?e.label:e.value}a(Nh,"getOptionText");function fi(e){return e==="multi"||e==="checkbox"}a(fi,"isMultiMode");function oN(e,t){return Nh(e).toLocaleLowerCase().includes(t.toLocaleLowerCase())}a(oN,"matchesSearch");function Th(e,t,o){if(t!==void 0&&(fi(e)?!Array.isArray(t):typeof t!="string"))throw new TypeError(`UnifiedDropdown ${o} must be ${fi(e)?"a string array":"a string"} in ${e} mode.`)}a(Th,"validateValueShape");var Rh=ho.forwardRef(a(function({mode:t,options:o=[],groups:r=[],value:n,defaultValue:i,placeholder:s="Select\u2026",trigger:l,triggerLabel:d,searchPlaceholder:c="Search\u2026",emptyLabel:p="No options",loadingLabel:u="Loading\u2026",clearLabel:g="Clear selection",retryLabel:f="Retry",loading:b=false,error:x,searchable:y=t==="searchable",clearable:k=false,maxSelections:w,disabled:v=false,invalid:h=false,open:S,defaultOpen:T=false,placement:C="bottom-start",closeOnSelect:R=t!=="multi"&&t!=="checkbox",portal:M=true,size:I="default",width:A="trigger",appearance:N,className:D,classNames:E,slots:P,style:W,onOpenChange:H,onValueChange:B,onSelect:L,onAction:F,onClear:_,onRetry:$,...G},z){if(!["single","multi","searchable","radio","checkbox","tree","action"].includes(t))throw new TypeError(`UnifiedDropdown mode "${String(t)}" is not supported.`);let re=ho.useMemo(()=>r.reduce((te,Te)=>{let ze=typeof Te.label=="string"?Te.label:Te.value;return te.push(...Te.options.map(je=>({...je,group:je.group??ze}))),te},[...o]),[r,o]);if(eN(re),w!==void 0&&(!Number.isFinite(w)||w<0))throw new TypeError("UnifiedDropdown maxSelections must be a non-negative finite number.");if(t==="action"&&(n!==void 0||i!==void 0))throw new TypeError("UnifiedDropdown action mode does not accept a value.");t!=="action"&&(Th(t,n,"value"),Th(t,i,"defaultValue"));let Z=ho.useId(),ae=`${Z}-trigger`,ee=`${Z}-listbox`,q=`${Z}-search`,U=ho.useRef(null),X=ho.useRef([]),[O,K]=ho.useState(T),[ne,fe]=ho.useState(i??(fi(t)?[]:"")),[he,me]=ho.useState(""),[ie,be]=ho.useState(0),He=S!==void 0,We=He?S:O,Ke=tN(n??ne),ce=ho.useMemo(()=>sm(re),[re]),Q=ho.useMemo(()=>y?ce.filter(te=>oN(te,he)):ce,[ce,he,y]),ge=ho.useMemo(()=>new Set(Ke),[Ke]),we=ce.filter(te=>ge.has(te.value)),Ie=we.map(Nh).join(", "),oe=d??(Ie||s),xe=we.length===0&&!d,{side:Ve,align:_e}=JT[C],Ge=t==="action",le=t==="radio"||t==="checkbox",Me=Ge||le?"menu":"listbox";ho.useEffect(()=>{We&&be(0);},[We,he]);let Ae=a(te=>{v||(He||K(te),H?.(te));},"setOpen"),J=a(te=>{n===void 0&&fe(te),B?.(te);},"commitValue"),$e=a(te=>{if(!(v||te.disabled)){if(L?.(te),t==="action"){R&&Ae(false),F&&queueMicrotask(()=>F(te));return}if(fi(t)){let Te=ge.has(te.value)?Ke.filter(ze=>ze!==te.value):w!==void 0&&Ke.length>=w?Ke:[...Ke,te.value];J(Te);}else J(te.value);R&&!fi(t)&&Ae(false);}},"selectOption"),ue=a(te=>{if(!v&&(te.key==="ArrowDown"||te.key==="ArrowUp")){te.preventDefault(),We||Ae(true);let Te=te.key==="ArrowDown"?1:-1;be(ze=>Math.max(0,Math.min(Q.length-1,ze+Te)));}},"handleTriggerKeyDown"),Re=a(te=>{if(te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();let Te=te.key==="ArrowDown"?1:-1;be(ze=>{let je=ze+Te;return Math.max(0,Math.min(Q.length-1,je))});}te.key==="Enter"&&Q[ie]&&(te.preventDefault(),$e(Q[ie]));},"handleContentKeyDown");ho.useEffect(()=>{We&&X.current[ie]?.scrollIntoView({block:"nearest"});},[ie,We]);let se=a(()=>{J(fi(t)?[]:""),_?.();},"clearSelection");return jsxRuntime.jsx(_n__namespace.Root,{open:We,onOpenChange:Ae,children:jsxRuntime.jsxs("div",{...G,ref:z,className:m("relative inline-flex min-w-0",D),style:W,"data-monkeys-component":"unified-dropdown","data-mode":t,"data-state":We?"open":"closed","data-invalid":h||void 0,"data-disabled":v||void 0,"data-appearance-preset":N?.preset,"data-appearance-variant":N?.variant,"data-appearance-density":N?.density,"data-appearance-radius":N?.radius,children:[jsxRuntime.jsx(_n__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{ref:U,id:ae,type:"button",disabled:v,"aria-expanded":We,"aria-haspopup":Ge||le?"menu":"listbox","aria-controls":We?ee:void 0,"aria-invalid":h||void 0,onKeyDown:ue,className:m("flex min-w-0 items-center justify-between gap-2 rounded-md border border-input bg-control-surface px-3 text-left text-sm text-foreground shadow-sm outline-hidden transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-control-surface","disabled:cursor-not-allowed disabled:opacity-50",I==="sm"?"h-8 py-1 text-xs":"h-10 py-2",h&&"border-destructive focus-visible:ring-destructive",A==="responsive"&&"w-full sm:w-auto",E?.trigger),children:[l?jsxRuntime.jsx("span",{className:"min-w-0 shrink-0",children:l}):null,jsxRuntime.jsx("span",{className:m("min-w-0 flex-1 truncate",xe&&"text-muted-foreground"),children:oe}),jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 opacity-60"})]})}),(()=>{let te=jsxRuntime.jsxs(_n__namespace.Content,{id:ee,side:Ve,align:_e,sideOffset:6,collisionPadding:8,avoidCollisions:true,onKeyDown:Re,onOpenAutoFocus:Te=>{Te.preventDefault(),(y?document.getElementById(q):X.current[0])?.focus();},tabIndex:-1,className:m("z-50 max-h-[min(24rem,calc(100vh-1rem))] max-w-[calc(100vw-1rem)] overflow-y-auto rounded-md border bg-menu-surface p-1 text-popover-foreground shadow-md outline-hidden",A==="trigger"&&"w-[var(--radix-popover-trigger-width)] min-w-[12rem]",A==="content"&&"min-w-[12rem] max-w-[min(32rem,calc(100vw-1rem))]",A==="responsive"&&"w-[min(var(--radix-popover-trigger-width),calc(100vw-1rem))] min-w-[12rem]",E?.content),children:[y?jsxRuntime.jsxs("div",{className:"relative mb-1",children:[jsxRuntime.jsx(lucideReact.Search,{"aria-hidden":"true",className:"pointer-events-none absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),jsxRuntime.jsx("input",{id:q,value:he,onChange:Te=>me(Te.target.value),placeholder:c,"aria-label":c,className:m("h-9 w-full rounded-sm border-0 bg-transparent pl-8 pr-2 text-sm outline-hidden ring-0 placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring",E?.search)})]}):null,k&&we.length>0?jsxRuntime.jsx("button",{type:"button",className:"mb-1 w-full rounded-sm px-2 py-1 text-left text-xs text-muted-foreground hover:bg-accent",onClick:se,children:g}):null,b&&Q.length===0?P?.loading?P.loading():jsxRuntime.jsx("div",{role:"status",className:m("px-2 py-6 text-center text-sm text-muted-foreground",E?.empty),children:u}):x&&Q.length===0?P?.error?P.error():jsxRuntime.jsxs("div",{role:"alert",className:m("px-2 py-6 text-center text-sm text-destructive-text",E?.empty),children:[x,$?jsxRuntime.jsx("button",{type:"button",className:"mt-2 block w-full text-center text-foreground underline",onClick:$,children:f}):null]}):Q.length===0?P?.empty?P.empty():jsxRuntime.jsx("div",{role:"status",className:m("px-2 py-6 text-center text-sm text-muted-foreground",E?.empty),children:p}):jsxRuntime.jsx("div",{role:t==="tree"?"tree":Me,"aria-multiselectable":t==="multi"||void 0,children:Q.map((Te,ze)=>{let je=ge.has(Te.value),it=t==="radio"?jsxRuntime.jsx(lucideReact.Circle,{"aria-hidden":"true",className:m("h-3.5 w-3.5",je&&"fill-current")}):jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"});return jsxRuntime.jsxs("div",{children:[Te.group&&(ze===0||Q[ze-1]?.group!==Te.group)?jsxRuntime.jsx("div",{role:"presentation",className:m("px-2 pb-1 pt-2 text-xs font-medium text-muted-foreground",E?.groupLabel),children:Te.group}):null,jsxRuntime.jsxs("button",{ref:Y=>{X.current[ze]=Y;},type:"button",role:t==="tree"?"treeitem":t==="radio"?"menuitemradio":t==="checkbox"?"menuitemcheckbox":Ge?"menuitem":"option","aria-level":t==="tree"?Te.depth+1:void 0,"aria-selected":!Ge&&!le?je:void 0,"aria-checked":le?je:void 0,disabled:Te.disabled,"data-highlighted":ze===ie||void 0,"data-state":je?"checked":"unchecked",onMouseEnter:()=>be(ze),onClick:()=>$e(Te),className:m("relative flex min-h-9 w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm outline-hidden transition-colors","hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50",ze===ie&&"bg-accent text-accent-foreground",je&&"font-medium",Te.danger&&"text-destructive-text",t!=="action"&&"pl-8",E?.item),style:t==="tree"?{paddingInlineStart:`${8+Te.depth*16}px`}:void 0,children:[t!=="action"?jsxRuntime.jsx("span",{className:"absolute left-2 flex h-4 w-4 items-center justify-center",children:je?it:null}):null,P?.option?P.option({option:Te,selected:je,highlighted:ze===ie}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[Te.icon?jsxRuntime.jsx("span",{className:"shrink-0",children:Te.icon}):null,jsxRuntime.jsx("span",{className:m("min-w-0 flex-1 truncate",E?.itemLabel),children:Te.label}),Te.description?jsxRuntime.jsx("span",{className:m("max-w-[45%] truncate text-xs text-muted-foreground",E?.itemDescription),children:Te.description}):null]})]})]},Te.value)})}),x&&Q.length>0?jsxRuntime.jsx("div",{role:"status",className:"px-2 py-1 text-xs text-destructive-text",children:x}):null,b&&Q.length>0?jsxRuntime.jsx("div",{role:"status",className:"px-2 py-1 text-xs text-muted-foreground",children:u}):null,P?.footer?P.footer():null]});return M?jsxRuntime.jsx(_n__namespace.Portal,{children:te}):te})()]})})},"UnifiedDropdown"));var Mh=ho.createContext(void 0);function Ih({appearance:e,children:t}){return jsxRuntime.jsx(Mh.Provider,{value:e,children:t})}a(Ih,"DataExplorerAppearanceProvider");function Et(e){let t=ho.useContext(Mh);return ho.useMemo(()=>e?t?{...t,...e,slots:{...t.slots,...e.slots},styles:{...t.styles,...e.styles}}:e:t,[e,t])}a(Et,"useDataExplorerAppearance");function j(...e){return e.filter(Boolean).join(" ")}a(j,"cn");function Mt(e,t){return typeof e=="function"?e(t):e}a(Mt,"resolveDataExplorerValue");var lN={},Ph={surfaceRoot:"relative flex h-full min-h-0 w-full min-w-0 overflow-hidden rounded-md border border-border bg-background shadow-sm",toolbarRoot:"flex flex-wrap items-center gap-2 border-b border-border bg-background px-4 py-3",toolbarLeading:"flex items-center gap-2",toolbarSearch:"flex h-10 min-w-52 flex-1 items-center gap-2 rounded-md border border-border bg-background px-3 text-sm",toolbarSearchIcon:"inline-flex shrink-0 text-muted-foreground",toolbarSearchInput:"min-w-0 flex-1 bg-transparent text-sm outline-hidden placeholder:text-muted-foreground",toolbarViewSwitch:"flex items-center rounded-md border border-border bg-background p-0.5",toolbarViewButton:"inline-flex h-9 min-w-9 items-center justify-center gap-2 rounded-md px-2 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50",toolbarViewButtonActive:"bg-muted text-foreground",toolbarActions:"flex items-center gap-2",actionBarRoot:"flex min-w-0 flex-wrap items-center gap-2",actionBarLeading:"flex shrink-0 items-center gap-2",actionBarActions:"flex min-w-0 flex-1 flex-wrap items-center gap-2",actionBarTrailing:"flex shrink-0 items-center gap-2",actionButtonBase:"inline-flex h-9 items-center justify-center gap-2 rounded-md border px-3 text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",actionButtonDefault:"border-border bg-background text-foreground hover:bg-accent/60",actionButtonPrimary:"border-primary/20 bg-primary/10 text-primary hover:bg-primary/15",actionButtonDanger:"border-destructive/20 bg-destructive/10 text-destructive-text hover:bg-destructive/15",actionButtonMuted:"border-border/60 bg-muted/45 text-muted-foreground hover:bg-muted/70 hover:text-foreground",actionButtonActive:"ring-1 ring-primary/30",actionButtonDisabled:"cursor-not-allowed opacity-60",actionIconButton:"w-9 px-0",actionToggleActive:"border-primary/30 bg-primary/10 text-primary",controlButton:"inline-flex h-10 min-w-0 items-center justify-center gap-2 rounded-md border border-border bg-background px-3 text-sm font-medium text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",controlButtonIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current [&_svg_*]:!stroke-current",controlButtonLabel:"min-w-0 truncate",controlSelectTrigger:"inline-flex h-10 min-w-28 items-center justify-between gap-3 rounded-md border border-border bg-background px-3 text-sm font-medium text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",controlSelectValue:"flex min-w-0 items-center gap-1 truncate",controlCheckbox:"inline-flex h-9 items-center gap-2 rounded-md border border-border bg-background px-3 text-sm font-medium text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",controlCheckboxIndicator:"flex h-4 w-4 shrink-0 items-center justify-center rounded border border-border bg-background text-primary",controlCheckboxLabel:"min-w-0 truncate",menuTrigger:"inline-flex h-8 w-8 items-center justify-center rounded-md text-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",menuContent:"z-50 min-w-36 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-hidden",menuLabel:"px-2 py-1.5 text-xs font-medium text-muted-foreground",menuSeparator:"-mx-1 my-1 h-px bg-border",menuItem:"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",menuItemPrimary:"text-primary focus:text-primary",menuItemDanger:"text-destructive-text focus:text-destructive-text",menuItemMuted:"text-muted-foreground",menuItemIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center",menuItemLabel:"truncate",cardRoot:"group relative flex min-w-0 flex-col overflow-hidden rounded-lg border border-border/70 bg-background transition-shadow",cardInteractive:"cursor-pointer hover:shadow-sm",cardSelected:"ring-2 ring-primary",cardDisabled:"opacity-60",cardHeader:"p-4",cardMedia:"shrink-0 overflow-hidden",cardFooter:"shrink-0 border-t border-border/60 px-4 py-3",recordCardRoot:"group relative border-border/70 transition-shadow hover:shadow-sm",recordCardActive:"z-10 ring-2 ring-monkeys-500",footerRoot:"flex items-center border-t border-border bg-background px-4 py-3",footerSummary:"flex items-center gap-1 whitespace-nowrap text-sm text-muted-foreground",footerJumpButton:"inline-flex items-center gap-1 text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",footerPageSizeSelect:"h-8 rounded-md border border-border bg-background px-2 text-sm text-foreground",previewRoot:"relative h-full min-h-0 w-full flex-1 select-none self-stretch overflow-hidden bg-slate-950",previewPlaceholder:"flex h-full w-full items-center justify-center rounded-xl bg-white/5 px-6 text-center text-sm text-white/60",previewActions:"absolute right-4 top-4 z-20 flex flex-col gap-2",previewControls:"absolute bottom-4 right-4 z-20 flex flex-col gap-2",previewZoomLabel:"min-w-[3rem] rounded-full border border-white/15 bg-black/30 px-1 py-1 text-center text-xs font-medium text-white/70 shadow-lg backdrop-blur",previewControlButton:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur transition hover:bg-black/45",previewNavigationButton:"absolute top-1/2 flex h-10 w-10 -translate-y-1/2 items-center justify-center rounded-full border border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur transition-colors hover:bg-black/45 disabled:pointer-events-none disabled:opacity-40",detailRoot:"flex h-full flex-col overflow-hidden bg-background",detailHeader:"flex items-center justify-between gap-3 border-b border-border bg-background px-4 py-4 sm:px-5",detailLeading:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",detailNavigation:"hidden items-center gap-1 rounded-lg border border-border bg-background px-1 py-1 md:flex",detailNavigationButton:"flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-50",detailCloseButton:"flex h-10 w-10 items-center justify-center rounded-full border border-border bg-background text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",detailPreviewPanel:"min-h-0 overflow-hidden border-b border-border bg-background xl:border-b-0",detailPreviewFrame:"relative h-full min-h-0 w-full overflow-hidden bg-background",detailRightPanel:"min-h-0 min-w-0 border-t border-border bg-background xl:border-l xl:border-t-0",detailRightPanelBody:"h-full overflow-y-auto overscroll-contain bg-background p-5",treeShellRoot:"flex h-full min-h-0 flex-col overflow-hidden",treeShellHeader:"flex shrink-0 items-start justify-between gap-3 px-4 py-3",treeShellTitle:"truncate text-sm font-semibold",treeShellSubtitle:"mt-1 text-sm text-muted-foreground",treeShellToolbar:"flex shrink-0 items-center gap-2",treeShellBody:"min-h-0 flex-1 overflow-hidden",treeShellFooter:"shrink-0",treeRoot:"min-w-0 space-y-1 overflow-hidden text-sm",treeGroup:"min-w-0 space-y-1",treeGroupHeader:"group/tree-group flex min-w-0 items-center gap-1",treeGroupHeaderButton:"flex h-9 min-w-0 flex-1 items-center gap-2 rounded-md px-2 text-left font-medium text-muted-foreground transition-colors hover:bg-accent/55 hover:text-foreground",treeGroupContent:"min-w-0 space-y-0.5",treeGroupActions:"shrink-0 opacity-0 transition-opacity group-hover/tree-group:opacity-100 data-[state=open]:opacity-100",treeNode:"min-w-0",treeNodeButton:"group/tree-node flex min-h-9 w-full min-w-0 items-center gap-1 rounded-md pr-1 text-left text-sm text-foreground transition-colors hover:bg-accent/55 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",treeNodeSelected:"bg-accent text-accent-foreground",treeNodeDisabled:"cursor-not-allowed opacity-55",treeNodeDragging:"opacity-50",treeNodeToggle:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",treeNodeIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground group-hover/tree-node:text-foreground",treeNodeLabel:"min-w-0 truncate",treeNodeDescription:"mt-0.5 truncate text-xs text-muted-foreground",treeNodeMeta:"ml-2 shrink-0 text-xs text-muted-foreground",treeNodeBadge:"ml-2 shrink-0 rounded-full border border-border bg-muted px-1.5 py-0.5 text-[11px] leading-none text-muted-foreground",treeNodeActions:"ml-1 shrink-0 opacity-0 transition-opacity group-hover/tree-node:opacity-100 data-[state=open]:opacity-100",treeNodeChildren:"mt-0.5 min-w-0 space-y-0.5",treeNodeDragHandle:"inline-flex h-5 w-5 shrink-0 cursor-grab items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground active:cursor-grabbing group-hover/tree-node:opacity-100",treeEmpty:"px-3 py-2 text-xs text-muted-foreground",treeError:"px-3 py-2 text-xs text-destructive-text",treeLoading:"px-3 py-2 text-xs text-muted-foreground"},dN={flush:{surfaceRoot:"relative flex h-full min-h-0 w-full min-w-0 overflow-hidden"}},cN={compact:{treeShellHeader:"px-3 py-2",toolbarRoot:"px-3 py-2",toolbarSearch:"h-9 min-w-48",toolbarViewButton:"h-8 min-w-8 text-xs",actionButtonBase:"h-8 px-2.5 text-xs",actionIconButton:"h-8 w-8 px-0",controlButton:"h-9 px-2.5 text-xs",controlSelectTrigger:"h-9 min-w-24 px-2.5 text-xs",controlCheckbox:"h-8 px-2.5 text-xs",menuTrigger:"h-8 w-8",footerRoot:"px-3 py-2",footerPageSizeSelect:"h-8 text-xs",treeGroupHeaderButton:"h-8 text-xs",treeNodeButton:"min-h-8 text-xs",treeEmpty:"py-1.5 text-xs",treeError:"py-1.5 text-xs",treeLoading:"py-1.5 text-xs"},default:{},comfortable:{treeShellHeader:"px-5 py-4",toolbarRoot:"px-5 py-4",toolbarSearch:"h-11",toolbarViewButton:"h-10 min-w-10",actionButtonBase:"h-10 px-3.5",actionIconButton:"h-10 w-10 px-0",controlButton:"h-11 px-3.5",controlSelectTrigger:"h-11 min-w-32 px-3.5",controlCheckbox:"h-10 px-3.5",menuTrigger:"h-9 w-9",footerRoot:"px-5 py-3.5",treeGroupHeaderButton:"h-10",treeNodeButton:"min-h-10"}},uN={none:{surfaceRoot:"rounded-none",toolbarSearch:"rounded-none",toolbarViewSwitch:"rounded-none",toolbarViewButton:"rounded-none",actionButtonBase:"rounded-none",controlButton:"rounded-none",controlSelectTrigger:"rounded-none",controlCheckbox:"rounded-none",controlCheckboxIndicator:"rounded-none",menuTrigger:"rounded-none",menuContent:"rounded-none",menuItem:"rounded-none",cardRoot:"rounded-none",footerPageSizeSelect:"rounded-none",detailLeading:"rounded-none",detailNavigation:"rounded-none",detailNavigationButton:"rounded-none",detailCloseButton:"rounded-none",treeGroupHeaderButton:"rounded-none",treeNodeButton:"rounded-none",treeNodeToggle:"rounded-none",treeNodeBadge:"rounded-none",treeNodeDragHandle:"rounded-none"},sm:{surfaceRoot:"rounded-sm",toolbarSearch:"rounded-sm",toolbarViewSwitch:"rounded-sm",toolbarViewButton:"rounded-sm",actionButtonBase:"rounded-sm",controlButton:"rounded-sm",controlSelectTrigger:"rounded-sm",controlCheckbox:"rounded-sm",controlCheckboxIndicator:"rounded-sm",menuTrigger:"rounded-sm",menuContent:"rounded-sm",menuItem:"rounded-sm",cardRoot:"rounded-sm",treeGroupHeaderButton:"rounded-sm",treeNodeButton:"rounded-sm",treeNodeToggle:"rounded-sm",treeNodeBadge:"rounded-sm",treeNodeDragHandle:"rounded-sm"},md:{},lg:{surfaceRoot:"rounded-xl",toolbarSearch:"rounded-lg",toolbarViewSwitch:"rounded-lg",toolbarViewButton:"rounded-lg",actionButtonBase:"rounded-lg",controlButton:"rounded-lg",controlSelectTrigger:"rounded-lg",controlCheckbox:"rounded-lg",controlCheckboxIndicator:"rounded-md",menuTrigger:"rounded-lg",menuContent:"rounded-lg",cardRoot:"rounded-xl",treeGroupHeaderButton:"rounded-lg",treeNodeButton:"rounded-lg",treeNodeToggle:"rounded-md",treeNodeBadge:"rounded-lg",treeNodeDragHandle:"rounded-md"},xl:{surfaceRoot:"rounded-2xl",toolbarSearch:"rounded-xl",toolbarViewSwitch:"rounded-xl",toolbarViewButton:"rounded-xl",actionButtonBase:"rounded-xl",controlButton:"rounded-xl",controlSelectTrigger:"rounded-xl",controlCheckbox:"rounded-xl",controlCheckboxIndicator:"rounded-lg",menuTrigger:"rounded-xl",menuContent:"rounded-xl",cardRoot:"rounded-2xl",treeGroupHeaderButton:"rounded-xl",treeNodeButton:"rounded-xl",treeNodeToggle:"rounded-lg",treeNodeBadge:"rounded-xl",treeNodeDragHandle:"rounded-lg"},full:{surfaceRoot:"rounded-2xl",toolbarSearch:"rounded-full",toolbarViewSwitch:"rounded-full",toolbarViewButton:"rounded-full",actionButtonBase:"rounded-full",controlButton:"rounded-full",controlSelectTrigger:"rounded-full",controlCheckbox:"rounded-full",controlCheckboxIndicator:"rounded-full",menuTrigger:"rounded-full",cardRoot:"rounded-2xl",treeGroupHeaderButton:"rounded-full",treeNodeButton:"rounded-full",treeNodeToggle:"rounded-full",treeNodeBadge:"rounded-full",treeNodeDragHandle:"rounded-full"}},pN={none:{surfaceRoot:"border-transparent",toolbarRoot:"border-transparent",toolbarSearch:"border-transparent",toolbarViewSwitch:"border-transparent",actionButtonBase:"border-transparent",controlButton:"border-transparent",controlSelectTrigger:"border-transparent",controlCheckbox:"border-transparent",cardRoot:"border-transparent",footerRoot:"border-transparent",detailHeader:"border-transparent",detailPreviewPanel:"border-transparent",detailRightPanel:"border-transparent"},subtle:{surfaceRoot:"border-border/60",toolbarRoot:"border-border/60",toolbarSearch:"border-border/60",toolbarViewSwitch:"border-border/60",actionButtonDefault:"border-border/60",controlButton:"border-border/60",controlSelectTrigger:"border-border/60",controlCheckbox:"border-border/60",cardRoot:"border-border/60",footerRoot:"border-border/60"},solid:{},strong:{surfaceRoot:"border-foreground/20",toolbarRoot:"border-foreground/20",toolbarSearch:"border-foreground/20",toolbarViewSwitch:"border-foreground/20",actionButtonDefault:"border-foreground/20",controlButton:"border-foreground/20",controlSelectTrigger:"border-foreground/20",controlCheckbox:"border-foreground/20",cardRoot:"border-foreground/20",footerRoot:"border-foreground/20"}},mN={plain:{},muted:{surfaceRoot:"bg-card",toolbarRoot:"bg-muted/20",toolbarSearch:"bg-background",toolbarViewSwitch:"bg-background",controlButton:"bg-background",controlSelectTrigger:"bg-background",controlCheckbox:"bg-background",cardRoot:"bg-card",footerRoot:"bg-muted/20",detailHeader:"bg-muted/20"},soft:{surfaceRoot:"bg-background/95 shadow-sm",toolbarRoot:"bg-background/95",actionButtonDefault:"bg-muted/30 hover:bg-muted/55",controlButton:"bg-muted/30 hover:bg-muted/55",controlSelectTrigger:"bg-muted/30 hover:bg-muted/55",controlCheckbox:"bg-muted/30 hover:bg-muted/55",cardRoot:"bg-background/95 shadow-sm",footerRoot:"bg-background/95"},glass:{surfaceRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",toolbarRoot:"border-white/10 bg-white/5 backdrop-blur-md",toolbarSearch:"border-white/10 bg-white/5",toolbarViewSwitch:"border-white/10 bg-white/5",actionButtonDefault:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlButton:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlSelectTrigger:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlCheckbox:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",controlCheckboxIndicator:"border-white/15 bg-white/10",cardRoot:"border-white/10 bg-white/[0.06] shadow-none",footerRoot:"border-white/10 bg-white/5 backdrop-blur-md"},"dark-stage":{previewRoot:"bg-slate-950",previewPlaceholder:"bg-white/5 text-white/60",actionButtonBase:"inline-flex h-9 items-center justify-center gap-2 rounded-full border px-3 text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-white/45 focus-visible:ring-offset-0",actionButtonDefault:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",controlButton:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",controlSelectTrigger:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",controlCheckbox:"border-white/15 bg-black/30 text-white/90 shadow-lg backdrop-blur hover:bg-black/[0.45]",actionButtonPrimary:"border-white/25 bg-white/20 text-white shadow-lg backdrop-blur hover:bg-white/28",actionButtonMuted:"border-white/10 bg-black/20 text-white/70 shadow-lg backdrop-blur hover:bg-black/[0.35] hover:text-white",actionIconButton:"h-9 w-9 px-0"}},Dh={default:{density:"default",radius:"md",border:"solid",background:"plain"},soft:{density:"default",radius:"md",border:"subtle",background:"plain"},compact:{density:"compact",radius:"md",border:"subtle",background:"soft"},"tinted-glass":{density:"default",radius:"lg",border:"subtle",background:"glass"},flat:{density:"compact",radius:"none",border:"solid",background:"plain"},glass:{density:"default",radius:"lg",border:"subtle",background:"glass"},"hard-edge":{density:"compact",radius:"none",border:"solid",background:"plain"}},fN={soft:{actionButtonBase:"font-medium",controlButton:"font-medium",controlSelectTrigger:"font-medium",controlCheckbox:"font-medium",menuTrigger:"rounded-full",cardRoot:"border-border/70"},compact:{toolbarRoot:"gap-2",actionButtonBase:"text-xs",controlButton:"text-xs",controlSelectTrigger:"text-xs",controlCheckbox:"text-xs",footerRoot:"text-xs"},"tinted-glass":{actionButtonDefault:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",actionButtonPrimary:"border-primary/30 bg-primary/15 text-primary-foreground hover:bg-primary/20",actionButtonMuted:"border-border/50 bg-muted/20 text-muted-foreground hover:bg-muted/45 hover:text-foreground",controlButton:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",controlSelectTrigger:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",controlCheckbox:"border-border/60 bg-background/10 text-foreground hover:bg-accent/60",controlCheckboxIndicator:"border-border/60 bg-background/10 text-primary",menuContent:"border-border bg-popover text-popover-foreground shadow-2xl",menuSeparator:"bg-border",menuItem:"focus:bg-accent focus:text-accent-foreground",cardSelected:"ring-2 ring-primary",previewRoot:"bg-background",treeGroupHeaderButton:"text-muted-foreground hover:bg-accent/60 hover:text-foreground",treeNodeButton:"text-foreground hover:bg-accent/60 hover:text-accent-foreground focus-visible:ring-ring",treeNodeSelected:"bg-accent text-accent-foreground",treeNodeToggle:"text-muted-foreground hover:bg-accent hover:text-foreground",treeNodeIcon:"text-muted-foreground group-hover/tree-node:text-foreground",treeNodeMeta:"text-muted-foreground",treeNodeBadge:"border-border bg-muted text-muted-foreground",treeNodeActions:"text-muted-foreground",treeNodeDragHandle:"text-muted-foreground hover:bg-accent hover:text-foreground group-hover/tree-node:opacity-100",treeEmpty:"text-muted-foreground",treeError:"text-destructive-text",treeLoading:"text-muted-foreground"},flat:{toolbarRoot:"border-slate-200 bg-white",toolbarSearch:"rounded-none border-slate-200 bg-white shadow-none",toolbarViewSwitch:"rounded-none border-slate-200 bg-white shadow-none",actionButtonBase:"rounded-none shadow-none",controlButton:"rounded-none border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",controlSelectTrigger:"rounded-none border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",controlCheckbox:"rounded-none border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",actionButtonDefault:"border-slate-200 bg-white text-slate-700 hover:bg-slate-50",menuTrigger:"rounded-none border border-slate-200 bg-white text-slate-700 shadow-none hover:bg-slate-50",menuContent:"rounded-none border-slate-200 bg-white shadow-none",cardRoot:"rounded-none border-slate-200 bg-white shadow-none",footerRoot:"border-slate-200 bg-white",treeRoot:"space-y-1 text-sm",treeGroupHeader:"group/tree-group flex min-w-0 items-center",treeGroupHeaderButton:"h-9 rounded-none px-3 text-slate-600 shadow-none hover:bg-slate-100 hover:text-slate-950",treeGroupContent:"space-y-1",treeNodeButton:"min-h-9 rounded-none text-slate-700 hover:bg-slate-100 hover:text-slate-950 focus-visible:ring-slate-300",treeNodeSelected:"bg-slate-100 text-slate-950",treeNodeToggle:"rounded-none text-slate-500 hover:bg-transparent hover:text-slate-950",treeNodeIcon:"text-slate-500 group-hover/tree-node:text-slate-950",treeNodeDragHandle:"rounded-none text-slate-400 hover:bg-transparent hover:text-slate-700",treeNodeActions:"text-slate-500"},glass:{menuContent:"border-white/10 bg-slate-950/90 text-white backdrop-blur-xl",menuSeparator:"bg-white/10",menuItem:"focus:bg-white/10 focus:text-white"},"hard-edge":{toolbarRoot:"border-slate-200 bg-white",actionButtonBase:"rounded-none shadow-none",controlButton:"rounded-none shadow-none",controlSelectTrigger:"rounded-none shadow-none",controlCheckbox:"rounded-none shadow-none",cardRoot:"rounded-none border-slate-200 bg-white shadow-none",footerRoot:"border-slate-200 bg-white",footerPageSizeSelect:"rounded-none border-slate-200 shadow-none"}},bN=Object.keys(Ph);function gN(...e){return bN.reduce((t,o)=>(t[o]=j(...e.map(r=>r?.[o])),t),{})}a(gN,"mergeSlots");function hN(...e){return e.reduce((t,o)=>({...t,...o}),{})}a(hN,"mergeStyles");function yN(e){let t=Dh[e];if(!t)throw new TypeError(`Unknown Data Explorer theme preset "${String(e)}". Expected one of: ${Object.keys(Dh).join(", ")}.`);return t}a(yN,"getPresetDefaults");function Ct(e){let t=e?.preset??"default",o=e?.surface??"card",r=yN(t),n=e?.density??r.density??"default",i=e?.radius??r.radius??"md",s=e?.border??r.border??"solid",l=e?.background??r.background??"plain",d=gN(Ph,fN[t],cN[n],uN[i],pN[s],mN[l],e?.slots);return o==="flush"&&(d.surfaceRoot=j(dN.flush.surfaceRoot,e?.slots?.surfaceRoot)),{surface:o,preset:t,density:n,radius:i,border:s,background:l,styles:hN(lN,e?.styles),slots:d}}a(Ct,"resolveDataExplorerAppearance");function Pd(e,t,o){return j(t==="primary"?e.slots.actionButtonPrimary:t==="danger"?e.slots.actionButtonDanger:t==="muted"?e.slots.actionButtonMuted:e.slots.actionButtonDefault,o&&e.slots.actionButtonActive)}a(Pd,"getDataExplorerActionToneClassName");function Gn(e,t){if(t==="primary")return e.slots.menuItemPrimary;if(t==="danger")return e.slots.menuItemDanger;if(t==="muted")return e.slots.menuItemMuted}a(Gn,"getDataExplorerMenuItemToneClassName");function vN(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4 animate-spin",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(vN,"LoadingIcon");var ws=ho.forwardRef(a(function({children:t,label:o,icon:r,endIcon:n,type:i="button",title:s,ariaLabel:l,tone:d,active:c=false,iconOnly:p=false,disabled:u=false,loading:g=false,stopPropagation:f=false,appearance:b,className:x,classNames:y,style:k,onClick:w,"aria-label":v,...h},S){let T=Ct(Et(b)),C=t??o,R=u||g,M=a(I=>{f&&I.stopPropagation(),!R&&w?.(I);},"handleClick");return jsxRuntime.jsxs("button",{...h,ref:S,type:i,title:s,"aria-label":l??v,"aria-pressed":c||void 0,"aria-busy":g||void 0,disabled:R,className:j(T.slots.controlButton,p&&T.slots.actionIconButton,Pd(T,d,c),R&&T.slots.actionButtonDisabled,y?.root,x),style:{...T.styles.control,...c?T.styles.controlActive:void 0,...R?T.styles.controlDisabled:void 0,...k},onClick:M,children:[g?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonIcon,y?.icon),children:jsxRuntime.jsx(vN,{})}):r?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonIcon,y?.icon),children:r}):null,p?jsxRuntime.jsx("span",{className:"sr-only",children:C}):C?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonLabel,y?.label),children:C}):null,n?jsxRuntime.jsx("span",{className:j(T.slots.controlButtonIcon,y?.icon),children:n}):null]})},"DataExplorerButton"));function wN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",children:jsxRuntime.jsx("path",{d:"m5 12 4 4L19 6"})})}a(wN,"CheckIcon");function Ed({checked:e=false,icon:t,label:o,title:r,disabled:n=false,appearance:i,className:s,classNames:l,style:d,onCheckedChange:c}){let p=Ct(Et(i));return jsxRuntime.jsxs("button",{type:"button",title:r,"aria-pressed":e,disabled:n,className:j(p.slots.controlCheckbox,e&&p.slots.actionToggleActive,n&&p.slots.actionButtonDisabled,l?.root,s),style:{...p.styles.control,...e?p.styles.controlActive:void 0,...n?p.styles.controlDisabled:void 0,...d},onClick:u=>{u.stopPropagation(),!n&&c?.(!e);},children:[jsxRuntime.jsx("span",{className:j(p.slots.controlCheckboxIndicator,l?.indicator,t!=null&&!e&&l?.icon),children:e?jsxRuntime.jsx(wN,{}):t}),o?jsxRuntime.jsx("span",{className:j(p.slots.controlCheckboxLabel,l?.label),children:o}):null]})}a(Ed,"DataExplorerCheckbox");function CN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}a(CN,"ChevronDownIcon");function SN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m5 12 4 4L19 6"})})}a(SN,"CheckIcon");function Bd({value:e="",options:t=[],label:o,placeholder:r="Select",icon:n,title:i,triggerLabel:s,disabled:l=false,display:d="value",align:c="start",sideOffset:p=6,appearance:u,className:g,classNames:f,style:b,onValueChange:x}){let y=Ct(Et(u)),k=t.find(v=>v.value===e),w=d==="label-value"&&o?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{children:o}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:k?.label??r})]}):k?.label??o??r;return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{type:"button",title:i,"aria-label":s,disabled:l||t.length===0,className:j(y.slots.controlSelectTrigger,f?.trigger,f?.root,g),style:{...y.styles.control,...b},onClick:v=>v.stopPropagation(),children:[n?jsxRuntime.jsx("span",{className:j(y.slots.controlButtonIcon,f?.icon),children:n}):null,jsxRuntime.jsx("span",{className:j(y.slots.controlSelectValue,f?.value),children:w}),jsxRuntime.jsx(CN,{})]})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{align:c,sideOffset:p,className:j(y.slots.menuContent,f?.content),style:y.styles.menuContent,onClick:v=>v.stopPropagation(),children:jsxRuntime.jsx(Bt__namespace.RadioGroup,{value:e,onValueChange:v=>{l||x?.(v);},children:t.map(v=>jsxRuntime.jsxs(Bt__namespace.RadioItem,{value:v.value,title:v.title,disabled:v.disabled,className:j(y.slots.menuItem,f?.item),style:y.styles.menuItem,children:[jsxRuntime.jsx("span",{className:j(y.slots.menuItemIcon,f?.itemIcon),children:v.value===e?jsxRuntime.jsx(SN,{}):v.icon}),jsxRuntime.jsx("span",{className:j(y.slots.menuItemLabel,f?.itemLabel),children:v.label})]},v.value))})})})]})}a(Bd,"DataExplorerSelect");function NN(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}a(NN,"ChevronDownIcon");function lm(e,t){return Mt(e.disabled,t)??Mt(e.loading,t)??false}a(lm,"resolveActionDisabled");function RN(e){return e.onAction??e.onClick}a(RN,"getActionCallback");function MN(e,t,o,r){let n=(Mt(e.disabled,t)??false)||(Mt(e.loading,t)??false),i=Mt(e.active,t)??false;return jsxRuntime.jsxs("div",{children:[e.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:o.slots.menuSeparator}):null,jsxRuntime.jsxs(Bt__namespace.Item,{title:e.title,disabled:n,className:j(o.slots.menuItem,Gn(o,e.tone),i&&"bg-accent text-accent-foreground",r),style:o.styles.menuItem,onSelect:()=>{!e.onAction||n||e.onAction(t);},children:[e.icon?jsxRuntime.jsx("span",{className:o.slots.menuItemIcon,children:e.icon}):null,jsxRuntime.jsx("span",{className:o.slots.menuItemLabel,children:e.label})]}),e.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:o.slots.menuSeparator}):null]},e.id)}a(MN,"renderMenuItem");function IN(e,t,o,r,n){let i=lm(e,t),s=Mt(e.active,t)??false,l=(e.items??[]).filter(d=>Mt(d.visible,t)??true);return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx(ws,{title:e.title,ariaLabel:e.triggerLabel,disabled:i||l.length===0,label:e.label,icon:e.icon,endIcon:jsxRuntime.jsx(NN,{}),tone:e.tone,active:s,stopPropagation:true,appearance:n,className:r?.action})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{align:e.align??"end",sideOffset:e.sideOffset??6,className:j(o.slots.menuContent,r?.menuContent),style:o.styles.menuContent,onClick:d=>d.stopPropagation(),children:[e.menuLabel?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Bt__namespace.Label,{className:o.slots.menuLabel,children:e.menuLabel}),jsxRuntime.jsx(Bt__namespace.Separator,{className:o.slots.menuSeparator})]}):null,l.map(d=>MN(d,t,o,r?.menuItem))]})})]},e.id)}a(IN,"renderMenuAction");function DN(e,t,o,r){let n=lm(e,t),i=String(Mt(e.value,t)??""),s=e.options??[];return jsxRuntime.jsx(Bd,{value:i,label:e.label,icon:e.icon,title:e.title,triggerLabel:e.triggerLabel,disabled:n,display:e.selectDisplay??"label-value",align:e.align??"end",sideOffset:e.sideOffset??6,options:s.map(l=>({value:l.value,label:l.label,icon:l.icon,title:l.title,disabled:Mt(l.disabled,t)??false})),appearance:r,classNames:{trigger:o?.action,content:o?.menuContent,item:o?.menuItem},onValueChange:l=>{!e.onValueChange||n||e.onValueChange(l,t);}},e.id)}a(DN,"renderSelectAction");function PN(e,t,o,r){let n=e.kind??"button",i=n==="toggle"?Mt(e.checked,t)??Mt(e.active,t)??false:Mt(e.active,t)??false,s=lm(e,t),l=RN(e);return n==="toggle"?jsxRuntime.jsx(Ed,{checked:i,icon:e.icon,label:e.label,title:e.title,disabled:s,appearance:o,className:r,onCheckedChange:d=>{e.onCheckedChange&&e.onCheckedChange(d,t);}},e.id):jsxRuntime.jsx(ws,{label:e.label,icon:e.icon,title:e.title,ariaLabel:n==="icon-button"?e.triggerLabel||e.title:void 0,tone:e.tone,active:i,iconOnly:n==="icon-button",disabled:s,loading:Mt(e.loading,t)??false,stopPropagation:true,appearance:o,className:r,onClick:()=>{l&&l(t);}},e.id)}a(PN,"renderButtonAction");function cn({context:e,actions:t=[],layout:o="action-bar",appearance:r,empty:n,children:i,className:s,classNames:l}){let d=Ct(Et(r)),c=t.filter(u=>Mt(u.visible,e)??true).map(u=>{if(u.render)return jsxRuntime.jsx("div",{children:u.render(e)},u.id);if(u.renderTrigger)return jsxRuntime.jsx("div",{children:u.renderTrigger(e)},u.id);let g=u.kind==="menu"?IN(u,e,d,l,r):u.kind==="select"?DN(u,e,l,r):PN(u,e,r,l?.action);return u.wrapTrigger?jsxRuntime.jsx("div",{children:u.wrapTrigger(g,e)},u.id):g});if(c.length===0&&!i&&!n)return null;let p=o==="action-bar"?d.slots.actionBarActions:o==="toolbar"?d.slots.toolbarActions:"flex items-center gap-2";return jsxRuntime.jsxs("div",{className:j(p,l?.root,s),children:[c,i,c.length===0&&!i?n:null]})}a(cn,"DataExplorerToolbarActions");function Ah({context:e,actions:t=[],leading:o,trailing:r,children:n,empty:i,appearance:s,className:l,classNames:d}){let c=Ct(Et(s)),p=!!o||!!r||!!n||t.length>0;return p||!!i?jsxRuntime.jsxs("div",{className:j(c.slots.actionBarRoot,d?.root,l),children:[o?jsxRuntime.jsx("div",{className:j(c.slots.actionBarLeading,d?.leading),children:o}):null,jsxRuntime.jsx(cn,{context:e,actions:t,layout:"action-bar",appearance:s,empty:p?void 0:i,classNames:{root:d?.actions,action:d?.action},children:n}),r?jsxRuntime.jsx("div",{className:j(c.slots.actionBarTrailing,d?.trailing),children:r}):null]}):null}a(Ah,"DataExplorerActionBar");function Bh(e,t){let o=new WeakMap,r=new Map,n=1;return (...i)=>{let s=i.slice(0,-1),l=i[i.length-1],d=s.map(u=>{if(!u)return 0;let g=o.get(u);return g===void 0&&(g=n++,o.set(u,g)),g}).join(":"),c=r.get(d);if(!c){let u={};for(let g of e)u[g]=t(...s.map(f=>f?.[g]));c=Object.freeze(u),r.size>=64&&r.delete(r.keys().next().value),r.set(d,c);}let p={...c};if(l)for(let u of e){let g=l[u];g&&(p[u]=t(...s.map(f=>f?.[u]),g));}return p}}a(Bh,"createStaticSlotMerger");var BN={},to="motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",xr="motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",Ld="motion-safe:transition-transform motion-safe:duration-300 motion-safe:ease-out",Lh=m("[scrollbar-width:thin]","[scrollbar-color:hsl(var(--muted-foreground)/0.45)_transparent]","[&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2","[&::-webkit-scrollbar-button]:hidden [&::-webkit-scrollbar-button]:h-0 [&::-webkit-scrollbar-button]:w-0 [&::-webkit-scrollbar-button]:bg-transparent","[&::-webkit-scrollbar-button:single-button]:hidden [&::-webkit-scrollbar-button:single-button]:h-0 [&::-webkit-scrollbar-button:single-button]:w-0","[&::-webkit-scrollbar-button:double-button]:hidden [&::-webkit-scrollbar-button:double-button]:h-0 [&::-webkit-scrollbar-button:double-button]:w-0","[&::-webkit-scrollbar-corner]:bg-transparent","[&::-webkit-scrollbar-track]:bg-transparent","[&:has(thead.sticky)::-webkit-scrollbar-track]:mt-[var(--base-table-header-height)]","[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/40","hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/55"),LN=m("[&.sticky_th]:sticky [&.sticky_th]:top-0 [&.sticky_th]:z-[2]","[&.sticky_th]:bg-[var(--base-table-sticky-header-bg)]","[&.sticky_th]:shadow-[inset_0_-1px_0_var(--base-table-header-separator)]"),Fh={buttonBase:m("group/button inline-flex min-w-0 items-center justify-center gap-2 rounded-md border px-3 text-sm font-medium focus-visible:outline-hidden","cursor-pointer disabled:!cursor-not-allowed",xr),buttonDefault:"border-border bg-background text-foreground hover:bg-accent/60",buttonPrimary:"border-primary/20 bg-primary/10 text-primary hover:bg-primary/15",buttonSuccess:"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-[hsl(var(--success,142_72%_29%))] hover:bg-[hsl(var(--success,142_72%_29%)_/_0.15)]",buttonWarning:"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))] hover:bg-[hsl(var(--warning,45_93%_47%)_/_0.15)]",buttonDanger:"border-destructive/20 bg-destructive/10 text-destructive-text hover:bg-destructive/15",buttonMuted:"border-border/60 bg-muted/45 text-muted-foreground hover:bg-muted/70 hover:text-foreground",buttonActive:"border-primary/35 bg-primary/10 text-primary",buttonDisabled:"!cursor-not-allowed opacity-60",buttonIconOnly:"w-9 px-0",buttonIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current [&_svg_*]:!stroke-current",buttonLabel:"min-w-0 truncate",badgeBase:m("inline-flex max-w-full items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium",to),badgeDefault:"border-border/60 bg-background text-foreground",badgePrimary:"border-primary/30 bg-primary/10 text-primary",badgeSuccess:"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-[hsl(var(--success,142_72%_29%))]",badgeWarning:"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))]",badgeDanger:"border-destructive/30 bg-destructive/10 text-destructive-text",badgeMuted:"border-border/60 bg-muted text-muted-foreground",badgeIcon:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",badgeLabel:"min-w-0 truncate",textRoot:"min-w-0 break-words leading-6",textSizeXs:"text-xs",textSizeSm:"text-sm",textSizeMd:"text-base",textSizeLg:"text-lg",textSizeXl:"text-xl",typographyToneDefault:"text-foreground",typographyToneMuted:"text-muted-foreground",typographyTonePrimary:"text-primary",typographyToneSuccess:"text-emerald-700 dark:text-emerald-400",typographyToneWarning:"text-amber-700 dark:text-amber-400",typographyToneDanger:"text-destructive-text",typographyToneInherit:"text-inherit",headingRoot:"min-w-0 break-words font-semibold tracking-tight",headingSizeXs:"text-sm leading-5",headingSizeSm:"text-base leading-6",headingSizeMd:"text-lg leading-7",headingSizeLg:"text-xl leading-7",headingSizeXl:"text-2xl leading-8",headingSize2xl:"text-3xl leading-9",linkRoot:"inline break-words underline decoration-current/40 underline-offset-4 hover:decoration-current focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",codeInline:"rounded border border-border/70 bg-muted/60 px-1.5 py-0.5 font-mono text-[0.875em] leading-[1.45] text-foreground",codeBlock:"m-0 max-w-full overflow-x-auto rounded-md border border-border/70 bg-muted/60 p-4 text-foreground",codeContent:"font-mono text-sm leading-6",kbdRoot:"inline-flex min-h-5 items-center rounded border border-border bg-muted/70 px-1.5 font-mono text-[0.75em] font-medium leading-5 text-foreground shadow-[inset_0_-1px_0_hsl(var(--monkeys-color-border))]",listRoot:"m-0 min-w-0 list-outside break-words ps-5 text-foreground",listSpacingCompact:"[&>li+li]:mt-1",listSpacingDefault:"[&>li+li]:mt-2",listSpacingRelaxed:"[&>li+li]:mt-3",listMarkerNone:"list-none ps-0",listMarkerDisc:"list-disc",listMarkerCircle:"list-[circle]",listMarkerSquare:"list-[square]",listMarkerDecimal:"list-decimal",listMarkerLowerAlpha:"list-[lower-alpha]",listMarkerUpperAlpha:"list-[upper-alpha]",listItem:"min-w-0 ps-1 leading-6 marker:text-muted-foreground",stackRoot:"flex min-w-0 flex-col",inlineRoot:"flex min-w-0 flex-row",gridRoot:"grid min-w-0",containerRoot:"mx-auto w-full min-w-0",aspectRatioRoot:"relative min-w-0 overflow-hidden [&>*]:h-full [&>*]:w-full",spinnerRoot:"inline-flex shrink-0 items-center justify-center text-current align-middle",spinnerIndicator:"h-5 w-5 rounded-full border-2 border-current border-r-transparent motion-safe:animate-spin motion-reduce:animate-none",visuallyHiddenRoot:"sr-only",visuallyHiddenFocusable:"focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-[1000] focus:rounded-md focus:bg-background focus:px-4 focus:py-2 focus:text-foreground focus:shadow-lg focus:outline-hidden focus:ring-2 focus:ring-ring focus-within:not-sr-only focus-within:fixed focus-within:left-4 focus-within:top-4 focus-within:z-[1000] focus-within:rounded-md focus-within:bg-background focus-within:px-4 focus-within:py-2 focus-within:text-foreground focus-within:shadow-lg focus-within:ring-2 focus-within:ring-ring",fieldsetRoot:"min-w-0 border-0 p-0 text-foreground",fieldsetLegend:"min-w-0 text-sm font-semibold leading-6 text-foreground",fieldsetDescription:"mt-1 text-sm leading-5 text-muted-foreground",fieldsetError:"mt-1 text-sm leading-5 text-destructive-text",fieldsetContent:"mt-3 grid min-w-0 gap-3",stepsRoot:"m-0 min-w-0 list-none p-0 text-foreground",stepsHorizontal:"flex w-full max-w-full items-start overflow-x-auto pb-2",stepsVertical:"grid",stepsItem:"relative min-w-0",stepsItemHorizontal:"flex min-w-52 flex-1 items-start",stepsItemVertical:"pb-6 last:pb-0",stepsTrigger:"flex min-w-0 flex-1 items-start gap-3 rounded-md border-0 bg-transparent p-1 text-start text-inherit",stepsTriggerInteractive:"cursor-pointer hover:bg-accent/50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",stepsTriggerDisabled:"!cursor-not-allowed opacity-60",stepsIndicator:"relative z-[1] inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full border text-xs font-semibold",stepsIndicatorPending:"border-border bg-background text-muted-foreground",stepsIndicatorCurrent:"border-primary/50 bg-primary/10 text-primary",stepsIndicatorCompleted:"border-primary bg-primary text-primary-foreground",stepsIndicatorError:"border-destructive bg-destructive text-destructive-foreground",stepsContent:"grid min-w-0 gap-1 pt-0.5",stepsLabel:"min-w-0 break-words text-sm font-medium leading-5",stepsDescription:"min-w-0 break-words text-sm leading-5 text-muted-foreground",stepsStatus:"sr-only",stepsConnector:"shrink-0 bg-border",stepsConnectorHorizontal:"mt-3.5 h-px w-8",stepsConnectorVertical:"absolute bottom-0 top-8 start-3.5 w-px -translate-x-1/2",stepsConnectorCompleted:"bg-primary/60",stepsConnectorError:"bg-destructive/60",scrollAreaViewport:"min-h-0 min-w-0",numberInputControl:"tabular-nums",numberInputStepControls:"me-1 flex shrink-0 self-stretch overflow-hidden border-s border-border",numberInputStepButton:"flex min-h-6 w-7 cursor-pointer items-center justify-center border-0 bg-transparent px-1 text-xs leading-none text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:z-[1] focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:!cursor-not-allowed disabled:opacity-40",passwordInputControl:"pe-2",passwordInputToggle:"me-1 inline-flex min-h-7 shrink-0 cursor-pointer items-center justify-center rounded px-2 text-xs font-medium text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:!cursor-not-allowed disabled:opacity-40",inputGroupRoot:m("relative flex min-w-0 items-stretch overflow-hidden rounded-md border border-border bg-background text-foreground focus-within:border-primary/50 focus-within:ring-2 focus-within:ring-ring/30",to),inputGroupInvalid:"border-destructive/55 focus-within:border-destructive/70 focus-within:ring-destructive/25",inputGroupDisabled:"!cursor-not-allowed bg-muted/35",inputGroupContent:"flex min-w-0 flex-1 items-stretch [&>*]:min-w-0",inputGroupStartElement:"inline-flex shrink-0 items-center justify-center ps-3 pe-1 text-foreground/75",inputGroupEndElement:"inline-flex shrink-0 items-center justify-center ps-1 pe-3 text-foreground/75",inputGroupStartAddon:"inline-flex max-w-[min(40%,16rem)] shrink-0 items-center overflow-hidden border-e border-border bg-muted/60 px-3 text-sm text-foreground/75 text-ellipsis whitespace-nowrap [&>*]:min-w-0",inputGroupEndAddon:"inline-flex max-w-[min(40%,16rem)] shrink-0 items-center overflow-hidden border-s border-border bg-muted/60 px-3 text-sm text-foreground/75 text-ellipsis whitespace-nowrap [&>*]:min-w-0",panelRoot:m("group relative flex min-w-0 flex-col overflow-hidden rounded-lg border border-border/70 bg-background",xr),panelInteractive:"cursor-pointer hover:shadow-md",panelSelected:"border-primary/45 bg-primary/5",panelDisabled:"!cursor-not-allowed opacity-60",panelMedia:"shrink-0 overflow-hidden",panelHeader:"min-w-0 p-token-lg",panelTitle:"min-w-0 truncate text-sm font-semibold leading-none text-foreground",panelDescription:"mt-1 text-sm leading-5 text-foreground/75",panelBody:"min-w-0 px-token-lg pb-token-lg text-sm text-foreground",panelBodyStandalone:"pt-token-lg",panelFooter:"shrink-0 border-t border-border/60 px-token-lg py-token-md",stateRoot:m("flex min-h-48 flex-col items-center justify-center rounded-lg border border-border/70 bg-background px-6 py-10 text-center",to),stateIcon:"mb-token-lg flex h-12 w-12 items-center justify-center rounded-full bg-muted text-muted-foreground motion-safe:animate-in motion-safe:fade-in",stateTitle:"text-sm font-semibold text-foreground",stateDescription:"mt-2 max-w-md text-sm leading-6 text-muted-foreground",stateActions:"mt-token-xl flex flex-wrap items-center justify-center gap-token-sm",loadingSpinner:"h-5 w-5 motion-safe:animate-spin motion-reduce:animate-none",fieldRoot:"grid min-w-0 gap-token-md",fieldLabelRow:"flex min-w-0 items-center justify-between gap-token-md",fieldLabel:"min-w-0 text-sm font-medium leading-none text-foreground",fieldRequired:"text-destructive-text",fieldDescription:"text-sm leading-5 text-muted-foreground",fieldMessage:"text-sm leading-5 text-muted-foreground",fieldControl:"min-w-0",controlWrapper:m("relative flex min-w-0 items-center rounded-md border border-border bg-background text-foreground focus-within:border-primary/35",to),controlBase:"min-w-0 flex-1 bg-transparent px-3 text-sm text-foreground outline-hidden placeholder:text-muted-foreground disabled:!cursor-not-allowed",controlInput:"h-9",controlTextarea:"min-h-24 resize-y py-2 leading-6",controlSelect:"h-9 cursor-pointer appearance-none pr-9 disabled:!cursor-not-allowed",controlIcon:"pointer-events-none ml-3 inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",controlTrailing:"mr-3 inline-flex shrink-0 items-center justify-center text-muted-foreground",controlInvalid:"border-destructive/45 focus-within:border-destructive/60",controlDisabled:"!cursor-not-allowed opacity-60",controlReadOnly:"bg-muted/35",selectChevron:m("pointer-events-none absolute right-3 top-1/2 h-2 w-2 -translate-y-1/2 rotate-45 border-b border-r border-current text-muted-foreground",Ld),selectMenu:"absolute left-0 right-0 top-[calc(100%+0.375rem)] z-50 max-h-60 overflow-auto rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg outline-hidden",selectOption:m("flex min-h-8 w-full min-w-0 cursor-pointer items-center rounded-sm px-2.5 py-1.5 text-left text-sm text-foreground",xr),selectOptionActive:"bg-accent text-accent-foreground",selectOptionSelected:"bg-primary/10 text-primary",selectOptionDisabled:"!cursor-not-allowed opacity-50",selectPlaceholder:"text-muted-foreground",selectNative:"sr-only",switchRoot:"inline-flex min-w-0 cursor-pointer items-start gap-3",switchInput:"sr-only",switchTrack:m("relative mt-0.5 inline-flex h-6 w-10 shrink-0 items-center rounded-full border border-border bg-muted focus-within:border-primary/35",to),switchThumb:m("h-4 w-4 translate-x-1 rounded-full bg-background shadow-sm",Ld),switchChecked:"border-primary/40 bg-primary/80 text-primary-foreground",switchDisabled:"!cursor-not-allowed opacity-60",switchContent:"grid min-w-0 gap-1",switchLabel:"text-sm font-medium leading-none text-foreground",switchDescription:"text-sm leading-5 text-muted-foreground",checkboxRoot:"inline-flex min-w-0 cursor-pointer items-start gap-3",checkboxInput:"sr-only",checkboxBox:m("mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border border-border bg-background text-primary focus-within:border-primary/40",to),checkboxBoxChecked:"border-primary/45 bg-primary text-primary-foreground",checkboxBoxInvalid:"border-destructive/50",checkboxIndicator:"text-xs font-bold leading-none",checkboxDisabled:"!cursor-not-allowed opacity-60",checkboxContent:"grid min-w-0 gap-1",checkboxLabel:"text-sm font-medium leading-none text-foreground",checkboxDescription:"text-sm leading-5 text-muted-foreground",radioGroupRoot:"grid min-w-0 gap-2",radioOption:m("inline-flex min-w-0 cursor-pointer items-start gap-3 rounded-md border border-border/60 bg-background px-3 py-2 text-sm",xr,"hover:bg-muted/35"),radioInput:"sr-only",radioMarker:m("mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-border bg-background text-primary focus-within:border-primary/40",to),radioMarkerChecked:"border-primary/50 bg-primary/10",radioIndicator:"h-2 w-2 rounded-full bg-primary",radioOptionDisabled:"!cursor-not-allowed opacity-60 hover:bg-background",radioContent:"grid min-w-0 gap-1",radioLabel:"text-sm font-medium leading-none text-foreground",radioDescription:"text-sm leading-5 text-muted-foreground",dialogRoot:"relative",dialogTrigger:"",dialogTriggerDisabled:"!cursor-not-allowed opacity-60",dialogOverlay:"fixed inset-0 z-50 bg-background/70 backdrop-blur-sm motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",dialogContent:"pointer-events-none fixed inset-0 z-50 flex min-h-0 items-center justify-center p-4",dialogPanel:m("pointer-events-auto relative flex max-h-[min(85vh,720px)] w-full max-w-lg min-w-0 flex-col overflow-hidden rounded-lg border border-border/70 bg-background text-foreground shadow-xl","motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-out"),dialogHeader:"grid min-w-0 gap-1 border-b border-border/60 px-5 py-4",dialogTitle:"min-w-0 pr-8 text-base font-semibold leading-6 text-foreground",dialogDescription:"text-sm leading-6 text-muted-foreground",dialogBody:"min-h-0 min-w-0 overflow-auto px-5 py-4 text-sm text-foreground",dialogFooter:"flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-border/60 px-5 py-4",dialogClose:m("absolute right-3 top-3 inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-muted/60 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",xr),dropdownRoot:"relative inline-flex min-w-0",dropdownTrigger:"",dropdownTriggerDisabled:"!cursor-not-allowed opacity-60",dropdownMenu:"z-50 min-w-48 overflow-hidden rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",dropdownMenuTop:"bottom-[calc(100%+0.375rem)] top-auto",dropdownMenuEnd:"left-auto right-0",dropdownLabel:"px-2.5 py-1.5 text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground",dropdownSeparator:"my-1 h-px bg-border/70",dropdownItem:m("flex min-w-0 cursor-pointer items-center gap-2 rounded-sm px-2.5 py-2 text-left text-sm text-foreground hover:bg-accent/60 focus:bg-accent/60 data-[highlighted]:bg-accent/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",xr),dropdownItemDanger:"text-destructive-text hover:bg-destructive/10 focus:bg-destructive/10 data-[highlighted]:bg-destructive/10",dropdownItemDisabled:"!cursor-not-allowed opacity-50 hover:bg-transparent focus:bg-transparent data-[highlighted]:bg-transparent",dropdownItemIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center",dropdownItemContent:"grid min-w-0 flex-1 gap-0.5",dropdownItemLabel:"min-w-0 truncate",dropdownItemDescription:"min-w-0 truncate text-xs leading-4 text-muted-foreground",dropdownItemShortcut:"ml-3 shrink-0 text-xs font-medium text-muted-foreground",tooltipRoot:"relative inline-flex min-w-0",tooltipTrigger:"inline-flex min-w-0",tooltipContent:"pointer-events-none z-50 max-w-xs rounded-md border border-border bg-popover px-2.5 py-1.5 text-xs leading-5 text-popover-foreground shadow-lg motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",noticeBase:m("flex min-w-0 gap-3 rounded-lg border px-4 py-3 text-sm",to,"motion-safe:animate-in motion-safe:fade-in"),noticeDefault:"border-border bg-background text-foreground",noticePrimary:"border-primary/25 bg-primary/10 text-primary",noticeSuccess:"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-foreground",noticeWarning:"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))]",noticeDanger:"border-destructive/30 bg-destructive/10 text-destructive-text",noticeMuted:"border-border/60 bg-muted/35 text-muted-foreground",noticeIcon:"mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center motion-safe:animate-in motion-safe:fade-in",noticeTitle:"font-semibold leading-5",noticeDescription:"leading-6",noticeActions:"mt-3 flex flex-wrap items-center gap-2",dividerRoot:m("shrink-0 border-border/70",to),dividerLabel:"mx-3 shrink-0 text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground motion-safe:animate-in motion-safe:fade-in",sectionHeaderRoot:"flex min-w-0 flex-wrap items-start justify-between gap-token-md motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out",sectionHeaderContent:"grid min-w-0 gap-1",sectionHeaderEyebrow:"text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground",sectionHeaderTitle:"text-base font-semibold leading-6 text-foreground",sectionHeaderDescription:"max-w-2xl text-sm leading-6 text-muted-foreground",sectionHeaderActions:"flex shrink-0 flex-wrap items-center gap-2",tabsRoot:"grid min-w-0 gap-token-md",tabsList:m("inline-flex min-w-0 flex-wrap items-center gap-token-xs rounded-lg border border-border/70 bg-muted/30 p-token-xs",to),tabsTrigger:m("inline-flex min-w-0 cursor-pointer items-center justify-center rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground hover:bg-background/70 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:ring-offset-1 motion-reduce:transition-none",xr),tabsTriggerActive:"bg-background text-foreground shadow-sm",tabsTriggerDisabled:"!cursor-not-allowed opacity-50 hover:bg-transparent",tabsPanel:"min-w-0 rounded-lg border border-border/70 bg-background p-4 text-sm text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out motion-reduce:transition-none",segmentedRoot:m("inline-flex min-w-0 items-center gap-1 rounded-lg border border-border/70 bg-muted/30 p-1",to),segmentedItem:m("inline-flex min-w-0 cursor-pointer items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground hover:bg-background/70 hover:text-foreground focus-visible:outline-hidden",xr),segmentedItemActive:"bg-background text-foreground shadow-sm",segmentedItemDisabled:"!cursor-not-allowed opacity-50 hover:bg-transparent",progressRoot:"grid min-w-0 gap-2",progressTrack:"h-2 w-full overflow-hidden rounded-full bg-muted",progressIndicator:"h-full rounded-full bg-primary motion-safe:transition-[width] motion-safe:duration-500 motion-safe:ease-out",progressLabelRow:"flex min-w-0 items-center justify-between gap-3",progressLabel:"min-w-0 truncate text-sm font-medium text-foreground",progressValue:"shrink-0 text-xs font-medium text-muted-foreground",skeletonRoot:"relative overflow-hidden rounded-md bg-muted/70",avatarRoot:"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full border border-border bg-muted text-sm font-semibold text-muted-foreground motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",avatarImage:"h-full w-full object-cover",avatarFallback:"flex h-full w-full items-center justify-center bg-muted text-foreground",avatarStatus:"absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-muted-foreground motion-safe:animate-pulse",avatarText:"min-w-0 truncate text-sm font-medium text-foreground",toolbarRoot:m("flex min-w-0 flex-wrap items-center justify-between gap-token-md rounded-lg border border-border/70 bg-background px-token-lg py-token-md",to),toolbarLeading:"flex min-w-0 items-center gap-token-md",toolbarTitle:"min-w-0 truncate text-sm font-semibold text-foreground",toolbarDescription:"mt-0.5 text-sm leading-5 text-muted-foreground",toolbarContent:"min-w-0 flex-1",toolbarActions:"flex shrink-0 flex-wrap items-center gap-token-sm",breadcrumbRoot:"min-w-0 text-sm text-muted-foreground",breadcrumbList:"flex min-w-0 flex-wrap items-center gap-1.5",breadcrumbItem:"inline-flex min-w-0 items-center gap-1.5",breadcrumbLink:"min-w-0 cursor-pointer truncate text-muted-foreground hover:text-foreground disabled:!cursor-not-allowed disabled:opacity-50 aria-disabled:!cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:text-muted-foreground motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",breadcrumbCurrent:"min-w-0 truncate font-medium text-foreground",breadcrumbSeparator:"shrink-0 text-muted-foreground/70",paginationRoot:"flex min-w-0 flex-wrap items-center justify-between gap-3 text-sm",paginationInfo:"min-w-0 text-muted-foreground",paginationControls:"flex min-w-0 flex-wrap items-center justify-end gap-1.5",paginationButton:"inline-flex h-8 min-w-8 cursor-pointer items-center justify-center whitespace-nowrap rounded-md border border-border bg-background px-2.5 text-sm font-medium text-foreground hover:bg-accent/60 disabled:!cursor-not-allowed disabled:opacity-50 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out",paginationButtonDisabled:"!cursor-not-allowed opacity-50",paginationPage:"inline-flex h-8 min-w-8 cursor-default items-center justify-center rounded-md bg-muted/50 px-2.5 text-sm font-medium text-foreground hover:bg-muted/50",paginationEllipsis:"inline-flex h-8 min-w-6 items-center justify-center px-1 text-sm text-muted-foreground",descriptionListRoot:"grid min-w-0 gap-3 text-sm",descriptionListItem:"grid min-w-0 gap-1 rounded-md border border-border/60 bg-background px-3 py-2 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out hover:shadow-sm",descriptionListTerm:"min-w-0 truncate text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",descriptionListValue:"min-w-0 text-sm leading-6 text-foreground",accordionRoot:"grid min-w-0 gap-2",accordionItem:"overflow-hidden rounded-lg border border-border/70 bg-background motion-safe:transition motion-safe:duration-300 motion-safe:ease-out motion-reduce:transition-none",accordionTrigger:"flex w-full min-w-0 cursor-pointer items-center justify-between gap-3 px-4 py-3 text-start text-sm font-medium text-foreground hover:bg-muted/40 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:!cursor-not-allowed disabled:opacity-50 motion-safe:transition motion-safe:duration-300 motion-safe:ease-out motion-reduce:transition-none",accordionTriggerIcon:m("h-2 w-2 shrink-0 rotate-45 border-b border-r border-current text-muted-foreground",Ld,"motion-reduce:transition-none"),accordionPanel:"border-t border-border/60 px-4 py-3 text-sm leading-6 text-muted-foreground motion-safe:animate-in motion-safe:fade-in motion-safe:duration-300 motion-safe:ease-out motion-reduce:animate-none",menuTrigger:"inline-flex min-w-0",menuContent:"z-50 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg outline-hidden motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-out",menuLabel:"px-2 py-1.5 text-xs font-medium text-muted-foreground",menuSeparator:"-mx-1 my-1 h-px bg-border",menuItem:m("relative flex min-h-8 min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm px-2.5 py-1.5 text-sm text-foreground outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:!cursor-not-allowed data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",xr),menuItemDefault:"text-foreground",menuItemPrimary:"text-primary focus:text-primary data-[highlighted]:text-primary",menuItemSuccess:"text-[hsl(var(--success,142_72%_29%))] focus:text-[hsl(var(--success,142_72%_29%))] data-[highlighted]:text-[hsl(var(--success,142_72%_29%))]",menuItemWarning:"text-[hsl(var(--warning-foreground,28_73%_26%))] focus:text-[hsl(var(--warning-foreground,28_73%_26%))] data-[highlighted]:text-[hsl(var(--warning-foreground,28_73%_26%))]",menuItemDanger:"text-destructive-text focus:text-destructive-text data-[highlighted]:text-destructive-text",menuItemMuted:"text-muted-foreground focus:text-foreground data-[highlighted]:text-foreground",menuItemDisabled:"!cursor-not-allowed opacity-50 data-[disabled]:pointer-events-none",menuItemIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center",menuItemLabel:"min-w-0 flex-1 truncate",menuItemShortcut:"ml-4 shrink-0 text-xs font-medium text-muted-foreground",menuCheckboxIndicator:"absolute left-2 inline-flex h-4 w-4 items-center justify-center text-current",menuRadioIndicator:"absolute left-2 inline-flex h-4 w-4 items-center justify-center text-current",menuSubTrigger:m("relative flex min-h-8 min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm px-2.5 py-1.5 text-sm text-foreground outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:!cursor-not-allowed data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",xr),menuSubTriggerIcon:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",menuSubContent:"z-50 min-w-40 overflow-hidden rounded-md border border-border bg-background p-1 text-sm text-foreground shadow-lg outline-hidden motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-300 motion-safe:ease-out",tableContainer:m("relative isolate min-w-0 overflow-auto rounded-lg border border-border/70 bg-background/95 bg-clip-padding [scrollbar-gutter:stable]","[--base-table-header-height:2.75rem] [--base-table-split-scrollbar-gutter:0.75rem]","[--base-table-sticky-header-bg:hsl(var(--background))] [--base-table-header-separator:hsl(var(--border)_/_0.7)]",Lh,to),tableContainerFooterAttached:"!rounded-b-none !shadow-none",tableRoot:"w-full caption-bottom border-separate border-spacing-0 text-sm text-foreground",tableCaption:"mt-3 text-sm text-muted-foreground",tableHeader:m("relative z-[2] bg-transparent [&_tr]:bg-transparent",LN),tableBody:"[&_tr:last-child>*]:border-b-0",tableFooter:"bg-muted/30 font-medium [&_tr>*]:border-t [&_tr>*]:border-border/70",tableFooterBar:m("flex min-w-0 flex-wrap items-center justify-between gap-3 rounded-lg border border-border/70 bg-muted/20 px-4 py-3 text-sm text-foreground shadow-none",to),tableFooterBarAttached:"-mt-px rounded-t-none border-t border-border/70 shadow-none",tableFooterBarLeading:"flex min-w-0 items-center gap-2",tableFooterBarContent:"min-w-0 flex-1",tableFooterBarActions:"ms-auto flex shrink-0 flex-wrap items-center gap-2",tableSplitRoot:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-[auto_minmax(0,1fr)_auto] caption-bottom border-separate border-spacing-0 text-sm text-foreground",tableSplitHeader:"block w-full min-w-0 shrink-0 overflow-x-hidden overflow-y-hidden bg-transparent",tableSplitBody:m("block min-h-0 w-full min-w-0 max-w-full justify-self-stretch overflow-auto [scrollbar-gutter:stable]",Lh),tableSplitFooter:"block w-full min-w-0 shrink-0 overflow-x-hidden overflow-y-hidden",tableSplitRow:"grid w-max min-w-full [grid-template-columns:var(--base-table-column-template)]",tableSplitHead:"flex min-w-0 overflow-hidden",tableSplitCell:"block min-w-0 overflow-hidden [overflow-wrap:anywhere]",tableRow:m("[&>*]:border-b [&>*]:border-border/60 data-[state=selected]:bg-primary/5 data-[state=selected]:[&>*]:bg-primary/5",to),tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--muted)_/_0.35)] hover:bg-[var(--base-table-row-hover-bg)] hover:[&>*]:bg-[var(--base-table-row-hover-bg)]",tableRowSelected:"bg-primary/5 [&>*]:bg-primary/5",tableRowDisabled:"!cursor-not-allowed opacity-60",tableHead:"relative h-11 whitespace-nowrap px-3 py-2 text-left align-middle text-xs font-semibold text-muted-foreground shadow-[inset_0_-1px_0_var(--base-table-header-separator)]",tableHeadContent:"flex min-w-0 items-center justify-between gap-2",tableHeadMain:"flex min-w-0 items-center gap-2",tableHeadIcon:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",tableHeadText:"grid min-w-0 gap-0.5",tableHeadLabel:"min-w-0 truncate text-xs font-semibold leading-4 text-foreground",tableHeadDescription:"min-w-0 truncate text-xs font-normal leading-4 text-muted-foreground",tableHeadMeta:"shrink-0 text-xs font-medium text-muted-foreground",tableHeadActions:"flex shrink-0 items-center gap-1",tableHeadSortButton:m("inline-flex min-w-0 cursor-pointer items-center gap-1 rounded-sm text-left focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed disabled:opacity-60",to),tableHeadSortIcon:m("inline-flex h-3 w-3 shrink-0 items-center justify-center text-muted-foreground",Ld),tableHeadDragHandle:m("inline-flex h-5 w-4 shrink-0 cursor-grab items-center justify-center rounded-sm text-muted-foreground hover:bg-muted active:cursor-grabbing focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed disabled:opacity-50",to),tableHeadResizeHandle:m("absolute end-0 top-1/2 h-7 w-2 -translate-y-1/2 cursor-col-resize touch-none rounded-sm after:absolute after:start-1/2 after:top-1/2 after:h-5 after:w-px after:-translate-x-1/2 after:-translate-y-1/2 after:bg-border hover:after:bg-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed disabled:opacity-50",to),tableCell:"min-w-0 px-3 py-2 align-middle text-sm text-foreground [overflow-wrap:anywhere]",tableCellAlignCenter:"text-center",tableCellAlignRight:"text-right",tableEmptyRow:"[&>*]:border-b [&>*]:border-border/60",tableEmptyCell:"px-4 py-10 text-center",tableEmptyContent:"mx-auto flex max-w-md flex-col items-center justify-center text-center",tableEmptyIcon:"mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-muted text-muted-foreground",tableEmptyTitle:"text-sm font-semibold text-foreground",tableEmptyDescription:"mt-1 text-sm leading-6 text-muted-foreground",tableEmptyActions:"mt-4 flex flex-wrap items-center justify-center gap-2",tableLoadingRow:"[&>*]:border-b [&>*]:border-border/60",tableLoadingCell:"px-3 py-2",tableLoadingSkeleton:"h-4 w-full rounded-md bg-muted/70",layoutRoot:m("grid min-w-0 overflow-hidden grid-rows-[auto_minmax(0,1fr)_auto] gap-3 rounded-lg border border-border/70 bg-background p-3 text-foreground",to),layoutRootFull:"h-full min-h-0",layoutHeader:"min-w-0",layoutBody:"grid min-h-0 min-w-0 overflow-hidden gap-token-md",layoutSidebar:"min-h-0 min-w-0 overflow-hidden",layoutMain:"min-h-0 min-w-0 overflow-hidden",layoutAside:"min-h-0 min-w-0 overflow-hidden",layoutFooter:"min-w-0",layoutPane:m("h-full max-h-full min-h-0 min-w-0 overflow-hidden rounded-lg bg-background text-foreground",to),layoutPaneScrollable:"overflow-auto",layoutPaneBordered:"border border-border/70",layoutPaneMuted:"bg-muted/25",layoutPaneSoft:"bg-background/95 shadow-sm",layoutPaneTransparent:"bg-transparent shadow-none",layoutSplitRoot:"grid min-h-0 min-w-0 overflow-hidden",layoutSplitHorizontal:"grid-flow-col",layoutSplitVertical:"grid-flow-row",layoutSplitPane:"min-h-0 min-w-0 overflow-hidden",layoutSplitPrimary:"",layoutSplitSecondary:"",layoutResizeHandle:m("group/resize relative z-10 flex shrink-0 items-center justify-center bg-transparent text-muted-foreground hover:bg-border/60 active:bg-border/70 focus-visible:bg-border/60 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30",xr),layoutResizeHandleHorizontal:"w-2 cursor-col-resize",layoutResizeHandleVertical:"h-2 cursor-row-resize",layoutResizeHandleDisabled:"cursor-default opacity-60",layoutResizeHandleIndicator:"rounded-full bg-muted-foreground/45 group-hover/resize:bg-primary/70"},WN={compact:{buttonBase:"h-8 px-2.5 text-xs",buttonIconOnly:"h-8 w-8 px-0",badgeBase:"px-1.5 py-0 text-xs",panelHeader:"p-token-md",panelBody:"px-token-md pb-token-md text-xs",panelBodyStandalone:"pt-token-md",panelFooter:"px-token-md py-token-md",stateRoot:"min-h-36 px-4 py-7",stateIcon:"mb-3 h-10 w-10",fieldRoot:"gap-token-sm",fieldLabel:"text-xs",fieldDescription:"text-xs leading-5",fieldMessage:"text-xs leading-5",controlInput:"h-8 text-xs",controlTextarea:"min-h-20 text-xs",controlSelect:"h-8 text-xs",selectMenu:"text-xs",selectOption:"min-h-7 px-2 py-1 text-xs",switchTrack:"h-5 w-9",switchThumb:"h-3.5 w-3.5",checkboxBox:"h-3.5 w-3.5",checkboxLabel:"text-xs",checkboxDescription:"text-xs leading-5",radioOption:"px-2 py-1.5 text-xs",radioMarker:"h-3.5 w-3.5",radioIndicator:"h-1.5 w-1.5",radioLabel:"text-xs",radioDescription:"text-xs leading-5",dialogPanel:"max-w-md",dialogHeader:"px-4 py-3",dialogTitle:"text-sm leading-5",dialogDescription:"text-xs leading-5",dialogBody:"px-4 py-3 text-xs",dialogFooter:"px-4 py-3",dropdownMenu:"min-w-44 text-xs",dropdownItem:"px-2 py-1.5 text-xs",tooltipContent:"text-xs leading-4",noticeBase:"px-3 py-2 text-xs",dividerLabel:"text-xs",sectionHeaderRoot:"gap-token-sm",sectionHeaderTitle:"text-sm leading-5",sectionHeaderDescription:"text-xs leading-5",tabsList:"gap-token-xs p-token-xs",tabsTrigger:"px-2 py-1 text-xs",tabsPanel:"p-3 text-xs",segmentedRoot:"gap-token-xs p-token-xs",segmentedItem:"px-2 py-1 text-xs",progressTrack:"h-1.5",avatarRoot:"text-xs",toolbarRoot:"gap-token-sm px-token-md py-token-md",toolbarTitle:"text-xs",toolbarDescription:"text-xs leading-5",paginationButton:"h-7 min-w-7 px-2 text-xs",paginationPage:"h-7 min-w-7 px-2 text-xs",descriptionListRoot:"gap-2 text-xs",descriptionListItem:"px-2 py-1.5",descriptionListTerm:"text-xs",descriptionListValue:"text-xs leading-5",accordionTrigger:"px-3 py-2 text-xs",accordionPanel:"px-3 py-2 text-xs leading-5",menuContent:"min-w-40 p-0.5 text-xs",menuSubContent:"min-w-36 p-0.5 text-xs",menuLabel:"px-2 py-1 text-xs",menuItem:"min-h-7 px-2 py-1 text-xs",menuSubTrigger:"min-h-7 px-2 py-1 text-xs",menuItemShortcut:"text-xs",tableContainer:"[--base-table-header-height:2.25rem]",tableHead:"h-9 px-2 py-1.5 text-xs",tableCell:"px-2 py-1.5 text-xs",tableHeadLabel:"text-xs",tableHeadDescription:"text-xs leading-3",tableLoadingCell:"px-2 py-1.5",layoutRoot:"gap-token-md p-token-md",layoutBody:"gap-token-md",layoutPane:"rounded-md text-xs",layoutResizeHandleHorizontal:"w-1.5",layoutResizeHandleVertical:"h-1.5"},default:{buttonBase:"h-9"},comfortable:{buttonBase:"h-10 px-3.5",buttonIconOnly:"h-10 w-10 px-0",badgeBase:"px-2.5 py-1",panelHeader:"p-token-xl",panelBody:"px-token-xl pb-token-xl",panelBodyStandalone:"pt-token-xl",panelFooter:"px-token-xl py-token-lg",stateRoot:"min-h-56 px-8 py-12",stateIcon:"mb-5 h-14 w-14",fieldRoot:"gap-token-md",controlInput:"h-10",controlTextarea:"min-h-28",controlSelect:"h-10",selectMenu:"p-1.5",selectOption:"min-h-9 px-3 py-2",switchTrack:"h-7 w-12",switchThumb:"h-5 w-5",checkboxBox:"h-5 w-5",radioOption:"px-4 py-3",radioMarker:"h-5 w-5",radioIndicator:"h-2.5 w-2.5",dialogPanel:"max-w-xl",dialogHeader:"px-6 py-5",dialogBody:"px-6 py-5",dialogFooter:"px-6 py-5",dropdownMenu:"min-w-56",dropdownItem:"px-3 py-2.5",noticeBase:"px-5 py-4",sectionHeaderTitle:"text-lg leading-7",tabsTrigger:"px-3.5 py-2",tabsPanel:"p-5",segmentedItem:"px-3.5 py-2",progressTrack:"h-2.5",toolbarRoot:"px-token-xl py-token-lg",paginationButton:"h-9 min-w-9 px-3",paginationPage:"h-9 min-w-9 px-3",descriptionListItem:"px-4 py-3",accordionTrigger:"px-5 py-4",accordionPanel:"px-5 py-4",menuContent:"min-w-48 p-1.5",menuSubContent:"min-w-44 p-1.5",menuItem:"min-h-9 px-3 py-2",menuSubTrigger:"min-h-9 px-3 py-2",tableContainer:"[--base-table-header-height:3rem]",tableHead:"h-12 px-4 py-3",tableCell:"px-4 py-3",tableLoadingCell:"px-4 py-3",layoutRoot:"gap-token-lg p-token-lg",layoutBody:"gap-token-lg",layoutPane:"rounded-xl",layoutResizeHandleHorizontal:"w-2.5",layoutResizeHandleVertical:"h-2.5"}},zN={none:{buttonBase:"rounded-none",badgeBase:"rounded-none",panelRoot:"rounded-none",stateRoot:"rounded-none",stateIcon:"rounded-none",controlWrapper:"rounded-none",selectMenu:"rounded-none",selectOption:"rounded-none",switchTrack:"rounded-none",switchThumb:"rounded-none",checkboxBox:"rounded-none",radioOption:"rounded-none",dialogPanel:"rounded-none",dialogClose:"rounded-none",dropdownMenu:"rounded-none",dropdownItem:"rounded-none",tooltipContent:"rounded-none",noticeBase:"rounded-none",tabsList:"rounded-none",tabsTrigger:"rounded-none",tabsPanel:"rounded-none",segmentedRoot:"rounded-none",segmentedItem:"rounded-none",progressTrack:"rounded-none",progressIndicator:"rounded-none",skeletonRoot:"rounded-none",avatarRoot:"rounded-none",avatarStatus:"rounded-none",toolbarRoot:"rounded-none",paginationButton:"rounded-none",paginationPage:"rounded-none",descriptionListItem:"rounded-none",accordionItem:"rounded-none",menuContent:"rounded-none",menuItem:"rounded-none",menuSubTrigger:"rounded-none",menuSubContent:"rounded-none",tableContainer:"rounded-none",tableEmptyIcon:"rounded-none",tableLoadingSkeleton:"rounded-none",layoutRoot:"rounded-none",layoutPane:"rounded-none"},sm:{buttonBase:"rounded-sm",badgeBase:"rounded-sm",panelRoot:"rounded-sm",stateRoot:"rounded-sm",stateIcon:"rounded-sm",controlWrapper:"rounded-sm",selectMenu:"rounded-sm",selectOption:"rounded-sm",switchTrack:"rounded-sm",switchThumb:"rounded-sm",checkboxBox:"rounded-sm",radioOption:"rounded-sm",dialogPanel:"rounded-sm",dialogClose:"rounded-sm",dropdownMenu:"rounded-sm",dropdownItem:"rounded-sm",tooltipContent:"rounded-sm",noticeBase:"rounded-sm",tabsList:"rounded-sm",tabsTrigger:"rounded-sm",tabsPanel:"rounded-sm",segmentedRoot:"rounded-sm",segmentedItem:"rounded-sm",progressTrack:"rounded-sm",progressIndicator:"rounded-sm",skeletonRoot:"rounded-sm",avatarRoot:"rounded-sm",avatarStatus:"rounded-sm",toolbarRoot:"rounded-sm",paginationButton:"rounded-sm",paginationPage:"rounded-sm",descriptionListItem:"rounded-sm",accordionItem:"rounded-sm",menuContent:"rounded-sm",menuItem:"rounded-sm",menuSubTrigger:"rounded-sm",menuSubContent:"rounded-sm",tableContainer:"rounded-sm",tableEmptyIcon:"rounded-sm",tableLoadingSkeleton:"rounded-sm",layoutRoot:"rounded-sm",layoutPane:"rounded-sm"},md:{},lg:{buttonBase:"rounded-lg",badgeBase:"rounded-lg",panelRoot:"rounded-xl",stateRoot:"rounded-xl",stateIcon:"rounded-xl",controlWrapper:"rounded-lg",selectMenu:"rounded-lg",selectOption:"rounded-md",switchTrack:"rounded-full",switchThumb:"rounded-full",checkboxBox:"rounded-md",radioOption:"rounded-xl",dialogPanel:"rounded-xl",dialogClose:"rounded-lg",dropdownMenu:"rounded-lg",dropdownItem:"rounded-md",tooltipContent:"rounded-md",noticeBase:"rounded-xl",tabsList:"rounded-xl",tabsTrigger:"rounded-lg",tabsPanel:"rounded-xl",segmentedRoot:"rounded-xl",segmentedItem:"rounded-lg",skeletonRoot:"rounded-lg",toolbarRoot:"rounded-xl",descriptionListItem:"rounded-lg",accordionItem:"rounded-xl",menuContent:"rounded-lg",menuItem:"rounded-md",menuSubTrigger:"rounded-md",menuSubContent:"rounded-lg",tableContainer:"rounded-xl",tableEmptyIcon:"rounded-xl",tableLoadingSkeleton:"rounded-lg",layoutRoot:"rounded-xl",layoutPane:"rounded-xl"},xl:{buttonBase:"rounded-xl",badgeBase:"rounded-xl",panelRoot:"rounded-2xl",stateRoot:"rounded-2xl",stateIcon:"rounded-2xl",controlWrapper:"rounded-xl",selectMenu:"rounded-xl",selectOption:"rounded-lg",switchTrack:"rounded-full",switchThumb:"rounded-full",checkboxBox:"rounded-lg",radioOption:"rounded-2xl",dialogPanel:"rounded-2xl",dialogClose:"rounded-xl",dropdownMenu:"rounded-xl",dropdownItem:"rounded-lg",tooltipContent:"rounded-lg",noticeBase:"rounded-2xl",tabsList:"rounded-2xl",tabsTrigger:"rounded-xl",tabsPanel:"rounded-2xl",segmentedRoot:"rounded-2xl",segmentedItem:"rounded-xl",skeletonRoot:"rounded-xl",toolbarRoot:"rounded-2xl",paginationButton:"rounded-xl",paginationPage:"rounded-xl",descriptionListItem:"rounded-xl",accordionItem:"rounded-2xl",menuContent:"rounded-xl",menuItem:"rounded-lg",menuSubTrigger:"rounded-lg",menuSubContent:"rounded-xl",tableContainer:"rounded-2xl",tableEmptyIcon:"rounded-2xl",tableLoadingSkeleton:"rounded-xl",layoutRoot:"rounded-2xl",layoutPane:"rounded-2xl"},full:{buttonBase:"rounded-full",badgeBase:"rounded-full",panelRoot:"rounded-2xl",stateRoot:"rounded-2xl",stateIcon:"rounded-full",controlWrapper:"rounded-full",selectMenu:"rounded-2xl",selectOption:"rounded-full",switchTrack:"rounded-full",switchThumb:"rounded-full",checkboxBox:"rounded-full",radioOption:"rounded-2xl",dialogPanel:"rounded-2xl",dialogClose:"rounded-full",dropdownMenu:"rounded-2xl",dropdownItem:"rounded-full",tooltipContent:"rounded-full",noticeBase:"rounded-2xl",tabsList:"rounded-full",tabsTrigger:"rounded-full",tabsPanel:"rounded-2xl",segmentedRoot:"rounded-full",segmentedItem:"rounded-full",progressTrack:"rounded-full",progressIndicator:"rounded-full",skeletonRoot:"rounded-full",avatarRoot:"rounded-full",avatarStatus:"rounded-full",toolbarRoot:"rounded-2xl",paginationButton:"rounded-full",paginationPage:"rounded-full",descriptionListItem:"rounded-2xl",accordionItem:"rounded-2xl",menuContent:"rounded-2xl",menuItem:"rounded-full",menuSubTrigger:"rounded-full",menuSubContent:"rounded-2xl",tableContainer:"rounded-2xl",tableEmptyIcon:"rounded-full",tableLoadingSkeleton:"rounded-full",layoutRoot:"rounded-2xl",layoutPane:"rounded-2xl"}},ON={none:{buttonBase:"border-transparent",badgeBase:"border-transparent",panelRoot:"border-transparent",panelFooter:"border-transparent",stateRoot:"border-transparent",controlWrapper:"border-transparent",selectMenu:"border-transparent",switchTrack:"border-transparent",checkboxBox:"border-transparent",radioOption:"border-transparent",radioMarker:"border-transparent",dialogPanel:"border-transparent",dialogHeader:"border-transparent",dialogFooter:"border-transparent",dropdownMenu:"border-transparent",tooltipContent:"border-transparent",noticeBase:"border-transparent",dividerRoot:"border-transparent",tabsList:"border-transparent",tabsPanel:"border-transparent",segmentedRoot:"border-transparent",avatarRoot:"border-transparent",toolbarRoot:"border-transparent",paginationButton:"border-transparent",descriptionListItem:"border-transparent",accordionItem:"border-transparent",accordionPanel:"border-transparent",menuContent:"border-transparent",menuSeparator:"bg-transparent",menuSubContent:"border-transparent",tableContainer:"border-transparent [--base-table-header-separator:transparent]",tableHeader:"border-transparent",tableFooter:"[&_tr>*]:border-transparent",tableFooterBar:"border-transparent",tableFooterBarAttached:"border-t border-transparent",tableRow:"[&>*]:border-transparent",tableEmptyRow:"[&>*]:border-transparent",tableLoadingRow:"[&>*]:border-transparent",layoutRoot:"border-transparent",layoutPaneBordered:"border-transparent",layoutResizeHandle:"bg-transparent hover:bg-transparent active:bg-transparent focus-visible:bg-transparent"},subtle:{buttonDefault:"border-border/60",badgeDefault:"border-border/60",panelRoot:"border-border/60",panelFooter:"border-border/60",stateRoot:"border-border/60",controlWrapper:"border-border/60",selectMenu:"border-border/60",switchTrack:"border-border/60",checkboxBox:"border-border/60",radioOption:"border-border/60",radioMarker:"border-border/60",dialogPanel:"border-border/60",dialogHeader:"border-border/60",dialogFooter:"border-border/60",dropdownMenu:"border-border/60",tooltipContent:"border-border/60",noticeDefault:"border-border/60",dividerRoot:"border-border/60",tabsList:"border-border/60",tabsPanel:"border-border/60",segmentedRoot:"border-border/60",avatarRoot:"border-border/60",toolbarRoot:"border-border/60",paginationButton:"border-border/60",descriptionListItem:"border-border/60",accordionItem:"border-border/60",accordionPanel:"border-border/60",menuContent:"border-border/60",menuSeparator:"bg-border/60",menuSubContent:"border-border/60",tableContainer:"border-border/60 [--base-table-header-separator:hsl(var(--border)_/_0.6)]",tableHeader:"border-border/60",tableFooter:"[&_tr>*]:border-border/60",tableFooterBar:"border-border/60",tableFooterBarAttached:"border-t border-border/60",tableRow:"[&>*]:border-border/50",tableEmptyRow:"[&>*]:border-border/50",tableLoadingRow:"[&>*]:border-border/50",layoutRoot:"border-border/60",layoutPaneBordered:"border-border/60"},solid:{},strong:{buttonDefault:"border-foreground/20",badgeDefault:"border-foreground/20",panelRoot:"border-foreground/20",panelFooter:"border-foreground/20",stateRoot:"border-foreground/20",controlWrapper:"border-foreground/20",selectMenu:"border-foreground/20",switchTrack:"border-foreground/20",checkboxBox:"border-foreground/20",radioOption:"border-foreground/20",radioMarker:"border-foreground/20",dialogPanel:"border-foreground/20",dialogHeader:"border-foreground/15",dialogFooter:"border-foreground/15",dropdownMenu:"border-foreground/20",tooltipContent:"border-foreground/20",noticeDefault:"border-foreground/20",dividerRoot:"border-foreground/20",tabsList:"border-foreground/20",tabsPanel:"border-foreground/20",segmentedRoot:"border-foreground/20",avatarRoot:"border-foreground/20",toolbarRoot:"border-foreground/20",paginationButton:"border-foreground/20",descriptionListItem:"border-foreground/20",accordionItem:"border-foreground/20",accordionPanel:"border-foreground/20",menuContent:"border-foreground/20",menuSeparator:"bg-foreground/15",menuSubContent:"border-foreground/20",tableContainer:"border-foreground/20 [--base-table-header-separator:hsl(var(--foreground)_/_0.15)]",tableHeader:"border-foreground/20",tableFooter:"[&_tr>*]:border-foreground/20",tableFooterBar:"border-foreground/20",tableFooterBarAttached:"border-t border-foreground/20",tableRow:"[&>*]:border-foreground/15",tableEmptyRow:"[&>*]:border-foreground/15",tableLoadingRow:"[&>*]:border-foreground/15",layoutRoot:"border-foreground/20",layoutPaneBordered:"border-foreground/20",layoutResizeHandle:"hover:bg-foreground/15 active:bg-foreground/20 focus-visible:bg-foreground/15"}},FN={plain:{},muted:{buttonDefault:"bg-muted/20 hover:bg-muted/45",panelRoot:"bg-card",panelFooter:"bg-muted/20",stateRoot:"bg-muted/20",controlWrapper:"bg-background",selectMenu:"bg-background",selectOptionActive:"bg-muted/70 text-foreground",checkboxBox:"bg-background",radioOption:"bg-card hover:bg-muted/45",radioMarker:"bg-background",dialogPanel:"bg-card",dropdownMenu:"bg-background",dropdownItem:"hover:bg-muted/60",tooltipContent:"bg-popover",noticeDefault:"bg-muted/20",tabsList:"bg-muted/35",tabsTriggerActive:"bg-background",tabsPanel:"bg-card",segmentedRoot:"bg-muted/35",segmentedItemActive:"bg-background",progressTrack:"bg-muted/60",skeletonRoot:"bg-muted",toolbarRoot:"bg-card",paginationButton:"bg-background hover:bg-muted/60",paginationPage:"bg-muted/60",descriptionListItem:"bg-card",accordionItem:"bg-card",menuContent:"bg-background",menuItem:"focus:bg-muted/70 data-[highlighted]:bg-muted/70",menuSubTrigger:"focus:bg-muted/70 data-[highlighted]:bg-muted/70 data-[state=open]:bg-muted/70",menuSubContent:"bg-background",tableContainer:"bg-background/95 [scrollbar-gutter:stable]",tableFooter:"bg-muted/35",tableFooterBar:"bg-muted/30 shadow-none",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--muted)_/_0.45)]",tableLoadingSkeleton:"bg-muted",layoutRoot:"bg-card",layoutPane:"bg-card",layoutPaneMuted:"bg-muted/35",layoutResizeHandle:"hover:bg-border/70 active:bg-border/80 focus-visible:bg-border/70"},soft:{buttonDefault:"bg-muted/30 hover:bg-muted/55",panelRoot:"bg-background/95 shadow-sm",stateRoot:"bg-background/95 shadow-sm",controlWrapper:"bg-background/95",selectMenu:"bg-background/95 shadow-xl",selectOptionActive:"bg-muted/60 text-foreground",checkboxBox:"bg-background/95",radioOption:"bg-background/95 shadow-sm hover:bg-muted/35",radioMarker:"bg-background/95",dialogPanel:"bg-background/95 shadow-xl",dropdownMenu:"bg-background/95 shadow-xl",dropdownItem:"hover:bg-muted/55",tooltipContent:"bg-popover shadow-xl",noticeDefault:"bg-background/95 shadow-sm",tabsList:"bg-background/60 shadow-sm",tabsTriggerActive:"bg-background",tabsPanel:"bg-background/95 shadow-sm",segmentedRoot:"bg-background/60 shadow-sm",segmentedItemActive:"bg-background",skeletonRoot:"bg-background/80",toolbarRoot:"bg-background/95 shadow-sm",paginationButton:"bg-background/95 hover:bg-muted/55",descriptionListItem:"bg-background/95 shadow-sm",accordionItem:"bg-background/95 shadow-sm",menuContent:"bg-background/95 shadow-xl",menuItem:"focus:bg-muted/60 data-[highlighted]:bg-muted/60",menuSubTrigger:"focus:bg-muted/60 data-[highlighted]:bg-muted/60 data-[state=open]:bg-muted/60",menuSubContent:"bg-background/95 shadow-xl",tableContainer:"bg-background/95 shadow-sm [scrollbar-gutter:stable]",tableFooter:"bg-muted/25",tableFooterBar:"bg-muted/25 shadow-none",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--muted)_/_0.35)]",tableLoadingSkeleton:"bg-muted/65",layoutRoot:"bg-background/95 shadow-sm",layoutPane:"bg-background/95 shadow-sm",layoutPaneSoft:"bg-background/95 shadow-md"},glass:{buttonBase:"backdrop-blur-md",buttonDefault:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",badgeDefault:"border-white/10 bg-white/[0.08] text-foreground",panelRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",panelFooter:"border-white/10 bg-white/[0.05]",stateRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",stateIcon:"bg-white/10 text-foreground",controlWrapper:"border-white/10 bg-white/[0.08] text-foreground backdrop-blur-md",selectMenu:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",selectOption:"text-foreground",selectOptionActive:"bg-white/[0.14] text-foreground",selectOptionSelected:"bg-white/[0.18] text-foreground",switchTrack:"border-white/10 bg-white/[0.12] backdrop-blur-md",checkboxBox:"border-white/10 bg-white/[0.08] backdrop-blur-md",checkboxBoxChecked:"border-white/20 bg-white/[0.22] text-foreground",radioOption:"border-white/10 bg-white/[0.06] backdrop-blur-md hover:bg-white/[0.10]",radioMarker:"border-white/10 bg-white/[0.08] backdrop-blur-md",radioMarkerChecked:"border-white/25 bg-white/[0.16]",dialogOverlay:"bg-background/45 backdrop-blur-md",dialogPanel:"border-white/10 bg-white/[0.08] shadow-2xl backdrop-blur-md",dialogHeader:"border-white/10",dialogFooter:"border-white/10",dropdownMenu:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",dropdownItem:"text-foreground hover:bg-white/[0.14]",tooltipContent:"border-foreground/10 bg-background/15 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",noticeDefault:"border-white/10 bg-white/[0.08] text-foreground backdrop-blur-md",dividerRoot:"border-white/15",tabsList:"border-white/10 bg-white/[0.08] backdrop-blur-md",tabsTrigger:"text-muted-foreground hover:bg-white/[0.12] hover:text-foreground",tabsTriggerActive:"bg-white/[0.16] text-foreground shadow-none",tabsPanel:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",segmentedRoot:"border-white/10 bg-white/[0.08] backdrop-blur-md",segmentedItem:"text-muted-foreground hover:bg-white/[0.12] hover:text-foreground",segmentedItemActive:"bg-white/[0.16] text-foreground shadow-none",progressTrack:"bg-white/[0.12]",skeletonRoot:"bg-white/[0.16]",avatarRoot:"border-white/10 bg-white/[0.12] text-foreground",avatarFallback:"bg-white/[0.12] text-foreground",avatarStatus:"border-background",toolbarRoot:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",paginationButton:"border-white/10 bg-white/[0.08] text-foreground hover:bg-white/[0.14]",paginationPage:"bg-white/[0.12] text-foreground",descriptionListItem:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",accordionItem:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",accordionPanel:"border-white/10",menuContent:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",menuSeparator:"bg-white/10",menuItem:"text-foreground focus:bg-white/[0.14] focus:text-foreground data-[highlighted]:bg-white/[0.14] data-[highlighted]:text-foreground",menuSubTrigger:"text-foreground focus:bg-white/[0.14] focus:text-foreground data-[highlighted]:bg-white/[0.14] data-[highlighted]:text-foreground data-[state=open]:bg-white/[0.16]",menuSubContent:"border-foreground/10 bg-background/10 text-foreground shadow-[0_18px_60px_hsl(var(--foreground)/0.18)] backdrop-blur-md",tableContainer:"border-foreground/10 bg-background/[0.06] shadow-none backdrop-blur-md [scrollbar-gutter:stable] [--base-table-sticky-header-bg:hsl(var(--background)/0.94)] [--base-table-header-separator:hsl(var(--foreground)/0.24)]",tableHeader:"border-white/10",tableFooter:"bg-white/[0.05] [&_tr>*]:border-white/10",tableFooterBar:"border-white/10 bg-white/[0.05] shadow-none backdrop-blur-md",tableFooterBarAttached:"border-t border-white/10",tableRow:"[&>*]:border-white/10",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--foreground)/0.08)]",tableHeadLabel:"text-foreground",tableLoadingSkeleton:"bg-white/[0.16]",layoutRoot:"border-white/10 bg-white/[0.05] shadow-none backdrop-blur-md",layoutPane:"border-white/10 bg-white/[0.06] shadow-none backdrop-blur-md",layoutPaneMuted:"bg-white/[0.08]",layoutPaneSoft:"bg-white/[0.10] shadow-none backdrop-blur-md",layoutResizeHandle:"text-foreground/65 hover:bg-white/10 active:bg-white/15 focus-visible:bg-white/10",layoutResizeHandleIndicator:"bg-white/45 group-hover/resize:bg-white/75"},dark:{buttonBase:"border-white/15 text-white shadow-lg backdrop-blur",buttonDefault:"bg-black/30 hover:bg-black/[0.45]",buttonPrimary:"border-white/25 bg-white/20 text-white hover:bg-white/25",buttonMuted:"border-white/10 bg-black/20 text-white/70 hover:bg-black/[0.35] hover:text-white",badgeDefault:"border-white/10 bg-white/[0.08] text-white",badgeMuted:"border-white/10 bg-black/20 text-white/70",panelRoot:"border-white/10 bg-slate-950 text-white shadow-none",panelTitle:"text-white",panelDescription:"text-white/65",panelBody:"text-white/85",panelFooter:"border-white/10 bg-white/[0.04]",stateRoot:"border-white/10 bg-slate-950 text-white shadow-none",stateIcon:"bg-white/10 text-white/75",stateTitle:"text-white",stateDescription:"text-white/65",fieldLabel:"text-white",fieldDescription:"text-white/65",fieldMessage:"text-white/65",controlWrapper:"border-white/15 bg-black/30 text-white shadow-lg backdrop-blur focus-within:border-white/35",controlBase:"text-white placeholder:text-white/45",selectChevron:"text-white/65",selectMenu:"border-white/15 bg-slate-950 text-white shadow-2xl",selectOption:"text-white",selectOptionActive:"bg-white/[0.12] text-white",selectOptionSelected:"bg-white/[0.16] text-white",selectPlaceholder:"text-white/45",switchTrack:"border-white/15 bg-black/30 shadow-lg backdrop-blur",switchChecked:"border-white/25 bg-white/25 text-white",switchLabel:"text-white",switchDescription:"text-white/65",checkboxBox:"border-white/15 bg-black/30 text-white shadow-lg backdrop-blur",checkboxBoxChecked:"border-white/25 bg-white/25 text-white",checkboxLabel:"text-white",checkboxDescription:"text-white/65",radioOption:"border-white/10 bg-white/[0.06] text-white hover:bg-white/[0.08]",radioMarker:"border-white/15 bg-black/30 text-white shadow-lg backdrop-blur",radioMarkerChecked:"border-white/25 bg-white/25",radioIndicator:"bg-white",radioLabel:"text-white",radioDescription:"text-white/65",dialogOverlay:"bg-slate-950/75",dialogPanel:"border-white/10 bg-slate-950 text-white shadow-2xl",dialogHeader:"border-white/10",dialogTitle:"text-white",dialogDescription:"text-white/65",dialogBody:"text-white/85",dialogFooter:"border-white/10",dialogClose:"text-white/65 hover:bg-white/[0.08] hover:text-white",dropdownMenu:"border-white/15 bg-slate-950 text-white shadow-2xl",dropdownLabel:"text-white/55",dropdownSeparator:"bg-white/15",dropdownItem:"text-white hover:bg-white/[0.10]",dropdownItemDescription:"text-white/55",dropdownItemShortcut:"text-white/55",tooltipContent:"border-white/15 bg-slate-950 text-white shadow-2xl",noticeDefault:"border-white/10 bg-white/[0.08] text-white",noticeMuted:"border-white/10 bg-black/20 text-white/70",dividerRoot:"border-white/15",dividerLabel:"text-white/55",sectionHeaderEyebrow:"text-white/55",sectionHeaderTitle:"text-white",sectionHeaderDescription:"text-white/65",tabsList:"border-white/10 bg-white/[0.08]",tabsTrigger:"text-white/65 hover:bg-white/[0.12] hover:text-white",tabsTriggerActive:"bg-white/[0.16] text-white shadow-none",tabsPanel:"border-white/10 bg-white/[0.06] text-white",segmentedRoot:"border-white/10 bg-white/[0.08]",segmentedItem:"text-white/65 hover:bg-white/[0.12] hover:text-white",segmentedItemActive:"bg-white/[0.16] text-white shadow-none",progressTrack:"bg-white/[0.12]",progressLabel:"text-white",progressValue:"text-white/65",skeletonRoot:"bg-white/[0.14]",avatarRoot:"border-white/15 bg-white/[0.10] text-white",avatarFallback:"bg-white/[0.10] text-white/75",avatarText:"text-white",avatarStatus:"border-slate-950",toolbarRoot:"border-white/10 bg-white/[0.06] text-white",toolbarTitle:"text-white",toolbarDescription:"text-white/65",breadcrumbLink:"text-white/65 hover:text-white",breadcrumbCurrent:"text-white",breadcrumbSeparator:"text-white/45",paginationInfo:"text-white/65",paginationButton:"border-white/10 bg-white/[0.08] text-white hover:bg-white/[0.14]",paginationPage:"bg-white/[0.14] text-white",descriptionListItem:"border-white/10 bg-white/[0.06]",descriptionListTerm:"text-white/55",descriptionListValue:"text-white",accordionItem:"border-white/10 bg-white/[0.06]",accordionTrigger:"text-white hover:bg-white/[0.08]",accordionPanel:"border-white/10 text-white/70",tableContainer:"border-foreground/10 bg-background text-foreground shadow-none [scrollbar-gutter:stable] [--base-table-sticky-header-bg:hsl(var(--background)/0.98)] [--base-table-header-separator:hsl(var(--foreground)/0.16)]",tableRoot:"text-white",tableHeader:"border-white/10",tableFooter:"bg-white/[0.05] [&_tr>*]:border-white/10",tableFooterBar:"border-white/10 bg-white/[0.05] text-white/65",tableFooterBarAttached:"border-t border-white/10",tableRow:"[&>*]:border-white/10",tableRowInteractive:"cursor-pointer [--base-table-row-hover-bg:hsl(var(--foreground)/0.06)]",tableHead:"text-white/65",tableHeadLabel:"text-white",tableHeadDescription:"text-white/55",tableHeadMeta:"text-white/55",tableHeadIcon:"text-white/55",tableHeadSortIcon:"text-white/55",tableHeadDragHandle:"text-white/55 hover:bg-white/[0.08]",tableHeadResizeHandle:"after:bg-white/20 hover:after:bg-white/60",tableCell:"text-white/85",tableEmptyIcon:"bg-white/10 text-white/65",tableEmptyTitle:"text-white",tableEmptyDescription:"text-white/60",menuContent:"border-white/10 bg-slate-950 text-white shadow-2xl",menuLabel:"text-white/55",menuSeparator:"bg-white/10",menuItem:"text-white focus:bg-white/[0.10] focus:text-white data-[highlighted]:bg-white/[0.10] data-[highlighted]:text-white",menuItemDefault:"text-white",menuItemPrimary:"text-primary focus:text-primary data-[highlighted]:text-primary",menuItemSuccess:"text-[hsl(var(--success,142_69%_58%))] focus:text-[hsl(var(--success,142_69%_58%))] data-[highlighted]:text-[hsl(var(--success,142_69%_58%))]",menuItemWarning:"text-[hsl(var(--warning-foreground,53_98%_77%))] focus:text-[hsl(var(--warning-foreground,53_98%_77%))] data-[highlighted]:text-[hsl(var(--warning-foreground,53_98%_77%))]",menuItemDanger:"text-destructive-text focus:text-destructive-text data-[highlighted]:text-destructive-text",menuItemMuted:"text-white/65 focus:text-white data-[highlighted]:text-white",menuItemShortcut:"text-white/45",menuSubTrigger:"text-white focus:bg-white/[0.10] focus:text-white data-[highlighted]:bg-white/[0.10] data-[highlighted]:text-white data-[state=open]:bg-white/[0.12]",menuSubTriggerIcon:"text-white/55",menuSubContent:"border-white/10 bg-slate-950 text-white shadow-2xl",tableLoadingSkeleton:"bg-white/[0.14]",layoutRoot:"border-white/10 bg-slate-950 text-white shadow-none",layoutPane:"border-white/10 bg-slate-950 text-white shadow-none",layoutPaneMuted:"bg-white/[0.06]",layoutPaneSoft:"bg-white/[0.08] shadow-none",layoutResizeHandle:"text-white/65 hover:bg-white/10 active:bg-white/15 focus-visible:bg-white/10",layoutResizeHandleIndicator:"bg-white/45 group-hover/resize:bg-white/75"}},Wh={default:{density:"default",radius:"md",border:"solid",background:"plain"},soft:{density:"default",radius:"lg",border:"subtle",background:"soft"},compact:{density:"compact",radius:"md",border:"subtle",background:"muted"},"tinted-glass":{density:"default",radius:"lg",border:"subtle",background:"glass"},glass:{density:"default",radius:"xl",border:"subtle",background:"glass"},"hard-edge":{density:"compact",radius:"none",border:"strong",background:"plain"}},HN={soft:{buttonBase:"font-medium",panelRoot:"border-border/70",controlWrapper:"font-medium",tabsTrigger:"font-medium",segmentedItem:"font-medium",toolbarRoot:"border-border/70",tableContainer:"border-border/70",tableFooterBar:"border-border/70",tableHeadLabel:"font-semibold",menuItemLabel:"font-medium"},compact:{buttonBase:"text-xs",badgeBase:"text-xs",fieldLabel:"text-xs",controlBase:"text-xs",selectOption:"text-xs",menuItem:"text-xs",menuSubTrigger:"text-xs",noticeBase:"text-xs",sectionHeaderTitle:"text-sm",tabsTrigger:"text-xs",segmentedItem:"text-xs",toolbarTitle:"text-xs",paginationRoot:"text-xs"},"tinted-glass":{buttonPrimary:"border-primary/25 bg-primary/15 text-primary-foreground hover:bg-primary/20",badgePrimary:"border-primary/25 bg-primary/15 text-primary-foreground",noticePrimary:"border-primary/25 bg-primary/15 text-primary-foreground",progressIndicator:"bg-primary",avatarStatus:"border-background"},glass:{panelRoot:"shadow-[0_24px_80px_hsl(var(--foreground)/0.12)]",stateRoot:"shadow-[0_24px_80px_hsl(var(--foreground)/0.12)]",noticeBase:"shadow-[0_18px_60px_hsl(var(--foreground)/0.10)]",tabsPanel:"shadow-[0_18px_60px_hsl(var(--foreground)/0.10)]",toolbarRoot:"shadow-[0_18px_60px_hsl(var(--foreground)/0.10)]",descriptionListItem:"shadow-[0_12px_40px_hsl(var(--foreground)/0.08)]",accordionItem:"shadow-[0_12px_40px_hsl(var(--foreground)/0.08)]"},"hard-edge":{buttonBase:"shadow-none",panelRoot:"shadow-none",stateRoot:"shadow-none",controlWrapper:"shadow-none",selectMenu:"shadow-none",menuContent:"shadow-none",menuSubContent:"shadow-none",noticeBase:"shadow-none",tabsList:"shadow-none",tabsTriggerActive:"shadow-none",tabsPanel:"shadow-none",segmentedRoot:"shadow-none",segmentedItemActive:"shadow-none",toolbarRoot:"shadow-none",descriptionListItem:"shadow-none",accordionItem:"shadow-none"}};function VN(e){return Wh[e]??Wh.default}a(VN,"getPresetDefaults");var _N=Object.keys(Fh),GN=Bh(_N,m);function $N(...e){return Object.assign({},...e.filter(Boolean))}a($N,"mergeStyles");function Ne(e){let t=e?.preset??"default",o=e?.variant??"default",r=VN(t),n=e?.density??r.density??"default",i=e?.state??"idle",s=e?.radius??r.radius??"md",l=e?.border??r.border??"solid",d=e?.background??r.background??"plain";return {preset:t,variant:o,density:n,state:i,radius:s,border:l,background:d,styles:$N(BN,e?.styles),slots:GN(Fh,HN[t],WN[n],zN[s],ON[l],FN[d],e?.slots)}}a(Ne,"resolveBaseAppearance");function jn(e,t="default",o=false){return m(t==="default"&&e.slots.buttonDefault,t==="primary"&&e.slots.buttonPrimary,t==="success"&&e.slots.buttonSuccess,t==="warning"&&e.slots.buttonWarning,t==="danger"&&e.slots.buttonDanger,t==="muted"&&e.slots.buttonMuted,o&&e.slots.buttonActive)}a(jn,"getBaseButtonToneClassName");function Wd(e,t="default"){return m(t==="default"&&e.slots.badgeDefault,t==="primary"&&e.slots.badgePrimary,t==="success"&&e.slots.badgeSuccess,t==="warning"&&e.slots.badgeWarning,t==="danger"&&e.slots.badgeDanger,t==="muted"&&e.slots.badgeMuted)}a(Wd,"getBaseBadgeToneClassName");function zd(e,t="default"){return m(t==="default"&&e.slots.noticeDefault,t==="primary"&&e.slots.noticePrimary,t==="success"&&e.slots.noticeSuccess,t==="warning"&&e.slots.noticeWarning,t==="danger"&&e.slots.noticeDanger,t==="muted"&&e.slots.noticeMuted)}a(zd,"getBaseNoticeToneClassName");function Da(e,t="default"){return m(t==="default"&&e.slots.menuItemDefault,t==="primary"&&e.slots.menuItemPrimary,t==="success"&&e.slots.menuItemSuccess,t==="warning"&&e.slots.menuItemWarning,t==="danger"&&e.slots.menuItemDanger,t==="muted"&&e.slots.menuItemMuted)}a(Da,"getBaseMenuItemToneClassName");function gi(e,t="default"){return m(t==="default"&&e.slots.typographyToneDefault,t==="muted"&&e.slots.typographyToneMuted,t==="primary"&&e.slots.typographyTonePrimary,t==="success"&&e.slots.typographyToneSuccess,t==="warning"&&e.slots.typographyToneWarning,t==="danger"&&e.slots.typographyToneDanger,t==="inherit"&&e.slots.typographyToneInherit)}a(gi,"getBaseTypographyToneClassName");function Od(e,t="md"){return m(t==="xs"&&e.slots.textSizeXs,t==="sm"&&e.slots.textSizeSm,t==="md"&&e.slots.textSizeMd,t==="lg"&&e.slots.textSizeLg,t==="xl"&&e.slots.textSizeXl)}a(Od,"getBaseTextSizeClassName");function Hh(e,t="lg"){return m(t==="xs"&&e.slots.headingSizeXs,t==="sm"&&e.slots.headingSizeSm,t==="md"&&e.slots.headingSizeMd,t==="lg"&&e.slots.headingSizeLg,t==="xl"&&e.slots.headingSizeXl,t==="2xl"&&e.slots.headingSize2xl)}a(Hh,"getBaseHeadingSizeClassName");function Vh(e,t="default"){return m(t==="compact"&&e.slots.listSpacingCompact,t==="default"&&e.slots.listSpacingDefault,t==="relaxed"&&e.slots.listSpacingRelaxed)}a(Vh,"getBaseListSpacingClassName");function _h(e,t){return m(t==="none"&&e.slots.listMarkerNone,t==="disc"&&e.slots.listMarkerDisc,t==="circle"&&e.slots.listMarkerCircle,t==="square"&&e.slots.listMarkerSquare,t==="decimal"&&e.slots.listMarkerDecimal,t==="lower-alpha"&&e.slots.listMarkerLowerAlpha,t==="upper-alpha"&&e.slots.listMarkerUpperAlpha)}a(_h,"getBaseListMarkerClassName");var Gh=/^(?:0+(?:\.0+)?|(?:\d+(?:\.\d+)?|\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw))$/i,jN=new Set(["calc","clamp","max","min","var"]),$h=/[;{}<>"'\\\u0000-\u001f\u007f]/,UN=/(?:\b(?:auto|fit-content|max-content|min-content|subgrid)\b|(?:calc|clamp|max|min|minmax|repeat|var)\s*\(|(?:^|[\s,(])(?:0+(?:\.0+)?|(?:\d+(?:\.\d+)?|\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|fr|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw))(?:$|[\s,)\]]))/i;function jh(e){let t={")":"(","]":"["},o=[];for(let r of e)if(r==="("||r==="[")o.push(r);else if((r===")"||r==="]")&&o.pop()!==t[r])return false;return o.length===0}a(jh,"hasBalancedDelimiters");function KN(e){let t=/^([a-z]+)\(([\s\S]+)\)$/i.exec(e);return !t||!jN.has(t[1].toLowerCase())||!t[2].trim()||!jh(e)?false:t[1].toLowerCase()==="var"?/^\s*--[a-z0-9_-]+(?:\s*,[\s\S]+)?\s*$/i.test(t[2]):Gh.test(t[2].trim())||/\b(?:calc|clamp|max|min|var)\s*\(/i.test(t[2])||/(?:^|[\s,(])(?:0+(?:\.0+)?|(?:\d+(?:\.\d+)?|\.\d+)(?:%|cap|ch|cm|dvb|dvh|dvi|dvw|em|ex|ic|in|lh|lvb|lvh|lvi|lvw|mm|pc|pt|px|q|rem|rlh|svb|svh|svi|svw|vb|vh|vi|vmax|vmin|vw))(?:$|[\s,)])/i.test(t[2])}a(KN,"isSupportedCssLengthFunction");function nr(e,t,o){if(typeof o=="number"){if(!Number.isFinite(o)||o<0)throw new RangeError(`${e} ${t} must be a finite, non-negative number or a supported CSS length string.`);return `${o}px`}if(typeof o!="string")throw new TypeError(`${e} ${t} must be a finite, non-negative number or a supported CSS length string.`);let r=o.trim();if(!r||$h.test(r)||!Gh.test(r)&&!KN(r))throw new TypeError(`${e} ${t} must be a non-empty, non-negative CSS length (for example 12px, 1rem, 5%, or var(--space)).`);return r}a(nr,"resolveBaseLayoutLength");function Uh(e){if(typeof e=="number"){if(!Number.isInteger(e)||e<=0)throw new RangeError("BaseGrid columns must be a positive integer or a supported CSS grid-template-columns string.");return `repeat(${e}, minmax(0, 1fr))`}if(typeof e!="string")throw new TypeError("BaseGrid columns must be a positive integer or a supported CSS grid-template-columns string.");let t=e.trim();if(!t||$h.test(t)||/\burl\s*\(/i.test(t)||!jh(t)||!UN.test(t))throw new TypeError('BaseGrid columns must be a non-empty CSS grid-template-columns value such as "12rem minmax(0, 1fr)" or "repeat(3, minmax(0, 1fr))".');return t}a(Uh,"resolveBaseGridColumns");var zh={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},Oh={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"};function hi(e,t){if(!Object.prototype.hasOwnProperty.call(zh,t))throw new TypeError(`${e} align must be one of: start, center, end, stretch, baseline.`);return zh[t]}a(hi,"resolveBaseLayoutAlign");function yi(e,t){if(!Object.prototype.hasOwnProperty.call(Oh,t))throw new TypeError(`${e} justify must be one of: start, center, end, between, around, evenly.`);return Oh[t]}a(yi,"resolveBaseLayoutJustify");var XN=new Set(["compact","pages"]);function Kh(e,t){return Math.min(Math.max(e,1),Math.max(t,1))}a(Kh,"clampPage");function Fd(e,t){if(!Number.isSafeInteger(e)||e<1)throw new RangeError(`BasePagination ${t} must be a positive safe integer.`)}a(Fd,"assertPositiveInteger");function cm(e,t){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`BasePagination ${t} must be a non-negative safe integer.`)}a(cm,"assertNonNegativeInteger");function Hd(e,t){if(typeof e=="string"&&!e.trim())throw new TypeError(`BasePagination ${t} must be a non-empty string when provided.`)}a(Hd,"assertOptionalControlLabel");function QN(e,t){if(e!==void 0&&(typeof e!="string"||!e.trim()))throw new TypeError("BasePagination aria-label must be a non-empty string when provided.");if(t!==void 0&&(typeof t!="string"||!t.trim()))throw new TypeError("BasePagination aria-labelledby must contain at least one valid ID token.");if(typeof t=="string"&&t.trim().split(/\s+/).some(r=>/[\u0000-\u001f\u007f]/u.test(r)))throw new TypeError("BasePagination aria-labelledby must contain only valid ID tokens.")}a(QN,"assertAccessibleName");function Pa(e,t){if(typeof e!="string"||!e.trim())throw new TypeError(`BasePagination locale ${t} must resolve to a non-empty string.`);return e}a(Pa,"assertLocaleString");function Vd(e,t){return V(e)?e:t}a(Vd,"getControlContent");function _d(e,t){return typeof e=="string"&&e.trim()?e:t}a(_d,"getControlAriaLabel");function ZN(e,t,o,r){let n=new Set,i=a(d=>{d>=1&&d<=t&&n.add(d);},"addPage");for(let d=0;d<o;d+=1)i(1+d),i(t-d);for(let d=-r;d<=r;d+=1)i(e+d);let s=[...n].sort((d,c)=>d-c),l=[];return s.forEach((d,c)=>{let p=s[c-1];if(p!==void 0){let u=d-p;u===2&&l.push(p+1),u>2&&l.push("ellipsis");}l.push(d);}),l}a(ZN,"getPageItems");var $d=ho.forwardRef(a(function({page:t,defaultPage:o,pageSize:r=20,total:n=0,pageCount:i,hasNext:s,hasPrevious:l,mode:d="compact",siblingCount:c=1,boundaryCount:p=1,label:u,firstLabel:g,previousLabel:f,nextLabel:b,lastLabel:x,appearance:y,className:k,classNames:w,style:v,onPageChange:h,role:S="navigation","aria-label":T,"aria-labelledby":C,...R},M){let I=Ye().pagination,A=Pe(y),N=ke(),D=Ne(A),[E,P]=ho.useState(()=>o??1);if(t!==void 0&&Fd(t,"page"),o!==void 0&&Fd(o,"defaultPage"),Fd(r,"pageSize"),cm(n,"total"),i!==void 0&&Fd(i,"pageCount"),cm(c,"siblingCount"),cm(p,"boundaryCount"),!XN.has(d))throw new TypeError('BasePagination mode must be "compact" or "pages".');if(h!==void 0&&typeof h!="function")throw new TypeError("BasePagination onPageChange must be a function.");Hd(g,"firstLabel"),Hd(f,"previousLabel"),Hd(b,"nextLabel"),Hd(x,"lastLabel"),QN(T,C);let W=Pa(I.navigation,"navigation"),H=Pa(I.first,"first"),B=Pa(I.previous,"previous"),L=Pa(I.next,"next"),F=Pa(I.last,"last"),_=i??Math.max(Math.ceil(n/r),1),$=t!==void 0,G=!$&&o!==void 0,z=Kh($?t:G?E:1,_),re=n>0?(z-1)*r+1:0,Z=Math.min(z*r,n),ae=l??z>1,ee=s??z<_,q=d==="pages"?ZN(z,_,p,c):[],U=a(O=>{let K=Kh(O,_);K!==z&&(G&&P(K),h?.(K));},"requestPage"),X=a((O,K,ne,fe,he)=>jsxRuntime.jsx("button",{type:"button",disabled:!ne,"aria-label":he,"data-slot":O,className:m(D.slots.paginationButton,!ne&&D.slots.paginationButtonDisabled,w?.button),onClick:()=>U(K),children:fe}),"renderControl");return jsxRuntime.jsxs("div",{...N,...R,ref:M,role:S,"aria-label":T??(C===void 0?W:void 0),"aria-labelledby":C,"data-monkeys-component":"pagination","data-slot":"root","data-mode":d,"data-controlled":$||void 0,"data-uncontrolled":G||void 0,className:m(D.slots.paginationRoot,w?.root,k),style:{...D.styles.pagination,...v},children:[jsxRuntime.jsx("div",{"aria-live":"polite","data-slot":"info",className:m(D.slots.paginationInfo,w?.info),children:V(u)?u:n>0?I.range({start:re,end:Z,total:n}):I.emptyResults}),jsxRuntime.jsxs("div",{"data-slot":"controls",className:m(D.slots.paginationControls,w?.controls),children:[d==="pages"?X("first",1,ae,Vd(g,H),_d(g,H)):null,X("previous",z-1,ae,Vd(f,B),_d(f,B)),d==="compact"?jsxRuntime.jsxs("span",{"aria-current":"page","aria-label":Pa(I.currentPage({page:z,pageCount:_}),"currentPage"),"data-slot":"page","data-page":z,className:m(D.slots.paginationPage,w?.page),children:[z," / ",_]}):q.map((O,K)=>{if(O==="ellipsis")return jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"ellipsis",className:m(D.slots.paginationEllipsis,w?.ellipsis),children:"\u2026"},`ellipsis-${K}`);let ne=O===z;return jsxRuntime.jsx("button",{type:"button","aria-current":ne?"page":void 0,"aria-label":Pa(ne?I.currentPage({page:O,pageCount:_}):I.page({page:O,pageCount:_}),ne?"currentPage":"page"),"data-slot":"page","data-page":O,"data-current":ne||void 0,className:m(D.slots.paginationButton,ne&&D.slots.paginationPage,w?.button,ne&&w?.page),onClick:()=>U(O),children:O},O)}),X("next",z+1,ee,Vd(b,L),_d(b,L)),d==="pages"?X("last",_,ee,Vd(x,F),_d(x,F)):null]})]})},"BasePagination"));function JN(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"ml-1 inline-block h-3 w-3 animate-spin",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(JN,"LoadingIcon");function Ud({total:e=0,loadedStart:t,loadedEnd:o,selectedCount:r,page:n=1,pageCount:i,pageSize:s=20,pageSizeOptions:l,showTotal:d,showPageSize:c,paginationMode:p,hasNext:u,hasPrevious:g,loading:f=false,totalLabel:b,selectedLabel:x,pageSizeLabel:y,appearance:k,className:w,classNames:v,onPageChange:h,onPageSizeChange:S,onSummaryClick:T,...C}){let R=Td(),M=Ye().pagination,I=[...new Set(l??R.pageSizeOptions??[10,20,50,100])].filter(L=>Number.isSafeInteger(L)&&L>0),A=d??R.showTotal??true,N=c??R.showPageSize??true,D=p??R.paginationMode??"auto",E=D==="auto"?e>0?"pages":"compact":D,P=t!==void 0&&t>0&&o!==void 0&&o>=t,W=A?b??(P?M.range({start:t,end:o,total:e}):M.range({start:e>0?(n-1)*s+1:0,end:o??0,total:e})):void 0,H=!!h&&(u!==void 0||g!==void 0?!!(u||g||e>s):e>s),B=R.alignment==="end"?"justify-end":R.alignment==="start"?"justify-start":"justify-between";return jsxRuntime.jsx("div",{...C,className:m("flex min-w-0 flex-wrap items-center gap-3 py-2 text-sm",B,v?.root,w),"data-monkeys-component":"list-footer","data-density":R.density,children:jsxRuntime.jsxs("div",{className:"monkeys-list-footer-groups contents",children:[jsxRuntime.jsx("div",{className:m("min-w-0 text-muted-foreground",v?.summary),children:(()=>{let L=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[x??(r!==void 0?M.selected({count:r}):null),r!==void 0&&W?jsxRuntime.jsx("span",{className:"mx-2",children:"\xB7"}):null,W,f?jsxRuntime.jsx(JN,{}):null]});return T?jsxRuntime.jsx("button",{type:"button",className:"inline-flex items-center",onClick:T,children:L}):L})()}),H?jsxRuntime.jsx($d,{page:n,pageCount:i,pageSize:s,total:e,mode:E,hasNext:u,hasPrevious:g,onPageChange:h,appearance:k,className:v?.pagination,classNames:{info:"sr-only"}}):null,N&&S&&I.length>0?jsxRuntime.jsxs("label",{className:m("inline-flex items-center gap-2 whitespace-nowrap text-muted-foreground",v?.pageSize),children:[jsxRuntime.jsx("span",{className:"sr-only",children:y??M.pageSize}),jsxRuntime.jsx("select",{"aria-label":typeof y=="string"?y:M.pageSize,value:String(s),className:"h-8 rounded-md border border-border bg-background px-2 text-sm text-foreground",onChange:L=>S(Number(L.currentTarget.value)),children:I.map(L=>jsxRuntime.jsx("option",{value:L,children:L},L))})]}):null]})})}a(Ud,"BaseListFooter");var qh=Symbol.for("@inf-monkeys-tech/monkeys-design/bento-depth@1"),Yh=globalThis,Xh=Yh[qh]??(Yh[qh]=ho.createContext(0));function Go(){return ho.useContext(Xh)}a(Go,"useBentoDepth");function pm({children:e,depth:t}){return jsxRuntime.jsx(Xh.Provider,{value:t,children:e})}a(pm,"BentoDepthProvider");function Cs({children:e}){return jsxRuntime.jsx(pm,{depth:0,children:e})}a(Cs,"BentoScope");var Zh="rounded-[var(--monkeys-bento-radius)] border-[length:var(--monkeys-bento-border-width)] border-[color:var(--monkeys-bento-border-color)] [border-style:var(--monkeys-bento-border-style)] bg-[var(--monkeys-bento-background)] shadow-[shadow:var(--monkeys-bento-shadow)] p-[var(--monkeys-bento-padding)] gap-[var(--monkeys-bento-gap)]";function Jh(){let e=Go(),t=e+1,o=uh(Hn(),t),r=Object.fromEntries(vd.map(n=>[`--monkeys-bento-${n.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`,o.values[n]]));return {parentDepth:e,level:t,variables:r}}a(Jh,"useBentoSurface");function ty({as:e="article",title:t,description:o,media:r,header:n,footer:i,children:s,interactive:l,selected:d,disabled:c,appearance:p,variant:u,density:g,state:f,className:b,classNames:x,style:y,...k}){let w=Ne({...p,variant:u,density:g,state:f}),v=e,h=n!==void 0?V(n):V(t)||V(o),S=r!=null,T=!h&&!S;return jsxRuntime.jsxs(v,{...k,"aria-disabled":c||void 0,"data-variant":w.variant,"data-density":w.density,"data-state":f??(c?"disabled":d?"selected":"idle"),"data-monkeys-component":"panel","data-slot":"root","data-interactive":l||void 0,"data-selected":d||void 0,"data-disabled":c||void 0,className:m(w.slots.panelRoot,l&&!c&&w.slots.panelInteractive,d&&w.slots.panelSelected,c&&w.slots.panelDisabled,x?.root,b),style:{...w.styles.panel,...y},children:[S?jsxRuntime.jsx("div",{"data-slot":"media",className:m(w.slots.panelMedia,x?.media),children:r}):null,h?jsxRuntime.jsx("div",{"data-slot":"header",className:m(w.slots.panelHeader,x?.header),style:w.styles.panelHeader,children:n!==void 0?n:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V(t)?jsxRuntime.jsx("div",{"data-slot":"title",className:m(w.slots.panelTitle,x?.title),children:t}):null,V(o)?jsxRuntime.jsx("div",{"data-slot":"description",className:m(w.slots.panelDescription,x?.description),children:o}):null]})}):null,s!=null?jsxRuntime.jsx("div",{"data-slot":"body",className:m(w.slots.panelBody,T&&w.slots.panelBodyStandalone,x?.body),style:w.styles.panelBody,children:s}):null,i!=null?jsxRuntime.jsx("div",{"data-slot":"footer",className:m(w.slots.panelFooter,x?.footer),style:w.styles.panelFooter,children:i}):null]})}a(ty,"BasePanel");var nR={menu:"monkeys-overlay-surface--menu bg-menu-surface text-popover-foreground",dialog:"monkeys-overlay-surface--dialog bg-dialog-surface text-foreground"};function un(e,t={}){return ["monkeys-overlay-surface",nR[e],t.rounded===false?void 0:"monkeys-overlay-surface--rounded"].filter(Boolean).join(" ")}a(un,"getOverlaySurfaceClassName");var dR=ho__namespace.forwardRef(({className:e,style:t,...o},r)=>jsxRuntime.jsx(pn__namespace.Item,{ref:r,className:m("border-b",e),style:{borderColor:"var(--monkeys-component-accordion-item-border-color, hsl(var(--border)))",...t},...o}));dR.displayName="AccordionItem";var cR=ho__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsx(pn__namespace.Header,{className:"flex",children:jsxRuntime.jsxs(pn__namespace.Trigger,{ref:r,className:m("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...o,children:[t,jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));cR.displayName="AccordionTrigger";var uR=ho__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsx(pn__namespace.Content,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...o,children:jsxRuntime.jsx("div",{className:m("pb-4 pt-0",e),children:t})}));uR.displayName="AccordionContent";var pR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Kd__namespace.Root,{ref:o,className:m("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:jsxRuntime.jsx(Kd__namespace.Indicator,{className:"flex items-center justify-center text-current",children:jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"})})}));pR.displayName="Checkbox";var mR=classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_[data-slot=icon]]:text-[inherit] [&_[data-slot=icon]_*]:!text-[inherit] [&_[data-slot=icon]_svg]:!stroke-current [&_[data-slot=icon]_svg_*]:!stroke-current [&_[data-slot=end-icon]]:text-[inherit] [&_[data-slot=end-icon]_*]:!text-[inherit] [&_[data-slot=end-icon]_svg]:!stroke-current [&_[data-slot=end-icon]_svg_*]:!stroke-current [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-control-surface shadow-sm ring-offset-control-surface hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-sm px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),mt=ho__namespace.forwardRef(({className:e,variant:t,size:o,asChild:r=false,...n},i)=>jsxRuntime.jsx(r?reactSlot.Slot:"button",{ref:i,className:mR({variant:t,size:o,className:e}),...n}));mt.displayName="Button";var fR=ho__namespace.forwardRef(({className:e,children:t,viewportClassName:o,viewportRef:r,onViewportScroll:n,scrollbar:i=true,scrollbarOrientation:s="vertical",scrollBarDisabled:l=false,type:d,...c},p)=>{let u=Go();return jsxRuntime.jsxs(Fr__namespace.Root,{ref:p,type:d??(u>0?"auto":void 0),className:m("group relative overflow-hidden",l&&"no-scrollbar",e),...c,children:[jsxRuntime.jsx(Fr__namespace.Viewport,{ref:r,onScroll:n,className:m("h-full w-full rounded-[inherit]",o),children:t}),i?jsxRuntime.jsx(oy,{orientation:s,className:m(l&&"size-0 p-0")}):null,jsxRuntime.jsx(Fr__namespace.Corner,{})]})});fR.displayName="ScrollArea";var oy=ho__namespace.forwardRef(({className:e,orientation:t="vertical",...o},r)=>jsxRuntime.jsx(Fr__namespace.ScrollAreaScrollbar,{ref:r,"data-monkeys-scrollbar":"",orientation:t,className:m("flex touch-none select-none opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 data-[state=visible]:opacity-100",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e),...o,children:jsxRuntime.jsx(Fr__namespace.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));oy.displayName="ScrollBar";var bR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(qd__namespace.Root,{ref:o,className:m("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,children:jsxRuntime.jsx(qd__namespace.Thumb,{className:"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"})}));bR.displayName="Switch";var Ea=ho__namespace.forwardRef(({variant:e="default",...t},o)=>jsxRuntime.jsx(Un__namespace.Root,{ref:o,"data-variant":e,...t}));Ea.displayName="Tabs";var Aa=ho__namespace.forwardRef(({className:e,gap:t,style:o,...r},n)=>jsxRuntime.jsx(Un__namespace.List,{ref:n,className:m("inline-flex h-10 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),style:{gap:t,...o},...r}));Aa.displayName="TabsList";var Kn=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Un__namespace.Trigger,{ref:o,className:m("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Kn.displayName="TabsTrigger";var mn=ho__namespace.forwardRef(({className:e,...t},o)=>{let r=Go();return jsxRuntime.jsx(Un__namespace.Content,{ref:o,className:m("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r>0&&"gap-[var(--monkeys-bento-gap)]",e),...t})});mn.displayName="TabsContent";var ry=fr__namespace.Provider,ny=fr__namespace.Root,ay=fr__namespace.Trigger,mm=ho__namespace.forwardRef(({className:e,sideOffset:t=4,...o},r)=>{let n=ke();return jsxRuntime.jsx(fr__namespace.Portal,{children:jsxRuntime.jsx(fr__namespace.Content,{...n,...o,ref:r,sideOffset:t,"data-monkeys-component":"tooltip","data-slot":"content","data-surface":"menu",className:m("z-50 overflow-hidden border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",un("menu"),e)})})});mm.displayName="TooltipContent";var wr=ho__namespace.forwardRef(({className:e,appearance:t="standard",type:o,...r},n)=>jsxRuntime.jsx("input",{ref:n,type:o,className:m("flex w-full border border-input bg-control-surface px-3 text-foreground ring-offset-control-surface transition-[border-color,background-color,color,box-shadow] file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t==="compact"?"h-9 rounded-md py-1 text-sm shadow-sm":"h-10 rounded-md py-2 text-sm shadow-sm",t==="shadow"&&"rounded-lg shadow-sm shadow-black/[0.02] dark:border-white/10 dark:bg-white/[0.04] dark:shadow-none",e),...r}));wr.displayName="Input";var bm=ho__namespace.forwardRef(({className:e,appearance:t="standard",...o},r)=>jsxRuntime.jsx("textarea",{ref:r,className:m("flex w-full border border-input bg-control-surface px-3 py-2 text-foreground ring-offset-control-surface placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t==="compact"?"min-h-[60px] rounded-md text-sm shadow-sm":"min-h-[80px] rounded-md text-sm",t==="shadow"&&"rounded-lg shadow-sm shadow-black/[0.02] dark:border-white/10 dark:bg-white/[0.04] dark:shadow-none",e),...o}));bm.displayName="Textarea";function dy({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"input-group",role:"group",className:m("group/input-group shadow-xs relative flex w-full items-center rounded-md border border-input outline-hidden transition-[color,box-shadow] dark:bg-input/30","h-9 has-[>textarea]:h-auto","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col","has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot=input-group-control]:focus-visible]:ring-ring","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}a(dy,"InputGroup");var gR=classVarianceAuthority.cva("text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]","block-start":"[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5","block-end":"[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function Yd({className:e,align:t="inline-start",...o}){return jsxRuntime.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:m(gR({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus();},...o})}a(Yd,"InputGroupAddon");var hR=classVarianceAuthority.cva("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",sm:"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function cy({className:e,type:t="button",variant:o="ghost",size:r="xs",...n}){return jsxRuntime.jsx(mt,{type:t,"data-size":r,variant:o,className:m(hR({size:r}),e),...n})}a(cy,"InputGroupButton");var hm=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(wr,{ref:o,"data-slot":"input-group-control",className:m("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent",e),...t}));hm.displayName="InputGroupInput";var yR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(bm,{ref:o,"data-slot":"input-group-control",className:m("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 dark:bg-transparent",e),...t}));yR.displayName="InputGroupTextarea";var Ts="relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",ym=`z-50 min-w-[8rem] overflow-hidden border p-1 ${un("menu")} data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,Ns=Bt__namespace.Root,Rs=Bt__namespace.Trigger;var my=Bt__namespace.RadioGroup,kR=ho__namespace.forwardRef(({className:e,inset:t,children:o,...r},n)=>jsxRuntime.jsxs(Bt__namespace.SubTrigger,{ref:n,className:m(Ts,"data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[o,jsxRuntime.jsx(lucideReact.ChevronRight,{"aria-hidden":"true",className:"ml-auto"})]}));kR.displayName="DropdownMenuSubTrigger";var CR=ho__namespace.forwardRef(({className:e,...t},o)=>{let r=ke();return jsxRuntime.jsx(Bt__namespace.SubContent,{...r,...t,ref:o,"data-monkeys-component":"dropdown-menu","data-slot":"content","data-surface":"menu",className:m(ym,e)})});CR.displayName="DropdownMenuSubContent";var vi=ho__namespace.forwardRef(({className:e,sideOffset:t=4,...o},r)=>{let n=ke();return jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{...n,...o,ref:r,sideOffset:t,"data-monkeys-component":"dropdown-menu","data-slot":"content","data-surface":"menu",className:m(ym,e)})})});vi.displayName="DropdownMenuContent";var Ms=ho__namespace.forwardRef(({className:e,inset:t,...o},r)=>jsxRuntime.jsx(Bt__namespace.Item,{ref:r,className:m(Ts,t&&"pl-8",e),...o}));Ms.displayName="DropdownMenuItem";var SR=ho__namespace.forwardRef(({className:e,children:t,checked:o,...r},n)=>jsxRuntime.jsxs(Bt__namespace.CheckboxItem,{ref:n,className:m(Ts,"pl-8",e),checked:o,...r,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(Bt__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"})})}),t]}));SR.displayName="DropdownMenuCheckboxItem";var xm=ho__namespace.forwardRef(({className:e,children:t,...o},r)=>jsxRuntime.jsxs(Bt__namespace.RadioItem,{ref:r,className:m(Ts,"pl-8",e),...o,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(Bt__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Circle,{"aria-hidden":"true",className:"h-2 w-2 fill-current"})})}),t]}));xm.displayName="DropdownMenuRadioItem";var vm=ho__namespace.forwardRef(({className:e,inset:t,...o},r)=>jsxRuntime.jsx(Bt__namespace.Label,{ref:r,className:m("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));vm.displayName="DropdownMenuLabel";var wm=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(Bt__namespace.Separator,{ref:o,className:m("-mx-1 my-1 h-px bg-muted",e),...t}));wm.displayName="DropdownMenuSeparator";var TR=a(({className:e,...t})=>jsxRuntime.jsx("span",{className:m("ml-auto text-xs tracking-widest opacity-60",e),...t}),"DropdownMenuShortcut");TR.displayName="DropdownMenuShortcut";var NR=ho__namespace.forwardRef(({className:e,children:t,iconClassName:o,size:r="default",...n},i)=>jsxRuntime.jsxs(At__namespace.Trigger,{ref:i,className:m("flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-control-surface px-3 py-2 text-left text-sm text-foreground shadow-sm ring-offset-control-surface data-[placeholder]:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:min-w-0 [&>span]:flex-1 [&>span]:text-left",r==="sm"&&"h-8 px-2 py-1 text-xs",e),...n,children:[t,jsxRuntime.jsx(At__namespace.Icon,{asChild:true,children:jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:m("h-4 w-4 opacity-50",o)})})]}));NR.displayName="SelectTrigger";var fy=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.ScrollUpButton,{ref:o,className:m("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(lucideReact.ChevronUp,{"aria-hidden":"true",className:"h-4 w-4"})}));fy.displayName="SelectScrollUpButton";var by=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.ScrollDownButton,{ref:o,className:m("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4"})}));by.displayName="SelectScrollDownButton";var RR=ho__namespace.forwardRef(({className:e,children:t,position:o="popper",viewportClassName:r,disableTriggerViewportSizing:n=false,...i},s)=>{let l=ke();return jsxRuntime.jsx(At__namespace.Portal,{children:jsxRuntime.jsxs(At__namespace.Content,{...l,...i,ref:s,position:o,"data-monkeys-component":"select","data-slot":"content","data-surface":"menu",className:m(ym,"relative max-h-[var(--radix-select-content-available-height)] overflow-y-auto overflow-x-hidden",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),children:[jsxRuntime.jsx(fy,{}),jsxRuntime.jsx(At__namespace.Viewport,{className:m("p-1",o==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]",o==="popper"&&!n&&"h-[var(--radix-select-trigger-height)]",r),children:t}),jsxRuntime.jsx(by,{})]})})});RR.displayName="SelectContent";var MR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.Label,{ref:o,className:m("px-2 py-1.5 text-sm font-semibold",e),...t}));MR.displayName="SelectLabel";var IR=ho__namespace.forwardRef(({className:e,children:t,indicatorClassName:o,itemText:r,hideIndicator:n=false,...i},s)=>jsxRuntime.jsxs(At__namespace.Item,{ref:s,className:m(Ts,"w-full",n?"px-2":"pl-8 pr-2",e),...i,children:[n?null:jsxRuntime.jsx("span",{className:m("absolute left-2 flex h-3.5 w-3.5 items-center justify-center",o),children:jsxRuntime.jsx(At__namespace.ItemIndicator,{children:jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":"true",className:"h-4 w-4"})})}),r?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(At__namespace.ItemText,{asChild:true,children:jsxRuntime.jsx("span",{className:"sr-only",children:r})}),t]}):jsxRuntime.jsx(At__namespace.ItemText,{children:t})]}));IR.displayName="SelectItem";var DR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(At__namespace.Separator,{ref:o,className:m("-mx-1 my-1 h-px bg-muted",e),...t}));DR.displayName="SelectSeparator";function qn(e){if(!e)return;let t=/^data:image\/svg\+xml(?:[;,]|$)/i.test(e.trim());if(!t)try{t=/\.svgz?$/i.test(decodeURIComponent(new URL(e,"https://preview.invalid").pathname));}catch{return}return t?{backgroundColor:"var(--monkeys-media-svg-background)",objectFit:"contain"}:void 0}a(qn,"svgPreviewSurface");var ER=a(({aspectRatio:e="square",maxSquareHeight:t=true,className:o}={})=>m("w-full overflow-hidden bg-muted",(e==="square"||e==="1:1")&&"aspect-square",(e==="square"||e==="1:1")&&t&&"max-h-[300px]",e==="4:3"&&"aspect-[4/3]",e==="3:4"&&"aspect-[3/4]",(e==="video"||e==="16:9")&&"aspect-video",e==="9:16"&&"aspect-[9/16]",o),"mediaPreviewFrameClassName"),Is=ho__namespace.forwardRef(({aspectRatio:e="square",maxSquareHeight:t=true,className:o,...r},n)=>jsxRuntime.jsx("div",{ref:n,className:ER({aspectRatio:e,maxSquareHeight:t,className:o}),...r}));Is.displayName="MediaPreviewFrame";var Ds=ho__namespace.forwardRef(({fit:e="contain",className:t,style:o,...r},n)=>{let i=qn(r.src);return jsxRuntime.jsx("img",{ref:n,className:m("block size-full",e==="contain"?"object-contain":"object-cover",t),style:{...i,...i?{objectFit:e}:{},...o},...r})});Ds.displayName="MediaPreviewImage";var Sm=xo__namespace.Root;var AR=xo__namespace.Portal,hy=ho__namespace.forwardRef(({className:e,...t},o)=>{let r=ke();return jsxRuntime.jsx(xo__namespace.Overlay,{...r,...t,ref:o,"data-monkeys-component":"sheet","data-slot":"overlay","data-monkeys-overlay":true,className:m("theme-overlay-backdrop fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e)})});hy.displayName="SheetOverlay";var BR={top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm"},Xd=ho__namespace.forwardRef(({side:e="right",className:t,children:o,...r},n)=>{let i=ke();return jsxRuntime.jsxs(AR,{children:[jsxRuntime.jsx(hy,{}),jsxRuntime.jsxs(xo__namespace.Content,{...i,...r,ref:n,"data-monkeys-component":"sheet","data-slot":"content","data-surface":"dialog","data-monkeys-dialog-content":true,className:m("fixed z-50 gap-4 p-6 transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",un("dialog",{rounded:false}),BR[e],t),children:[jsxRuntime.jsxs(xo__namespace.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-dialog-surface transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[jsxRuntime.jsx("svg",{"aria-hidden":"true",className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]}),jsxRuntime.jsx(Cs,{children:o})]})]})});Xd.displayName="SheetContent";var Qd=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(xo__namespace.Title,{ref:o,className:m("text-lg font-semibold text-foreground",e),...t}));Qd.displayName="SheetTitle";var LR=ho__namespace.forwardRef(({className:e,...t},o)=>jsxRuntime.jsx(xo__namespace.Description,{ref:o,className:m("text-sm text-muted-foreground",e),...t}));LR.displayName="SheetDescription";var yy=["pulse","shimmer","shimmer-soft","shimmer-diagonal","shimmer-vertical","drift","outline","none"];function vy(e,t=false){if(!(e===void 0||yy.includes(e))&&!(t&&(e==="shimmer-shared"||e==="shimmer-stagger")))throw new TypeError(`Skeleton animation must be ${yy.join(", ")}${t?", shimmer-shared, or shimmer-stagger":""}.`)}a(vy,"validateSkeletonAnimation");var Nm=ho.createContext(null),As=ho.createContext(void 0);function Rm(e){delete e.dataset.skeletonReady;for(let t of ["width","offset","delay"])e.style.removeProperty(`--monkeys-skeleton-${t}`);}a(Rm,"clearGeometry");function zR(e,t,o,r){let n=ho.useMemo(()=>({nodes:new Map,update:a(()=>{},"update")}),[]);return ho.useEffect(()=>{if(!o||t||e!=="shimmer-shared"&&e!=="shimmer-stagger")return;let i=window.matchMedia("(prefers-reduced-motion: reduce)"),s,l,d=false,c=new Set,p=a(()=>{if(l=void 0,!d)return;let b=[...n.nodes.keys()].filter(S=>S.isConnected);if(b.sort((S,T)=>S.compareDocumentPosition(T)&2?1:-1),e==="shimmer-stagger"){b.forEach((S,T)=>{let C=n.nodes.get(S)?.item??T;S.style.setProperty("--monkeys-skeleton-delay",`${Math.min(C*80,400)}ms`);});return}let x=r?.current??b[0]?.parentElement;for(let S of b)for(;x&&!x.contains(S);)x=x.parentElement;let y=new Set(b);for(let S of b)for(let T=S.parentElement;T&&(y.add(T),T!==x);T=T.parentElement);x&&y.add(x);for(let S of c)y.has(S)||(s?.unobserve(S),c.delete(S));for(let S of y)c.has(S)||(s?.observe(S),c.add(S));let k=b.map(S=>S.getBoundingClientRect()),w=b.map((S,T)=>{let C=getComputedStyle(S),R=C.boxSizing==="border-box"?0:parseFloat(C.paddingLeft)+parseFloat(C.paddingRight)+parseFloat(C.borderLeftWidth)+parseFloat(C.borderRightWidth),M=parseFloat(C.width)+R,I=M?k[T].width/M:1;return Math.abs(I-1)<1e-4?1:I}),v=Math.min(...k.map(S=>S.left)),h=Math.max(...k.map(S=>S.right));b.forEach((S,T)=>{let C=k[T];if(!C.width||!C.height){Rm(S);return}let R=w[T];S.style.setProperty("--monkeys-skeleton-width",`${(h-v)/R}px`),S.style.setProperty("--monkeys-skeleton-offset",`${(v-C.left)/R}px`),S.dataset.skeletonReady||(S.style.setProperty("--monkeys-skeleton-delay",`${-(performance.now()%2600)}ms`),S.dataset.skeletonReady="true");});},"measure"),u=a(()=>{d&&l===void 0&&(l=window.requestAnimationFrame(p));},"schedule"),g=a(()=>{d=false,s?.disconnect(),s=void 0,c.clear(),l!==void 0&&window.cancelAnimationFrame(l),l=void 0,window.removeEventListener("resize",u),window.removeEventListener("scroll",u,true),n.nodes.forEach((b,x)=>Rm(x));},"stop"),f=a(()=>{g(),!(i.matches||e==="shimmer-shared"&&typeof ResizeObserver>"u")&&(d=true,e==="shimmer-shared"&&(s=new ResizeObserver(u),window.addEventListener("resize",u),window.addEventListener("scroll",u,{capture:true,passive:true})),u());},"start");return n.update=u,f(),i.addEventListener("change",f),()=>{g(),i.removeEventListener("change",f),n.update=()=>{};}},[e,t,o,n,r]),ho.useEffect(()=>{n.update();}),n}a(zR,"useGroupRegistry");function Xn({animation:e,animated:t,children:o,independent:r=false,containerRef:n}){if(vy(e,true),t!==void 0&&typeof t!="boolean")throw new TypeError("SkeletonGroup animated must be a boolean.");let i=ho.useContext(Nm),s=ho.useContext(As),l=r||e!==void 0||!i,d=e??i?.animation??"pulse",c=!!i?.disabled||t===false||d==="none",p=zR(d,c,l,n),u=ho.useMemo(()=>({animation:d,disabled:c,registry:l?p:i.registry}),[d,c,l,p,i]),g=jsxRuntime.jsx(Nm.Provider,{value:u,children:o});return jsxRuntime.jsx(As.Provider,{value:l?void 0:s,children:g})}a(Xn,"SkeletonScope");function Zd({index:e,children:t}){let o=ho.useContext(As);return jsxRuntime.jsx(As.Provider,{value:o??e,children:t})}a(Zd,"SkeletonItem");function Dm(e,t){return ho.useMemo(()=>{let o;return r=>{if(e(r),typeof t=="function"){if(o)o(),o=void 0;else if(r===null){t(null);return}if(r!==null){let n=t(r);typeof n=="function"&&(o=n);}}else t&&(t.current=r);}},[e,t])}a(Dm,"useSkeletonRef");function Jd(e,t=true,o){vy(e);let r=ho.useContext(Nm),n=ho.useContext(As),i=!t||r?.disabled?"none":e??r?.animation??"pulse",[s,l]=ho.useState(null),d=Dm(l,o),c=e===void 0&&(i==="shimmer-shared"||i==="shimmer-stagger")?r?.registry:void 0;return ho.useEffect(()=>{if(!(!s||!c))return c.nodes.set(s,{item:n}),c.update(),()=>{c.nodes.delete(s),Rm(s),c.update();}},[s,c,n,i]),{ref:d,mode:i,style:i==="shimmer-stagger"&&n!==void 0?{"--monkeys-skeleton-delay":`${Math.min(n*80,400)}ms`}:void 0}}a(Jd,"useSkeletonMotion");var VR=ho.forwardRef(a(function({animation:t,animated:o,children:r,...n},i){let s=ho.useRef(null),l=ho.useCallback(c=>{s.current=c;},[]),d=Dm(l,i);return jsxRuntime.jsx(Xn,{animation:t,animated:o,independent:true,containerRef:s,children:jsxRuntime.jsx("div",{...n,ref:d,children:r})})},"SkeletonGroup"));function Ty({selectedCount:e,loadedStart:t,loadedEnd:o,total:r,currentPage:n=1,pageSize:i=Math.max(1,o||1),pageSizeOptions:s=[],loading:l,selectedLabel:d,loadedLabel:c,pageSizeLabel:p,pageText:u,tone:g="default",className:f,classNames:b,onJump:x,onJumpToPage:y,onPageSizeChange:k}){let w=Ye().pagination,v=typeof t=="number"&&t>0&&o>=t,h=c??(v?w.range({start:t,end:o,total:r}):w.range({start:0,end:o,total:r})),[S,T]=ho.useState(false),[C,R]=ho.useState(String(n)),M=ho.useRef(null),I=r>0?Math.max(1,Math.ceil(r/Math.max(1,i))):1;if(ho.useEffect(()=>{S||R(String(n));},[n,S]),ho.useEffect(()=>{if(!S)return;let A=window.setTimeout(()=>{M.current?.focus(),M.current?.select();},0);return ()=>window.clearTimeout(A)},[S]),g==="hard-edge"){let A=a(()=>{let N=Math.floor(Number(C));if(!Number.isFinite(N)||Number.isNaN(N)){R(String(n)),T(false);return}let D=Math.min(I,Math.max(1,N));T(false),D!==n&&y?.(D);},"confirmJump");return jsxRuntime.jsxs("div",{className:m("flex items-center border-t bg-background px-4 py-3",b?.root,f),"data-monkeys-component":"collection-footer","data-tone":"hard-edge",children:[jsxRuntime.jsxs("div",{className:m("flex min-w-0 items-center gap-1 whitespace-nowrap text-sm text-muted-foreground",b?.summary),children:[e!==void 0?jsxRuntime.jsxs("span",{children:[d??w.selected({count:e})," \xB7"]}):null,y&&r>0?S?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:w.jumpToPage}),jsxRuntime.jsx(wr,{ref:M,type:"number",inputMode:"numeric",min:1,max:I,value:C,onChange:N=>R(N.currentTarget.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),N.currentTarget.blur()),N.key==="Escape"&&(N.preventDefault(),T(false),R(String(n)));},onBlur:A,className:"h-7 w-20 px-2 text-xs","aria-label":w.jumpToPage}),jsxRuntime.jsxs("span",{className:"text-xs text-muted-foreground",children:["/ ",I," ",w.pages]})]}):jsxRuntime.jsxs("button",{type:"button",className:m("inline-flex items-center text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",b?.jumpButton),onClick:()=>{R(String(n)),T(true),x?.();},title:w.clickToJump,children:[h,u?` (${u})`:null,l?jsxRuntime.jsx(lucideReact.Loader2,{"aria-hidden":"true",className:"ml-1 inline-block h-3 w-3 animate-spin"}):null]}):jsxRuntime.jsxs("span",{className:"inline-flex items-center",children:[h,u?` (${u})`:null,l?jsxRuntime.jsx(lucideReact.Loader2,{"aria-hidden":"true",className:"ml-1 h-3 w-3 animate-spin"}):null]})]}),k&&s.length>0?jsxRuntime.jsx("div",{className:m("ml-auto",b?.pageSizeControl),children:jsxRuntime.jsxs(Ns,{children:[jsxRuntime.jsx(Rs,{asChild:true,children:jsxRuntime.jsxs(mt,{type:"button",variant:"outline",size:"sm",className:m("h-8 gap-1 px-2",b?.pageSizeButton),"aria-label":typeof p=="string"?p:w.perLoad,children:[i,jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"h-4 w-4"})]})}),jsxRuntime.jsxs(vi,{align:"end",className:"w-32",children:[jsxRuntime.jsx(vm,{children:p??w.perLoad}),jsxRuntime.jsx(wm,{}),jsxRuntime.jsx(my,{value:String(i),onValueChange:N=>{let D=Number(N);Number.isFinite(D)&&k(D);},children:s.map(N=>jsxRuntime.jsx(xm,{value:String(N),children:N},N))})]})]})}):null]})}return jsxRuntime.jsx(Ud,{total:r,loadedStart:t,loadedEnd:o,selectedCount:e,page:n,pageSize:i,pageSizeOptions:s,loading:l,totalLabel:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[h," ",u?`(${u})`:null]}),selectedLabel:d,pageSizeLabel:p,className:f,classNames:{root:b?.root,summary:b?.summary,pageSize:b?.pageSizeControl},onSummaryClick:x,onPageSizeChange:k})}a(Ty,"DataExplorerCollectionFooter");function jR(e){return typeof e=="number"?`${e}px`:e}a(jR,"toCssSize");function Ry({label:e,leading:t,children:o,actions:r,maxFieldsHeight:n=80,className:i,classNames:s,style:l,...d}){let c={maxHeight:jR(n)};return jsxRuntime.jsx("div",{className:j("border-b border-border/60 bg-background px-8 py-3",s?.root,i),style:l,...d,children:jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-start gap-2 text-sm",s?.layout),children:[e?jsxRuntime.jsx("div",{className:j("flex h-9 shrink-0 items-center font-semibold text-foreground",s?.label),children:e}):null,jsxRuntime.jsx("div",{className:j("min-w-0 flex-1 overflow-y-auto overscroll-contain",s?.fieldsViewport),style:c,children:jsxRuntime.jsxs("div",{className:j("flex flex-wrap items-center gap-2",s?.fields),children:[t,o]})}),r?jsxRuntime.jsx("div",{className:j("flex shrink-0 items-center gap-2",s?.actions),children:r}):null]})})}a(Ry,"DataExplorerFilterBar");function My(e){return e!=null&&e!==false&&e!==""}a(My,"hasContent");function tc({field:e,label:t=e?.label,icon:o=e?.icon,value:r=e?.value,helperText:n=e?.helperText,error:i=e?.error,required:s=e?.required??false,disabled:l=e?.disabled??false,children:d,context:c,className:p,valueClassName:u=e?.valueClassName,classNames:g,dataAttributes:f=e?.dataAttributes,labelDataAttributes:b=e?.labelDataAttributes,valueDataAttributes:x=e?.valueDataAttributes,helperDataAttributes:y=e?.helperDataAttributes,errorDataAttributes:k=e?.errorDataAttributes}){let w={...e?.classNames,...g},v=d??(e?.render?e.render(c):r),h=My(i);return jsxRuntime.jsxs("div",{...f,title:e?.title,"aria-disabled":l||void 0,"data-disabled":l||void 0,"data-invalid":h||void 0,"data-required":s||void 0,className:j("min-w-0 space-y-1",l&&"opacity-60",w.root,e?.className,p),children:[jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-center gap-1.5 text-[13px] font-medium text-muted-foreground",w.label),children:[o?jsxRuntime.jsx("span",{className:j("inline-flex shrink-0 items-center justify-center",w.icon),children:o}):null,jsxRuntime.jsx("span",{...b,className:"min-w-0 truncate",children:t}),s?jsxRuntime.jsx("span",{"aria-hidden":"true",className:j("text-destructive-text",w.required),children:"*"}):null]}),jsxRuntime.jsx("div",{...x,className:j("min-w-0 max-w-full text-[15px] leading-6 text-foreground [overflow-wrap:anywhere]",w.value,u),children:v}),My(n)?jsxRuntime.jsx("div",{...y,"data-slot":"helper",className:j("min-w-0 max-w-full text-xs leading-5 text-muted-foreground [overflow-wrap:anywhere]",w.helper),children:n}):null,h?jsxRuntime.jsx("div",{...k,role:"alert","data-slot":"error",className:j("min-w-0 max-w-full text-xs leading-5 text-destructive-text [overflow-wrap:anywhere]",w.error),children:i}):null]})}a(tc,"DataExplorerDetailField");function oc({section:e,title:t=e?.title,fields:o=e?.fields,children:r,context:n,className:i,classNames:s,fieldClassNames:l}){let d={...e?.classNames,...s},c=(o||[]).filter(g=>!(Mt(g.hidden,n)??false)),p=r??(typeof e?.children=="function"?e.children(n):e?.children);return !(!!p||c.length>0)||Mt(e?.hidden,n)?null:jsxRuntime.jsxs("section",{className:j("border-b border-border pb-6 last:border-b-0 last:pb-0",d.root,e?.className,i),children:[t?jsxRuntime.jsx("div",{className:j("mb-4 text-[15px] font-semibold text-foreground",d.title),children:t}):null,jsxRuntime.jsxs("div",{className:j("space-y-4",d.body),children:[p,c.map((g,f)=>jsxRuntime.jsx(tc,{field:g,context:n,classNames:l},g.id||String(f)))]})]})}a(oc,"DataExplorerDetailSection");function UR(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-[18px] w-[18px]",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M18 6 6 18"}),jsxRuntime.jsx("path",{d:"m6 6 12 12"})]})}a(UR,"DefaultCloseIcon");function Ey(){return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m15 18-6-6 6-6"})})}a(Ey,"DefaultChevronLeftIcon");function Ay(){return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m9 18 6-6-6-6"})})}a(Ay,"DefaultChevronRightIcon");function By({title:e,subtitle:t,leading:o,actions:r,preview:n,previewVisible:i=true,previewStyle:s,previewPadded:l=false,previewCentered:d=true,sections:c=[],rightPanel:p,context:u,navigation:g,closeLabel:f="Close",closeIcon:b,closeVisible:x=true,onClose:y,appearance:k,className:w,classNames:v}){let h=Ct(Et(k)),S=(g?.visible??true)&&typeof g?.count=="number"&&g.count>1,T=c.filter(C=>!(Mt(C.hidden,u)??false));return jsxRuntime.jsxs("div",{className:j(h.slots.detailRoot,v?.root,w),style:h.styles.detailRoot,children:[jsxRuntime.jsxs("div",{className:j(h.slots.detailHeader,v?.header),children:[jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-center gap-3",v?.headerMain),children:[o?jsxRuntime.jsx("div",{className:j(h.slots.detailLeading,v?.leading),children:o}):null,jsxRuntime.jsxs("div",{className:j("min-w-0",v?.titleGroup),children:[jsxRuntime.jsx("div",{className:j("truncate text-[20px] font-semibold leading-tight text-foreground",v?.title),children:e}),t?jsxRuntime.jsx("div",{className:j("mt-1 min-w-0 truncate text-sm text-muted-foreground",v?.subtitle),children:t}):null]})]}),jsxRuntime.jsxs("div",{className:j("flex items-center gap-2",v?.headerActions),children:[r,S?jsxRuntime.jsxs("div",{className:j(h.slots.detailNavigation,v?.navigation),children:[jsxRuntime.jsx("button",{type:"button","aria-label":g?.previousLabel||"Previous",className:j(h.slots.detailNavigationButton,v?.navigationButton),disabled:!g?.onPrevious,onClick:g?.onPrevious,children:jsxRuntime.jsx(Ey,{})}),jsxRuntime.jsxs("div",{className:j("min-w-[74px] text-center text-xs font-medium text-muted-foreground",v?.navigationCount),children:[g.index+1," / ",g.count]}),jsxRuntime.jsx("button",{type:"button","aria-label":g?.nextLabel||"Next",className:j(h.slots.detailNavigationButton,v?.navigationButton),disabled:!g?.onNext,onClick:g?.onNext,children:jsxRuntime.jsx(Ay,{})})]}):null,x?jsxRuntime.jsx("button",{type:"button","aria-label":f,className:j(h.slots.detailCloseButton,v?.closeButton),onClick:y,children:b??jsxRuntime.jsx(UR,{})}):null]})]}),jsxRuntime.jsxs("div",{className:j("grid min-h-0 flex-1",i?"xl:grid-cols-[minmax(0,1fr)_380px] 2xl:grid-cols-[minmax(0,1fr)_400px]":"grid-cols-1",v?.body),children:[i?jsxRuntime.jsx("div",{className:j(h.slots.detailPreviewPanel,v?.previewPanel),children:jsxRuntime.jsxs("div",{className:j("flex h-full min-h-0 flex-col",v?.previewStack),children:[S?jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsxs("div",{className:j("text-xs text-muted-foreground xl:hidden",v?.previewMobileCount),children:[g.index+1," / ",g.count]})}):null,jsxRuntime.jsx("div",{className:j("flex min-h-0 flex-1 justify-center",d&&"items-stretch",v?.previewWrapper),children:jsxRuntime.jsxs("div",{className:j(h.slots.detailPreviewFrame,v?.previewFrame),style:s,children:[jsxRuntime.jsx("div",{className:j("relative flex h-full w-full items-center justify-center",l&&"p-4",v?.previewContent),children:n}),S?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button","aria-label":g?.previousLabel||"Previous",className:j(h.slots.previewNavigationButton,"left-4",v?.previewNavigationButton),disabled:!g?.onPrevious,onClick:g?.onPrevious,children:jsxRuntime.jsx(Ey,{})}),jsxRuntime.jsx("button",{type:"button","aria-label":g?.nextLabel||"Next",className:j(h.slots.previewNavigationButton,"right-4",v?.previewNavigationButton),disabled:!g?.onNext,onClick:g?.onNext,children:jsxRuntime.jsx(Ay,{})})]}):null]})})]})}):null,jsxRuntime.jsx("div",{className:j(h.slots.detailRightPanel,v?.rightPanel),children:jsxRuntime.jsx("div",{className:j(h.slots.detailRightPanelBody,v?.rightPanelBody),style:{scrollbarGutter:"stable"},children:p??jsxRuntime.jsx("div",{className:j("space-y-6",v?.sections),children:T.map(C=>jsxRuntime.jsx(oc,{section:C,context:u,className:v?.section,fieldClassNames:{root:v?.field}},C.id))})})})]})]})}a(By,"DataExplorerDetailShell");function Wy(e){if(e===null)return null;if(typeof e=="string"&&e.trim().length>0)return e;throw new TypeError("BaseField validate must return a non-empty error string or null.")}a(Wy,"resolveBaseFieldValidationResult");var Pm=ho.createContext(null);function Qn(){let e=ho.useContext(Pm),t=ho.useRef(null);t.current===null&&(t.current=Symbol("BaseFieldControl"));let o=e?.registerControl;ho.useEffect(()=>{if(!(!o||t.current===null))return o(t.current)},[o]);let r=e?.notifyBlur,n=e?.notifyChange;return {invalid:e?.invalid??false,notifyBlur:ho.useCallback(i=>r?.(i),[r]),notifyChange:ho.useCallback(i=>n?.(i),[n])}}a(Qn,"useBaseFieldControl");var oM={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"},rM={sm:"text-[10px]",md:"text-[11px]",lg:"text-xs"};function nM(e,...t){for(let o of t)if(o){if(typeof o=="function"){o(e);continue}o.current=e;}}a(nM,"setRefs");var ki=ho.forwardRef(a(function({label:t,description:o,indeterminate:r=false,invalid:n=false,disabled:i=false,controlSize:s,appearance:l,className:d,classNames:c,style:p,checked:u,defaultChecked:g,onBlur:f,onChange:b,"aria-invalid":x,...y},k){for(let[L,F]of [["indeterminate",r],["invalid",n],["disabled",i]])if(typeof F!="boolean")throw new TypeError(`BaseCheckbox ${L} must be a boolean.`);if(s!==void 0&&s!=="sm"&&s!=="md"&&s!=="lg")throw new TypeError('BaseCheckbox controlSize must be "sm", "md", or "lg".');let w=Pe(l),v=ke(),h=Ne(w),S=Qn(),T=n||S.invalid,C=V(t),R=Md(o),M=ho.useRef(null),I=ho.useRef(r);I.current=r;let[A,N]=ho.useState(g??false),D=u!==void 0,E=!!(D?u:A),P=r||E,W=r?"mixed":E?"checked":"unchecked",H=ho.useCallback(L=>{M.current=L,L&&(L.indeterminate=I.current),nM(L,k);},[k]);ho.useEffect(()=>{M.current&&(M.current.indeterminate=r);},[r]);let B=a(L=>{i||(D||N(L.currentTarget.checked),b?.(L),S.notifyChange(L.currentTarget.checked),M.current&&(M.current.indeterminate=r));},"handleChange");return jsxRuntime.jsxs("label",{...v,"data-monkeys-component":"checkbox","data-slot":"root","data-state":W,"data-size":s,"data-invalid":T||void 0,"data-disabled":i||void 0,className:m(h.slots.checkboxRoot,!R&&"items-center",i&&h.slots.checkboxDisabled,c?.root,d),style:{...h.styles.checkboxRoot,...p},children:[jsxRuntime.jsxs("span",{"data-slot":"box","data-state":W,"data-size":s,className:m(h.slots.checkboxBox,!R&&"mt-0",P&&h.slots.checkboxBoxChecked,T&&h.slots.checkboxBoxInvalid,s&&oM[s],c?.box),style:{...h.styles.checkboxBox},children:[jsxRuntime.jsx("input",{...y,ref:H,type:"checkbox",disabled:i,checked:u,defaultChecked:g,"aria-invalid":x??(T||void 0),"aria-checked":r?"mixed":E,"data-slot":"input","data-state":W,"data-size":s,"data-invalid":T||void 0,"data-disabled":i||void 0,className:m(h.slots.checkboxInput,c?.input),onBlur:L=>{f?.(L),S.notifyBlur(L.currentTarget.checked);},onChange:B}),P?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator","data-state":W,"data-size":s,className:m(h.slots.checkboxIndicator,s&&rM[s],c?.indicator),children:r?"\u2013":"\u2713"}):null]}),C||R?jsxRuntime.jsxs("span",{"data-slot":"content",className:m(h.slots.checkboxContent,c?.content),children:[C?jsxRuntime.jsx("span",{"data-slot":"label",className:m(h.slots.checkboxLabel,c?.label),children:t}):null,R?jsxRuntime.jsx("span",{"data-slot":"description",className:m(h.slots.checkboxDescription,c?.description),children:o}):null]}):null]})},"BaseCheckbox"));function iM(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"19",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"5",cy:"12",r:"1"})]})}a(iM,"MoreIcon");function nc({item:e,itemId:t=e?.id,source:o=e?.source,actions:r=[],label:n="Actions",triggerLabel:i="Open actions",triggerIcon:s,align:l="end",sideOffset:d=6,appearance:c,className:p,classNames:u}){let[g,f]=ho.useState(false),b=Ct(Et(c)),x={itemId:t,item:e,source:o},y=r.filter(k=>Mt(k.visible,x)??true);return y.length===0?null:jsxRuntime.jsx("span",{className:j("inline-flex",u?.root),children:jsxRuntime.jsxs(Bt__namespace.Root,{open:g,onOpenChange:f,children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{type:"button","aria-label":i,className:j(b.slots.menuTrigger,u?.trigger,p),onClick:k=>k.stopPropagation(),children:[s??jsxRuntime.jsx(iM,{}),jsxRuntime.jsx("span",{className:"sr-only",children:i})]})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{align:l,sideOffset:d,className:j(b.slots.menuContent,u?.content),style:b.styles.menuContent,onClick:k=>k.stopPropagation(),children:[n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Bt__namespace.Label,{className:j(b.slots.menuLabel,u?.label),children:n}),jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)})]}):null,y.map(k=>{let w=(Mt(k.disabled,x)??false)||(Mt(k.loading,x)??false);return k.render?jsxRuntime.jsxs("div",{children:[k.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)}):null,k.render(x),k.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)}):null]},k.id):jsxRuntime.jsxs("div",{children:[k.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:j("-mx-1 my-1 h-px bg-border",u?.separator)}):null,jsxRuntime.jsxs(Bt__namespace.Item,{title:k.title,disabled:w,className:j(b.slots.menuItem,Gn(b,k.tone),u?.item,k.className),style:b.styles.menuItem,onSelect:()=>{!k.onAction||w||k.onAction(x);},onContextMenu:v=>{!k.onContextAction||w||(v.preventDefault(),v.stopPropagation(),f(false),k.onContextAction(x));},children:[k.icon?jsxRuntime.jsx("span",{className:j(b.slots.menuItemIcon,u?.itemIcon),children:k.icon}):null,jsxRuntime.jsx("span",{className:j(b.slots.menuItemLabel,u?.itemLabel),children:k.label})]}),k.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:j(b.slots.menuSeparator,u?.separator)}):null]},k.id)})]})})]})})}a(nc,"DataExplorerDisplayActionMenu");function lM(e){return e?Array.isArray(e)?e.filter(Boolean):[e]:[]}a(lM,"normalizeMedia");function dM(e){return String(e||"unknown").toLowerCase()}a(dM,"resolveMediaKind");function Ci({media:e,fallbackTitle:t,empty:o,className:r,classNames:n,onOpen:i}){let l=lM(e)[0];if(!l)return o?jsxRuntime.jsx("div",{className:j("flex min-h-24 items-center justify-center bg-muted/30 text-sm text-muted-foreground",n?.placeholder,r),children:o}):null;if(l.node)return jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",n?.root,r),children:l.node});let d=dM(l.kind),c=String(l.src||l.thumbnail||"").trim(),p=l.title??t,u=l.alt||(typeof p=="string"?p:"preview"),g=typeof i=="function",f=c?d==="image"||d==="unknown"?jsxRuntime.jsx("img",{src:c,style:qn(c),alt:u,className:j("h-auto w-full object-contain",n?.media),loading:"lazy",decoding:"async",draggable:false}):d==="video"?jsxRuntime.jsx("video",{src:c,className:j("h-auto w-full",n?.media),controls:true,preload:"metadata"}):d==="audio"?jsxRuntime.jsx("audio",{src:c,className:j("w-full",n?.media),controls:true,preload:"metadata"}):jsxRuntime.jsxs("div",{className:j("flex min-h-24 flex-col items-center justify-center gap-1 bg-muted/30 p-4 text-center text-sm text-muted-foreground",n?.placeholder),children:[p?jsxRuntime.jsx("span",{className:j("max-w-full truncate",n?.title),children:p}):null,jsxRuntime.jsx("span",{className:"max-w-full truncate",children:c})]}):jsxRuntime.jsx("div",{className:j("flex min-h-24 items-center justify-center bg-muted/30 text-sm text-muted-foreground",n?.placeholder),children:p||"No preview"});return g?jsxRuntime.jsx("button",{type:"button",className:j("block min-w-0 overflow-hidden text-left",n?.root,r),onClick:()=>i?.(l,0),children:f}):jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",n?.root,r),children:f})}a(Ci,"DataExplorerDisplayMedia");function uM(e){return e?Array.isArray(e)?e.every(t=>!!t&&typeof t=="object"&&("src"in t||"thumbnail"in t||"node"in t||"kind"in t)):typeof e=="object"&&("src"in e||"thumbnail"in e||"node"in e||"kind"in e):false}a(uM,"isDisplayMedia");function pM(e){if(e?.length)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map((t,o)=>jsxRuntime.jsx("span",{title:t.title,className:j("inline-flex max-w-full items-center rounded-full border border-border/60 px-2 py-0.5 text-xs font-medium",t.tone==="primary"&&"border-primary/30 bg-primary/10 text-primary",t.tone==="success"&&"border-[hsl(var(--success,142_72%_29%)_/_0.30)] bg-[hsl(var(--success,142_72%_29%)_/_0.10)] text-[hsl(var(--success,142_72%_29%))]",t.tone==="warning"&&"border-[hsl(var(--warning,45_93%_47%)_/_0.30)] bg-[hsl(var(--warning,45_93%_47%)_/_0.10)] text-[hsl(var(--warning-foreground,28_73%_26%))]",t.tone==="danger"&&"border-destructive/30 bg-destructive/10 text-destructive-text",t.tone==="muted"&&"bg-muted text-muted-foreground"),children:jsxRuntime.jsx("span",{className:"truncate",children:t.label})},t.id??o))})}a(pM,"renderBadges");function mM(e){if(e?.length)return jsxRuntime.jsx("dl",{className:"grid min-w-0 grid-cols-1 gap-2 text-xs sm:grid-cols-2",children:e.map((t,o)=>jsxRuntime.jsxs("div",{className:"min-w-0",children:[t.label?jsxRuntime.jsx("dt",{className:"truncate text-muted-foreground",title:t.title,children:t.label}):null,jsxRuntime.jsx("dd",{className:"mt-0.5 min-w-0 truncate text-foreground",children:t.value})]},t.id??o))})}a(mM,"renderMetadata");function fM(e){if(e?.length)return jsxRuntime.jsx("div",{className:"flex min-w-0 flex-wrap gap-1.5",children:e.map((t,o)=>jsxRuntime.jsx("span",{className:"max-w-full truncate rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:t},o))})}a(fM,"renderKeywords");function Jn({item:e,title:t=e?.title,description:o=e?.description,badges:r=pM(e?.badges),meta:n=e?.status,actions:i,media:s=e?.media,header:l,headerLeading:d,headerContent:c,overlay:p,footer:u,children:g,selected:f=e?.selected,disabled:b=e?.disabled,interactive:x,role:y,tabIndex:k,appearance:w,className:v,classNames:h,onClick:S,onKeyDown:T}){let C=Ct(Et(w)),R=x??!!(S||T),I=l!==void 0?!!l:!!(d||c||t||o||r||n||i),A=uM(s)?jsxRuntime.jsx(Ci,{media:s,fallbackTitle:t}):s,N=mM(e?.metadata),D=fM(e?.keywords),E=g!==void 0?g:N||D?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[N,D]}):void 0,P=!!E;return jsxRuntime.jsxs("article",{className:j(C.slots.cardRoot,R&&!b&&C.slots.cardInteractive,f&&C.slots.cardSelected,b&&C.slots.cardDisabled,h?.root,v),"aria-disabled":b||void 0,role:y,tabIndex:k,style:C.styles.cardRoot,onClick:b?void 0:S,onKeyDown:b?void 0:T,children:[p?jsxRuntime.jsx("div",{className:j(h?.overlay),children:p}):null,I?jsxRuntime.jsx("div",{className:j(C.slots.cardHeader,h?.header),children:l!==void 0?l:jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-start justify-between gap-3",h?.headerMain),children:[d?jsxRuntime.jsx("div",{className:j("flex shrink-0 items-center gap-2",h?.headerLeading),children:d}):null,jsxRuntime.jsx("div",{className:j("min-w-0 flex-1",h?.headerContent),children:c??jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t?jsxRuntime.jsx("div",{className:j("truncate text-sm font-semibold leading-none text-foreground",h?.title),children:t}):null,o?jsxRuntime.jsx("div",{className:j("mt-1 min-w-0 text-sm text-muted-foreground [overflow-wrap:anywhere]",h?.description),children:o}):null,r?jsxRuntime.jsx("div",{className:j("mt-2 flex flex-wrap items-center gap-2",h?.badges),children:r}):null]})}),n||i?jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[n?jsxRuntime.jsx("div",{className:j("min-w-0 max-w-[12rem] truncate text-sm text-muted-foreground",h?.meta),children:n}):null,i?jsxRuntime.jsx("div",{className:j("flex shrink-0 items-center gap-2",h?.actions),children:i}):null]}):null]})}):null,A?jsxRuntime.jsx("div",{className:j(C.slots.cardMedia,h?.media),children:A}):null,P?jsxRuntime.jsx("div",{className:j("min-w-0 px-4 pb-4",h?.body),children:E}):null,u?jsxRuntime.jsx("div",{className:j(C.slots.cardFooter,h?.footer),children:u}):null]})}a(Jn,"DataExplorerDisplayCard");function ac({media:e,title:t,description:o,meta:r,badges:n,actions:i,footer:s,children:l,className:d,classNames:c}){let p=!!t||!!o||!!r||!!n||!!i;return jsxRuntime.jsxs("article",{className:j("flex min-w-0 flex-col overflow-hidden rounded-lg border border-border/60 bg-background",c?.root,d),children:[e?jsxRuntime.jsx("div",{className:j("shrink-0 overflow-hidden",c?.media),children:e}):null,p?jsxRuntime.jsxs("div",{className:j("flex flex-col gap-3 p-4",c?.header),children:[jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[t?jsxRuntime.jsx("div",{className:j("truncate text-sm font-semibold text-foreground",c?.title),children:t}):null,o?jsxRuntime.jsx("div",{className:j("mt-1 text-sm text-muted-foreground",c?.description),children:o}):null]}),r||i?jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r?jsxRuntime.jsx("div",{className:j("text-sm text-muted-foreground",c?.meta),children:r}):null,i?jsxRuntime.jsx("div",{className:j("flex items-center gap-2",c?.actions),children:i}):null]}):null]}),n?jsxRuntime.jsx("div",{className:j("flex flex-wrap items-center gap-2",c?.badges),children:n}):null]}):null,l?jsxRuntime.jsx("div",{className:j("min-w-0 px-4 pb-4",c?.body),children:l}):null,s?jsxRuntime.jsx("div",{className:j("shrink-0 border-t border-border/60 px-4 py-3",c?.footer),children:s}):null]})}a(ac,"DataExplorerViewItemShell");function ic(e){let{item:t,index:o,itemId:r,context:n,capabilities:i,itemDefinition:s,className:l,selected:d,actions:c,onOpen:p,onSelectionChange:u}=e;if(s?.render)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:s.render(e)});let g=typeof s?.shellProps=="function"?s.shellProps({item:t,index:o,itemId:r,context:n,capabilities:i,itemDefinition:s,className:l,selected:d,actions:c,onOpen:p,onSelectionChange:u}):s?.shellProps;return jsxRuntime.jsx(ac,{...g,className:l})}a(ic,"DataExplorerViewItem");function xM(e){switch(e){case "list":return "flex min-h-0 flex-col gap-3";case "waterfall":return "columns-1 gap-4 sm:columns-2 lg:columns-3";default:return "grid min-h-0 gap-4"}}a(xM,"getItemsClassName");function vM(e){if(e==="waterfall")return "mb-4 break-inside-avoid"}a(vM,"getDefaultItemClassName");function wM(e,t){return String(t)}a(wM,"defaultResolveItemId");function kM(e){return typeof e=="number"?`${Bm(e,220)}px`:e}a(kM,"resolveMeasuredGridMinColumnWidth");function Hy(e,t,o){return Math.max(1,Math.ceil((e+o)/(t+o)))}a(Hy,"resolveMeasuredGridSpan");function Bm(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}a(Bm,"resolvePositiveNumber");function CM(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:t}a(CM,"resolveNonNegativeNumber");function Ti({items:e,activeViewId:t,context:o,capabilities:r,className:n,classNames:i,empty:s,loading:l,loadingNode:d,footer:c,overlay:p,layout:u="grid",scrollable:g=true,wrapItems:f=true,measuredGrid:b,itemsStyle:x,itemStyle:y,selectedIds:k=[],getItemId:w,itemDefinition:v,renderItem:h,getItemClassName:S,onOpenItem:T,onSelectionChange:C}){let R=Array.isArray(e)?e:[],M=new Set(k),I=w??wM,A=b===true?{}:b&&typeof b=="object"?b:void 0,N=u==="grid"&&!!(A?.enabled??b),D=Bm(A?.rowHeight,4),E=CM(A?.gap,8),P=A?.minColumnWidth??"220px",W=ho.useRef(new Map),H=ho.useRef(new Map),B=ho.useRef(new Map),L=ho.useRef(null),[,F]=ho.useState(0),_=typeof y=="function"?ae=>y(ae):()=>y;ho.useEffect(()=>{if(!N||typeof ResizeObserver>"u")return;let ae=new ResizeObserver(ee=>{let q=false;for(let U of ee){let O=U.target.dataset.dataExplorerItemId;if(!O)continue;let K=Math.ceil(U.contentRect.height),ne=Hy(K,D,E);B.current.get(O)!==ne&&(B.current.set(O,ne),q=true);}q&&F(U=>U+1);});L.current=ae;for(let ee of W.current.values())ae.observe(ee);return ()=>{ae.disconnect(),L.current===ae&&(L.current=null);}},[N,E,D]),ho.useEffect(()=>{if(!N){W.current.clear(),H.current.clear(),B.current.clear();return}let ae=new Set(R.map((q,U)=>I(q,U))),ee=false;for(let q of B.current.keys())ae.has(q)||(B.current.delete(q),ee=true);for(let[q,U]of W.current.entries())ae.has(q)||(L.current?.unobserve(U),W.current.delete(q));for(let q of H.current.keys())ae.has(q)||H.current.delete(q);ee&&F(q=>q+1);},[N,R,I]);let $=ho.useCallback(ae=>{let ee=H.current.get(ae);if(ee)return ee;let q=a(U=>{let X=W.current.get(ae);X&&X!==U&&(L.current?.unobserve(X),W.current.delete(ae)),U&&(U.dataset.dataExplorerItemId=ae,W.current.set(ae,U),L.current?.observe(U));},"callback");return H.current.set(ae,q),q},[]),G=a(ae=>{let ee=ae.itemId;if(ee){let O=B.current.get(ee);if(O)return O}let q=A?.estimateItemHeight,U=typeof q=="function"?q(ae):typeof q=="number"?q:240,X=Bm(U,240);return Hy(X,D,E)},"getMeasuredGridSpan"),z=a(()=>N?{...x,gap:E,gridAutoFlow:"dense",gridAutoRows:D,gridTemplateColumns:`repeat(auto-fill, minmax(${kM(P)}, 1fr))`}:x,"resolveMeasuredItemsStyle"),re=a(()=>l&&d?jsxRuntime.jsx("div",{className:j("flex items-center justify-center p-6 text-sm text-muted-foreground",i?.loading),children:d}):s?jsxRuntime.jsx("div",{className:j("flex items-center justify-center p-6 text-sm text-muted-foreground",i?.empty),children:s}):null,"renderStatus"),Z=a((ae,ee,q,U)=>{if(!C)return;let X=w?w(ae,ee):q,O=U?Array.from(new Set([...k,X])):k.filter(K=>K!==X);C(O);},"handleSelectionChange");return R.length===0&&!c&&!p?re():jsxRuntime.jsxs("div",{className:j("relative flex min-h-0 flex-1 flex-col overflow-hidden",i?.root,n),"data-view-id":t||void 0,children:[R.length>0?jsxRuntime.jsx("div",{className:j(xM(u),g&&"overflow-auto",i?.items),style:z(),children:R.map((ae,ee)=>{let q=I(ae,ee),U=M.has(q),O={item:ae,index:ee,itemId:q,context:o,capabilities:r,itemDefinition:v,selected:U,onOpen:T,onSelectionChange:a((ie,be)=>{Z(ie,ee,q,be);},"selectionChange")},K=j(vM(u),i?.item,S?.({...O,className:i?.item})),ne={...O,className:K},fe=h?h(ne):jsxRuntime.jsx(ic,{...ne}),he=_(ne),me=N?{...he,gridRowEnd:`span ${G(ne)}`}:he;return f?jsxRuntime.jsx("div",{className:K,style:me,children:N?jsxRuntime.jsx("div",{ref:$(q),children:fe}):fe},q):N?jsxRuntime.jsx("div",{className:K,style:me,children:jsxRuntime.jsx("div",{ref:$(q),children:fe})},q):jsxRuntime.jsx(ho.Fragment,{children:fe},q)})}):re(),l&&d&&R.length>0?jsxRuntime.jsx("div",{className:j("shrink-0 p-3 text-sm text-muted-foreground",i?.loading),children:d}):null,c?jsxRuntime.jsx("div",{className:j("shrink-0",i?.footer),children:c}):null,p?jsxRuntime.jsx("div",{className:j("absolute inset-0 z-10",i?.overlay),children:p}):null]})}a(Ti,"DataExplorerViewCollection");function lc({className:e,classNames:t,...o}){return jsxRuntime.jsx(Jn,{...o,className:j("rounded-md",e),classNames:{...t,root:j("flex-row items-stretch",t?.root),media:j("w-28 shrink-0",t?.media),header:j("flex min-w-0 flex-1 items-center p-3",t?.header),body:j("px-3 pb-3",t?.body)}})}a(lc,"DataExplorerDisplayListItem");function Vy(e,t){if(e)return typeof e=="function"?e(t):e}a(Vy,"resolveDisplayItemProps");function NM(e,t,o){let{item:r,layout:n}=e,i=!!t&&!r.disabled,s=o?.renderActions?o.renderActions(e):r.actions?.length?jsxRuntime.jsx(nc,{item:r,actions:r.actions,appearance:o?.appearance}):void 0,l={media:o?.renderMedia?o.renderMedia(e):void 0,actions:s,appearance:o?.appearance,interactive:i,onClick:i?()=>t?.(r):void 0};if(n==="list"){let c=Vy(o?.listItemProps,e);return jsxRuntime.jsx(lc,{...l,...c,item:r,className:j(l.className,c?.className)})}let d=Vy(o?.cardProps,e);return jsxRuntime.jsx(Jn,{...l,...d,item:r,className:j(l.className,d?.className)})}a(NM,"renderDefaultItem");function _y({items:e,activeViewId:t="display",layout:o="grid",appearance:r,selectedIds:n,empty:i,loading:s,loadingNode:l,footer:d,overlay:c,className:p,classNames:u,scrollable:g,wrapItems:f,measuredGrid:b,itemsStyle:x,itemStyle:y,getItemClassName:k,cardProps:w,listItemProps:v,renderMedia:h,renderActions:S,renderItem:T,onOpenItem:C,onSelectionChange:R}){return jsxRuntime.jsx(Ti,{activeViewId:t,items:e,layout:o,selectedIds:n,className:p,classNames:u,empty:i,loading:s,loadingNode:l,footer:d,overlay:c,scrollable:g,wrapItems:f,measuredGrid:b,itemsStyle:x,itemStyle:typeof y=="function"?({item:M,index:I=0,itemId:A="",selected:N=false})=>y({item:M,index:I,itemId:A,selected:N,activeViewId:t,layout:o}):y,getItemId:M=>M.id,getItemClassName:k?({item:M,index:I=0,itemId:A="",selected:N=false})=>k({item:M,index:I,itemId:A,selected:N,activeViewId:t,layout:o}):void 0,renderItem:({item:M,index:I})=>(()=>{let A={item:M,index:I??0,itemId:M.id,selected:n?.includes(M.id)??false,activeViewId:t,layout:o};return T?T(M,A.index,A):NM(A,C,{cardProps:w,listItemProps:v,appearance:r,renderMedia:h,renderActions:S})})(),onOpenItem:C,onSelectionChange:R})}a(_y,"DataExplorerDisplayCollectionView");function Lm(e,t){let o=typeof e=="function"?e():e;if(o===null)return null;if(!o||typeof o!="object"||o.nodeType!==1)throw new TypeError(`${t} must resolve to an Element or null.`);return o}a(Lm,"resolveContainerValue");function Wm({explicitProvided:e,explicitContainer:t,providerProvided:o,providerContainer:r,getDocument:n}){if(e)return Lm(t,"BasePortal container");if(o)return Lm(r,"MonkeysProvider portal.container");if(!n)return null;let i=n();if(i===null)return null;if(!i||typeof i!="object"||!("body"in i))throw new TypeError("MonkeysProvider environment.getDocument must resolve to a Document or null.");return Lm(i.body,"MonkeysProvider environment.getDocument().body")}a(Wm,"resolveBasePortalContainer");function DM(e){let t=ui(),o=pi(),[r,n]=ho.useState(false);if(ho.useEffect(()=>{n(true);},[]),e.disabled!==void 0&&typeof e.disabled!="boolean")throw new TypeError("BasePortal disabled must be a boolean.");if(e.inline!==void 0&&typeof e.inline!="boolean")throw new TypeError("BasePortal inline must be a boolean.");let i=e.disabled??o.disabled??false;if(!r||i||e.inline)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.children});let s=Wm({explicitProvided:e.container!==void 0,explicitContainer:e.container,providerProvided:o.container!==void 0,providerContainer:o.container,getDocument:t.getDocument});return s?reactDom.createPortal(e.children,s):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.children})}a(DM,"BasePortal");function BM({mounted:e,explicitDisabled:t,explicitContainer:o,providerDisabled:r,providerContainer:n,getDocument:i}){let s=t??r??false;if(!e||s)return {mounted:e,disabled:s,shouldPortal:false,container:null,radixPortalProps:void 0};let l=Wm({explicitProvided:o!==void 0,explicitContainer:o,providerProvided:n!==void 0,providerContainer:n,getDocument:i});return l?{mounted:true,disabled:false,shouldPortal:true,container:l,radixPortalProps:Object.freeze({container:l})}:{mounted:true,disabled:false,shouldPortal:false,container:null,radixPortalProps:void 0}}a(BM,"resolveBaseOverlayPortalState");function LM(){return globalThis.document??null}a(LM,"getDefaultDocument");function Cr(e={}){let t=ui(),o=pi(),[r,n]=ho.useState(false);return ho.useEffect(()=>{n(true);},[]),BM({mounted:r,explicitDisabled:e.disabled,explicitContainer:e.container,providerDisabled:o.disabled,providerContainer:o.container,getDocument:t.getDocument??LM})}a(Cr,"useBaseOverlayPortal");function jy(e,t){return t.shouldPortal?reactDom.createPortal(e,t.container):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}a(jy,"renderBaseOverlayPortalContent");function cc(e,t){if(typeof e!="boolean")throw new TypeError(`BaseTooltip ${t} must be a boolean.`)}a(cc,"validateBoolean");function _M(e){if(e!=="top"&&e!=="bottom"&&e!=="left"&&e!=="right")throw new TypeError('BaseTooltip placement must be "top", "bottom", "left", or "right".')}a(_M,"validatePlacement");function GM(e,t){return ho.isValidElement(e)&&e.type!==ho.Fragment?e:jsxRuntime.jsx("span",{tabIndex:!t&&V(e)?0:void 0,children:e})}a(GM,"normalizeTrigger");var To=ho.forwardRef(a(function({content:t,children:o,open:r,defaultOpen:n=false,placement:i="top",disabled:s=false,portal:l=false,appearance:d,className:c,classNames:p,style:u,onOpenChange:g,...f},b){r!==void 0&&cc(r,"open"),cc(n,"defaultOpen"),cc(s,"disabled"),cc(l,"portal"),_M(i);let x=Pe(d),y=ke(),k=Ne(x),w=Cr({disabled:!l}),[v,h]=ho.useState(n),S=r!==void 0,T=!s&&V(t),R=T&&(S?r:v),M=l&&w.shouldPortal?"portaled":"inline",I=a(D=>{D&&!T||(S||h(D),g?.(D));},"handleOpenChange"),A=GM(o,s),N=T?jsxRuntime.jsx(fr__namespace.Content,{...y,side:i,sideOffset:8,collisionPadding:8,"data-monkeys-component":"tooltip","data-slot":"content","data-placement":i,"data-portal":M,"data-disabled":s||void 0,className:m(k.slots.tooltipContent,p?.content),style:k.styles.tooltip,children:t}):null;return jsxRuntime.jsx("span",{...y,...f,ref:b,"data-monkeys-component":"tooltip","data-slot":"root","data-state":R?"open":"closed","data-placement":i,"data-portal":M,"data-disabled":s||void 0,className:m(k.slots.tooltipRoot,p?.root,c),style:u,children:jsxRuntime.jsx(fr__namespace.Provider,{delayDuration:0,skipDelayDuration:0,disableHoverableContent:true,children:jsxRuntime.jsxs(fr__namespace.Root,{open:R,onOpenChange:I,delayDuration:0,disableHoverableContent:true,children:[jsxRuntime.jsx("span",{...y,"data-monkeys-component":"tooltip","data-slot":"trigger-wrapper","data-state":R?"open":"closed","data-placement":i,"data-portal":M,"data-disabled":s||void 0,className:m(k.slots.tooltipTrigger,p?.trigger),children:jsxRuntime.jsx(fr__namespace.Trigger,{asChild:true,...y,"data-monkeys-component":"tooltip","data-slot":"trigger","data-placement":i,"data-portal":M,"data-disabled":s||void 0,children:A})}),l&&w.shouldPortal?jsxRuntime.jsx(fr__namespace.Portal,{...w.radixPortalProps,children:N}):N]})})})},"BaseTooltip"));var Ky=1.18,qy=16,Yy=1e6,Om=1e-6,Xy={topLeft:"left-4 top-4",top:"left-1/2 top-4 -translate-x-1/2",topRight:"right-4 top-4",left:"left-4 top-1/2 -translate-y-1/2",right:"right-4 top-1/2 -translate-y-1/2",bottomLeft:"bottom-4 left-4",bottom:"bottom-4 left-1/2 -translate-x-1/2",bottomRight:"bottom-4 right-4"},Ls=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp"),pc=a(e=>e instanceof Element&&!!e.closest('[data-no-drag="true"],button,a,input,textarea,select,[contenteditable="true"],[role="button"]'),"isNoDragTarget");function qM(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),jsxRuntime.jsx("path",{d:"M3 4v6h6"})]})}a(qM,"ResetIcon");function YM(){return jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 5v14"}),jsxRuntime.jsx("path",{d:"M5 12h14"})]})}a(YM,"PlusIcon");function XM(){return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M5 12h14"})})}a(XM,"MinusIcon");var Qy=ho.forwardRef(a(function({src:t,rotation:o=0,flipX:r=false,flipY:n=false,alt:i="Preview image",empty:s="No image preview",actions:l,actionContext:d,toolbarActions:c,zoomStep:p=Ky,stagePadding:u=qy,minScale:g=Om,maxScale:f=Yy,wheelZoom:b="plain",doubleClickAction:x="reset",panEnabled:y=true,keyboardEnabled:k=true,slots:w,overlay:v,imageOverlay:h,controlsPosition:S="bottomRight",renderControls:T,onScaleChange:C,controlsVisible:R=true,zoomLabelVisible:M=false,resetLabel:I="Reset image view",zoomInLabel:A="Zoom in",zoomOutLabel:N="Zoom out",originalSizeLabel:D="Original size",appearance:E,className:P,classNames:W,onLoad:H,onError:B},L){let F=Ct(E??{background:"dark-stage"}),_=typeof t=="string"?t.trim():"",$=ho.useRef(null),G=ho.useRef(null),z=ho.useRef({scale:1,translateX:u,translateY:u}),re=ho.useRef(void 0),[Z,ae]=ho.useState(null),[ee,q]=ho.useState(false),U=ho.useRef("page"),[{scale:X,translateX:O,translateY:K},ne]=ho.useState(()=>({scale:1,translateX:u,translateY:u}));ho.useLayoutEffect(()=>{z.current={scale:X,translateX:O,translateY:K};},[X,O,K]),ho.useLayoutEffect(()=>{ae(null),U.current="page";let le=re.current?.pointerId;le!==void 0&&$.current?.hasPointerCapture(le)&&$.current.releasePointerCapture(le),re.current=void 0,q(false),ne({scale:1,translateX:0,translateY:0});},[_]);let fe=ho.useRef(C);fe.current=C,ho.useEffect(()=>{Z&&fe.current?.(X);},[X,Z]);let he=Number.isFinite(g)?Math.max(Om,g):Om,me=Number.isFinite(f)?Math.max(he,f):Yy,ie=Number.isFinite(p)&&p>1?p:Ky,be=Number.isFinite(u)&&u>=0?u:qy,He=Number.isFinite(o)?o%360:0,We=ho.useCallback(le=>{let Me=He*Math.PI/180,Ae=Math.abs(Math.cos(Me)),J=Math.abs(Math.sin(Me));return {width:Math.round((le.width*Ae+le.height*J)*1e6)/1e6,height:Math.round((le.width*J+le.height*Ae)*1e6)/1e6}},[He]),Ke=Z?We(Z):null,ce=ho.useCallback((le,Me="page")=>{U.current=Me;let Ae=$.current,J=le??Z;if(!Ae||!J)return;let $e=We(J),ue=Math.max(0,Ae.clientWidth-be*2),Re=Math.max(0,Ae.clientHeight-be*2);if(ue<=0||Re<=0||$e.width<=0||$e.height<=0)return;let se=Me==="width"?ue/$e.width:Math.min(ue/$e.width,Re/$e.height),te=Ls(se,he,me),Te=$e.width*te,ze=$e.height*te;ne({scale:te,translateX:(Ae.clientWidth-Te)/2,translateY:(Ae.clientHeight-ze)/2});},[Z,me,he,be,We]),Q=ho.useCallback((le,Me)=>{if(!Number.isFinite(le)||!Number.isFinite(Me)||le<=0||Me<=0)return;let Ae=G.current;if(G.current={width:le,height:Me},!Ae||!_)return;if(U.current&&Z){ce(Z,U.current);return}let J=(le-Ae.width)/2,$e=(Me-Ae.height)/2;J===0&&$e===0||ne(ue=>({scale:ue.scale,translateX:ue.translateX+J,translateY:ue.translateY+$e}));},[_,Z,ce]);ho.useLayoutEffect(()=>{let le=$.current;if(!le)return;if(Q(le.clientWidth,le.clientHeight),typeof ResizeObserver<"u"){let Ae=new ResizeObserver(J=>{let $e=J[0];$e&&Q($e.contentRect.width,$e.contentRect.height);});return Ae.observe(le),()=>Ae.disconnect()}let Me=a(()=>{Q(le.clientWidth,le.clientHeight);},"handleResize");return window.addEventListener("resize",Me),()=>window.removeEventListener("resize",Me)},[Q]);let ge=ho.useCallback((le,Me,Ae)=>{!Number.isFinite(le)||le===1||!Number.isFinite(Me)||!Number.isFinite(Ae)||(U.current=null,ne(J=>{let $e=Ls(J.scale*le,he,me);if(!Number.isFinite($e)||$e===J.scale)return J;let ue=$e/J.scale;return {scale:$e,translateX:Me-(Me-J.translateX)*ue,translateY:Ae-(Ae-J.translateY)*ue}}));},[me,he]);ho.useEffect(()=>{let le=$.current;if(!le||!_||!Z)return;let Me=a(Ae=>{if(pc(Ae.target)||b==="disabled"||b==="modifier"&&!(Ae.ctrlKey||Ae.metaKey)||b==="plain"&&(Ae.ctrlKey||Ae.metaKey))return;Ae.preventDefault();let J=le.getBoundingClientRect(),$e=Ae.clientX-J.left,ue=Ae.clientY-J.top,Re=Ae.deltaY*(Ae.deltaMode===1?16:Ae.deltaMode===2?le.clientHeight:1),se=Math.pow(ie,-Ls(Re,-1e3,1e3)/100);ge(se,$e,ue);},"handleWheel");return le.addEventListener("wheel",Me,{passive:false}),()=>le.removeEventListener("wheel",Me)},[_,Z,ie,ge,b]),ho.useLayoutEffect(()=>{let le=$.current;if(!le||!Z)return;let Me=z.current.scale,Ae=Ls(Me,he,me);Ae!==Me&&ge(Ae/Me,le.clientWidth/2,le.clientHeight/2);},[Z,he,me,ge]);let we=ho.useCallback(le=>{if(le.button!==0||!y||!_||!Z||pc(le.target))return;let Me=$.current;Me&&(le.preventDefault(),Me.setPointerCapture(le.pointerId),Me.focus({preventScroll:true}),U.current=null,re.current={pointerId:le.pointerId,startClientX:le.clientX,startClientY:le.clientY,startTranslateX:z.current.translateX,startTranslateY:z.current.translateY},q(true));},[_,Z,y]),Ie=ho.useCallback(le=>{let Me=re.current;!Me||Me.pointerId!==le.pointerId||(le.preventDefault(),ne({scale:z.current.scale,translateX:Me.startTranslateX+le.clientX-Me.startClientX,translateY:Me.startTranslateY+le.clientY-Me.startClientY}));},[]),oe=ho.useCallback(le=>{let Me=re.current;if(!Me||Me.pointerId!==le.pointerId)return;re.current=void 0,q(false);let Ae=$.current;Ae?.hasPointerCapture(le.pointerId)&&Ae.releasePointerCapture(le.pointerId);},[]),xe=ho.useCallback(()=>{let le=$.current;if(!le||!Z)return;U.current=null;let Me=We(Z),Ae=Ls(1,he,me);ne({scale:Ae,translateX:(le.clientWidth-Me.width*Ae)/2,translateY:(le.clientHeight-Me.height*Ae)/2});},[Z,he,me,We]),Ve=ho.useCallback(le=>{!_||!Z||pc(le.target)||(x==="reset"&&ce(),x==="original-size"&&xe());},[_,Z,ce,xe,x]),_e=ho.useCallback(le=>{let Me=$.current;!Me||!Z||ge(le,Me.clientWidth/2,Me.clientHeight/2);},[Z,ge]),Ge={scale:X,ready:!!(_&&Z),canZoomIn:!!(Z&&X<me),canZoomOut:!!(Z&&X>he),zoomIn:a(()=>_e(ie),"zoomIn"),zoomOut:a(()=>_e(1/ie),"zoomOut"),reset:a(()=>ce(),"reset"),fitWidth:a(()=>ce(void 0,"width"),"fitWidth"),originalSize:xe};return ho.useImperativeHandle(L,()=>Ge),jsxRuntime.jsxs("div",{ref:$,"data-image-preview":true,tabIndex:k?0:void 0,onKeyDown:le=>{if(!k||!Ge.ready||pc(le.target))return;let Me=le.key==="+"||le.key==="="?Ge.zoomIn:le.key==="-"?Ge.zoomOut:le.key==="0"?Ge.reset:le.key==="1"?Ge.originalSize:void 0;Me&&(le.preventDefault(),le.stopPropagation(),Me());},className:tailwindMerge.twMerge(F.slots.previewRoot,_&&Z&&y?ee?"cursor-grabbing":"cursor-grab":"cursor-default",W?.root,P),onPointerDown:we,onPointerMove:Ie,onPointerUp:oe,onPointerCancel:oe,onLostPointerCapture:oe,onDoubleClick:Ve,style:{touchAction:y?"none":void 0,...F.styles.previewRoot},children:[_?jsxRuntime.jsx("div",{"data-image-transform":true,className:tailwindMerge.twMerge("absolute left-0 top-0 will-change-transform",W?.imageLayer),style:{visibility:Z?"visible":"hidden",width:Ke?.width,height:Ke?.height,transform:`translate(${O}px, ${K}px) scale(${X})`,transformOrigin:"0 0"},children:jsxRuntime.jsxs("div",{"data-image-orientation":true,className:"absolute left-1/2 top-1/2",style:{width:Z?.width,height:Z?.height,transform:`translate(-50%, -50%) rotate(${He}deg) scaleX(${r?-1:1}) scaleY(${n?-1:1})`},children:[jsxRuntime.jsx("img",{src:_,style:qn(_),alt:i,draggable:false,className:tailwindMerge.twMerge("pointer-events-none max-h-none max-w-none select-none",W?.image),onLoad:le=>{let Me=le.currentTarget.naturalWidth,Ae=le.currentTarget.naturalHeight;if(!Me||!Ae)return;let J={width:Me,height:Ae};ae(J),ce(J),H?.(J);},onError:le=>{ae(null),B?.(le);}},_),h?jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0","data-image-coordinate-overlay":true,children:h}):null]})}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(F.slots.previewPlaceholder,W?.placeholder),children:s}),v?jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0","data-no-drag":"true",children:v}):null,Object.keys(Xy).map(le=>{let Me=le==="topRight"&&(c?.length||l),Ae=le===S&&R;return !w?.[le]&&!Me&&!Ae?null:jsxRuntime.jsxs("div",{"data-image-slot":le,"data-no-drag":"true",className:tailwindMerge.twMerge("absolute z-20 flex max-h-full max-w-full flex-col gap-2",Xy[le]),children:[w?.[le],Me?jsxRuntime.jsxs("div",{"data-no-drag":"true",className:tailwindMerge.twMerge(F.slots.previewActions,"static",W?.actions),children:[c?.length?jsxRuntime.jsx(cn,{context:d,actions:c,layout:"inline",appearance:E??{background:"dark-stage"}}):null,l]}):null,Ae?T?T(Ge):jsxRuntime.jsxs("div",{"data-no-drag":"true",className:tailwindMerge.twMerge(F.slots.previewControls,"static",W?.controls),children:[M?jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge(F.slots.previewZoomLabel,W?.zoomLabel),children:[Math.round(X*100),"%"]}):null,jsxRuntime.jsx(To,{content:N,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":N,disabled:!Ge.canZoomOut,className:tailwindMerge.twMerge(F.slots.previewControlButton,"disabled:cursor-not-allowed disabled:opacity-40",W?.controlButton),onClick:()=>_e(1/ie),children:jsxRuntime.jsx(XM,{})})}),jsxRuntime.jsx(To,{content:A,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":A,disabled:!Ge.canZoomIn,className:tailwindMerge.twMerge(F.slots.previewControlButton,"disabled:cursor-not-allowed disabled:opacity-40",W?.controlButton),onClick:()=>_e(ie),children:jsxRuntime.jsx(YM,{})})}),jsxRuntime.jsx(To,{content:I,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":I,disabled:!_||!Z,className:tailwindMerge.twMerge(F.slots.previewControlButton,"disabled:cursor-not-allowed disabled:opacity-40",W?.controlButton),onClick:()=>ce(),children:jsxRuntime.jsx(qM,{})})}),jsxRuntime.jsx(To,{content:D,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":D,disabled:!Ge.ready,className:tailwindMerge.twMerge(F.slots.previewControlButton,W?.controlButton),onClick:xe,children:jsxRuntime.jsx(lucideReact.Scan,{className:"h-4 w-4","aria-hidden":"true"})})})]}):null]},le)})]})},"DataExplorerImagePreview"));function fn(e,t){if(typeof e!="string")return;let o=e.trim();if(!o||/[\u0000-\u001f\u007f\\]/.test(o)||/^https?:/i.test(o)&&!/^https?:\/\//i.test(o))return;let r;try{r=new URL(o,"https://monkeys.invalid/");}catch{return}if(!(r.username||r.password)){if(r.protocol==="http:"||r.protocol==="https:"||t==="link"&&(r.protocol==="mailto:"||r.protocol==="tel:"))return o;if(r.protocol==="blob:"){if(r.pathname.startsWith("null/"))return o;try{let n=new URL(r.pathname);if(["https:","http:"].includes(n.protocol)&&!n.username&&!n.password)return o}catch{}}}}a(fn,"safeDisplayUrl");function Zy(e){if(typeof e!="string"||!e.trim())return;let t=e.split(",");for(let o of t){let r=o.trim().split(/\s+/);if(!fn(r[0],"media")||r.length>2||r.length===2&&!/^(?:[1-9]\d*w|(?:\d+(?:\.\d+)?|\.\d+)x)$/.test(r[1]))return}return e}a(Zy,"safeDisplaySrcSet");function Jy({kind:e}){return jsxRuntime.jsx(e==="image"?lucideReact.Image:e==="video"?lucideReact.Video:e==="audio"?lucideReact.Music2:lucideReact.FileText,{className:"h-6 w-6","aria-hidden":"true"})}a(Jy,"PreviewIcon");function tx({src:e,kind:t="image",alt:o="Preview",title:r,aspectRatio:n="auto",fit:i="contain",controls:s=true,loading:l=false,empty:d="No preview available",error:c="Preview is unavailable right now.",className:p,style:u,classNames:g,mediaAttributes:f,onLoad:b,onError:x}){let[y,k]=ho.useState(false),w=fn(e,"media")??"",v=Object.fromEntries(Object.entries(f??{}).flatMap(([C,R])=>{let M=C.toLowerCase();return M==="src"||M==="srcdoc"||M==="dangerouslysetinnerhtml"?[]:M==="srcset"?[["srcSet",Zy(R)]]:M==="poster"?[["poster",fn(R,"media")]]:[[C,R]]}));ho.useEffect(()=>{k(false);},[w,t]);let h=a((C,R)=>jsxRuntime.jsx("div",{className:j("flex min-h-24 flex-col items-center justify-center gap-2 bg-muted/30 p-4 text-center text-sm text-muted-foreground",g?.placeholder,R),role:l?"status":"img","aria-label":typeof C=="string"?C:void 0,children:C}),"renderPlaceholder");if(l)return jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",g?.root,p),style:u,"aria-busy":"true",children:jsxRuntime.jsxs("div",{className:j("flex min-h-24 flex-col items-center justify-center gap-2 bg-muted/30 p-4 text-sm text-muted-foreground",g?.loading),children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-5 w-5 animate-spin","aria-hidden":"true"}),r||"Loading preview..."]})});if(!w||y)return jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",g?.root,p),style:u,children:h(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Jy,{kind:t}),jsxRuntime.jsx("span",{className:j("max-w-full truncate",y?g?.error:void 0),children:y?c:d}),r?jsxRuntime.jsx("span",{className:"max-w-full truncate text-xs",children:r}):null]}))});let S=a(()=>{k(true),x?.();},"handleError"),T=t==="image"?jsxRuntime.jsx(Ds,{...v,src:w,alt:o,fit:i,className:g?.media,loading:"lazy",decoding:"async",draggable:false,onLoad:b,onError:S}):t==="video"?jsxRuntime.jsx("video",{...v,src:w,className:j("block h-auto w-full",i==="cover"?"object-cover":"object-contain",g?.media),controls:s,preload:"metadata",onLoadedData:b,onError:S}):t==="audio"?jsxRuntime.jsx("audio",{...v,src:w,className:j("w-full",g?.media),controls:s,preload:"metadata",onCanPlay:b,onError:S}):h(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Jy,{kind:"file"}),jsxRuntime.jsx("span",{className:"max-w-full truncate",children:r||w})]}));return t==="image"?jsxRuntime.jsx(Is,{aspectRatio:n,className:j(g?.root,p),style:u,children:T}):jsxRuntime.jsx("div",{className:j("min-w-0 overflow-hidden",g?.root,p),style:u,children:T})}a(tx,"DataExplorerMediaPreview");function rx({sidebar:e,tree:t,toolbar:o,controls:r,notices:n,content:i,view:s,detail:l,appearance:d,className:c,classNames:p}){let u=Et(d),g=u?Ct(u):void 0,f=t??e,b=r??o,x=s??i;return jsxRuntime.jsx(Ih,{appearance:u,children:jsxRuntime.jsxs("div",{className:j("flex h-full min-h-0 overflow-hidden",g?.slots.surfaceRoot,p?.root,c),style:g?.styles.surfaceRoot,children:[f?jsxRuntime.jsx("div",{className:j("min-h-0 shrink-0 overflow-hidden",p?.sidebar,p?.tree),children:f}):null,jsxRuntime.jsxs("div",{className:j("relative flex min-h-0 flex-1 flex-col overflow-hidden",p?.main),children:[b?jsxRuntime.jsx("div",{className:j("shrink-0",p?.toolbar,p?.controls),children:b}):null,n?jsxRuntime.jsx("div",{className:j("shrink-0",p?.notices),children:n}):null,jsxRuntime.jsx("div",{className:j("flex min-h-0 flex-1 flex-col overflow-hidden",p?.content,p?.view),children:x}),l?jsxRuntime.jsx("div",{className:j(p?.detail),children:l}):null]})]})})}a(rx,"DataExplorerPage");function n2({item:e,selected:t,label:o,className:r,onToggleSelection:n}){return n?jsxRuntime.jsx("input",{type:"checkbox",checked:t,"aria-label":o,className:j("h-4 w-4 shrink-0 accent-primary",r),onChange:()=>n(e),onClick:i=>i.stopPropagation()}):null}a(n2,"DefaultCheckbox");function a2({item:e,active:t,label:o,className:r,onToggleFavorite:n}){return n?jsxRuntime.jsxs("button",{type:"button","aria-pressed":t,title:o,className:j("inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",t&&"text-[hsl(var(--warning,45_93%_47%))]",r),onClick:i=>{i.stopPropagation(),n(e);},children:[jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:t?"currentColor":"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.8-6.2-3.3L5.8 21 7 14.2 2 9.3l6.9-1L12 2Z"})}),jsxRuntime.jsx("span",{className:"sr-only",children:o})]}):null}a(a2,"DefaultFavorite");function i2({item:e,limit:t,classNames:o}){let r=e.keywords??[];if(r.length===0)return null;let n=r.slice(0,t),i=Math.max(0,r.length-n.length);return jsxRuntime.jsxs("div",{className:j("mt-2 flex flex-wrap gap-2",o?.keywords),children:[n.map((s,l)=>jsxRuntime.jsx("span",{className:j("max-w-full truncate rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",o?.keyword),title:typeof s=="string"?s:void 0,children:s},l)),i>0?jsxRuntime.jsxs("span",{className:j("rounded-full border border-border px-2 py-0.5 text-xs text-muted-foreground",o?.keywordOverflow),children:["+",i]}):null]})}a(i2,"renderKeywords");function nx({item:e,selected:t=e.selected??false,active:o,disabled:r=e.disabled,hasMedia:n,showHeaderWithMedia:i=false,selectionVisible:s,favoriteVisible:l,overlayControlsAlwaysVisible:d,favoriteActive:c=false,favoriteLabel:p="Favorite",favoriteActiveLabel:u="Unfavorite",selectLabel:g="Select item",unselectLabel:f="Unselect item",actions:b,media:x,footer:y,checkbox:k,favorite:w,keywordLimit:v=3,appearance:h,className:S,classNames:T,onClick:C,onToggleSelection:R,onToggleFavorite:M}){let I=Ct(Et(h)),A=n??!!(x??e.media),N=!A||i,D=s??!!(t||R),E=l??!!(w||M),P=c?u:p,H=k??(D?jsxRuntime.jsx(n2,{item:e,selected:t,label:t?f:g,className:T?.selectionControl,onToggleSelection:R}):null),B=w??(E?jsxRuntime.jsx(a2,{item:e,active:c,label:P,className:T?.favoriteControl,onToggleFavorite:M}):null),L=x??(e.media?jsxRuntime.jsx(Ci,{media:e.media,fallbackTitle:e.title}):void 0),F=N?jsxRuntime.jsxs("div",{className:j("flex flex-col",T?.header),children:[jsxRuntime.jsxs("div",{className:j("flex min-w-0 items-center justify-between gap-2",T?.headerMain),children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[H,jsxRuntime.jsx("div",{className:"min-w-0 flex-1",children:e.title?jsxRuntime.jsx("h3",{className:j("truncate text-sm font-semibold leading-none",T?.title),children:e.title}):null})]}),B||b?jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[B,b]}):null]}),i2({item:e,limit:v,classNames:T})]}):null,_=A&&(H||B||b)?jsxRuntime.jsx("div",{className:j("absolute inset-x-2 top-2 z-10",T?.overlay),children:jsxRuntime.jsxs("div",{className:j("flex items-start justify-between gap-1 transition-opacity",t||d?"opacity-100":"opacity-0 group-hover:opacity-100",T?.overlayControls),children:[H??jsxRuntime.jsx("span",{}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[B,b?jsxRuntime.jsx("div",{className:j(T?.floatingActions),children:b}):null]})]})}):null;return jsxRuntime.jsx(Jn,{item:e,selected:t,disabled:r,appearance:h,className:j(I.slots.recordCardRoot,o&&I.slots.recordCardActive,T?.root,S),classNames:{overlay:T?.overlay,header:j(A?"p-3":"p-3 pb-2",T?.header),media:j("p-0 bg-muted/30",T?.media),footer:T?.footer},header:F,overlay:_,media:L?jsxRuntime.jsx("div",{className:j("relative overflow-hidden",T?.mediaFrame),children:L}):void 0,footer:y,children:null,onClick:C})}a(nx,"DataExplorerRecordCard");var p2=a((e,t)=>{let o=t?Array.isArray(e)?e:e?[e]:[]:typeof e=="string"?[e]:[];return Array.from(new Set(o.filter(r=>typeof r=="string"&&r.length>0)))},"normalizeValues"),Hm=a(e=>e.textValue??(typeof e.label=="string"?e.label:e.value),"getOptionText");function lx({value:e,activeValue:t,options:o=[],createOption:r,multiple:n=false,placeholder:i="Select a record",triggerLabel:s,triggerIcon:l,searchPlaceholder:d="Search records",emptyState:c="No records found",loadingState:p,loadingMoreState:u,errorState:g,loading:f=false,loadingMore:b=false,disabled:x=false,open:y,defaultOpen:k=false,searchValue:w,defaultSearchValue:v="",appearance:h,className:S,classNames:T,triggerProps:C,dataAttributes:R,onOpenChange:M,onListScroll:I,onSearchValueChange:A,onValueChange:N}){let D=Ct(Et(h)),[E,P]=ho.useState(k),[W,H]=ho.useState(v),B=y!==void 0,L=B?y:E,F=w!==void 0,_=F?w:W,$=ho.useMemo(()=>p2(e,n),[n,e]),G=ho.useMemo(()=>new Set($),[$]),z=$.map(X=>o.find(O=>O.value===X)).filter(X=>!!X),re=r?[r,...o]:o,Z=z.length?n&&z.length>1?`${z.slice(0,2).map(X=>Hm(X)).join(", ")} +${z.length-2}`:Hm(z[0]):i;ho.useEffect(()=>{if(!L)return;let X=a(O=>{O.key==="Escape"&&M?.(false);},"handleKeyDown");return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[L,M]);let ae=a(X=>{x||(B||P(X),M?.(X));},"setOpen"),ee=a(X=>{F||H(X),A?.(X);},"setQuery"),q=a(X=>{if(!(x||X.disabled)){if(n){let O=G.has(X.value)?$.filter(K=>K!==X.value):[...$,X.value];N?.(O);return}N?.(X.value),ae(false);}},"handleOptionClick"),U=a(X=>{x||N?.($.filter(O=>O!==X));},"removeValue");return jsxRuntime.jsxs("div",{...R?.root,className:j("relative min-w-0 w-full",T?.root,S),children:[jsxRuntime.jsxs(_n__namespace.Root,{open:L,onOpenChange:ae,children:[jsxRuntime.jsx(_n__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{...C,...R?.trigger,type:"button",disabled:x,"aria-label":s,"aria-expanded":L,className:j(D.slots.controlSelectTrigger,T?.trigger),children:[l,jsxRuntime.jsx("span",{...R?.triggerValue,className:j(D.slots.controlSelectValue,!z.length&&"text-muted-foreground",T?.triggerValue),children:Z}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 shrink-0","aria-hidden":"true"})]})}),jsxRuntime.jsx(_n__namespace.Portal,{children:jsxRuntime.jsxs(_n__namespace.Content,{...R?.content,align:"start",sideOffset:6,className:j("z-50 w-[min(30rem,calc(100vw-2rem))] rounded-md border border-border bg-popover p-2 text-popover-foreground shadow-md",T?.content),onOpenAutoFocus:X=>X.preventDefault(),children:[jsxRuntime.jsxs("label",{className:j("flex h-9 items-center gap-2 rounded-md border border-border bg-background px-2 text-sm",T?.search),children:[jsxRuntime.jsx(lucideReact.Search,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("input",{autoFocus:true,value:_,onChange:X=>ee(X.target.value),placeholder:d,"aria-label":d,className:"min-w-0 flex-1 bg-transparent outline-hidden placeholder:text-muted-foreground"})]}),jsxRuntime.jsx("div",{className:j("mt-2 max-h-72 overflow-y-auto",T?.list),...R?.list,role:"listbox","aria-multiselectable":n||void 0,onScroll:I,children:f?jsxRuntime.jsxs("div",{...R?.loading,className:j("flex min-h-16 items-center justify-center gap-2 px-3 py-4 text-sm text-muted-foreground",T?.status),children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),p??"Loading records..."]}):g?jsxRuntime.jsx("div",{...R?.error,className:j("px-3 py-4 text-sm text-destructive-text",T?.status),children:g}):re.length===0?jsxRuntime.jsx("div",{...R?.empty,className:j("px-3 py-4 text-sm text-muted-foreground",T?.status),children:c}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[re.map(X=>{let O=G.has(X.value);return jsxRuntime.jsxs("button",{...R?.option,type:"button",role:"option","aria-selected":O,"aria-current":t!==void 0&&X.value===t?"true":void 0,disabled:X.disabled,onClick:()=>q(X),className:j("flex w-full items-start gap-2 rounded-sm px-2.5 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50",O&&"bg-accent/60",T?.option),children:[jsxRuntime.jsx("span",{className:j("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center",T?.optionIndicator),children:O?jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4","aria-hidden":"true"}):null}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:j("block truncate",T?.optionLabel),children:X.label}),X.description?jsxRuntime.jsx("span",{className:j("mt-0.5 block truncate text-xs text-muted-foreground",T?.optionDescription),children:X.description}):null]})]},X.value)}),b?jsxRuntime.jsxs("div",{...R?.loadingMore,className:j("flex items-center justify-center gap-2 px-3 py-2 text-xs text-muted-foreground",T?.status),children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}),u??"Loading more records..."]}):null]})})]})})]}),n&&z.length>0?jsxRuntime.jsx("div",{className:j("mt-2 flex flex-wrap gap-1.5",T?.selectedList),children:z.map(X=>jsxRuntime.jsxs("span",{className:j("inline-flex max-w-full items-center gap-1 rounded-full border border-border bg-muted px-2 py-1 text-xs",T?.selectedItem),children:[jsxRuntime.jsx("span",{className:j("min-w-0 truncate",T?.selectedItemLabel),children:X.label}),jsxRuntime.jsx("button",{type:"button","aria-label":`Remove ${Hm(X)}`,onClick:()=>U(X.value),className:j("inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",T?.selectedItemRemove),children:jsxRuntime.jsx(lucideReact.X,{className:"h-3 w-3","aria-hidden":"true"})})]},X.value))}):null]})}a(lx,"DataExplorerRecordPicker");function h2({items:e,value:t,defaultValue:o,allowCollapse:r,keyboardNavigation:n}){if(!Array.isArray(e))throw new TypeError("BaseAccordion items must be an array.");if(t!==void 0&&(typeof t!="string"||!t.trim()))throw new TypeError("BaseAccordion value must be a non-empty string when provided.");if(o!==void 0&&(typeof o!="string"||!o.trim()))throw new TypeError("BaseAccordion defaultValue must be a non-empty string when provided.");if(typeof r!="boolean")throw new TypeError("BaseAccordion allowCollapse must be a boolean.");if(typeof n!="boolean")throw new TypeError("BaseAccordion keyboardNavigation must be a boolean.");let i=new Set;e.forEach((s,l)=>{if(!s||typeof s!="object")throw new TypeError(`BaseAccordion item at index ${l} must be an object.`);if(typeof s.value!="string"||!s.value.trim())throw new TypeError(`BaseAccordion item value at index ${l} must be a non-empty string.`);if(i.has(s.value))throw new TypeError(`BaseAccordion items must use unique values; duplicate value ${JSON.stringify(s.value)} at index ${l}.`);if(s.disabled!==void 0&&typeof s.disabled!="boolean")throw new TypeError(`BaseAccordion item disabled at index ${l} must be a boolean.`);i.add(s.value);});}a(h2,"validateBaseAccordionProps");function y2(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(y2,"toDomId");function x2(e){let t=new Set;return e.map((o,r)=>{let n=y2(o.value)||`item-${r}`,i=n;if(t.has(i))for(i=`${n}-${r}`;t.has(i);)i=`${i}-${r}`;return t.add(i),i})}a(x2,"getDomIdFragments");var ux=ho.forwardRef(a(function({items:t=[],value:o,defaultValue:r,allowCollapse:n=true,keyboardNavigation:i=true,appearance:s,className:l,classNames:d,style:c,onValueChange:p,id:u,onFocusCapture:g,onBlurCapture:f,...b},x){h2({items:t,value:o,defaultValue:r,allowCollapse:n,keyboardNavigation:i});let y=Pe(s),k=ke(),w=Ne(y),v=ho.useId(),h=u??v,[S,T]=ho.useState(r),[C,R]=ho.useState(),M=ho.useRef(new Map),I=ho.useRef(false),A=o!==void 0,N=A?o:S,D=x2(t),E=t.filter(G=>!G.disabled),P=t.find(G=>G.value===N),W=typeof b.dir=="string"?b.dir:k.dir;ho.useEffect(()=>{if(!I.current||C===void 0)return;let G=t.find(re=>re.value===C);if(G&&!G.disabled)return;let z=E.find(re=>re.value===N)??E[0];if(!z){I.current=false;return}R(z.value),M.current.get(z.value)?.focus();},[E,C,t,N]);let H=a(G=>{if(G.disabled)return;let z=N===G.value;if(z&&!n){p?.(G.value);return}let re=z?void 0:G.value;A||T(re),p?.(re);},"handleToggle"),B=a((G,z,re)=>{if(!i||E.length===0)return;let Z;if(re==="first")Z=E[0];else if(re==="last")Z=E[E.length-1];else {let ee=(E.findIndex(q=>q.value===z.value)+re+E.length)%E.length;Z=E[ee];}Z&&(G.preventDefault(),R(Z.value),M.current.get(Z.value)?.focus());},"moveFocus"),L=a((G,z)=>{z.disabled||(G.key==="ArrowDown"?B(G,z,1):G.key==="ArrowUp"?B(G,z,-1):G.key==="Home"?B(G,z,"first"):G.key==="End"&&B(G,z,"last"));},"handleKeyDown"),F=a(G=>G instanceof HTMLElement&&G.dataset.accordionOwner===h,"isOwnedTrigger"),_=a(G=>{F(G.target)&&(I.current=true),g?.(G);},"handleFocusCapture"),$=a(G=>{F(G.target)&&!F(G.relatedTarget)&&(I.current=false),f?.(G);},"handleBlurCapture");return jsxRuntime.jsx("div",{...k,...b,ref:x,id:u,dir:W,"data-monkeys-component":"accordion","data-slot":"root","data-state":P?"open":"closed","data-collapsible":n,"data-keyboard-navigation":i,className:m(w.slots.accordionRoot,d?.root,l),style:{...w.styles.accordion,...c},onFocusCapture:_,onBlurCapture:$,children:t.map((G,z)=>{let re=D[z],Z=`${h}-${re}-trigger`,ae=`${h}-${re}-panel`,ee=G.value===N,q=ee?"open":"closed";return ho.createElement("div",{...k,key:G.value,dir:W,"data-monkeys-component":"accordion","data-slot":"item","data-state":q,"data-disabled":G.disabled||void 0,className:m(w.slots.accordionItem,d?.item)},jsxRuntime.jsxs("button",{...k,ref:U=>{U?M.current.set(G.value,U):M.current.delete(G.value);},id:Z,type:"button","aria-expanded":ee,"aria-controls":ae,"aria-disabled":G.disabled||void 0,disabled:G.disabled,dir:W,"data-accordion-owner":h,"data-monkeys-component":"accordion","data-slot":"trigger","data-state":q,"data-disabled":G.disabled||void 0,className:m(w.slots.accordionTrigger,d?.trigger),onFocus:()=>R(G.value),onKeyDown:U=>L(U,G),onClick:()=>H(G),children:[jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:G.title}),jsxRuntime.jsx("span",{"aria-hidden":"true","data-monkeys-component":"accordion","data-slot":"trigger-icon","data-state":q,className:m(w.slots.accordionTriggerIcon,ee&&"rotate-[225deg]",d?.triggerIcon)})]}),ee?jsxRuntime.jsx("div",{...k,id:ae,role:"region","aria-labelledby":Z,dir:W,"data-monkeys-component":"accordion","data-slot":"panel","data-state":"open",className:m(w.slots.accordionPanel,d?.panel),children:V(G.content)?G.content:null}):null)})})},"BaseAccordion"));var T2={sm:"h-7 w-7 text-xs",md:"h-9 w-9 text-sm",lg:"h-12 w-12 text-base"},mx={online:"bg-[hsl(var(--success,142_72%_29%))]",busy:"bg-[hsl(var(--warning,45_93%_47%))]",offline:"bg-muted-foreground",neutral:"bg-muted-foreground"};function px(e){return typeof e=="string"&&e in mx}a(px,"isStatusPreset");function N2(e){if(!e)return;let t=e.trim().split(/\s+/).filter(Boolean);if(t.length)return t.slice(0,2).map(o=>o[0]?.toUpperCase()).join("")}a(N2,"getInitials");var bc=ho.forwardRef(a(function({src:t,alt:o,name:r,initials:n,icon:i,status:s,size:l="md",appearance:d,className:c,classNames:p,style:u,children:g,title:f,...b},x){if(l!=="sm"&&l!=="md"&&l!=="lg")throw new TypeError('BaseAvatar size must be "sm", "md", or "lg".');let y=Pe(d),k=ke(),w=Ne(y),[v,h]=ho.useState(),T=!!t&&!!!(t&&v===t),C=N2(r),R=V(g)?"children":V(n)?"initials":V(C)?"name":V(i)?"icon":"default",M=V(g)?g:V(n)?n:V(C)?C:V(i)?i:"?",I=px(s)?s:V(s)?"custom":void 0;return ho.useEffect(()=>{h(void 0);},[t]),jsxRuntime.jsxs("div",{...k,...b,ref:x,title:f??r,"data-monkeys-component":"avatar","data-slot":"root","data-state":T?"image":"fallback","data-size":l,"data-status":I,"data-fallback":T?void 0:R,className:m(w.slots.avatarRoot,T2[l],p?.root,c),style:{...w.styles.avatar,...u},children:[T?jsxRuntime.jsx("img",{src:t,alt:o??r??"","data-slot":"image","data-size":l,"data-status":I,className:m(w.slots.avatarImage,p?.image),onError:()=>h(t)}):jsxRuntime.jsx("span",{"data-slot":"fallback","data-size":l,"data-status":I,"data-fallback":R,className:m(w.slots.avatarFallback,p?.fallback,p?.text),children:M}),px(s)?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"status","data-size":l,"data-status":s,className:m(w.slots.avatarStatus,mx[s],p?.status)}):V(s)?jsxRuntime.jsx("span",{"data-slot":"status","data-size":l,"data-status":"custom",className:m(w.slots.avatarStatus,p?.status),children:s}):null]})},"BaseAvatar"));function I2(e){if(!Number.isFinite(e)||e<=0)throw new RangeError("BaseAspectRatio ratio must be a positive finite number.");return String(e)}a(I2,"resolveAspectRatio");var D2=ho.forwardRef(a(function({children:t,ratio:o=16/9,appearance:r,className:n,classNames:i,style:s,...l},d){let c=Pe(r),p=ke(),u=Ne(c);return jsxRuntime.jsx("div",{...p,...l,ref:d,"data-monkeys-component":"aspect-ratio","data-slot":"root","data-ratio":o,className:m(u.slots.aspectRatioRoot,i?.root,n),style:{...u.styles.aspectRatio,aspectRatio:I2(o),...s},children:t})},"BaseAspectRatio"));var gc=ho.forwardRef(a(function({children:t,label:o,icon:r,tone:n,appearance:i,variant:s,density:l,state:d,className:c,classNames:p,style:u,...g},f){if(n!==void 0&&n!=="default"&&n!=="primary"&&n!=="success"&&n!=="warning"&&n!=="danger"&&n!=="muted")throw new TypeError('BaseBadge tone must be "default", "primary", "success", "warning", "danger", or "muted".');let b=Pe(i),x=ke(),y=Ne({...b,variant:s,density:l,state:d}),k=t??o,w=n??"default";return jsxRuntime.jsxs("span",{...x,...g,ref:f,"data-monkeys-component":"badge","data-slot":"root","data-tone":w,"data-variant":y.variant,"data-density":y.density,"data-state":y.state,className:m(y.slots.badgeBase,Wd(y,n),p?.root,c),style:{...y.styles.badge,...u},children:[r?jsxRuntime.jsx("span",{"data-slot":"icon","data-tone":w,className:m(y.slots.badgeIcon,p?.icon),children:r}):null,k!=null?jsxRuntime.jsx("span",{"data-slot":"label","data-tone":w,className:m(y.slots.badgeLabel,p?.label),children:k}):null]})},"BaseBadge"));function B2(e,t,o){return e.current??t===o-1}a(B2,"isCurrentItem");function bx({items:e=[],separator:t="/",appearance:o,className:r,classNames:n,style:i,onSelect:s,...l}){let d=Ne(o),c=a((p,u,g)=>{if(u.disabled){p.preventDefault();return}s?.(u,g);},"handleClick");return jsxRuntime.jsx("nav",{...l,"aria-label":l["aria-label"]??"Breadcrumb",className:m(d.slots.breadcrumbRoot,n?.root,r),style:{...d.styles.breadcrumb,...i},children:jsxRuntime.jsx("ol",{className:m(d.slots.breadcrumbList,n?.list),children:e.map((p,u)=>{let g=B2(p,u,e.length);return jsxRuntime.jsxs("li",{className:m(d.slots.breadcrumbItem,n?.item),children:[g?jsxRuntime.jsx("span",{"aria-current":"page",className:m(d.slots.breadcrumbCurrent,n?.current),children:p.label}):p.href?jsxRuntime.jsx("a",{href:p.href,"aria-disabled":p.disabled||void 0,className:m(d.slots.breadcrumbLink,n?.link),onClick:f=>c(f,p,u),children:p.label}):jsxRuntime.jsx("button",{type:"button",disabled:p.disabled,className:m(d.slots.breadcrumbLink,"bg-transparent p-0",n?.link),onClick:f=>c(f,p,u),children:p.label}),u<e.length-1?jsxRuntime.jsx("span",{"aria-hidden":"true",className:m(d.slots.breadcrumbSeparator,n?.separator),children:t}):null]},`${u}-${p.value??p.href??String(p.label)}`)})})})}a(bx,"BaseBreadcrumb");var z2={sm:"h-8 px-2.5 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-3.5 text-base"},O2={sm:"h-8 w-8 px-0",md:"h-9 w-9 px-0",lg:"h-10 w-10 px-0"},Vm={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"};function hc(e){return typeof e=="string"&&e.trim()?e:void 0}a(hc,"nonEmptyText");function F2(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-full w-full motion-safe:animate-spin motion-reduce:animate-none",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(F2,"LoadingIcon");var dt=ho.forwardRef(a(function({children:t,label:o,icon:r,endIcon:n,type:i="button",title:s,ariaLabel:l,tone:d,size:c,active:p=false,iconOnly:u=false,disabled:g=false,loading:f=false,stopPropagation:b=false,appearance:x,variant:y,density:k,state:w,className:v,classNames:h,style:S,onClick:T,"aria-label":C,"aria-pressed":R,...M},I){for(let[z,re]of [["active",p],["iconOnly",u],["disabled",g],["loading",f],["stopPropagation",b]])if(typeof re!="boolean")throw new TypeError(`BaseButton ${z} must be a boolean.`);if(c!==void 0&&c!=="sm"&&c!=="md"&&c!=="lg")throw new TypeError('BaseButton size must be "sm", "md", or "lg".');if(d!==void 0&&d!=="default"&&d!=="primary"&&d!=="success"&&d!=="warning"&&d!=="danger"&&d!=="muted")throw new TypeError('BaseButton tone must be "default", "primary", "success", "warning", "danger", or "muted".');let A=Pe(x),N=ke(),D=Ne({...A,variant:y,density:k,state:w}),E=t??o,P=V(E)&&(typeof E!="string"||!!E.trim()),W=hc(l)??hc(C),H=typeof E=="string"?hc(E):void 0,B=hc(s);if(u&&!P&&!W&&!B)throw new TypeError("BaseButton iconOnly requires ariaLabel, aria-label, title, or a renderable label.");let L=W??H??B,F=g||f,_=d??"default",$=w??(f?"loading":g?"disabled":p?"active":"idle"),G=a(z=>{b&&z.stopPropagation(),!F&&T?.(z);},"handleClick");return jsxRuntime.jsxs("button",{...N,...M,ref:I,type:i,title:s,"aria-label":L,"aria-pressed":R??(p||void 0),"aria-busy":f||void 0,"data-variant":D.variant,"data-density":D.density,disabled:F,"data-monkeys-component":"button","data-slot":"root","data-state":$,"data-tone":_,"data-size":c,"data-active":p||void 0,"data-loading":f||void 0,"data-disabled":F||void 0,"data-icon-only":u||void 0,className:m(D.slots.buttonBase,u&&D.slots.buttonIconOnly,c&&z2[c],u&&c&&O2[c],jn(D,d,p),F&&D.slots.buttonDisabled,h?.root,v),style:{...D.styles.button,...p?D.styles.buttonActive:void 0,...F?D.styles.buttonDisabled:void 0,...S},onClick:G,children:[f?jsxRuntime.jsx("span",{"data-slot":"icon","data-state":$,"data-tone":_,"data-size":c,className:m(D.slots.buttonIcon,c&&Vm[c],h?.icon),children:jsxRuntime.jsx(F2,{})}):r?jsxRuntime.jsx("span",{"data-slot":"icon","data-state":$,"data-tone":_,"data-size":c,className:m(D.slots.buttonIcon,c&&Vm[c],h?.icon),children:r}):null,u?V(E)?jsxRuntime.jsx("span",{"data-slot":"label","data-state":$,"data-tone":_,"data-size":c,className:"sr-only",children:E}):null:V(E)?jsxRuntime.jsx("span",{"data-slot":"label","data-state":$,"data-tone":_,"data-size":c,className:m(D.slots.buttonLabel,h?.label),children:E}):null,!f&&n?jsxRuntime.jsx("span",{"data-slot":"end-icon","data-state":$,"data-tone":_,"data-size":c,className:m(D.slots.buttonIcon,c&&Vm[c],h?.icon,h?.endIcon),children:n}):null]})},"BaseButton"));var V2=ho.forwardRef(a(function({children:t,display:o="inline",appearance:r,className:n,classNames:i,style:s,...l},d){let c=Pe(r),p=ke(),u=Ne(c);return o==="block"?jsxRuntime.jsx("pre",{...p,...l,ref:d,"data-monkeys-component":"code","data-slot":"root","data-display":"block",className:m(u.slots.codeBlock,i?.root,n),style:{...u.styles.code,...s},children:jsxRuntime.jsx("code",{"data-slot":"code",className:m(u.slots.codeContent,i?.code),style:u.styles.codeContent,children:t})}):jsxRuntime.jsx("code",{...p,...l,ref:d,"data-monkeys-component":"code","data-slot":"root","data-display":"inline",className:m(u.slots.codeInline,u.slots.codeContent,i?.root,i?.code,n),style:{...u.styles.code,...u.styles.codeContent,...s},children:t})},"BaseCode"));function hx(e,t){let o=Number.isFinite(t?.speed)?Math.max(-1,Math.min(1,t.speed)):0,r=Number.isFinite(t?.maxOffset)?Math.max(0,Math.min(200,t.maxOffset)):16;ho.useEffect(()=>{let n=e.current;if(!n||!o||!r)return;let i=n.ownerDocument.defaultView;if(!i)return;let s=n.parentElement;for(;s&&!/(auto|scroll|overlay)/.test(i.getComputedStyle(s).overflowY);)s=s.parentElement;let l=s,d=l??i,c=i.matchMedia("(prefers-reduced-motion: reduce)"),p=n.style.translate,u,g=false,f=a(()=>{u=void 0;let k=Math.max(-r,Math.min(r,Math.max(0,l?l.scrollTop:i.scrollY)*o));n.style.translate=`0 ${k}px`;},"update"),b=a(()=>{u===void 0&&(u=i.requestAnimationFrame(f));},"schedule"),x=a(()=>{d.removeEventListener("scroll",b),g=false,u!==void 0&&i.cancelAnimationFrame(u),u=void 0,n.style.translate=p;},"stop"),y=a(()=>{c.matches?x():g||(d.addEventListener("scroll",b,{passive:true}),g=true,f());},"syncPreference");return c.addEventListener("change",y),y(),()=>{x(),c.removeEventListener("change",y);}},[e,o,r]);}a(hx,"useScrollMotion");var U2=ho.forwardRef(a(function({children:t,maxWidth:o="80rem",padding:r="1rem",scrollMotion:n,appearance:i,className:s,classNames:l,style:d,...c},p){let u=ho.useRef(null),g=ho.useCallback(w=>{u.current=w,typeof p=="function"?p(w):p&&(p.current=w);},[p]);hx(u,n);let f=Pe(i),b=ke(),x=Ne(f),y=nr("BaseContainer","maxWidth",o),k=nr("BaseContainer","padding",r);return jsxRuntime.jsx("div",{...b,...c,ref:g,"data-monkeys-component":"container","data-slot":"root",className:m(x.slots.containerRoot,l?.root,s),style:{...x.styles.container,maxWidth:y,paddingInline:k,...d},children:t})},"BaseContainer"));var q2=["default","primary","success","warning","danger","muted"];function Lo(e,t){if(typeof e!="boolean")throw new TypeError(`BaseContextMenu ${t} must be a boolean.`)}a(Lo,"validateBoolean");function yc(e){if(e!==void 0&&!q2.includes(e))throw new TypeError('BaseContextMenu tone must be "default", "primary", "success", "warning", "danger", or "muted".')}a(yc,"validateTone");function Y2(e){if(e!==void 0&&e!=="ltr"&&e!=="rtl")throw new TypeError('BaseContextMenu dir must be "ltr" or "rtl".')}a(Y2,"validateDirection");function X2(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M3.5 8.5 6.5 11.5 12.5 4.5"})})}a(X2,"CheckIcon");function Q2(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"currentColor",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"3"})})}a(Q2,"DotIcon");function Z2(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 4 4 4-4 4"})})}a(Z2,"ChevronRightIcon");function Gm({label:e,icon:t,shortcut:o,children:r,classNames:n,inset:i,indicator:s}){let l=r??e;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s||null,V(t)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m(n?.icon),children:t}):i?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"icon",className:"h-4 w-4 shrink-0"}):null,V(l)?jsxRuntime.jsx("span",{"data-slot":"label",className:m(n?.label),children:l}):null,V(o)?jsxRuntime.jsx("span",{"data-slot":"shortcut",className:m(n?.shortcut),children:o}):null]})}a(Gm,"renderItemContent");function xc({children:e,trigger:t,content:o,disabled:r=false,modal:n=true,dir:i,appearance:s,className:l,classNames:d,onOpenChange:c}){Lo(r,"disabled"),Lo(n,"modal"),Y2(i);let p=ci(),u=Pe(s);return jsxRuntime.jsxs(Tt__namespace.Root,{onOpenChange:c,modal:n,dir:i??p,children:[t?jsxRuntime.jsx(Ws,{disabled:r,appearance:u,className:m(d?.trigger,l),children:t}):null,o?jsxRuntime.jsx(zs,{appearance:u,className:d?.content,children:o}):null,e]})}a(xc,"BaseContextMenu");var Ws=ho.forwardRef(a(function({children:t,disabled:o=false,asChild:r=false,appearance:n,className:i,style:s,...l},d){Lo(o,"Trigger disabled"),Lo(r,"Trigger asChild");let c=Pe(n),p=ke(),u=Ne(c);return jsxRuntime.jsx(Tt__namespace.Trigger,{...p,...l,ref:d,asChild:r,disabled:o,"data-monkeys-component":"context-menu","data-slot":"trigger","data-disabled":o||void 0,className:m(!r&&u.slots.menuTrigger,o&&!r&&u.slots.menuItemDisabled,i),style:s,children:t})},"BaseContextMenuTrigger")),zs=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,...s},l){let d=Pe(o),c=ke(),p=Ne(d),u=Cr(),g=jsxRuntime.jsx(Tt__namespace.Content,{...c,...s,ref:l,"data-monkeys-component":"context-menu","data-slot":"content",className:m(p.slots.menuContent,n?.root,r),style:{...p.styles.menuContent,...i},children:t});return u.shouldPortal?jsxRuntime.jsx(Tt__namespace.Portal,{...u.radixPortalProps,children:g}):g},"BaseContextMenuContent")),vc=ho.forwardRef(a(function({children:t,appearance:o,className:r,style:n,...i},s){let l=Pe(o),d=ke(),c=Ne(l);return jsxRuntime.jsx(Tt__namespace.Label,{...d,...i,ref:s,"data-monkeys-component":"context-menu","data-slot":"label",className:m(c.slots.menuLabel,r),style:n,children:t})},"BaseContextMenuLabel")),wc=ho.forwardRef(a(function({appearance:t,className:o,style:r,...n},i){let s=Pe(t),l=ke(),d=Ne(s);return jsxRuntime.jsx(Tt__namespace.Separator,{...l,...n,ref:i,"data-monkeys-component":"context-menu","data-slot":"separator",className:m(d.slots.menuSeparator,o),style:r})},"BaseContextMenuSeparator")),na=ho.forwardRef(a(function({children:t,label:o,icon:r,shortcut:n,tone:i,disabled:s=false,inset:l=false,appearance:d,className:c,classNames:p,style:u,onSelect:g,...f},b){Lo(s,"Item disabled"),Lo(l,"Item inset"),yc(i);let x=i??"default",y=Pe(d),k=ke(),w=Ne(y);return jsxRuntime.jsx(Tt__namespace.Item,{...k,...f,ref:b,disabled:s,"data-monkeys-component":"context-menu","data-slot":"item","data-tone":x,"data-disabled":s||void 0,className:m(w.slots.menuItem,Da(w,i),s&&w.slots.menuItemDisabled,p?.root,c),style:{...w.styles.menuItem,...u},onSelect:v=>{if(s){v.preventDefault();return}g?.(v);},children:Gm({children:t,label:o,icon:r,shortcut:n,inset:l,classNames:{icon:m(w.slots.menuItemIcon,p?.icon),label:m(w.slots.menuItemLabel,p?.label),shortcut:m(w.slots.menuItemShortcut,p?.shortcut)}})})},"BaseContextMenuItem")),yx=ho.forwardRef(a(function({children:t,label:o,icon:r,shortcut:n,tone:i,disabled:s=false,inset:l=false,checked:d,onCheckedChange:c,appearance:p,className:u,classNames:g,style:f,onSelect:b,...x},y){if(Lo(s,"CheckboxItem disabled"),Lo(l,"CheckboxItem inset"),yc(i),d!==void 0&&d!=="indeterminate"&&typeof d!="boolean")throw new TypeError('BaseContextMenu CheckboxItem checked must be a boolean or "indeterminate".');let k=i??"default",w=Pe(p),v=ke(),h=Ne(w);return jsxRuntime.jsx(Tt__namespace.CheckboxItem,{...v,...x,ref:y,checked:d,disabled:s,"data-monkeys-component":"context-menu","data-slot":"checkbox-item","data-tone":k,"data-disabled":s||void 0,"data-checked":d==="indeterminate"?"mixed":d===void 0?void 0:String(d),onCheckedChange:S=>{s||c?.(S);},className:m(h.slots.menuItem,"pl-8",Da(h,i),s&&h.slots.menuItemDisabled,g?.root,u),style:{...h.styles.menuItem,...f},onSelect:S=>{if(s){S.preventDefault();return}b?.(S);},children:Gm({children:t,label:o,icon:r,shortcut:n,inset:l,classNames:{icon:m(h.slots.menuItemIcon,g?.icon),label:m(h.slots.menuItemLabel,g?.label),shortcut:m(h.slots.menuItemShortcut,g?.shortcut)},indicator:jsxRuntime.jsx(Tt__namespace.ItemIndicator,{"data-slot":"indicator",className:m(h.slots.menuCheckboxIndicator,g?.indicator),children:jsxRuntime.jsx(X2,{})})})})},"BaseContextMenuCheckboxItem"));function xx({children:e,value:t,onValueChange:o}){return jsxRuntime.jsx(Tt__namespace.RadioGroup,{value:t,onValueChange:o,children:e})}a(xx,"BaseContextMenuRadioGroup");var vx=ho.forwardRef(a(function({children:t,label:o,icon:r,shortcut:n,tone:i,disabled:s=false,inset:l=false,value:d,appearance:c,className:p,classNames:u,style:g,onSelect:f,...b},x){Lo(s,"RadioItem disabled"),Lo(l,"RadioItem inset"),yc(i);let y=i??"default",k=Pe(c),w=ke(),v=Ne(k);return jsxRuntime.jsx(Tt__namespace.RadioItem,{...w,...b,ref:x,value:d,disabled:s,"data-monkeys-component":"context-menu","data-slot":"radio-item","data-tone":y,"data-value":d,"data-disabled":s||void 0,className:m(v.slots.menuItem,"pl-8",Da(v,i),s&&v.slots.menuItemDisabled,u?.root,p),style:{...v.styles.menuItem,...g},onSelect:h=>{if(s){h.preventDefault();return}f?.(h);},children:Gm({children:t,label:o,icon:r,shortcut:n,inset:l,classNames:{icon:m(v.slots.menuItemIcon,u?.icon),label:m(v.slots.menuItemLabel,u?.label),shortcut:m(v.slots.menuItemShortcut,u?.shortcut)},indicator:jsxRuntime.jsx(Tt__namespace.ItemIndicator,{"data-slot":"indicator",className:m(v.slots.menuRadioIndicator,u?.indicator),children:jsxRuntime.jsx(Q2,{})})})})},"BaseContextMenuRadioItem"));function wx({children:e,open:t,defaultOpen:o,onOpenChange:r}){return t!==void 0&&Lo(t,"Sub open"),o!==void 0&&Lo(o,"Sub defaultOpen"),jsxRuntime.jsx(Tt__namespace.Sub,{open:t,defaultOpen:o,onOpenChange:r,children:e})}a(wx,"BaseContextMenuSub");var kx=ho.forwardRef(a(function({children:t,label:o,icon:r,tone:n,disabled:i=false,inset:s=false,appearance:l,className:d,classNames:c,style:p,...u},g){Lo(i,"SubTrigger disabled"),Lo(s,"SubTrigger inset"),yc(n);let f=n??"default",b=Pe(l),x=ke(),y=Ne(b),k=t??o;return jsxRuntime.jsxs(Tt__namespace.SubTrigger,{...x,...u,ref:g,disabled:i,"data-monkeys-component":"context-menu","data-slot":"sub-trigger","data-tone":f,"data-disabled":i||void 0,className:m(y.slots.menuSubTrigger,Da(y,n),i&&y.slots.menuItemDisabled,c?.root,d),style:{...y.styles.menuItem,...p},children:[V(r)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m(y.slots.menuItemIcon,c?.icon),children:r}):s?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"icon",className:"h-4 w-4 shrink-0"}):null,V(k)?jsxRuntime.jsx("span",{"data-slot":"label",className:m(y.slots.menuItemLabel,c?.label),children:k}):null,jsxRuntime.jsx("span",{"data-slot":"sub-indicator",className:m(y.slots.menuSubTriggerIcon,c?.shortcut,"rtl:rotate-180"),children:jsxRuntime.jsx(Z2,{})})]})},"BaseContextMenuSubTrigger")),Cx=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,sideOffset:s=6,...l},d){let c=Pe(o),p=ke(),u=Ne(c),g=Cr(),f=jsxRuntime.jsx(Tt__namespace.SubContent,{...p,...l,ref:d,sideOffset:s,"data-monkeys-component":"context-menu","data-slot":"sub-content",className:m(u.slots.menuSubContent,n?.root,r),style:{...u.styles.menuContent,...i},children:t});return g.shouldPortal?jsxRuntime.jsx(Tt__namespace.Portal,{...g.radixPortalProps,children:f}):f},"BaseContextMenuSubContent"));var eI={1:"grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-2 xl:grid-cols-3"};function kc({items:e,columns:t=1,appearance:o,className:r,classNames:n,style:i,children:s,...l}){let d=Ne(o);return jsxRuntime.jsxs("dl",{...l,className:m(d.slots.descriptionListRoot,eI[t],n?.root,r),style:{...d.styles.descriptionList,...i},children:[e?.map((c,p)=>jsxRuntime.jsxs("div",{className:m(d.slots.descriptionListItem,n?.item),children:[jsxRuntime.jsx("dt",{className:m(d.slots.descriptionListTerm,n?.term),children:c.term}),jsxRuntime.jsx("dd",{className:m(d.slots.descriptionListValue,n?.value),children:c.value})]},p)),s]})}a(kc,"BaseDescriptionList");var nI=["default","primary","success","warning","danger","muted"];function $r(e,t){if(typeof e!="boolean")throw new TypeError(`BaseDialog ${t} must be a boolean.`)}a($r,"validateBoolean");function aI(e){if(!nI.includes(e))throw new TypeError('BaseDialog triggerTone must be "default", "primary", "success", "warning", "danger", or "muted".')}a(aI,"validateTriggerTone");function iI({trigger:e,triggerLabel:t,triggerIcon:o,triggerTone:r,triggerDisabled:n,theme:i}){return V(e)?jsxRuntime.jsx("span",{role:"button",tabIndex:n?-1:0,"aria-disabled":n||void 0,onKeyDown:s=>{n||(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),s.currentTarget.click());},children:e}):V(t)?jsxRuntime.jsxs("button",{type:"button",disabled:n,"aria-label":typeof t=="string"&&t.trim()?t:void 0,className:m(i.slots.buttonBase,jn(i,r),n&&i.slots.buttonDisabled),style:{...i.styles.button,...n?i.styles.buttonDisabled:void 0},children:[V(o)?jsxRuntime.jsx("span",{"data-slot":"icon",className:i.slots.buttonIcon,children:o}):null,jsxRuntime.jsx("span",{"data-slot":"label",className:i.slots.buttonLabel,children:t})]}):null}a(iI,"renderTrigger");var aa=ho.forwardRef(a(function({open:t,defaultOpen:o=false,size:r="default",title:n,description:i,header:s,footer:l,trigger:d,triggerLabel:c,triggerIcon:p,triggerTone:u="default",triggerDisabled:g=false,closeLabel:f,closeOnEscape:b=true,closeOnOverlayClick:x=true,showCloseButton:y=true,keepMounted:k=false,trapFocus:w=true,restoreFocus:v=true,initialFocus:h="first-interactive",initialFocusRef:S,zIndex:T,portal:C=false,appearance:R,className:M,classNames:I,style:A,children:N,onOpenChange:D,id:E,...P},W){if(t!==void 0&&$r(t,"open"),$r(o,"defaultOpen"),!["default","viewport","page"].includes(r))throw new TypeError("BaseDialog size must be default, viewport or page.");if($r(g,"triggerDisabled"),$r(b,"closeOnEscape"),$r(x,"closeOnOverlayClick"),$r(y,"showCloseButton"),$r(k,"keepMounted"),$r(w,"trapFocus"),$r(v,"restoreFocus"),$r(C,"portal"),aI(u),h!=="first-interactive"&&h!=="container"&&h!=="explicit")throw new TypeError('BaseDialog initialFocus must be "first-interactive", "container", or "explicit".');if(T!==void 0&&!Number.isFinite(T))throw new TypeError("BaseDialog zIndex must be a finite number.");let H=Ye().dialog,B=Pe(R),L=ke(),F=f===void 0?H.close:f,_=Ne(B),$=Cr({disabled:!C}),[G,z]=ho.useState(o),re=ho.useRef(null),Z=ho.useRef(null),ae=t!==void 0,ee=ae?t:G,q=C&&$.shouldPortal?"portaled":"inline",U=V(n),X=V(i),O=V(s);if(y&&(typeof F!="string"||!F.trim()))throw new TypeError("BaseDialog closeLabel must be a non-empty string when showCloseButton is true.");let K=a(me=>{ae||z(me),D?.(me);},"handleOpenChange");ho.useEffect(()=>{if(!ee||!k)return;let me=re.current,ie=me?.ownerDocument,be=ie?.defaultView;if(!me||!ie||!be)return;Z.current=ie.activeElement instanceof be.HTMLElement?ie.activeElement:null;let He=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),We=a(()=>{let Q=me.querySelector(He);(h==="container"?me:h==="explicit"?S?.current??me:Q??me).focus();},"focusInitial"),Ke=be.requestAnimationFrame(We),ce=a(Q=>{if(Q.key==="Escape"&&b){Q.preventDefault(),Q.stopPropagation(),K(false);return}if(Q.key!=="Tab"||!w)return;let ge=Array.from(me.querySelectorAll(He));if(ge.length===0){Q.preventDefault(),me.focus();return}let we=ge[0],Ie=ge[ge.length-1];Q.shiftKey&&ie.activeElement===we?(Q.preventDefault(),Ie.focus()):!Q.shiftKey&&ie.activeElement===Ie&&(Q.preventDefault(),we.focus());},"handleKeyDown");return be.addEventListener("keydown",ce),()=>{be.cancelAnimationFrame(Ke),be.removeEventListener("keydown",ce),v&&Z.current?.isConnected&&Z.current.focus();}},[b,h,S,ee,k,v,w]);let ne=O||U||X?jsxRuntime.jsxs("div",{...L,"data-monkeys-component":"dialog","data-slot":"header","data-state":ee?"open":"closed","data-portal":q,className:m(_.slots.dialogHeader,I?.header,r==="page"&&"sr-only"),children:[O?s:null,U?jsxRuntime.jsx(xo__namespace.Title,{...L,"data-monkeys-component":"dialog","data-slot":"title","data-state":ee?"open":"closed","data-portal":q,className:O?"sr-only":m(_.slots.dialogTitle,I?.title),children:n}):null,X?jsxRuntime.jsx(xo__namespace.Description,{...L,"data-monkeys-component":"dialog","data-slot":"description","data-state":ee?"open":"closed","data-portal":q,className:O?"sr-only":m(_.slots.dialogDescription,I?.description),children:i}):null]}):null,fe=iI({trigger:d,triggerLabel:c,triggerIcon:p,triggerTone:u,triggerDisabled:g,theme:_}),he=ee||k?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(xo__namespace.Overlay,{forceMount:k||void 0,hidden:!ee,...L,"aria-hidden":"true","data-monkeys-component":"dialog","data-slot":"overlay","data-portal":q,className:m(_.slots.dialogOverlay,I?.overlay),style:{..._.styles.dialogOverlay,zIndex:T,...r==="page"?{background:"transparent",backdropFilter:"none"}:{}}}),jsxRuntime.jsx("div",{...L,hidden:!ee,"data-monkeys-component":"dialog","data-slot":"content","data-state":ee?"open":"closed","data-portal":q,className:m(_.slots.dialogContent,I?.content),style:{zIndex:T,...r==="page"?{padding:0,inset:0}:{}},children:jsxRuntime.jsx(xo__namespace.Content,{forceMount:k||void 0,...L,...U?{}:{"aria-labelledby":void 0},...X?{}:{"aria-describedby":void 0},asChild:true,onOpenAutoFocus:me=>{if(k){me.preventDefault();return}let ie=re.current;Z.current=ie?.ownerDocument.activeElement,(h==="container"||h==="explicit")&&(me.preventDefault(),(h==="explicit"?S?.current??ie:ie)?.focus({preventScroll:true}));},onCloseAutoFocus:me=>{if(k||!v){me.preventDefault();return}let ie=Z.current;ie?.isConnected&&(me.preventDefault(),ie.focus({preventScroll:true}));},onEscapeKeyDown:me=>{(k||!b)&&me.preventDefault();},onPointerDownOutside:me=>{x||me.preventDefault();},children:jsxRuntime.jsxs("div",{...L,ref:re,tabIndex:-1,"aria-modal":"true","data-monkeys-component":"dialog","data-slot":"panel","data-portal":q,className:m(_.slots.dialogPanel,I?.panel),"data-presentation":r,style:{..._.styles.dialogPanel,...r!=="default"?{width:r==="page"?"100vw":"96vw",maxWidth:"none",height:r==="page"?"100dvh":"94dvh",maxHeight:r==="page"?"100dvh":"94dvh",display:"flex",flexDirection:"column"}:{},...r==="page"?{borderRadius:0,border:0,boxShadow:"none",margin:0,animation:"none"}:{}},children:[ne,y?jsxRuntime.jsx(xo__namespace.Close,{asChild:true,children:jsxRuntime.jsx("button",{...L,type:"button","aria-label":F,title:F,"data-monkeys-component":"dialog","data-slot":"close","data-state":ee?"open":"closed","data-portal":q,className:m(_.slots.dialogClose,I?.close),children:"\xD7"})}):null,jsxRuntime.jsx("div",{...L,"data-monkeys-component":"dialog","data-slot":"body","data-state":ee?"open":"closed","data-portal":q,className:m(_.slots.dialogBody,I?.body),style:r!=="default"?{minHeight:0,flex:"1 1 0%",overflow:"hidden",padding:0}:void 0,children:N}),V(l)?jsxRuntime.jsx("div",{...L,"data-monkeys-component":"dialog","data-slot":"footer","data-state":ee?"open":"closed","data-portal":q,className:m(_.slots.dialogFooter,I?.footer),children:l}):null]})})})]}):null;return jsxRuntime.jsx("div",{...L,...P,ref:W,id:E,"data-monkeys-component":"dialog","data-slot":"root","data-state":ee?"open":"closed","data-portal":q,className:m(_.slots.dialogRoot,I?.root,M),style:A,children:jsxRuntime.jsxs(xo__namespace.Root,{open:ee,onOpenChange:K,modal:!k&&w,children:[fe?jsxRuntime.jsx(xo__namespace.Trigger,{...L,asChild:true,disabled:g,"data-monkeys-component":"dialog","data-slot":"trigger","data-portal":q,"data-tone":u,"data-disabled":g||void 0,className:m(_.slots.dialogTrigger,g&&_.slots.dialogTriggerDisabled,I?.trigger),children:fe}):null,C&&$.shouldPortal?jsxRuntime.jsx(Cs,{children:jsxRuntime.jsx(xo__namespace.Portal,{...$.radixPortalProps,forceMount:k||void 0,children:he})}):jsxRuntime.jsx(Cs,{children:he})]})})},"BaseDialog"));var Rx=ho.forwardRef(a(function({orientation:t="horizontal",label:o,appearance:r,className:n,classNames:i,style:s,...l},d){if(t!=="horizontal"&&t!=="vertical")throw new TypeError('BaseDivider orientation must be "horizontal" or "vertical".');let c=Pe(r),p=ke(),u=Ne(c),g=t==="vertical",f=V(o)&&!g,b={...u.styles.divider,...s};return f?jsxRuntime.jsxs("div",{...p,...l,ref:d,role:"separator","aria-orientation":t,"data-monkeys-component":"divider","data-slot":"root","data-orientation":t,"data-state":"labeled",className:m("flex min-w-0 items-center",i?.root,n),style:b,children:[jsxRuntime.jsx("div",{"data-slot":"line","data-orientation":t,className:m("min-w-0 flex-1 border-t",u.slots.dividerRoot,i?.line)}),jsxRuntime.jsx("span",{"data-slot":"label","data-orientation":t,className:m(u.slots.dividerLabel,i?.label),children:o}),jsxRuntime.jsx("div",{"data-slot":"line","data-orientation":t,className:m("min-w-0 flex-1 border-t",u.slots.dividerRoot,i?.line)})]}):jsxRuntime.jsx("div",{...p,...l,ref:d,role:"separator","aria-orientation":t,"data-monkeys-component":"divider","data-slot":"root","data-orientation":t,"data-state":"unlabeled",className:m(u.slots.dividerRoot,g?"min-h-full self-stretch border-l":"w-full border-t",i?.root,n),style:b})},"BaseDivider"));function Ii(e,t){if(typeof e!="boolean")throw new TypeError(`BaseDropdownMenu ${t} must be a boolean.`)}a(Ii,"validateBoolean");function pI(e){if(e!=="bottom-start"&&e!=="bottom-end"&&e!=="top-start"&&e!=="top-end")throw new TypeError('BaseDropdownMenu placement must be "bottom-start", "bottom-end", "top-start", or "top-end".')}a(pI,"validatePlacement");function mI(e){if(e!==void 0&&e!=="ltr"&&e!=="rtl")throw new TypeError('BaseDropdownMenu dir must be "ltr" or "rtl".')}a(mI,"validateDirection");function fI(e){if(!Array.isArray(e))throw new TypeError("BaseDropdownMenu items must be an array.");let t=new Set;for(let[o,r]of e.entries()){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError(`BaseDropdownMenu items[${o}] must be an object.`);if(typeof r.value!="string"||!r.value.trim())throw new TypeError(`BaseDropdownMenu items[${o}].value must be a non-empty string.`);if(t.has(r.value))throw new TypeError(`BaseDropdownMenu item value "${r.value}" must be unique.`);t.add(r.value);for(let n of ["disabled","danger","separatorBefore"]){let i=r[n];i!==void 0&&Ii(i,`items[${o}].${n}`);}if(r.onSelect!==void 0&&typeof r.onSelect!="function")throw new TypeError(`BaseDropdownMenu items[${o}].onSelect must be a function.`)}}a(fI,"validateItems");function bI(e){let[t,o]=e.split("-");return {side:t,align:o}}a(bI,"resolvePlacement");function gI({trigger:e,triggerLabel:t,triggerIcon:o,disabled:r,theme:n}){return V(e)?jsxRuntime.jsx("span",{role:"button",tabIndex:r?-1:0,"aria-disabled":r||void 0,children:e}):jsxRuntime.jsxs("button",{type:"button",disabled:r,"aria-label":typeof t=="string"&&t.trim()?t:void 0,className:m(n.slots.buttonBase,jn(n),r&&n.slots.buttonDisabled),style:{...n.styles.button,...r?n.styles.buttonDisabled:void 0},children:[V(o)?jsxRuntime.jsx("span",{"data-slot":"icon",className:n.slots.buttonIcon,children:o}):null,V(t)?jsxRuntime.jsx("span",{"data-slot":"label",className:n.slots.buttonLabel,children:t}):null]})}a(gI,"renderTrigger");var Mx=ho.forwardRef(a(function({items:t=[],label:o,trigger:r,triggerLabel:n,triggerIcon:i,disabled:s=false,open:l,defaultOpen:d=false,placement:c="bottom-start",closeOnSelect:p=true,portal:u=false,dir:g,appearance:f,className:b,classNames:x,style:y,children:k,onOpenChange:w,onSelect:v,...h},S){l!==void 0&&Ii(l,"open"),Ii(d,"defaultOpen"),Ii(s,"disabled"),Ii(p,"closeOnSelect"),Ii(u,"portal"),pI(c),mI(g),fI(t);let T=ci(),C=g??T,R=Pe(f),M=ke(),I=Ye().dropdownMenu,A=Ne(R),N=Cr({disabled:!u}),[D,E]=ho.useState(d),P=l!==void 0,W=P?l:D,H=n===void 0?I.actions:n,B=u&&N.shouldPortal?"portaled":"inline",{side:L,align:F}=bI(c);if(n===void 0&&(typeof I.actions!="string"||!I.actions.trim()))throw new TypeError("BaseDropdownMenu locale actions message must be a non-empty string.");let _=a(G=>{s||(P||E(G),w?.(G));},"handleOpenChange"),$=jsxRuntime.jsxs(Bt__namespace.Content,{...M,side:L,align:F,sideOffset:6,collisionPadding:8,"data-monkeys-component":"dropdown-menu","data-slot":"content","data-placement":c,"data-portal":B,"data-tone":"default","data-disabled":s||void 0,className:m(A.slots.dropdownMenu,x?.menu),style:A.styles.dropdownMenu,children:[V(o)?jsxRuntime.jsx(Bt__namespace.Label,{...M,"data-monkeys-component":"dropdown-menu","data-slot":"label","data-state":"static",className:m(A.slots.dropdownLabel,x?.label),children:o}):null,t.map(G=>{let z=G.disabled??false,re=G.danger?"danger":"default";return jsxRuntime.jsxs("div",{"data-monkeys-component":"dropdown-menu","data-slot":"item-wrapper",children:[G.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{...M,"data-monkeys-component":"dropdown-menu","data-slot":"separator","data-state":"static",className:m(A.slots.dropdownSeparator,x?.separator)}):null,jsxRuntime.jsx(Bt__namespace.Item,{asChild:true,disabled:z,onSelect:Z=>{G.onSelect?.(G),v?.(G),p||Z.preventDefault();},children:jsxRuntime.jsxs("button",{...M,type:"button",disabled:z,"data-monkeys-component":"dropdown-menu","data-slot":"item","data-state":z?"disabled":"enabled","data-value":G.value,"data-placement":c,"data-portal":B,"data-tone":re,"data-disabled":z||void 0,className:m(A.slots.dropdownItem,G.danger&&A.slots.dropdownItemDanger,z&&A.slots.dropdownItemDisabled,x?.item),style:A.styles.dropdownItem,children:[V(G.icon)?jsxRuntime.jsx("span",{"data-slot":"item-icon",className:m(A.slots.dropdownItemIcon,x?.itemIcon),children:G.icon}):null,jsxRuntime.jsxs("span",{"data-slot":"item-content",className:m(A.slots.dropdownItemContent,x?.itemContent),children:[jsxRuntime.jsx("span",{"data-slot":"item-label",className:m(A.slots.dropdownItemLabel,x?.itemLabel),children:G.label}),V(G.description)?jsxRuntime.jsx("span",{"data-slot":"item-description",className:m(A.slots.dropdownItemDescription,x?.itemDescription),children:G.description}):null]}),V(G.shortcut)?jsxRuntime.jsx("span",{"data-slot":"item-shortcut",className:m(A.slots.dropdownItemShortcut,x?.itemShortcut),children:G.shortcut}):null]})})]},G.value)}),k]});return jsxRuntime.jsx("div",{...M,...h,ref:S,dir:C,"data-monkeys-component":"dropdown-menu","data-slot":"root","data-state":W?"open":"closed","data-placement":c,"data-portal":B,"data-tone":"default","data-disabled":s||void 0,className:m(A.slots.dropdownRoot,x?.root,b),style:y,children:jsxRuntime.jsxs(Bt__namespace.Root,{open:W,onOpenChange:_,dir:C,modal:false,children:[jsxRuntime.jsx(Bt__namespace.Trigger,{...M,asChild:true,disabled:s,"data-monkeys-component":"dropdown-menu","data-slot":"trigger","data-placement":c,"data-portal":B,"data-tone":"default","data-disabled":s||void 0,className:m(A.slots.dropdownTrigger,s&&A.slots.dropdownTriggerDisabled,x?.trigger),children:gI({trigger:r,triggerLabel:H,triggerIcon:i,disabled:s,theme:A})}),u&&N.shouldPortal?jsxRuntime.jsx(Bt__namespace.Portal,{...N.radixPortalProps,children:$}):$]})})},"BaseDropdownMenu"));function yI(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-6 w-6",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",children:[jsxRuntime.jsx("rect",{width:"16",height:"12",x:"4",y:"6",rx:"2"}),jsxRuntime.jsx("path",{d:"M8 10h8"}),jsxRuntime.jsx("path",{d:"M8 14h5"})]})}a(yI,"DefaultEmptyIcon");var Pi=ho.forwardRef(a(function({icon:t=jsxRuntime.jsx(yI,{}),title:o,description:r,actions:n,variant:i,appearance:s,className:l,classNames:d,style:c,...p},u){let g=Pe(s),f=ke(),b=Or(),x=i??b.empty?.variant??"default",y=b.density==="compact"?"min-h-0 px-3 py-3":b.density==="comfortable"?"min-h-56 px-8 py-12":void 0,k=Ne(g);return jsxRuntime.jsxs("div",{...f,...p,ref:u,"data-monkeys-component":"empty-state","data-slot":"root","data-state":"empty","data-variant":x,"data-density":b.density,className:m(k.slots.stateRoot,y,x==="compact"&&"min-h-0 gap-1 py-3",d?.root,l),style:{...k.styles.stateRoot,...c},children:[V(t)?jsxRuntime.jsx("div",{"data-slot":"icon","data-state":"empty",className:m(k.slots.stateIcon,d?.icon),style:k.styles.stateIcon,children:t}):null,V(o)?jsxRuntime.jsx("div",{"data-slot":"title","data-state":"empty",className:m(k.slots.stateTitle,d?.title),children:o}):null,V(r)?jsxRuntime.jsx("div",{"data-slot":"description","data-state":"empty",className:m(k.slots.stateDescription,d?.description),children:r}):null,V(n)?jsxRuntime.jsx("div",{"data-slot":"actions","data-state":"empty",className:m(k.slots.stateActions,d?.actions),children:n}):null]})},"BaseEmptyState"));var Dx=ho.createContext(false);function Px({children:e}){let{locale:t}=Co();return e==null||e===""?null:jsxRuntime.jsx(To,{content:e,portal:true,children:jsxRuntime.jsx("button",{type:"button","aria-label":typeof e=="string"?e:t.startsWith("zh")?"\u8BF4\u660E":"Help","data-form-help":true,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:jsxRuntime.jsx(lucideReact.HelpCircle,{className:"h-4 w-4","aria-hidden":"true"})})})}a(Px,"BaseFormHelp");function NI(...e){let t=e.flatMap(o=>o?.split(/\s+/).filter(Boolean)??[]);return t.length?Array.from(new Set(t)).join(" "):void 0}a(NI,"mergeAriaIds");function Um(e,t,o){if(e===void 0)return t;if(!e.trim()||/\s/.test(e))throw new TypeError(`BaseField ${o} must be a non-empty ID without whitespace.`);return e}a(Um,"resolveOptionalId");var jr=ho.forwardRef(a(function({label:t,description:o,message:r,error:n,required:i=false,disabled:s=false,htmlFor:l,descriptionId:d,messageId:c,errorId:p,validate:u,validationMode:g="onBlur",children:f,appearance:b,className:x,classNames:y,style:k,...w},v){for(let[K,ne]of [["required",i],["disabled",s]])if(typeof ne!="boolean")throw new TypeError(`BaseField ${K} must be a boolean.`);if(u!==void 0&&typeof u!="function")throw new TypeError("BaseField validate must be a function.");if(g!=="onBlur"&&g!=="onChange")throw new TypeError('BaseField validationMode must be "onBlur" or "onChange".');let h=ho.useContext(Dx)?"tooltip":"inline",S=ho.useId(),T=Pe(b),C=ke(),R=Ne(T),M=V(o),[I,A]=ho.useState(null),N=ho.useRef(new Set),D=ho.useRef(u),E=ho.useRef(g),P=ho.useRef(s);D.current=u,E.current=g,P.current=s;let W=u!==void 0;ho.useEffect(()=>{(!W||s)&&A(null);},[s,W]),ho.useEffect(()=>{if(W&&N.current.size!==1)throw new TypeError("BaseField with validate must contain exactly one compatible Base control.")},[W]);let H=ho.useCallback(K=>{let ne=N.current;if(D.current!==void 0&&!ne.has(K)&&ne.size>0)throw new TypeError("BaseField with validate supports exactly one compatible Base control. Use BaseFieldset for control groups.");return ne.add(K),()=>{ne.delete(K);}},[]),B=ho.useCallback((K,ne)=>{let fe=D.current;if(P.current||fe===void 0||E.current!==K)return;let he=Wy(fe(ne));if(he===null){A(null);return}A(he);},[]),L=ho.useCallback(K=>B("onBlur",K),[B]),F=ho.useCallback(K=>B("onChange",K),[B]),$=V(n)?n:I,G=V($),z=!G&&V(r),re=G?$:r,Z=l??`${S}-control`,ae=M?Um(d,`${S}-description`,"descriptionId"):void 0,ee=z?Um(c,`${S}-message`,"messageId"):void 0,q=G?Um(p,`${S}-error`,"errorId"):void 0,U={id:Z,"aria-describedby":NI(ae,ee),"aria-errormessage":q,"aria-invalid":G?true:void 0,"aria-required":i?true:void 0,required:i||void 0,disabled:s||void 0},X=typeof f=="function"?f(U):f,O=ho.useMemo(()=>({invalid:G,registerControl:H,notifyBlur:L,notifyChange:F}),[G,L,F,H]);return jsxRuntime.jsxs("div",{...C,...w,ref:v,"aria-disabled":s||void 0,"data-monkeys-component":"field","data-slot":"root","data-required":i||void 0,"data-disabled":s||void 0,"data-invalid":G||void 0,className:m(R.slots.fieldRoot,s&&R.slots.controlDisabled,y?.root,x),style:{...R.styles.field,...k},children:[V(t)?jsxRuntime.jsxs("div",{"data-slot":"label-row",className:m(R.slots.fieldLabelRow,y?.labelRow),children:[jsxRuntime.jsxs("label",{htmlFor:typeof f=="function"?Z:l,"data-slot":"label",className:m(R.slots.fieldLabel,y?.label),children:[t,i?jsxRuntime.jsxs("span",{"aria-hidden":"true","data-slot":"required-indicator",className:m(R.slots.fieldRequired,y?.required),children:[" ","*"]}):null]}),h==="tooltip"&&M?jsxRuntime.jsx(Px,{children:o}):null]}):null,M?jsxRuntime.jsx("div",{id:ae,"data-slot":"description",className:m(R.slots.fieldDescription,y?.description,h==="tooltip"&&"sr-only"),children:o}):null,V(X)?jsxRuntime.jsx("div",{"data-slot":"control",className:m(R.slots.fieldControl,y?.control),style:R.styles.fieldControl,children:jsxRuntime.jsx(Pm.Provider,{value:O,children:X})}):null,V(re)?jsxRuntime.jsx("div",{id:G?q:ee,role:G?"alert":void 0,"data-slot":G?"error":"message",className:m(R.slots.fieldMessage,G&&"text-destructive-text",y?.message),children:re}):null]})},"BaseField"));function Ax(...e){let t=e.flatMap(o=>o?.split(/\s+/).filter(Boolean)??[]);return t.length?Array.from(new Set(t)).join(" "):void 0}a(Ax,"mergeAriaIds");function Bx(e,t,o){if(e===void 0)return t;if(!e.trim()||/\s/.test(e))throw new TypeError(`BaseFieldset ${o} must be a non-empty ID without whitespace.`);return e}a(Bx,"resolveOptionalId");var II=ho.forwardRef(a(function({children:t,legend:o,description:r,descriptionId:n,error:i,errorId:s,disabled:l,appearance:d,className:c,classNames:p,style:u,"aria-describedby":g,"aria-errormessage":f,...b},x){let y=ho.useId(),k=Pe(d),w=ke(),v=Ne(k);if(!V(o)||typeof o=="string"&&!o.trim())throw new TypeError("BaseFieldset legend must contain an accessible name.");if(l!==void 0&&typeof l!="boolean")throw new TypeError("BaseFieldset disabled must be a boolean.");let h=V(r),S=V(i),T=h?Bx(n,`${y}-description`,"descriptionId"):void 0,C=S?Bx(s,`${y}-error`,"errorId"):void 0;return jsxRuntime.jsxs("fieldset",{...w,...b,ref:x,disabled:l,"aria-describedby":Ax(g,T),"aria-errormessage":Ax(f,C),"data-monkeys-component":"fieldset","data-slot":"root",className:m(v.slots.fieldsetRoot,p?.root,c),style:{...v.styles.fieldset,...u},children:[jsxRuntime.jsx("legend",{"data-slot":"legend",className:m(v.slots.fieldsetLegend,p?.legend),style:v.styles.fieldsetLegend,children:o}),h?jsxRuntime.jsx("div",{id:T,"data-slot":"description",className:m(v.slots.fieldsetDescription,p?.description),style:v.styles.fieldsetDescription,children:r}):null,S?jsxRuntime.jsx("div",{id:C,"data-slot":"error",className:m(v.slots.fieldsetError,p?.error),style:v.styles.fieldsetError,children:i}):null,jsxRuntime.jsx("div",{"data-slot":"content",className:m(v.slots.fieldsetContent,p?.content),style:v.styles.fieldsetContent,children:t})]})},"BaseFieldset"));function AI(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=6}a(AI,"isHeadingLevel");var BI=ho.forwardRef(a(function({level:t=2,children:o,size:r="lg",tone:n="default",appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u);if(!AI(t))throw new RangeError("BaseHeading level must be an integer from 1 to 6.");return ho.createElement(`h${t}`,{...g,...c,ref:p,"data-monkeys-component":"heading","data-slot":"root","data-level":t,"data-size":r,"data-tone":n,className:m(f.slots.headingRoot,Hh(f,r),gi(f,n),l?.root,s),style:{...f.styles.heading,...d}},o)},"BaseHeading"));var WI=ho.forwardRef(a(function({children:t,columns:o=1,gap:r,align:n="stretch",justify:i="start",appearance:s,className:l,classNames:d,style:c,...p},u){let g=Go(),f=Pe(s),b=ke(),x=Ne(f),y=r===void 0?void 0:nr("BaseGrid","gap",r);return jsxRuntime.jsx("div",{...b,...p,ref:u,"data-monkeys-component":"grid","data-slot":"root","data-align":n,"data-justify":i,"data-columns":o,className:m(x.slots.gridRoot,g>0&&r===void 0&&"gap-[var(--monkeys-bento-gap)]",f?.slots?.gridRoot,d?.root,l),style:{...x.styles.grid,gridTemplateColumns:Uh(o),gap:y??x.styles.grid?.gap,alignItems:hi("BaseGrid",n),justifyContent:yi("BaseGrid",i),...c},children:t})},"BaseGrid"));var FI={sm:"h-8 px-2.5 text-xs",md:"h-9 px-3 text-sm",lg:"h-10 px-3.5 text-base"},Mc=ho.forwardRef(a(function({icon:t,trailing:o,invalid:r=false,disabled:n=false,readOnly:i=false,controlSize:s,appearance:l,className:d,classNames:c,style:p,"aria-invalid":u,onBlur:g,onChange:f,...b},x){for(let[S,T]of [["invalid",r],["disabled",n],["readOnly",i]])if(typeof T!="boolean")throw new TypeError(`BaseInput ${S} must be a boolean.`);if(s!==void 0&&s!=="sm"&&s!=="md"&&s!=="lg")throw new TypeError('BaseInput controlSize must be "sm", "md", or "lg".');let y=Pe(l),k=ke(),w=Ne(y),v=Qn(),h=r||v.invalid;return jsxRuntime.jsxs("div",{...k,"data-monkeys-component":"input","data-slot":"root","data-size":s,"data-invalid":h||void 0,"data-disabled":n||void 0,"data-readonly":i||void 0,className:m(w.slots.controlWrapper,h&&w.slots.controlInvalid,n&&w.slots.controlDisabled,i&&w.slots.controlReadOnly,c?.root,d),style:{...w.styles.control,...h?w.styles.controlInvalid:void 0,...n?w.styles.controlDisabled:void 0,...p},children:[V(t)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m(w.slots.controlIcon,c?.icon),children:t}):null,jsxRuntime.jsx("input",{...b,ref:x,disabled:n,readOnly:i,"aria-invalid":u??(h||void 0),"data-slot":"control","data-size":s,"data-invalid":h||void 0,"data-disabled":n||void 0,"data-readonly":i||void 0,className:m(w.slots.controlBase,w.slots.controlInput,s&&FI[s],c?.control),onBlur:S=>{g?.(S),v.notifyBlur(S.currentTarget.value);},onChange:S=>{f?.(S),v.notifyChange(S.currentTarget.value);}}),V(o)?jsxRuntime.jsx("span",{"data-slot":"trailing",className:m(w.slots.controlTrailing,c?.trailing),children:o}):null]})},"BaseInput"));var _I=ho.forwardRef(a(function({children:t,startElement:o,endElement:r,startAddon:n,endAddon:i,invalid:s=false,disabled:l=false,appearance:d,className:c,classNames:p,style:u,...g},f){for(let[k,w]of [["invalid",s],["disabled",l]])if(typeof w!="boolean")throw new TypeError(`BaseInputGroup ${k} must be a boolean.`);let b=Pe(d),x=ke(),y=Ne(b);return jsxRuntime.jsxs("div",{...x,...g,ref:f,"data-monkeys-component":"input-group","data-slot":"root","data-invalid":s||void 0,"data-disabled":l||void 0,className:m(y.slots.inputGroupRoot,s&&y.slots.inputGroupInvalid,l&&y.slots.inputGroupDisabled,p?.root,c),style:{...y.styles.inputGroup,...s?y.styles.inputGroupInvalid:void 0,...l?y.styles.inputGroupDisabled:void 0,...u},children:[V(n)?jsxRuntime.jsx("span",{"data-slot":"start-addon","data-placement":"start",className:m(y.slots.inputGroupStartAddon,p?.startAddon),style:y.styles.inputGroupAddon,children:n}):null,V(o)?jsxRuntime.jsx("span",{"data-slot":"start-element","data-placement":"start",className:m(y.slots.inputGroupStartElement,p?.startElement),style:y.styles.inputGroupElement,children:o}):null,jsxRuntime.jsx("div",{"data-slot":"content",className:m(y.slots.inputGroupContent,p?.content),style:y.styles.inputGroupContent,children:t}),V(r)?jsxRuntime.jsx("span",{"data-slot":"end-element","data-placement":"end",className:m(y.slots.inputGroupEndElement,p?.endElement),style:y.styles.inputGroupElement,children:r}):null,V(i)?jsxRuntime.jsx("span",{"data-slot":"end-addon","data-placement":"end",className:m(y.slots.inputGroupEndAddon,p?.endAddon),style:y.styles.inputGroupAddon,children:i}):null]})},"BaseInputGroup"));var jI=ho.forwardRef(a(function({children:t,gap:o,align:r="center",justify:n="start",wrap:i=true,appearance:s,className:l,classNames:d,style:c,...p},u){let g=Go(),f=Pe(s),b=ke(),x=Ne(f);if(typeof i!="boolean")throw new TypeError("BaseInline wrap must be a boolean.");let y=o===void 0?void 0:nr("BaseInline","gap",o);return jsxRuntime.jsx("div",{...b,...p,ref:u,"data-monkeys-component":"inline","data-slot":"root","data-align":r,"data-justify":n,"data-wrap":i?"wrap":"nowrap",className:m(x.slots.inlineRoot,g>0&&o===void 0&&"gap-[var(--monkeys-bento-gap)]",f?.slots?.inlineRoot,d?.root,l),style:{...x.styles.inline,gap:y??x.styles.inline?.gap,alignItems:hi("BaseInline",r),justifyContent:yi("BaseInline",n),flexWrap:i?"wrap":"nowrap",...c},children:t})},"BaseInline"));var qI=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,...s},l){let d=Pe(o),c=ke(),p=Ne(d);return jsxRuntime.jsx("kbd",{...c,...s,ref:l,"data-monkeys-component":"kbd","data-slot":"root",className:m(p.slots.kbdRoot,n?.root,r),style:{...p.styles.kbd,...i},children:t})},"BaseKbd"));var ZI=50,JI=20,eD=80,tD=2.5;function oD(e,t){typeof e=="function"?e(t):e&&(e.current=t);}a(oD,"assignRef");function Wa(e,t){if(typeof t!="boolean")throw new TypeError(`BaseLayout ${e} must be a boolean.`)}a(Wa,"assertBoolean");function Ox(e){if(e!=="horizontal"&&e!=="vertical")throw new TypeError('BaseLayout orientation must be "horizontal" or "vertical".')}a(Ox,"assertOrientation");function Dc(e,t){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error("BaseLayout size and gap props must be finite, non-negative numbers.");return `${e}px`}if(typeof e=="string"){if(e.trim().length===0)throw new TypeError("BaseLayout size and gap string props must not be empty.");return e}return t}a(Dc,"toCssSize");function Ei(e,t){if(!Number.isFinite(t))throw new Error(`BaseLayoutSplit ${e} must be a finite number.`);if(t<0||t>100)throw new Error(`BaseLayoutSplit ${e} must be between 0 and 100.`);return t}a(Ei,"assertPercent");function Ym(e,t,o){return Math.min(Math.max(e,t),o)}a(Ym,"clamp");function rD({minSize:e=JI,maxSize:t=eD,keyboardStep:o=tD}){let r=Ei("minSize",e),n=Ei("maxSize",t);if(r>n)throw new Error("BaseLayoutSplit minSize cannot be greater than maxSize.");if(!Number.isFinite(o)||o<=0)throw new Error("BaseLayoutSplit keyboardStep must be a finite positive number.");return {min:r,max:n,keyboardStep:o}}a(rD,"resolveSplitBounds");function Wx(e,t,o,r,n){return Ym(Ei(e,t??o),r,n)}a(Wx,"resolveSplitSize");function nD(e){return e==="horizontal"?"vertical":"horizontal"}a(nD,"getSeparatorOrientation");function zx(e){let t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).direction==="rtl":e.closest('[dir="rtl"]')!==null}a(zx,"isRtl");function aD(e,t){if(e.setPointerCapture)try{e.setPointerCapture(t);}catch(o){let r=e.ownerDocument.defaultView?.DOMException;if(r&&o instanceof r&&o.name==="NotFoundError")return;throw o}}a(aD,"setPointerCaptureIfAvailable");var Fx=ho.forwardRef(a(function({header:t,sidebar:o,aside:r,sidebarLabel:n,asideLabel:i,footer:s,children:l,sidebarSize:d,asideSize:c,gap:p,fullHeight:u=false,appearance:g,className:f,classNames:b,style:x,...y},k){Wa("fullHeight",u);let w=Pe(g),v=ke(),h=Ne(w),S=V(t),T=V(o),C=V(r),R=V(s),M=[T?"var(--base-layout-sidebar-size)":void 0,"minmax(0, 1fr)",C?"var(--base-layout-aside-size)":void 0].filter(Boolean).join(" "),I=[S?"auto":void 0,"minmax(0, 1fr)",R?"auto":void 0].filter(Boolean).join(" "),A=p!==void 0?Dc(p,"0px"):void 0,N={...h.styles.layout,"--base-layout-sidebar-size":Dc(d,"16rem"),"--base-layout-aside-size":Dc(c,"20rem"),gridTemplateRows:I,...A!==void 0?{gap:A}:{},...x},D={...h.styles.layoutBody,gridTemplateColumns:M,...A!==void 0?{gap:A}:{}};return jsxRuntime.jsxs("div",{...v,...y,ref:k,"data-monkeys-component":"layout","data-slot":"root","data-full-height":u?"true":"false",className:m(h.slots.layoutRoot,u&&h.slots.layoutRootFull,b?.root,f),style:N,children:[S?jsxRuntime.jsx("div",{"data-slot":"header",className:m(h.slots.layoutHeader,b?.header),style:h.styles.layoutHeader,children:t}):null,jsxRuntime.jsxs("div",{"data-slot":"body",className:m(h.slots.layoutBody,b?.body),style:D,children:[T?jsxRuntime.jsx("aside",{"aria-label":n,"data-slot":"sidebar",className:m(h.slots.layoutSidebar,b?.sidebar),style:h.styles.layoutSidebar,children:o}):null,jsxRuntime.jsx("main",{"data-slot":"main",className:m(h.slots.layoutMain,b?.main),style:h.styles.layoutMain,children:l}),C?jsxRuntime.jsx("aside",{"aria-label":i,"data-slot":"aside",className:m(h.slots.layoutAside,b?.aside),style:h.styles.layoutAside,children:r}):null]}),R?jsxRuntime.jsx("div",{"data-slot":"footer",className:m(h.slots.layoutFooter,b?.footer),style:h.styles.layoutFooter,children:s}):null]})},"BaseLayout")),Hx=ho.forwardRef(a(function({as:t="div",scrollable:o=false,bordered:r=true,surface:n="default",children:i,appearance:s,className:l,classNames:d,style:c,...p},u){Wa("scrollable",o),Wa("bordered",r);let g=Pe(s),f=ke(),b=Ne(g);return jsxRuntime.jsx(t,{...f,...p,ref:u,"data-monkeys-component":"layout-pane","data-slot":"root","data-scrollable":o?"true":"false","data-surface":n,className:m(b.slots.layoutPane,o&&b.slots.layoutPaneScrollable,r&&b.slots.layoutPaneBordered,n==="muted"&&b.slots.layoutPaneMuted,n==="soft"&&b.slots.layoutPaneSoft,n==="transparent"&&b.slots.layoutPaneTransparent,d?.root,l),style:{...b.styles.layoutPane,...c},children:i})},"BaseLayoutPane")),Xm=ho.forwardRef(a(function({orientation:t="horizontal",resizable:o=false,disabled:r=false,size:n,minSize:i,maxSize:s,label:l,appearance:d,className:c,classNames:p,style:u,tabIndex:g,...f},b){Ox(t),Wa("resizable",o),Wa("disabled",r);let x=i===void 0?void 0:Ei("minSize",i),y=s===void 0?void 0:Ei("maxSize",s);if(x!==void 0&&y!==void 0&&x>y)throw new Error("BaseLayoutSplit minSize cannot be greater than maxSize.");let k=n===void 0?void 0:Ym(Ei("size",n),x??0,y??100),w=Pe(d),v=ke(),h=Ye().layout,S=Ne(w),T=l??h.resizePanels;if(o&&(typeof T!="string"||T.trim().length===0))throw new TypeError("BaseLayoutResizeHandle label must be a non-empty string.");let C=o&&!r,R=nD(t);return jsxRuntime.jsx("div",{...v,...f,ref:b,"data-monkeys-component":"layout-resize-handle","data-slot":"handle","data-orientation":t,"data-state":C?"enabled":r?"disabled":"static",role:o?"separator":void 0,"aria-label":o?T:void 0,"aria-orientation":o?R:void 0,"aria-valuemin":o?x:void 0,"aria-valuemax":o?y:void 0,"aria-valuenow":o?k:void 0,"aria-disabled":o&&r?true:void 0,tabIndex:C?g??0:void 0,className:m(S.slots.layoutResizeHandle,t==="horizontal"?S.slots.layoutResizeHandleHorizontal:S.slots.layoutResizeHandleVertical,!C&&S.slots.layoutResizeHandleDisabled,p?.root,c),style:{...S.styles.layoutResizeHandle,...u},children:jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator",className:m(S.slots.layoutResizeHandleIndicator,t==="horizontal"?"h-8 w-px":"h-px w-8",p?.indicator)})})},"BaseLayoutResizeHandle")),Vx=ho.forwardRef(a(function({orientation:t="horizontal",primary:o,secondary:r,children:n,resizable:i=false,disabled:s=false,size:l,defaultSize:d,minSize:c,maxSize:p,gap:u,keyboardStep:g,resizeLabel:f,appearance:b,className:x,classNames:y,style:k,onSizeChange:w,...v},h){Ox(t),Wa("resizable",i),Wa("disabled",s);let S=Pe(b),T=ke(),C=Ne(S),R=rD({minSize:c,maxSize:p,keyboardStep:g}),M=Wx("defaultSize",d,ZI,R.min,R.max),[I,A]=ho.useState(M),N=ho.useRef(null),D=ho.useRef(null),E=l!==void 0,P=i&&!s,W=Wx("size",E?l:I,M,R.min,R.max),H=v.dir??T.dir,B=ho.useCallback(ee=>{N.current=ee,oD(h,ee);},[h]),L=ho.useCallback(ee=>{let q=Ym(ee,R.min,R.max);E||A(q),w?.(q);},[R.max,R.min,E,w]),F=ho.useCallback(ee=>{let q=N.current;if(!q)return;let U=q.getBoundingClientRect(),X=t==="horizontal"?U.width:U.height;if(!Number.isFinite(X)||X<=0)return;let O=t==="horizontal"?zx(q)?U.right-ee.clientX:ee.clientX-U.left:ee.clientY-U.top;L(O/X*100);},[L,t]),_=ho.useCallback(()=>{let ee=D.current;D.current=null,ee?.();},[]);ho.useEffect(()=>(P||_(),_),[P,_]);let $=a(ee=>{if(!P||ee.button!==0&&ee.pointerType!=="touch")return;ee.preventDefault(),_(),F(ee);let q=ee.pointerId,U=ee.currentTarget,X=U.ownerDocument,O=a(fe=>{fe.pointerId===q&&F(fe);},"handleMove"),K=a(fe=>{fe.pointerId===q&&_();},"handleStop"),ne=a(fe=>{fe.pointerId===q&&_();},"handleLostCapture");X.addEventListener("pointermove",O),X.addEventListener("pointerup",K),X.addEventListener("pointercancel",K),U.addEventListener("lostpointercapture",ne),D.current=()=>{X.removeEventListener("pointermove",O),X.removeEventListener("pointerup",K),X.removeEventListener("pointercancel",K),U.removeEventListener("lostpointercapture",ne),U.hasPointerCapture?.(q)&&U.releasePointerCapture?.(q);},aD(U,q);},"handlePointerDown"),G=a(ee=>{if(!P)return;let q=ee.shiftKey?R.keyboardStep*4:R.keyboardStep,U=t==="horizontal"&&zx(ee.currentTarget),X;ee.key==="Home"&&(X=R.min),ee.key==="End"&&(X=R.max),t==="horizontal"&&ee.key==="ArrowLeft"&&(X=W+(U?q:-q)),t==="horizontal"&&ee.key==="ArrowRight"&&(X=W+(U?-q:q)),t==="vertical"&&ee.key==="ArrowUp"&&(X=W-q),t==="vertical"&&ee.key==="ArrowDown"&&(X=W+q),X!==void 0&&(ee.preventDefault(),L(X));},"handleKeyDown"),z=u!==void 0?Dc(u,"0px"):void 0,re=z!==void 0?"var(--base-layout-split-gap)":"auto",Z=z!==void 0?t==="horizontal"?{width:"var(--base-layout-split-gap)"}:{height:"var(--base-layout-split-gap)"}:void 0,ae={...C.styles.layoutSplit,[t==="horizontal"?"gridTemplateColumns":"gridTemplateRows"]:i?`${W}% ${re} minmax(0, 1fr)`:`${W}% minmax(0, 1fr)`,...i?{gap:0}:{},...z!==void 0?{"--base-layout-split-gap":z,...i?{}:{gap:z}}:{},...k};return jsxRuntime.jsxs("div",{...T,...v,ref:B,"data-monkeys-component":"layout-split","data-slot":"root","data-orientation":t,"data-state":P?"enabled":s?"disabled":"static","data-controlled":E?"true":"false",className:m(C.slots.layoutSplitRoot,t==="horizontal"?C.slots.layoutSplitHorizontal:C.slots.layoutSplitVertical,y?.root,x),style:ae,children:[jsxRuntime.jsx("div",{"data-slot":"primary",className:m(C.slots.layoutSplitPane,C.slots.layoutSplitPrimary,y?.primary),style:C.styles.layoutSplitPane,children:V(o)?o:n}),i?jsxRuntime.jsx(Xm,{orientation:t,resizable:true,disabled:s,size:W,minSize:R.min,maxSize:R.max,label:f,appearance:b,dir:H,className:y?.handle,style:Z,onPointerDown:$,onKeyDown:G}):null,jsxRuntime.jsx("div",{"data-slot":"secondary",className:m(C.slots.layoutSplitPane,C.slots.layoutSplitSecondary,y?.secondary),style:C.styles.layoutSplitPane,children:r})]})},"BaseLayoutSplit"));var sD={line:"h-4 w-full",block:"h-24 w-full",circle:"aspect-square h-10 rounded-full"},Ur=ho.forwardRef(a(function({variant:t="line",animated:o=true,animation:r,appearance:n,className:i,classNames:s,style:l,...d},c){if(t!=="line"&&t!=="block"&&t!=="circle")throw new TypeError('BaseSkeleton variant must be "line", "block", or "circle".');if(typeof o!="boolean")throw new TypeError("BaseSkeleton animated must be a boolean.");let p=Pe(n),u=ke(),g=Ne(p),f=Jd(r,o,c);return jsxRuntime.jsx("div",{...u,...d,ref:f.ref,"aria-hidden":"true","data-monkeys-component":"skeleton","data-slot":"root","data-variant":t,"data-animated":f.mode!=="none","data-state":f.mode!=="none"?"animated":"static","data-skeleton-animation":f.mode,className:m(g.slots.skeletonRoot,sD[t],f.mode==="pulse"&&"motion-safe:animate-pulse motion-reduce:animate-none",s?.root,i),style:{...g.styles.skeleton,...f.style,...l}})},"BaseSkeleton"));function cD({className:e}){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:e,fill:"none",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9",className:"opacity-25",stroke:"currentColor",strokeWidth:"3"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M12 3a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6V3Z"})]})}a(cD,"DefaultLoadingIcon");var Kr=ho.forwardRef(a(function({icon:t,title:o,description:r,actions:n,variant:i,animation:s,appearance:l,className:d,classNames:c,style:p,role:u="status","aria-live":g="polite","aria-busy":f=true,"aria-label":b,"aria-labelledby":x,...y},k){let w=Pe(l),v=ke(),{loading:h}=Ye(),S=Or(),T=i??S.loading?.variant??"spinner",C=S.density==="compact"?"min-h-0 px-3 py-3":S.density==="comfortable"?"min-h-56 px-8 py-12":void 0,R=Ne(w),M=T==="skeleton"&&t===void 0?void 0:t===void 0?jsxRuntime.jsx(cD,{className:R.slots.loadingSpinner}):t,I=b??(x===void 0?typeof o=="string"?o:h.spinner:void 0);return jsxRuntime.jsxs("div",{...v,...y,ref:k,role:u,"aria-live":g,"aria-busy":f,"aria-label":I,"aria-labelledby":x,"data-monkeys-component":"loading-state","data-slot":"root","data-state":"loading","data-variant":T,"data-density":S.density,className:m(R.slots.stateRoot,C,c?.root,d),style:{...R.styles.stateRoot,...p},children:[T==="skeleton"?jsxRuntime.jsx(Xn,{animation:s,children:jsxRuntime.jsxs("div",{className:"flex w-full max-w-sm flex-col gap-3","data-slot":"skeleton",children:[jsxRuntime.jsx(Ur,{variant:"block",className:"h-20"}),jsxRuntime.jsx(Ur,{variant:"line",className:"w-4/5"}),jsxRuntime.jsx(Ur,{variant:"line",className:"w-3/5"})]})}):V(M)?jsxRuntime.jsx("div",{"data-slot":"icon","data-state":"loading",className:m(R.slots.stateIcon,c?.icon),style:R.styles.stateIcon,children:M}):null,T!=="skeleton"&&V(o)?jsxRuntime.jsx("div",{"data-slot":"title","data-state":"loading",className:m(R.slots.stateTitle,c?.title),children:o}):null,T!=="skeleton"&&V(r)?jsxRuntime.jsx("div",{"data-slot":"description","data-state":"loading",className:m(R.slots.stateDescription,c?.description),children:r}):null,V(n)?jsxRuntime.jsx("div",{"data-slot":"actions","data-state":"loading",className:m(R.slots.stateActions,c?.actions),children:n}):null]})},"BaseLoadingState"));var fD=ho.forwardRef(a(function({children:t,openOnMount:o=false,size:r="md",tone:n="primary",appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u),b=fn(c.href,"link"),x=c.href!==void 0&&b===void 0,y=ho.useRef();return ho.useEffect(()=>{!o||!b||c.target!=="_blank"||c["aria-disabled"]===true||c["aria-disabled"]==="true"||y.current===b||(y.current=b,window.open(b,"_blank","noopener,noreferrer"));},[o,b,c.target,c["aria-disabled"]]),jsxRuntime.jsx("a",{...g,...c,href:b,"aria-disabled":x?true:c["aria-disabled"],onClickCapture:k=>{if(x){k.preventDefault(),k.stopPropagation();return}c.onClickCapture?.(k);},onClick:k=>{if(x){k.preventDefault(),k.stopPropagation();return}c.onClick?.(k);},onAuxClickCapture:k=>{if(x){k.preventDefault(),k.stopPropagation();return}c.onAuxClickCapture?.(k);},ref:p,"data-monkeys-component":"link","data-slot":"root","data-size":r,"data-tone":n,className:m(f.slots.linkRoot,Od(f,r),gi(f,n),l?.root,s),style:{...f.styles.link,...d},children:t})},"BaseLink"));var gD=ho.forwardRef(a(function({ordered:t=false,marker:o="auto",spacing:r="default",children:n,appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u),b={...g,...c,"data-monkeys-component":"list","data-slot":"root","data-list-type":t?"ordered":"unordered","data-marker":o,"data-spacing":r,className:m(f.slots.listRoot,Vh(f,r),o!=="auto"&&_h(f,o),l?.root,s),style:{...f.styles.list,...d},children:n};return t?jsxRuntime.jsx("ol",{...b,ref:p}):jsxRuntime.jsx("ul",{...b,ref:p})},"BaseList")),hD=ho.forwardRef(a(function({children:t,appearance:o,className:r,classNames:n,style:i,...s},l){let d=Pe(o),c=ke(),p=Ne(d);return jsxRuntime.jsx("li",{...c,...s,ref:l,"data-monkeys-component":"list-item","data-slot":"item",className:m(p.slots.listItem,n?.root,r),style:{...p.styles.listItem,...i},children:t})},"BaseListItem"));var vD=500;function wD({options:e,value:t,defaultValue:o,invalid:r,disabled:n,required:i,openForPreview:s,maxTagCount:l}){for(let[d,c]of [["invalid",r],["disabled",n],["required",i],["openForPreview",s]])if(typeof c!="boolean")throw new TypeError(`BaseMultiSelect ${d} must be a boolean.`);if(l!==void 0&&typeof l!="number")throw new TypeError("BaseMultiSelect maxTagCount must be a number.");if(e!==void 0&&!Array.isArray(e))throw new TypeError("BaseMultiSelect options must be an array.");e?.forEach((d,c)=>{if(!d||typeof d!="object")throw new TypeError(`BaseMultiSelect option at index ${c} must be an object.`);if(typeof d.value!="string")throw new TypeError(`BaseMultiSelect option value at index ${c} must be a string.`);if(d.disabled!==void 0&&typeof d.disabled!="boolean")throw new TypeError(`BaseMultiSelect option disabled at index ${c} must be a boolean.`);if(d.textValue!==void 0&&typeof d.textValue!="string")throw new TypeError(`BaseMultiSelect option textValue at index ${c} must be a string.`)});for(let[d,c]of [["value",t],["defaultValue",o]]){if(c!==void 0&&!Array.isArray(c))throw new TypeError(`BaseMultiSelect ${d} must be an array.`);c?.forEach((p,u)=>{if(typeof p!="string")throw new TypeError(`BaseMultiSelect ${d} item at index ${u} must be a string.`)});}}a(wD,"validateMultiSelectProps");function tf(e){let t=[],o=new Set;return e?.forEach(r=>{o.has(r)||(o.add(r),t.push(r));}),t}a(tf,"normalizeValues");function kD(e,t,o){if(!e.length)return -1;let r=t>=0?t:o===1?-1:0;for(let n=1;n<=e.length;n+=1){let i=(r+n*o+e.length)%e.length;if(!e[i]?.disabled)return i}return -1}a(kD,"getNextEnabledIndex");function Ac(e,t){if(t==="first")return e.findIndex(o=>!o.disabled);for(let o=e.length-1;o>=0;o-=1)if(!e[o]?.disabled)return o;return -1}a(Ac,"getBoundaryEnabledIndex");function CD(e,t){return e===void 0||!Number.isFinite(e)?t:Math.max(0,Math.min(t,Math.floor(e)))}a(CD,"getSafeTagCount");function SD(e){return e.textValue!==void 0?e.textValue:typeof e.label=="string"?e.label:e.value}a(SD,"getOptionText");function TD(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(TD,"toDomId");var $x=ho.forwardRef(a(function({options:t,value:o,defaultValue:r,name:n,placeholder:i,icon:s,invalid:l=false,disabled:d=false,required:c=false,openForPreview:p=false,maxTagCount:u,removeLabel:g,emptyLabel:f,appearance:b,className:x,classNames:y,style:k,id:w,"aria-invalid":v,"aria-label":h,"aria-labelledby":S,"aria-describedby":T,"aria-errormessage":C,onValueChange:R,...M},I){wD({options:t,value:o,defaultValue:r,invalid:l,disabled:d,required:c,openForPreview:p,maxTagCount:u});let A=Ye().multiSelect,N=Pe(b),D=ke(),E=Ne(N),P=ho.useId(),W=w??P,H=`${W}-control`,B=`${W}-listbox`,L=ho.useRef(null),F=ho.useRef(null),_=ho.useRef(false),$=ho.useRef(""),G=ho.useRef(null),z=t??[],re=z.map((J,$e)=>`${W}-option-${$e}-${TD(J.value)}`),Z=p,[ae,ee]=ho.useState(false),q=Z||ae,U=ho.useRef(tf(r)),[X,O]=ho.useState(()=>[...U.current]),[K,ne]=ho.useState(()=>Ac(z,"first")),fe=o!==void 0,he=ho.useMemo(()=>tf(fe?o:X),[fe,X,o]),me=ho.useMemo(()=>new Set(he),[he]),ie=ho.useMemo(()=>{let J=new Map;return z.forEach($e=>{J.has($e.value)||J.set($e.value,$e);}),J},[z]),be=ho.useMemo(()=>he.map(J=>ie.get(J)).filter(J=>J!==void 0),[ie,he]),He=Ac(z,"first"),We=K>=0&&!z[K]?.disabled?K:He,Ke=CD(u,be.length),ce=be.slice(0,Ke),Q=be.length-ce.length,ge=be.length===0,we=M.dir??D.dir,Ie=d?"disabled":l?"invalid":q?"open":"closed",oe=a(J=>{L.current=J,typeof I=="function"?I(J):I&&(I.current=J);},"setRootRef"),xe=a(J=>{d||Z||(ee(J),J&&We<0&&ne(He));},"setOpen"),Ve=a(J=>{let $e=tf(J);fe||O($e),R?.($e);},"commitValues"),_e=a(J=>{if(!J||J.disabled||d)return;let $e=me.has(J.value)?he.filter(ue=>ue!==J.value):[...he,J.value];Ve($e);},"toggleOption"),Ge=a(J=>{d||Ve(he.filter($e=>$e!==J.value));},"removeOption"),le=a(J=>{J<0||z[J]?.disabled||(ne(J),q||xe(true));},"moveActive"),Me=a((J,$e)=>{let ue=J.currentTarget.ownerDocument.defaultView;if(!ue)return;let Re=`${$.current}${$e}`.toLocaleLowerCase();$.current=Re,G.current&&G.current.ownerWindow.clearTimeout(G.current.timerId),G.current={ownerWindow:ue,timerId:ue.setTimeout(()=>{$.current="",G.current=null;},vD)};let te=Array.from(Re).every(Te=>Te===Re[0])?$e.toLocaleLowerCase():Re;for(let Te=1;Te<=z.length;Te+=1){let ze=(We+Te+z.length)%z.length,je=z[ze];if(!je?.disabled&&SD(je).trim().toLocaleLowerCase().startsWith(te)){J.preventDefault(),le(ze);return}}},"handleTypeahead"),Ae=a(J=>{if(!(d||_.current||J.nativeEvent.isComposing)){if(J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault(),q?le(kD(z,We,J.key==="ArrowDown"?1:-1)):(ne(He),xe(true));return}if(J.key==="Home"||J.key==="End"){J.preventDefault(),le(Ac(z,J.key==="Home"?"first":"last"));return}if(J.key==="Enter"||J.key===" "){J.preventDefault(),q?_e(z[We]):xe(true);return}if(J.key==="Escape"&&q){J.preventDefault(),xe(false);return}if(J.key==="Tab"&&q){xe(false);return}J.key.length===1&&!J.ctrlKey&&!J.metaKey&&!J.altKey&&!/\s/.test(J.key)&&Me(J,J.key);}},"handleKeyDown");return ho.useEffect(()=>{if(!q||Z)return;let J=L.current?.ownerDocument;if(!J)return;let $e=a(ue=>{L.current?.contains(ue.target)||ee(false);},"handlePointerDown");return J.addEventListener("pointerdown",$e),()=>J.removeEventListener("pointerdown",$e)},[Z,q]),ho.useEffect(()=>{if(fe)return;let J=L.current?.closest("form");if(!J)return;let $e=a(()=>{O([...U.current]),ne(Ac(z,"first")),Z||ee(false);},"handleReset");return J.addEventListener("reset",$e),()=>J.removeEventListener("reset",$e)},[Z,fe,z]),ho.useEffect(()=>()=>{G.current&&G.current.ownerWindow.clearTimeout(G.current.timerId);},[]),jsxRuntime.jsxs("div",{...D,...M,id:w,ref:oe,dir:we,"data-monkeys-component":"multi-select","data-slot":"root","data-state":Ie,"data-disabled":d||void 0,"data-invalid":l||void 0,className:m(E.slots.controlWrapper,"overflow-visible",q&&"z-50",l&&E.slots.controlInvalid,d&&E.slots.controlDisabled,y?.root,x),style:{...E.styles.control,...l?E.styles.controlInvalid:void 0,...d?E.styles.controlDisabled:void 0,...k},children:[V(s)?jsxRuntime.jsx("span",{className:m(E.slots.controlIcon,y?.icon),children:s}):null,jsxRuntime.jsx("div",{...D,ref:F,id:H,role:"combobox",tabIndex:d?-1:0,dir:we,"aria-haspopup":"listbox","aria-expanded":q,"aria-controls":B,"aria-activedescendant":q&&We>=0?re[We]:void 0,"aria-autocomplete":"none","aria-disabled":d||void 0,"aria-required":c||void 0,"aria-invalid":v??(l||void 0),"aria-label":h,"aria-labelledby":S,"aria-describedby":T,"aria-errormessage":C,"data-monkeys-component":"multi-select","data-slot":"control","data-state":Ie,className:m(E.slots.controlBase,"flex min-h-9 cursor-pointer flex-wrap items-center gap-1.5 py-1.5 pr-9 text-left",d&&"!cursor-not-allowed",y?.control),onMouseDown:J=>{d||J.button!==0||(J.preventDefault(),F.current?.focus());},onClick:()=>{F.current?.focus(),xe(!q);},onBlur:J=>{L.current?.contains(J.relatedTarget)||xe(false);},onCompositionStart:()=>{_.current=true;},onCompositionEnd:()=>{_.current=false;},onKeyDown:Ae,children:jsxRuntime.jsxs("span",{"data-monkeys-component":"multi-select","data-slot":"tag-list","data-state":ge?"empty":"filled",className:m("flex min-w-0 flex-1 flex-wrap items-center gap-1.5",y?.tagList),children:[ce.map((J,$e)=>jsxRuntime.jsxs("span",{"data-monkeys-component":"multi-select","data-slot":"tag","data-state":"selected",className:m("inline-flex max-w-full items-center gap-1 rounded-full border border-border/70 bg-muted/65 px-2 py-0.5 text-xs font-medium text-foreground",y?.tag),children:[jsxRuntime.jsx("span",{"data-slot":"tag-label",className:m("max-w-40 truncate",y?.tagLabel),children:J.label}),jsxRuntime.jsx("button",{...D,type:"button",tabIndex:-1,dir:we,"aria-label":g?.(J)??A.removeOption({value:J.value}),disabled:d,"data-monkeys-component":"multi-select","data-slot":"tag-remove","data-state":"selected",className:m("inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background/80 hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/30 disabled:!cursor-not-allowed",y?.tagRemove),onClick:ue=>{ue.preventDefault(),ue.stopPropagation(),Ge(J),F.current?.focus();},onMouseDown:ue=>{ue.preventDefault(),ue.stopPropagation();},onKeyDown:ue=>ue.stopPropagation(),children:jsxRuntime.jsx("span",{"aria-hidden":"true",children:"x"})})]},`${J.value}-${$e}`)),Q>0?jsxRuntime.jsxs("span",{"data-monkeys-component":"multi-select","data-slot":"tag-overflow","data-state":"selected",className:m("inline-flex max-w-full items-center rounded-full border border-border/70 bg-muted/45 px-2 py-0.5 text-xs font-medium text-muted-foreground",y?.tag),children:["+",Q]}):null,ge?jsxRuntime.jsx("span",{"data-monkeys-component":"multi-select","data-slot":"placeholder","data-state":"empty",className:m("min-w-0 truncate",E.slots.selectPlaceholder,y?.placeholder),children:i===void 0?A.placeholder:i}):null]})}),jsxRuntime.jsx("span",{"data-monkeys-component":"multi-select","data-slot":"chevron","data-state":q?"open":"closed",className:m(E.slots.selectChevron,q&&"rotate-[225deg]",y?.chevron)}),n?he.map(J=>ho.createElement("input",{...D,key:J,type:"hidden",name:n,value:J,disabled:d,dir:we,"data-monkeys-component":"multi-select","data-slot":"hidden-input","data-state":"selected",className:y?.hiddenInput})):null,q?jsxRuntime.jsx("div",{...D,id:B,role:"listbox",dir:we,"aria-multiselectable":"true","aria-labelledby":H,"data-monkeys-component":"multi-select","data-slot":"menu","data-state":"open",className:m(E.slots.selectMenu,y?.menu),style:E.styles.selectMenu,children:z.length>0?z.map((J,$e)=>{let ue=me.has(J.value),Re=$e===We,se=J.disabled?"disabled":Re?"active":ue?"selected":"idle";return ho.createElement("button",{...D,key:`${J.value}-${$e}`,id:re[$e],type:"button",role:"option",tabIndex:-1,dir:we,"aria-selected":ue,disabled:J.disabled,"data-monkeys-component":"multi-select","data-slot":"option","data-state":se,"data-active":Re||void 0,"data-selected":ue||void 0,"data-disabled":J.disabled||void 0,className:m(E.slots.selectOption,"gap-2",Re&&E.slots.selectOptionActive,ue&&E.slots.selectOptionSelected,J.disabled&&E.slots.selectOptionDisabled,y?.option),style:{...E.styles.selectOption,...Re?E.styles.selectOptionActive:void 0,...ue?E.styles.selectOptionSelected:void 0},onMouseEnter:()=>{J.disabled||ne($e);},onMouseDown:te=>te.preventDefault(),onClick:()=>{_e(J),F.current?.focus();}},jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"option-indicator",className:m("inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-border/70 text-[10px]",ue&&"border-primary/40 bg-primary text-primary-foreground",y?.optionIndicator),children:ue?"\u2713":null}),jsxRuntime.jsx("span",{"data-slot":"option-label",className:m("min-w-0 flex-1 truncate",y?.optionLabel),children:J.label}))}):jsxRuntime.jsx("div",{...D,dir:we,role:"option",tabIndex:-1,"aria-disabled":"true","aria-selected":"false","data-monkeys-component":"multi-select","data-slot":"empty","data-state":"empty",className:m("px-2.5 py-2 text-sm text-muted-foreground",y?.empty),children:f===void 0?A.empty:f})}):null]})},"BaseMultiSelect"));var MD=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/;function rf(e){if(!MD.test(e))return null;let t=Number(e);return Number.isFinite(t)?t:null}a(rf,"parseBaseNumberInputValue");function ID(e){let t=/^(?:\d+)(?:\.(\d*))?(?:e([+-]?\d+))?$/i.exec(Math.abs(e).toString());if(!t)return 0;let o=t[1]?.length??0,r=Number(t[2]??0);return Math.min(12,Math.max(0,o-r))}a(ID,"resolveDecimalPlaces");function jx(e,t){let r=10**Math.max(...t.map(ID)),n=Math.round((e+Number.EPSILON)*r)/r;return Object.is(n,-0)?0:n}a(jx,"normalizeSteppedValue");function DD({rawValue:e,direction:t,step:o,min:r,max:n}){let s=rf(e)??0,l=[s,o];r!==void 0&&l.push(r),n!==void 0&&l.push(n);let d=jx(s+t*o,l);return r!==void 0&&(d=Math.max(r,d)),n!==void 0&&(d=Math.min(n,d)),jx(d,l)}a(DD,"resolveBaseNumberInputStep");function Ux(e,t){if(t!==void 0&&!Number.isFinite(t))throw new TypeError(`BaseNumberInput ${e} must be a finite number.`)}a(Ux,"validateBoundary");function Kx(e,t){if(!t.trim())throw new TypeError(`BaseNumberInput ${e} must be a non-empty string.`)}a(Kx,"validateLabel");function PD(e,t,o){return e!==null&&(t===void 0||e>=t)&&(o===void 0||e<=o)}a(PD,"isInRange");var ED=ho.forwardRef(a(function({value:t,defaultValue:o="",min:r,max:n,step:i=1,showStepControls:s=false,incrementLabel:l,decrementLabel:d,invalid:c=false,disabled:p=false,readOnly:u=false,appearance:g,className:f,classNames:b,style:x,onChange:y,onKeyDown:k,onValueChange:w,"aria-invalid":v,...h},S){if(t!==void 0&&typeof t!="string")throw new TypeError("BaseNumberInput value must be a string.");if(typeof o!="string")throw new TypeError("BaseNumberInput defaultValue must be a string.");if(Ux("min",r),Ux("max",n),r!==void 0&&n!==void 0&&r>n)throw new RangeError("BaseNumberInput min must be less than or equal to max.");if(!Number.isFinite(i)||i<=0)throw new TypeError("BaseNumberInput step must be a positive finite number.");for(let[G,z]of [["showStepControls",s],["invalid",c],["disabled",p],["readOnly",u]])if(typeof z!="boolean")throw new TypeError(`BaseNumberInput ${G} must be a boolean.`);let T=Ye(),C=l??T.numberInput.increment,R=d??T.numberInput.decrement;Kx("incrementLabel",C),Kx("decrementLabel",R);let[M,I]=ho.useState(o),A=t!==void 0,N=A?t:M,D=rf(N),E=Pe(g),P=ke(),W=Ne(E),H=a((G,z)=>{A||I(G);let re=rf(G);w?.(re,{rawValue:G,reason:z,inRange:PD(re,r,n)});},"emitValueChange"),B=a(G=>{if(p||u||D!==null&&(G===1&&n!==void 0&&D>=n||G===-1&&r!==void 0&&D<=r))return;let z=DD({rawValue:N,direction:G,step:i,min:r,max:n});H(String(z),G===1?"step-up":"step-down");},"stepValue"),L=a(G=>{y?.(G),H(G.currentTarget.value,"input");},"handleChange"),F=a(G=>{k?.(G),!(G.defaultPrevented||p||u)&&(G.key!=="ArrowUp"&&G.key!=="ArrowDown"||(G.preventDefault(),B(G.key==="ArrowUp"?1:-1)));},"handleKeyDown"),_=p||u||D!==null&&r!==void 0&&D<=r,$=p||u||D!==null&&n!==void 0&&D>=n;return jsxRuntime.jsxs("div",{...P,"data-monkeys-component":"number-input","data-slot":"root","data-invalid":c||void 0,"data-disabled":p||void 0,"data-readonly":u||void 0,className:m(W.slots.controlWrapper,c&&W.slots.controlInvalid,p&&W.slots.controlDisabled,u&&W.slots.controlReadOnly,b?.root,f),style:{...W.styles.control,...c?W.styles.controlInvalid:void 0,...p?W.styles.controlDisabled:void 0,...x},children:[jsxRuntime.jsx("input",{...h,ref:S,type:"text",inputMode:"decimal",role:"spinbutton",value:N,disabled:p,readOnly:u,"aria-invalid":v??(c||void 0),"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":D??void 0,"aria-valuetext":N||void 0,"data-slot":"control",className:m(W.slots.controlBase,W.slots.controlInput,W.slots.numberInputControl,b?.control),onChange:L,onKeyDown:F}),s?jsxRuntime.jsxs("span",{"data-slot":"step-controls",className:m(W.slots.numberInputStepControls,b?.stepControls),style:W.styles.numberInputStepControls,children:[jsxRuntime.jsx("button",{type:"button","aria-label":C,disabled:$,"data-slot":"increment",className:m(W.slots.numberInputStepButton,b?.increment),style:W.styles.numberInputStepButton,onClick:()=>B(1),children:"+"}),jsxRuntime.jsx("button",{type:"button","aria-label":R,disabled:_,"data-slot":"decrement",className:m(W.slots.numberInputStepButton,b?.decrement),style:W.styles.numberInputStepButton,onClick:()=>B(-1),children:"\u2212"})]}):null]})},"BaseNumberInput"));function Xx({tone:e,icon:t,title:o,description:r,actions:n,children:i,appearance:s,className:l,classNames:d,style:c,...p}){let u=Ne(s),g=i??r;return jsxRuntime.jsxs("div",{...p,className:m(u.slots.noticeBase,zd(u,e),d?.root,l),style:{...u.styles.notice,...c},children:[V(t)?jsxRuntime.jsx("div",{className:m(u.slots.noticeIcon,d?.icon),children:t}):null,jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[V(o)?jsxRuntime.jsx("div",{className:m(u.slots.noticeTitle,d?.title),children:o}):null,V(g)?jsxRuntime.jsx("div",{className:m(u.slots.noticeDescription,d?.description),children:g}):null,V(n)?jsxRuntime.jsx("div",{className:m(u.slots.noticeActions,d?.actions),children:n}):null]})]})}a(Xx,"BaseNotice");function WD(e,...t){for(let o of t)o&&(typeof o=="function"?o(e):o.current=e);}a(WD,"setRefs");function Qx(e,t){if(!t.trim())throw new TypeError(`BasePasswordInput ${e} must be a non-empty string.`)}a(Qx,"validateLabel");var zD=ho.forwardRef(a(function({visible:t,defaultVisible:o=false,onVisibleChange:r,showPasswordLabel:n,hidePasswordLabel:i,invalid:s=false,disabled:l=false,readOnly:d=false,appearance:c,className:p,classNames:u,style:g,"aria-invalid":f,...b},x){for(let[E,P]of [["defaultVisible",o],["invalid",s],["disabled",l],["readOnly",d]])if(typeof P!="boolean")throw new TypeError(`BasePasswordInput ${E} must be a boolean.`);if(t!==void 0&&typeof t!="boolean")throw new TypeError("BasePasswordInput visible must be a boolean.");let y=Ye(),k=n??y.passwordInput.showPassword,w=i??y.passwordInput.hidePassword;Qx("showPasswordLabel",k),Qx("hidePasswordLabel",w);let v=ho.useRef(null),[h,S]=ho.useState(o),T=t!==void 0,C=T?t:h,R=Pe(c),M=ke(),I=Ne(R),A=a(E=>{let P=v.current;P&&P.ownerDocument.activeElement===P&&E.preventDefault();},"handleTogglePointerDown"),N=a(()=>{if(l)return;let E=!C;T||S(E),r?.(E);},"handleToggle"),D=C?w:k;return jsxRuntime.jsxs("div",{...M,"data-monkeys-component":"password-input","data-slot":"root","data-visible":C||void 0,"data-invalid":s||void 0,"data-disabled":l||void 0,"data-readonly":d||void 0,className:m(I.slots.controlWrapper,s&&I.slots.controlInvalid,l&&I.slots.controlDisabled,d&&I.slots.controlReadOnly,u?.root,p),style:{...I.styles.control,...s?I.styles.controlInvalid:void 0,...l?I.styles.controlDisabled:void 0,...g},children:[jsxRuntime.jsx("input",{...b,ref:E=>WD(E,v,x),type:C?"text":"password",disabled:l,readOnly:d,"aria-invalid":f??(s||void 0),"data-slot":"control",className:m(I.slots.controlBase,I.slots.controlInput,I.slots.passwordInputControl,u?.control)}),jsxRuntime.jsx("button",{type:"button","aria-label":D,"aria-pressed":C,disabled:l,"data-slot":"toggle","data-state":C?"visible":"hidden",className:m(I.slots.passwordInputToggle,u?.toggle),style:I.styles.passwordInputToggle,onPointerDown:A,onClick:N,children:D})]})},"BasePasswordInput"));function VD(e,t,o){return Math.min(Math.max(e,t),o)}a(VD,"clamp");var ev=ho.forwardRef(a(function({value:t=0,max:o=100,label:r,showValue:n=false,valueFormatter:i,appearance:s,className:l,classNames:d,style:c,"aria-label":p,"aria-labelledby":u,...g},f){let b=`${ho.useId()}-label`;if(typeof o!="number"||!Number.isFinite(o)||o<=0)throw new TypeError("BaseProgress max must be a positive finite number.");if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("BaseProgress value must be a finite number.");let x=Pe(s),y=ke(),k=Ne(x),w=VD(t,0,o),v=w/o*100,h=i?.(w,o)??`${Math.round(v)}%`,S=V(r),T=S||n,C=typeof r=="string"?r:void 0,M=S&&C===void 0&&!(p!==void 0||u!==void 0)?b:void 0,I=w===0?"empty":w===o?"complete":"progress";return jsxRuntime.jsxs("div",{...y,...g,ref:f,role:"progressbar","aria-valuemin":0,"aria-valuemax":o,"aria-valuenow":w,"aria-label":p??(u===void 0?C:void 0),"aria-labelledby":u??M,"data-monkeys-component":"progress","data-slot":"root","data-state":I,"data-value":w,"data-max":o,className:m(k.slots.progressRoot,d?.root,l),style:{...k.styles.progressRoot,...c},children:[T?jsxRuntime.jsxs("div",{"data-slot":"label-row","data-state":I,className:m(k.slots.progressLabelRow,d?.labelRow),children:[S?jsxRuntime.jsx("span",{id:M,"data-slot":"label",className:m(k.slots.progressLabel,d?.label),children:r}):jsxRuntime.jsx("span",{"data-slot":"label"}),n?jsxRuntime.jsx("span",{"data-slot":"value","data-value":w,className:m(k.slots.progressValue,d?.value),children:h}):null]}):null,jsxRuntime.jsx("div",{"data-slot":"track","data-state":I,className:m(k.slots.progressTrack,d?.track),children:jsxRuntime.jsx("div",{"data-slot":"indicator","data-state":I,"data-value":w,className:m(k.slots.progressIndicator,d?.indicator),style:{...k.styles.progressIndicator,width:`${v}%`}})})]})},"BaseProgress"));function jD(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(jD,"toDomId");var UD={sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-3 text-base"},KD={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"},qD={sm:"h-1.5 w-1.5",md:"h-2 w-2",lg:"h-2.5 w-2.5"},tv=ho.forwardRef(a(function({options:t=[],value:o,defaultValue:r,name:n,form:i,orientation:s="vertical",required:l=false,invalid:d=false,disabled:c=false,controlSize:p,appearance:u,className:g,classNames:f,style:b,children:x,onChange:y,onValueChange:k,id:w,"aria-invalid":v,...h},S){for(let[B,L]of [["required",l],["invalid",d],["disabled",c]])if(typeof L!="boolean")throw new TypeError(`BaseRadioGroup ${B} must be a boolean.`);if(s!=="horizontal"&&s!=="vertical")throw new TypeError('BaseRadioGroup orientation must be "horizontal" or "vertical".');if(p!==void 0&&p!=="sm"&&p!=="md"&&p!=="lg")throw new TypeError('BaseRadioGroup controlSize must be "sm", "md", or "lg".');if(!Array.isArray(t))throw new TypeError("BaseRadioGroup options must be an array.");let T=new Set;t.forEach((B,L)=>{if(!B||typeof B!="object")throw new TypeError(`BaseRadioGroup option at index ${L} must be an object.`);if(typeof B.value!="string")throw new TypeError(`BaseRadioGroup option value at index ${L} must be a string.`);if(T.has(B.value)){let F=JSON.stringify(B.value);throw new TypeError(`BaseRadioGroup options must use unique values; duplicate value ${F} at index ${L}.`)}if(B.disabled!==void 0&&typeof B.disabled!="boolean")throw new TypeError(`BaseRadioGroup option disabled at index ${L} must be a boolean.`);T.add(B.value);});let C=Pe(u),R=ke(),M=Ne(C),I=ho.useId(),A=w??I,N=n??A,[D,E]=ho.useState(r),P=o!==void 0,W=P?o:D,H=a((B,L)=>{if(c||L)return;let F=B.currentTarget.value;P||E(F),y?.(B),k?.(F,B);},"handleSelect");return jsxRuntime.jsxs("div",{...R,...h,ref:S,id:w,role:"radiogroup","aria-orientation":s,"aria-required":l||void 0,"aria-invalid":v??(d||void 0),"aria-disabled":c||void 0,"data-monkeys-component":"radio-group","data-slot":"root","data-state":c?"disabled":"enabled","data-orientation":s,"data-size":p,"data-required":l||void 0,"data-invalid":d||void 0,"data-disabled":c||void 0,className:m(M.slots.radioGroupRoot,s==="horizontal"&&"flex flex-wrap items-center",f?.root,g),style:{...M.styles.radioGroup,...b},children:[t.map((B,L)=>{let F=c||B.disabled,_=B.value===W,$=_?"checked":"unchecked",G=`${A}-${L}-${jD(B.value)}`;return jsxRuntime.jsxs("label",{htmlFor:G,"data-slot":"option","data-state":$,"data-size":p,"data-invalid":d||void 0,"data-disabled":F||void 0,className:m(M.slots.radioOption,F&&M.slots.radioOptionDisabled,p&&UD[p],f?.option),style:M.styles.radioOption,children:[jsxRuntime.jsxs("span",{"data-slot":"marker","data-state":$,"data-size":p,"data-invalid":d||void 0,"data-disabled":F||void 0,className:m(M.slots.radioMarker,_&&M.slots.radioMarkerChecked,p&&KD[p],f?.marker),children:[jsxRuntime.jsx("input",{id:G,type:"radio",name:N,form:i,value:B.value,checked:_,required:l,disabled:F,"aria-invalid":v??(d||void 0),"data-slot":"input","data-state":$,"data-size":p,"data-invalid":d||void 0,"data-disabled":F||void 0,className:m(M.slots.radioInput,f?.input),onChange:z=>H(z,B.disabled)}),_?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator","data-state":$,"data-size":p,className:m(M.slots.radioIndicator,p&&qD[p],f?.indicator)}):null]}),V(B.icon)?jsxRuntime.jsx("span",{"data-slot":"icon",className:m("mt-0.5 shrink-0",f?.icon),children:B.icon}):null,jsxRuntime.jsxs("span",{"data-slot":"content",className:m(M.slots.radioContent,f?.content),children:[jsxRuntime.jsx("span",{"data-slot":"label",className:m(M.slots.radioLabel,f?.label),children:B.label}),V(B.description)?jsxRuntime.jsx("span",{"data-slot":"description",className:m(M.slots.radioDescription,f?.description),children:B.description}):null]})]},B.value)}),x]})},"BaseRadioGroup"));function XD(e){if(e==="x")return {overflowX:"auto",overflowY:"hidden"};if(e==="y")return {overflowX:"hidden",overflowY:"auto"};if(e==="both")return {overflowX:"auto",overflowY:"auto"};throw new TypeError('BaseScrollArea axis must be "x", "y", or "both".')}a(XD,"resolveOverflow");var QD=ho.forwardRef(a(function({children:t,axis:o="y",maxWidth:r,maxHeight:n,appearance:i,className:s,classNames:l,style:d,...c},p){let u=Pe(i),g=ke(),f=Ne(u),b=XD(o),x=r===void 0?void 0:nr("BaseScrollArea","maxWidth",r),y=n===void 0?void 0:nr("BaseScrollArea","maxHeight",n);return jsxRuntime.jsx("div",{...g,...c,ref:p,"data-monkeys-component":"scroll-area","data-slot":"viewport","data-axis":o,className:m(f.slots.scrollAreaViewport,l?.viewport,s),style:{...f.styles.scrollArea,...b,maxWidth:x,maxHeight:y,...d},children:t})},"BaseScrollArea"));var lP=500;function dP({options:e,value:t,defaultValue:o,invalid:r,disabled:n,openForPreview:i,portal:s,required:l}){for(let[d,c]of [["invalid",r],["disabled",n],["openForPreview",i],["portal",s]])if(typeof c!="boolean")throw new TypeError(`BaseSelect ${d} must be a boolean.`);if(l!==void 0&&typeof l!="boolean")throw new TypeError("BaseSelect required must be a boolean.");if(e!==void 0&&!Array.isArray(e))throw new TypeError("BaseSelect options must be an array.");if(e?.forEach((d,c)=>{if(!d||typeof d!="object")throw new TypeError(`BaseSelect option at index ${c} must be an object.`);if(typeof d.value!="string")throw new TypeError(`BaseSelect option value at index ${c} must be a string.`);if(d.disabled!==void 0&&typeof d.disabled!="boolean")throw new TypeError(`BaseSelect option disabled at index ${c} must be a boolean.`);if(d.textValue!==void 0&&typeof d.textValue!="string")throw new TypeError(`BaseSelect option textValue at index ${c} must be a string.`)}),e?.length){if(t!==void 0&&typeof t!="string"&&typeof t!="number")throw new TypeError("BaseSelect value must be a string or number when options are used.");if(o!==void 0&&typeof o!="string"&&typeof o!="number")throw new TypeError("BaseSelect defaultValue must be a string or number when options are used.")}}a(dP,"validateSelectProps");function nf(e){return typeof e=="string"||typeof e=="number"?String(e):""}a(nf,"normalizeValue");function cP(e,t){if(t!==void 0)return e.find(o=>o.value===t)}a(cP,"findOption");function Gs(e,t){let o=e.findIndex(r=>r.value===t&&!r.disabled);return o>=0?o:e.findIndex(r=>!r.disabled)}a(Gs,"getInitialActiveIndex");function uP(e,t,o){if(!e.length)return -1;let r=t>=0?t:o===1?-1:0;for(let n=1;n<=e.length;n+=1){let i=(r+n*o+e.length)%e.length;if(!e[i]?.disabled)return i}return -1}a(uP,"getNextEnabledIndex");function pP(e,t){if(t==="first")return e.findIndex(o=>!o.disabled);for(let o=e.length-1;o>=0;o-=1)if(!e[o]?.disabled)return o;return -1}a(pP,"getBoundaryEnabledIndex");function ov(e){return e.textValue!==void 0?e.textValue:typeof e.label=="string"?e.label:e.value}a(ov,"getOptionText");function mP(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(mP,"toDomId");var Hc=ho.forwardRef(a(function({options:t,placeholder:o,icon:r,invalid:n=false,disabled:i=false,openForPreview:s=false,portal:l=false,appearance:d,className:c,classNames:p,style:u,children:g,value:f,defaultValue:b,onBlur:x,onChange:y,onFocus:k,onInvalid:w,name:v,id:h,required:S,"aria-invalid":T,"aria-label":C,"aria-labelledby":R,"aria-describedby":M,"aria-errormessage":I,"aria-required":A,...N},D){dP({options:t,value:f,defaultValue:b,invalid:n,disabled:i,openForPreview:s,portal:l,required:S});let E=Pe(d),P=ke(),W=Ne(E),H=Qn(),B=n||H.invalid,L=ho.useId(),F=h??L,_=`${F}-button`,$=`${F}-listbox`,G=ho.useRef(null),z=ho.useRef(null),re=ho.useRef(null),Z=ho.useRef([]),ae=ho.useRef(false),ee=ho.useRef(""),q=ho.useRef(null),U=t??[],X=U.length>0,O=s,[K,ne]=ho.useState(false),[fe,he]=ho.useState(false),me=O||K,ie=Cr({disabled:O||!l?true:void 0}),{refs:be,floatingStyles:He,isPositioned:We,placement:Ke}=react.useFloating({transform:false,open:X&&me&&ie.shouldPortal,placement:"bottom-start",strategy:"fixed",whileElementsMounted:ie.shouldPortal?react.autoUpdate:void 0,middleware:[react.offset(6),react.flip({padding:8}),react.shift({padding:8}),react.size({padding:8,apply({rects:Ce,availableHeight:Xe,elements:de}){Object.assign(de.floating.style,{width:`${Ce.reference.width}px`,maxHeight:`min(15rem, ${Math.max(0,Xe)}px)`});}})]}),ce=ho.useCallback(Ce=>{z.current=Ce,be.setReference(Ce);},[be.setReference]),[Q,ge]=ho.useState(()=>nf(b)),we=f!==void 0,Ie=we?nf(f):Q,oe=cP(U,Ie),[xe,Ve]=ho.useState(()=>Gs(U,Ie)),_e=xe>=0&&!U[xe]?.disabled?xe:Gs(U,Ie),Ge=U.map((Ce,Xe)=>`${F}-option-${Xe}-${mP(Ce.value)}`),le=oe?.label??o,Me=!oe,Ae=N.dir??P.dir,J=i?"disabled":B?"invalid":me?"open":"closed",$e=a(Ce=>{re.current=Ce,typeof D=="function"?D(Ce):D&&(D.current=Ce);},"setSelectRef"),ue=a(Ce=>{x?.(Ce),H.notifyBlur(Ce.currentTarget.value);},"handleNativeBlur"),Re=a(Ce=>{y?.(Ce),H.notifyChange(Ce.currentTarget.value);},"handleNativeChange"),se=a(()=>{Ve(Gs(U,Ie));},"resetActiveIndex"),te=a(()=>{se(),O||ne(false);},"cancelAndClose"),Te=a((Ce,Xe=false)=>{he(Xe),Ve(Ce??Gs(U,Ie)),O||ne(true);},"openMenu"),ze=a(Ce=>{let Xe=re.current;if(!Xe)return;let de=Xe.ownerDocument.defaultView;if(!de)throw new Error("BaseSelect cannot dispatch change without an owning window.");let Ee=Object.getOwnPropertyDescriptor(de.HTMLSelectElement.prototype,"value")?.set;if(!Ee)throw new Error("BaseSelect could not resolve the native select value setter.");Ee.call(Xe,Ce),Xe.dispatchEvent(new de.Event("change",{bubbles:true}));},"notifyChange"),je=a(Ce=>{let Xe=U[Ce];!Xe||Xe.disabled||i||(Ve(Ce),Xe.value!==Ie&&(we||ge(Xe.value),ze(Xe.value)),O||ne(false));},"commitIndex"),it=a(Ce=>{Ce<0||U[Ce]?.disabled||(Ve(Ce),me||Te(Ce));},"moveActive"),Y=a((Ce,Xe)=>{let de=Ce.currentTarget.ownerDocument.defaultView;if(!de)return;let Ee=`${ee.current}${Xe}`.toLocaleLowerCase();ee.current=Ee,q.current&&q.current.ownerWindow.clearTimeout(q.current.timerId),q.current={ownerWindow:de,timerId:de.setTimeout(()=>{ee.current="",q.current=null;},lP)};let Le=Array.from(Ee).every(Je=>Je===Ee[0])?Xe.toLocaleLowerCase():Ee,Se=me?_e:U.findIndex(Je=>Je.value===Ie&&!Je.disabled);for(let Je=1;Je<=U.length;Je+=1){let bt=(Se+Je+U.length)%U.length,xt=U[bt];if(!xt?.disabled&&ov(xt).trim().toLocaleLowerCase().startsWith(Le)){Ce.preventDefault(),it(bt);return}}},"handleTypeahead"),pe=a(Ce=>{if(!(i||ae.current||Ce.nativeEvent.isComposing)){if(Ce.key==="ArrowDown"||Ce.key==="ArrowUp"){Ce.preventDefault();let Xe=U.findIndex(Ee=>Ee.value===Ie&&!Ee.disabled);it(uP(U,me?_e:Xe,Ce.key==="ArrowDown"?1:-1));return}if(Ce.key==="Home"||Ce.key==="End"){Ce.preventDefault(),it(pP(U,Ce.key==="Home"?"first":"last"));return}if(Ce.key==="Enter"||Ce.key===" "){Ce.preventDefault(),me?je(_e):Te();return}if(Ce.key==="Escape"&&me){Ce.preventDefault(),te();return}if(Ce.key==="Tab"&&me){je(_e);return}Ce.key.length===1&&!Ce.ctrlKey&&!Ce.metaKey&&!Ce.altKey&&!/\s/.test(Ce.key)&&Y(Ce,Ce.key);}},"handleKeyDown"),Be=a(Ce=>{k?.(Ce),Ce.defaultPrevented||z.current?.focus();},"handleCustomFocus"),rt=a(Ce=>{w?.(Ce),Ce.preventDefault(),z.current?.focus();},"handleCustomInvalid");return ho.useEffect(()=>{if(!X||!me||O)return;let Ce=G.current?.ownerDocument;if(!Ce)return;let Xe=a(de=>{!G.current?.contains(de.target)&&!be.floating.current?.contains(de.target)&&te();},"handlePointerDown");return Ce.addEventListener("pointerdown",Xe),()=>{Ce.removeEventListener("pointerdown",Xe);}},[O,X,me,U,Ie]),ho.useEffect(()=>{!X||!me||_e<0||Z.current[_e]?.scrollIntoView?.({block:"nearest"});},[X,me,_e]),ho.useEffect(()=>{if(!X||we)return;let Ce=re.current,Xe=Ce?.form,de=Ce?.ownerDocument.defaultView;if(!Xe||!de)return;let Ee=a(()=>{de.setTimeout(()=>{let qe=nf(b);ge(qe),Ve(Gs(U,qe)),O||ne(false);},0);},"handleReset");return Xe.addEventListener("reset",Ee),()=>Xe.removeEventListener("reset",Ee)},[b,O,we,X,U]),ho.useEffect(()=>()=>{q.current&&q.current.ownerWindow.clearTimeout(q.current.timerId);},[]),X?jsxRuntime.jsxs("div",{...P,ref:G,dir:Ae,"data-monkeys-component":"select","data-slot":"root","data-state":J,"data-native":"false",className:m(W.slots.controlWrapper,"overflow-visible",me&&"z-50",B&&W.slots.controlInvalid,i&&W.slots.controlDisabled,p?.root,c),style:{...W.styles.control,...B?W.styles.controlInvalid:void 0,...i?W.styles.controlDisabled:void 0,...u},children:[V(r)?jsxRuntime.jsx("span",{className:m(W.slots.controlIcon,p?.icon),children:r}):null,jsxRuntime.jsx("button",{...P,ref:ce,type:"button",id:_,role:"combobox",disabled:i,dir:Ae,"aria-haspopup":"listbox","aria-expanded":me,"aria-controls":$,"aria-activedescendant":me&&_e>=0?Ge[_e]:void 0,"aria-autocomplete":"none","aria-invalid":T??(B||void 0),"aria-label":C,"aria-labelledby":R,"aria-describedby":M,"aria-errormessage":I,"aria-required":A??(S||void 0),"data-monkeys-component":"select","data-slot":"trigger","data-state":J,className:m(W.slots.controlBase,W.slots.controlSelect,"flex items-center text-left",p?.control),onClick:Ce=>{me?te():Te(void 0,Ce.detail>0);},onBlur:Ce=>{!G.current?.contains(Ce.relatedTarget)&&!be.floating.current?.contains(Ce.relatedTarget)&&(te(),H.notifyBlur(Ie));},onCompositionStart:()=>{ae.current=true;},onCompositionEnd:()=>{ae.current=false;},onKeyDown:pe,children:jsxRuntime.jsx("span",{className:m("min-w-0 flex-1 truncate",Me&&W.slots.selectPlaceholder,Me&&p?.placeholder),children:le})}),jsxRuntime.jsx("span",{className:m(W.slots.selectChevron,me&&"rotate-[225deg]")}),jsxRuntime.jsxs("select",{...P,...N,ref:$e,id:h,name:v,value:Ie,required:S,disabled:i,dir:Ae,"aria-hidden":"true",tabIndex:-1,"data-monkeys-component":"select","data-slot":"native","data-state":J,"data-native":"false",className:W.slots.selectNative,onBlur:x,onFocus:Be,onInvalid:rt,onChange:Re,children:[V(o)?jsxRuntime.jsx("option",{value:"",disabled:true,children:o}):null,U.map(Ce=>jsxRuntime.jsx("option",{value:Ce.value,disabled:Ce.disabled,children:ov(Ce)},Ce.value))]}),me?jy(jsxRuntime.jsx("div",{...P,ref:ie.shouldPortal?be.setFloating:void 0,id:$,role:"listbox",dir:Ae,"aria-labelledby":_,"data-monkeys-component":"select","data-slot":"menu","data-portal":ie.shouldPortal?"portaled":"inline","data-state":"open","data-side":ie.shouldPortal?Ke.split("-")[0]:"bottom",className:m(W.slots.selectMenu,ie.shouldPortal&&Ke.startsWith("top")?"origin-bottom":"origin-top",fe&&!O&&(!ie.shouldPortal||We)&&"motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-95 motion-safe:duration-150 motion-safe:ease-out",p?.menu),style:{...W.styles.selectMenu,...ie.shouldPortal?{...He,right:"auto",visibility:We?"visible":"hidden"}:void 0},children:U.map((Ce,Xe)=>{let de=Ce.value===Ie,Ee=Xe===_e,qe=Ce.disabled?"disabled":Ee?"active":de?"selected":"idle";return ho.createElement("button",{...P,ref:Le=>{Z.current[Xe]=Le;},key:Ce.value,id:Ge[Xe],type:"button",role:"option",tabIndex:-1,disabled:Ce.disabled,dir:Ae,"aria-selected":de,"data-monkeys-component":"select","data-slot":"option","data-state":qe,"data-active":Ee||void 0,"data-selected":de||void 0,"data-disabled":Ce.disabled||void 0,className:m(W.slots.selectOption,Ee&&W.slots.selectOptionActive,de&&W.slots.selectOptionSelected,Ce.disabled&&W.slots.selectOptionDisabled,p?.option),style:{...W.styles.selectOption,...Ee?W.styles.selectOptionActive:void 0,...de?W.styles.selectOptionSelected:void 0},onMouseDown:Le=>Le.preventDefault(),onClick:()=>je(Xe)},jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:Ce.label}))})}),ie):null]}):jsxRuntime.jsxs("div",{...P,"data-monkeys-component":"select","data-slot":"root","data-state":J,"data-native":"true",className:m(W.slots.controlWrapper,B&&W.slots.controlInvalid,i&&W.slots.controlDisabled,p?.root,c),style:{...W.styles.control,...B?W.styles.controlInvalid:void 0,...i?W.styles.controlDisabled:void 0,...u},children:[V(r)?jsxRuntime.jsx("span",{className:m(W.slots.controlIcon,p?.icon),children:r}):null,jsxRuntime.jsxs("select",{...P,...N,id:h,ref:D,name:v,value:f,defaultValue:b,required:S,disabled:i,"aria-invalid":T??(B||void 0),"aria-label":C,"aria-labelledby":R,"aria-describedby":M,"aria-errormessage":I,"aria-required":A,"data-monkeys-component":"select","data-slot":"native","data-state":J,"data-native":"true",onBlur:ue,onFocus:k,onInvalid:w,onChange:Re,className:m(W.slots.controlBase,W.slots.controlSelect,p?.control),children:[V(o)?jsxRuntime.jsx("option",{value:"",disabled:true,children:o}):null,g]}),jsxRuntime.jsx("span",{className:W.slots.selectChevron})]})},"BaseSelect"));function nv({eyebrow:e,title:t,description:o,actions:r,children:n,appearance:i,className:s,classNames:l,style:d,...c}){let p=Ne(i),u=n??o;return jsxRuntime.jsxs("div",{...c,className:m(p.slots.sectionHeaderRoot,l?.root,s),style:{...p.styles.sectionHeader,...d},children:[jsxRuntime.jsxs("div",{className:m(p.slots.sectionHeaderContent,l?.content),children:[V(e)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderEyebrow,l?.eyebrow),children:e}):null,V(t)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderTitle,l?.title),children:t}):null,V(u)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderDescription,l?.description),children:u}):null]}),V(r)?jsxRuntime.jsx("div",{className:m(p.slots.sectionHeaderActions,l?.actions),children:r}):null]})}a(nv,"BaseSectionHeader");function gP(e,t){return t&&e?.some(o=>o.value===t)&&!e.find(r=>r.value===t)?.disabled?t:e?.find(o=>!o.disabled)?.value??e?.[0]?.value}a(gP,"getInitialSegmentValue");function sa({options:e=[],value:t,defaultValue:o,appearance:r,className:n,classNames:i,style:s,onValueChange:l,...d}){let c=Ne(r),[p,u]=ho.useState(()=>gP(e,o)),g=t!==void 0,f=g?t:p,b=a((y,k)=>{k||(g||u(y),l?.(y));},"handleSelect"),x=a(y=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(y.key))return;let k=e.filter(C=>!C.disabled);if(k.length===0)return;y.preventDefault();let w=Math.max(0,k.findIndex(C=>C.value===f)),v=y.key==="Home"?0:y.key==="End"?k.length-1:y.key==="ArrowLeft"||y.key==="ArrowUp"?(w-1+k.length)%k.length:(w+1)%k.length,h=k[v],S=y.currentTarget.querySelectorAll('[role="radio"]'),T=Array.from(S).find(C=>C.dataset.value===h.value);b(h.value),T?.focus();},"handleKeyDown");return jsxRuntime.jsx("div",{...d,role:"radiogroup","aria-orientation":"horizontal",className:m(c.slots.segmentedRoot,i?.root,n),style:{...c.styles.segmentedRoot,...s},onKeyDown:x,children:e.map(y=>{let k=y.value===f;return jsxRuntime.jsxs("button",{type:"button",role:"radio","data-value":y.value,"aria-checked":k,tabIndex:k?0:-1,disabled:y.disabled,className:m(c.slots.segmentedItem,k&&c.slots.segmentedItemActive,y.disabled&&c.slots.segmentedItemDisabled,i?.item),style:c.styles.segmentedItem,onClick:()=>b(y.value,y.disabled),children:[V(y.icon)?jsxRuntime.jsx("span",{className:m("inline-flex h-4 w-4 shrink-0",i?.icon),children:y.icon}):null,jsxRuntime.jsx("span",{className:m("min-w-0 truncate",i?.label),children:y.label})]},y.value)})})}a(sa,"BaseSegmentedControl");var xP=ho.forwardRef(a(function({decorative:t=false,label:o,appearance:r,className:n,classNames:i,style:s,...l},d){let c=Ye(),p=Pe(r),u=ke(),g=Ne(p);if(typeof t!="boolean")throw new TypeError("BaseSpinner decorative must be a boolean.");if(t&&o!==void 0)throw new TypeError("BaseSpinner label cannot be provided when decorative is true.");let f=t?void 0:o??c.loading.spinner;if(!t&&(typeof f!="string"||!f.trim()))throw new TypeError("BaseSpinner label must be a non-empty string.");return jsxRuntime.jsx("span",{...u,...l,ref:d,role:t?void 0:"status","aria-label":f,"aria-hidden":t?"true":void 0,"data-monkeys-component":"spinner","data-slot":"root","data-decorative":t||void 0,className:m(g.slots.spinnerRoot,i?.root,n),style:{...g.styles.spinner,...s},children:jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator",className:m(g.slots.spinnerIndicator,i?.indicator),style:g.styles.spinnerIndicator})})},"BaseSpinner"));var wP=ho.forwardRef(a(function({children:t,gap:o,align:r="stretch",justify:n="start",appearance:i,className:s,classNames:l,style:d,...c},p){let u=Go(),g=Pe(i),f=ke(),b=Ne(g),x=o===void 0?void 0:nr("BaseStack","gap",o);return jsxRuntime.jsx("div",{...f,...c,ref:p,"data-monkeys-component":"stack","data-slot":"root","data-align":r,"data-justify":n,className:m(b.slots.stackRoot,u>0&&o===void 0&&"gap-[var(--monkeys-bento-gap)]",g?.slots?.stackRoot,l?.root,s),style:{...b.styles.stack,gap:x??b.styles.stack?.gap,alignItems:hi("BaseStack",r),justifyContent:yi("BaseStack",n),...d},children:t})},"BaseStack"));var TP=new Set(["pending","current","completed","error"]),iv=["current","completed","error","disabled"],sv=/[\s\u0000-\u001f\u007f]/u;function lv(e){if(!e||typeof e!="object"||Array.isArray(e))return false;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}a(lv,"isPlainRecord");function dv(e){return V(e)?typeof e=="string"?!!e.trim():Array.isArray(e)?e.some(dv):true:false}a(dv,"hasStepLabel");function NP(e){try{return encodeURIComponent(e)}catch{throw new TypeError(`BaseSteps item id ${JSON.stringify(e)} must contain valid Unicode.`)}}a(NP,"encodeStepId");function RP(e){if(!Array.isArray(e))throw new TypeError("BaseSteps items must be an array.");let t=new Set,o=0,r=e.map((n,i)=>{if(!lv(n))throw new TypeError(`BaseSteps item at index ${i} must be an object.`);let s=n;if(typeof s.id!="string"||!s.id||sv.test(s.id))throw new TypeError(`BaseSteps item at index ${i} must have a non-empty id without whitespace or control characters.`);if(t.has(s.id))throw new TypeError(`BaseSteps item id ${JSON.stringify(s.id)} is duplicated.`);if(t.add(s.id),!dv(s.label))throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} label must contain renderable content.`);let l=s.status??"pending";if(!TP.has(l))throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} status must be one of: pending, current, completed, error.`);if(l==="current"&&(o+=1),s.disabled!==void 0&&typeof s.disabled!="boolean")throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} disabled must be a boolean.`);if(s.selectable!==void 0&&typeof s.selectable!="boolean")throw new TypeError(`BaseSteps item ${JSON.stringify(s.id)} selectable must be a boolean.`);return {item:s,encodedId:NP(s.id),status:l}});if(o>1)throw new RangeError("BaseSteps items may contain at most one current step.");return r}a(RP,"validateItems");function MP(e,t){if(t!==void 0&&!lv(t))throw new TypeError("BaseSteps statusLabels must be an object.");let o=t;for(let n of Object.keys(o??{}))if(!iv.includes(n))throw new TypeError(`BaseSteps statusLabels.${n} is not a supported status label.`);let r={current:o?.current??e.current,completed:o?.completed??e.completed,error:o?.error??e.error,disabled:o?.disabled??e.disabled};for(let n of iv){let i=r[n];if(typeof i!="string"||!i.trim())throw new TypeError(`BaseSteps statusLabels.${n} must be a non-empty string.`)}return r}a(MP,"resolveStatusLabels");function IP(e,t){if(e!==void 0&&(typeof e!="string"||!e.trim()))throw new TypeError("BaseSteps aria-label must be a non-empty string when provided.");if(t===void 0)return;if(typeof t!="string"||!t.trim())throw new TypeError("BaseSteps aria-labelledby must contain at least one valid ID token.");if(t.trim().split(/\s+/).some(r=>sv.test(r)))throw new TypeError("BaseSteps aria-labelledby must contain only valid ID tokens.")}a(IP,"validateAccessibleName");function DP(e,t){return e==="completed"?"\u2713":e==="error"?"!":t+1}a(DP,"getIndicator");function PP(e,t){return m(e==="pending"&&t.stepsIndicatorPending,e==="current"&&t.stepsIndicatorCurrent,e==="completed"&&t.stepsIndicatorCompleted,e==="error"&&t.stepsIndicatorError)}a(PP,"getIndicatorClassName");var EP=ho.forwardRef(a(function({items:t,orientation:o="horizontal",statusLabels:r,appearance:n,className:i,classNames:s,style:l,onStepSelect:d,"aria-label":c,"aria-labelledby":p,...u},g){let f=ho.useId(),b=Ye().steps,x=Pe(n),y=ke(),k=Ne(x);if(o!=="horizontal"&&o!=="vertical")throw new TypeError('BaseSteps orientation must be "horizontal" or "vertical".');if(d!==void 0&&typeof d!="function")throw new TypeError("BaseSteps onStepSelect must be a function.");if(typeof b.label!="string"||!b.label.trim())throw new TypeError("BaseSteps locale label must be a non-empty string.");IP(c,p);let w=RP(t),v=MP(b,r);return jsxRuntime.jsx("ol",{...y,...u,ref:g,role:"list","aria-label":c??(p===void 0?b.label:void 0),"aria-labelledby":p,"data-monkeys-component":"steps","data-slot":"root","data-orientation":o,className:m(k.slots.stepsRoot,o==="horizontal"?k.slots.stepsHorizontal:k.slots.stepsVertical,s?.root,i),style:{...k.styles.steps,...l},children:w.map(({item:h,encodedId:S,status:T},C)=>{let R=`${f}-step-${S}`,M=`${R}-label`,I=`${R}-description`,A=`${R}-status`,N=V(h.description),D=T==="pending"?void 0:v[T],E=!!(D||h.disabled),P=d!==void 0&&h.selectable!==false,W=[N?I:void 0,E?A:void 0].filter(Boolean).join(" ")||void 0,H=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"indicator",className:m(k.slots.stepsIndicator,PP(T,k.slots),s?.indicator),style:k.styles.stepsIndicator,children:DP(T,C)}),jsxRuntime.jsxs("span",{"data-slot":"content",className:m(k.slots.stepsContent,s?.content),children:[jsxRuntime.jsx("span",{id:M,"data-slot":"label",className:m(k.slots.stepsLabel,s?.label),children:h.label}),N?jsxRuntime.jsx("span",{id:I,"data-slot":"description",className:m(k.slots.stepsDescription,s?.description),children:h.description}):null,E?jsxRuntime.jsxs("span",{id:A,"data-slot":"status",className:m(k.slots.stepsStatus,s?.status),children:[D,D&&h.disabled?". ":null,h.disabled?v.disabled:null]}):null]})]});return jsxRuntime.jsxs("li",{id:R,"aria-current":T==="current"?"step":void 0,"aria-disabled":h.disabled||void 0,"data-step-id":h.id,"data-status":T,"data-disabled":h.disabled||void 0,"data-selectable":P||void 0,className:m(k.slots.stepsItem,o==="horizontal"?k.slots.stepsItemHorizontal:k.slots.stepsItemVertical,s?.item),style:k.styles.stepsItem,children:[P?jsxRuntime.jsx("button",{type:"button",disabled:h.disabled,"aria-labelledby":M,"aria-describedby":W,"data-slot":"trigger",className:m(k.slots.stepsTrigger,k.slots.stepsTriggerInteractive,h.disabled&&k.slots.stepsTriggerDisabled,s?.trigger),style:k.styles.stepsTrigger,onClick:()=>{h.disabled||d(h.id,h,C);},children:H}):jsxRuntime.jsx("div",{"data-slot":"trigger",className:m(k.slots.stepsTrigger,h.disabled&&k.slots.stepsTriggerDisabled,s?.trigger),style:k.styles.stepsTrigger,children:H}),C<w.length-1?jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"connector",className:m(k.slots.stepsConnector,o==="horizontal"?k.slots.stepsConnectorHorizontal:k.slots.stepsConnectorVertical,T==="completed"&&k.slots.stepsConnectorCompleted,T==="error"&&k.slots.stepsConnectorError,s?.connector),style:k.styles.stepsConnector}):null]},h.id)})})},"BaseSteps"));var WP={sm:"h-5 w-9",md:"h-6 w-10",lg:"h-7 w-12"},zP={sm:"h-3.5 w-3.5",md:"h-4 w-4",lg:"h-5 w-5"},OP={sm:"translate-x-[18px]",md:"translate-x-5",lg:"translate-x-6"},FP={compact:"sm",default:"md",comfortable:"lg"},cv=ho.forwardRef(a(function({label:t,description:o,disabled:r=false,controlSize:n,appearance:i,className:s,classNames:l,style:d,checked:c,defaultChecked:p,onChange:u,...g},f){if(typeof r!="boolean")throw new TypeError("BaseSwitch disabled must be a boolean.");if(n!==void 0&&n!=="sm"&&n!=="md"&&n!=="lg")throw new TypeError('BaseSwitch controlSize must be "sm", "md", or "lg".');let b=Pe(i),x=ke(),y=Ne(b),k=V(t),w=Md(o),[v,h]=ho.useState(p??false),S=c!==void 0,T=S?c:v,C=T?"checked":"unchecked",R=n??FP[y.density],M=a(I=>{r||(S||h(I.currentTarget.checked),u?.(I));},"handleChange");return jsxRuntime.jsxs("label",{...x,"data-monkeys-component":"switch","data-slot":"root","data-state":C,"data-size":n,"data-disabled":r||void 0,className:m(y.slots.switchRoot,!w&&"items-center",r&&y.slots.switchDisabled,l?.root,s),style:{...y.styles.switchRoot,...d},children:[jsxRuntime.jsxs("span",{"data-slot":"track","data-state":C,"data-size":n,className:m(y.slots.switchTrack,!w&&"mt-0",T&&y.slots.switchChecked,n&&WP[n],l?.track),style:y.styles.switchTrack,children:[jsxRuntime.jsx("input",{...g,ref:f,type:"checkbox",role:"switch",disabled:r,checked:c,defaultChecked:p,"aria-checked":T,"data-slot":"input","data-state":C,"data-size":n,"data-disabled":r||void 0,onChange:M,className:m(y.slots.switchInput,l?.input)}),jsxRuntime.jsx("span",{"aria-hidden":"true","data-slot":"thumb","data-state":C,"data-size":n,className:m(y.slots.switchThumb,n&&zP[n],T&&OP[R],l?.thumb),style:y.styles.switchThumb})]}),k||w?jsxRuntime.jsxs("span",{"data-slot":"content",className:m(y.slots.switchContent,l?.content),children:[k?jsxRuntime.jsx("span",{"data-slot":"label",className:m(y.slots.switchLabel,l?.label),children:t}):null,w?jsxRuntime.jsx("span",{"data-slot":"description",className:m(y.slots.switchDescription,l?.description),children:o}):null]}):null]})},"BaseSwitch"));function VP({kind:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-7 w-7",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",children:{error:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9"}),jsxRuntime.jsx("path",{d:"M12 7v6"}),jsxRuntime.jsx("path",{d:"M12 17h.01"})]}),permission:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2"}),jsxRuntime.jsx("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"})]}),offline:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 12.5a10 10 0 0 1 14 0"}),jsxRuntime.jsx("path",{d:"M8.5 16a5 5 0 0 1 7 0"}),jsxRuntime.jsx("path",{d:"M12 20h.01"}),jsxRuntime.jsx("path",{d:"m4 4 16 16"})]}),fallback:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"9"}),jsxRuntime.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 4.2 1.8c-1 .8-1.7 1.2-1.7 2.7"}),jsxRuntime.jsx("path",{d:"M12 17h.01"})]})}[e]})}a(VP,"SystemStateIcon");var Fa=ho.forwardRef(a(function({kind:t="fallback",icon:o,title:r,description:n,actions:i,appearance:s,className:l,classNames:d,style:c,role:p,"aria-live":u,...g},f){let b=Pe(s),x=ke(),y=Or(),k=y.density==="compact"?"min-h-0 px-3 py-3":y.density==="comfortable"?"min-h-56 px-8 py-12":void 0,w=Ne(b),v=o===void 0?jsxRuntime.jsx(VP,{kind:t}):o,h=p??(t==="error"||t==="offline"?"alert":"status");return jsxRuntime.jsxs("div",{...x,...g,ref:f,role:h,"aria-live":u??(h==="alert"?"assertive":"polite"),"data-monkeys-component":"system-state","data-slot":"root","data-state":t,"data-density":y.density,className:m(w.slots.stateRoot,k,d?.root,l),style:{...w.styles.stateRoot,...c},children:[V(v)?jsxRuntime.jsx("div",{"data-slot":"icon","data-state":t,className:m(w.slots.stateIcon,d?.icon),style:w.styles.stateIcon,children:v}):null,V(r)?jsxRuntime.jsx("div",{"data-slot":"title","data-state":t,className:m(w.slots.stateTitle,d?.title),children:r}):null,V(n)?jsxRuntime.jsx("div",{"data-slot":"description","data-state":t,className:m(w.slots.stateDescription,d?.description),children:n}):null,V(i)?jsxRuntime.jsx("div",{"data-slot":"actions","data-state":t,className:m(w.slots.stateActions,d?.actions),children:i}):null]})},"BaseSystemState"));var lf="application/x-monkeys-base-table-column",jc=8;function pf(e,t){typeof e=="function"?e(t):e&&(e.current=t);}a(pf,"assignRef");function qr(e,t){if(t!==void 0&&typeof t!="boolean")throw new Error(`BaseTable ${e} must be a boolean.`)}a(qr,"assertBoolean");function Bi(e,t,o){if(t!==void 0&&!o.includes(t))throw new Error(`BaseTable ${e} must be one of ${o.map(r=>`"${r}"`).join(", ")}.`)}a(Bi,"assertEnum");function Kc(e,t){if(t!==void 0&&(typeof t!="string"||t.trim().length===0))throw new Error(`BaseTable ${e} must be a non-empty string when provided.`)}a(Kc,"assertOptionalLabel");function uf(e,t){if(t!==void 0&&typeof t!="function")throw new Error(`BaseTable ${e} must be a function when provided.`)}a(uf,"assertOptionalFunction");function yn(e,t,o={}){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable ${t} must be a finite non-negative number${o.stringAllowed?" or a non-empty CSS size string":""}.`);return}if(!(o.stringAllowed&&typeof e=="string"&&e.trim().length>0))throw new Error(`BaseTable ${t} must be ${o.stringAllowed?"a finite non-negative number or a non-empty CSS size string":"a finite non-negative number"}.`)}}a(yn,"validateCssSizeValue");function UP(e){if(e===void 0)return;if(!Array.isArray(e))throw new Error("BaseTable columns must be an array when provided.");let t=new Set;return e.forEach((o,r)=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error(`BaseTable column at index ${r} must be an object.`);let n=o;if(typeof n.id!="string"||n.id.trim().length===0)throw new Error(`BaseTable column id at index ${r} must be a non-empty string.`);let i=n.id.trim();if(n.id!==i)throw new Error(`BaseTable column id "${n.id}" must not contain surrounding whitespace.`);if(t.has(i))throw new Error(`BaseTable columns contain duplicate id "${i}".`);if(t.add(i),yn(n.width,`column "${i}" width`,{stringAllowed:true}),yn(n.minWidth,`column "${i}" minWidth`,{stringAllowed:true}),yn(n.maxWidth,`column "${i}" maxWidth`,{stringAllowed:true}),typeof n.minWidth=="number"&&typeof n.maxWidth=="number"&&n.minWidth>n.maxWidth)throw new Error(`BaseTable column "${i}" minWidth cannot be greater than maxWidth.`)}),t}a(UP,"validateColumns");function KP(e,t){if(e===void 0)return;if(!Array.isArray(e))throw new Error("BaseTable columnOrder must be an array when provided.");let o=new Set;if(e.forEach((r,n)=>{if(typeof r!="string"||r.trim().length===0)throw new Error(`BaseTable columnOrder entry at index ${n} must be a non-empty string.`);let i=r.trim();if(r!==i)throw new Error(`BaseTable columnOrder entry "${r}" must not contain surrounding whitespace.`);if(o.has(i))throw new Error(`BaseTable columnOrder contains duplicate id "${i}".`);if(t&&!t.has(i))throw new Error(`BaseTable columnOrder contains unknown column id "${i}".`);o.add(i);}),t&&o.size!==t.size){let r=[...t].filter(n=>!o.has(n));throw new Error(`BaseTable columnOrder must contain every configured column id; missing ${r.map(n=>`"${n}"`).join(", ")}.`)}}a(KP,"validateColumnOrder");function qP(e,t){if(e!==void 0){if(!e||typeof e!="object"||Array.isArray(e)||![Object.prototype,null].includes(Object.getPrototypeOf(e)))throw new Error("BaseTable columnSizes must be a plain record when provided.");Object.entries(e).forEach(([o,r])=>{let n=o.trim();if(n.length===0)throw new Error("BaseTable columnSizes keys must be non-empty strings.");if(o!==n)throw new Error(`BaseTable columnSizes key "${o}" must not contain surrounding whitespace.`);if(t&&!t.has(n))throw new Error(`BaseTable columnSizes contains unknown column id "${o}".`);yn(r,`columnSizes["${o}"]`);});}}a(qP,"validateColumnSizes");function Uc(e){let t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).direction==="rtl":e.closest('[dir="rtl"]')!==null}a(Uc,"isRtl");function YP(e,t){if(e.setPointerCapture)try{e.setPointerCapture(t);}catch(o){let r=e.ownerDocument.defaultView?.DOMException;if(r&&o instanceof r&&o.name==="NotFoundError")return;throw o}}a(YP,"setPointerCaptureIfAvailable");var fv=ho.createContext(null);function xn(e){let t=ho.useContext(fv),o=Pe(e);if(t){let n=e===void 0?t.appearance:o;return {...t,theme:e===void 0?t.theme:Ne(n),appearance:n}}let r=Ne(o);return {appearance:o,theme:r,layout:"native",setDraggingColumnId:a(()=>{},"setDraggingColumnId")}}a(xn,"useBaseTableContext");function bv(e){let t=false;return ho.Children.forEach(e,o=>{if(t||!ho.isValidElement(o))return;let r=o.props;if(r.layout==="split-scroll"){t=true;return}r.children&&(t=bv(r.children));}),t}a(bv,"hasSplitScrollTable");function qc(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(qc,"toCssSize");function XP(e,t){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable ${t} must be a finite non-negative number when numeric.`);return `${e}px`}if(e.trim().length===0)throw new Error(`BaseTable ${t} must not be an empty CSS size.`);return e}}a(XP,"validateTableCssSize");function df(e,t,o){if(e!==void 0){if(typeof e=="number"){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable split-scroll column "${t}" has invalid ${o}. Expected a finite non-negative number.`);return `${e}px`}if(e.trim().length===0)throw new Error(`BaseTable split-scroll column "${t}" has an empty ${o} value.`);return e}}a(df,"validateCssSize");function pv(e,t,o){if(!(e===void 0||typeof e!="number")){if(!Number.isFinite(e)||e<0)throw new Error(`BaseTable split-scroll column "${t}" has invalid ${o}. Expected a finite non-negative number.`);return e}}a(pv,"validateNumericSize");function QP(e,t){if(!e?.length)throw new Error('BaseTable layout="split-scroll" requires at least one column definition.');let o=new Set;return `${e.map((n,i)=>{let s=n.id.trim();if(!s)throw new Error(`BaseTable split-scroll column at index ${i} requires a non-empty id.`);if(o.has(s))throw new Error(`BaseTable layout="split-scroll" received duplicate column id "${s}".`);o.add(s);let l=t?.[s],d=pv(n.minWidth,s,"minWidth"),c=pv(n.maxWidth,s,"maxWidth");if(d!==void 0&&c!==void 0&&c<d)throw new Error(`BaseTable split-scroll column "${s}" has maxWidth smaller than minWidth.`);let p=df(n.minWidth,s,"minWidth"),u=df(n.maxWidth,s,"maxWidth"),g=l!==void 0?la(l,d,c):n.width,f=df(g,s,"width");return f||`minmax(${p??"0px"}, ${u??"1fr"})`}).join(" ")} var(--base-table-split-scrollbar-gutter)`}a(QP,"buildSplitColumnTemplate");function la(e,t,o){let r=t??48,n=o??Number.POSITIVE_INFINITY;return Math.min(Math.max(e,r),n)}a(la,"clampWidth");function cf(e,t,o){if(!e||t===o)return;let r=e.indexOf(t),n=e.indexOf(o);if(r<0||n<0)return;let i=[...e],[s]=i.splice(r,1);return i.splice(n,0,s),i}a(cf,"getNextColumnOrder");function ZP(e){switch(e){case "asc":return "ascending";case "desc":return "descending";default:return}}a(ZP,"sortAriaValue");function JP(e){switch(e){case "center":return "center";case "right":return "flex-end";default:return "flex-start"}}a(JP,"getSplitHeadJustifyContent");function eE(e){switch(e){case "top":return "flex-start";case "bottom":return "flex-end";default:return "center"}}a(eE,"getSplitHeadAlignItems");function tE({direction:e,className:t}){return jsxRuntime.jsx("span",{"aria-hidden":"true",className:m(t,e==="desc"&&"rotate-180",(!e||e==="none")&&"opacity-45"),children:"\u25B2"})}a(tE,"SortIndicator");function oE(){return jsxRuntime.jsxs("span",{"aria-hidden":"true",className:"grid gap-0.5",children:[jsxRuntime.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-current"}),jsxRuntime.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-current"}),jsxRuntime.jsx("span",{className:"h-0.5 w-0.5 rounded-full bg-current"})]})}a(oE,"DragHandleIcon");var Li=ho.forwardRef(a(function({appearance:t,attachedFooter:o=false,children:r,className:n,classNames:i,style:s,...l},d){qr("attachedFooter",o);let c=Pe(t),p=ke(),u=Ne(c),f=bv(r)?{overflow:"hidden",scrollbarGutter:"auto"}:void 0;return jsxRuntime.jsx("div",{...p,...l,ref:d,"data-monkeys-component":"table-container","data-slot":"container","data-base-table-container":"","data-attached-footer":o?"":void 0,className:m(u.slots.tableContainer,o&&u.slots.tableContainerFooterAttached,i?.root,n),style:{...u.styles.tableContainer,...o?u.styles.tableContainerFooterAttached:void 0,...f,...s},children:r})},"BaseTableContainer")),Wi=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,layout:i="native",columns:s,bodyMaxHeight:l,bodyClassName:d,columnOrder:c,columnSizes:p,columnDragEnabled:u=false,columnResizeEnabled:g=false,onColumnOrderChange:f,onColumnSizeChange:b,...x},y){Bi("layout",i,["native","split-scroll"]),qr("columnDragEnabled",u),qr("columnResizeEnabled",g),uf("onColumnOrderChange",f),uf("onColumnSizeChange",b),yn(l,"bodyMaxHeight",{stringAllowed:true});let k=UP(s);KP(c,k),qP(p,k);let w=Pe(t),v=ke(),h=Ne(w),[S,T]=ho.useState(),C=ho.useRef(null),R=ho.useRef(null),M=i==="split-scroll",I=M?QP(s,p):void 0,A={appearance:w,theme:h,layout:i,columnTemplate:I,bodyMaxHeight:l,bodyClassName:d,splitHeaderRef:C,splitFooterRef:R,columnOrder:c,columnSizes:p,columnDragEnabled:u,columnResizeEnabled:g,onColumnOrderChange:f,onColumnSizeChange:b,draggingColumnId:S,setDraggingColumnId:T};return jsxRuntime.jsx(fv.Provider,{value:A,children:jsxRuntime.jsx("table",{...v,...x,ref:y,"data-monkeys-component":"table","data-slot":"root","data-base-table-layout":i,className:m(h.slots.tableRoot,M&&h.slots.tableSplitRoot,r?.root,o),style:{...h.styles.table,...M?h.styles.tableSplitRoot:void 0,...I?{"--base-table-column-template":I}:void 0,...n}})})},"BaseTable")),zi=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,...i},s){let{layout:l,splitHeaderRef:d,theme:c}=xn(t),p=l==="split-scroll";return jsxRuntime.jsx("thead",{...i,ref:a(g=>{d&&(d.current=p?g:null),pf(s,g);},"setHeaderRef"),"data-slot":"header",className:m(c.slots.tableHeader,p&&c.slots.tableSplitHeader,r?.root,o),style:{...c.styles.tableHeader,...p?c.styles.tableSplitHeader:void 0,...n}})},"BaseTableHeader")),Oi=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,onScroll:n,style:i,...s},l){let{bodyClassName:d,bodyMaxHeight:c,layout:p,splitFooterRef:u,splitHeaderRef:g,theme:f}=xn(t),b=p==="split-scroll";return jsxRuntime.jsx("tbody",{...s,ref:l,"data-slot":"body",onScroll:b?y=>{let k=y.currentTarget.scrollLeft;g?.current&&(g.current.scrollLeft=k),u?.current&&(u.current.scrollLeft=k),n?.(y);}:n,className:m(f.slots.tableBody,b&&f.slots.tableSplitBody,b&&d,r?.root,o),style:{...f.styles.tableBody,...b?f.styles.tableSplitBody:void 0,...b&&c!==void 0?{maxHeight:XP(c,"bodyMaxHeight")}:void 0,...i}})},"BaseTableBody")),gv=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,...i},s){let{layout:l,splitFooterRef:d,theme:c}=xn(t),p=l==="split-scroll";return jsxRuntime.jsx("tfoot",{...i,ref:a(g=>{d&&(d.current=p?g:null),pf(s,g);},"setFooterRef"),"data-slot":"footer",className:m(c.slots.tableFooter,p&&c.slots.tableSplitFooter,r?.root,o),style:{...c.styles.tableFooter,...p?c.styles.tableSplitFooter:void 0,...n}})},"BaseTableFooter")),vn=ho.forwardRef(a(function({interactive:t,selected:o,disabled:r,appearance:n,className:i,classNames:s,style:l,...d},c){qr("interactive",t),qr("selected",o),qr("disabled",r);let{layout:p,theme:u}=xn(n),g=p==="split-scroll";return jsxRuntime.jsx("tr",{...d,ref:c,"data-slot":"row","aria-disabled":r||void 0,"data-state":o?"selected":void 0,className:m(u.slots.tableRow,g&&u.slots.tableSplitRow,t&&!r&&u.slots.tableRowInteractive,o&&u.slots.tableRowSelected,r&&u.slots.tableRowDisabled,s?.root,i),style:{...u.styles.tableRow,...g?u.styles.tableSplitRow:void 0,...l}})},"BaseTableRow")),Fi=ho.forwardRef(a(function({presentation:t,columnId:o,align:r,verticalAlign:n,icon:i,label:s,description:l,meta:d,actions:c,trailing:p,sortable:u,sortDirection:g="none",sortLabel:f,onSort:b,draggable:x,dragLabel:y,resizable:k,resizeLabel:w,width:v,minWidth:h,maxWidth:S,appearance:T,className:C,classNames:R,style:M,children:I,onDragOver:A,onDrop:N,...D},E){if(Bi("head presentation",t,["classic-data-grid"]),Bi("head align",r,["left","center","right"]),Bi("head verticalAlign",n,["top","middle","bottom"]),Bi("head sortDirection",g,["asc","desc","none"]),qr("head sortable",u),qr("head draggable",x),qr("head resizable",k),uf("head onSort",b),Kc("head sortLabel",f),Kc("head dragLabel",y),Kc("head resizeLabel",w),o!==void 0&&(typeof o!="string"||o.trim().length===0))throw new Error("BaseTable head columnId must be a non-empty string when provided.");if(yn(v,"head width",{stringAllowed:true}),yn(h,"head minWidth"),yn(S,"head maxWidth"),h!==void 0&&S!==void 0&&h>S)throw new Error("BaseTable head minWidth cannot be greater than maxWidth.");let P=xn(T),{theme:W}=P,H=Ye().table,B=P.layout==="split-scroll",L=t==="classic-data-grid",F=r??(B?"center":"left"),_=n??"middle",$=ho.useRef(null),G=ho.useRef(()=>{}),[z,re]=ho.useState(),Z=a(ce=>{$.current=ce,pf(E,ce);},"setHeadRef"),ae=o&&P.columnSizes?.[o]!==void 0?P.columnSizes[o]:v,ee=!!(o&&x!==false&&(x||P.columnDragEnabled)&&P.columnOrder&&P.onColumnOrderChange),q=!!(o&&k!==false&&(k||P.columnResizeEnabled)&&P.onColumnSizeChange);if(q&&S!==void 0&&S<(h??48))throw new Error("BaseTable resizable head maxWidth cannot be smaller than its effective minWidth.");let U=!!(u||b),X=ZP(g),O=V(s)?s:I,K=V(O)||V(l),ne=f??(K?void 0:H.sortColumn({columnId:o?.trim()||void 0})),fe=ee||V(i)||V(s)||V(l)||V(d)||V(c)||V(p)||U,he=L?jsxRuntime.jsx("div",{className:m("flex h-full min-w-0 select-none items-center",F==="center"?"justify-center":F==="right"?"justify-end":"justify-start",ee&&"cursor-grab active:cursor-grabbing"),...ee?{draggable:true,role:"button",tabIndex:0,"aria-disabled":false,"aria-roledescription":"sortable",onKeyDown:a(ce=>{if(!o||!P.columnOrder||ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;let Q=P.columnOrder.indexOf(o);if(Q<0)return;let ge=Uc(ce.currentTarget),we=ce.key==="ArrowLeft"?-1:1,Ie=Q+(ge?-we:we),oe=P.columnOrder[Ie];if(!oe)return;let xe=cf(P.columnOrder,o,oe);xe&&(ce.preventDefault(),P.onColumnOrderChange?.(xe,{columnId:o,targetColumnId:oe}));},"onKeyDown"),onDragStart:a(ce=>{ce.stopPropagation(),P.setDraggingColumnId(o),ce.dataTransfer.effectAllowed="move",ce.dataTransfer.setData(lf,o);},"onDragStart"),onDragEnd:a(ce=>{ce.stopPropagation(),P.setDraggingColumnId(void 0);},"onDragEnd")}:{},children:O}):fe?jsxRuntime.jsxs("div",{className:m(W.slots.tableHeadContent,R?.content),children:[jsxRuntime.jsxs("div",{className:m(W.slots.tableHeadMain,R?.main),children:[ee?jsxRuntime.jsx("button",{type:"button",draggable:true,title:y,"aria-label":y??H.dragColumn({columnId:o}),className:m(W.slots.tableHeadDragHandle,R?.dragHandle),onClick:ce=>ce.stopPropagation(),onKeyDown:ce=>{if(!o||!P.columnOrder||ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;let Q=P.columnOrder.indexOf(o);if(Q<0)return;let ge=Uc(ce.currentTarget),we=ce.key==="ArrowLeft"?-1:1,Ie=Q+(ge?-we:we),oe=P.columnOrder[Ie];if(!oe)return;let xe=cf(P.columnOrder,o,oe);xe&&(ce.preventDefault(),P.onColumnOrderChange?.(xe,{columnId:o,targetColumnId:oe}));},onDragStart:ce=>{ce.stopPropagation(),P.setDraggingColumnId(o),ce.dataTransfer.effectAllowed="move",ce.dataTransfer.setData(lf,o);},onDragEnd:ce=>{ce.stopPropagation(),P.setDraggingColumnId(void 0);},children:jsxRuntime.jsx(oE,{})}):null,i?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadIcon,R?.icon),children:i}):null,U?jsxRuntime.jsxs("button",{type:"button",disabled:!b,title:f,"aria-label":ne,className:m(W.slots.tableHeadSortButton,R?.sortButton),onClick:ce=>{ce.stopPropagation(),b?.(o);},children:[jsxRuntime.jsxs("span",{className:m(W.slots.tableHeadText,R?.text),children:[V(O)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadLabel,R?.label),children:O}):null,V(l)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadDescription,R?.description),children:l}):null]}),jsxRuntime.jsx(tE,{direction:g,className:m(W.slots.tableHeadSortIcon,R?.sortIcon)})]}):jsxRuntime.jsxs("span",{className:m(W.slots.tableHeadText,R?.text),children:[V(O)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadLabel,R?.label),children:O}):null,V(l)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadDescription,R?.description),children:l}):null]})]}),V(d)||V(c)||V(p)?jsxRuntime.jsxs("div",{className:m(W.slots.tableHeadActions,R?.actions),children:[V(d)?jsxRuntime.jsx("span",{className:m(W.slots.tableHeadMeta,R?.meta),children:d}):null,c,p]}):null]}):I,me=a(ce=>{A?.(ce),!(!ee||!P.draggingColumnId||P.draggingColumnId===o)&&(ce.preventDefault(),ce.dataTransfer.dropEffect="move");},"handleDragOver"),ie=a(ce=>{if(N?.(ce),!ee||!o)return;let Q=P.draggingColumnId||ce.dataTransfer.getData(lf);if(!Q||Q===o)return;let ge=cf(P.columnOrder,Q,o);ge&&(ce.preventDefault(),P.onColumnOrderChange?.(ge,{columnId:Q,targetColumnId:o})),P.setDraggingColumnId(void 0);},"handleDrop"),be=a(ce=>{if(!q||!o||!P.onColumnSizeChange||ce.button!==0&&ce.pointerType!=="touch")return;ce.preventDefault(),ce.stopPropagation(),G.current();let Q=ce.clientX,ge=He??$.current?.offsetWidth??h??48,we=la(ge,h,S),Ie=ce.pointerId,oe=ce.currentTarget,xe=oe.ownerDocument,Ve=Uc(oe),_e=a(Me=>{if(Me.pointerId!==Ie)return;let Ae=la(we+(Ve?Q-Me.clientX:Me.clientX-Q),h,S);P.onColumnSizeChange?.(o,Ae,{columnId:o,previousWidth:we,minWidth:h,maxWidth:S});},"handlePointerMove"),Ge=a(Me=>{Me.pointerId===Ie&&G.current();},"handleStop"),le=a(Me=>{Me.pointerId===Ie&&G.current();},"handleLostCapture");G.current=()=>{xe.removeEventListener("pointermove",_e),xe.removeEventListener("pointerup",Ge),xe.removeEventListener("pointercancel",Ge),oe.removeEventListener("lostpointercapture",le),oe.hasPointerCapture?.(Ie)&&oe.releasePointerCapture?.(Ie),G.current=()=>{};},YP(oe,Ie),xe.addEventListener("pointermove",_e),xe.addEventListener("pointerup",Ge),xe.addEventListener("pointercancel",Ge),oe.addEventListener("lostpointercapture",le);},"handleResizePointerDown"),He=typeof ae=="number"?la(ae,h,S):z,We=He??la(h??48,h,S),Ke=a(ce=>{if(!q||!o||!P.onColumnSizeChange)return;let Q=Uc(ce.currentTarget),ge=He??la($.current?.offsetWidth||h||48,h,S),we;ce.key==="ArrowLeft"&&(we=ge+(Q?jc:-jc)),ce.key==="ArrowRight"&&(we=ge+(Q?-jc:jc)),ce.key==="Home"&&h!==void 0&&(we=h),ce.key==="End"&&S!==void 0&&(we=S),we!==void 0&&(ce.preventDefault(),ce.stopPropagation(),P.onColumnSizeChange(o,la(we,h,S),{columnId:o,previousWidth:ge,minWidth:h,maxWidth:S}));},"handleResizeKeyDown");return ho.useEffect(()=>{if(typeof ae=="number"){re(void 0);return}let ce=$.current?.getBoundingClientRect().width;if(ce&&Number.isFinite(ce)){let Q=la(ce,h,S);re(ge=>ge===Q?ge:Q);}},[ae,h,S,q]),ho.useEffect(()=>(q||G.current(),()=>G.current()),[q,o,P.onColumnSizeChange]),jsxRuntime.jsxs("th",{...D,ref:Z,"data-slot":"head","data-v2-header-drag-id":L&&ee?o:void 0,scope:D.scope??"col","aria-sort":X,className:m(W.slots.tableHead,B&&W.slots.tableSplitHead,F==="center"&&W.slots.tableCellAlignCenter,F==="right"&&W.slots.tableCellAlignRight,L&&"!relative !h-9 !px-3 !align-middle !text-sm !font-medium !text-muted-foreground after:pointer-events-none after:absolute after:bottom-2 after:right-0 after:top-2 after:w-px after:bg-border/50 after:content-['']",R?.root,C),style:{...W.styles.tableHead,...B?W.styles.tableSplitHead:void 0,width:B?void 0:qc(ae),minWidth:B?void 0:qc(h),maxWidth:B?void 0:qc(S),...B?{alignItems:eE(_),justifyContent:JP(F),textAlign:F}:n?{verticalAlign:n}:void 0,...M},onDragOver:me,onDrop:ie,children:[he,q&&L?jsxRuntime.jsx("div",{"data-column-resize-handle":"true",className:"absolute right-0 top-0 z-20 h-full w-2 cursor-col-resize touch-none select-none hover:bg-muted",onPointerDown:be}):q?jsxRuntime.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-valuenow":We,"aria-valuemin":h??48,"aria-valuemax":S,"aria-valuetext":`${We}px`,title:w,"aria-label":w??H.resizeColumn({columnId:o}),className:m(W.slots.tableHeadResizeHandle,R?.resizeHandle),onClick:ce=>ce.stopPropagation(),onKeyDown:Ke,onPointerDown:be}):null]})},"BaseTableHead")),Ha=ho.forwardRef(a(function({align:t="left",appearance:o,className:r,classNames:n,style:i,...s},l){Bi("cell align",t,["left","center","right"]);let{layout:d,theme:c}=xn(o),p=d==="split-scroll";return jsxRuntime.jsx("td",{...s,ref:l,"data-slot":"cell",className:m(c.slots.tableCell,p&&c.slots.tableSplitCell,t==="center"&&c.slots.tableCellAlignCenter,t==="right"&&c.slots.tableCellAlignRight,n?.root,r),style:{...c.styles.tableCell,...p?c.styles.tableSplitCell:void 0,...i}})},"BaseTableCell")),hv=ho.forwardRef(a(function({appearance:t,className:o,classNames:r,style:n,...i},s){let{theme:l}=xn(t);return jsxRuntime.jsx("caption",{...i,ref:s,"data-slot":"caption",className:m(l.slots.tableCaption,r?.root,o),style:{...l.styles.tableCaption,...n}})},"BaseTableCaption")),Hi=ho.forwardRef(a(function({colSpan:t,icon:o,title:r,description:n,actions:i,children:s,appearance:l,className:d,classNames:c,style:p,...u},g){if(!Number.isSafeInteger(t)||t<1)throw new Error("BaseTable empty colSpan must be a positive safe integer.");let{layout:f,theme:b}=xn(l),x=f==="split-scroll",y=V(o)||V(r)||V(n)||V(i);return jsxRuntime.jsx("tr",{...u,ref:g,"data-slot":"empty-row",className:m(b.slots.tableEmptyRow,x&&b.slots.tableSplitRow,c?.row,d),style:{...b.styles.tableEmpty,...x?b.styles.tableSplitRow:void 0,...p},children:jsxRuntime.jsx("td",{colSpan:t,"data-slot":"empty-cell",className:m(b.slots.tableEmptyCell,x&&b.slots.tableSplitCell,c?.cell),style:x?{gridColumn:"1 / -1"}:void 0,children:y?jsxRuntime.jsxs("div",{className:m(b.slots.tableEmptyContent,c?.content),children:[V(o)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyIcon,c?.icon),children:o}):null,V(r)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyTitle,c?.title),children:r}):null,V(n)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyDescription,c?.description),children:n}):null,V(i)?jsxRuntime.jsx("div",{className:m(b.slots.tableEmptyActions,c?.actions),children:i}):null]}):s})})},"BaseTableEmpty"));function rE({baseClassName:e,className:t,style:o}){let r=Jd();return jsxRuntime.jsx("div",{ref:r.ref,"aria-hidden":"true","data-slot":"loading-skeleton","data-skeleton-animation":r.mode,className:m(e,r.mode==="pulse"&&"animate-pulse motion-reduce:animate-none",t),style:{...r.style,...o}})}a(rE,"BaseTableLoadingSkeleton");function yv({rows:e=3,columns:t,columnWidths:o=[],animated:r=true,animation:n,rowLabel:i,appearance:s,className:l,classNames:d,style:c}){if(!Number.isSafeInteger(e)||e<0)throw new Error("BaseTable loading rows must be a non-negative safe integer.");if(!Number.isSafeInteger(t)||t<1)throw new Error("BaseTable loading columns must be a positive safe integer.");if(!Array.isArray(o))throw new Error("BaseTable loading columnWidths must be an array.");o.forEach((x,y)=>yn(x,`loading columnWidths[${y}]`,{stringAllowed:true})),qr("loading animated",r),Kc("loading rowLabel",i);let{layout:p,theme:u}=xn(s),g=Ye().table,f=i??g.loadingRow,b=p==="split-scroll";return jsxRuntime.jsx(Xn,{animation:n,animated:r,children:Array.from({length:e}).map((x,y)=>jsxRuntime.jsx(Zd,{index:y,children:jsxRuntime.jsx("tr",{"data-slot":"loading-row","aria-label":`${f} ${y+1}`,"aria-busy":"true",className:m(u.slots.tableLoadingRow,b&&u.slots.tableSplitRow,d?.row,l),style:{...u.styles.tableLoading,...b?u.styles.tableSplitRow:void 0,...c},children:Array.from({length:t}).map((k,w)=>jsxRuntime.jsx("td",{"data-slot":"loading-cell",className:m(u.slots.tableLoadingCell,b&&u.slots.tableSplitCell,d?.cell),children:jsxRuntime.jsx(rE,{baseClassName:u.slots.tableLoadingSkeleton,className:d?.skeleton,style:{width:qc(o[w])}})},w))})},y))})}a(yv,"BaseTableLoading");var xv=ho.forwardRef(a(function({appearance:t,leading:o,actions:r,attached:n=true,children:i,className:s,classNames:l,style:d,...c},p){if(typeof n!="boolean")throw new Error("BaseTableFooterBar attached must be a boolean.");let u=Pe(t),g=ke(),f=Ne(u);return jsxRuntime.jsxs("div",{...g,...c,ref:p,"data-monkeys-component":"table-footer-bar","data-slot":"footer-bar","data-base-table-footer-bar":"","data-attached":n?"":void 0,className:m(f.slots.tableFooterBar,n&&f.slots.tableFooterBarAttached,l?.root,s),style:{...f.styles.tableFooterBar,...d},children:[V(o)?jsxRuntime.jsx("div",{className:m(f.slots.tableFooterBarLeading,l?.leading),children:o}):null,V(i)?jsxRuntime.jsx("div",{className:m(f.slots.tableFooterBarContent,l?.content),children:i}):null,V(r)?jsxRuntime.jsx("div",{className:m(f.slots.tableFooterBarActions,l?.actions),children:r}):null]})},"BaseTableFooterBar"));function dE({items:e,value:t,defaultValue:o,orientation:r,activationMode:n}){if(!Array.isArray(e))throw new TypeError("BaseTabs items must be an array.");if(t!==void 0&&typeof t!="string")throw new TypeError("BaseTabs value must be a string.");if(o!==void 0&&typeof o!="string")throw new TypeError("BaseTabs defaultValue must be a string.");if(r!=="horizontal"&&r!=="vertical")throw new TypeError('BaseTabs orientation must be "horizontal" or "vertical".');if(n!=="automatic"&&n!=="manual")throw new TypeError('BaseTabs activationMode must be "automatic" or "manual".');let i=new Set;e.forEach((s,l)=>{if(!s||typeof s!="object")throw new TypeError(`BaseTabs item at index ${l} must be an object.`);if(typeof s.value!="string")throw new TypeError(`BaseTabs item value at index ${l} must be a string.`);if(i.has(s.value))throw new TypeError(`BaseTabs items must use unique values; duplicate value ${JSON.stringify(s.value)} at index ${l}.`);if(s.disabled!==void 0&&typeof s.disabled!="boolean")throw new TypeError(`BaseTabs item disabled at index ${l} must be a boolean.`);i.add(s.value);});}a(dE,"validateTabsProps");function ff(e,t){return t!==void 0&&e.some(o=>o.value===t&&!o.disabled)?t:e.find(o=>!o.disabled)?.value}a(ff,"getResolvedValue");function cE(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}a(cE,"toDomId");function uE(e){let t=new Set;return e.map((o,r)=>{let n=cE(o.value),i=n;if(t.has(i))for(i=`${n}-${r}`;t.has(i);)i=`${i}-${r}`;return t.add(i),i})}a(uE,"getDomIdFragments");function pE(e,t){let n=e.currentTarget.ownerDocument.defaultView?.getComputedStyle(e.currentTarget).direction==="rtl";return t==="ArrowRight"?n?-1:1:n?1:-1}a(pE,"getHorizontalStep");var wv=ho.forwardRef(a(function({items:t=[],value:o,defaultValue:r,orientation:n="horizontal",activationMode:i="automatic",appearance:s,className:l,classNames:d,style:c,onValueChange:p,id:u,"aria-label":g,"aria-labelledby":f,...b},x){dE({items:t,value:o,defaultValue:r,orientation:n,activationMode:i});let y=Pe(s),k=ke(),w=Ne(y),v=ho.useId(),h=u??v,S=o!==void 0?o:r,[T,C]=ho.useState(()=>ff(t,r)),[R,M]=ho.useState(()=>ff(t,S)),I=ho.useRef([]),A=o!==void 0,N=ff(t,A?o:T),D=t.findIndex(z=>z.value===N&&!z.disabled),E=D>=0?t[D]:void 0,P=t.reduce((z,re,Z)=>(re.disabled||z.push(Z),z),[]),W=t.findIndex(z=>z.value===R&&!z.disabled),H=W>=0?W:D,B=uE(t),L=E?"active":"disabled",F=typeof b.dir=="string"?b.dir:k.dir,_=a(z=>{z.disabled||(A||C(z.value),p?.(z.value));},"activateItem"),$=a((z,re)=>{let Z=t[re];!Z||Z.disabled||(z.preventDefault(),M(Z.value),I.current[re]?.focus(),i==="automatic"&&_(Z));},"moveFocus"),G=a((z,re,Z)=>{if(re.disabled)return;if(i==="manual"&&(z.key==="Enter"||z.key===" ")){z.preventDefault(),_(re);return}if(P.length===0)return;if(z.key==="Home"){$(z,P[0]);return}if(z.key==="End"){$(z,P[P.length-1]);return}let ae;if(n==="horizontal"&&(z.key==="ArrowLeft"||z.key==="ArrowRight")?ae=pE(z,z.key):n==="vertical"&&z.key==="ArrowUp"?ae=-1:n==="vertical"&&z.key==="ArrowDown"&&(ae=1),ae===void 0)return;let q=(P.indexOf(Z)+ae+P.length)%P.length;$(z,P[q]);},"handleKeyDown");return jsxRuntime.jsxs("div",{...k,...b,ref:x,id:u,"data-monkeys-component":"tabs","data-slot":"root","data-state":L,"data-orientation":n,"data-activation-mode":i,className:m(w.slots.tabsRoot,d?.root,l),style:c,children:[jsxRuntime.jsx("div",{...k,dir:F,role:"tablist","aria-label":g,"aria-labelledby":f,"aria-orientation":n,"data-monkeys-component":"tabs","data-slot":"list","data-state":L,"data-orientation":n,"data-activation-mode":i,className:m(w.slots.tabsList,n==="vertical"&&"flex-col items-stretch",d?.list),style:w.styles.tabsList,children:t.map((z,re)=>{let Z=B[re],ae=re===D,ee=z.disabled?"disabled":ae?"active":"inactive";return ho.createElement("button",{...k,ref:q=>{I.current[re]=q;},key:z.value,id:`${h}-${Z}-tab`,type:"button",role:"tab",tabIndex:!z.disabled&&re===H?0:-1,"aria-selected":ae,"aria-controls":`${h}-${Z}-panel`,disabled:z.disabled,dir:F,"data-monkeys-component":"tabs","data-slot":"trigger","data-state":ee,"data-orientation":n,"data-activation-mode":i,"data-disabled":z.disabled||void 0,className:m(w.slots.tabsTrigger,ae&&w.slots.tabsTriggerActive,z.disabled&&w.slots.tabsTriggerDisabled,d?.trigger),style:w.styles.tabsTrigger,onFocus:()=>M(z.value),onKeyDown:q=>G(q,z,re),onClick:()=>{M(z.value),_(z);}},jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:z.label}))})}),E?jsxRuntime.jsx("div",{...k,id:`${h}-${B[D]}-panel`,role:"tabpanel",tabIndex:0,"aria-labelledby":`${h}-${B[D]}-tab`,dir:F,"data-monkeys-component":"tabs","data-slot":"panel","data-state":"active","data-orientation":n,"data-activation-mode":i,className:m(w.slots.tabsPanel,d?.panel),style:w.styles.tabsPanel,children:V(E.content)?E.content:V(E.description)?jsxRuntime.jsx("p",{className:"m-0 text-muted-foreground",children:E.description}):null}):null]})},"BaseTabs"));var gE={sm:"min-h-20 px-2.5 py-1.5 text-xs leading-5",md:"min-h-24 px-3 py-2 text-sm leading-6",lg:"min-h-28 px-3.5 py-2.5 text-base leading-7"},kv=ho.forwardRef(a(function({invalid:t=false,disabled:o=false,readOnly:r=false,controlSize:n,appearance:i,className:s,classNames:l,style:d,"aria-invalid":c,onBlur:p,onChange:u,...g},f){for(let[v,h]of [["invalid",t],["disabled",o],["readOnly",r]])if(typeof h!="boolean")throw new TypeError(`BaseTextarea ${v} must be a boolean.`);if(n!==void 0&&n!=="sm"&&n!=="md"&&n!=="lg")throw new TypeError('BaseTextarea controlSize must be "sm", "md", or "lg".');let b=Pe(i),x=ke(),y=Ne(b),k=Qn(),w=t||k.invalid;return jsxRuntime.jsx("textarea",{...x,...g,ref:f,disabled:o,readOnly:r,"aria-invalid":c??(w||void 0),"data-monkeys-component":"textarea","data-slot":"control","data-size":n,"data-invalid":w||void 0,"data-disabled":o||void 0,"data-readonly":r||void 0,className:m(y.slots.controlWrapper,y.slots.controlBase,y.slots.controlTextarea,w&&y.slots.controlInvalid,o&&y.slots.controlDisabled,r&&y.slots.controlReadOnly,n&&gE[n],l?.control,s),style:{...y.styles.control,...w?y.styles.controlInvalid:void 0,...o?y.styles.controlDisabled:void 0,...d},onBlur:v=>{p?.(v),k.notifyBlur(v.currentTarget.value);},onChange:v=>{u?.(v),k.notifyChange(v.currentTarget.value);}})},"BaseTextarea"));function Cv(e,t,o,r,n=false){ho.useEffect(()=>{let i=e.current,s=t.current,l=i?.ownerDocument.defaultView;if(!o||!i||!s||!l?.matchMedia||!s.animate)return;let d=i.closest("button, a, [tabindex]")??i,c=l.matchMedia("(prefers-reduced-motion: reduce)"),p=d.matches(":hover"),u=d.contains(i.ownerDocument.activeElement),g,f=a(()=>{g?.cancel(),g=void 0,delete i.dataset.scrolling;},"stop"),b=a(()=>{f();let h=s.scrollWidth-i.clientWidth;if(c.matches&&!(n&&p)||!p&&!u||h<=1)return;let T=h/64*1e3,C=160,R=T+C*2;g=s.animate([{transform:"translateX(0)",offset:0},{transform:"translateX(0)",offset:C/R},{transform:`translateX(-${h}px)`,offset:1-C/R},{transform:`translateX(-${h}px)`,offset:1}],{duration:R,iterations:1/0,direction:"alternate",easing:"linear"}),i.dataset.scrolling="true";},"update"),x=a(()=>{p=true,b();},"enter"),y=a(()=>{p=false,b();},"leave"),k=a(()=>{u=true,b();},"focus"),w=a(h=>{u=h.relatedTarget instanceof l.Node&&d.contains(h.relatedTarget),b();},"blur"),v=l.ResizeObserver?new l.ResizeObserver(b):void 0;return v?.observe(i),v?.observe(s),d.addEventListener("pointerenter",x),d.addEventListener("pointerleave",y),d.addEventListener("focusin",k),d.addEventListener("focusout",w),c.addEventListener("change",b),b(),()=>{f(),v?.disconnect(),d.removeEventListener("pointerenter",x),d.removeEventListener("pointerleave",y),d.removeEventListener("focusin",k),d.removeEventListener("focusout",w),c.removeEventListener("change",b);}},[e,t,o,r,n]);}a(Cv,"useOverflowMotion");var wE=ho.forwardRef(a(function({as:t="p",children:o,size:r="md",tone:n="default",overflowMotion:i,appearance:s,className:l,classNames:d,style:c,...p},u){let g=Pe(s),f=ke(),b=Ne(g),x=ho.useRef(null),y=ho.useRef(null),k=i==="hover-scroll"||i==="hover-scroll-always",w=ho.useCallback(v=>{x.current=v,typeof u=="function"?u(v):u&&(u.current=v);},[u]);return Cv(x,y,k,o,i==="hover-scroll-always"),ho.createElement(t,{...f,...p,ref:w,"data-monkeys-component":"text","data-slot":"root","data-size":r,"data-tone":n,className:m(b.slots.textRoot,Od(b,r),gi(b,n),d?.root,l),style:{...b.styles.text,...k?{display:"block",minWidth:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{},...c}},k?ho.createElement("span",{ref:y,style:{display:"inline-block",whiteSpace:"nowrap"}},o):o)},"BaseText"));function Nv({leading:e,title:t,description:o,actions:r,children:n,appearance:i,className:s,classNames:l,style:d,...c}){let p=Ne(i),u=V(t)||V(o);return jsxRuntime.jsxs("div",{...c,className:m(p.slots.toolbarRoot,l?.root,s),style:{...p.styles.toolbar,...d},children:[jsxRuntime.jsxs("div",{className:m(p.slots.toolbarLeading,l?.leading),children:[V(e)?e:null,u?jsxRuntime.jsxs("div",{className:m(p.slots.toolbarContent,l?.content),children:[V(t)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarTitle,l?.title),children:t}):null,V(o)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarDescription,l?.description),children:o}):null]}):null]}),V(n)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarContent,l?.content),children:n}):null,V(r)?jsxRuntime.jsx("div",{className:m(p.slots.toolbarActions,l?.actions),children:r}):null]})}a(Nv,"BaseToolbar");var CE=ho.forwardRef(a(function({children:t,focusable:o=false,appearance:r,className:n,classNames:i,style:s,...l},d){let c=Pe(r),p=ke(),u=Ne(c);if(typeof o!="boolean")throw new TypeError("BaseVisuallyHidden focusable must be a boolean.");return jsxRuntime.jsx("span",{...p,...l,ref:d,"data-monkeys-component":"visually-hidden","data-slot":"root","data-focusable":o||void 0,className:m(u.slots.visuallyHiddenRoot,o&&u.slots.visuallyHiddenFocusable,i?.root,n),style:{...u.styles.visuallyHidden,...s},children:t})},"BaseVisuallyHidden"));var DE={oneOf:[{type:"object",additionalProperties:false,required:["kind","src"],properties:{kind:{const:"image"},src:{type:"string",minLength:1,maxLength:4096}}},{type:"object",additionalProperties:false,required:["kind","value"],properties:{kind:{const:"emoji"},value:{type:"string",minLength:1,maxLength:64},backgroundColor:{type:"string",maxLength:128}}},{type:"object",additionalProperties:false,required:["kind","name"],properties:{kind:{const:"lucide"},name:{type:"string",minLength:1,maxLength:128}}}]},Mv={path:["d"],circle:["cx","cy","r"],rect:["x","y","width","height","rx","ry"],polyline:["points"],line:["x1","x2","y1","y2"],ellipse:["cx","cy","rx","ry"],polygon:["points"]};function yf(e){if(!Array.isArray(e)||!e.length||e.length>256)return;let t=[];for(let o of e){if(!Array.isArray(o)||o.length!==2||typeof o[0]!="string"||!Object.prototype.hasOwnProperty.call(Mv,o[0]))return;let r=o[0],n=o[1];if(!n||typeof n!="object"||Array.isArray(n)||Object.getPrototypeOf(n)!==Object.prototype)return;let i={};for(let[s,l]of Object.entries(Object.getOwnPropertyDescriptors(n))){if(!("value"in l)||typeof l.value!="string")return;let d=l.value;if(s==="key"){if(d.length>256)return}else if(s==="fill"){if(d!=="currentColor"&&d!=="none")return}else if(Mv[r].includes(s)){if(s==="d"){if(!d.length||d.length>8192||!/^[MmZzLlHhVvCcSsQqTtAa0-9eE+.,\s-]+$/.test(d))return}else if(s==="points"){if(!d.length||d.length>8192||!/^[0-9eE+.,\s-]+$/.test(d))return}else if(!d.trim()||d.length>128||!Number.isFinite(Number(d)))return}else return;i[s]=d;}t.push([r,i]);}return t}a(yf,"parseAssetIconNodes");var xf=ho.forwardRef(a(function({icon:t,alt:o,normalizeImageIcon:r=false,className:n,style:i,...s},l){let d=ke(),c=im()??runtime$1.resolveAssetIconNodes,p=vh(),u=t.kind==="image"?t.src:void 0,[g,f]=ho.useState();ho.useEffect(()=>{if(!u||!p)return;let D=new AbortController;return Promise.resolve().then(()=>p(u,D.signal)).then(E=>{D.signal.aborted||f({reference:u,resolver:p,src:fn(E,"media")});}).catch(()=>{D.signal.aborted||f({reference:u,resolver:p});}),()=>D.abort()},[u,p]);let b=p?g&&g.reference===u&&g.resolver===p?g.src:void 0:fn(u,"media"),[x,y]=ho.useState(),k=ho.useRef(null);ho.useEffect(()=>{let D=k.current;b&&D?.complete&&y({source:b,resolver:p,ready:D.naturalWidth>0});},[b,p]);let w=t.kind==="lucide"?t.name:void 0,v=ho.useMemo(()=>{if(w)try{return c.peek?yf(c.peek(w)):void 0}catch{return}},[w,c]),[h,S]=ho.useState();ho.useEffect(()=>{let D=true;return w&&!v&&Promise.resolve().then(()=>c(w)).then(E=>{D&&S({name:w,resolver:c,nodes:yf(E)});}).catch(()=>{D&&S({name:w,resolver:c,nodes:void 0});}),()=>{D=false;}},[w,c,v]);let T=h?.name===w&&h?.resolver===c,C=v??(T?h?.nodes:void 0),R=!!(u&&p&&!(g?.reference===u&&g?.resolver===p)),M=x?.source===b&&x?.resolver===p,I=!!(w&&!v&&!T),A=t.kind==="emoji"?"ready":t.kind==="image"?b?M?x?.ready?"ready":"error":"loading":R?"loading":"error":C?"ready":I?"loading":"error",N=A==="loading"?jsxRuntime.jsx(Ur,{variant:"block",className:"h-5 w-5 max-h-full max-w-full rounded"}):jsxRuntime.jsx(lucideReact.Wrench,{"aria-hidden":"true",className:"h-5 w-5 max-h-full max-w-full"});return jsxRuntime.jsx("div",{...d,...s,ref:l,role:"img","aria-label":o,"data-icon-state":A,"aria-busy":A==="loading"||void 0,className:m("monkeys-asset-icon flex h-11 w-11 shrink-0 items-center justify-center rounded-xl text-muted-foreground",t.kind==="emoji"?"text-2xl":t.kind==="image"&&!r?"overflow-hidden border":"bg-muted",n),style:{...t.kind==="emoji"&&t.backgroundColor?{backgroundColor:t.backgroundColor}:{},...i},children:t.kind==="image"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b&&A!=="error"&&jsxRuntime.jsx("img",{ref:k,src:b,alt:"","aria-hidden":"true",onLoad:D=>{D.currentTarget===k.current&&y({source:b,resolver:p,ready:true});},onError:D=>{D.currentTarget===k.current&&y({source:b,resolver:p,ready:false});},style:A==="loading"?{display:"none"}:void 0,className:r?"h-5 w-5 object-contain":"h-full w-full object-cover"},b),A!=="ready"&&N]}):t.kind==="emoji"?jsxRuntime.jsx("span",{"aria-hidden":"true",children:t.value}):C?jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"h-5 w-5 max-h-full max-w-full",children:C.map(([D,E],P)=>{let{key:W,...H}=E;return ho.createElement(D,{...H,key:W??P})})}):N})},"BaseAssetIcon"));function Ev(e){try{let t=new URL(e.trim());return ["http:","https:"].includes(t.protocol)?t.href:void 0}catch{return}}a(Ev,"imageLink");function Bv({accept:e,multiple:t=false,disabled:o=false,busy:r=false,title:n="Upload files",description:i,hint:s,busyLabel:l="Uploading...",icon:d,inputProps:c,className:p,classNames:u,onFilesSelected:g,renderPreview:f,replaceLabel:b,clearLabel:x,pasteLabel:y,renderActions:k,onClear:w,onChoose:v,onPasteClick:h,onUrlSelected:S,onInputError:T}){let C=f?.(),R=k?.(),M=ho.useRef(null),[I,A]=ho.useState(false),[N,D]=ho.useState(false),E=ho.useRef(true),P=ho.useRef(0),W=o||r,H=ho.useRef({blocked:W,onFilesSelected:g,onUrlSelected:S,onInputError:T});H.current={blocked:W,onFilesSelected:g,onUrlSelected:S,onInputError:T},ho.useEffect(()=>(E.current=true,()=>{E.current=false,P.current++;}),[]),ho.useEffect(()=>{W&&(P.current++,D(false),A(false));},[W]);let B=a(z=>{let re=Array.from(z);!H.current.blocked&&re.length&&H.current.onFilesSelected?.(t?re:re.slice(0,1));},"emitFiles"),L=a(()=>{W||(P.current++,D(false),v?v():M.current?.click());},"choose"),F=a(z=>{if(W)return false;if(z.files.length&&g)return P.current++,D(false),B(z.files),true;let re=Ev(z.getData("text/plain"));return re&&S?(P.current++,D(false),S(re),true):false},"acceptTransfer"),_=a(async()=>{if(W||N)return;let z=++P.current,re=a(()=>E.current&&!H.current.blocked&&z===P.current,"active");D(true);try{if(!navigator.clipboard?.read)throw new Error("Clipboard reading is unavailable.");let Z=await navigator.clipboard.read();for(let ae of Z){let ee=ae.types.find(q=>q.startsWith("image/"));if(ee&&H.current.onFilesSelected){let q=await ae.getType(ee);re()&&B([new File([q],`clipboard.${ee.split("/")[1]}`,{type:ee})]);return}}for(let ae of Z){if(!ae.types.includes("text/plain"))continue;let ee=Ev(await(await ae.getType("text/plain")).text());if(ee&&H.current.onUrlSelected){re()&&H.current.onUrlSelected(ee);return}}re()&&H.current.onInputError?.("empty-clipboard");}catch{re()&&H.current.onInputError?.("clipboard-unavailable");}finally{E.current&&z===P.current&&D(false);}},"paste"),$=a((z,re,Z)=>z?jsxRuntime.jsx("span",{"data-slot":Z,className:j("max-w-full [overflow-wrap:anywhere]",re),children:z}):null,"renderText"),G=a((z,re,Z)=>z?jsxRuntime.jsx(To,{content:z,portal:true,children:jsxRuntime.jsx(dt,{label:z,iconOnly:true,icon:re,disabled:W||N,onClick:Z})}):null,"action");return jsxRuntime.jsxs("div",{"data-monkeys-component":"data-explorer-upload-surface","data-state":r?"busy":I?"dragging":"idle",className:j("grid min-w-0 gap-global rounded-[var(--radius)] border border-border bg-muted/20 p-global transition-colors",!C&&"border-dashed",I&&"border-primary bg-primary/5",W&&"opacity-60",u?.root,p),tabIndex:W?-1:0,onPaste:z=>{F(z.clipboardData)&&(z.preventDefault(),z.stopPropagation());},onDragEnter:z=>{z.preventDefault(),W||A(true);},onDragOver:z=>z.preventDefault(),onDragLeave:z=>{z.relatedTarget instanceof Node&&z.currentTarget.contains(z.relatedTarget)||A(false);},onDrop:z=>{z.preventDefault(),A(false),F(z.dataTransfer)&&z.stopPropagation();},children:[!v&&jsxRuntime.jsx("input",{...c,ref:M,className:"sr-only",type:"file",accept:e,multiple:t,disabled:W,onChange:z=>{P.current++,D(false),B(z.target.files??[]),z.target.value="";}}),C?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Is,{aspectRatio:"video",className:"rounded-[var(--radius)] bg-background",children:C}),jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-token-sm",children:[G(b,jsxRuntime.jsx(lucideReact.RefreshCw,{className:"h-4 w-4"}),L),G(y,jsxRuntime.jsx(lucideReact.Clipboard,{className:"h-4 w-4"}),h??_),w&&G(x,jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4"}),()=>{P.current++,D(false),w();}),R]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{type:"button",className:j("flex min-w-0 flex-col items-center gap-token-sm rounded-[var(--radius)] py-global text-center focus-visible:outline focus-visible:outline-primary",u?.button),disabled:W,onClick:L,children:[jsxRuntime.jsx("span",{className:j("text-muted-foreground",u?.icon),children:d??jsxRuntime.jsx(lucideReact.UploadCloud,{className:"h-8 w-8","aria-hidden":true})}),$(r?l:n,j("text-sm font-medium text-foreground",u?.title),"title"),$(i,j("text-xs text-muted-foreground",u?.description),"description"),$(s,j("text-xs text-muted-foreground",u?.hint),"hint")]}),y&&jsxRuntime.jsx(dt,{label:y,icon:jsxRuntime.jsx(lucideReact.Clipboard,{className:"h-4 w-4"}),disabled:W||N,onClick:h??_,className:"w-full"}),R]})]})}a(Bv,"DataExplorerUploadSurface");function WE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"7"}),jsxRuntime.jsx("path",{d:"m20 20-3.5-3.5"})]})}a(WE,"DefaultSearchIcon");function Lv({rootRef:e,dataAttributes:t,context:o,leading:r,leadingActions:n,searchVisible:i=true,searchValue:s="",searchPlaceholder:l="Search data...",searchIcon:d,viewOptions:c=[],activeViewId:p,actions:u,toolbarActions:g,appearance:f,children:b,className:x,classNames:y,onSearchChange:k,onSearchSubmit:w,onViewChange:v}){let h=a(C=>{C.preventDefault(),w?.(s);},"handleSubmit"),S=Et(f),T=Ct(S);return jsxRuntime.jsxs("div",{ref:e,...t,className:j(T.slots.toolbarRoot,y?.root,x),style:T.styles.toolbarRoot,children:[r||n?.length?jsxRuntime.jsxs("div",{className:j(T.slots.toolbarLeading,y?.leading),children:[r,n?.length?jsxRuntime.jsx(cn,{context:o,actions:n,layout:"inline",appearance:S,classNames:{action:y?.action,menuContent:y?.menuContent,menuItem:y?.menuItem}}):null]}):null,i?jsxRuntime.jsxs("form",{className:j(T.slots.toolbarSearch,y?.search),style:T.styles.toolbarSearch,onSubmit:h,children:[jsxRuntime.jsx("span",{className:j(T.slots.toolbarSearchIcon,y?.searchIcon),children:d??jsxRuntime.jsx(WE,{})}),jsxRuntime.jsx("input",{value:s,placeholder:l,className:j(T.slots.toolbarSearchInput,y?.searchInput),onChange:C=>k?.(C.currentTarget.value)})]}):null,c.length>0?jsxRuntime.jsx("div",{className:j(T.slots.toolbarViewSwitch,y?.viewSwitch),style:T.styles.toolbarViewSwitch,children:c.map(C=>{let R=C.id===p;return jsxRuntime.jsxs("button",{type:"button",disabled:C.disabled,className:j(T.slots.toolbarViewButton,R&&T.slots.toolbarViewButtonActive,y?.viewButton),onClick:()=>v?.(C.id),children:[C.icon,C.label?jsxRuntime.jsx("span",{children:C.label}):null]},C.id)})}):null,g?.length?jsxRuntime.jsx(cn,{context:o,actions:g,layout:"toolbar",appearance:f,classNames:{root:y?.actions,action:y?.action,menuContent:y?.menuContent,menuItem:y?.menuItem}}):u||b?jsxRuntime.jsxs("div",{className:j(T.slots.toolbarActions,y?.actions),children:[u,b]}):null]})}a(Lv,"DataExplorerToolbarShell");function zE(e){if(!e||typeof e!="object")return;let t=e.children;return Array.isArray(t)?t:void 0}a(zE,"defaultGetChildren");function Wv({nodes:e=[],context:t,capabilities:o,className:r,classNames:n,empty:i,selectedNodeId:s,getNodeId:l,getChildren:d=zE,renderNode:c,onSelect:p}){let u=Array.isArray(e)?e:[],g=a((f,b)=>f.map((x,y)=>{let k=l?l(x,y):`${b}-${y}`,w=d(x,y,b)??[],v=w.length>0,h=String(s??"")===String(k),S=v?g(w,b+1):null;return c?jsxRuntime.jsx("div",{className:"min-w-0",children:c({node:x,index:y,depth:b,context:t,capabilities:o,childNodes:w,hasChildren:v,selected:h,onSelect:p,renderChildren:a(()=>S,"renderChildren")})},k):S}),"renderTreeNodes");return u.length===0?i?jsxRuntime.jsx("div",{className:j(n?.empty),children:i}):null:jsxRuntime.jsx("div",{className:j("min-w-0",n?.root,r),children:g(u,0)})}a(Wv,"DataExplorerTree");function zv({title:e,subtitle:t,toolbar:o,footer:r,children:n,appearance:i,className:s,classNames:l}){let d=Ct(Et(i)),c=!!e||!!t||!!o;return jsxRuntime.jsxs("section",{className:j(d.slots.treeShellRoot,l?.root,s),children:[c?jsxRuntime.jsxs("div",{className:j(d.slots.treeShellHeader,l?.header),children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e?jsxRuntime.jsx("div",{className:j(d.slots.treeShellTitle,l?.title),children:e}):null,t?jsxRuntime.jsx("div",{className:j(d.slots.treeShellSubtitle,l?.subtitle),children:t}):null]}),o?jsxRuntime.jsx("div",{className:j(d.slots.treeShellToolbar,l?.toolbar),children:o}):null]}):null,jsxRuntime.jsx("div",{className:j(d.slots.treeShellBody,l?.body),children:n}),r?jsxRuntime.jsx("div",{className:j(d.slots.treeShellFooter,l?.footer),children:r}):null]})}a(zv,"DataExplorerTreeShell");function Fv({expanded:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:e?"m6 9 6 6 6-6":"m9 18 6-6-6-6"})})}a(Fv,"ChevronIcon");function FE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"12",cy:"5",r:"1"}),jsxRuntime.jsx("circle",{cx:"12",cy:"19",r:"1"})]})}a(FE,"MoreIcon");function HE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"9",cy:"6",r:"1"}),jsxRuntime.jsx("circle",{cx:"9",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"9",cy:"18",r:"1"}),jsxRuntime.jsx("circle",{cx:"15",cy:"6",r:"1"}),jsxRuntime.jsx("circle",{cx:"15",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"15",cy:"18",r:"1"})]})}a(HE,"GripIcon");function _v(e,t){for(let o of e??[])o.defaultExpanded&&t.add(o.id),_v(o.children,t);}a(_v,"collectDefaultExpandedNodeIds");function Hv(e,t){let o=new Set(t??[]);for(let r of e)_v(r.nodes,o);return o}a(Hv,"buildDefaultNodeExpandedSet");function Vv(e,t){let o=new Set(t??[]);for(let r of e)(r.hideHeader||r.defaultExpanded!==false)&&o.add(r.id);return o}a(Vv,"buildDefaultGroupExpandedSet");function Gv(e,t,o,r){for(let[n,i]of (e??[]).entries())r.set(i.id,{node:i,group:t,parentId:o,index:n}),Gv(i.children,t,i.id,r);}a(Gv,"flattenNodes");function VE(e){let t=new Map;for(let o of e)Gv(o.nodes,o,void 0,t);return t}a(VE,"buildFlattenedNodeMap");function _E(e,t){return [...t??[],...e.actions??[]]}a(_E,"getNodeActions");function GE(e,t){return [...t??[],...e.actions??[]]}a(GE,"getGroupActions");function eu({groups:e,nodes:t,context:o,selectedNodeId:r,selectedGroupId:n,expandedNodeIds:i,defaultExpandedNodeIds:s,expandedGroupIds:l,defaultExpandedGroupIds:d,resetExpansionKey:c,nodeActions:p,groupActions:u,indentSize:g=16,indentOffset:f=8,actionIcon:b,empty:x,loading:y=false,loadingNode:k,error:w,labels:v,reorderMode:h="none",appearance:S,className:T,classNames:C,onSelectNode:R,onSelectGroup:M,onExpandedNodeIdsChange:I,onExpandedGroupIdsChange:A,onAction:N,onReorderNodes:D}){let E=Ye().dataExplorer.viewTree,P=Ct(Et(S)),W=v?.actions??E.actions,H=v?.expand??E.expand,B=v?.collapse??E.collapse,L=k??v?.loading??E.loading,F=x??v?.empty??E.empty,_=Array.isArray(e),$=ho.useMemo(()=>_?e:[{id:"__root__",hideHeader:true,defaultExpanded:true,nodes:Array.isArray(t)?t:[]}],[e,_,t]),G=ho.useMemo(()=>VE($),[$]),[z,re]=ho.useState(()=>Hv($,s)),[Z,ae]=ho.useState(()=>Vv($,d)),[ee,q]=ho.useState(),[U,X]=ho.useState();ho.useEffect(()=>{re(Hv($,s)),ae(Vv($,d));},[d,s,c]);let O=i!==void 0?new Set(i):z,K=l!==void 0?new Set(l):Z,ne=a((Q,ge)=>{let we=new Set(O);ge?we.add(Q):we.delete(Q),i===void 0&&re(we),I?.([...we]);},"setNodeExpanded"),fe=a((Q,ge)=>{let we=new Set(K);ge?we.add(Q):we.delete(Q),l===void 0&&ae(we),A?.([...we]);},"setGroupExpanded"),he=a((Q,ge)=>ge.type==="node"?{type:"node",action:Q,node:ge.node,group:ge.group,context:o}:{type:"group",action:Q,group:ge.group,context:o},"createActionContext"),me=a((Q,ge)=>{let we=Q.filter(Ie=>{let oe=he(Ie,ge);return Mt(Ie.visible,oe)??true});return we.length===0?null:jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx("button",{type:"button",title:W,"aria-label":W,className:m(P.slots.menuTrigger,ge.type==="group"?P.slots.treeGroupActions:P.slots.treeNodeActions,ge.type==="group"?C?.groupActions:m(C?.nodeActions,C?.itemActions)),onClick:Ie=>Ie.stopPropagation(),children:b??jsxRuntime.jsx(FE,{})})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{align:"end",sideOffset:6,className:m(P.slots.menuContent,C?.menuContent),style:P.styles.menuContent,onClick:Ie=>Ie.stopPropagation(),children:we.map(Ie=>{let oe=he(Ie,ge),xe=(Mt(Ie.disabled,oe)??false)||(Mt(Ie.loading,oe)??false),Ve=Mt(Ie.active,oe)??false;return Ie.render?jsxRuntime.jsx("div",{children:Ie.render(oe)},Ie.id):jsxRuntime.jsxs("div",{children:[Ie.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:P.slots.menuSeparator}):null,jsxRuntime.jsxs(Bt__namespace.Item,{title:Ie.title,disabled:xe,className:m(P.slots.menuItem,Gn(P,Ie.tone),Ve&&"bg-accent text-accent-foreground",C?.menuItem),style:P.styles.menuItem,onSelect:()=>{xe||(Ie.onAction?.(oe),N?.(oe));},children:[Ie.icon?jsxRuntime.jsx("span",{className:P.slots.menuItemIcon,children:Ie.icon}):null,jsxRuntime.jsx("span",{className:P.slots.menuItemLabel,children:Ie.label})]}),Ie.separatorAfter?jsxRuntime.jsx(Bt__namespace.Separator,{className:P.slots.menuSeparator}):null]},Ie.id)})})})]})},"renderActions"),ie=a((Q,ge)=>{Q.preventDefault();let we=ee||Q.dataTransfer.getData("application/x-data-explorer-node");if(!we||we===ge.id||!D){q(void 0),X(void 0);return}let Ie=G.get(we),oe=G.get(ge.id);if(!Ie||!oe){q(void 0),X(void 0);return}let xe=Ie.parentId===oe.parentId&&Ie.group?.id===oe.group?.id;if(h==="same-parent"&&!xe){q(void 0),X(void 0);return}let Ve={activeNode:Ie.node,overNode:oe.node,activeGroup:Ie.group,overGroup:oe.group,activeParentId:Ie.parentId,overParentId:oe.parentId,oldIndex:Ie.index,newIndex:oe.index,sameParent:xe,context:o};D(Ve),q(void 0),X(void 0);},"handleDrop"),be=a((Q,ge,we)=>{let Ie=Array.isArray(Q.children)?Q.children:[],oe=Ie.length>0,xe=Q.collapsible===false||O.has(Q.id),Ve=r===Q.id,_e=Q.selectable!==false&&!Q.disabled,Ge=h!=="none"&&!!D&&Q.reorderable!==false,le=ee===Q.id,Me=U===Q.id&&ee!==Q.id,Ae=_E(Q,p);return jsxRuntime.jsxs("div",{"data-data-explorer-entry":"node","data-data-explorer-node-id":Q.id,"data-data-explorer-group-id":ge?.id,className:m(P.slots.treeNode,C?.node,C?.item,Q.className),onDragOver:J=>{!ee||!Ge||(J.preventDefault(),X(Q.id));},onDragLeave:()=>{U===Q.id&&X(void 0);},onDrop:J=>ie(J,Q),children:[jsxRuntime.jsxs("div",{className:m(P.slots.treeNodeButton,Ve&&P.slots.treeNodeSelected,Q.disabled&&P.slots.treeNodeDisabled,le&&P.slots.treeNodeDragging,Me&&"ring-1 ring-primary/30",Ve&&C?.itemSelected,Ve&&C?.nodeSelected,Q.disabled&&C?.nodeDisabled,le&&C?.nodeDragging,C?.nodeButton,C?.itemButton),style:{paddingLeft:`calc(${(Q.indentLevel??we)*g+f}px + var(--data-explorer-tree-group-indent, 0px))`},role:"treeitem","aria-selected":Ve||void 0,"aria-disabled":Q.disabled||void 0,"aria-expanded":oe?xe:void 0,"aria-label":Q.ariaLabel,tabIndex:_e?0:-1,onClick:()=>{_e&&R?.(Q,o);},onKeyDown:J=>{J.target===J.currentTarget&&_e&&(J.key!=="Enter"&&J.key!==" "||(J.preventDefault(),R?.(Q,o)));},children:[Ge?jsxRuntime.jsx("span",{draggable:true,className:m(P.slots.treeNodeDragHandle,C?.nodeDragHandle),onClick:J=>J.stopPropagation(),onDragStart:J=>{J.stopPropagation(),J.dataTransfer.effectAllowed="move",J.dataTransfer.setData("application/x-data-explorer-node",Q.id),q(Q.id);},onDragEnd:()=>{q(void 0),X(void 0);},children:jsxRuntime.jsx(HE,{})}):null,oe?jsxRuntime.jsx("button",{type:"button",className:m(P.slots.treeNodeToggle,C?.nodeToggle,C?.expander),"aria-label":xe?B:H,onClick:J=>{J.stopPropagation(),ne(Q.id,!xe);},children:jsxRuntime.jsx(Fv,{expanded:xe})}):jsxRuntime.jsx("span",{className:m(P.slots.treeNodeToggle,C?.nodeToggle)}),Q.icon?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeIcon,C?.nodeIcon,C?.itemIcon),children:Q.icon}):null,jsxRuntime.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[jsxRuntime.jsx("span",{className:m(P.slots.treeNodeLabel,C?.nodeLabel,C?.itemLabel),children:Q.label}),Q.description?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeDescription,C?.nodeDescription),children:Q.description}):null]}),Q.meta?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeMeta,C?.nodeMeta),children:Q.meta}):null,Q.badge?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeBadge,C?.nodeBadge),children:Q.badge}):null,me(Ae,{type:"node",node:Q,group:ge})]}),oe&&xe?jsxRuntime.jsx("div",{className:m(P.slots.treeNodeChildren,C?.nodeChildren,C?.list),children:Ie.map(J=>be(J,ge,we+1))}):null]},Q.id)},"renderNode"),He=a((Q,ge,we)=>Q===false?null:jsxRuntime.jsx("div",{className:m(ge,we),children:Q}),"renderPlaceholder");if(y)return jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),children:He(L,P.slots.treeLoading,C?.loading)});if(w)return jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),children:He(w??v?.error,P.slots.treeError,C?.error)});let We=$.some(Q=>(Q.nodes??[]).length>0),Ke=$.some(Q=>Q.status==="loading"||Q.error);return !We&&!Ke&&(!_||$.length===0)?jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),children:He(F,P.slots.treeEmpty,C?.empty)}):jsxRuntime.jsx("div",{className:m(P.slots.treeRoot,C?.root,T),role:We||$.some(Q=>!Q.hideHeader)?"tree":void 0,children:$.map(Q=>{let ge=Q.hideHeader||Q.collapsible===false||K.has(Q.id),we=Q.nodes?.length??0,Ie=GE(Q,u),oe=n===Q.id,xe=Q.collapsible!==false;return jsxRuntime.jsxs("section",{"data-data-explorer-entry":"group","data-data-explorer-group-id":Q.id,className:m(P.slots.treeGroup,C?.group,Q.className),children:[Q.hideHeader?null:jsxRuntime.jsxs("div",{role:"treeitem","aria-label":typeof Q.label=="string"?Q.label:void 0,"aria-selected":Q.selectable?oe:void 0,"aria-expanded":xe?ge:void 0,className:m(P.slots.treeGroupHeader,P.slots.treeGroupHeaderButton,oe&&P.slots.treeNodeSelected,C?.groupHeader,C?.groupHeaderButton,oe&&C?.itemSelected),children:[jsxRuntime.jsxs("button",{type:"button",className:m("flex min-w-0 flex-1 items-center gap-2 text-left outline-hidden focus-visible:ring-2 focus-visible:ring-ring",C?.groupLabel),"aria-pressed":Q.selectable?oe:void 0,"aria-expanded":!Q.selectable&&xe?ge:void 0,onClick:()=>{if(Q.selectable){M?.(Q,o);return}xe&&fe(Q.id,!ge);},children:[Q.icon?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeIcon,C?.nodeIcon,C?.itemIcon),children:Q.icon}):null,jsxRuntime.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[Q.label?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeLabel,C?.nodeLabel,C?.itemLabel),children:Q.label}):null,Q.description?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeDescription,C?.nodeDescription),children:Q.description}):null]}),Q.meta?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeMeta,C?.nodeMeta),children:Q.meta}):null,Q.badge?jsxRuntime.jsx("span",{className:m(P.slots.treeNodeBadge,C?.nodeBadge),children:Q.badge}):null]}),xe?jsxRuntime.jsx("button",{type:"button",className:m(P.slots.treeNodeToggle,C?.expander),"aria-label":ge?B:H,"aria-expanded":ge,onClick:()=>fe(Q.id,!ge),children:jsxRuntime.jsx(Fv,{expanded:ge})}):jsxRuntime.jsx("span",{className:m(P.slots.treeNodeToggle,C?.expander)}),me(Ie,{type:"group",group:Q})]}),ge?jsxRuntime.jsx("div",{role:"group",className:m(P.slots.treeGroupContent,C?.groupContent,C?.list),children:Q.loading||Q.status==="loading"?He(L,P.slots.treeLoading,C?.loading):Q.error||Q.status==="error"?He(Q.error??v?.error??E.error,P.slots.treeError,C?.error):we>0?Q.nodes?.map(Ve=>be(Ve,Q,0)):He(Q.empty??F,P.slots.treeEmpty,C?.empty)}):null]},Q.id)})})}a(eu,"DataExplorerViewTree");function $E(e,t,o){let r=e.filter(n=>!n.hidden);if(r.length!==0){if(t){let n=r.find(i=>i.id===t);if(n)return n}if(o){let n=r.find(i=>i.id===o);if(n)return n}return r[0]}}a($E,"resolveActiveViewDefinition");function jv({items:e,views:t=[],activeViewId:o,fallbackViewId:r,context:n,capabilities:i,className:s,classNames:l,empty:d,loading:c,loadingNode:p,footer:u,overlay:g,layout:f,collection:b,selectedIds:x=[],getItemId:y,itemDefinition:k,renderItem:w,onOpenItem:v,onSelectionChange:h}){let S=Array.isArray(e)?e:[],T=$E(t,o,r),C=T?.id??o??r??"",R=b||T?.collection?{...b,...T?.collection,classNames:{...b?.classNames,...T?.collection?.classNames}}:void 0,M=T?.layout??T?.collection?.layout??f??b?.layout,I=T?.collection?.loading??b?.loading??c,A=T?.collection?.loadingNode??b?.loadingNode??p,N=T?.collection?.footer??b?.footer??u,D=T?.collection?.overlay??b?.overlay??g,E=typeof T?.empty=="function"?T.empty({items:S,activeViewId:C,context:n,capabilities:i,className:s,empty:d,loading:c,loadingNode:p,footer:u,overlay:g,layout:f,collection:R,selectedIds:x,getItemId:y,itemDefinition:k,renderItem:w,onOpenItem:v,onSelectionChange:h}):T?.empty??d,P={items:S,activeViewId:C,context:n,capabilities:i,className:s,empty:E,loading:I,loadingNode:A,footer:N,overlay:D,layout:M,collection:R,selectedIds:x,getItemId:y,itemDefinition:T?.itemDefinition??k,renderItem:T?.renderItem??w,onOpenItem:v,onSelectionChange:h};return T?.render?jsxRuntime.jsx(jsxRuntime.Fragment,{children:T.render(P)}):jsxRuntime.jsx(Ti,{items:S,activeViewId:C,context:n,capabilities:i,className:R?.className??s,classNames:{...l,...R?.classNames},empty:E,loading:P.loading,loadingNode:P.loadingNode,footer:P.footer,overlay:P.overlay,layout:P.layout,scrollable:R?.scrollable,wrapItems:R?.wrapItems,measuredGrid:R?.measuredGrid,itemsStyle:R?.itemsStyle,itemStyle:R?.itemStyle,selectedIds:x,getItemId:y,itemDefinition:P.itemDefinition,renderItem:P.renderItem,getItemClassName:T?.getItemClassName,onOpenItem:v,onSelectionChange:h})}a(jv,"DataExplorerView");function Uv({header:e,footer:t,overlay:o,empty:r,isEmpty:n=false,children:i,className:s,classNames:l}){return jsxRuntime.jsxs("section",{className:j("relative flex min-h-0 flex-1 flex-col overflow-hidden",l?.root,s),children:[e?jsxRuntime.jsx("div",{className:j("shrink-0",l?.header),children:e}):null,jsxRuntime.jsx("div",{className:j("flex min-h-0 flex-1 flex-col overflow-hidden",l?.body),children:n&&r?jsxRuntime.jsx("div",{className:j("flex h-full items-center justify-center p-6 text-sm text-muted-foreground",l?.empty),children:r}):i}),t?jsxRuntime.jsx("div",{className:j("shrink-0",l?.footer),children:t}):null,o?jsxRuntime.jsx("div",{className:j("absolute inset-0",l?.overlay),children:o}):null]})}a(Uv,"DataExplorerViewShell");var Ys="gap-2 rounded-[var(--radius)] border border-transparent text-sm font-medium motion-reduce:transition-none",Xs="size-[var(--monkeys-component-navigation-sidebar-icon-size,1.125rem)] shrink-0 text-inherit [&_svg]:size-full",kf="text-foreground hover:border-transparent hover:bg-[var(--navigation-internal-hover-background)] hover:text-[var(--navigation-internal-hover-foreground)]",Cf="border-[var(--navigation-internal-selected-border)] bg-[var(--navigation-internal-selected-background)] text-[var(--navigation-internal-selected-foreground)] hover:border-[var(--navigation-internal-selected-border)] hover:bg-[var(--navigation-internal-selected-background)] hover:text-[var(--navigation-internal-selected-foreground)]",Kv="[--navigation-internal-theme-selected-background:color-mix(in_srgb,hsl(var(--monkeys-color-primary,var(--primary)))_10%,transparent)] [--navigation-internal-theme-selected-foreground:hsl(var(--monkeys-color-primary,var(--primary)))] dark:[--navigation-internal-theme-selected-background:hsl(var(--monkeys-color-accent,var(--accent)))] dark:[--navigation-internal-theme-selected-foreground:hsl(var(--monkeys-color-foreground,var(--foreground)))]";function qv(e){let t={muted:"hsl(var(--monkeys-color-accent,var(--accent)))",soft:"color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 10%,transparent)",solid:"hsl(var(--monkeys-color-primary,var(--primary)))",outline:"hsl(var(--monkeys-color-background,var(--background)))"}[e??"muted"];return {"--navigation-internal-default-selected-background":e===void 0?"var(--navigation-internal-theme-selected-background)":t,"--navigation-internal-default-selected-foreground":e===void 0?"var(--navigation-internal-theme-selected-foreground)":e==="solid"?"hsl(var(--monkeys-color-primary-foreground,var(--primary-foreground)))":"hsl(var(--monkeys-color-foreground,var(--foreground)))","--navigation-internal-selected-background":"var(--monkeys-component-navigation-sidebar-row-selected-background,var(--navigation-internal-default-selected-background))","--navigation-internal-selected-foreground":"var(--monkeys-component-navigation-sidebar-row-selected-foreground,var(--navigation-internal-default-selected-foreground))","--navigation-internal-selected-border":`var(--monkeys-component-navigation-sidebar-row-selected-border,${e===void 0||e==="muted"?"transparent":e==="soft"?"color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 25%,transparent)":e==="outline"?"color-mix(in srgb,hsl(var(--monkeys-color-primary,var(--primary))) 55%,transparent)":"hsl(var(--monkeys-color-primary,var(--primary)))"})`,"--navigation-internal-hover-background":"var(--monkeys-component-navigation-sidebar-row-hover-background,color-mix(in srgb,hsl(var(--monkeys-color-accent,var(--accent))) 65%,transparent))","--navigation-internal-hover-foreground":"var(--monkeys-component-navigation-sidebar-row-hover-foreground,hsl(var(--monkeys-color-foreground,var(--foreground))))"}}a(qv,"unifiedStyle");var KE="[--navigation-internal-selected-background:var(--monkeys-component-navigation-sidebar-row-selected-background,var(--monkeys-component-navigation-sidebar-tree-row-selected-background,var(--navigation-internal-default-selected-background)))] [--navigation-internal-selected-foreground:var(--monkeys-component-navigation-sidebar-row-selected-foreground,var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,var(--navigation-internal-default-selected-foreground)))] [--navigation-internal-hover-background:var(--monkeys-component-navigation-sidebar-row-hover-background,var(--monkeys-component-navigation-sidebar-tree-row-hover-background,color-mix(in_srgb,hsl(var(--monkeys-color-accent,var(--accent)))_65%,transparent)))] [--navigation-internal-hover-foreground:var(--monkeys-component-navigation-sidebar-row-hover-foreground,var(--monkeys-component-navigation-sidebar-tree-row-hover-foreground,hsl(var(--monkeys-color-foreground,var(--foreground)))))]",qE="aria-selected:border-[var(--navigation-internal-selected-border)] aria-selected:bg-[var(--navigation-internal-selected-background)] aria-selected:text-[var(--navigation-internal-selected-foreground)] aria-selected:hover:border-[var(--navigation-internal-selected-border)] aria-selected:hover:bg-[var(--navigation-internal-selected-background)] aria-selected:hover:text-[var(--navigation-internal-selected-foreground)]",qs="rounded-[var(--monkeys-component-navigation-sidebar-action-radius,0.25rem)] text-inherit hover:bg-foreground/10 hover:text-inherit focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none";function Yv(e,t,o={}){let r=m(Ys,e,t,kf);return {...o,root:m(KE,"space-y-0.5",o.root),group:m("space-y-0.5","[&>[role=treeitem]+[role=group]]:[--data-explorer-tree-group-indent:var(--monkeys-component-navigation-sidebar-tree-group-indent,1rem)]",o.group),groupHeaderButton:m("h-auto",r,o.groupHeaderButton),nodeButton:m(r,qE,o.nodeButton),itemSelected:m(Cf,o.itemSelected),nodeIcon:m(Xs,"group-hover/tree-node:text-inherit",o.nodeIcon),nodeLabel:m("font-medium",o.nodeLabel),nodeDescription:m("text-inherit",o.nodeDescription),nodeDisabled:m("opacity-50",o.nodeDisabled),groupActions:m(qs,"order-2 size-5 p-0 group-focus-within/tree-group:opacity-100",o.groupActions),nodeActions:m(qs,"order-2 size-5 p-0 group-focus-within/tree-node:opacity-100",o.nodeActions),nodeToggle:m(qs,"order-1 empty:hidden",o.nodeToggle),expander:m(qs,"order-1 empty:hidden",o.expander),nodeDragHandle:m(qs,o.nodeDragHandle)}}a(Yv,"unifiedTreeClassNames");function QE({collapsed:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4",fill:"none",children:jsxRuntime.jsx("path",{d:e?"M4 4.5h12M4 15.5h12M5 7.5 7.5 10 5 12.5M15 7.5 12.5 10l2.5 2.5":"M4 4.5h12M4 15.5h12M7.5 7.5 5 10l2.5 2.5M12.5 7.5 15 10l-2.5 2.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}a(QE,"CollapseIcon");function ZE(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8.5",cy:"8.5",r:"5",stroke:"currentColor",strokeWidth:"1.6"}),jsxRuntime.jsx("path",{d:"m12.2 12.2 3.3 3.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}a(ZE,"SearchIcon");function JE(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5",fill:"none",children:jsxRuntime.jsx("path",{d:"m6 6 8 8m0-8-8 8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}a(JE,"ClearIcon");function eA(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4",fill:"currentColor",children:[jsxRuntime.jsx("circle",{cx:"5",cy:"10",r:"1.2"}),jsxRuntime.jsx("circle",{cx:"10",cy:"10",r:"1.2"}),jsxRuntime.jsx("circle",{cx:"15",cy:"10",r:"1.2"})]})}a(eA,"MoreIcon");function ou({expanded:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:m("h-4 w-4 transition-transform motion-reduce:transition-none",e&&"rotate-180"),fill:"none",children:jsxRuntime.jsx("path",{d:"m6 8 4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}a(ou,"DisclosureIcon");function tA(e,t){typeof e=="function"?e(t):e&&(e.current=t);}a(tA,"assignRef");function Gi(e,t){if(!Number.isFinite(t))throw new RangeError(`NavigationSidebar ${e} must be a finite number.`)}a(Gi,"requireFiniteNumber");function oA(e){let t=e.minWidth??180,o=e.maxWidth??420,r=e.defaultWidth??256,n=e.collapsedWidth??60,i=e.collapseThreshold??140;if(Gi("minWidth",t),Gi("maxWidth",o),Gi("defaultWidth",r),Gi("collapsedWidth",n),Gi("collapseThreshold",i),t<=0)throw new RangeError("NavigationSidebar minWidth must be greater than zero.");if(o<t)throw new RangeError("NavigationSidebar maxWidth must be greater than or equal to minWidth.");if(n<0)throw new RangeError("NavigationSidebar collapsedWidth cannot be negative.");if(i<0)throw new RangeError("NavigationSidebar collapseThreshold cannot be negative.");return {defaultWidth:r,minWidth:t,maxWidth:o,collapsedWidth:n,collapseThreshold:i}}a(oA,"resolveLayoutBounds");function ru(e,t){return Math.min(Math.max(e,t.minWidth),t.maxWidth)}a(ru,"clampWidth");function ew(e,t){if(t){t(e);return}typeof console<"u"&&console.warn("NavigationSidebar could not persist layout state.",e);}a(ew,"reportStorageError");function tw(e){if(e)return e;if(!(typeof window>"u"))return window.localStorage}a(tw,"resolveStorage");function rA(e,t){let o={collapsed:e.defaultCollapsed??false,width:ru(t.defaultWidth,t)};if(!e.storageKey)return o;let r=tw(e.storage);if(!r)return o;try{let n=r.getItem(e.storageKey);if(!n)return o;let i=JSON.parse(n);return {collapsed:typeof i.collapsed=="boolean"?i.collapsed:o.collapsed,width:typeof i.width=="number"&&Number.isFinite(i.width)?ru(i.width,t):o.width}}catch(n){return ew(n,e.onStorageError),o}}a(rA,"readStoredLayout");function Tf(e,t){return t||(typeof e=="string"?e:void 0)}a(Tf,"getNodeTitle");function nA(e){return e==="solid"?"border-primary bg-primary text-primary-foreground shadow-sm":e==="outline"?"border-primary/55 bg-background text-foreground ring-1 ring-primary/20":e==="muted"?"border-transparent bg-muted text-foreground":"border-primary/25 bg-primary/10 text-foreground"}a(nA,"activeVariantClassName");function aA(e){if(e?.preset!==void 0&&e.preset!=="unified")throw new TypeError(`Unknown NavigationSidebar preset "${e.preset}". Supported preset: unified.`);let t=e?.preset==="unified",o=e?.density??(t?"compact":"default"),r=e?.surface??"panel",n=e?.activeVariant??(t?"muted":"soft");return {unified:t,density:o,surface:r,activeVariant:n,selected:t?Cf:nA(n),inactive:t?kf:"text-muted-foreground hover:border-border/70 hover:bg-muted/60 hover:text-foreground",root:m(r==="plain"&&"border-transparent bg-transparent shadow-none",r==="panel"&&"border-border/70 bg-card text-card-foreground shadow-sm",r==="frosted"&&"border-border/55 bg-card/80 text-card-foreground shadow-sm backdrop-blur-xl",r==="outlined"&&"border-border bg-background text-foreground shadow-none",t&&"rounded-[var(--radius)] shadow-none",t&&Kv,t&&r==="panel"&&"border-[var(--monkeys-component-navigation-sidebar-border,hsl(var(--monkeys-color-border,var(--border))))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--monkeys-color-card,var(--card))))] text-foreground"),itemHeight:o==="compact"?t?"min-h-[var(--monkeys-component-navigation-sidebar-row-height,2.5rem)]":"min-h-9":o==="comfortable"?"min-h-14":"min-h-11",itemPadding:o==="compact"?t?"px-2 py-2":"px-2 py-1.5":o==="comfortable"?"px-3 py-3":"px-3 py-2",searchHeight:o==="compact"?t?"h-[var(--monkeys-component-navigation-sidebar-row-height,2.5rem)]":"h-8":o==="comfortable"?"h-10":"h-9"}}a(aA,"resolveAppearance");var Jv="hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-hover-background,hsl(var(--muted)))] hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-hover-foreground,hsl(var(--foreground)))]",iA="bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))] hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))]",Qs="hover:!bg-transparent hover:!text-inherit focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring";function sA(e){return {...e,groupHeader:m(Jv,e?.groupHeader),itemSelected:m(iA,e?.itemSelected),nodeButton:m(Jv,"aria-selected:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] aria-selected:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))] aria-selected:hover:bg-[var(--monkeys-component-navigation-sidebar-tree-row-selected-background,hsl(var(--accent)))] aria-selected:hover:text-[var(--monkeys-component-navigation-sidebar-tree-row-selected-foreground,hsl(var(--accent-foreground)))]",e?.nodeButton),expander:m(Qs,e?.expander),nodeToggle:m(Qs,e?.nodeToggle),groupActions:m(Qs,e?.groupActions),nodeActions:m(Qs,e?.nodeActions),nodeDragHandle:m(Qs,e?.nodeDragHandle)}}a(sA,"resolveNavigationTreeClassNames");function Nf({item:e,active:t,collapsed:o,mobile:r,embedded:n=false,appearance:i,classNames:s,domClassName:l}){return m("group/navigation-item relative flex w-full min-w-0 items-center gap-3 rounded-[var(--radius)] border border-transparent text-left text-sm outline-hidden transition-[background-color,border-color,color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",i.itemHeight,i.itemPadding,i.unified&&Ys,n?"min-h-0 self-stretch border-0 bg-transparent text-inherit hover:bg-transparent hover:text-inherit":t?i.selected:i.inactive,o&&!r&&"justify-center px-0",e.disabled&&"pointer-events-none opacity-50",s?.item,t&&s?.itemActive,r&&s?.mobileItem,l,e.className)}a(Nf,"entryClassName");function Rf({item:e,collapsed:t,mobile:o,classNames:r,endIndicator:n,appearance:i}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V(e.icon)?jsxRuntime.jsx("span",{className:m("flex size-5 shrink-0 items-center justify-center [&_svg]:size-full",i.unified&&Xs,r?.itemIcon),"aria-hidden":"true",children:e.icon}):null,o||!t?jsxRuntime.jsxs("span",{className:m("flex min-w-0 flex-1 flex-col",r?.itemContent),children:[jsxRuntime.jsx("span",{className:m("min-w-0 truncate font-semibold",i.unified&&"font-medium",r?.itemLabel),children:e.label}),V(e.description)?jsxRuntime.jsx("span",{className:m("mt-0.5 truncate text-xs font-normal",i.unified&&"text-inherit",r?.itemDescription),children:e.description}):null]}):null,(o||!t)&&V(e.meta)?jsxRuntime.jsx("span",{className:m("shrink-0 text-xs text-muted-foreground",r?.itemMeta),children:e.meta}):null,(o||!t)&&V(e.endContent)?jsxRuntime.jsx("span",{className:m("shrink-0",r?.itemEndContent),children:e.endContent}):null,(o||!t)&&V(n)?jsxRuntime.jsx("span",{className:"flex shrink-0 items-center justify-center",children:n}):null]})}a(Rf,"EntryContent");function nu({item:e,active:t,collapsed:o,itemAs:r,appearance:n,classNames:i,mobile:s=false,embedded:l=false,onSelect:d,ariaControls:c,ariaExpanded:p,endIndicator:u}){let g=r??(e.href?"a":"button"),f=Tf(e.label,e.title),b=e.domProps??{},x=a(k=>{if(e.disabled){k.preventDefault();return}e.onClick?.(k),d?.();},"handleClick"),y={...b,...e.to?{to:e.to}:{},...e.href?{href:e.href}:{},...g==="button"?{type:"button",disabled:e.disabled}:{},title:f,"aria-current":t?"page":void 0,"aria-disabled":e.disabled||void 0,"aria-controls":c,"aria-expanded":p,tabIndex:e.disabled?-1:b.tabIndex,onClick:x};return jsxRuntime.jsx(g,{...y,"data-navigation-sidebar-item-id":e.id,"data-active":t?"true":"false","data-expanded":p===void 0?void 0:String(p),className:Nf({item:e,active:t,collapsed:o,mobile:s,embedded:l,appearance:n,classNames:i,domClassName:b.className}),children:jsxRuntime.jsx(Rf,{appearance:n,item:e,collapsed:o,mobile:s,classNames:i,endIndicator:u})})}a(nu,"EntryButton");function lA({item:e,appearance:t,classNames:o}){let r=e.domProps??{};return jsxRuntime.jsx("div",{...r,"data-navigation-sidebar-item-id":e.id,"aria-disabled":e.disabled||void 0,title:Tf(e.label,e.title),className:Nf({item:e,active:false,collapsed:false,mobile:true,embedded:true,appearance:t,classNames:o,domClassName:r.className}),children:jsxRuntime.jsx(Rf,{appearance:t,item:e,collapsed:false,mobile:true,classNames:o})})}a(lA,"EntryPresentation");function au({active:e,appearance:t}){return m("flex w-full min-w-0 items-center gap-0.5 rounded-[var(--radius)] border border-transparent pr-1 text-sm transition-[background-color,border-color,color,box-shadow] motion-reduce:transition-none",t.itemHeight,t.unified&&Ys,e?t.selected:t.inactive)}a(au,"routeRowClassName");function iu(e,t){return t?e.filter(o=>!o.filterIds?.length||o.filterIds.includes(t)):e}a(iu,"filterCatalogItems");function dA({props:e,collapsed:t,appearance:o}){let{items:r=[],sections:n=[],filters:i=[],activeFilterId:s,activeItemId:l,onFilterSelect:d,itemAs:c,layout:p="single",empty:u,ariaLabel:g,classNames:f}=e,b=iu(r,s),x=n.map(v=>({...v,items:iu(v.items,s)})).filter(v=>v.items.length>0),y=b.length>0||x.length>0,k=i.length>0&&!t?jsxRuntime.jsx("div",{role:"group",className:m(p==="split"?"flex min-w-32 flex-col gap-1 border-r border-border/60 pr-2":"flex flex-wrap gap-1",f?.filterList),"aria-label":g?`${g} filters`:void 0,children:i.map(v=>{let h=v.id===s;return jsxRuntime.jsxs("button",{type:"button",title:v.title??(typeof v.label=="string"?v.label:void 0),"aria-pressed":h,disabled:v.disabled,className:m("inline-flex min-h-8 items-center gap-2 rounded-md px-2.5 text-xs font-medium text-muted-foreground outline-hidden transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",h&&"bg-muted text-foreground",f?.filterItem,h&&f?.filterItemActive),onClick:()=>d?.(v),children:[V(v.icon)?jsxRuntime.jsx("span",{"aria-hidden":"true",children:v.icon}):null,jsxRuntime.jsx("span",{className:"truncate",children:v.label})]},v.id)})}):null,w=y?jsxRuntime.jsxs("div",{className:m("min-w-0 flex-1",f?.list),children:[b.length>0?jsxRuntime.jsx("ul",{className:"grid list-none gap-1 p-0",children:b.map(v=>jsxRuntime.jsx("li",{children:jsxRuntime.jsx(nu,{item:v,active:v.active??v.id===l,collapsed:t,itemAs:c,appearance:o,classNames:f})},v.id))}):null,x.map(v=>jsxRuntime.jsxs("section",{className:m("mt-3 first:mt-0",f?.section,v.className),children:[!t&&V(v.label)?jsxRuntime.jsx("div",{className:m("mb-1 px-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",f?.sectionLabel,v.labelClassName),children:v.label}):null,jsxRuntime.jsx("ul",{className:"grid list-none gap-1 p-0",children:v.items.map(h=>jsxRuntime.jsx("li",{children:jsxRuntime.jsx(nu,{item:h,active:h.active??h.id===l,collapsed:t,itemAs:c,appearance:o,classNames:f})},h.id))})]},v.id))]}):jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:u});return jsxRuntime.jsxs("nav",{"aria-label":g,className:m(p==="split"&&!t&&"flex min-w-0 gap-2"),children:[k,w]})}a(dA,"CatalogContent");function cA({child:e,parent:t,active:o,interactive:r,onSelect:n,appearance:i,classNames:s,embedded:l=false}){let d=r?"button":"div",c=e.domProps??{};return jsxRuntime.jsxs(d,{...c,...r?{type:"button"}:{},"data-navigation-sidebar-child-id":e.id,"aria-current":r&&o?"page":void 0,"aria-disabled":e.disabled||void 0,title:Tf(e.label,e.title),disabled:r?e.disabled:void 0,className:m("flex w-full min-w-0 flex-1 items-center gap-3 rounded-[var(--radius)] border border-transparent text-left text-sm font-semibold outline-hidden transition-[background-color,border-color,color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",i.itemHeight,i.itemPadding,i.unified&&Ys,l?"min-h-0 self-stretch border-0 bg-transparent text-inherit hover:bg-transparent hover:text-inherit":o?i.selected:i.inactive,e.disabled&&"pointer-events-none opacity-50",s?.childItem,o&&s?.childItemActive,c.className,e.className),onClick:r&&!e.disabled?()=>n?.(e,t):void 0,children:[V(e.icon)?jsxRuntime.jsx("span",{className:m("flex size-5 shrink-0 items-center justify-center [&_svg]:size-full",i.unified&&Xs),"aria-hidden":"true",children:e.icon}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:e.label})]})}a(cA,"ChildEntry");function su({itemId:e,actions:t,kind:o,className:r,mobile:n=false}){return V(t)?jsxRuntime.jsx("div",{"data-navigation-sidebar-item-actions":o==="item"?e:void 0,"data-navigation-sidebar-child-actions":o==="child"?e:void 0,"data-navigation-sidebar-actions-mobile":n?"true":void 0,className:m("ml-auto flex shrink-0 items-center gap-1 [&>button]:border-0 [&>button]:bg-transparent [&>button]:shadow-none [&>button:hover]:bg-muted",r),children:t}):null}a(su,"RouteActions");function Mf(e){return e.interaction==="disclosure"}a(Mf,"isDisclosureRouteItem");function uA(e){let t=new Set,o=new Set,r=new Set;for(let n of e){let i=n.id;if(t.has(i))throw new RangeError(`NavigationSidebar route item ids must be unique; received "${i}" more than once.`);if(t.add(i),Mf(n)){if(!n.children.length)throw new RangeError(`NavigationSidebar disclosure item "${n.id}" must include at least one child.`);if(n.href!==void 0||n.to!==void 0||n.onClick!==void 0)throw new TypeError(`NavigationSidebar disclosure item "${i}" cannot define href, to, or onClick.`);r.add(n.id);}else if(n.childrenPresentation==="collapsible"){if(!n.children?.length)throw new RangeError(`NavigationSidebar collapsible route item "${n.id}" must include at least one child.`);r.add(n.id);}for(let l of n.children??[]){if(o.has(l.id))throw new RangeError(`NavigationSidebar route child ids must be unique; received "${l.id}" more than once.`);o.add(l.id);}}return r}a(uA,"validateRouteItems");function pA({item:e,expanded:t,controls:o,label:r,onToggle:n,classNames:i}){let s=typeof e.label=="string"?e.label:e.id;return jsxRuntime.jsx("button",{type:"button",disabled:e.disabled,"aria-expanded":t,"aria-controls":o,"aria-label":`${r}: ${s}`,title:r,"data-navigation-sidebar-disclosure-trigger":e.id,className:m("inline-flex h-8 w-7 shrink-0 items-center justify-center rounded-md border-0 bg-transparent text-muted-foreground shadow-none outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",i?.childMenuTrigger),onClick:n,children:jsxRuntime.jsx(ou,{expanded:t})})}a(pA,"RouteChildrenToggle");function lu({item:e,activeChildId:t,label:o,onChildSelect:r,classNames:n,appearance:i,triggerVariant:s="submenu",mobile:l=false}){let d=(e.children??[]).filter(g=>!g.disabled);if(!e.children?.length||s==="submenu"&&(!r||d.length===0))return null;let c=typeof e.label=="string"?e.label:e.id,p=!!e.disabled||!r||d.length===0,u=e.domProps??{};return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:s==="item"&&i?jsxRuntime.jsx("button",{...u,type:"button",disabled:p,"aria-label":`${o}: ${c}`,title:o,"data-navigation-sidebar-item-id":e.id,"data-navigation-sidebar-disclosure-menu":"true",className:Nf({item:e,active:false,collapsed:!l,mobile:l,appearance:i,classNames:n,domClassName:u.className}),children:jsxRuntime.jsx(Rf,{appearance:i,item:e,collapsed:!l,mobile:l,classNames:n,endIndicator:l?jsxRuntime.jsx(ou,{expanded:false}):void 0})}):jsxRuntime.jsx("button",{type:"button",disabled:s==="disclosure"?p:void 0,"data-navigation-sidebar-disclosure-trigger":s==="disclosure"?e.id:void 0,className:m("inline-flex h-8 shrink-0 items-center justify-center rounded-md border-0 bg-transparent text-muted-foreground shadow-none outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",s==="disclosure"?"w-7":"w-6",n?.childMenuTrigger),"aria-label":`${o}: ${c}`,title:o,children:s==="disclosure"?jsxRuntime.jsx(ou,{expanded:false}):jsxRuntime.jsx(eA,{})})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{side:"right",align:"start",sideOffset:8,className:m("z-50 min-w-40 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-hidden",n?.childMenuContent),children:e.children?.map(g=>jsxRuntime.jsxs(Bt__namespace.Item,{disabled:g.disabled,"data-navigation-sidebar-child-id":g.id,"data-active":g.id===t?"true":"false",className:m("flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",g.id===t&&"bg-accent text-accent-foreground"),onSelect:()=>r?.(g,e),children:[V(g.icon)?jsxRuntime.jsx("span",{"aria-hidden":"true",children:g.icon}):null,jsxRuntime.jsx("span",{className:"truncate",children:g.label})]},g.id))})})]})}a(lu,"CollapsedChildMenu");function mA({props:e,collapsed:t,appearance:o}){let{routeItems:r,activeItemId:n,activeChildId:i,expandedItemIds:s,defaultExpandedItemIds:l=[],itemAs:d,onItemSelect:c,onChildSelect:p,onExpandedItemIdsChange:u,collapsedChildMenuLabel:g="Open submenu",disclosureLabel:f="Toggle submenu",ariaLabel:b,classNames:x}=e,y=ho.useId(),k=ho.useMemo(()=>uA(r),[r]),[w,v]=ho.useState(()=>l),h=s!==void 0,S=s??w,T=ho.useMemo(()=>S.filter(M=>k.has(M)),[k,S]),C=ho.useMemo(()=>new Set(T),[T]),R=ho.useCallback(M=>{if(M.disabled||!k.has(M.id))return;let I=C.has(M.id)?T.filter(A=>A!==M.id):[...T,M.id];h||v(I),u?.(I);},[k,C,h,T,u]);return jsxRuntime.jsx("nav",{"aria-label":b,children:jsxRuntime.jsx("ul",{className:m("grid list-none gap-2 p-0",o.unified&&"gap-0.5",x?.list),children:r.map((M,I)=>{let A=Mf(M),N=!A&&M.id===n,D=!!M.children?.length,E=k.has(M.id),P=!E||C.has(M.id),W=!t&&V(M.actions),H=t&&D&&!!p||!t&&E&&!A||W,B=`${y}-route-children-${I}`;return jsxRuntime.jsxs("li",{className:"grid min-w-0 gap-1",children:[t&&A?jsxRuntime.jsx(lu,{item:M,activeChildId:i,label:g,onChildSelect:p,classNames:x,appearance:o,triggerVariant:"item"}):jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-row":H?M.id:void 0,"data-active":H?String(N):void 0,className:H?au({active:N,appearance:o}):void 0,children:[jsxRuntime.jsx(nu,{item:M,active:N,collapsed:t,embedded:H,itemAs:A?"button":d,appearance:o,classNames:x,onSelect:A?()=>R(M):c?()=>c(M):void 0,ariaControls:!t&&E&&A?B:void 0,ariaExpanded:!t&&E&&A?P:void 0,endIndicator:!t&&A&&!W?jsxRuntime.jsx(ou,{expanded:P}):void 0}),W?jsxRuntime.jsx(su,{itemId:M.id,actions:M.actions,kind:"item",className:x?.itemActions}):null,t&&p?jsxRuntime.jsx(lu,{item:M,activeChildId:i,label:g,onChildSelect:p,classNames:x}):null,!t&&E&&(!A||W)?jsxRuntime.jsx(pA,{item:M,expanded:P,controls:B,label:f,onToggle:()=>R(M),classNames:x}):null]}),!t&&D?jsxRuntime.jsx("ul",{id:B,hidden:!P,style:P?void 0:{display:"none"},className:m("ml-5 grid list-none gap-0.5 border-l border-border/70 py-1 pl-3",o.unified&&"border-border",x?.childList),children:M.children?.map(L=>{let F=V(L.actions),_=L.id===i,$=jsxRuntime.jsx(cA,{child:L,parent:M,active:_,interactive:!!p,onSelect:p,appearance:o,classNames:x,embedded:F});return jsxRuntime.jsx("li",{children:F?jsxRuntime.jsxs("div",{"data-navigation-sidebar-child-row":L.id,"data-active":String(_),className:au({active:_,appearance:o}),children:[$,jsxRuntime.jsx(su,{itemId:L.id,actions:L.actions,kind:"child",className:x?.childActions})]}):$},L.id)})}):null]},M.id)})})})}a(mA,"RouteContent");function fA(e,t,o){return [...iu(e,o),...t.flatMap(r=>iu(r.items,o))]}a(fA,"flattenCatalogItems");function bA({props:e,appearance:t}){if(!e.mobile||e.mobile.mode!=="horizontal")return null;let o=e.classNames,r=e.kind==="catalog"?fA(e.items??[],e.sections??[],e.activeFilterId):e.routeItems;return jsxRuntime.jsx("nav",{"aria-label":e.ariaLabel,className:m("flex gap-2 overflow-x-auto pb-1",o?.mobileNav,e.mobile.className),children:r.map(n=>{let i={...o,mobileItem:m(o?.mobileItem,e.mobile?.itemClassName)},s=e.kind==="route"?n:void 0,l=s!==void 0&&V(s.actions);if(e.kind==="route"&&Mf(n))return l?jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-row":n.id,"data-active":"false",className:m(au({active:false,appearance:t}),"shrink-0"),children:[jsxRuntime.jsx(lA,{item:n,appearance:t,classNames:i}),jsxRuntime.jsx(su,{itemId:n.id,actions:n.actions,kind:"item",className:o?.itemActions,mobile:true}),jsxRuntime.jsx(lu,{item:n,activeChildId:e.activeChildId,label:e.collapsedChildMenuLabel??"Open submenu",onChildSelect:e.onChildSelect,classNames:i,appearance:t,triggerVariant:"disclosure",mobile:true})]},n.id):jsxRuntime.jsx(ho.Fragment,{children:jsxRuntime.jsx(lu,{item:n,activeChildId:e.activeChildId,label:e.collapsedChildMenuLabel??"Open submenu",onChildSelect:e.onChildSelect,classNames:i,appearance:t,triggerVariant:"item",mobile:true})},n.id);let d=e.kind==="catalog"?n.active??n.id===e.activeItemId:n.id===e.activeItemId,c=jsxRuntime.jsx(nu,{item:n,active:d,collapsed:false,embedded:l,itemAs:e.itemAs,appearance:t,classNames:i,mobile:true,onSelect:e.kind==="route"&&e.onItemSelect?()=>e.onItemSelect?.(n):void 0});return l&&s?jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-row":n.id,"data-active":String(d),className:m(au({active:d,appearance:t}),"shrink-0"),children:[c,jsxRuntime.jsx(su,{itemId:s.id,actions:s.actions,kind:"item",className:o?.itemActions,mobile:true})]},n.id):jsxRuntime.jsx(ho.Fragment,{children:c},n.id)})})}a(bA,"MobileNavigation");function gA(e,t){let o=oA(e);e.width!==void 0&&Gi("width",e.width);let r=ho.useRef(null);r.current||(r.current=rA(e,o));let n=ho.useRef(null),[i,s]=ho.useState(r.current.collapsed),[l,d]=ho.useState(r.current.width),[c,p]=ho.useState(e.search?.defaultValue??""),[u,g]=ho.useState(false),f=e.collapsed??i,b=ru(e.width??l,o),x=e.search?.value??c,y=e.collapsed!==void 0,k=e.width!==void 0,w=ho.useMemo(()=>aA(e.appearance),[e.appearance]),v=e.collapsible??true,h=e.resizable??true,S=v?e.collapsePlacement??"header":"none",T=e.collapseLabel??"Collapse sidebar",C=e.expandLabel??"Expand sidebar",R=e.resizeLabel??"Resize sidebar",M=!f||o.collapsedWidth>0,I=a(H=>{n.current=H,tA(t,H);},"setSidebarRef"),A=ho.useCallback(H=>{!v&&H||(y||s(H),e.onCollapsedChange?.(H));},[v,y,e.onCollapsedChange]),N=ho.useCallback(H=>{let B=ru(H,o);k||d(B),e.onWidthChange?.(B);},[o.maxWidth,o.minWidth,k,e.onWidthChange]);ho.useEffect(()=>{if(!e.storageKey)return;let H=tw(e.storage);if(H)try{H.setItem(e.storageKey,JSON.stringify({collapsed:f,width:b}));}catch(B){ew(B,e.onStorageError);}},[e.onStorageError,e.storage,e.storageKey,f,b]),ho.useEffect(()=>{if(!u)return;let H=document.body.style.cursor,B=document.body.style.userSelect,L=a(_=>{let $=n.current;if(!$)return;let G=_.clientX-$.getBoundingClientRect().left;if(v&&G<o.collapseThreshold){A(true);return}A(false),N(G);},"handlePointerMove"),F=a(()=>g(false),"handlePointerUp");return window.addEventListener("pointermove",L),window.addEventListener("pointerup",F),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",F),document.body.style.cursor=H,document.body.style.userSelect=B;}},[o.collapseThreshold,v,u,A,N]);let D=a(H=>{if(!(H.key!=="ArrowLeft"&&H.key!=="ArrowRight")){if(H.preventDefault(),H.key==="ArrowLeft"){let B=b-24;v&&B<o.collapseThreshold?A(true):N(B);return}f&&A(false),N(Math.max(b+24,o.minWidth));}},"handleResizeKeyDown"),E=a(H=>jsxRuntime.jsx("button",{type:"button",className:m("inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-hidden transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",e.classNames?.collapseButton,H),"aria-label":f?C:T,title:f?C:T,"aria-expanded":!f,onClick:()=>A(!f),children:jsxRuntime.jsx(QE,{collapsed:f})}),"collapseButton"),P=V(e.title)||V(e.headerLeading)||V(e.headerActions)||S==="header",W=a(()=>{if(e.kind==="catalog")return jsxRuntime.jsx(dA,{props:e,collapsed:f,appearance:w});if(e.kind==="route")return jsxRuntime.jsx(mA,{props:e,collapsed:f,appearance:w});let H=e.tree;return jsxRuntime.jsx(eu,{...H,classNames:w.unified?Yv(w.itemHeight,w.itemPadding,H.classNames):sA(H.classNames)})},"renderContent");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("aside",{...e.rootDomProps,ref:I,"aria-label":e.ariaLabel,"data-monkeys-component":e.dataComponent??"navigation-sidebar","data-navigation-sidebar-kind":e.kind,"data-navigation-sidebar-preset":e.appearance?.preset,"data-collapsed":f?"true":"false",className:m("relative flex h-full min-h-0 shrink-0 flex-col overflow-visible rounded-[calc(var(--radius)+0.25rem)] border transition-[width,opacity] duration-300 motion-reduce:transition-none",w.root,e.desktopClassName,e.classNames?.root,e.rootDomProps?.className,e.className),style:{...w.unified?qv(e.appearance?.activeVariant):{},...e.style,width:e.widthMode==="fill"?void 0:f?o.collapsedWidth:b,transition:u?"none":e.style?.transition},children:[h?jsxRuntime.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-valuemin":o.minWidth,"aria-valuemax":o.maxWidth,"aria-valuenow":b,"aria-label":R,title:R,className:m("group/resize absolute -right-1.5 bottom-0 top-0 z-40 w-3 cursor-col-resize bg-transparent outline-hidden focus-visible:ring-2 focus-visible:ring-ring",e.classNames?.resizeHandle),onPointerDown:H=>{H.preventDefault(),g(true);},onKeyDown:D,children:jsxRuntime.jsx("span",{className:"pointer-events-none absolute bottom-3 right-1/2 top-3 w-px translate-x-1/2 rounded-full bg-border opacity-0 transition-opacity group-hover/resize:opacity-100 group-focus-visible/resize:opacity-100"})}):null,S==="edge"?E("absolute -right-3 top-1/2 z-50 -translate-y-1/2 border border-border bg-background shadow-sm"):null,M?jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden",children:[P?jsxRuntime.jsxs("div",{className:m("flex min-h-12 min-w-0 items-center gap-2 border-b border-border/60 px-3",w.unified&&"min-h-14 border-border px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))]",f&&"justify-center px-1",e.classNames?.header),children:[V(e.headerLeading)?jsxRuntime.jsx("span",{className:m("flex shrink-0 items-center justify-center",e.classNames?.headerLeading),children:e.headerLeading}):null,!f&&V(e.title)?jsxRuntime.jsx("div",{className:m("min-w-0 flex-1 truncate text-sm font-semibold",e.classNames?.title),children:e.title}):null,!f&&V(e.headerActions)?jsxRuntime.jsx("div",{className:m("flex shrink-0 items-center gap-1",e.classNames?.headerActions),children:e.headerActions}):null,S==="header"?E():null]}):null,!f&&e.search?jsxRuntime.jsx("div",{className:m("px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] pb-2 pt-3",w.unified&&"pb-1",e.classNames?.search),children:jsxRuntime.jsxs("div",{className:m("flex items-center gap-2 rounded-md border border-input bg-[var(--monkeys-component-navigation-sidebar-search-background,hsl(var(--monkeys-color-control-surface)))] px-3 text-muted-foreground ring-offset-control-surface focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",w.searchHeight,w.unified&&"rounded-[var(--radius)] border-border bg-[var(--monkeys-component-navigation-sidebar-search-background,transparent)] px-2"),children:[jsxRuntime.jsx("span",{className:m("flex shrink-0",w.unified&&Xs,e.classNames?.searchIcon),"aria-hidden":"true",children:e.search.icon??jsxRuntime.jsx(ZE,{})}),jsxRuntime.jsx("input",{type:"search",value:x,placeholder:e.search.placeholder,"aria-label":e.search.ariaLabel,className:m("min-w-0 flex-1 bg-transparent text-sm text-foreground outline-hidden placeholder:text-muted-foreground",e.classNames?.searchInput),onChange:H=>{let B=H.currentTarget.value;e.search?.value===void 0&&p(B),e.search?.onValueChange?.(B);}}),x&&e.search.clearLabel?jsxRuntime.jsx("button",{type:"button",className:m("inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",e.classNames?.searchClear),"aria-label":e.search.clearLabel,title:e.search.clearLabel,onClick:()=>{e.search?.value===void 0&&p(""),e.search?.onValueChange?.("");},children:jsxRuntime.jsx(JE,{})}):null]})}):null,jsxRuntime.jsx("div",{className:m("min-h-0 flex-1 overflow-y-auto px-[var(--monkeys-component-navigation-sidebar-content-inline-padding,var(--global-spacing,0.75rem))] py-3",w.unified&&e.search&&"pt-1",f&&"px-1.5",e.classNames?.content),children:W()}),V(e.footer)||S==="footer"?jsxRuntime.jsxs("div",{className:m("flex shrink-0 items-center gap-2 border-t border-border/70 p-3",w.unified&&"border-border",f&&"justify-center px-1",e.classNames?.footer),children:[!f&&V(e.footer)?jsxRuntime.jsx("div",{className:"min-w-0 flex-1",children:e.footer}):null,S==="footer"?E():null]}):null]}):null]}),e.kind!=="tree"?jsxRuntime.jsx(bA,{props:e,appearance:w}):null]})}a(gA,"NavigationSidebarInner");var $i=ho.forwardRef(gA);var rw=ho.forwardRef(a(function({title:t,items:o,sections:r=[],activeItemId:n,onItemSelect:i,itemAs:s,collapsed:l,defaultCollapsed:d=false,onCollapsedChange:c,width:p,onWidthChange:u,defaultWidth:g=220,minWidth:f=180,maxWidth:b=420,collapsedWidth:x=60,collapseThreshold:y=140,storageKey:k,resizable:w=true,collapsible:v=true,collapseLabel:h="Collapse sidebar",expandLabel:S="Expand sidebar",resizeLabel:T="Resize sidebar",desktopClassName:C="hidden md:flex",mobileClassName:R="flex md:hidden",className:M,classNames:I,style:A,...N},D){let{level:E,variables:P}=Jh(),W=a(H=>({...H,icon:H.icon??(H.iconName?jsxRuntime.jsx(xf,{icon:{kind:"lucide",name:H.iconName},alt:"",className:"h-4 w-4 rounded-none bg-transparent"}):void 0),endContent:H.endContent??(H.count!==void 0?jsxRuntime.jsx(gc,{children:H.count}):void 0),onClick:a(B=>{H.disabled||(H.onClick?.(B),B.defaultPrevented||i?.({itemId:H.id}));},"onClick")}),"project");return jsxRuntime.jsx(pm,{depth:E,children:jsxRuntime.jsx($i,{ref:D,kind:"catalog",title:t,items:o.map(W),sections:r.map(H=>({...H,items:H.items.map(W)})),activeItemId:n,itemAs:s,collapsed:l,defaultCollapsed:d,onCollapsedChange:c,width:p,onWidthChange:u,defaultWidth:g,minWidth:f,maxWidth:b,collapsedWidth:x,collapseThreshold:y,storageKey:k,resizable:w,collapsible:v,collapsePlacement:"header",collapseLabel:h,expandLabel:S,resizeLabel:T,desktopClassName:C,dataComponent:"workbench-resizable-sidebar",rootDomProps:{...N,"data-workbench-resizable-sidebar":"","data-monkeys-bento-level":E},appearance:{density:"compact",surface:"panel",activeVariant:"soft"},mobile:{mode:"horizontal",className:R},className:m(Zh,"[&>div]:gap-[var(--monkeys-bento-gap)] [--monkeys-sidebar-item-padding:var(--monkeys-bento-gap)] data-[collapsed=true]:[--monkeys-sidebar-item-padding:0px]",I?.root,M),classNames:{root:I?.root,header:m("min-h-0 gap-[var(--monkeys-bento-gap)] border-0 p-0",I?.header),title:m("text-xs font-medium uppercase text-muted-foreground",I?.title),collapseButton:m("h-8 w-8",I?.collapseButton),content:m("space-y-[var(--monkeys-bento-gap)] p-0",I?.list),list:"[&_ul]:gap-[var(--monkeys-bento-gap)]",section:m("mt-[var(--monkeys-bento-gap)]",I?.section),sectionLabel:m("mb-[var(--monkeys-bento-gap)] px-[var(--monkeys-bento-gap)]",I?.sectionLabel),item:m("h-auto min-h-9 gap-[var(--monkeys-bento-gap)] rounded-md px-[var(--monkeys-sidebar-item-padding)] py-[calc(var(--monkeys-bento-gap)/2)] text-sm shadow-none",I?.item),itemIcon:m("[&_svg]:h-3.5 [&_svg]:w-3.5",I?.itemIcon),itemLabel:I?.itemLabel,resizeHandle:I?.resizeHandle,mobileNav:m("gap-[var(--monkeys-bento-gap,var(--global-spacing,0.75rem))] pb-0",I?.mobileNav),mobileItem:m("h-auto min-h-9 w-auto shrink-0 gap-[var(--monkeys-bento-gap,var(--global-spacing,0.75rem))] px-[var(--monkeys-bento-gap,var(--global-spacing,0.75rem))] py-[calc(var(--monkeys-bento-gap,var(--global-spacing,0.75rem))/2)] text-sm",I?.mobileItem)},style:{...P,...A}})})},"WorkbenchResizableSidebar"));function xA(e){return !!(e.header||e.footer||e.bodyAs||e.bodyClassName||e.bodyProps||e.classNames?.body)}a(xA,"shouldRenderBodyWrapper");var nw=ho.forwardRef(a(function({as:t="section",bodyAs:o="div",header:r,footer:n,children:i,className:s,headerClassName:l,bodyClassName:d,footerClassName:c,bodyProps:p,classNames:u,style:g,...f},b){let x=xA({header:r,footer:n,bodyAs:o==="div"?void 0:o,bodyClassName:d,bodyProps:p,classNames:u}),{className:y,...k}=p??{};return jsxRuntime.jsxs(t,{ref:b,"data-workbench-content-pane":true,className:m("workbench-surface-subtle flex h-full min-w-0 flex-1 flex-col overflow-hidden rounded-lg border border-border/50 transition-all duration-300 dark:border-border/40",u?.root,s),style:g,...f,children:[r?jsxRuntime.jsx("div",{className:m("shrink-0 border-b border-border/40 px-4 py-3 dark:border-border/30",u?.header,l),children:r}):null,x?jsxRuntime.jsx(o,{className:m("min-h-0 flex-1 overflow-hidden",u?.body,d,y),...k,children:i}):i,n?jsxRuntime.jsx("div",{className:m("shrink-0 border-t border-border/40 px-4 py-3 dark:border-border/30",u?.footer,c),children:n}):null]})},"WorkbenchContentPane"));var sw={settingsButton:"Gallery settings",title:"Gallery settings",visibleColumns:"Visible fields",coverField:"Cover field",autoDetect:"Auto",cardDensity:"Card density",cardColumns:"Cards per row",detailColumns:"Detail columns",fieldVisibility:"Field visibility",fieldLimit:"Field limit",fieldLimitHint:"Uses current field order",layout:"Gallery layout",compact:"Compact",comfortable:"Standard",detailed:"Detailed",autoColumns:"Auto",columns:a(e=>`${e}`,"columns"),bentoColumns:a(e=>`${e}`,"bentoColumns"),topLimit:"First fields",allFields:"All fields",adaptiveGrid:"Grid",masonry:"Masonry"};function da(e){return String(e?.key||"")}a(da,"normalizeColumnKey");function CA(e){return e.label??e.key}a(CA,"getDefaultColumnLabel");function SA(e){return e.filter(t=>da(t)&&t.hidden!==true).map(t=>da(t))}a(SA,"getDefaultVisibleColumnKeys");function TA({columns:e,visibleColumnKeys:t,allowEmptyVisibleColumns:o}){let r=new Set(e.map(da).filter(Boolean)),n=Array.isArray(t)?t.filter(i=>r.has(String(i))):null;return n&&(n.length||o)?n:SA(e)}a(TA,"getResolvedVisibleColumnKeys");function NA(e){return [{value:"compact",label:e.compact},{value:"comfortable",label:e.comfortable},{value:"detailed",label:e.detailed}]}a(NA,"getDefaultDensityOptions");function RA(e){return [{value:"auto",label:e.autoColumns},{value:1,label:e.columns(1)},{value:2,label:e.columns(2)},{value:3,label:e.columns(3)},{value:4,label:e.columns(4)}]}a(RA,"getDefaultGridColumnOptions");function MA(e){return [{value:1,label:e.bentoColumns(1)},{value:2,label:e.bentoColumns(2)},{value:3,label:e.bentoColumns(3)}]}a(MA,"getDefaultBentoColumnOptions");function IA(e){return [{value:"limit",label:e.topLimit},{value:"all",label:e.allFields}]}a(IA,"getDefaultDetailVisibilityOptions");function DA(e){return [{value:"fixed",label:e.adaptiveGrid},{value:"masonry",label:e.masonry}]}a(DA,"getDefaultLayoutOptions");function Js(e){return String(e)}a(Js,"normalizeOptionValue");function el(e,t,o){let r=String(t??o);return e.some(n=>String(n.value)===r)?r:String(o)}a(el,"getOptionValue");function iw(e){let t=Number.parseInt(e,10);return Number.isFinite(t)?t:1}a(iw,"parseNumberOption");var tl={root:"flex w-full flex-wrap",item:"min-w-[58px] flex-1 px-2 text-[11px]",label:"text-[11px]"};function Df({columns:e=[],galleryFieldOptions:t,value:o,onValueChange:r,labels:n,densityOptions:i,gridColumnOptions:s,bentoColumnOptions:l,detailVisibilityOptions:d,layoutOptions:c,getColumnLabel:p=CA,getColumnDescription:u,showColumnVisibility:g=true,showGalleryControls:f=true,showLayoutControl:b=true,showGridColumns:x=true,showDetailColumns:y=true,allowEmptyVisibleColumns:k=false,className:w,classNames:v}){let h={...sw,...n},S=o||{},T=e.filter(F=>da(F)),C=TA({columns:T,visibleColumnKeys:S.visibleColumnKeys,allowEmptyVisibleColumns:k}),R=new Set(C),M=(t||T).filter(F=>da(F)),I=i||NA(h),A=s||RA(h),N=l||MA(h),D=d||IA(h),E=c||DA(h),P=typeof r=="function",W=a(F=>{r?.({...S,...F},F);},"updateValue"),H=a(F=>{if(!P)return;let _=new Set(C);_.has(F)?_.delete(F):_.add(F);let $=T.map(da).filter(G=>_.has(G));!$.length&&!k&&($=[F]),W({visibleColumnKeys:$});},"toggleColumn"),B=g&&T.length>0,L=f;return jsxRuntime.jsxs("div",{className:m("space-y-3 text-foreground",v?.root,w),children:[B?jsxRuntime.jsxs("section",{className:m("space-y-2",v?.section),children:[jsxRuntime.jsx("div",{className:m("text-[10px] font-medium uppercase tracking-wide text-muted-foreground",v?.sectionHeader),children:h.visibleColumns}),jsxRuntime.jsx("div",{className:m("max-h-[220px] space-y-1 overflow-y-auto pr-1",v?.columnList),children:T.map(F=>{let _=da(F);return jsxRuntime.jsx(ki,{checked:R.has(_),disabled:!P,label:p(F),description:u?.(F),onChange:()=>H(_),className:m("flex w-full rounded-lg px-2 py-1.5 hover:bg-muted/50",v?.columnItem)},`workbench-gallery-column-${_}`)})})]}):null,L?jsxRuntime.jsxs("section",{className:m("space-y-3 border-t border-border/60 pt-3",v?.section),children:[jsxRuntime.jsx(jr,{label:h.coverField,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(Hc,{value:String(S.galleryFieldKey||"auto"),options:[{value:"auto",label:h.autoDetect},...M.map(F=>({value:da(F),label:p(F)}))],disabled:!P,onChange:F=>W({galleryFieldKey:F.currentTarget.value||"auto"}),className:v?.control})}),jsxRuntime.jsx(jr,{label:h.cardDensity,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(sa,{value:el(I,S.galleryDensity,"comfortable"),options:I.map(F=>({value:Js(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryDensity:F}),className:m("w-full",v?.control),classNames:tl})}),x?jsxRuntime.jsx(jr,{label:h.cardColumns,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(sa,{value:el(A,S.galleryGridColumns,"auto"),options:A.map(F=>({value:Js(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryGridColumns:F==="auto"?"auto":iw(F)}),className:m("w-full",v?.control),classNames:tl})}):null,y?jsxRuntime.jsx(jr,{label:h.detailColumns,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(sa,{value:el(N,S.galleryBentoColumns,2),options:N.map(F=>({value:Js(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryBentoColumns:iw(F)}),className:m("w-full",v?.control),classNames:tl})}):null,jsxRuntime.jsx(jr,{label:h.fieldVisibility,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(sa,{value:el(D,S.galleryDetailVisibility,"limit"),options:D.map(F=>({value:Js(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryDetailVisibility:F}),className:m("w-full",v?.control),classNames:tl})}),S.galleryDetailVisibility!=="all"?jsxRuntime.jsx(jr,{label:h.fieldLimit,description:h.fieldLimitHint,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground",description:"text-[10px]"},children:jsxRuntime.jsx(Mc,{type:"number",min:1,step:1,value:String(S.galleryDetailLimit||4),disabled:!P,onChange:F=>W({galleryDetailLimit:F.currentTarget.value}),className:v?.control})}):null,b?jsxRuntime.jsx(jr,{label:h.layout,classNames:{label:"text-[10px] uppercase tracking-wide text-muted-foreground"},children:jsxRuntime.jsx(sa,{value:el(E,S.galleryLayout,"fixed"),options:E.map(F=>({value:Js(F.value),label:F.label,disabled:F.disabled})),onValueChange:F=>W({galleryLayout:F}),className:m("w-full",v?.control),classNames:tl})}):null]}):null]})}a(Df,"WorkbenchGallerySettingsPanel");function rl({open:e,defaultOpen:t=false,onOpenChange:o,triggerIcon:r,triggerLabel:n,triggerTitle:i,align:s="end",popoverWidth:l=320,panelHeader:d,panelBefore:c,panelAfter:p,panelClassName:u,buttonClassName:g,popoverClassName:f,buttonClassNames:b,labels:x,className:y,classNames:k,...w}){let v={...sw,...x},h=ho.useRef(null),[S,T]=ho.useState(t),[C,R]=ho.useState({}),M=e!==void 0,I=M?!!e:S,A=a(E=>{M||T(E),o?.(E);},"setOpen");ho.useLayoutEffect(()=>{if(!I)return;let E=a(()=>{let H=h.current?.getBoundingClientRect();if(!H||typeof window>"u")return;let B=12,L=Math.max(window.innerWidth-B*2,0),F=Math.min(l,L||l),_=s==="start"?H.left:H.right-F,$=Math.min(Math.max(_,B),Math.max(window.innerWidth-F-B,B)),G=Math.min(H.bottom+8,Math.max(window.innerHeight-80,B));R({left:$,top:G,width:F,maxHeight:`calc(100vh - ${Math.round(G+B)}px)`});},"updatePopoverPosition"),P=a(H=>{h.current?.contains(H.target)||A(false);},"handlePointerDown"),W=a(H=>{H.key==="Escape"&&A(false);},"handleKeyDown");return E(),window.addEventListener("resize",E),window.addEventListener("scroll",E,true),window.addEventListener("pointerdown",P),window.addEventListener("keydown",W),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,true),window.removeEventListener("pointerdown",P),window.removeEventListener("keydown",W);}},[s,I,l]);let N=n??v.settingsButton,D=d??v.title;return jsxRuntime.jsxs("div",{ref:h,className:m("relative inline-flex",b?.root,y),children:[jsxRuntime.jsx(dt,{icon:r,label:N,title:i||(typeof N=="string"?N:void 0),iconOnly:!!r,active:I,tone:"muted","aria-haspopup":"dialog","aria-expanded":I,className:m(b?.trigger,g),onClick:()=>A(!I)}),I?jsxRuntime.jsxs("div",{role:"dialog","aria-label":typeof D=="string"?D:void 0,className:m("fixed z-50 overflow-y-auto rounded-xl border border-border bg-card p-3 text-foreground shadow-lg",s==="start"?"origin-top-left":"origin-top-right",b?.popover,f),style:C,children:[D?jsxRuntime.jsx("div",{className:m("mb-3 text-[11px] font-medium text-foreground",b?.header),children:D}):null,c,jsxRuntime.jsx(Df,{...w,labels:v,className:m(b?.panel,u),classNames:k}),p]}):null]})}a(rl,"WorkbenchGallerySettingsButton");function uw(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),jsxRuntime.jsx("path",{d:"M3 10h18M9 4v16"})]})}a(uw,"TableViewIcon");function pw(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),jsxRuntime.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),jsxRuntime.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}),jsxRuntime.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1.5"})]})}a(pw,"GalleryViewIcon");function lw(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 7h-9M7 7H4M14 17H4M20 17h-3"}),jsxRuntime.jsx("circle",{cx:"9",cy:"7",r:"2"}),jsxRuntime.jsx("circle",{cx:"16",cy:"17",r:"2"})]})}a(lw,"SettingsIcon");function LA({open:e}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:m("h-3 w-3 opacity-55 transition-transform",e&&"rotate-180"),fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}a(LA,"ChevronDownIcon");var WA=[{value:"list",label:"Table view",icon:jsxRuntime.jsx(uw,{})},{value:"gallery",label:"Gallery view",icon:jsxRuntime.jsx(pw,{})}];function dw(e){return e.icon!==void 0?e.icon:e.value==="list"||e.value==="table"?jsxRuntime.jsx(uw,{}):e.value==="gallery"?jsxRuntime.jsx(pw,{}):null}a(dw,"getViewModeOptionIcon");function cw(e){return e.triggerLabel??e.labels?.settingsButton??"Settings"}a(cw,"getSettingsTriggerLabel");function zA({value:e,options:t,onValueChange:o,classNames:r}){let n=ho.useRef(null),[i,s]=ho.useState(false),l=t.find(c=>c.value===e)||t.find(c=>!c.disabled)||t[0],d=l?dw(l):null;return ho.useEffect(()=>{if(!i)return;let c=a(u=>{n.current?.contains(u.target)||s(false);},"handlePointerDown"),p=a(u=>{u.key==="Escape"&&s(false);},"handleKeyDown");return window.addEventListener("pointerdown",c),window.addEventListener("keydown",p),()=>{window.removeEventListener("pointerdown",c),window.removeEventListener("keydown",p);}},[i]),l?jsxRuntime.jsxs("div",{ref:n,className:m("relative inline-flex",r?.viewModeRoot),children:[jsxRuntime.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-expanded":i,className:m("inline-flex h-7 min-w-0 items-center justify-center gap-1.5 rounded-md border border-border/70 bg-card px-2 text-xs font-medium text-foreground shadow-none transition-colors hover:bg-muted/50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/25",r?.viewModeTrigger),onClick:()=>s(c=>!c),children:[d?jsxRuntime.jsx("span",{className:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center text-muted-foreground",children:d}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:l.label}),jsxRuntime.jsx(LA,{open:i})]}),i?jsxRuntime.jsx("div",{role:"listbox",className:m("absolute left-0 top-full z-50 mt-2 min-w-[160px] overflow-hidden rounded-xl border border-border/60 bg-card/95 p-1.5 text-xs text-foreground shadow-lg backdrop-blur-xl",r?.viewModeMenu),children:t.map(c=>{let p=c.value===l.value,u=dw(c);return jsxRuntime.jsxs("button",{type:"button",role:"option","aria-selected":p,disabled:c.disabled,className:m("flex min-h-8 w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/55 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",p&&"bg-muted/60 text-foreground",r?.viewModeItem),onClick:()=>{c.disabled||(o?.(c.value,c),s(false));},children:[u?jsxRuntime.jsx("span",{className:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:u}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:c.label})]},c.value)})}):null]}):null}a(zA,"WorkbenchContentToolbarViewModeControl");var cu=ho.forwardRef(a(function({as:t="div",children:o,end:r,viewMode:n,viewModeOptions:i,onViewModeChange:s,gallerySettings:l,gallerySettingsPlacement:d="start",className:c,startClassName:p,endClassName:u,classNames:g,...f},b){let x=i||(n?WA:[]),y=l&&typeof l=="object"?l:null,k=!!x.length,w=!!y,v=w&&d!=="end",h=w&&d==="end",S=k||v||!!o,T=!!r||h;return jsxRuntime.jsxs(t,{ref:b,"data-workbench-content-toolbar":true,className:m("flex min-h-[46px] shrink-0 flex-col gap-2 border-b border-border/60 px-4 py-2 md:flex-row md:items-center md:justify-between",g?.root,c),...f,children:[S?jsxRuntime.jsxs("div",{className:m("flex flex-wrap items-center gap-2",g?.start,p),children:[k?jsxRuntime.jsx(zA,{value:n,options:x,onValueChange:s,classNames:g}):null,v&&y?jsxRuntime.jsx(rl,{align:"end",triggerIcon:jsxRuntime.jsx(lw,{}),triggerLabel:cw(y),...y,buttonClassName:m("!h-7 !w-7 !min-h-0 !rounded-md !p-0 text-xs",g?.settings,y.buttonClassName)}):null,o]}):null,T?jsxRuntime.jsxs("div",{className:m("flex shrink-0 items-center gap-2",g?.end,u),children:[r,h&&y?jsxRuntime.jsx(rl,{align:"end",triggerIcon:jsxRuntime.jsx(lw,{}),triggerLabel:cw(y),...y,buttonClassName:m("!h-7 !w-7 !min-h-0 !rounded-md !p-0 text-xs",g?.settings,y.buttonClassName)}):null]}):null]})},"WorkbenchContentToolbar"));function HA(e){return !!(e.header||e.footer||e.bodyAs||e.bodyClassName||e.bodyProps||e.classNames?.body)}a(HA,"shouldRenderBodyWrapper");function gw(e){if(e==null||typeof e=="boolean")return false;if(typeof e=="string")return e.trim().length>0;if(Array.isArray(e))return e.some(gw);let t=ho.Children.toArray(e);return t.length?t.some(o=>typeof o=="string"?o.trim().length>0:true):false}a(gw,"hasRenderableChildren");function VA(e,t){return t===void 0?{}:e===void 0?{width:t}:{width:e?t:0,opacity:e?1:0}}a(VA,"resolveWidthStyle");function mw(e){return e.label??e.key}a(mw,"getFallbackFieldLabel");function _A(e){let t=["text","label","title","display","value","recordId"];for(let o of t){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let r=e[o];if(r!=null&&r!=="")return r}}a(_A,"getObjectDisplayValue");function fw(e){return e==null||e===""}a(fw,"isEmptyDetailValue");function bw(e){return ["string","number","boolean"].includes(typeof e)}a(bw,"isPlainDisplayValue");function hw(e){if(!e)return null;if(typeof e=="string"){let r=e.startsWith("data:image/"),n=/\.(avif|gif|jpe?g|png|svg|webp)(\?.*)?$/i.test(e);return r||n?{src:e}:null}if(typeof e!="object"||ho.isValidElement(e))return null;let t=e,o=t.src||t.url||t.thumbnail||t.preview||t.image;return o?{src:String(o),alt:t.alt||t.label||t.title||"",caption:t.caption||t.description||t.label||t.title}:null}a(hw,"getMediaDisplayData");function GA(e,t){let o=String(e?.renderType||"").toLowerCase();return ["image","media","preview","thumbnail"].includes(o)||!!hw(t)}a(GA,"shouldRenderAsMedia");function $A(e,t){return e?typeof e=="string"||typeof e=="number"?jsxRuntime.jsx("span",{className:m("inline-flex h-3.5 min-w-3.5 shrink-0 items-center justify-center rounded-sm text-[10px] font-semibold text-primary",t),children:e}):typeof e=="boolean"?null:ho.isValidElement(e)?e:jsxRuntime.jsx(e,{className:m("h-3.5 w-3.5 shrink-0 text-primary",t)}):jsxRuntime.jsxs("span",{className:m("relative inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",t),children:[jsxRuntime.jsx("span",{className:"absolute inset-0 rounded-full border border-primary/25 bg-primary/10"}),jsxRuntime.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary"})]})}a($A,"renderMaybeFieldIcon");function jA(e,t,o){return jsxRuntime.jsxs("span",{className:m("inline-flex min-w-0 items-center gap-1.5 text-[11px] font-semibold text-foreground",o?.fieldLabel),children:[$A(t.labelIcon||t.icon,o?.fieldLabelIcon),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:e})]})}a(jA,"renderDetailFieldLabel");function UA({media:e,classNames:t}){return jsxRuntime.jsxs("div",{className:m("grid gap-2",t?.mediaValue),children:[jsxRuntime.jsx("div",{className:"overflow-hidden rounded-md border border-border/55 bg-muted/20 dark:border-border/45 dark:bg-muted/10",children:jsxRuntime.jsx("img",{src:e.src,alt:String(e.alt||""),className:m("block aspect-[16/9] w-full object-cover",t?.mediaImage)})}),e.caption?jsxRuntime.jsx("div",{className:m("truncate text-[11px] leading-4 text-muted-foreground",t?.mediaCaption),children:e.caption}):null]})}a(UA,"WorkbenchDetailSidebarMediaValue");function Pf(e,t,o,r){if(fw(e))return t;if(ho.isValidElement(e))return e;if(GA(o,e)){let n=hw(e);if(n)return jsxRuntime.jsx(UA,{media:n,classNames:r})}if(Array.isArray(e)){let n=e.map(i=>Pf(i,"",void 0,r)).filter(i=>!fw(i));return n.length?n.every(bw)?n.map(String).join(" \xB7 "):jsxRuntime.jsx("span",{className:"inline-flex flex-wrap items-center gap-1",children:n.map((i,s)=>jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1",children:[s>0?jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"\xB7"}):null,bw(i)?String(i):i]},s))}):t}if(typeof e=="object"){let n=_A(e);return n===void 0?t:Pf(n,t,o,r)}return String(e)}a(Pf,"getDefaultDetailDisplayValue");function KA(e,t){return Object.prototype.hasOwnProperty.call(e,"value")?typeof e.value=="function"?e.value(t,e):e.value:t?t?.[e.key]:void 0}a(KA,"getDefaultFieldValue");function qA(e,t){return typeof e.hidden=="function"?e.hidden(e,t):!!e.hidden}a(qA,"shouldHideField");function YA(e,t){return typeof e.hidden=="function"?e.hidden(e,t):!!e.hidden}a(YA,"shouldHideSection");function XA({record:e,fields:t,sections:o,fieldColumns:r=1,emptyValue:n="\u2014",emptyState:i,getFieldValue:s,renderFieldValue:l,formatFieldValue:d,formatFieldLabel:c,classNames:p}){let g=(o?.length?o:t?.length?[{fields:t,columns:r}]:[]).filter(f=>!YA(f,e));return g.length?jsxRuntime.jsx("div",{className:m("space-y-3",p?.autoBody),children:g.map((f,b)=>{let x=(f.fields||[]).filter(w=>!qA(w,e)),y=f.id||`section-${b}`;if(!x.length&&!f.emptyState)return null;let k=x.map((w,v)=>{let h={field:w,fieldIndex:v,section:f,sectionIndex:b,record:e},S=s?s(w,e,h):KA(w,e),T=l?l(w,e,h):d?d(S,h):Pf(S,w.emptyValue??n,w,p),C=c?c(mw(w),h):mw(w);return {term:jA(C,w,p),value:T}});return jsxRuntime.jsxs("section",{className:m("min-w-0 space-y-3",p?.section),children:[f.title||f.description?jsxRuntime.jsxs("div",{className:m("min-w-0 space-y-1.5",p?.sectionHeader),children:[f.title?jsxRuntime.jsx("div",{className:m("inline-flex max-w-full items-center gap-2 rounded-md border border-primary/20 bg-primary/5 px-2.5 py-1.5 text-xs font-medium text-primary dark:border-primary/25 dark:bg-primary/10",p?.sectionTitle),children:f.title}):null,f.description?jsxRuntime.jsx("div",{className:m("text-[11px] leading-5 text-muted-foreground",p?.sectionDescription),children:f.description}):null]}):null,k.length?jsxRuntime.jsx(kc,{items:k,columns:f.columns||r,className:m("gap-3",p?.descriptionList),classNames:{item:m("!border-0 !bg-transparent !p-0 !shadow-none !gap-1.5",p?.descriptionListItem),term:m("!normal-case !tracking-normal !text-foreground",p?.descriptionListTerm),value:m("min-h-10 rounded-md border border-border/55 bg-muted/25 px-3 py-2 text-xs leading-5 text-foreground shadow-[inset_0_1px_0_hsl(var(--background)/0.8)] dark:border-border/45 dark:bg-white/[0.035]",p?.fieldValue,p?.descriptionListValue)}}):jsxRuntime.jsx("div",{className:m("py-3 text-center text-xs text-muted-foreground",p?.emptyState),children:f.emptyState})]},y)})}):i?jsxRuntime.jsx("div",{className:m("rounded-lg border border-dashed border-border/60 px-3 py-6 text-center text-xs text-muted-foreground",p?.emptyState),children:i}):null}a(XA,"WorkbenchDetailSidebarAutoContent");var yw=ho.forwardRef(a(function({as:t="aside",bodyAs:o="div",open:r,width:n,header:i,footer:s,resizeHandle:l,children:d,record:c,fields:p,sections:u,fieldColumns:g,emptyValue:f,emptyState:b,getFieldValue:x,renderFieldValue:y,formatFieldValue:k,formatFieldLabel:w,className:v,headerClassName:h,bodyClassName:S,footerClassName:T,resizeHandleClassName:C,bodyProps:R,classNames:M,style:I,...A},N){let D=gw(d)?d:jsxRuntime.jsx(XA,{record:c,fields:p,sections:u,fieldColumns:g,emptyValue:f,emptyState:b,getFieldValue:x,renderFieldValue:y,formatFieldValue:k,formatFieldLabel:w,classNames:M}),E=HA({header:i,footer:s,bodyAs:o==="div"?void 0:o,bodyClassName:S,bodyProps:R,classNames:M}),{className:P,...W}=R??{};return jsxRuntime.jsxs(t,{ref:N,"data-workbench-detail-sidebar":true,"data-open":r===void 0?void 0:r?"true":"false",className:m("workbench-surface-subtle relative flex flex-shrink-0 flex-col self-stretch overflow-hidden rounded-lg border border-border/50 transition-all duration-300 dark:border-border/40",r===false&&"pointer-events-none",M?.root,v),style:{...VA(r,n),...I},...A,children:[l?jsxRuntime.jsx("div",{className:m(M?.resizeHandle,C),children:l}):null,i?jsxRuntime.jsx("div",{className:m("shrink-0 border-b border-border/40 px-4 py-3 dark:border-border/30",M?.header,h),children:i}):null,E?jsxRuntime.jsx(o,{className:m("min-h-0 flex-1 overflow-y-auto",M?.body,S,P),...W,children:D}):D,s?jsxRuntime.jsx("div",{className:m("shrink-0 border-t border-border/40 px-4 py-3 dark:border-border/30",M?.footer,T),children:s}):null]})},"WorkbenchDetailSidebar"));function vw(e){return typeof e=="function"?true:typeof e=="object"&&e!==null&&!ho.isValidElement(e)&&"$$typeof"in e}a(vw,"isWorkbenchIconComponent");function nl(e,t){return e?ho.isValidElement(e)?e:vw(e)?jsxRuntime.jsx(e,{className:t}):e:null}a(nl,"renderWorkbenchIcon");function ww(e){return !e||!vw(e)?null:e}a(ww,"getWorkbenchIconComponent");function JA(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(JA,"toCssSize");var eB=160,tB=56,oB=128;function kw(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return;let t=e.trim().match(/^(\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}a(kw,"numericCssSize");function Tw(e,t){return e.renderType==="icon"?tB:t?oB:eB}a(Tw,"defaultWorkbenchColumnWidth");function Cw(e,t,o){return t??kw(e.width)??kw(e.minWidth)??Tw(e,o)}a(Cw,"resolvedWorkbenchColumnWidth");function rB(e){return e==null||e===false?null:e}a(rB,"defaultFormatLabel");function Sw(e){if(typeof e=="string"||typeof e=="number")return String(e)}a(Sw,"toTitle");function nB(e,t){return e?.id??e?.key??e?.linkKey??t}a(nB,"defaultGetRowKey");function aB(e){return e?.linkKey??e?.id??e?.key}a(aB,"defaultGetRowSelectionKey");function iB(e,t){if(!t?.length)return e;let o=new Map(e.map(s=>[s.key,s])),r=t.map(s=>o.get(s)).filter(Boolean),n=new Set(r.map(s=>s.key)),i=e.filter(s=>!n.has(s.key));return [...r,...i]}a(iB,"getOrderedColumns");function Lf(e,t){let o=new Set(e),r=(t||[]).filter(s=>o.has(s)),n=new Set(r),i=e.filter(s=>!n.has(s));return [...r,...i]}a(Lf,"normalizeColumnOrder");function sB({helperText:e,className:t}){return V(e)?jsxRuntime.jsxs("span",{className:m("group relative inline-flex items-center",t),children:[jsxRuntime.jsx("button",{type:"button",title:Sw(e),"aria-label":Sw(e)||"Field help",className:"inline-flex h-4 w-4 items-center justify-center rounded-md border border-border/60 bg-background text-xs font-semibold normal-case tracking-normal text-muted-foreground shadow-sm transition-colors hover:border-primary/40 hover:text-primary focus-visible:border-primary/40 focus-visible:text-primary focus-visible:outline-hidden",onClick:o=>o.stopPropagation(),children:"?"}),jsxRuntime.jsx("span",{role:"tooltip",className:"pointer-events-none absolute left-1/2 top-full z-40 mt-2 hidden w-72 -translate-x-1/2 whitespace-pre-line rounded-lg border border-border/60 bg-card px-3 py-2 text-xs font-normal normal-case leading-5 tracking-normal text-foreground shadow-sm backdrop-blur-sm group-hover:block group-focus-within:block",children:e})]}):null}a(sB,"WorkbenchTableHeaderHelper");function Nw({rows:e=[],columns:t=[],onRowClick:o,selectedRowKey:r,selectedLinkKey:n,activePrimaryColumn:i,activeTablePrimaryColumn:s,renderedRowCount:l,totalRowCount:d,tableMinWidth:c,minWidth:p,bodyMaxHeight:u="min(58vh, 38rem)",stickyFirstColumn:g=true,appearance:f,headerPresentation:b,fillRemainingWidthColumnKey:x,columnOrder:y,columnSizes:k,columnDragEnabled:w,columnResizeEnabled:v,className:h,tableClassName:S,rowClassName:T,classNames:C,style:R,renderCell:M,renderFieldValue:I,renderColumnHeader:A,onColumnOrderChange:N,onColumnSizeChange:D,onSort:E,formatLabel:P=rB,getColumnDataType:W,getColumnIcon:H,getColumnTypeIcon:B,getRowKey:L=nB,getRowSelectionKey:F=aB,isActionColumn:_,isActionField:$,isRowDisabled:G,isWorkbenchPlaceholderRow:z,emptyState:re="-",hiddenRowsMessage:Z,scrollFooter:ae,scrollRestoration:ee}){let q=t.map(se=>se.key).join(""),U=ho.useMemo(()=>q?q.split(""):[],[q]),[X,O]=ho.useState(U),[K,ne]=ho.useState({}),fe=ho.useRef(null),he=ho.useRef(new Map),me=ho.useRef(ee);me.current=ee;let ie=ho.useRef(void 0),be=ho.useCallback(()=>{let se=fe.current,te=me.current;if(!se||!te||ie.current!==te.key)return;let Te=se.getBoundingClientRect().top,ze=Array.from(he.current.entries()).find(([,je])=>je.getBoundingClientRect().bottom>Te);te.write({x:se.scrollLeft,y:se.scrollTop,...ze?{rowKey:ze[0],rowOffset:ze[1].getBoundingClientRect().top-Te}:{}});},[]);ho.useEffect(()=>{let se=fe.current,te=me.current;if(!se||!te||ie.current===te.key||e.length===0)return;let Te=te.read(),ze=a(()=>{let Y=Te?.rowKey?he.current.get(Te.rowKey):void 0,pe=Y&&typeof Te?.rowOffset=="number"?se.scrollTop+Y.getBoundingClientRect().top-se.getBoundingClientRect().top-Te.rowOffset:Te?.y??0;se.scrollTo({left:Te?.x??0,top:Math.max(0,pe),behavior:"auto"}),ie.current=te.key;},"restore"),je=se.ownerDocument.defaultView;if(!je){ze();return}let it=je.requestAnimationFrame(ze);return ()=>je.cancelAnimationFrame(it)},[e,ee?.key]),ho.useEffect(()=>{let se=fe.current?.ownerDocument.defaultView;return se?.addEventListener("pagehide",be),()=>{se?.removeEventListener("pagehide",be),be();}},[be]);let[He,We]=ho.useState();ho.useEffect(()=>{O(se=>Lf(U,se));},[U]);let Ke=y?Lf(U,y):X,ce=k??K,Q=ho.useCallback((se,te)=>{let Te=Lf(U,se);y||O(Te),N?.(Te,te);},[y,U,N]),ge=ho.useCallback((se,te,Te)=>{k||ne(ze=>({...ze,[se]:te})),D?.(se,te,Te);},[k,D]),we=r??n,Ie=i??s,oe=iB(t,Ke),xe=x?oe.reduce((se,te)=>te.key===x?se:se+Cw(te,ce[te.key],_?.(te)??$?.(te)??false),0):void 0,Ve=x&&xe!==void 0&&He!==void 0?Math.max(0,Math.round(He-xe)):void 0,_e=oe.flatMap(se=>se.key!==x?[se]:Ve===0?[]:Ve===void 0?[se]:[{...se,width:Ve,minWidth:Ve,maxWidth:Ve}]),Ge=Math.max(0,Number(d||e.length)-Number(l||e.length)),le=M??I??((se,te)=>te?.[se.key]),Me=_??$??(()=>false),Ae=G??z??(()=>false),J=H??B,$e=xe!==void 0&&Ve!==void 0?xe+Ve:void 0,ue=$e??c??p??Math.max(760,_e.reduce((se,te)=>se+Cw(te,ce[te.key],Me(te)),0));ho.useEffect(()=>{if(!x){We(void 0);return}let se=fe.current;if(!se)return;let te=se.ownerDocument.defaultView,Te=a(()=>{let it=Math.round(se.getBoundingClientRect().width);!Number.isFinite(it)||it<=0||We(Y=>Y===it?Y:it);},"updateWidth");Te();let ze=te?.ResizeObserver,je=ze?new ze(Te):void 0;return je?.observe(se),te?.addEventListener("resize",Te),()=>{je?.disconnect(),te?.removeEventListener("resize",Te);}},[x]);let Re=Ge>0&&Z?typeof Z=="function"?Z(Ge,l||e.length,d||e.length):Z:null;return jsxRuntime.jsxs(Li,{appearance:f,className:m("w-full overflow-hidden rounded-lg border border-border/40 bg-muted/15 dark:border-border/35 dark:bg-muted/10",C?.root,h),style:u==="100%"?{display:"flex",minHeight:0,flex:1,flexDirection:"column",...R}:R,children:[jsxRuntime.jsxs("div",{ref:fe,onScroll:be,className:m("w-full overflow-auto",C?.scrollArea),style:{maxHeight:JA(u),...u==="100%"?{minHeight:0,flex:1}:{}},children:[jsxRuntime.jsxs(Wi,{appearance:f,columnOrder:Ke,columnSizes:ce,columnDragEnabled:w,columnResizeEnabled:v,onColumnOrderChange:Q,onColumnSizeChange:ge,className:m("w-full table-auto text-left text-xs",C?.table,S),style:{width:$e,minWidth:ue},children:[jsxRuntime.jsx(zi,{appearance:f,className:m("z-20 text-xs font-sans text-muted-foreground",C?.header),children:jsxRuntime.jsx(vn,{className:m("hover:bg-transparent",C?.headerRow),children:_e.map((se,te)=>{let Te=Tw(se,Me(se)),ze=se.renderType||se.type||W?.(se.key,e,se),je=nl(J?.(ze,se),"h-3.5 w-3.5 shrink-0 text-primary"),Y=_e[te-1]?.renderType==="icon"&&se.key===Ie?.key,pe=A?A(se,{column:se,columnIndex:te,columns:_e,rows:e,columnType:ze}):P(se.label,{column:se}),Be=!A&&(V(se.trailing)||V(se.helperText))?jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[V(se.trailing)?P(se.trailing,{column:se}):null,jsxRuntime.jsx(sB,{helperText:P(se.helperText,{column:se}),className:C?.helper})]}):void 0,rt=!!se.sortable,Ce=rt&&E?()=>E(se.key,se):void 0;return jsxRuntime.jsx(Fi,{appearance:f,presentation:b,columnId:se.key,align:se.align,icon:A?void 0:je,label:pe,description:A?void 0:P(se.description,{column:se}),meta:A?void 0:P(se.meta,{column:se}),actions:se.actions,trailing:Be,sortable:rt,sortDirection:se.sortDirection,sortLabel:se.sortLabel,onSort:Ce,draggable:se.draggable,dragLabel:se.dragLabel,resizable:se.resizable,resizeLabel:se.resizeLabel,width:se.width??Te,minWidth:typeof se.minWidth=="number"?se.minWidth:void 0,maxWidth:typeof se.maxWidth=="number"?se.maxWidth:void 0,className:m("sticky top-0 z-20 h-auto whitespace-nowrap bg-card/95 px-4 py-3 font-medium backdrop-blur-sm supports-[backdrop-filter]:bg-card/90",g&&te===0&&"md:left-0 md:z-30 md:shadow-[1px_0_0_0_hsl(var(--border)/0.35)]",se.compactHeaderClassName,se.renderType==="icon"&&"pl-3 pr-1",Y&&"pl-2",C?.headerCell,se.headerClassName),style:{minWidth:typeof se.minWidth=="string"?se.minWidth:void 0,maxWidth:typeof se.maxWidth=="string"?se.maxWidth:void 0,...se.headerStyle}},se.key)})})}),jsxRuntime.jsx(Oi,{appearance:f,className:m("divide-y divide-border/35 dark:divide-border/30",C?.body),children:e.length?e.map((se,te)=>{let Te=L(se,te),ze=Ae(se,te),je=F(se,te),it=!!(we&&String(je)===String(we)),Y=typeof T=="function"?T(se,te):T;return jsxRuntime.jsx(vn,{appearance:f,ref:pe=>{pe?he.current.set(String(Te),pe):he.current.delete(String(Te));},interactive:!!o&&!ze,"data-item-key":String(Te),tabIndex:o&&!ze?0:void 0,selected:it,disabled:ze,onClick:pe=>{ze||(o&&pe.currentTarget.focus({preventScroll:true}),o?.(se,te));},onKeyDown:pe=>{pe.target!==pe.currentTarget||ze||!o||!["Enter"," "].includes(pe.key)||(pe.preventDefault(),o(se,te));},className:m(o&&!ze?"cursor-pointer":"cursor-default",it?"bg-primary/10 hover:bg-primary/15":ze?"":"hover:bg-muted/25 dark:hover:bg-muted/15",C?.row,Y),children:_e.map((pe,Be)=>{let rt=Me(pe)||pe.wrap===true,Xe=_e[Be-1]?.renderType==="icon"&&pe.key===Ie?.key;return jsxRuntime.jsx(Ha,{appearance:f,align:pe.align,className:m(rt?"align-top whitespace-normal":"whitespace-nowrap","px-4 py-3 text-muted-foreground",!rt&&"overflow-hidden text-ellipsis",g&&Be===0&&"md:sticky md:left-0 md:z-10 md:bg-card/95 md:text-foreground md:shadow-[1px_0_0_0_hsl(var(--border)/0.3)]",pe.compactCellClassName,pe.renderType==="icon"&&"pl-3 pr-1",Xe&&"pl-2",C?.cell,pe.cellClassName),style:pe.cellStyle,children:le(pe,se,{row:se,rowIndex:te,column:pe,columnIndex:Be,compact:true,surface:"list"})},`${Te}-${pe.key}`)})},Te)}):jsxRuntime.jsx(Hi,{appearance:f,colSpan:Math.max(_e.length,1),classNames:{cell:"px-4 py-10 text-center text-sm text-muted-foreground"},children:re})})]}),V(ae)?jsxRuntime.jsx("div",{style:{minWidth:ue},children:ae}):null]}),Re?jsxRuntime.jsx("div",{className:m("border-t border-border/40 px-4 py-2 text-xs text-muted-foreground dark:border-border/30",C?.footer),children:Re}):null]})}a(Nw,"WorkbenchTableView");function Wf(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(Wf,"toCssSize");function Ki(){return typeof window<"u"}a(Ki,"isBrowser");function Mw(e,t){return e?.id??e?.key??t}a(Mw,"defaultGetRowKey");function fu(e){return typeof e.width=="number"?e.width:typeof e.minWidth=="number"?e.minWidth:160}a(fu,"getColumnDefaultSize");function lB(e,t){return e.reduce((o,r)=>(o[r.key]=t?.[r.key]??fu(r),o),{})}a(lB,"buildDefaultColumnSizes");function Iw(e,t){if(!e||!Ki())return t;try{let o=JSON.parse(window.localStorage.getItem(e)||"{}");return Object.keys(t).reduce((r,n)=>{let i=Number(o?.[n]);return r[n]=Number.isFinite(i)?i:t[n],r},{})}catch{return t}}a(Iw,"loadStoredColumnSizes");function Dw(e,t){!e||!Ki()||window.localStorage.setItem(e,JSON.stringify(t));}a(Dw,"persistColumnSizes");function Ww(e){return e?`${e}.frozenColumnCount`:void 0}a(Ww,"getFrozenColumnStorageKey");function zw(e){return e?`${e}.frozenEndColumnCount`:void 0}a(zw,"getFrozenEndColumnStorageKey");function ca(e,t){return Number.isFinite(e)?Math.max(0,Math.min(Math.round(e),t)):0}a(ca,"clampFrozenColumnCount");function dB(e,t,o){let r=ca(e,o),n=ca(t,Math.max(0,o-r));return {startCount:r,endCount:n}}a(dB,"normalizeFrozenColumnCounts");function Pw(e,t,o){let r=ca(t,o),n=Ww(e);if(!n||!Ki())return r;try{let i=window.localStorage.getItem(n);if(i===null)return r;let s=Number(i);return Number.isFinite(s)?ca(s,o):r}catch{return r}}a(Pw,"loadStoredFrozenColumnCount");function cB(e,t){let o=Ww(e);!o||!Ki()||window.localStorage.setItem(o,String(t));}a(cB,"persistFrozenColumnCount");function Ew(e,t,o){let r=ca(t,o),n=zw(e);if(!n||!Ki())return r;try{let i=window.localStorage.getItem(n);if(i===null)return r;let s=Number(i);return Number.isFinite(s)?ca(s,o):r}catch{return r}}a(Ew,"loadStoredFrozenEndColumnCount");function uB(e,t){let o=zw(e);!o||!Ki()||window.localStorage.setItem(o,String(t));}a(uB,"persistFrozenEndColumnCount");function mu(e,t){let o=new Set(e),r=(t||[]).filter(s=>o.has(s)),n=new Set(r),i=e.filter(s=>!n.has(s));return [...r,...i]}a(mu,"normalizeColumnOrder");function pB(e,t){let o=mu(e.map(n=>n.key),t),r=new Map(e.map(n=>[n.key,n]));return o.map(n=>r.get(n)).filter(Boolean)}a(pB,"getOrderedColumns");function ll(e,t){let o=t[e.key];return typeof o=="number"?o:fu(e)}a(ll,"getColumnNumericWidth");function mB(e,t,o){let r=new Map,n=0;return e.slice(0,Math.max(0,o)).forEach(i=>{r.set(i.key,n),n+=ll(i,t);}),r}a(mB,"buildFrozenOffsets");function fB(e,t,o){let r=new Map,n=0;return e.slice(Math.max(0,e.length-o)).reverse().forEach(i=>{r.set(i.key,n),n+=ll(i,t);}),r}a(fB,"buildFrozenEndOffsets");function Aw(e,t,o){return typeof e=="function"?e(t,o):e}a(Aw,"resolveRowClassName");function Bw(e,t){let o=t?.[e.key];return o==null||o===""?"\u2014":String(o)}a(Bw,"renderDefaultCell");function Lw({children:e,wrap:t}){return jsxRuntime.jsx("div",{className:m("min-w-0 max-w-full overflow-auto overscroll-contain [scrollbar-width:thin]",t?"max-h-20 whitespace-pre-wrap break-words leading-5":"whitespace-nowrap"),children:e})}a(Lw,"InteractiveTableCellContent");function bB({className:e}){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:e,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",children:[jsxRuntime.jsx("path",{d:"M5.25 2.75h5.5"}),jsxRuntime.jsx("path",{d:"M6.25 2.75v4L4.5 9.25h7L9.75 6.75v-4"}),jsxRuntime.jsx("path",{d:"M8 9.25v4"})]})}a(bB,"PinIcon");function Ow({rows:e=[],columns:t=[],pinnedTopRows:o=[],getRowKey:r=Mw,getPinnedTopRowKey:n=Mw,renderCell:i,renderPinnedTopCell:s,renderColumnHeader:l,onRowClick:d,getRowState:c,rowClassName:p,pinnedTopRowClassName:u,emptyState:g="\u2014",columnMenuLabels:f,columnStorageKey:b,columnOrder:x,columnSizes:y,defaultColumnSizes:k,columnDragEnabled:w=false,columnResizeEnabled:v=true,frozenColumnCount:h=0,frozenEndColumnCount:S=0,tableMinWidth:T,bodyMaxHeight:C="min(60vh, 42rem)",appearance:R,className:M,tableClassName:I,classNames:A,style:N,onColumnOrderChange:D,onColumnSizeChange:E,onResetColumnSizes:P,onFrozenColumnCountChange:W,onFrozenEndColumnCountChange:H,onSort:B}){let L=Ye().workbench.interactiveTable,F=t.map(oe=>oe.key).join(""),_=ho.useMemo(()=>F?F.split(""):[],[F]),$=ho.useMemo(()=>lB(t,k),[t,k]),[G,z]=ho.useState(_),[re,Z]=ho.useState(()=>Iw(b,$)),[ae,ee]=ho.useState(()=>Pw(b,h,t.length)),[q,U]=ho.useState(()=>Ew(b,S,t.length));ho.useEffect(()=>{z(oe=>mu(_,oe));},[_]),ho.useEffect(()=>{y||Z(Iw(b,$));},[y,b,$]),ho.useEffect(()=>{ee(Pw(b,h,t.length));},[b,t.length,h]),ho.useEffect(()=>{U(Ew(b,S,t.length));},[b,t.length,S]);let X=x?mu(_,x):G,O=y??re,K=pB(t,X),{startCount:ne,endCount:fe}=dB(ae,q,K.length),he=mB(K,O,ne),me=fB(K,O,fe),ie=T??Math.max(760,K.reduce((oe,xe)=>oe+ll(xe,O),0)),be={columnActions:f?.columnActions??L.columnActions,freezeColumn:f?.freezeColumn??L.freezeColumn,freezeEndColumn:f?.freezeEndColumn??L.freezeEndColumn,unfreezeColumn:f?.unfreezeColumn??L.unfreezeColumn,unfreezeEndColumn:f?.unfreezeEndColumn??L.unfreezeEndColumn,unfreezeAllColumns:f?.unfreezeAllColumns??L.unfreezeAllColumns,resetColumnWidth:f?.resetColumnWidth??L.resetColumnWidth,frozenColumnTitle:f?.frozenColumnTitle??L.frozenColumnTitle},He=ho.useCallback((oe,xe)=>{let Ve=mu(_,oe);x||z(Ve),D?.(Ve,xe);},[x,_,D]),We=ho.useCallback((oe,xe,Ve)=>{let _e=t.find(J=>J.key===oe),Ge=_e?.minWidth,le=_e?.maxWidth,Me=Math.max(typeof Ge=="number"?Ge:0,Math.min(xe,typeof le=="number"?le:Number.POSITIVE_INFINITY)),Ae={...O,[oe]:Me};y||Z(Ae),Dw(b,Ae),E?.(oe,Me,Ve);},[y,b,t,E,O]),Ke=ho.useCallback(oe=>{let xe=$[oe.key]??fu(oe),Ve=ll(oe,O),_e={...O,[oe.key]:xe};y||Z(_e),Dw(b,_e),E?.(oe.key,xe,{columnId:oe.key,previousWidth:Ve,minWidth:oe.minWidth,maxWidth:oe.maxWidth}),P?.(_e);},[y,b,$,E,P,O]),ce=ho.useCallback(oe=>{let xe=ca(oe,Math.max(0,K.length-fe));ee(xe),cB(b,xe),W?.(xe);},[b,W,K.length,fe]),Q=ho.useCallback(oe=>{let xe=ca(oe,Math.max(0,K.length-ne));U(xe),uB(b,xe),H?.(xe);},[b,H,K.length,ne]),ge=a(oe=>{if(oe<ne)return "start";if(oe>=K.length-fe)return "end"},"getFrozenPosition"),we=a((oe,xe,Ve=false)=>{let _e=ge(xe);if(_e)return m("sticky",_e==="start"?"shadow-[1px_0_0_0_hsl(var(--border)/0.45)]":"shadow-[-1px_0_0_0_hsl(var(--border)/0.45)]",Ve?"bg-muted/60":"bg-inherit",Ve?"z-40":"z-20",(xe===0||xe===K.length-1)&&(Ve?"z-50":"z-30"))},"getFrozenClassName"),Ie=a((oe,xe)=>{let Ve=ge(xe);if(Ve==="start")return {left:he.get(oe.key)??0};if(Ve==="end")return {right:me.get(oe.key)??0}},"getFrozenStyle");return jsxRuntime.jsx(Li,{appearance:R,className:m("flex h-full min-h-0 flex-col overflow-hidden rounded-lg border border-border/60 bg-card",A?.root,M),style:N,children:jsxRuntime.jsx("div",{className:m("min-h-0 flex-1 overflow-auto",A?.scrollArea),style:{maxHeight:Wf(C)},children:jsxRuntime.jsxs(Wi,{appearance:R,columnOrder:X,columnSizes:O,columnDragEnabled:w,columnResizeEnabled:v,onColumnOrderChange:He,onColumnSizeChange:We,className:m("w-full table-fixed text-left text-xs",A?.table,I),style:{minWidth:ie},children:[jsxRuntime.jsx("colgroup",{children:K.map(oe=>jsxRuntime.jsx("col",{style:{width:Wf(O[oe.key]??oe.width),minWidth:Wf(oe.minWidth)}},oe.key))}),jsxRuntime.jsx(zi,{appearance:R,className:m("border-b border-border/60 bg-muted/60 text-[11px] font-medium text-muted-foreground",A?.tableHeader),children:jsxRuntime.jsx(vn,{appearance:R,className:m("hover:bg-transparent",A?.headerRow),children:K.map((oe,xe)=>{let Ve=l?l(oe,{column:oe,columnIndex:xe,columns:K,rows:e}):oe.label,_e=!!oe.sortable,Ge=_e&&B?()=>B(oe.key,oe):void 0,le=xe<ne,Me=xe>=K.length-fe,Ae=le||Me,J=ll(oe,O)===($[oe.key]??fu(oe));return jsxRuntime.jsxs(xc,{modal:false,children:[jsxRuntime.jsx(Ws,{asChild:true,appearance:R,children:jsxRuntime.jsx(Fi,{appearance:R,columnId:oe.key,align:oe.align,label:Ve,description:oe.description,trailing:Ae?jsxRuntime.jsx("span",{title:be.frozenColumnTitle,className:"inline-flex h-5 w-5 items-center justify-center rounded text-primary",children:jsxRuntime.jsx(bB,{className:"h-3.5 w-3.5"})}):null,sortable:_e,sortDirection:oe.sortDirection,sortLabel:oe.sortLabel,onSort:Ge,draggable:oe.draggable,resizable:oe.resizable,width:oe.width,minWidth:oe.minWidth,maxWidth:oe.maxWidth,className:m("sticky top-0 h-9 whitespace-nowrap border-r border-border/50 bg-muted/60 px-2.5 py-2 backdrop-blur",we(oe,xe,true),oe.headerClassName,oe.className,A?.headerCell),style:Ie(oe,xe)})}),jsxRuntime.jsxs(zs,{appearance:R,alignOffset:-4,className:"min-w-44",children:[jsxRuntime.jsx(vc,{appearance:R,children:be.columnActions}),Ae?jsxRuntime.jsx(na,{appearance:R,onSelect:()=>{Me?Q(K.length-xe-1):ce(xe);},children:Me?be.unfreezeEndColumn:be.unfreezeColumn}):jsxRuntime.jsx(na,{appearance:R,onSelect:()=>ce(xe+1),children:be.freezeColumn}),Ae?null:jsxRuntime.jsx(na,{appearance:R,onSelect:()=>Q(K.length-xe),children:be.freezeEndColumn}),jsxRuntime.jsx(na,{appearance:R,disabled:ne===0&&fe===0,onSelect:()=>{ce(0),Q(0);},children:be.unfreezeAllColumns}),jsxRuntime.jsx(wc,{appearance:R}),jsxRuntime.jsx(na,{appearance:R,disabled:J,onSelect:()=>Ke(oe),children:be.resetColumnWidth})]})]},oe.key)})})}),jsxRuntime.jsxs(Oi,{appearance:R,className:m("divide-y divide-border/50",A?.body),children:[o.map((oe,xe)=>{let Ve=n(oe,xe),_e=Aw(u,oe,xe);return jsxRuntime.jsx(vn,{appearance:R,className:m("bg-card/95",A?.pinnedTopRow,_e),children:K.map((Ge,le)=>jsxRuntime.jsx(Ha,{appearance:R,align:Ge.align,className:m("h-[52px] border-r border-border/50 px-2.5 py-1.5 align-middle",Ge.wrap?"whitespace-normal":"whitespace-nowrap",we(Ge,le),Ge.cellClassName,A?.cell),style:Ie(Ge,le),children:jsxRuntime.jsx(Lw,{wrap:Ge.wrap,children:s?s(Ge,oe,{row:oe,rowIndex:xe,column:Ge,columnIndex:le,isPinnedTopRow:true}):Bw(Ge,oe)})},`pinned-${Ve}-${Ge.key}`))},`pinned-${Ve}`)}),e.length?e.map((oe,xe)=>{let Ve=r(oe,xe),_e=c?.(oe,xe)||{},Ge=Aw(p,oe,xe);return jsxRuntime.jsx(vn,{appearance:R,interactive:!!d&&!_e.disabled,selected:_e.selected,disabled:_e.disabled,onClick:()=>{_e.disabled||d?.(oe,xe);},className:m("min-h-[52px] bg-card transition-colors",_e.saving&&"bg-primary/5",_e.pending&&"opacity-80",d&&!_e.disabled?"cursor-pointer hover:bg-muted/30":"hover:bg-muted/30",A?.row,Ge),children:K.map((le,Me)=>jsxRuntime.jsx(Ha,{appearance:R,align:le.align,className:m("h-[52px] border-r border-border/50 px-2.5 py-1.5 align-middle",le.wrap?"whitespace-normal":"whitespace-nowrap",we(le,Me),le.cellClassName,A?.cell),style:Ie(le,Me),children:jsxRuntime.jsx(Lw,{wrap:le.wrap,children:i?i(le,oe,{row:oe,rowIndex:xe,column:le,columnIndex:Me,isPinnedTopRow:false}):Bw(le,oe)})},`${Ve}-${le.key}`))},Ve)}):o.length?null:jsxRuntime.jsx(Hi,{appearance:R,colSpan:Math.max(K.length,1),className:A?.empty,children:g})]})]})})})}a(Ow,"InteractiveTable");function Fw({value:e,placeholder:t,disabled:o,multiline:r=false,commitOnBlur:n=true,className:i,inputClassName:s,onCommit:l}){let d=String(e||""),[c,p]=ho.useState(d);ho.useEffect(()=>{p(d);},[d]);let u=ho.useCallback(async()=>{let f=String(c||"").trim(),b=String(d||"").trim();if(f!==b)try{await l?.(f);}catch{p(d);}},[c,d,l]),g=m("w-full resize-none rounded-sm border border-transparent bg-transparent px-1.5 py-1 text-xs text-foreground outline-hidden transition-colors","placeholder:text-muted-foreground/70 hover:border-border/60 hover:bg-background focus:border-primary/45 focus:bg-background",r?"min-h-[42px] leading-5":"h-8",o&&"cursor-not-allowed text-muted-foreground hover:border-transparent hover:bg-transparent",s);return r?jsxRuntime.jsx("textarea",{className:m(g,i),disabled:o,value:c,placeholder:t,onChange:f=>p(f.target.value),onBlur:()=>{n&&u();},onKeyDown:f=>{(f.metaKey||f.ctrlKey)&&f.key==="Enter"&&f.currentTarget.blur(),f.key==="Escape"&&(p(d),f.currentTarget.blur());}}):jsxRuntime.jsx("input",{className:m(g,i),disabled:o,value:c,placeholder:t,onChange:f=>p(f.target.value),onBlur:()=>{n&&u();},onKeyDown:f=>{f.key==="Enter"&&f.currentTarget.blur(),f.key==="Escape"&&(p(d),f.currentTarget.blur());}})}a(Fw,"InteractiveTableEditableTextCell");function Hw({children:e,mono:t=false,className:o}){return jsxRuntime.jsx("div",{className:m("min-w-0 text-xs text-muted-foreground",t&&"font-mono",o),children:V(e)?e:"\u2014"})}a(Hw,"InteractiveTableReadonlyCell");function Vw({value:e,options:t,disabled:o,ariaLabel:r,children:n,className:i,onChange:s}){return jsxRuntime.jsxs("div",{className:m("relative flex w-full items-center",i),children:[n,jsxRuntime.jsx("select",{"aria-label":r,disabled:o,value:e,onChange:l=>s?.(l.target.value),className:"absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",children:t.map(l=>jsxRuntime.jsx("option",{value:l.value,children:l.label},l.value))})]})}a(Vw,"InteractiveTableSelectCell");function _w({children:e,title:t,presentation:o,renderSlot:r}){let n=o.title,i=n?.placement??"none",s=n?.background==="panel"?"div":"span",l=(o.slots??[]).map(p=>({slot:p,content:r?.(p)})).filter(p=>p.content!=null),d=i==="none"?null:jsxRuntime.jsx("div",{className:"monkeys-gallery-cover-title",title:typeof t=="string"||typeof t=="number"?String(t):void 0,"data-placement":i,"data-background":n?.background??(i.startsWith("overlay")?"gradient":"none"),style:{...n?.background==="panel"?{margin:12,borderRadius:"var(--radius)",border:"1px solid hsl(var(--border) / .8)",background:"hsl(var(--card) / .9)",backdropFilter:"blur(12px)",boxShadow:"var(--monkeys-component-overlay-dialog-shadow)"}:{},textAlign:n?.align??"left",padding:n?.padding??12,fontSize:`var(--monkeys-gallery-title-${n?.size??"md"})`,fontWeight:n?.weight==="normal"?400:n?.weight==="medium"?500:600},children:jsxRuntime.jsx(s,{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:n?.background==="panel"?void 0:n?.maxLines??2,overflow:"hidden"},children:t})}),c=a(p=>jsxRuntime.jsx("div",{className:"monkeys-gallery-slot-row","data-row":p,children:l.filter(({slot:u})=>u.position.startsWith(p)).map(({slot:u,content:g})=>jsxRuntime.jsx("div",{"data-card-slot":u.position,"data-visibility":u.visibility??"always",className:u.visibility==="hover"?"monkeys-gallery-hover-actions":void 0,style:{gridColumn:u.position.endsWith("left")?1:u.position.endsWith("center")?2:3,justifySelf:u.position.endsWith("left")?"start":u.position.endsWith("center")?"center":"end",padding:u.inset??12,gap:u.gap??8,flexDirection:u.direction==="vertical"?"column":"row"},children:g},u.position))}),"band");return jsxRuntime.jsxs("div",{className:"monkeys-gallery-card-surface","data-hover-effect":o.hover?.effect??"none",style:{"--monkeys-gallery-hover-scale":o.hover?.scale??1.02},children:[i==="above"&&d,jsxRuntime.jsxs("div",{className:"monkeys-gallery-media-card",children:[jsxRuntime.jsx("div",{className:"monkeys-gallery-card-media",children:e}),jsxRuntime.jsxs("div",{className:"monkeys-gallery-card-overlay",children:[jsxRuntime.jsxs("div",{children:[i==="overlay-top"&&d,c("top")]}),c("middle"),jsxRuntime.jsxs("div",{children:[c("bottom"),i==="overlay-bottom"&&d]})]})]}),i==="below"&&d]})}a(_w,"WorkbenchGalleryCardSurface");var gB=/\.(png|jpe?g|webp|gif|svg|bmp|avif)$/i,hB=/\.(wav|mp3|ogg|m4a|flac|aac)$/i,yB=a(e=>/^https?:\/\//i.test(String(e||"")),"isLikelyUrl"),Gw=a(e=>String(e?.renderType||e?.type||"").toLowerCase(),"getColumnRenderKind"),xB=a(e=>String(e||"").startsWith("data:image/")||gB.test(String(e||"")),"isImageLikeValue"),vB=a(e=>String(e||"").startsWith("data:audio/")||hB.test(String(e||"")),"isAudioLikeValue"),wB=a(e=>String(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),"escapeSvgText"),qi=a((e,t)=>e?t?.[e.key]??null:null,"getDefaultGalleryFieldValue"),ul=a(e=>{if(e==null||e==="")return "\u2014";if(Array.isArray(e))return e.map(o=>{if(typeof o=="string")return o;if(!o||typeof o!="object")return "";let r=o;return r.text||r.label||r.title||r.display||r.value||r.recordId||""}).filter(Boolean).join(" \xB7 ")||"\u2014";if(typeof e=="object"){let t=e;return String(t.text||t.label||t.title||t.display||t.value||"\u2014")}return String(e)},"getDefaultGalleryDisplayText"),pl=a((e={key:""},t)=>Gw(e)==="image"||xB(t),"isDefaultGalleryImageField"),ml=a((e={key:""},t)=>Gw(e)==="audio"||vB(t),"isDefaultGalleryAudioField"),$w=a((e,t,o)=>{if(yB(e)||String(e||"").startsWith("data:image/"))return String(e);let r=wB(e||o||t||""),i=`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 960 540'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0%' stop-color='#0f172a'/><stop offset='55%' stop-color='#1d4ed8'/><stop offset='100%' stop-color='#14b8a6'/></linearGradient></defs><rect width='960' height='540' fill='url(#g)'/><g opacity='0.28'><circle cx='780' cy='130' r='150' fill='#67e8f9'/><circle cx='180' cy='430' r='170' fill='#a78bfa'/></g>${r?`<text x='68' y='450' fill='white' font-family='Inter, Arial' font-size='52' font-weight='700'>${r}</text>`:""}</svg>`;return `data:image/svg+xml;utf8,${encodeURIComponent(i)}`},"getDefaultGalleryImagePreviewSrc"),bu=a((e,t,{getFieldValue:o=qi,shouldEnhanceMultimodal:r=true,isImageField:n=pl,isAudioField:i=ml}={})=>{if(!e||!r)return false;let s=o(e,t);return n(e,s)||i(e,s)},"isDefaultGalleryMediaColumn"),gu=a((e,t,{isMediaColumn:o=a(()=>false,"isMediaColumn")}={})=>!e||e.renderType==="icon"?false:!o(e,t),"isDefaultGalleryTitleCandidate"),hu=a((e,t,{isMediaColumn:o=a(()=>false,"isMediaColumn")}={})=>!e||e.renderType==="icon"?false:!o(e,t),"isDefaultGallerySummaryCandidate"),jw=a((e,t,{compact:o=false,getFieldValue:r=qi,getDisplayText:n=ul}={})=>{let i=r(e,t);return jsxRuntime.jsx("span",{className:m("leading-relaxed",o&&e?.wrap===true&&"line-clamp-2 block"),children:n(i)})},"renderDefaultGalleryFieldValue");var CB=a(e=>e==="compact"?2:e==="detailed"?6:4,"getDefaultGalleryDetailLimit"),SB=a((e,t)=>e===1||e===2||e===3?Number(e):t==="detailed"?1:2,"getNormalizedGalleryBentoColumns"),TB=a(({density:e,visibility:t,limit:o})=>{if(t==="all")return Number.POSITIVE_INFINITY;let r=Number.parseInt(String(o),10);return Number.isFinite(r)&&r>0?r:CB(e)},"getNormalizedGalleryDetailLimit"),NB=a(e=>e==="compact"?"p-3":e==="detailed"?"p-4":"p-3.5","getGalleryCardPaddingClassName"),RB=a((e,t)=>t?"h-auto w-full object-cover":e==="compact"?"h-32 w-full object-cover":e==="detailed"?"h-48 w-full object-cover":"h-40 w-full object-cover","getGalleryPreviewClassName"),MB=a(e=>e===1?"grid-cols-1":e===3?"grid-cols-1 sm:grid-cols-2 2xl:grid-cols-3":"grid-cols-1 sm:grid-cols-2","getGalleryDetailGridClassName");function IB(e){return ww(e)}a(IB,"getIconComponent");function DB(e){return e}a(DB,"defaultFormatLabel");function PB(e){return typeof e=="string"||typeof e=="number"?String(e):""}a(PB,"getLabelText");function yu({row:e,columns:t,onClick:o,cardInteraction:r="button",cardPresentation:n,renderCardSlot:i,renderCoverTitle:s,isSelected:l=false,isMasonry:d=false,galleryFieldKey:c="auto",galleryDensity:p="comfortable",galleryBentoColumns:u,galleryDetailVisibility:g="limit",galleryDetailLimit:f,galleryDetailPresentation:b="tiles",shouldEnhanceMultimodal:x=true,getFieldValue:y,isMediaColumn:k,isTitleCandidate:w,isSummaryCandidate:v,getDisplayText:h,renderFieldValue:S,getImagePreviewSrc:T,isImageField:C,isAudioField:R,AudioPlayerComponent:M,cardVariant:I="default",renderPreview:A,renderMeta:N,renderLeadingVisual:D,resolveRecordVisual:E,hiddenDetailFieldKeys:P=[],labels:W,formatLabel:H=DB,className:B}){let L=y||qi,F=h||ul,_=C||pl,$=R||ml,G=T||$w,z=k||((Se,Je)=>bu(Se,Je,{getFieldValue:L,shouldEnhanceMultimodal:x,isImageField:_,isAudioField:$})),re=w||((Se,Je)=>gu(Se,Je,{isMediaColumn:z})),Z=v||((Se,Je)=>hu(Se,Je,{isMediaColumn:z})),ae=S||((Se,Je,{compact:bt}={})=>jw(Se,Je,{compact:bt,getFieldValue:L,getDisplayText:F})),ee=I==="preview-only",q=I==="image-only",U=I==="chromatic-bento",O=(c!=="auto"?t.find(Se=>Se.key===c&&z(Se,e)):null)||(x?t.find(Se=>z(Se,e)):null),K=t.find(Se=>Se.renderType==="icon"),ne=K&&E?E(e[K.key],e,K):null,fe=IB(ne?.Icon||ne?.icon),he=O?L(O,e):null,me=O?_(O,he):false,ie=O?$(O,he):false,be=t.filter(Se=>Se.key!==O?.key&&Se.renderType!=="icon"),We=be.filter(Se=>{if(!Se||z(Se,e)||!re(Se,e))return false;let Je=L(Se,e);return !(Je==null||Je==="")})[0]||null,Ke=F(We?L(We,e):e.linkKey||e.id),Q=be.filter(Se=>Se&&Se.key!==We?.key&&!z(Se,e)&&Z(Se,e)).map(Se=>({column:Se,text:String(F(L(Se,e)))})),ge=(Q.find(({text:Se})=>Se!=="\u2014"&&Se.length>12)||Q.find(({text:Se})=>Se!=="\u2014"))?.column||null,we=ge?F(L(ge,e)):"",Ie=new Set(P),oe=be.filter(Se=>Se.key!==We?.key&&Se.key!==ge?.key&&!Ie.has(Se.key)),xe=TB({density:p,visibility:g,limit:f}),Ve=Number.isFinite(xe)?oe.slice(0,xe):oe,_e=p==="detailed",Ge=SB(u,p),le=NB(p),Me=MB(Ge),Ae=b==="lines",J=q?n?"block h-auto w-full":"block h-auto w-full transition-transform duration-500 group-hover:scale-[1.02]":RB(p,d),$e=typeof A=="function"?A({row:e,mediaColumn:O,mediaValue:he,isImageMedia:me,isAudioMedia:ie,iconVisual:ne,IconComponent:fe,previewClassName:J}):null,ue={row:e,contentColumns:be,detailColumns:oe,titleColumn:We,summaryColumn:ge,getDisplayText:F,getFieldValue:L},Re=N?.(ue)??null,se=D?.({...ue,iconVisual:ne})??null,te=!se&&ne?jsxRuntime.jsx("div",{className:m("flex h-9 w-9 items-center justify-center rounded-lg border",ne.chipClassName||"border-primary/20 bg-primary/10 text-primary"),children:nl(ne.Icon||ne.icon,m("h-4 w-4",ne.iconClassName||"text-primary"))}):null,Te=se||te,ze=U?"shrink-0 rounded-full border border-border/40 bg-muted/25 px-2.5 py-1 text-[10px] text-muted-foreground transition-all duration-300 group-hover:border-primary/30 group-hover:bg-primary/10 group-hover:text-primary dark:border-border/35 dark:bg-muted/15":"shrink-0 rounded-md border border-border/40 bg-muted/25 px-2 py-1 text-[10px] text-muted-foreground dark:border-border/35 dark:bg-muted/15",je=U?"rounded-xl border border-border/35 bg-muted/20 px-3 py-2.5 transition-all duration-300 group-hover:border-primary/25 group-hover:bg-primary/5 dark:border-border/30 dark:bg-muted/10":"rounded-lg border border-border/35 bg-muted/20 px-2.5 py-2 dark:border-border/30 dark:bg-muted/10",it=U?"text-[10px] uppercase tracking-[0.14em] text-muted-foreground transition-colors duration-300 group-hover:text-foreground":"text-[10px] uppercase tracking-[0.12em] text-muted-foreground",Y=U?"mt-1.5 text-[11px] text-muted-foreground transition-colors duration-300 group-hover:text-foreground [&_*]:max-w-full [&_pre]:text-[11px] [&_pre]:leading-relaxed":"mt-1.5 text-[11px] text-foreground [&_*]:max-w-full [&_pre]:text-[11px] [&_pre]:leading-relaxed",pe=W?.fieldCount?.(be.length),Be=W?.coverOnlyHint,rt=$e==null&&me&&O?G(he,e.id,O.label):void 0,Ce=$e??jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[me&&O?jsxRuntime.jsx("div",{className:m("overflow-hidden bg-card/50",q?"rounded-[inherit] bg-transparent":ee?"rounded-[inherit]":"mb-3 rounded-lg border border-border/70"),children:jsxRuntime.jsx("img",{src:rt,style:qn(rt),alt:typeof he?.alt=="string"?he.alt:typeof he=="string"?he:String(O.label||""),className:J,loading:"lazy",referrerPolicy:"no-referrer",onError:Se=>{Se.currentTarget.onerror=null,Se.currentTarget.src=G("",e.id,O.label);}})}):null,!me&&ne&&ee?jsxRuntime.jsx("div",{className:m("flex items-center justify-center","rounded-[inherit] border py-10",ne.chipClassName||"border-primary/20 bg-primary/5"),children:nl(ne.Icon||ne.icon,m("h-10 w-10",ne.iconClassName||"text-primary"))}):null,ie&&M?jsxRuntime.jsx("div",{className:m(!ee&&"mb-3"),children:jsxRuntime.jsx(M,{filename:String(he)})}):null]}),Xe=n?_w:null,de=n?.title?.fieldId?t.find(Se=>Se.key===n.title?.fieldId):We,Ee=s?s(e):de?F(L(de,e)):Ke,qe=!!n?.slots?.length,Le=qe||r==="container"?"div":"button";return jsxRuntime.jsxs(Le,{"data-gallery-card":true,"data-card-hover-effect":n?.hover?.effect,type:Le==="button"?"button":void 0,role:qe&&r==="button"&&o?"group":void 0,tabIndex:qe&&r==="button"&&o?0:void 0,onKeyDown:qe&&r==="button"&&o?Se=>{Se.target===Se.currentTarget&&(Se.key==="Enter"||Se.key===" ")&&(Se.preventDefault(),o());}:void 0,onClick:r==="button"?Se=>{(!qe||!Se.target.closest("button,a,input,select,textarea,[role=button],[role=menuitem]"))&&o?.();}:void 0,"aria-label":PB(Ke),className:m("group relative w-full rounded-lg text-left transition-all duration-300",q?"overflow-hidden bg-transparent p-0 shadow-none":ee?"overflow-hidden bg-transparent p-0":m("overflow-hidden border",U&&"shadow-none"),!ee&&!q&&le,!ee&&!q&&(l?U?"border-primary/35 bg-background/85 ring-1 ring-primary/20":"border-primary/40 bg-primary/10 ring-1 ring-primary/30":U?n?"workbench-surface-card":"workbench-surface-card hover:-translate-y-1 hover:border-primary/20":n?"workbench-surface-card":"workbench-surface-card hover:border-primary/30"),ee&&l&&"ring-1 ring-primary/30",q&&(l?"ring-1 ring-primary/30":!n&&"hover:-translate-y-0.5"),d?"block h-full w-full min-w-0":"h-full min-w-0",B),children:[U?jsxRuntime.jsx("div",{"aria-hidden":"true",className:m("pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_right,hsl(var(--primary)/0.18),transparent_40%),radial-gradient(circle_at_bottom_left,hsl(var(--accent)/0.18),transparent_45%)] opacity-0 transition-opacity duration-300",l?"opacity-100":"group-hover:opacity-100")}):null,jsxRuntime.jsxs("div",{className:m("relative z-[1]",(q||ee)&&"rounded-[inherit]"),children:[Xe&&n?jsxRuntime.jsx(Xe,{presentation:n,title:Ee,renderSlot:Se=>i?.(Se,ue),children:Ce}):Ce,!ee&&!q?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[Te?jsxRuntime.jsx("div",{className:"shrink-0",children:Te}):null,jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[!n?.title&&jsxRuntime.jsx("div",{className:m("flex items-center gap-2 text-sm font-semibold",U?"text-muted-foreground transition-colors duration-300 group-hover:text-foreground":"text-foreground"),children:jsxRuntime.jsx("span",{className:"truncate",children:r==="container"&&o?jsxRuntime.jsx("button",{type:"button",onClick:o,className:"border-0 bg-transparent p-0 text-left hover:underline",style:{font:"inherit",color:"inherit"},children:Ke}):Ke})}),we&&we!==Ke?jsxRuntime.jsx("div",{className:m("mt-1 text-[11px] leading-5 text-muted-foreground",_e?"line-clamp-4":"line-clamp-2",U&&"transition-colors duration-300 group-hover:text-foreground"),children:we}):null]}),Re??(V(pe)?jsxRuntime.jsx("span",{className:ze,children:pe}):null)]})]}),Ve.length>0?jsxRuntime.jsx("div",{"data-gallery-detail-presentation":b,className:m("mt-3 grid grid-flow-row gap-2",Ae?"grid-cols-1":Me),children:Ve.map(Se=>jsxRuntime.jsxs("div",{className:Ae?"flex min-w-0 items-start gap-2 text-xs":je,children:[Se.label?jsxRuntime.jsx("div",{className:Ae?"shrink-0 text-muted-foreground":it,children:H(Se.label,{column:Se})}):null,jsxRuntime.jsx("div",{className:Ae?"min-w-0 text-foreground":m(Y,!Se.label&&"mt-0"),children:ae(Se,e,{compact:p!=="detailed",surface:"gallery"})})]},`${e.id||e.linkKey}-${Se.key}`))}):null,!We&&!we&&Ve.length===0&&V(Be)?jsxRuntime.jsx("div",{className:m("mt-3 text-[11px] text-muted-foreground",U&&"transition-colors duration-300 group-hover:text-foreground"),children:Be}):null]}):null]})]})}a(yu,"WorkbenchGalleryCard");function Kw(e,t){let o=e==="rail"?"horizontal":"vertical";if(t&&t!=="auto"&&t!==o)throw new TypeError(`Gallery layout ${e} requires ${o} scrolling.`);return o}a(Kw,"resolveGalleryScrollDirection");function BB(e,t,o,r,n){let i=Array.from({length:t},()=>0),s=0,l=0,d=e.map((c,p)=>{if(n==="rail")return {index:p,left:p*(o+r),top:0,width:o,height:c};if(n==="grid")return p>0&&p%t===0&&(s+=l+r,l=0),l=Math.max(l,c),{index:p,left:p%t*(o+r),top:s,width:o,height:c};let u=i.indexOf(Math.min(...i)),g=i[u];return i[u]=g+c+r,{index:p,left:u*(o+r),top:g,width:o,height:c}});return {placements:d,height:Math.max(0,...d.map(c=>c.top+c.height)),width:n==="rail"?Math.max(0,e.length*(o+r)-r):t*(o+r)-r}}a(BB,"placeWindowedItems");function LB(e,t,o,r,n){let i=t-n,s=t+o+n;return e.filter(l=>{let d=r?l.left:l.top;return d<=s&&d+(r?l.width:l.height)>=i})}a(LB,"visibleWindow");function Yw({items:e,getKey:t,layout:o,cardWidth:r,estimateHeight:n,getScrollOwner:i,railRef:s,tailRef:l,containerProps:d,getItemProps:c,renderItem:p}){let u=o.mode==="rail",g=u?1:o.columnCount,f=Math.max(1,u?r??280:o.columnWidth),b=ho.useRef(null),x=ho.useRef(new Map),y=ho.useRef(),[k,w]=ho.useState({width:f,heights:{}}),[v,h]=ho.useState({start:0,length:u?1280:720}),[S,T]=ho.useState(),[C,R]=ho.useState(),M=e.map(t),I=JSON.stringify(M),A=M.map((L,F)=>k.heights[L]??Math.max(1,n(e[F],f))),N=ho.useMemo(()=>BB(A,g,f,o.gap,u?"rail":o.mode==="grid"?"grid":"masonry"),[JSON.stringify(A),g,f,o.gap,u,o.mode]),D=ho.useCallback(()=>{let L=b.current,F=i();if(!L||!F)return;let _=L.getBoundingClientRect(),$=F.getBoundingClientRect(),G=F.offsetHeight>0?$.height/F.offsetHeight:1,z=u?F.scrollLeft:($.top-_.top)/(G||1)+F.clientTop,re=u?F.clientWidth:F.clientHeight;re<=0||h(Z=>Z.start===z&&Z.length===re?Z:{start:z,length:re});},[i,u]);ho.useLayoutEffect(()=>{D();},[D,N.height,N.width]),ho.useEffect(()=>{let L=i();if(!L)return;let F=0,_=a(()=>{F||(F=requestAnimationFrame(()=>{F=0,D();}));},"update");L.addEventListener("scroll",_,{passive:true}),window.addEventListener("resize",_);let $=typeof ResizeObserver=="function"?new ResizeObserver(_):void 0;return $?.observe(L),b.current&&$?.observe(b.current),()=>{L.removeEventListener("scroll",_),window.removeEventListener("resize",_),$?.disconnect(),cancelAnimationFrame(F);}},[i,D]),ho.useEffect(()=>{if(typeof ResizeObserver!="function")return;let L=new ResizeObserver(F=>{w(_=>{let $={..._.heights},G=_.width!==f;for(let z of F){let re=z.target.dataset.windowKey,Z=z.borderBoxSize?.[0]?.blockSize??z.target.offsetHeight;re!==void 0&&Z>0&&$[re]!==Z&&($[re]=Z,G=true);}return G?{width:f,heights:$}:_});});return y.current=L,x.current.forEach(F=>L.observe(F)),()=>{L.disconnect(),y.current=void 0;}},[f]),ho.useEffect(()=>{let L=new Set(M);w(F=>({width:F.width,heights:Object.fromEntries(Object.entries(F.heights).filter(([_])=>L.has(_)))}));},[I]);let E=a((L,F)=>{let _=x.current.get(L);if(_&&y.current?.unobserve(_),!F){x.current.delete(L);return}F.dataset.windowKey=L,x.current.set(L,F),y.current?.observe(F);},"register"),P=v.length,W=LB(N.placements,v.start,v.length,u,P),H=new Set(W.map(L=>L.index));for(let L of [S,C]){let F=L===void 0?-1:M.indexOf(L);F>=0&&H.add(F);}ho.useLayoutEffect(()=>{if(!C)return;let L=x.current.get(C)?.parentElement;L&&(L.focus(),L.scrollIntoView({block:"nearest",inline:"nearest"}),R(void 0));},[C]);let B={...o,columnWidth:f,itemWidth:f};return jsxRuntime.jsxs("div",{...d,ref:L=>{b.current=L,s&&(s.current=L);},"data-collection-windowed":"","data-collection-total":e.length,style:{...d.style,position:"relative",...u?{overflowX:"auto",overflowY:"hidden"}:{height:N.height},overflowAnchor:"none"},children:[u?jsxRuntime.jsx("div",{"aria-hidden":"true",style:{width:N.width,height:N.height,pointerEvents:"none"}}):null,Array.from(H).sort((L,F)=>L-F).map(L=>{let F=e[L],_=M[L],$=N.placements[L],G=c(F,B);return jsxRuntime.jsx("div",{...G,"aria-posinset":L+1,"aria-setsize":e.length,onFocus:z=>{T(_),G.onFocus?.(z);},onBlur:z=>{z.currentTarget.contains(z.relatedTarget)||T(void 0),G.onBlur?.(z);},onKeyDown:z=>{if(z.target===z.currentTarget){let re=u?1:g,Z=z.key==="Home"?0:z.key==="End"?e.length-1:z.key==="ArrowRight"?L+1:z.key==="ArrowLeft"?L-1:z.key==="ArrowDown"?L+re:z.key==="ArrowUp"?L-re:void 0;if(Z!==void 0){z.preventDefault(),R(M[Math.min(e.length-1,Math.max(0,Z))]);return}}G.onKeyDown?.(z);},style:{...G.style,position:"absolute",left:$.left,top:$.top,width:$.width},children:jsxRuntime.jsx("div",{ref:z=>E(_,z),children:p(F,B)})},_)}),l?jsxRuntime.jsx("div",{ref:l,"aria-hidden":"true",style:{position:"absolute",left:Math.max(0,N.width-1),top:0,width:1,height:1}}):null]})}a(Yw,"WorkbenchWindowedLayout");var OB=12,FB=8,Zw=280,ek=240,HB=typeof window>"u"?ho.useEffect:ho.useLayoutEffect;function ku(e,t,o){return Math.min(Math.max(e,t),o)}a(ku,"clamp");function VB(e){if(typeof window>"u")return 16;let t=e||document.documentElement,o=Number.parseFloat(window.getComputedStyle(t).fontSize);return Number.isFinite(o)&&o>0?o:16}a(VB,"getRootFontSize");function Cu(e,t,o){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return t;let r=e.trim().toLowerCase();if(!r)return t;if(/^\d+(\.\d+)?$/.test(r)){let n=Number.parseFloat(r);return Number.isFinite(n)&&n>0?n:t}if(r.endsWith("px")){let n=Number.parseFloat(r);return Number.isFinite(n)&&n>0?n:t}if(r.endsWith("rem")){let n=Number.parseFloat(r);return !Number.isFinite(n)||n<=0?t:n*VB(o)}return t}a(Cu,"resolveLengthToPixels");function Jw(e,t){let o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return false;for(let n of r)if(e[n]!==t[n])return false;return true}a(Jw,"areMeasurementMapsEqual");function _B({containerWidth:e,itemCount:t,targetColumnWidth:o,gap:r}){if(!e)return 1;let n=Math.max(t,1),i=Math.max(1,Math.min(n,Math.ceil((e+r)/(Math.max(o*.58,1)+r)))),s=1,l=Number.POSITIVE_INFINITY;for(let d=1;d<=i;d+=1){let c=(e-r*Math.max(d-1,0))/d;if(!Number.isFinite(c)||c<=0)continue;let p=Math.max(0,o*.78-c),u=Math.max(0,c-o*1.35),g=Math.abs(c-o)+p*3+u*2;g<l&&(l=g,s=d);}return s}a(_B,"getMasonryColumnCount");function GB({size:e,columnWidth:t,columnCount:o,gap:r}){if(Number.isFinite(e?.columnSpan)&&Number(e?.columnSpan)>0)return ku(Math.round(Number(e?.columnSpan)),1,o);let n=Cu(e?.width,t,null);return ku(Math.ceil((n+r)/(t+r)),1,o)}a(GB,"getItemColumnSpan");function $B({size:e,measuredHeight:t,rowHeight:o,gap:r}){if(Number.isFinite(e?.rowSpan)&&Number(e?.rowSpan)>0)return Math.max(1,Math.round(Number(e?.rowSpan)));let n=Number.isFinite(t)&&Number(t)>0?Number(t):Cu(e?.height,ek,null);return Math.max(1,Math.ceil((n+r)/(o+r)))}a($B,"getItemRowSpan");function jB({size:e,measuredHeight:t}){return Number.isFinite(t)&&Number(t)>0?Number(t):Cu(e?.height,ek,null)}a(jB,"getResolvedItemHeight");function Xi({items:e=[],renderItem:t,getItemKey:o=a((g,f)=>g?.id??g?.key??f,"getItemKey"),getItemSize:r,columnWidth:n=Zw,columnCount:i,gap:s=OB,rowHeight:l=FB,placementStrategy:d="shelf",containerProps:c,getItemProps:p,className:u}){let g=ho.useRef(null),f=ho.useRef(new Map),b=ho.useRef(null),[x,y]=ho.useState(0),[k,w]=ho.useState({}),v=ho.useMemo(()=>e.map((N,D)=>String(o(N,D))),[o,e]),h=v.join("|");ho.useEffect(()=>{let N=g.current;if(!N)return;let D=a(()=>{let E=Math.round(N.getBoundingClientRect().width);y(P=>P===E?P:E);},"updateWidth");if(D(),typeof ResizeObserver=="function"){let E=new ResizeObserver(()=>D());return E.observe(N),()=>E.disconnect()}return window.addEventListener("resize",D),()=>window.removeEventListener("resize",D)},[]),ho.useEffect(()=>{w(N=>{let D=new Set(v),E=Object.fromEntries(Object.entries(N).filter(([P])=>D.has(P)));return Jw(N,E)?N:E});},[v,h]);let S=Cu(n,Zw,g.current),T=d==="dense",R=(Number.isFinite(i)&&Number(i)>0?ku(Math.round(Number(i)),1,24):void 0)||_B({containerWidth:x,itemCount:e.length,targetColumnWidth:S,gap:s}),M=x>0?(x-s*Math.max(R-1,0))/R:S,I=ho.useMemo(()=>e.map((N,D)=>{let E=v[D],P=typeof r=="function"?r(N,{columnCount:R,columnWidth:M,containerWidth:x,gap:s,placementStrategy:d,rowHeight:l})||{}:{};return {key:E,item:N,size:P,columnSpan:GB({size:P,columnWidth:M,columnCount:R,gap:s}),rowSpan:$B({size:P,measuredHeight:k[E],rowHeight:l,gap:s})}}),[R,x,s,r,v,e,k,d,M,l]);HB(()=>{let N={};f.current.forEach((D,E)=>{let P=Math.ceil(D.getBoundingClientRect().height);Number.isFinite(P)&&P>0&&(N[E]=P);}),w(D=>{if(!Object.keys(N).length)return D;let E={...D,...N};return Jw(D,E)?D:E});},[R,T,h,M]),ho.useEffect(()=>{if(typeof ResizeObserver!="function")return;let N=new ResizeObserver(D=>{w(E=>{let P={...E},W=false;for(let H of D){let B=H.target.dataset.masonryKey;if(!B)continue;let L=Math.ceil(H.contentRect.height);!Number.isFinite(L)||L<=0||P[B]===L||(P[B]=L,W=true);}return W?P:E});});return b.current=N,f.current.forEach(D=>N.observe(D)),()=>{N.disconnect(),b.current=null;}},[T,h]);let A=a((N,D)=>{let E=f.current,P=E.get(N);if(P&&P!==D&&b.current&&b.current.unobserve(P),!D){E.delete(N);return}D.dataset.masonryKey=N,E.set(N,D),b.current&&b.current.observe(D);},"registerItemNode");if(!T){let N=(()=>{let D=Array.from({length:R},()=>0),E=0,P=0,W=I.map(({key:H,item:B,columnSpan:L,rowSpan:F,size:_})=>{let $=ku(L,1,R),G=E;if(d==="shortest"){let q=Number.POSITIVE_INFINITY;for(let U=0;U<=R-$;U+=1){let X=Math.max(...D.slice(U,U+$));X<q&&(q=X,G=U);}}else G+$>R&&(G=0),G=Math.min(G,R-$);let z=M*$+s*Math.max($-1,0),re=jB({size:_,measuredHeight:k[H]}),Z=Math.max(...D.slice(G,G+$)),ae=G*(M+s),ee=Z+re;for(let q=G;q<G+$;q+=1)D[q]=ee+s;return P=Math.max(P,ee),d!=="shortest"&&(E=G+$,E>=R&&(E=0)),{key:H,item:B,columnSpan:$,itemHeight:re,itemWidth:z,left:ae,rowSpan:F,size:_,top:Z}});return {containerHeight:Math.max(0,P),positionedItems:W}})();return jsxRuntime.jsx("div",{ref:g,...c,className:m("relative w-full",u,c?.className),style:{...c?.style,height:`${N.containerHeight}px`},children:N.positionedItems.map(({key:D,item:E,columnSpan:P,rowSpan:W,size:H,itemWidth:B,left:L,top:F})=>{let _=x<=0&&R===1,$=_?"100%":`${B}px`,G={columnCount:R,columnSpan:P,columnWidth:M,containerWidth:x,gap:s,itemWidth:B,placementStrategy:d,rowSpan:W,rowHeight:l,size:H},z=p?.(E,G);return jsxRuntime.jsx("div",{...z,className:m("absolute min-w-0",z?.className),style:{...z?.style,left:_?0:`${L}px`,top:`${F}px`,width:$,maxWidth:$},children:jsxRuntime.jsx("div",{ref:re=>A(D,re),role:"presentation",className:"min-w-0",children:t(E,G)})},D)})})}return jsxRuntime.jsx("div",{ref:g,...c,className:m("grid w-full items-start",u,c?.className),style:{...c?.style,gap:`${s}px`,gridAutoFlow:"row dense",gridAutoRows:`${l}px`,gridTemplateColumns:`repeat(${R}, minmax(0, 1fr))`},children:I.map(({key:N,item:D,columnSpan:E,rowSpan:P,size:W})=>{let H={columnCount:R,columnSpan:E,columnWidth:M,containerWidth:x,gap:s,placementStrategy:d,rowSpan:P,rowHeight:l,size:W},B=p?.(D,H);return jsxRuntime.jsx("div",{...B,className:m("min-w-0",B?.className),style:{...B?.style,gridColumn:`span ${E}`,gridRow:`span ${P}`},children:jsxRuntime.jsx("div",{ref:L=>A(N,L),role:"presentation",className:"min-w-0",children:t(D,H)})},N)})})}a(Xi,"WorkbenchMasonryLayout");var KB=12,qB=[1],YB=[4/3],XB=[1,4/5,3/2,3/4,5/4],QB=.5,ZB=2,JB="hsl(var(--monkeys-color-muted, var(--muted)))";function Su(e,t,o){return Math.min(Math.max(e,t),o)}a(Su,"clamp");function Hf(e,t,o){return typeof e!="number"||!Number.isFinite(e)||e<=0?t:Su(Math.round(e),1,o)}a(Hf,"normalizeCount");function e5(e){return e==="masonry"||e==="dense"?XB:e==="rail"?YB:qB}a(e5,"getDefaultAspectRatios");function t5(e,t){let o=t?.filter(r=>typeof r=="number"&&Number.isFinite(r)&&r>0).map(r=>Su(r,QB,ZB));return o?.length?o:e5(e)}a(t5,"resolveAspectRatios");function ok(e){return Hf(e?.count,KB,48)}a(ok,"resolveWorkbenchCollectionSkeletonCapacity");function rk(e){if(e===void 0)return "skeleton";if(e==="skeleton"||e==="spinner")return e;throw new TypeError('WorkbenchCollection loading.variant must be "skeleton" or "spinner".')}a(rk,"resolveWorkbenchCollectionLoadingVariant");function o5({columnCount:e,config:t,phase:o}){if(o==="initial"){let n=Su(e*2,6,24);return Hf(t?.count,n,48)}let r=Su(e,1,12);return Hf(t?.loadMoreCount,r,24)}a(o5,"resolveSkeletonCount");function tk(e,t){return Math.max(1,e/t)}a(tk,"getSkeletonHeight");function Vf({mode:e,phase:t,columnCount:o,columnWidth:r,cardWidth:n,gap:i,rowHeight:s,config:l,ariaLabel:d,className:c}){let p=o5({columnCount:o,config:l,phase:t}),u=t5(e,l?.aspectRatios),g=l?.animated??true,f=ho.useMemo(()=>Array.from({length:p},(x,y)=>({aspectRatio:u[y%u.length],key:`${t}-${y}`,index:y})),[u,p,t]),b=a((x,y)=>jsxRuntime.jsx(Zd,{index:x.index,children:jsxRuntime.jsx(Ur,{variant:"block",animated:g,className:"h-auto w-full rounded-lg",style:{backgroundColor:JB,...y??{aspectRatio:String(x.aspectRatio)}},"data-collection-skeleton-item":"","data-skeleton-aspect-ratio":x.aspectRatio})}),"renderSkeleton");return jsxRuntime.jsx(Xn,{animation:l?.animation,animated:g,children:jsxRuntime.jsx("div",{role:"status","aria-label":d,"aria-atomic":"true","data-collection-loading":t,"data-layout-mode":e,className:"min-w-0",children:e==="masonry"||e==="dense"?jsxRuntime.jsx(Xi,{items:f,columnCount:o,columnWidth:r,gap:i,rowHeight:s,placementStrategy:e==="dense"?"dense":"shortest",className:c,containerProps:{"aria-hidden":true},getItemKey:x=>x.key,getItemSize:(x,y)=>({height:tk(y.columnWidth,x.aspectRatio)}),renderItem:(x,y)=>b(x,{height:`${tk(y.columnWidth,x.aspectRatio)}px`})}):e==="rail"?jsxRuntime.jsx("div",{"aria-hidden":"true",className:m("grid min-w-0 grid-flow-col items-start overflow-x-auto",c),style:{gap:i,gridAutoColumns:typeof n=="number"?`${n}px`:n??`${r}px`},children:f.map(x=>jsxRuntime.jsx("div",{children:b(x)},x.key))}):jsxRuntime.jsx("div",{"aria-hidden":"true",className:m("grid min-w-0 items-start",c),style:{gap:i,gridTemplateColumns:`repeat(${o}, minmax(0, 1fr))`},children:f.map(x=>jsxRuntime.jsx("div",{children:b(x)},x.key))})})})}a(Vf,"WorkbenchCollectionSkeleton");function n5(e,t){if(e.size!==t.size)return false;for(let o of e)if(!t.has(o))return false;return true}a(n5,"setsEqual");function a5(e){return String(e)}a(a5,"getComparableKey");function i5(e){return e==="multiple"?"toggle":"replace"}a(i5,"getDefaultBehavior");function Tu({items:e,getItemKey:t,mode:o="none",behavior:r,selectedKeys:n,defaultSelectedKeys:i,isItemDisabled:s,onSelectionChange:l}){let d=n!==void 0,[c,p]=ho.useState(()=>new Set(i??[])),u=ho.useRef(null),g=ho.useRef(l);g.current=l;let f=ho.useMemo(()=>{let h=new Map;return e.map((S,T)=>{let C=t(S,T),R=a5(C),M=h.get(R);if(M!==void 0)throw new TypeError(`useWorkbenchCollectionSelection received duplicate item key "${R}" at indices ${M} and ${T}.`);return h.set(R,T),{item:S,index:T,key:C}})},[t,e]),b=ho.useMemo(()=>{let h=new Map;return f.forEach(S=>h.set(S.key,S)),h},[f]),x=ho.useMemo(()=>o==="none"?new Set:d?new Set(n??[]):c,[d,n,c,o]),y=ho.useRef(x);y.current=x;let k=ho.useCallback(()=>{u.current=null;},[]);ho.useEffect(()=>{if(d)return;let h=new Set(f.map(({key:S})=>S));p(S=>{let T=new Set(Array.from(S).filter(C=>h.has(C)));return n5(S,T)?S:(y.current=T,T)});},[d,f]),ho.useEffect(()=>{let h=u.current;if(o!=="multiple"||x.size===0||h===null){k();return}let S=b.get(h);(!S||s?.(S.item,S.index))&&k();},[s,b,o,k,x.size]);let w=ho.useCallback((h,S={})=>{if(o==="none")return;let T=b.get(h);if(!T||s?.(T.item,T.index))return;let C=new Set(y.current),R=r??i5(o),M=S.shiftKey&&o==="multiple"?"range":S.behavior??R;o==="single"&&(M=M==="toggle"?"toggle":"replace");let I=u.current===null?void 0:b.get(u.current),A=!!(I&&!s?.(I.item,I.index));o==="multiple"&&M==="range"&&!A&&(M=R==="range"?"toggle":R);let N=new Set;if(o==="single")M==="toggle"&&C.has(T.key)||N.add(T.key);else if(M==="range"&&I){C.forEach(P=>N.add(P));let D=Math.min(I.index,T.index),E=Math.max(I.index,T.index);f.slice(D,E+1).forEach(P=>{s?.(P.item,P.index)||N.add(P.key);});}else M==="replace"?N.add(T.key):(C.forEach(D=>N.add(D)),N.has(T.key)?N.delete(T.key):N.add(T.key));u.current=o==="multiple"?T.key:null,d||(y.current=N,p(N)),g.current?.(N,{item:T.item,index:T.index,key:T.key,behavior:M});},[r,d,s,b,o,f]),v=ho.useCallback(h=>x.has(h),[x]);return {mode:o,selectedKeys:x,isSelected:v,selectKey:w,resetAnchor:k}}a(Tu,"useWorkbenchCollectionSelection");var Kf=12,d5=8,Ru=280,c5=640,u5=1024,lk=24;function Mu(e,t,o){return Math.min(Math.max(e,t),o)}a(Mu,"clamp");function Ir(e,t){return typeof e=="function"?e(t):e}a(Ir,"resolveRenderableSlot");function Zi(e,t,o){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return t;let r=e.trim().toLowerCase();if(!r)return t;if(/^\d+(\.\d+)?(px)?$/.test(r)){let n=Number.parseFloat(r);return Number.isFinite(n)&&n>0?n:t}if(r.endsWith("rem")){let n=Number.parseFloat(r),i=typeof window>"u"?16:Number.parseFloat(window.getComputedStyle(o||document.documentElement).fontSize)||16;return Number.isFinite(n)&&n>0?n*i:t}return t}a(Zi,"resolveLengthToPixels");function Nu(e){if(!(typeof e!="number"||!Number.isFinite(e)||e<=0))return Mu(Math.round(e),1,lk)}a(Nu,"normalizeColumns");function ak(e,t){if(e==="auto"||e===void 0)return;if(typeof e=="number")return Nu(e);let o=Nu(e.mobile),r=Nu(e.tablet),n=Nu(e.desktop);return t>=u5?n??r??o:t>=c5?r??o??n:o??r??n}a(ak,"resolveResponsiveColumns");function p5({containerWidth:e,itemCount:t,gap:o,columns:r,underfilledBehavior:n,maxColumns:i,minCardWidth:s,idealCardWidth:l,maxCardWidth:d,node:c}){let p=ak(r,e),u=ak(i,e);if(p)return u?Math.min(p,u):p;if(!e)return 1;let g=Zi(l,Ru,c),f=Zi(s,g*.78,c),b=Math.max(f,Zi(d,g*1.35,c)),x=Math.max(t,1),y=Math.max(1,Math.min(n==="preserve-columns"?lk:x,Math.ceil((e+o)/(Math.max(f*.75,1)+o)))),k=1,w=Number.POSITIVE_INFINITY;for(let v=1;v<=y;v+=1){let h=(e-o*Math.max(v-1,0))/v;if(!Number.isFinite(h)||h<=0)continue;let S=Math.abs(h-g)+Math.max(0,f-h)*3+Math.max(0,h-b)*2;S<w&&(w=S,k=v);}return u?Math.min(k,u):k}a(p5,"resolveColumnCount");function ik(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:Kf}a(ik,"normalizeGap");function m5(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:d5}a(m5,"normalizeRowHeight");function f5(e){return typeof e=="number"&&Number.isFinite(e)?Mu(e,0,1):0}a(f5,"normalizeThreshold");function b5(e,t,o){let r=Number.isFinite(t)&&Number(t)>0?Number(t):void 0,n=e?.height??(r?Math.max(1,o/r):void 0);return {...e,height:n}}a(b5,"normalizeItemSize");function g5(e,t){if(e&&typeof e=="object"){let o=e;if(typeof o.id=="string"||typeof o.id=="number")return o.id;if(typeof o.key=="string"||typeof o.key=="number")return o.key}return t}a(g5,"getDefaultItemKey");function h5(e){return `@inf-monkeys-tech/monkeys-design:workbench-collection:${e}`}a(h5,"getScrollStorageKey");function y5(e){let t=e?.parentElement??null;for(;t;){if(typeof window>"u")return t;let o=window.getComputedStyle(t).overflowY;if(o==="auto"||o==="scroll")return t;t=t.parentElement;}return null}a(y5,"getParentScrollOwner");function sk(e,t){if(typeof Element>"u"||!(e instanceof Element)||e===t)return false;let o=e.closest('a, button, input, select, textarea, summary, [contenteditable="true"], [data-collection-action]');return !!(o&&t.contains(o))}a(sk,"isInteractiveEventTarget");function x5(e){if(!(!Number.isFinite(e)||Number(e)<=0))return Mu(Math.round(Number(e)),1,12)}a(x5,"normalizeTitleMaxLines");function Sn({items:e,config:t,renderItem:o,slots:r,callbacks:n,className:i,classNames:s,style:l,ariaLabel:d}){let c=ke(),p=Ye().workbench.collection,u=Or(),g=Hn(),f=ho.useId().replace(/:/g,""),b=ho.useRef(null),x=ho.useRef(null),y=ho.useRef(null),k=ho.useRef(null),w=ho.useRef(false),v=ho.useRef(false),h=ho.useRef(false),S=ho.useRef(false),T=ho.useRef(null),C=ho.useRef(null),R=ho.useRef(void 0),M=ho.useRef(false),[I,A]=ho.useState(0),[N,D]=ho.useState(Kf),[E,P]=ho.useState(null),W=ho.useRef(n);W.current=n;let H=ho.useCallback(de=>{y.current=de,P(de);},[]),B=t.layout.mode;if(B!=="grid"&&B!=="masonry"&&B!=="dense"&&B!=="rail")throw new TypeError(`WorkbenchCollection layout.mode "${String(B)}" is not supported.`);let L=t.layout.gap===void 0?N:ik(t.layout.gap),F=m5(t.layout.rowHeight),_=t.getItemKey??g5,$=ho.useMemo(()=>e.map((de,Ee)=>{let qe=_(de,Ee);return {item:de,index:Ee,key:qe,stringKey:String(qe)}}),[_,e]),G=$.map(({stringKey:de})=>de).join(""),z=t.state,re=z?.loading===true,Z=z?.loadingMore===true,ae=z?.hasMore===true,ee=rk(t.loading?.variant),q=re&&$.length===0&&ee==="skeleton"?ok(t.loading?.skeleton):$.length,U=t.selection?.mode??"none",X=ho.useCallback(de=>t.selection?.isItemDisabled?.(de.item,de.index)??false,[t.selection?.isItemDisabled]),O=ho.useCallback(de=>de.key,[]),K=ho.useCallback((de,Ee)=>{W.current?.onSelectionChange?.(de,{item:Ee.item.item,key:Ee.key,behavior:Ee.behavior});},[]),{selectedKeys:ne,selectKey:fe}=Tu({items:$,getItemKey:O,mode:U,behavior:t.selection?.behavior,selectedKeys:t.selection?.selectedKeys,defaultSelectedKeys:t.selection?.defaultSelectedKeys,isItemDisabled:X,onSelectionChange:K});ho.useEffect(()=>{let de=E;if(!de)return;let Ee=a(()=>{if(t.layout.gap===void 0&&b.current){let Le=Number.parseFloat(window.getComputedStyle(b.current).columnGap);D(Number.isFinite(Le)&&Le>=0?Le:Kf);}let qe=de.clientWidth;A(Le=>Le===qe?Le:qe);},"updateWidth");if(Ee(),typeof ResizeObserver=="function"){let qe=new ResizeObserver(Ee);return qe.observe(de),()=>qe.disconnect()}if(!(typeof window>"u"))return window.addEventListener("resize",Ee),()=>window.removeEventListener("resize",Ee)},[E,t.layout.gap,l?.gap,g]);let he=p5({containerWidth:I,itemCount:q,gap:L,columns:t.layout.columns,underfilledBehavior:t.layout.underfilledBehavior,maxColumns:t.layout.maxColumns,minCardWidth:t.layout.minCardWidth,idealCardWidth:t.layout.idealCardWidth??t.layout.columnWidth,maxCardWidth:t.layout.maxCardWidth,node:y.current}),me=I>0?Math.max(0,(I-L*Math.max(he-1,0))/he):Zi(t.layout.cardWidth??t.layout.columnWidth??t.layout.idealCardWidth,Ru,y.current),ie=t.layout.placementStrategy??(B==="dense"?"dense":B==="masonry"?"shortest":"shelf"),be=ho.useMemo(()=>({collection:t.labels?.collection??p.label,loading:t.labels?.loading??p.loading,empty:t.labels?.empty??p.empty,loadError:t.labels?.loadError??p.loadError,refreshError:t.labels?.refreshError??p.refreshError,retry:t.labels?.retry??p.retry,loadingMore:t.labels?.loadingMore??p.loadingMore,permission:t.labels?.permission??p.permission,offline:t.labels?.offline??p.offline,requestAccess:t.labels?.requestAccess??p.requestAccess}),[t.labels,p]),He=ho.useMemo(()=>{let de=t.virtualization;return de?.enabled!==true||de.fallback!=="error"?null:de.adapter?de.adapter.supports?.(B)===false?new Error(`WorkbenchCollection virtualization adapter does not support mode "${B}".`):null:new Error("WorkbenchCollection virtualization requires an adapter.")},[t.virtualization,B]),We=ho.useMemo(()=>({mode:B,columnCount:he,columnWidth:me,containerWidth:I,gap:L,itemCount:$.length}),[he,me,I,L,B,$.length]);ho.useEffect(()=>{W.current?.onLayoutChange?.(We),I>0&&!M.current&&(M.current=true,W.current?.onLayoutReady?.(We));},[We,I]),ho.useEffect(()=>{M.current=false;},[B]);let Ke=ho.useCallback(()=>{let de=t.layout.scrollOwner;return de&&de!=="self"&&de!=="parent"?de:B==="rail"?x.current:de==="parent"?y5(b.current):b.current},[t.layout.scrollOwner,B]);ho.useEffect(()=>{let de=t.scrollRestorationKey?.trim();if(!de||typeof window>"u")return;let Ee=Ke();if(!Ee)return;let qe=h5(de);try{let Se=Number.parseFloat(window.sessionStorage.getItem(qe)??"");Number.isFinite(Se)&&Se>=0&&(Ee.scrollTop=Se);}catch{}let Le=a(()=>{try{window.sessionStorage.setItem(qe,String(Ee.scrollTop));}catch{}},"saveScrollPosition");return Ee.addEventListener("scroll",Le,{passive:true}),()=>{Le(),Ee.removeEventListener("scroll",Le);}},[t.scrollRestorationKey,Ke]);let ce=typeof n?.onLoadMore=="function",Q=z?.error??He;ho.useEffect(()=>{(!ce||!ae)&&(v.current=false,h.current=false,S.current=false);},[ce,ae]);let ge=ho.useCallback(()=>{if(!ce||!ae||Z||w.current)return;w.current=true;let de=a(()=>{w.current=false;},"releaseRequest");try{let Ee=W.current?.onLoadMore?.();Ee&&typeof Ee.then=="function"?Ee.then(de,de):de();}catch(Ee){throw de(),Ee}},[ce,ae,Z]);ho.useEffect(()=>{let de=k.current;if((T.current!==de||C.current!==G||R.current!==t.loading?.pageKey)&&(T.current=de,C.current=G,R.current=t.loading?.pageKey,v.current=false,h.current=false,S.current=false),!de||!ce||!ae||typeof IntersectionObserver!="function")return;let Ee=Ke(),qe=false,Le=true,Se=new IntersectionObserver(xt=>{if(!Le)return;let Gt=xt.some(Ca=>Ca.isIntersecting);if(!(Gt&&(Z||w.current))){if(S.current){if(qe=true,S.current=false,v.current=Gt,!Gt){h.current=false;return}if(h.current)return;h.current=true,ge();return}if(!qe){qe=true,v.current=Gt,Gt||(h.current=false),Gt&&t.loading?.autoFill&&!h.current&&(h.current=true,ge());return}if(!Gt){v.current=false,h.current=false;return}v.current||(v.current=true,h.current=true,ge());}},{root:Ee===b.current?Ee:Ee||null,rootMargin:t.loading?.rootMargin??"240px",threshold:f5(t.loading?.threshold)}),Je=Ee??(typeof window>"u"?null:window),bt=a(()=>{!v.current||h.current||S.current||(S.current=true,Se.unobserve(de),Se.takeRecords(),Se.observe(de));},"validateActiveIntersection");return Se.observe(de),Je?.addEventListener("scroll",bt,{passive:true}),()=>{Le=false,Se.disconnect(),Je?.removeEventListener("scroll",bt);}},[ce,t.loading?.autoFill,t.loading?.pageKey,t.loading?.rootMargin,t.loading?.threshold,ae,G,Z,$.length,ge,Ke]),ho.useEffect(()=>{if(!t.loading?.autoFill||!ce||!ae||Z||h.current||w.current||!k.current)return;let Ee=Ke()??(t.layout.scrollOwner==="parent"?b.current?.parentElement??null:null)??b.current;if(!Ee)return;let qe=B==="rail"?Ee.clientWidth:Ee.clientHeight,Le=B==="rail"?Ee.scrollWidth:Ee.scrollHeight;qe<=0||Le<=qe+1&&(h.current=true,ge());},[ce,t.layout.scrollOwner,t.loading?.autoFill,t.loading?.pageKey,ae,G,Z,$.length,ge,Ke,B]);let we=ho.useMemo(()=>{if(!t.grouping)return [{key:"__all__",stringKey:"__all__",items:$}];let de=new Map;return $.forEach(Ee=>{let qe=t.grouping?.getGroupKey(Ee.item,Ee.index)??"__all__",Le=String(qe),Se=de.get(Le);if(Se){Se.items.push(Ee);return}de.set(Le,{key:qe,stringKey:Le,label:t.grouping?.getGroupLabel?.(qe,Ee.item),items:[Ee]});}),Array.from(de.values())},[t.grouping,$]),Ie=ho.useCallback((de,Ee)=>{let qe=t.selection?.isItemDisabled?.(de.item,de.index)??false,Le={item:de.item,index:de.index,key:de.key,status:t.getItemStatus?.(de.item,de.index)??"idle",disabled:qe,selected:ne.has(de.key),selectionMode:U,layout:Ee,select:a(Se=>fe(de.key,{behavior:Se}),"select"),selectFromEvent:a((Se,Je)=>fe(de.key,{behavior:Je,shiftKey:Se.shiftKey}),"selectFromEvent"),preview:a(()=>n?.onItemPreview?.(de.item,Le),"preview"),detail:a(()=>n?.onItemDetail?.(de.item,Le),"detail"),renderSlot:a(Se=>r?.item?.[Se]?.(de.item,Le),"renderSlot"),notifyMediaLoad:a(()=>n?.onMediaLoad?.(de.item,Le),"notifyMediaLoad"),notifyMediaError:a(Se=>n?.onMediaError?.(de.item,Le,Se),"notifyMediaError")};return Le},[n,t.getItemStatus,t.selection,ne,fe,U,r?.item]),oe=ho.useCallback((de,Ee)=>{let qe=a(Le=>{Le.target!==Le.currentTarget||Le.key!=="Enter"&&Le.key!==" "||(Le.preventDefault(),U!=="none"?Ee.selectFromEvent(Le):n?.onItemClick?.(de.item,Ee,Le));},"handleKeyboard");return {id:`${f}-item-${de.index}`,"data-monkeys-collection-item":"","data-item-key":de.stringKey,"data-selected":Ee.selected||void 0,"data-disabled":Ee.disabled||void 0,"data-status":Ee.status,role:U==="none"?"listitem":"option","aria-selected":U==="none"?void 0:Ee.selected,"aria-disabled":Ee.disabled||void 0,tabIndex:n?.onItemClick||U!=="none"||t.item?.title?.visibility==="hover"?0:void 0,draggable:n?.onItemDragStart?true:void 0,className:m("min-w-0 group/workbench-collection-item outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t.appearance?.hover&&t.appearance.hover!=="none"&&"transition-[transform,box-shadow,background-color] duration-200",t.appearance?.hover==="highlight"&&"hover:bg-muted/30",t.appearance?.hover==="lift"&&"hover:-translate-y-0.5 motion-reduce:transform-none",t.appearance?.hover==="scale"&&"hover:scale-[1.01] motion-reduce:transform-none",t.appearance?.hover==="shadow"&&"hover:shadow-md",t.appearance?.hover==="lift-shadow"&&"hover:-translate-y-0.5 hover:shadow-md motion-reduce:transform-none",t.appearance?.selection==="ring"&&Ee.selected&&"ring-2 ring-primary",t.appearance?.selection==="outline"&&Ee.selected&&"outline outline-2 outline-primary",s?.item),onClick:a(Le=>{sk(Le.target,Le.currentTarget)||(U!=="none"&&Ee.selectFromEvent(Le),n?.onItemClick?.(de.item,Ee,Le));},"onClick"),onDoubleClick:a(Le=>{sk(Le.target,Le.currentTarget)||n?.onItemDoubleClick?.(de.item,Ee,Le);},"onDoubleClick"),onMouseEnter:a(Le=>n?.onItemHoverChange?.(de.item,Ee,true,Le),"onMouseEnter"),onMouseLeave:a(Le=>n?.onItemHoverChange?.(de.item,Ee,false,Le),"onMouseLeave"),onKeyDown:qe,onDragStart:a(Le=>n?.onItemDragStart?.(de.item,Ee,Le),"onDragStart"),onDragOver:n?.onItemDrop?Le=>Le.preventDefault():void 0,onDrop:a(Le=>n?.onItemDrop?.(de.item,Ee,Le),"onDrop")}},[n,s?.item,f,t.appearance,t.item?.title?.visibility,U]),xe=ho.useCallback((de,Ee)=>{let qe=o(de.item,Ee),Le=t.item?.title,Se=Le?.visibility??"always",Je=Le&&Se!=="never"?Le.getContent?.(de.item,Ee)??Ee.renderSlot("title"):null,bt=!!(Le&&V(Je)),xt=Le?.placement??"below",Gt=bt&&xt.startsWith("overlay-"),Ca=x5(Le?.maxLines),rn=Le?.surface??(Gt?"scrim":"none"),fs=bt?jsxRuntime.jsx("div",{"data-collection-item-title":"","data-title-placement":xt,"data-title-visibility":Se,className:m("min-w-0 px-1 py-2 text-sm font-medium text-foreground",Le?.align==="center"&&"text-center",Le?.align==="end"&&"text-right",Se==="hover"&&"!opacity-0 transition-opacity group-hover/workbench-collection-item:!opacity-100 group-focus-within/workbench-collection-item:!opacity-100",Gt&&"pointer-events-none absolute inset-x-0 z-10 px-3 py-2",xt==="overlay-top"&&"top-0",xt==="overlay-center"&&"top-1/2 -translate-y-1/2 motion-reduce:transform-none",xt==="overlay-bottom"&&"bottom-0",rn==="surface"&&"bg-background/90 backdrop-blur-sm",rn==="scrim"&&xt==="overlay-top"&&"bg-gradient-to-b from-background/90 to-transparent pb-8",rn==="scrim"&&xt==="overlay-bottom"&&"bg-gradient-to-t from-background/90 to-transparent pt-8",rn==="scrim"&&xt==="overlay-center"&&"bg-background/75 backdrop-blur-sm",!!Ca&&"overflow-hidden [display:-webkit-box] [-webkit-box-orient:vertical]",s?.itemTitle),style:Ca?{WebkitLineClamp:Ca}:void 0,children:Je}):null,Eo=t.item?.actions,ei=Eo?.visibility??"always",bs=Eo&&ei!=="never"?Ee.renderSlot("actions"):null,Sa=!!(Eo&&V(bs)),hr=Eo?.placement??"overlay-bottom",ti=Sa&&hr.startsWith("overlay-"),gs=Sa?jsxRuntime.jsx("div",{"data-collection-item-actions":"","data-actions-placement":hr,"data-actions-align":Eo?.align??"center","data-actions-visibility":ei,className:m("flex min-w-0 items-center gap-2 px-2 py-2",Eo?.align==="start"&&"justify-start",(Eo?.align===void 0||Eo.align==="center")&&"justify-center",Eo?.align==="end"&&"justify-end",Eo?.wrap!==false&&"flex-wrap",ei==="hover"&&"!opacity-0 transition-opacity group-hover/workbench-collection-item:!opacity-100 group-focus-within/workbench-collection-item:!opacity-100 [@media(hover:none)]:!opacity-100",ti&&"pointer-events-none absolute inset-x-0 z-20",hr==="overlay-top"&&"top-1",hr==="overlay-bottom"&&"bottom-1",s?.itemActions),children:jsxRuntime.jsx("div",{className:m("pointer-events-auto flex items-center gap-2",Eo?.wrap!==false&&"flex-wrap"),children:bs})}):null;return !bt&&!Sa?qe:jsxRuntime.jsxs("div",{className:m("min-w-0",(Gt||ti)&&"relative",s?.itemContent),"data-collection-item-content":"",children:[xt==="above"?fs:null,hr==="above"?gs:null,qe,xt==="below"||Gt?fs:null,hr==="below"||ti?gs:null]})},[s?.itemActions,s?.itemContent,s?.itemTitle,t.item,o]),Ve=ho.useCallback((de,Ee,qe=true)=>{let Le=Ie(de,Ee),Se=xe(de,Le);return qe?jsxRuntime.jsx("div",{...oe(de,Le),children:Se}):Se},[Ie,oe,xe]),_e=ho.useMemo(()=>({mode:B,columnCount:he,columnWidth:me,containerWidth:I,gap:L,placementStrategy:ie,rowHeight:F}),[he,me,I,L,B,ie,F]),Ge=a(de=>{if(t.windowed&&B!=="dense"){let Se=de===we[we.length-1];return jsxRuntime.jsx(Yw,{items:de.items,getKey:Je=>Je.stringKey,layout:_e,cardWidth:Zi(t.layout.cardWidth,Ru,b.current),getScrollOwner:Ke,railRef:B==="rail"&&Se?x:void 0,tailRef:B==="rail"&&Se?k:void 0,estimateHeight:(Je,bt)=>{let xt=t.layout.getItemSize?.(Je.item,{..._e,columnWidth:bt}),Gt=t.layout.getItemAspectRatio?.(Je.item,Je.index);return Zi(xt?.height,Gt&&Gt>0?bt/Gt:300,b.current)},containerProps:{role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0,className:s?.layout},getItemProps:(Je,bt)=>oe(Je,Ie(Je,bt)),renderItem:(Je,bt)=>Ve(Je,bt,false)})}let Ee=t.virtualization,qe=Ee?.adapter,Le=Ee?.enabled===true;if(Le&&(!qe||qe.supports?.(B)===false)&&Ee?.fallback==="error")return null;if(Le&&qe&&qe.supports?.(B)!==false)return qe.render({items:de.items.map(({item:Se})=>Se),keys:de.items.map(({key:Se})=>Se),layout:t.layout,scrollOwner:Ke(),renderItem:a((Se,Je,bt)=>{let xt=de.items[Je];return xt?jsxRuntime.jsx(ho.Fragment,{children:Ve(xt,bt)},xt.stringKey):null},"renderItem")});if(B==="masonry"||B==="dense")return jsxRuntime.jsx(Xi,{items:de.items,columnCount:he,columnWidth:t.layout.cardWidth??t.layout.columnWidth??t.layout.idealCardWidth,gap:L,rowHeight:F,placementStrategy:B==="dense"?"dense":ie,className:s?.layout,containerProps:{role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0},getItemProps:(Se,Je)=>{let bt=Ie(Se,{...Je,mode:B});return oe(Se,bt)},getItemKey:Se=>Se.key,getItemSize:(Se,Je)=>{let bt={...Je,mode:B},xt=t.layout.getItemSize?.(Se.item,bt),Gt=t.layout.getItemAspectRatio?.(Se.item,Se.index);return b5(xt,Gt,Je.columnWidth)},renderItem:(Se,Je)=>Ve(Se,{...Je,mode:B},false)});if(B==="rail"){let Se=t.layout.cardWidth??t.layout.idealCardWidth??Ru,Je=de===we[we.length-1];return jsxRuntime.jsx("div",{ref:Je?x:void 0,role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0,className:m("grid min-w-0 grid-flow-col items-start overflow-x-auto",s?.layout),style:{gap:L,gridAutoColumns:typeof Se=="number"?`${Se}px`:Se},children:de.items.map((bt,xt)=>jsxRuntime.jsx("div",{ref:Je&&xt===de.items.length-1?k:void 0,className:"min-w-0",children:Ve(bt,_e)},bt.stringKey))})}return jsxRuntime.jsx("div",{role:U==="none"?"list":"listbox","aria-label":d??be.collection,"aria-multiselectable":U==="multiple"||void 0,className:m("grid min-w-0 items-start",s?.layout),style:{gap:L,gridTemplateColumns:`repeat(${he}, minmax(0, 1fr))`},children:de.items.map(Se=>{let Je=t.layout.getItemSize?.(Se.item,_e),bt=Mu(Math.round(Number(Je?.columnSpan)||1),1,he),xt=t.layout.getItemAspectRatio?.(Se.item,Se.index);return jsxRuntime.jsx("div",{...oe(Se,Ie(Se,{..._e,columnSpan:bt,size:Je})),style:{gridColumn:bt>1?`span ${bt}`:void 0,aspectRatio:Number.isFinite(xt)&&Number(xt)>0?String(xt):void 0},children:Ve(Se,{..._e,columnSpan:bt,size:Je},false)},Se.stringKey)})})},"renderGroupItems"),le={items:e,error:Q,loading:re,loadingMore:Z,selectedKeys:ne,retry:a(()=>n?.onRetry?.(),"retry")},Me=Ir(r?.header,le),Ae=Ir(r?.toolbar,le),J=ne.size>0?Ir(r?.selectionToolbar,le):null,$e=Ir(r?.beforeItems,le),ue=Ir(r?.footer,le),Re=z?.permission===true,se=z?.offline===true&&!Re,te=re&&e.length===0&&!Re&&!se,Te=!!Q&&e.length===0&&!Re&&!se&&!te,ze=!Re&&!se&&!te&&!Te&&(z?.empty===true||e.length===0),je=Ir(r?.loading,le),it=Ir(r?.error,le),Y=Ir(r?.permission,le),pe=Ir(r?.offline,le),Be=Ir(r?.empty,le),rt=Ir(r?.loadMore,le),Ce=t.layout.scrollOwner==="self"||t.layout.scrollOwner===void 0&&(t.layout.fillHeight||t.layout.maxHeight),Xe={...l,gap:t.layout.gap===void 0?l?.gap??"var(--monkeys-bento-gap, var(--global-spacing, 0.75rem))":ik(t.layout.gap),padding:t.layout.padding??l?.padding,height:t.layout.fillHeight?"100%":l?.height,maxHeight:t.layout.maxHeight??l?.maxHeight,overflow:Ce?"auto":l?.overflow};return jsxRuntime.jsxs("section",{ref:b,...c,"data-monkeys-component":"workbench-collection","data-layout-mode":B,"data-density":t.appearance?.density,"data-radius":t.appearance?.radius,"data-media-fit":t.appearance?.mediaFit,"data-hover-effect":t.appearance?.hover,"aria-label":d??be.collection,"aria-busy":re||Z||void 0,className:m("min-h-0 min-w-0",t.layout.fillHeight&&"h-full",s?.root,i),style:Xe,children:[V(Me)?jsxRuntime.jsx("div",{className:s?.header,children:Me}):null,V(Ae)?jsxRuntime.jsx("div",{className:s?.toolbar,children:Ae}):null,V(J)?jsxRuntime.jsx("div",{className:s?.selectionToolbar,children:J}):null,V($e)?jsxRuntime.jsx("div",{className:s?.beforeItems,children:$e}):null,Re?V(Y)?Y:jsxRuntime.jsx(Fa,{kind:"permission",title:be.permission,actions:u.permission?.showRequestAccess!==false&&n?.onRequestAccess?jsxRuntime.jsx(dt,{size:"sm",label:be.requestAccess,onClick:n.onRequestAccess}):void 0}):se?V(pe)?pe:jsxRuntime.jsx(Fa,{kind:"offline",title:be.offline,actions:u.error?.showRetry!==false&&n?.onRetry?jsxRuntime.jsx(dt,{size:"sm",label:be.retry,onClick:n.onRetry}):void 0}):te?V(je)?je:ee==="spinner"?jsxRuntime.jsx(Kr,{title:be.loading,variant:"spinner"}):jsxRuntime.jsx("div",{ref:H,className:m("min-w-0",s?.items),children:jsxRuntime.jsx(Vf,{mode:B,phase:"initial",columnCount:he,columnWidth:me,cardWidth:t.layout.cardWidth??t.layout.idealCardWidth,gap:L,rowHeight:F,config:t.loading?.skeleton,ariaLabel:be.loading,className:s?.layout})}):Te?V(it)?it:jsxRuntime.jsx(Fa,{kind:"error",title:be.loadError,actions:u.error?.showRetry!==false&&n?.onRetry?jsxRuntime.jsx(dt,{size:"sm",label:be.retry,onClick:n.onRetry}):void 0}):ze?V(Be)?Be:jsxRuntime.jsx(Pi,{title:be.empty}):jsxRuntime.jsx("div",{ref:H,className:m("min-w-0",s?.items),children:we.map((de,Ee)=>{let qe={key:de.key,label:de.label,items:de.items.map(({item:Je})=>Je),groupIndex:Ee},Le=t.grouping?r?.groupHeading?.(qe,le)??de.label:null,Se=`${f}-group-${Ee}`;return jsxRuntime.jsxs("div",{"data-collection-group":de.stringKey,className:s?.group,children:[V(Le)?jsxRuntime.jsx("div",{id:Se,role:"heading","aria-level":2,className:s?.groupHeading,children:Le}):null,Ge(de)]},de.stringKey)})}),e.length>0&&Q?jsxRuntime.jsx("div",{className:s?.status,children:V(it)?it:jsxRuntime.jsx(Fa,{kind:"error",title:be.refreshError,actions:u.error?.showRetry!==false&&n?.onRetry?jsxRuntime.jsx(dt,{size:"sm",label:be.retry,onClick:n.onRetry}):void 0})}):null,e.length>0&&(ae||Z)?jsxRuntime.jsx("div",{ref:B==="rail"?void 0:k,className:s?.loadMore,"data-collection-load-more":"",children:V(rt)?rt:Z?ee==="spinner"?jsxRuntime.jsx(Kr,{title:be.loadingMore,variant:"spinner"}):jsxRuntime.jsx(Vf,{mode:B,phase:"load-more",columnCount:he,columnWidth:me,cardWidth:t.layout.cardWidth??t.layout.idealCardWidth,gap:L,rowHeight:F,config:t.loading?.skeleton,ariaLabel:be.loadingMore,className:s?.layout}):null}):null,V(ue)?jsxRuntime.jsx("div",{className:s?.footer,children:ue}):null]})}a(Sn,"WorkbenchCollection");function k5(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return `${e}px`;if(typeof e=="string"&&e.trim())return e.trim()}a(k5,"getNormalizedGalleryGridCardWidth");function C5(e){return e==="compact"?2:e==="detailed"?6:4}a(C5,"getDefaultGalleryDetailLimit");function S5(e,t){return e===1||e===2||e===3?Number(e):t==="detailed"?1:2}a(S5,"getNormalizedGalleryBentoColumns");function T5({density:e,visibility:t,limit:o}){if(t==="all")return Number.POSITIVE_INFINITY;let r=Number.parseInt(String(o),10);return Number.isFinite(r)&&r>0?r:C5(e)}a(T5,"getNormalizedGalleryDetailLimit");function dk(e){return e==="compact"?{min:220,ideal:244,max:268}:e==="detailed"?{min:320,ideal:372,max:420}:{min:260,ideal:304,max:348}}a(dk,"getGalleryCardWidthMetrics");function N5(e){if(e==null||e===""||e==="auto")return;let t=Number.parseInt(String(e),10);if(!(!Number.isFinite(t)||t<=0))return Math.max(1,Math.min(t,8))}a(N5,"getNormalizedGalleryGridColumns");function ck(e){if(e==null)return 0;let t=String(e).trim();return t&&t!=="\u2014"?t.length:0}a(ck,"getGalleryTextLength");function fl({column:e,row:t,getFieldValue:o,getDisplayText:r}){if(!e)return "";let n=o(e,t);if(n==null||n==="")return "";let i=r(n);return i==="\u2014"?"":String(i)}a(fl,"getGalleryFieldText");function qf({text:e,charsPerLine:t,maxLines:o}){let r=ck(e);return r?Math.max(1,Math.min(o,Math.ceil(r/t))):0}a(qf,"estimateLineCount");function R5({text:e,density:t,bentoColumns:o}){let r=t==="detailed"?54:t==="compact"?44:48,s=qf({text:e,charsPerLine:o===1?t==="detailed"?32:26:t==="detailed"?18:15,maxLines:t==="detailed"?3:2});return s?r+Math.max(0,s-1)*16:r}a(R5,"estimateGalleryDetailCellHeight");function M5({columns:e,density:t,bentoColumns:o}){if(!e.length)return 0;let r=e.map(i=>R5({text:i.text,density:t,bentoColumns:o}));if(o===1)return 12+r.reduce((i,s)=>i+s,0)+Math.max(0,e.length-1)*8;let n=12;for(let i=0;i<r.length;i+=o){let s=r.slice(i,i+o);n+=Math.max(...s),i+o<r.length&&(n+=8);}return n}a(M5,"estimateGalleryDetailGridHeight");function I5({row:e,columns:t,galleryFieldKey:o,galleryDensity:r,galleryBentoColumns:n,galleryDetailVisibility:i,galleryDetailLimit:s,getFieldValue:l,isMediaColumn:d,isTitleCandidate:c,isSummaryCandidate:p,getDisplayText:u,isImageField:g,isAudioField:f,cardVariant:b,renderPreview:x,renderLeadingVisual:y,hiddenDetailFieldKeys:k,layout:w,resolveRecordVisual:v}){let h=t.find(U=>U.renderType==="icon"),S=h&&v?v(e?.[h.key],e,h):null,C=(o!=="auto"?t.find(U=>U.key===o&&d(U,e)):null)||t.find(U=>d(U,e))||null,R=C?l(C,e):null,M=C?g(C,R):false,I=C?f(C,R):false,N=!!y||!!S,D=t.filter(U=>U.key!==C?.key&&U.renderType!=="icon"),P=D.filter(U=>{if(!U||d(U,e)||!c(U,e))return false;let X=l(U,e);return !(X==null||X==="")})[0]||null,W=P?fl({column:P,row:e,getFieldValue:l,getDisplayText:u}):String(u(e?.linkKey||e?.id||"")),H=D.find(U=>!U||U.key===P?.key||d(U,e)||!p(U,e)?false:fl({column:U,row:e,getFieldValue:l,getDisplayText:u}).length>12)||D.find(U=>!U||U.key===P?.key||d(U,e)||!p(U,e)?false:ck(fl({column:U,row:e,getFieldValue:l,getDisplayText:u}))>0)||null,B=H?fl({column:H,row:e,getFieldValue:l,getDisplayText:u}):"",L=new Set(k),F=D.filter(U=>U.key!==P?.key&&U.key!==H?.key&&!L.has(U.key)).map(U=>({column:U,text:fl({column:U,row:e,getFieldValue:l,getDisplayText:u})})),_=T5({density:r,visibility:i,limit:s}),$=Number.isFinite(_)?F.slice(0,_):F,G=Math.max(F.length-$.length,0),z=S5(n,r),re=w?.columnWidth||dk(r).ideal;if(b==="image-only")return {width:re,height:Math.round(re*1.25)};if(b==="preview-only")return {width:re,height:Math.round(re*.82)};let Z=r==="detailed"?84:r==="compact"?64:72;typeof x=="function"?Z+=r==="detailed"?188:r==="compact"?140:164:M?Z+=Math.round(re*(r==="detailed"?.72:.62))+12:I&&(Z+=92);let ae=qf({text:W,charsPerLine:r==="detailed"?26:24,maxLines:2})||1,ee=qf({text:B,charsPerLine:N?22:r==="detailed"?30:26,maxLines:r==="detailed"?4:2}),q=26+ae*18+(ee>0?ee*16+4:0);return Z+=Math.max(N?56:0,q),Z+=M5({columns:$,density:r,bentoColumns:z}),G>0&&(Z+=18),!B&&$.length===0&&(Z+=24),{width:re,height:Z}}a(I5,"getDefaultGalleryMasonryItemSize");function uk({rows:e=[],children:t,columns:o=[],onRowClick:r,cardInteraction:n="button",selectedLinkKey:i,selectedRowKey:s,selectedRowKeys:l,className:d,isMasonry:c=false,galleryLayoutMode:p="auto",galleryRailCardWidth:u,galleryGap:g,galleryScrollDirection:f,galleryGridColumns:b,galleryGridColumnsResponsive:x,galleryCardWidthMetrics:y,galleryCardAspectRatio:k,galleryCardMinHeight:w,galleryGridCardWidth:v,galleryUnderfilledBehavior:h,galleryMasonryColumnWidth:S,masonryPlacementStrategy:T,pagination:C,onLoadMore:R,scrollOwner:M,windowed:I,galleryFieldKey:A="auto",galleryDensity:N="comfortable",galleryBentoColumns:D=2,galleryDetailVisibility:E="limit",galleryDetailLimit:P,shouldEnhanceMultimodal:W=true,getFieldValue:H,isMediaColumn:B,isTitleCandidate:L,isSummaryCandidate:F,getDisplayText:_,renderFieldValue:$,getImagePreviewSrc:G,isImageField:z,isAudioField:re,AudioPlayerComponent:Z,cardVariant:ae="default",cardPresentation:ee,renderCardSlot:q,renderCoverTitle:U,galleryDetailPresentation:X,renderPreview:O,renderMeta:K,renderLeadingVisual:ne,resolveRecordVisual:fe,hiddenDetailFieldKeys:he=[],labels:me,formatLabel:ie,getMasonryItemSize:be}){let{min:He,ideal:We,max:Ke}=y??dk(N),ce=u||He,Q=N5(b),ge=k5(v),we=S||He,Ie=p==="rail",oe=H||qi,xe=_||ul,Ve=z||pl,_e=re||ml,Ge=B||((ue,Re)=>bu(ue,Re,{getFieldValue:oe,shouldEnhanceMultimodal:W,isImageField:Ve,isAudioField:_e})),le=L||((ue,Re)=>gu(ue,Re,{isMediaColumn:Ge})),Me=F||((ue,Re)=>hu(ue,Re,{isMediaColumn:Ge})),Ae=$||((ue,Re,{compact:se}={})=>jsxRuntime.jsx("span",{children:xe(oe(ue,Re))})),J=a((ue,Re)=>jsxRuntime.jsx(yu,{row:ue,columns:o,cardInteraction:n,onClick:r?()=>r(ue,Re):void 0,isSelected:l?l.has(String(ue?.linkKey||ue?.id||"")):String(ue?.linkKey||ue?.id||"")===String(s||i||""),isMasonry:c,galleryFieldKey:A,galleryDensity:N,galleryBentoColumns:D,galleryDetailVisibility:E,galleryDetailLimit:P,galleryDetailPresentation:X,shouldEnhanceMultimodal:W,getFieldValue:oe,isMediaColumn:Ge,isTitleCandidate:le,isSummaryCandidate:Me,getDisplayText:xe,renderFieldValue:Ae,getImagePreviewSrc:G,isImageField:Ve,isAudioField:_e,AudioPlayerComponent:Z,cardVariant:ae,cardPresentation:ee,renderCardSlot:q,renderCoverTitle:U,renderPreview:O,renderMeta:K,renderLeadingVisual:ne,resolveRecordVisual:fe,hiddenDetailFieldKeys:he,labels:me,formatLabel:ie},ue?.id||ue?.linkKey||Re),"renderGalleryCard"),$e=c?T==="dense"?"dense":"masonry":Ie?"rail":"grid";if(Kw($e,f),t!==void 0){let ue=ho.Children.toArray(t);return jsxRuntime.jsx(Sn,{items:ue,callbacks:{onLoadMore:R},slots:{loadMore:C?.loadingMore?jsxRuntime.jsx(Kr,{variant:"spinner",className:"py-global",style:{minHeight:0}}):void 0},classNames:{layout:d},config:{windowed:I,state:C,loading:{autoFill:true},getItemKey:a((Re,se)=>ho.isValidElement(Re)&&Re.key!=null?Re.key:se,"getItemKey"),layout:{mode:$e,scrollOwner:M??"parent",gap:g,columns:x??(Q?{mobile:1,tablet:Math.min(2,Q),desktop:Q}:"auto"),underfilledBehavior:h,cardWidth:Ie?ce:void 0,minCardWidth:ge??He,idealCardWidth:ge??We,maxCardWidth:ge??Ke}},renderItem:Re=>Re})}return jsxRuntime.jsx(Sn,{items:e,slots:{loadMore:C?.loadingMore?jsxRuntime.jsx(Kr,{variant:"spinner",className:"py-global",style:{minHeight:0}}):void 0},callbacks:{onLoadMore:R,onItemClick:n==="container"&&r?(ue,Re)=>r(ue,Re.index):void 0},classNames:{layout:d},config:{windowed:I,state:C,loading:{autoFill:true},getItemKey:a((ue,Re)=>ue?.id||ue?.linkKey||Re,"getItemKey"),layout:{mode:$e,underfilledBehavior:h,scrollOwner:M,gap:g,columns:x??(Q?{mobile:1,tablet:Math.min(2,Q),desktop:Q}:"auto"),cardWidth:Ie?ce:void 0,minCardWidth:ge??He,idealCardWidth:c?we:ge??We,maxCardWidth:ge??Ke,placementStrategy:T??(ae==="image-only"?"shortest":"shelf"),getItemAspectRatio:ae==="image-only"?ue=>{let Re=o.find(je=>je.key===A)??o.find(je=>Ge(je,ue)),se=Re?oe(Re,ue):void 0,te=se&&typeof se=="object"&&"aspectRatio"in se?se.aspectRatio:void 0;if(typeof te!="string"||!/^\d+(?:\.\d+)?:\d+(?:\.\d+)?$/.test(te))return;let[Te,ze]=te.split(":").map(Number);return Te>0&&ze>0?Te/ze:void 0}:void 0,getItemSize:ae==="image-only"&&k&&k>0?(ue,Re)=>({height:Math.max(w??0,Re.columnWidth/k)}):c?(ue,Re)=>{let se=I5({row:ue,columns:o,galleryFieldKey:A,galleryDensity:N,galleryBentoColumns:D,galleryDetailVisibility:E,galleryDetailLimit:P,getFieldValue:oe,isMediaColumn:Ge,isTitleCandidate:le,isSummaryCandidate:Me,getDisplayText:xe,isImageField:Ve,isAudioField:_e,cardVariant:ae,renderPreview:O,renderLeadingVisual:ne,hiddenDetailFieldKeys:he,layout:Re,resolveRecordVisual:fe});if(typeof be!="function")return se;let te=be(ue,{...Re,placementStrategy:Re.placementStrategy==="dense"?"dense":"shelf",defaultSize:se})||{};return {...se,...te}}:void 0}},renderItem:(ue,Re)=>J(ue,Re.index)})}a(uk,"WorkbenchGalleryView");function pk({layout:e="horizontal",mediaPosition:t="start",detailsSize:o="balanced",sizing:r="content",asidePosition:n="end",detailsVisible:i=true,heading:s,metadata:l,message:d,actions:c,media:p,toolbar:u,aside:g,secondary:f,children:b,className:x,...y}){let k=i&&(V(s)||V(l)||V(b)||V(d)||V(c)),w=e==="horizontal"&&V(p)&&k,v=r==="fill",h=V(f),S=w&&h,T=V(g)?jsxRuntime.jsx("div",{"data-record-part":"aside",className:"flex min-h-0 shrink-0 gap-global",children:g}):null;return jsxRuntime.jsxs("article",{...y,"data-monkeys-component":"record-view","data-record-layout":e,"data-record-sizing":r,className:m("@container flex min-h-0 min-w-0 flex-col gap-global font-[family-name:var(--font-sans)] text-sm leading-5 text-foreground",v&&"h-full",x),children:[V(u)&&jsxRuntime.jsx("div",{"data-record-part":"toolbar",className:"flex shrink-0 flex-wrap items-center gap-global",children:u}),jsxRuntime.jsxs("div",{className:m("flex min-h-0 min-w-0 gap-global",v&&"flex-1"),children:[n==="start"&&T,jsxRuntime.jsxs("div",{"data-record-part":"body",className:m("grid min-h-0 min-w-0 flex-1 grid-cols-1 gap-global",S?"@[48rem]:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_minmax(0,1fr)]":w&&(o==="balanced"?"@[48rem]:grid-cols-2":t==="start"?"@[48rem]:grid-cols-[minmax(0,1fr)_minmax(16rem,24rem)]":"@[48rem]:grid-cols-[minmax(16rem,24rem)_minmax(0,1fr)]"),v&&"overflow-auto @[48rem]:overflow-hidden"),children:[V(p)&&jsxRuntime.jsx("div",{"data-record-part":"media",className:m("min-h-0 min-w-0",t==="end"&&w&&"@[48rem]:order-2",v&&"flex flex-col"),children:p}),k&&jsxRuntime.jsxs("div",{"data-record-part":"details",className:m("flex min-h-0 min-w-0 flex-col [&>section]:flex-1",v&&"@[48rem]:overflow-auto"),children:[V(s)&&jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global",children:s}),V(l)&&jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global text-sm tabular-nums text-muted-foreground [&_span]:text-inherit [&_time]:text-inherit",children:l}),b,V(d)&&jsxRuntime.jsx("div",{className:"mt-global break-words text-sm text-destructive-text",children:d}),V(c)&&jsxRuntime.jsx("div",{className:"mt-auto flex shrink-0 flex-wrap gap-global pt-global",children:c})]}),h&&jsxRuntime.jsx("div",{"data-record-part":"secondary",className:m("flex min-h-0 min-w-0 flex-col [&>section]:flex-1",v&&"@[48rem]:overflow-auto"),children:f})]}),n==="end"&&T]})]})}a(pk,"RecordView");function mk(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}a(mk,"toCssSize");function O5(e,t){return String(e?.id??e?.key??t)}a(O5,"defaultGetRowId");function F5(e){return String(e?.columnId??e?.status??"")}a(F5,"defaultGetColumnId");function H5(e){let t=e?.title??e?.name??e?.id??"Untitled";return jsxRuntime.jsx("div",{className:"rounded-lg border border-border/70 bg-card px-3 py-2 text-sm text-foreground shadow-sm",children:String(t)})}a(H5,"defaultRenderCard");function V5({row:e,rowId:t,rowIndex:o,column:r,classNames:n,renderCard:i}){let{attributes:s,listeners:l,setNodeRef:d,isDragging:c}=core.useDraggable({id:t});return jsxRuntime.jsx("div",{ref:d,...l,...s,className:m("touch-none",n?.cardWrapper),children:i(e,{row:e,rowIndex:o,column:r,isDragging:c,isOverlay:false})})}a(V5,"WorkbenchLaneDraggableCard");function _5({column:e,columnRows:t,columnWidth:o,columnMinHeight:r,emptyColumn:n,classNames:i,renderCard:s}){let{setNodeRef:l,isOver:d}=core.useDroppable({id:e.id});return jsxRuntime.jsxs("section",{className:m("flex shrink-0 flex-col rounded-xl border border-border/60 bg-card p-2 shadow-sm",i?.column,e.className),style:{width:mk(o)??"280px"},children:[jsxRuntime.jsxs("div",{className:m("flex h-10 items-center gap-2 px-1",i?.columnHeader,e.headerClassName),children:[e.icon?jsxRuntime.jsx("span",{className:m("inline-flex h-4 w-4 items-center justify-center text-muted-foreground",i?.columnIcon,e.iconClassName),children:e.icon}):null,jsxRuntime.jsx("span",{className:m("inline-flex items-center rounded px-2 py-0.5 text-xs font-semibold bg-muted text-muted-foreground",i?.columnBadge,e.badgeClassName),children:e.label??e.id}),jsxRuntime.jsx("span",{className:m("text-xs text-muted-foreground",i?.columnCount),children:t.length})]}),jsxRuntime.jsx("div",{ref:l,className:m("mt-1 flex min-h-[200px] flex-1 flex-col gap-2 overflow-y-auto rounded-lg p-1 transition-colors [scrollbar-width:thin]",d&&"bg-accent/60",i?.columnBody,e.bodyClassName),style:{minHeight:mk(r)},children:t.length?t.map(({row:c,rowIndex:p,rowId:u})=>jsxRuntime.jsx(V5,{row:c,rowId:u,rowIndex:p,column:e,classNames:i,renderCard:s},u)):n?jsxRuntime.jsx("div",{className:m("flex min-h-24 items-center justify-center rounded-lg border border-dashed border-border/60 px-3 py-4 text-xs text-muted-foreground",i?.emptyColumn),children:n}):null})]})}a(_5,"WorkbenchLaneColumnView");function fk({rows:e=[],columns:t=[],getRowId:o=O5,getColumnId:r=F5,renderCard:n,renderOverlayCard:i,onMoveRow:s,onSelectRow:l,emptyColumn:d,activationDistance:c=5,columnWidth:p=280,columnMinHeight:u,className:g,classNames:f,style:b}){let x=n??((A,N)=>l?jsxRuntime.jsx(dt,{className:"w-full justify-start whitespace-normal text-left",onClick:()=>l({rowId:o(A,N.rowIndex)}),children:String(A?.title??A?.name??o(A,N.rowIndex))}):H5(A)),[y,k]=ho.useState(null),w=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:c}})),v=ho.useMemo(()=>new Map(t.map(A=>[A.id,A])),[t]),h=ho.useMemo(()=>e.map((A,N)=>({row:A,rowIndex:N,rowId:o(A,N),columnId:r(A,N)})),[r,o,e]),S=y?h.find(A=>A.rowId===y):void 0,T=ho.useMemo(()=>{let A=new Map;return t.forEach(N=>A.set(N.id,[])),h.forEach(({row:N,rowIndex:D,rowId:E,columnId:P})=>{A.get(P)?.push({row:N,rowIndex:D,rowId:E});}),A},[t,h]),C=S?v.get(S.columnId):void 0,R=ho.useCallback(A=>{k(String(A.active.id));},[]),M=ho.useCallback(A=>{k(null);let N=String(A.active.id),D=String(A.over?.id??""),E=h.find(P=>P.rowId===N);!E||!v.has(D)||E.columnId===D||s?.(N,D,E.row);},[v,s,h]),I=ho.useCallback(()=>{k(null);},[]);return jsxRuntime.jsxs(core.DndContext,{sensors:w,onDragStart:R,onDragEnd:M,onDragCancel:I,children:[jsxRuntime.jsx("div",{className:m("flex min-h-0 flex-1 gap-4 overflow-x-auto p-4 [scrollbar-width:thin]",f?.root,g),style:b,children:t.map(A=>jsxRuntime.jsx(_5,{column:A,columnRows:T.get(A.id)||[],columnWidth:p,columnMinHeight:u,emptyColumn:d,classNames:f,renderCard:x},A.id))}),jsxRuntime.jsx(core.DragOverlay,{children:S&&C?jsxRuntime.jsx("div",{className:m(f?.overlayWrapper),children:(i||x)(S.row,{row:S.row,rowIndex:S.rowIndex,column:C,isDragging:false,isOverlay:true})}):null})]})}a(fk,"WorkbenchLaneView");var bk=a(e=>{if(Number.isFinite(e))return Math.min(1,Math.max(0,Number(e)))},"normalizeProgress");function gk({items:e,summary:t,variant:o="bars",density:r="comfortable",emptyState:n=null,ariaLabel:i="Metrics",className:s,itemClassName:l}){if(!e.length)return V(n)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:n}):null;if(o==="radar"&&e.length>=3&&e.length<=12){let d=a((u,g)=>{let f=-Math.PI/2+u*Math.PI*2/e.length;return [180+Math.cos(f)*g,160+Math.sin(f)*g]},"point"),c=e.map((u,g)=>{let f=bk(u.progress);return f===void 0?void 0:d(g,f*100)}),p=c.every(Boolean);return jsxRuntime.jsxs("figure",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":"radar",className:m("m-0 min-w-0",s),children:[jsxRuntime.jsxs("svg",{viewBox:"0 0 360 320",role:"img","aria-label":t?`${i} \xB7 ${t.label} ${t.value}`:i,className:"mx-auto block w-full max-w-sm overflow-visible",children:[[.25,.5,.75,1].map(u=>jsxRuntime.jsx("polygon",{points:e.map((g,f)=>d(f,u*100).join(",")).join(" "),fill:"none",stroke:"hsl(var(--border))"},u)),e.map((u,g)=>{let f=d(g,100),b=d(g,131);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:"180",y1:"160",x2:f[0],y2:f[1],stroke:"hsl(var(--border))"}),typeof u.label=="string"||typeof u.label=="number"?jsxRuntime.jsx("text",{x:b[0],y:b[1]-7,textAnchor:"middle",dominantBaseline:"middle",fontSize:"12",fill:"hsl(var(--muted-foreground))",children:u.label}):null,typeof u.value=="string"||typeof u.value=="number"?jsxRuntime.jsx("text",{"data-metric-axis-value":u.id,x:b[0],y:b[1]+10,textAnchor:"middle",dominantBaseline:"middle",fontSize:"13",fontWeight:"600",fill:"hsl(var(--foreground))",children:u.value}):null]},u.id)}),p?jsxRuntime.jsx("polygon",{"data-metric-radar-series":"complete",points:c.map(u=>u.join(",")).join(" "),fill:"hsl(var(--primary) / .18)",stroke:"hsl(var(--primary))",strokeWidth:"2.5"}):c.map((u,g)=>{let f=c[(g+1)%c.length];return u&&f?jsxRuntime.jsx("line",{"data-metric-radar-series":"partial",x1:u[0],y1:u[1],x2:f[0],y2:f[1],stroke:"hsl(var(--primary))",strokeWidth:"2.5"},e[g].id):null}),c.map((u,g)=>u?jsxRuntime.jsx("circle",{cx:u[0],cy:u[1],r:"3",fill:"hsl(var(--primary))"},e[g].id):null),t?jsxRuntime.jsxs("g",{"data-metric-radar-summary":"true",textAnchor:"middle",paintOrder:"stroke",stroke:"hsl(var(--card))",strokeWidth:"3",strokeLinejoin:"round",children:[jsxRuntime.jsx("text",{x:"180",y:"149",fontSize:"12",fill:"hsl(var(--muted-foreground))",children:t.label}),jsxRuntime.jsx("text",{x:"180",y:"174",fontSize:"23",fontWeight:"700",fill:"hsl(var(--foreground))",children:t.value})]}):null]}),jsxRuntime.jsx("dl",{className:"sr-only",children:e.map(u=>jsxRuntime.jsxs("div",{className:m("flex min-w-0 justify-between gap-2",l),children:[jsxRuntime.jsx("dt",{className:"truncate text-muted-foreground",children:u.label}),jsxRuntime.jsx("dd",{className:"font-semibold tabular-nums",children:u.value})]},u.id))})]})}return o==="list"?jsxRuntime.jsx("dl",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":o,"data-metric-density":r,className:m("grid min-w-0",r==="compact"?"gap-2":"gap-3",s),children:e.map(d=>jsxRuntime.jsxs("div",{className:m("flex min-w-0 items-start justify-between gap-4",r==="compact"?"text-xs":"text-sm",l),children:[jsxRuntime.jsxs("dt",{className:"min-w-0 text-muted-foreground",children:[jsxRuntime.jsx("span",{className:"block truncate",children:d.label}),V(d.description)?jsxRuntime.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-muted-foreground/80",children:d.description}):null]}),jsxRuntime.jsx("dd",{className:"shrink-0 font-semibold tabular-nums text-foreground",children:d.value})]},d.id))}):o==="cards"?jsxRuntime.jsx("dl",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":o,"data-metric-density":r,className:m("grid min-w-0 [grid-template-columns:repeat(auto-fit,minmax(9rem,1fr))]",r==="compact"?"gap-2":"gap-3",s),children:e.map(d=>jsxRuntime.jsxs("div",{className:m("min-w-0 rounded-lg border border-border/70 bg-card text-card-foreground",r==="compact"?"p-3":"p-4",l),children:[jsxRuntime.jsx("dt",{className:"truncate text-xs font-medium text-muted-foreground",children:d.label}),jsxRuntime.jsx("dd",{className:m("font-semibold tabular-nums text-foreground",r==="compact"?"mt-1.5 text-xl":"mt-2 text-2xl"),children:d.value}),V(d.description)?jsxRuntime.jsx("div",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:d.description}):null]},d.id))}):jsxRuntime.jsx("dl",{"aria-label":i,"data-monkeys-component":"workbench-metric-grid","data-metric-variant":o,"data-metric-density":r,className:m("grid min-w-0 [grid-template-columns:repeat(auto-fit,minmax(5.5rem,1fr))]",r==="compact"?"gap-2":"gap-3",s),children:e.map(d=>{let c=bk(d.progress);return jsxRuntime.jsxs("div",{className:m("min-w-0",l),children:[jsxRuntime.jsx("div",{role:c===void 0?void 0:"meter","aria-label":c===void 0?void 0:String(d.label),"aria-valuemin":c===void 0?void 0:0,"aria-valuemax":c===void 0?void 0:100,"aria-valuenow":c===void 0?void 0:Math.round(c*100),className:m("overflow-hidden rounded-full bg-muted",r==="compact"?"h-1.5":"h-2"),children:c===void 0?null:jsxRuntime.jsx("span",{className:"block h-full rounded-full bg-primary transition-[width] duration-200 motion-reduce:transition-none",style:{width:`${Math.max(c>0?4:0,c*100)}%`}})}),jsxRuntime.jsxs("div",{className:"mt-1.5 flex min-w-0 items-baseline justify-between gap-2",children:[jsxRuntime.jsx("dt",{className:"truncate text-xs text-muted-foreground",children:d.label}),jsxRuntime.jsx("dd",{className:"shrink-0 text-xs font-semibold tabular-nums text-foreground",children:d.value})]})]},d.id)})})}a(gk,"WorkbenchMetricGrid");var hk=Math.PI*(3-Math.sqrt(5)),yk=a(e=>Array.from(e).reduce((t,o)=>Math.imul(t^o.charCodeAt(0),16777619)>>>0,2166136261),"hash");function Du(e,t){let o=new Set(e.map(v=>v.id)),r=new Map,n=new Set,i=new Map(e.map(v=>[v.id,new Set])),s=t.filter(v=>o.has(v.sourceId)&&o.has(v.targetId));for(let v of s){let h=r.get(v.sourceId)??[];h.includes(v.targetId)||h.push(v.targetId),r.set(v.sourceId,h),n.add(v.targetId),i.get(v.sourceId).add(v.targetId),i.get(v.targetId).add(v.sourceId);}let d=e.filter(v=>!n.has(v.id))[0]?.id??e[0]?.id,c=new Map,p=d?[d]:[];d&&c.set(d,{depth:0,branch:d,cluster:d});for(let v=0;v<p.length;v++){let h=p[v],S=c.get(h);for(let T of r.get(h)??[])c.has(T)||(c.set(T,{depth:S.depth+1,branch:S.depth===0?T:S.branch,cluster:S.depth<2?T:S.cluster}),p.push(T));}for(let v of e)c.has(v.id)||c.set(v.id,{depth:1,branch:v.id,cluster:v.id});let u=[...new Set([...c.values()].filter(v=>v.depth>0).map(v=>v.branch))],g=new Map;for(let[v,h]of c){if(h.depth<2)continue;let S=g.get(h.cluster)??[];S.push(v),g.set(h.cluster,S);}let f=u.map(v=>Math.sqrt([...c.values()].filter(h=>h.branch===v).length+8)),b=f.reduce((v,h)=>v+h,0)||1,x=-Math.PI/2,y=new Map;u.forEach((v,h)=>{let S=Math.PI*2*f[h]/b,T=x+S/2;y.set(v,{x:Math.cos(T)*12,y:Math.sin(T)*10,z:Math.sin(T*2)*3.2,angle:T}),x+=S;});let k=new Map;for(let v of u){let h=y.get(v),S=[...g.keys()].filter(T=>c.get(T)?.branch===v);S.forEach((T,C)=>{let R=S.length>1?Math.max(3,Math.sqrt(S.length)*1.7):1.5,M=C*hk+h.angle;k.set(T,{x:h.x+Math.cos(M)*R,y:h.y+Math.sin(M)*R,z:h.z+Math.sin(M)*2.5});});}let w=e.map(v=>{let h=c.get(v.id),S=h.depth<2?y.get(h.branch):k.get(h.cluster);if(h.depth===0||!S)return {...v,...h,x:0,y:0,z:0};if(h.depth===1)return {...v,...h,x:S.x*.76,y:S.y*.76,z:S.z};let C=g.get(h.cluster).indexOf(v.id),R=h.depth===2?0:1.5+Math.sqrt(C)*.72,M=C*hk+yk(h.cluster)%360*Math.PI/180;return {...v,...h,x:S.x+Math.cos(M)*R,y:S.y+Math.sin(M)*R*.85,z:S.z+Math.sin(M*1.37)*Math.min(R,3.5)}});for(let v=0;v<30;v++)for(let h=0;h<w.length;h++)for(let S=h+1;S<w.length;S++){let T=w[h],C=w[S],R=C.x-T.x,M=C.y-T.y,I=Math.hypot(R,M),A=T.depth<3||C.depth<3?1.4:.85;if(I>=A)continue;let N=yk(T.id+C.id)%360*Math.PI/180,D=I>.001?R/I:Math.cos(N),E=I>.001?M/I:Math.sin(N),P=(A-I)*.25;T.depth>0&&(T.x-=D*P,T.y-=E*P),C.depth>0&&(C.x+=D*P,C.y+=E*P);}if(w.length)for(let v of ["x","y","z"]){let h=(Math.min(...w.map(S=>S[v]))+Math.max(...w.map(S=>S[v])))/2;w.forEach(S=>{S[v]-=h;});}return {points:w,links:s,neighbors:i,root:d}}a(Du,"buildRelationshipGalaxyLayout");function vk({nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:n,className:i}){let s=Ye(),l=ho.useRef(null),d=ho.useRef(new Map),c=ho.useRef(o),p=ho.useRef(r),[u,g]=ho.useState(false),f=JSON.stringify([e,t]),b=ho.useMemo(()=>Du(e,t),[f]);return c.current=o,p.current=r,ho.useEffect(()=>{let x=l.current;if(!x)return;let y=false,k=a(()=>{},"cleanup");return g(false),Promise.all([import('three'),import('three/examples/jsm/controls/OrbitControls.js')]).then(([w,{OrbitControls:v}])=>{if(y)return;let h=[],S=new w.Scene,T=getComputedStyle(x),C=a((ie,be)=>{let He=document.createElement("span");He.style.color=`hsl(${T.getPropertyValue(ie).trim()||T.getPropertyValue(be).trim()})`,x.append(He);let We=new w.Color(getComputedStyle(He).color);return He.remove(),We},"tokenColor"),R=C("--radar-canvas","--background");S.background=R;let M=new w.PerspectiveCamera(48,1,.1,250),I=new w.WebGLRenderer({antialias:true,alpha:false});I.setPixelRatio(Math.min(devicePixelRatio,2)),I.domElement.style.cssText="position:absolute;inset:0;width:100%;height:100%;touch-action:none",I.domElement.setAttribute("aria-hidden","true"),x.prepend(I.domElement);let A=new v(M,I.domElement);A.enableDamping=true,A.dampingFactor=.08,A.rotateSpeed=.45,A.minDistance=8,A.maxDistance=130,A.autoRotate=false;let N=new Map(b.points.map(ie=>[ie.id,new w.Vector3(ie.x,ie.y,ie.z)])),D={primary:C("--radar-series-one","--primary"),secondary:C("--radar-series-two","--success"),accent:C("--radar-series-three","--warning"),muted:C("--radar-series-four","--muted-foreground")},E=128,P=new Uint8Array(E*E*4);for(let ie=0;ie<E;ie++)for(let be=0;be<E;be++){let He=Math.hypot(be+.5-E/2,ie+.5-E/2)/(E/2),We=He<.09?1:Math.exp(-He*7.5)*.85;P.set([255,255,255,Math.round(We*255)],(ie*E+be)*4);}let W=new w.DataTexture(P,E,E,w.RGBAFormat);W.minFilter=W.magFilter=w.LinearFilter,W.needsUpdate=true,h.push(W);let H=b.points.map(ie=>{let be=new w.SpriteMaterial({map:W,color:D[ie.tone??"primary"],transparent:true,blending:w.AdditiveBlending,depthWrite:false}),He=new w.Sprite(be);return He.position.copy(N.get(ie.id)),S.add(He),h.push(be),He}),B=new w.BufferGeometry;B.setAttribute("position",new w.Float32BufferAttribute(b.links.flatMap(ie=>[...N.get(ie.sourceId).toArray(),...N.get(ie.targetId).toArray()]),3));let L=new Float32Array(b.links.length*6);B.setAttribute("color",new w.BufferAttribute(L,3));let F=new w.LineBasicMaterial({vertexColors:true,transparent:true,opacity:.5,depthWrite:false});S.add(new w.LineSegments(B,F)),h.push(B,F);let _=new Map;b.points.filter(ie=>ie.depth>0).forEach(ie=>{let be=_.get(ie.cluster)??[];be.push(ie),_.set(ie.cluster,be);});for(let ie of _.values()){if(ie.length<3)continue;let be=ie.reduce((Ke,ce)=>Ke.add(N.get(ce.id)),new w.Vector3).multiplyScalar(1/ie.length),He=new w.SpriteMaterial({map:W,color:D[ie[0].tone??"primary"],transparent:true,opacity:.13,blending:w.AdditiveBlending,depthWrite:false}),We=new w.Sprite(He);We.position.copy(be),We.position.z-=1,We.scale.setScalar(8+Math.sqrt(ie.length)*1.2),S.add(We),h.push(He);}let $=Math.max(8,...b.points.map(ie=>Math.abs(ie.x)))+3,G=Math.max(6,...b.points.map(ie=>Math.abs(ie.y)))+3,z=55,re=false,Z=new ResizeObserver(()=>{let{width:ie,height:be}=x.getBoundingClientRect();if(!ie||!be)return;M.aspect=ie/be;let He=Math.max(G,$/M.aspect)/Math.tan(w.MathUtils.degToRad(M.fov/2))+7;re?M.position.sub(A.target).multiplyScalar(He/z).add(A.target):(M.position.set(0,0,He),re=true),z=He,A.update(),M.updateProjectionMatrix(),I.setSize(ie,be,false);});Z.observe(x);let ae=new w.Vector3,ee=new w.Vector2,q={x:0,y:0},U,X,O=a(ie=>{let be=I.domElement.getBoundingClientRect();ee.set(ie.clientX-be.left,ie.clientY-be.top);let He,We=12;for(let Ke of b.points){if(ae.copy(N.get(Ke.id)).project(M),ae.z<-1||ae.z>1)continue;let ce=Math.hypot((ae.x+1)*be.width/2-ee.x,(-ae.y+1)*be.height/2-ee.y);ce<We&&(We=ce,He=Ke);}return He},"nodeAt"),K=a(ie=>{q={x:ie.clientX,y:ie.clientY};},"pointerDown"),ne=a(ie=>{U=O(ie)?.id,I.domElement.style.cursor=U?"pointer":"grab";},"pointerMove"),fe=a(()=>{U=void 0;},"pointerLeave"),he=a(ie=>{if(Math.hypot(ie.clientX-q.x,ie.clientY-q.y)>5)return;let be=O(ie);be&&p.current?.(be);},"pointerUp");I.domElement.addEventListener("pointerdown",K),I.domElement.addEventListener("pointermove",ne),I.domElement.addEventListener("pointerleave",fe),I.domElement.addEventListener("pointerup",he);let me=[...b.points].sort((ie,be)=>ie.depth-be.depth||(b.neighbors.get(be.id)?.size??0)-(b.neighbors.get(ie.id)?.size??0));I.setAnimationLoop(()=>{A.update();let ie=c.current,be=ie?b.neighbors.get(ie):void 0;(X!==ie||!B.userData.initialized)&&(X=ie,B.userData.initialized=true,b.links.forEach((ge,we)=>{let Ie=ge.sourceId===ie||ge.targetId===ie,oe=b.points.find(Ve=>Ve.id===ge.targetId),xe=D[oe.tone??"primary"].clone().multiplyScalar(ie?Ie?1.35:.12:.45);L.set([...xe.toArray(),...xe.toArray()],we*6);}),B.attributes.color.needsUpdate=true),H.forEach((ge,we)=>{let Ie=b.points[we],oe=ie===Ie.id;ge.scale.setScalar((Ie.depth===0?2.2:Ie.depth===1?1.8:Ie.depth===2?1.2:.82)*(oe?1.5:1)),ge.material.opacity=!ie||oe||be?.has(Ie.id)?1:.25;});let He=x.clientWidth,We=x.clientHeight,Ke=z/M.position.distanceTo(A.target),ce=[],Q=[...me].sort((ge,we)=>+(we.id===ie||we.id===U)-+(ge.id===ie||ge.id===U));for(let ge of Q){let we=d.current.get(ge.id);if(!we)continue;let Ie=ge.id===ie,oe=ge.id===U,xe=be?.has(ge.id);ae.copy(N.get(ge.id)).project(M);let Ve=(ae.x+1)*He/2,_e=(-ae.y+1)*We/2+10,Ge={x:Ve-Math.min(ge.label.length*13,170)/2,y:_e,width:Math.min(ge.label.length*13,170),height:21},le=ae.z>-1&&ae.z<1&&Ge.x>4&&Ge.x+Ge.width<He-4&&_e>4&&_e+21<We-4,Me=Ie||oe||xe||ge.depth<=2||Ke>1.65,Ae=ce.some($e=>Ge.x<$e.x+$e.width+8&&Ge.x+Ge.width+8>$e.x&&Ge.y<$e.y+$e.height+5&&Ge.y+Ge.height+5>$e.y),J=le&&Me&&(Ie||oe||!Ae)&&(!ie||Ie||oe||xe||ge.depth<2);we.style.display=J?"block":"none",we.tabIndex=J?0:-1,we.style.transform=`translate(${Ve}px,${_e}px) translate(-50%,0)`,we.style.color="#"+D[ge.tone??"primary"].clone().lerp(D.primary,.45).getHexString(),we.style.opacity=ie&&!Ie&&!xe&&!oe?"0.45":"1",we.style.fontWeight=ge.depth<2||Ie?"var(--monkeys-semantic-font-weight-semibold, 600)":"var(--monkeys-semantic-font-weight-normal, 400)",we.style.zIndex=Ie||oe?"2":"1",J&&ce.push(Ge);}I.render(S,M);}),k=a(()=>{I.domElement.removeEventListener("pointerdown",K),I.domElement.removeEventListener("pointermove",ne),I.domElement.removeEventListener("pointerleave",fe),I.domElement.removeEventListener("pointerup",he),Z.disconnect(),I.setAnimationLoop(null),A.dispose(),h.forEach(ie=>ie.dispose()),I.dispose(),I.domElement.remove();},"cleanup");}).catch(()=>{y||g(true);}),()=>{y=true,k();}},[b]),jsxRuntime.jsxs("div",{ref:l,className:i,role:"group","aria-label":n,"data-monkeys-component":"relationship-galaxy",style:{position:"relative",width:"100%",height:"100%",minHeight:400,overflow:"hidden",background:"hsl(var(--radar-canvas, var(--background)))"},children:[e.map(x=>jsxRuntime.jsx("button",{ref:y=>{y?d.current.set(x.id,y):d.current.delete(x.id);},"aria-pressed":o===x.id,className:"font-sans text-xs",title:x.meta,onClick:()=>p.current?.(x),style:{display:"none",position:"absolute",left:0,top:0,maxWidth:170,border:0,background:"transparent",padding:"calc(var(--global-spacing, 0.75rem) / 6)",cursor:"pointer",textShadow:"0 1px 4px hsl(var(--radar-canvas, var(--foreground)))",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:x.label},x.id)),u&&jsxRuntime.jsx("div",{role:"alert",className:"absolute inset-0 grid place-items-center bg-background text-foreground",children:s.workbench.collection.loadError})]})}a(vk,"RelationshipGalaxy");var es={physics:{repulsion:18e3,linkDistance:100,weakLinkDistance:280,linkStrength:.014,strongLinkStrength:.025,centerStrength:.0015,velocityRetention:.72,maxVelocity:35,collisionPadding:18,collisionPasses:2,cooling:.975,minAlpha:.002,ticksPerFrame:2},nodes:{fontSize:13,iconSize:16,showIcons:true,showLabels:true,focusScale:1.08,borderRadius:999,glow:true,contextOpacity:null},edges:{visible:true,curved:true,widthScale:1,opacityScale:1,glow:true,color:null},interaction:{pan:true,zoom:true,dragNodes:true,keyboard:true,openNodes:true,dragThreshold:4,keyboardStep:15,keyboardFastStep:50},viewport:{minZoom:.08,maxZoom:8,fitMaxZoom:2,fitPadding:60,screenPadding:50,zoomSensitivity:.0012,zoomStep:180,fitOnResize:true},ui:{controls:true,minimap:true,minimapWidth:156,minimapHeight:108,dock:"bottom-left"}};for(let e of Object.values(es))Object.freeze(e);Object.freeze(es);var wk={repulsion:[0,1e6],linkDistance:[0,2e3],weakLinkDistance:[0,3e3],linkStrength:[0,.2],strongLinkStrength:[0,.2],centerStrength:[0,.1],velocityRetention:[0,.99],maxVelocity:[1,100],collisionPadding:[0,200],collisionPasses:[0,8],cooling:[.5,.995],minAlpha:[.001,.1],ticksPerFrame:[1,10],fontSize:[8,48],iconSize:[8,64],focusScale:[.5,2],borderRadius:[0,999],contextOpacity:[0,1],widthScale:[0,8],opacityScale:[0,5],dragThreshold:[0,30],keyboardStep:[1,200],keyboardFastStep:[1,500],minZoom:[.01,20],maxZoom:[.01,20],fitMaxZoom:[.01,20],fitPadding:[0,500],screenPadding:[0,300],zoomSensitivity:[1e-4,.01],zoomStep:[1,1e3],minimapWidth:[140,360],minimapHeight:[60,300]},kk=new Set(["collisionPasses","ticksPerFrame"]),Ck=a(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"record");function bl(e={}){if(!Ck(e))throw new Error("config must be an object");let t=structuredClone(es);for(let[o,r]of Object.entries(e)){if(!Object.prototype.hasOwnProperty.call(t,o))throw new Error(`Unknown config group: ${o}`);if(!Ck(r))throw new Error(`config.${o} must be an object`);let n=t[o];for(let[i,s]of Object.entries(r)){let l=`config.${o}.${i}`;if(!Object.prototype.hasOwnProperty.call(n,i))throw new Error(`Unknown field: ${l}`);if((i==="contextOpacity"||i==="color")&&s===null){n[i]=null;continue}if(i==="dock"){if(typeof s!="string"||!["bottom-left","bottom-right","top-left","top-right"].includes(s))throw new Error(`${l} must be a supported corner`)}else if(i==="color"){if(typeof s!="string"||!/^#[\da-f]{6}$/i.test(s))throw new Error(`${l} must be a #RRGGBB color or null`)}else if(wk[i]){let[d,c]=wk[i];if(typeof s!="number"||!Number.isFinite(s)||s<d||s>c||kk.has(i)&&!Number.isInteger(s))throw new Error(`${l} must be ${kk.has(i)?"an integer":"a number"} in [${d}, ${c}]`)}else if(typeof s!="boolean")throw new Error(`${l} must be a boolean`);n[i]=s;}}if(t.viewport.minZoom>t.viewport.maxZoom)throw new Error("config.viewport.minZoom must not exceed maxZoom");return t}a(bl,"resolveRelationshipGraphConfig");var Zf=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp");function Eu(e,t,o={}){let r=bl({physics:o.physics??{}}).physics,n=[...e].sort((u,g)=>u.id.localeCompare(g.id,"en")).map((u,g)=>({...u,x:Number.isFinite(u.x)?u.x:Math.cos(g*2.39996)*100,y:Number.isFinite(u.y)?u.y:Math.sin(g*2.39996)*100,vx:0,vy:0,...o.fixedNodes?.has(u.id)?{fx:o.fixedNodes.get(u.id).x,fy:o.fixedNodes.get(u.id).y}:{}})),i=new Map(n.map(u=>[u.id,u])),s=t.flatMap(u=>{let g=i.get(u.sourceId),f=i.get(u.targetId);if(!g||!f||g===f)return [];let b=Number.isFinite(u.associationStrength)?Zf(u.associationStrength,0,1):0;return [{source:g,target:f,strength:b,distance:(g.width+f.width)/2+(r.linkDistance+(1-b)*r.weakLinkDistance)}]}).sort((u,g)=>`${u.source.id}:${u.target.id}`.localeCompare(`${g.source.id}:${g.target.id}`,"en")),l=o.center??{x:3800,y:2800},d=n.length?1:0,c=0;function p(u=1){for(let g=0;g<u&&d>0;g++){for(let f=0;f<n.length;f++)for(let b=f+1;b<n.length;b++){let x=n[f],y=n[b],k=y.x-x.x,w=y.y-x.y;if(Math.abs(k)+Math.abs(w)<.01){let C=(f+b+1)*2.39996;k=Math.cos(C),w=Math.sin(C);}let v=Math.max(1,Math.hypot(k,w)),h=Math.min(8,r.repulsion/Math.max(2500,v*v))*d,S=k/v*h,T=w/v*h;x.vx-=S,x.vy-=T,y.vx+=S,y.vy+=T;}for(let{source:f,target:b,strength:x,distance:y}of s){let k=b.x-f.x,w=b.y-f.y,v=Math.max(1,Math.hypot(k,w)),h=(v-y)*(r.linkStrength+x*r.strongLinkStrength)*d,S=k/v*h,T=w/v*h;f.vx+=S,f.vy+=T,b.vx-=S,b.vy-=T;}c=0;for(let f of n)f.vx=Zf((f.vx+(l.x-f.x)*r.centerStrength*d)*r.velocityRetention,-r.maxVelocity,r.maxVelocity),f.vy=Zf((f.vy+(l.y-f.y)*r.centerStrength*d)*r.velocityRetention,-r.maxVelocity,r.maxVelocity),f.fx!==void 0&&f.fy!==void 0?(f.x=f.fx,f.y=f.fy,f.vx=f.vy=0):(f.x+=f.vx,f.y+=f.vy,c+=f.vx*f.vx+f.vy*f.vy);for(let f=0;f<r.collisionPasses;f++)for(let b=0;b<n.length;b++)for(let x=b+1;x<n.length;x++){let y=n[b],k=n[x],w=k.x-y.x,v=k.y-y.y,h=(y.width+k.width)/2+r.collisionPadding-Math.abs(w),S=(y.height+k.height)/2+r.collisionPadding-Math.abs(v);if(h<=0||S<=0)continue;let T=y.fx===void 0,C=k.fx===void 0,R=Number(T)+Number(C);if(R)if(h<S){let M=Math.sign(w||1)*h/R;T&&(y.x-=M),C&&(k.x+=M);}else {let M=Math.sign(v||1)*S/R;T&&(y.y-=M),C&&(k.y+=M);}}d*=r.cooling,d<r.minAlpha&&(d=0);}return d>0}return a(p,"step"),{step:p,get active(){return d>0},get energy(){return c},positions:a(()=>new Map(n.map(({id:u,x:g,y:f})=>[u,{x:g,y:f}])),"positions"),reheat(){n.length&&(d=Math.max(d,.65));},pin(u,g,f){let b=i.get(u);!b||!Number.isFinite(g)||!Number.isFinite(f)||(b.x=b.fx=g,b.y=b.fy=f,b.vx=b.vy=0,d=Math.max(d,.65));},release(u){let g=i.get(u);if(!g)return;let f=o.fixedNodes?.get(u);g.fx=f?.x,g.fy=f?.y,d=Math.max(d,.65);}}}a(Eu,"createForceSimulation");var q5=a((e,t,o,r={})=>{let n=[...e].sort((d,c)=>d.id.localeCompare(c.id,"en")),i=new Map;for(let d of t)i.set(d.sourceId,(i.get(d.sourceId)??0)+1),i.set(d.targetId,(i.get(d.targetId)??0)+1);let s=n.map((d,c)=>{let p=c*Math.PI*(3-Math.sqrt(5)),u=d.role==="focus"?0:130*Math.sqrt(c+1);return {...d,x:3800+Math.cos(p)*u,y:2800+Math.sin(p)*u}}),l=Eu(s,t,r);return l.step(Math.max(1,Math.min(1e3,Number.isFinite(o)?Math.floor(o):280))),new Map([...l.positions()].map(([d,c])=>[d,{...c,degree:i.get(d)??0}]))},"layoutTrendRadarFocusTopology"),Au=a((e,t)=>{if(!e.length)return {x:0,y:0,width:2,height:2};let o=Math.min(...e.map(s=>s.x-s.width/2))-t,r=Math.max(...e.map(s=>s.x+s.width/2))+t,n=Math.min(...e.map(s=>s.y-s.height/2))-t,i=Math.max(...e.map(s=>s.y+s.height/2))+t;return {x:o,y:n,width:Math.max(2,r-o),height:Math.max(2,i-n)}},"calculateTrendRadarFocusTopologyBounds");var Dr={x:0,y:0,width:7600,height:5600};var Y5=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp");var Sk=a(e=>{let t=Number.isFinite(e)?Y5(e,0,1):0,o=.8+Math.pow(t,1.35)*7.2;return {strokeWidth:o,strokeOpacity:.26+t*.7,glowWidth:o+3+t*7,glowOpacity:t<.28?.02:.04+t*.14}},"getTrendRadarFocusTopologyFocusEdgeStyle"),Bu=a((e,t="dark")=>{let o=a((l,d,c)=>`color-mix(in srgb, ${d} ${c}%, ${l})`,"mix"),r=e.role==="context",n=e.role==="focus",i=o("hsl(var(--monkeys-color-background))",e.solidColor,t==="light"?n?16:r?4:10:n?48:40),s=t==="light"?o(r?"hsl(var(--monkeys-color-muted-foreground))":"hsl(var(--monkeys-color-foreground))",e.solidColor,r?10:38):o(e.color,"hsl(var(--monkeys-color-foreground))",n?45:34);return {background:i,foreground:s,border:o(i,s,n?82:67)}},"getTrendRadarFocusTopologyNodeTone"),X5=a((e,t)=>{let o=t.x-e.x,r=t.y-e.y,n=Math.max(Math.hypot(o,r),1),i=Math.min(72,Math.max(18,n*.13)),s=e.id.localeCompare(t.id)>=0?1:-1;return {x:(e.x+t.x)/2+r/n*i*s,y:(e.y+t.y)/2-o/n*i*s}},"getTrendRadarFocusTopologyEdgeControlPoint"),Tk=a((e,t)=>{let o=X5(e,t);return `M ${e.x} ${e.y} Q ${o.x} ${o.y} ${t.x} ${t.y}`},"getTrendRadarFocusTopologyEdgePath");var fL={"align-justify":lucideReact.AlignJustify,grid:lucideReact.Grid3X3,layers:lucideReact.Layers,"map-pin":lucideReact.MapPin,mountain:lucideReact.Mountain,package:lucideReact.Package,paintbrush:lucideReact.Paintbrush,palette:lucideReact.Palette,scissors:lucideReact.Scissors,shield:lucideReact.Shield,"shield-check":lucideReact.ShieldCheck,shirt:lucideReact.Shirt,snowflake:lucideReact.Snowflake,sparkles:lucideReact.Sparkles,user:lucideReact.UserRound,users:lucideReact.UsersRound},bL=a((e,t)=>{if(e.role!=="focus")return "var(--trend-radar-muted-color)";let o=Math.pow(e.associationStrength,1.2)*86;return `color-mix(in srgb, var(--trend-radar-muted-color), ${t.color} ${o}%)`},"edgeStroke");function Rk({model:e,config:t=es,onOpenNode:o,renderNodeAction:r,relationshipLabel:n,colorMode:i="dark",onNodePointerDown:s,onNodeKeyDown:l}){let d=a((u,g)=>t.edges.curved?Tk(u,g):`M ${u.x} ${u.y} L ${g.x} ${g.y}`,"edgePath"),c=ho.useId().replace(/:/g,""),p=ho.useMemo(()=>new Map(e.nodes.map(u=>[u.id,u])),[e.nodes]);return jsxRuntime.jsxs("div",{className:"trend-radar-focus-topology-background pointer-events-none relative size-full overflow-visible","data-radar-focus-topology-surface":"true","data-radar-focus-topology-color-mode":i,children:[t.edges.visible&&jsxRuntime.jsxs("svg",{viewBox:`0 0 ${Dr.width} ${Dr.height}`,className:"absolute inset-0 size-full overflow-visible","aria-hidden":"true",children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("filter",{id:c,x:"-40%",y:"-40%",width:"180%",height:"180%",children:jsxRuntime.jsx("feGaussianBlur",{stdDeviation:"7"})})}),jsxRuntime.jsx("g",{"data-radar-focus-topology-edge-layer":"context",children:e.edges.filter(u=>u.role!=="focus").map(u=>{let g=p.get(u.sourceId),f=p.get(u.targetId);return !g||!f?null:jsxRuntime.jsx("path",{d:d(g,f),fill:"none",stroke:t.edges.color??"var(--trend-radar-muted-color)",strokeWidth:Math.max(.8,.72+Math.pow(u.associationStrength,1.08)*2.2)*t.edges.widthScale,strokeOpacity:Math.min(1,(u.role==="related"?.12:.045)*t.edges.opacityScale),strokeLinecap:"round",strokeLinejoin:"round"},u.id)})}),jsxRuntime.jsx("g",{"data-radar-focus-topology-edge-layer":"focus",children:e.edges.filter(u=>u.role==="focus").map(u=>{let g=p.get(u.sourceId),f=p.get(u.targetId);if(!g||!f)return null;let b=d(g,f),x=t.edges.color??bL(u,g.id===e.subjectId?f:g),y=Sk(u.associationStrength);return jsxRuntime.jsxs("g",{"data-radar-focus-topology-focus-edge":u.id,"data-radar-focus-topology-association-strength":u.associationStrength.toFixed(4),children:[jsxRuntime.jsx("path",{d:b,fill:"none",stroke:x,strokeWidth:y.glowWidth*t.edges.widthScale,strokeOpacity:t.edges.glow?Math.min(1,y.glowOpacity*t.edges.opacityScale):0,strokeLinecap:"round",filter:`url(#${c})`}),jsxRuntime.jsx("path",{d:b,fill:"none",stroke:x,strokeWidth:y.strokeWidth*t.edges.widthScale,strokeOpacity:Math.min(1,y.strokeOpacity*t.edges.opacityScale),strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("title",{children:n(u)})})]},u.id)})})]}),e.nodes.map(u=>{let g=fL[u.iconName]??lucideReact.Palette,f=Bu(u,i),b=u.role==="focus",x=u.role==="context",y=!!(o&&!b);return jsxRuntime.jsxs("div",{className:m("absolute transition-[filter,opacity,transform] duration-200",b?"z-20":u.role==="related"?"z-10":"z-0",x&&i==="dark"&&"opacity-[0.18] brightness-[0.72] saturate-[0.3] hover:!opacity-100 hover:!filter-none"),style:{"--radar-node-background":f.background,"--radar-node-foreground":f.foreground,"--radar-node-border":f.border,left:u.x,opacity:x?t.nodes.contextOpacity??(i==="dark"?u.contextOpacity:void 0):void 0,top:u.y,width:u.width,height:u.height,transform:`translate(-50%, -50%) scale(${b?t.nodes.focusScale:1})`,transformOrigin:"center center"},"data-radar-focus-topology-node-anchor":u.ref.id,children:[jsxRuntime.jsxs("button",{type:"button",disabled:!y&&!s,"aria-label":u.label,title:u.taxonomy?.secondaryLabel?`${u.label} \xB7 ${u.taxonomy.secondaryLabel}`:u.label,onPointerDown:k=>{k.stopPropagation(),s?.(k,u);},onKeyDown:k=>l?.(k,u),onClick:k=>{k.stopPropagation(),y&&o?.(u);},className:m("focus-visible:ring-primary pointer-events-auto flex size-full items-center justify-center gap-2 rounded-full border-0 px-3 text-left text-[0.8125rem] leading-none font-semibold outline-hidden transition-[box-shadow,filter,transform] focus-visible:ring-2",y&&"cursor-pointer hover:brightness-110",!y&&"cursor-default disabled:opacity-100"),style:{fontSize:t.nodes.fontSize,borderRadius:t.nodes.borderRadius,color:f.foreground,backgroundColor:f.background,boxShadow:t.nodes.glow?b?`inset 0 0 0 2px ${f.border}, 0 0 34px ${u.color}66`:u.role==="related"?`inset 0 0 0 1px ${f.border}, 0 0 18px ${u.color}24`:`inset 0 0 0 1px ${f.border}`:`inset 0 0 0 ${b?2:1}px ${f.border}`},"data-radar-focus-topology-node":u.ref.id,"data-world-x":u.x.toFixed(2),"data-world-y":u.y.toFixed(2),"data-radar-focus-topology-node-role":u.role,children:[t.nodes.showIcons&&jsxRuntime.jsx(g,{className:"shrink-0",size:t.nodes.iconSize,color:f.foreground,strokeWidth:1.8,"aria-hidden":"true"}),t.nodes.showLabels&&jsxRuntime.jsx("span",{className:"min-w-0 truncate",style:{color:"inherit"},children:u.label})]}),r?.(u)]},u.id)})]})}a(Rk,"TrendRadarFocusTopologySurface");function Ou({model:e,config:t,onCameraChange:o,colorMode:r="light",ariaLabel:n,onOpenNode:i,renderNodeAction:s,nodeAction:l,onNodeAction:d,relationshipLabel:c,controls:p,onNodePositionChange:u}){if(l?.maxActive!==void 0&&(!Number.isSafeInteger(l.maxActive)||l.maxActive<1))throw new TypeError("Node action maxActive must be a positive integer.");if(l?.size!==void 0&&(!Number.isFinite(l.size)||l.size<16||l.size>48))throw new TypeError("Node action size must be between 16 and 48.");let g=ho.useMemo(()=>bl(t),[t]),f=ho.useMemo(()=>new Set(l?.activeNodeIds??[]),[l?.activeNodeIds]),b=JSON.stringify(g.physics),x=ho.useMemo(()=>JSON.parse(b),[b]),y=JSON.stringify(g.viewport),k=ho.useMemo(()=>JSON.parse(y),[y]),{interaction:w,ui:v}=g,h=ho.useRef(null),S=ho.useRef(),T=JSON.stringify({nodes:e.nodes.map(({id:O,x:K,y:ne,width:fe,height:he})=>({id:O,x:K,y:ne,width:fe,height:he})),edges:e.edges.map(({sourceId:O,targetId:K,associationStrength:ne})=>({sourceId:O,targetId:K,associationStrength:ne}))}),C=ho.useMemo(()=>{let O=JSON.parse(T);return Eu(O.nodes,O.edges,{physics:x})},[T,x]),[R,M]=ho.useState(()=>C.positions()),[I,A]=ho.useState(false),[N,D]=ho.useState({x:0,y:0,z:1}),E=ho.useRef(o);E.current=o,ho.useEffect(()=>{E.current?.(N);},[N]);let P=ho.useRef(N),W=ho.useRef(),H=ho.useRef(false),[B,L]=ho.useState({width:1,height:1}),F=ho.useRef(false),_=ho.useMemo(()=>e.nodes.map(O=>({...O,...R.get(O.id)??{}})),[e.nodes,R]),$=ho.useRef(_);$.current=_;let G=ho.useCallback(O=>{P.current=O,D(O);},[]),z=ho.useCallback(()=>{if(S.current!==void 0)return;if(F.current&&!W.current){C.step(1400),M(C.positions()),A(false);return}A(C.active);let O=a(()=>{C.step(x.ticksPerFrame),M(C.positions()),C.active?S.current=requestAnimationFrame(O):(S.current=void 0,A(false));},"tick");S.current=requestAnimationFrame(O);},[C,x.ticksPerFrame]),re=ho.useCallback(()=>{let O=h.current;if(!O)return;let K=Au($.current,k.fitPadding),ne=Math.max(k.minZoom,Math.min(k.maxZoom,k.fitMaxZoom,(O.clientWidth-k.screenPadding*2)/K.width,(O.clientHeight-k.screenPadding*2)/K.height));G({x:O.clientWidth/(2*ne)-K.x-K.width/2,y:O.clientHeight/(2*ne)-K.y-K.height/2,z:ne});},[G,k]);ho.useEffect(()=>{F.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??false;let O=C.positions();return M(O),$.current=$.current.map(K=>({...K,...O.get(K.id)})),re(),z(),()=>{S.current!==void 0&&cancelAnimationFrame(S.current),S.current=void 0;let K=W.current;K?.target.hasPointerCapture?.(K.pointerId)&&K.target.releasePointerCapture(K.pointerId),W.current=void 0;}},[C,re,z]),ho.useEffect(()=>{let O=h.current;if(!O)return;let K=new ResizeObserver(()=>{L({width:O.clientWidth,height:O.clientHeight}),k.fitOnResize&&re();});return K.observe(O),()=>K.disconnect()},[re,k.fitOnResize]);let Z=ho.useCallback((O,K,ne)=>{if(!w.zoom)return;let fe=P.current,he=Math.max(k.minZoom,Math.min(k.maxZoom,fe.z*Math.exp(-O*k.zoomSensitivity)));G({x:fe.x-K/fe.z+K/he,y:fe.y-ne/fe.z+ne/he,z:he});},[G,k,w.zoom]);ho.useEffect(()=>{let O=h.current;if(!O)return;let K=a(ne=>{if(W.current||!w.zoom)return;ne.preventDefault();let fe=O.getBoundingClientRect();Z(ne.deltaY,ne.clientX-fe.left,ne.clientY-fe.top);},"wheel");return O.addEventListener("wheel",K,{passive:false}),()=>O.removeEventListener("wheel",K)},[Z,w.zoom]);let ae=a((O,K)=>{if(O.button!==0||W.current||(K?!w.dragNodes:!w.pan))return;H.current=false;let ne=P.current;W.current={pointerId:O.pointerId,id:K?.id,startX:O.clientX,startY:O.clientY,x:K?.x??ne.x,y:K?.y??ne.y,moved:false,target:O.currentTarget},O.currentTarget.setPointerCapture(O.pointerId),K&&(C.pin(K.id,K.x,K.y),z());},"begin"),ee=a(O=>{let K=W.current;if(!(!K||K.pointerId!==O.pointerId)){if(W.current=void 0,H.current=K.moved,K.id){let ne=C.positions().get(K.id);C.release(K.id),z(),K.moved&&ne&&u?.(K.id,ne);}K.target.hasPointerCapture(O.pointerId)&&K.target.releasePointerCapture(O.pointerId);}},"end"),q={...e,nodes:_},U=new Map(_.map(O=>[O.id,O])),X=Au([...e.nodes,..._],200);return jsxRuntime.jsxs("section",{ref:h,className:"relationship-graph bg-background relative size-full overflow-hidden",style:{cursor:w.pan?void 0:"default",touchAction:w.pan||w.dragNodes?"none":"auto"},role:"region","aria-label":n,"data-radar-focus-topology":"true","data-graph-engine":"native-force","data-force-running":I,"data-radar-focus-topology-camera":`${N.x.toFixed(2)},${N.y.toFixed(2)},${N.z.toFixed(3)}`,onPointerDown:O=>{O.target.closest("button")||ae(O);},onPointerMove:O=>{let K=W.current;if(!K||K.pointerId!==O.pointerId)return;let ne=O.clientX-K.startX,fe=O.clientY-K.startY;K.moved||(K.moved=Math.hypot(ne,fe)>w.dragThreshold),K.moved&&(K.id?(C.pin(K.id,K.x+ne/P.current.z,K.y+fe/P.current.z),M(C.positions()),z()):G({...P.current,x:K.x+ne/P.current.z,y:K.y+fe/P.current.z}));},onPointerUp:ee,onPointerCancel:ee,onLostPointerCapture:ee,onClickCapture:O=>{H.current&&(O.preventDefault(),O.stopPropagation(),H.current=false);},children:[jsxRuntime.jsx("div",{style:{position:"absolute",left:0,top:0,width:Dr.width,height:Dr.height,transformOrigin:"0 0",transform:`translate(${N.x*N.z}px, ${N.y*N.z}px) scale(${N.z})`},children:jsxRuntime.jsx(Rk,{model:q,config:g,colorMode:r,relationshipLabel:c,onOpenNode:w.openNodes?i:void 0,renderNodeAction:s??(l&&d?O=>{if(l.nodeKinds&&!l.nodeKinds.includes(O.ref.kind))return null;let K=f.has(O.id),ne=l.disabled||!K&&l.maxActive!==void 0&&f.size>=l.maxActive,fe=`${K?l.activeLabel??l.label:l.label}: ${O.label}`,he=K?lucideReact.Check:lucideReact.Plus,me=l.size??24;return jsxRuntime.jsx("button",{type:"button","data-relationship-node-action":O.id,"aria-label":fe,title:fe,"aria-pressed":K,disabled:ne,className:"grid place-items-center rounded-md border border-current bg-card text-foreground shadow-sm outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40",style:{position:"absolute",right:0,top:0,width:me,height:me,color:Bu(O,r).foreground,transform:`translate(50%, -50%) scale(${l.keepScreenSize===false?1:1/N.z})`,transformOrigin:"center"},onPointerDown:ie=>ie.stopPropagation(),onKeyDown:ie=>ie.stopPropagation(),onClick:ie=>{ie.stopPropagation(),d(O);},children:jsxRuntime.jsx(he,{size:me*.6,"aria-hidden":"true"})})}:void 0),onNodePointerDown:w.dragNodes?(O,K)=>ae(O,K):void 0,onNodeKeyDown:(O,K)=>{if(!w.keyboard||!w.dragNodes)return;let ne={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[O.key];if(!ne)return;O.preventDefault(),O.stopPropagation();let fe=(O.shiftKey?w.keyboardFastStep:w.keyboardStep)/P.current.z,he={x:K.x+ne[0]*fe,y:K.y+ne[1]*fe};C.pin(K.id,he.x,he.y),M(C.positions()),C.release(K.id),z(),u?.(K.id,he);}})}),(v.controls||v.minimap)&&jsxRuntime.jsxs("div",{className:"relationship-minimap","data-radar-focus-topology-minimap":"true",style:{width:v.minimapWidth,left:v.dock.endsWith("left")?12:"auto",right:v.dock.endsWith("right")?12:"auto",top:v.dock.startsWith("top")?12:"auto",bottom:v.dock.startsWith("bottom")?12:"auto"},children:[v.controls&&jsxRuntime.jsxs("div",{className:"relationship-controls",children:[jsxRuntime.jsx("button",{type:"button","aria-label":p.zoomOut,onClick:()=>Z(k.zoomStep,B.width/2,B.height/2),disabled:!w.zoom||N.z<=k.minZoom,children:jsxRuntime.jsx(lucideReact.Minus,{size:15})}),jsxRuntime.jsxs("output",{children:[Math.round(N.z*100),"%"]}),jsxRuntime.jsx("button",{type:"button","aria-label":p.zoomIn,onClick:()=>Z(-k.zoomStep,B.width/2,B.height/2),disabled:!w.zoom||N.z>=k.maxZoom,children:jsxRuntime.jsx(lucideReact.Plus,{size:15})}),jsxRuntime.jsx("button",{type:"button","aria-label":p.zoomToFit,onClick:re,children:jsxRuntime.jsx(lucideReact.LocateFixed,{size:15})})]}),v.minimap&&jsxRuntime.jsx("button",{type:"button",className:"relationship-minimap-map",disabled:!w.pan,"aria-label":p.minimap,onClick:O=>{if(O.detail===0){re();return}let K=O.currentTarget.getBoundingClientRect(),ne=(O.clientX-K.left)/K.width*X.width+X.x,fe=(O.clientY-K.top)/K.height*X.height+X.y;G({...N,x:B.width/(2*N.z)-ne,y:B.height/(2*N.z)-fe});},children:jsxRuntime.jsxs("svg",{viewBox:`${X.x} ${X.y} ${X.width} ${X.height}`,style:{height:v.minimapHeight},preserveAspectRatio:"none","aria-hidden":"true",children:[e.edges.map(O=>{let K=U.get(O.sourceId),ne=U.get(O.targetId);return K&&ne?jsxRuntime.jsx("line",{x1:K.x,y1:K.y,x2:ne.x,y2:ne.y,stroke:"currentColor",strokeWidth:2,opacity:.2},O.id):null}),_.map(O=>jsxRuntime.jsx("circle",{cx:O.x,cy:O.y,r:O.role==="focus"?14:8,fill:O.color},O.id)),jsxRuntime.jsx("rect",{x:-N.x,y:-N.y,width:B.width/N.z,height:B.height/N.z,fill:"currentColor",fillOpacity:.07,stroke:"currentColor",strokeWidth:4})]})})]})]})}a(Ou,"RelationshipGraph2D");var xL={primary:"hsl(var(--radar-series-one, var(--primary)))",secondary:"hsl(var(--radar-series-two, var(--success)))",accent:"hsl(var(--radar-series-three, var(--warning)))",muted:"hsl(var(--radar-series-four, var(--muted-foreground)))"},vL={nodes:{showIcons:false,glow:false,contextOpacity:1},edges:{glow:false,opacityScale:3,widthScale:.5}};function Dk({nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:n="Relationship graph",className:i,height:s=440}){let l=Ye(),d=Hn(),c=JSON.stringify([e,t]),p=ho.useMemo(()=>Du(e,t),[c]),u=ho.useMemo(()=>({subjectId:o??"",bounds:Dr,focusBounds:Dr,nodes:p.points.map(b=>{let x=Math.max(88,Math.min(240,Array.from(b.label).length*14+32)),y=xL[b.tone??"muted"];return {id:b.id,ref:{kind:"node",id:b.id},label:b.label,x:Dr.width/2+b.x*70,y:Dr.height/2+b.y*70,width:x,height:36,radius:x/2,score:0,degree:p.neighbors.get(b.id)?.size??0,colorKey:b.tone??"muted",color:y,solidColor:y,iconName:"layers",role:b.id===o?"focus":"related"}}),edges:p.links.map((b,x)=>({id:b.id??`${b.sourceId}:${b.targetId}:${x}`,sourceId:b.sourceId,targetId:b.targetId,evidenceRefs:[],evidenceCount:0,associationStrength:1,role:b.sourceId===o||b.targetId===o?"focus":"related"}))}),[p,o]),g=ho.useMemo(()=>new Map(e.map(b=>[b.id,b])),[c]),f=ho.useMemo(()=>new Map(p.links.map((b,x)=>[b.id??`${b.sourceId}:${b.targetId}:${x}`,b.label??`${g.get(b.sourceId)?.label} \u2192 ${g.get(b.targetId)?.label}`])),[p,g]);return jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-relationship-graph","data-workbench-relationship-variant":"force-2d",className:m("relative h-[var(--relationship-height)] min-h-0 min-w-0 overflow-hidden",i),style:{"--relationship-height":`${s}px`},children:jsxRuntime.jsx(Ou,{model:u,config:vL,colorMode:d?.colorMode==="dark"?"dark":"light",ariaLabel:n,controls:l.workbench.relationshipGraph??{zoomOut:"Zoom out",zoomIn:"Zoom in",zoomToFit:"Fit graph",minimap:"Graph overview"},relationshipLabel:b=>f.get(b.id)??"",onOpenNode:r?b=>{let x=g.get(b.id);x&&r(x);}:void 0})})}a(Dk,"RelationshipForce2D");var wL={primary:"fill-primary/10 stroke-primary text-primary",secondary:"fill-secondary stroke-secondary-foreground text-secondary-foreground",accent:"fill-accent stroke-accent-foreground text-accent-foreground",muted:"fill-muted stroke-muted-foreground text-muted-foreground"},kL={primary:"--radar-series-one",secondary:"--radar-series-two",accent:"--radar-series-three",muted:"--radar-series-four"},CL={primary:"var(--primary)",secondary:"var(--secondary-foreground)",accent:"var(--accent-foreground)",muted:"var(--muted-foreground)"},Hu=a((e,t=1)=>`hsl(var(${kL[e]}, ${CL[e]}) / ${t})`,"radarToneColor"),SL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateNode");function Ek({nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,width:n=900,height:i=440,emptyState:s=null,ariaLabel:l="Relationship graph",className:d,variant:c="default"}){if(!e.length)return V(s)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:s}):null;if(c==="galaxy")return jsxRuntime.jsx(vk,{nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:l,className:d});if(c==="force-2d")return jsxRuntime.jsx(Dk,{nodes:e,edges:t,selectedNodeId:o,onNodeSelect:r,ariaLabel:l,className:d,height:i});let p=c==="radar",u=Math.min(n,i)*(p?.37:.35),g=o?e.findIndex(x=>x.id===o):-1,f=g>=0?e.filter((x,y)=>y!==g):e,b=new Map(e.map((x,y)=>{if(e.length===1)return [x.id,{x:n/2,y:i/2}];if(p&&y===g)return [x.id,{x:n/2,y:i/2}];let k=f.findIndex(v=>v.id===x.id),w=Math.PI*2*k/f.length-Math.PI/2;return [x.id,{x:n/2+Math.cos(w)*u,y:i/2+Math.sin(w)*u}]}));return jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-relationship-graph","data-workbench-relationship-variant":c,className:m("relative min-w-0 overflow-hidden rounded-lg border",p?"min-h-[42rem]":"overflow-x-auto border-border/70 bg-card",d),style:p?{backgroundColor:"hsl(var(--radar-canvas, var(--background)))",borderColor:"hsl(var(--radar-shell-border, var(--border)))",backgroundImage:"linear-gradient(hsl(var(--radar-grid, var(--border)) / 0.28) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--radar-grid, var(--border)) / 0.28) 1px, transparent 1px), radial-gradient(circle at center, hsl(var(--primary) / 0.1), transparent 45%)",backgroundSize:"4rem 4rem, 4rem 4rem, 100% 100%"}:void 0,children:jsxRuntime.jsxs("svg",{viewBox:`0 0 ${n} ${i}`,className:m(p?"absolute inset-0 size-full":"min-w-[42rem]"),preserveAspectRatio:p?"xMidYMid meet":void 0,role:"img","aria-label":l,children:[t.map((x,y)=>{let k=b.get(x.sourceId),w=b.get(x.targetId);return !k||!w?null:jsxRuntime.jsx("line",{x1:k.x,y1:k.y,x2:w.x,y2:w.y,className:p?void 0:"stroke-border",strokeWidth:p?"2":"1.5",style:p?{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.46)",filter:"drop-shadow(0 0 0.35rem hsl(var(--primary) / 0.34))"}:void 0,children:jsxRuntime.jsx("title",{children:x.label||`${x.sourceId} to ${x.targetId}`})},x.id||`${x.sourceId}:${x.targetId}:${y}`)}),e.map(x=>{let y=b.get(x.id),k=x.id===o,w=x.tone||"muted",v=p?{color:Hu(w)}:void 0;return jsxRuntime.jsxs("g",{transform:`translate(${y.x}, ${y.y})`,role:r?"button":void 0,tabIndex:r?0:void 0,"aria-label":x.meta?`${x.label}, ${x.meta}`:x.label,"aria-pressed":r?k:void 0,onClick:r?()=>r(x):void 0,onKeyDown:h=>SL(h,x,r),className:m(p?"outline-hidden":wL[w],r&&"cursor-pointer outline-hidden"),style:v,children:[jsxRuntime.jsx("circle",{r:p&&k?"50":p?"40":"36",className:m("stroke-1 transition-[stroke-width] duration-150 motion-reduce:transition-none",k&&"stroke-[3]"),style:p?{fill:Hu(w,k?.22:.12),stroke:Hu(w,k?1:.78),filter:`drop-shadow(0 0 ${k?"1.4rem":"0.75rem"} ${Hu(w,.62)})`}:void 0}),jsxRuntime.jsx("text",{textAnchor:"middle",y:x.meta?-3:4,className:m("pointer-events-none fill-current font-semibold",p?"text-sm":"text-xs"),children:x.label.slice(0,18)}),x.meta?jsxRuntime.jsx("text",{textAnchor:"middle",y:"16",className:m("pointer-events-none text-xs",p?"fill-current opacity-70":"fill-muted-foreground"),children:x.meta.slice(0,22)}):null]},x.id)})]})})}a(Ek,"WorkbenchRelationshipGraph");var NL={primary:"fill-primary stroke-primary",secondary:"fill-secondary stroke-secondary-foreground",accent:"fill-accent stroke-accent-foreground",muted:"fill-muted stroke-muted-foreground"},RL=a(e=>e.filter(Number.isFinite),"finiteValues"),Jf=a((e,t,o)=>{let r=RL(e),n=Number.isFinite(t)?Number(t):Math.min(...r,0),i=Number.isFinite(o)?Number(o):Math.max(...r,1);return n===i?[n,i+1]:n<i?[n,i]:[i,n]},"getDomain"),yl=a((e,t,o,r)=>o+(e-t[0])/(t[1]-t[0])*(r-o),"scale"),Ga=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp"),ML=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activatePoint");function Bk({points:e,xAxis:t,yAxis:o,thresholds:r,selectedPointId:n,onPointSelect:i,width:s=900,height:l=420,emptyState:d=null,ariaLabel:c=`${t.label} by ${o.label}`,className:p}){let u=e.filter(T=>Number.isFinite(T.x)&&Number.isFinite(T.y));if(!u.length)return V(d)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:d}):null;let g=56,f=Jf(u.map(T=>T.x),t.min,t.max),b=Jf(u.map(T=>T.y),o.min,o.max),x=Jf(u.map(T=>T.size??1)),y=g,k=s-g,w=g,v=l-g,h=Number.isFinite(r?.x)?yl(Number(r?.x),f,y,k):void 0,S=Number.isFinite(r?.y)?yl(Number(r?.y),b,v,w):void 0;return jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-scatter-plot",className:m("min-w-0 overflow-x-auto rounded-lg border border-border/70 bg-card p-3",p),children:jsxRuntime.jsxs("svg",{viewBox:`0 0 ${s} ${l}`,className:"min-w-[42rem]",role:"img","aria-label":c,children:[jsxRuntime.jsx("line",{x1:y,y1:v,x2:k,y2:v,className:"stroke-border"}),jsxRuntime.jsx("line",{x1:y,y1:w,x2:y,y2:v,className:"stroke-border"}),h===void 0?null:jsxRuntime.jsx("line",{x1:Ga(h,y,k),y1:w,x2:Ga(h,y,k),y2:v,className:"stroke-muted-foreground/50",strokeDasharray:"5 5"}),S===void 0?null:jsxRuntime.jsx("line",{x1:y,y1:Ga(S,w,v),x2:k,y2:Ga(S,w,v),className:"stroke-muted-foreground/50",strokeDasharray:"5 5"}),jsxRuntime.jsx("text",{x:s/2,y:l-12,textAnchor:"middle",className:"fill-muted-foreground text-xs",children:t.label}),jsxRuntime.jsx("text",{x:"16",y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/2})`,className:"fill-muted-foreground text-xs",children:o.label}),u.map(T=>{let C=Ga(yl(T.x,f,y,k),y,k),R=Ga(yl(T.y,b,v,w),w,v),M=T.size===void 0?9:Ga(yl(T.size,x,7,18),7,18),I=n===T.id;return jsxRuntime.jsxs("g",{transform:`translate(${C}, ${R})`,role:i?"button":void 0,tabIndex:i?0:void 0,"aria-label":`${T.label}: ${t.label} ${T.x}, ${o.label} ${T.y}`,"aria-pressed":i?I:void 0,onClick:i?()=>i(T):void 0,onKeyDown:A=>ML(A,T,i),className:m(i&&"cursor-pointer outline-hidden"),children:[jsxRuntime.jsx("circle",{r:M,className:m("stroke-1 opacity-80 transition-opacity duration-150 motion-reduce:transition-none",NL[T.tone||"primary"],I?"opacity-100 stroke-[3]":"hover:opacity-100")}),jsxRuntime.jsx("text",{y:-M-7,textAnchor:"middle",className:"pointer-events-none fill-foreground text-[0.6875rem] font-semibold",children:T.label.slice(0,24)}),jsxRuntime.jsx("title",{children:T.description||T.label})]},T.id)})]})})}a(Bk,"WorkbenchScatterPlot");var DL=a((e,t,o)=>{!o||t.disabled||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateItem");function Wk({items:e,onItemSelect:t,ariaLabel:o="Journey",className:r}){return jsxRuntime.jsx("nav",{"aria-label":o,"data-monkeys-component":"workbench-journey-navigation",className:m("min-w-0 overflow-x-auto rounded-lg border border-border/70 bg-card p-2",r),children:jsxRuntime.jsx("ol",{className:"flex min-w-max items-stretch gap-1",children:e.map((n,i)=>{let s=n.state||"upcoming";return jsxRuntime.jsxs("li",{className:"flex items-center",children:[i?jsxRuntime.jsx("span",{className:"mx-1 h-px w-5 bg-border","aria-hidden":"true"}):null,jsxRuntime.jsxs("button",{type:"button",disabled:n.disabled,"aria-current":s==="current"?"page":void 0,onClick:t&&!n.disabled?()=>t(n):void 0,onKeyDown:l=>DL(l,n,t),className:m("min-w-28 rounded-md border px-3 py-2 text-left outline-hidden transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background motion-reduce:transition-none",s==="current"&&"border-primary bg-primary text-primary-foreground",s==="complete"&&"border-primary/30 bg-primary/10 text-foreground",s==="upcoming"&&"border-transparent bg-muted/50 text-muted-foreground",n.disabled&&"cursor-not-allowed opacity-50"),children:[V(n.eyebrow)?jsxRuntime.jsx("span",{className:m("block text-[0.625rem] font-semibold uppercase tracking-[0.14em]",s==="current"?"text-primary-foreground/75":"text-muted-foreground"),children:n.eyebrow}):null,jsxRuntime.jsx("span",{className:"mt-0.5 block text-xs font-semibold",children:n.label})]})]},n.id)})})})}a(Wk,"WorkbenchJourneyNavigation");var PL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateItem");function zk({items:e,selectedItemId:t,onItemSelect:o,emptyState:r=null,ariaLabel:n="Ranked items",className:i}){return e.length?jsxRuntime.jsx("ol",{"aria-label":n,"data-monkeys-component":"workbench-ranked-list",className:m("grid min-w-0 gap-2",i),children:e.map((s,l)=>{let d=t===s.id;return jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{type:"button","aria-pressed":o?d:void 0,onClick:o?()=>o(s):void 0,onKeyDown:c=>PL(c,s,o),className:m("grid w-full min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-3 rounded-lg border bg-card p-3 text-left text-card-foreground outline-hidden transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",d?"border-primary bg-primary/5":"border-border/70 hover:border-primary/40 hover:bg-accent/50",!o&&"cursor-default"),children:[jsxRuntime.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-semibold tabular-nums text-muted-foreground",children:s.leading||l+1}),jsxRuntime.jsxs("span",{className:"min-w-0",children:[jsxRuntime.jsx("span",{className:"block truncate text-sm font-semibold text-foreground",children:s.label}),V(s.description)?jsxRuntime.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:s.description}):null,s.tags?.length?jsxRuntime.jsx("span",{className:"mt-2 flex flex-wrap gap-1.5",children:s.tags.map((c,p)=>jsxRuntime.jsx("span",{className:"rounded-full bg-secondary px-2 py-0.5 text-[0.625rem] font-medium text-secondary-foreground",children:c},`${s.id}:tag:${p}`))}):null,s.metrics?.length?jsxRuntime.jsx("span",{className:"mt-2 grid grid-cols-2 gap-x-4 gap-y-1 sm:grid-cols-4",children:s.metrics.map(c=>jsxRuntime.jsxs("span",{className:"min-w-0",children:[jsxRuntime.jsx("span",{className:"block truncate text-[0.625rem] text-muted-foreground",children:c.label}),jsxRuntime.jsx("span",{className:"block text-xs font-semibold tabular-nums text-foreground",children:c.value})]},c.id))}):null]}),jsxRuntime.jsxs("span",{className:"shrink-0 text-right",children:[V(s.score)?jsxRuntime.jsx("span",{className:"block text-lg font-semibold tabular-nums text-primary",children:s.score}):null,V(s.trailing)?jsxRuntime.jsx("span",{className:"mt-1 block text-muted-foreground",children:s.trailing}):null]})]})},s.id)})}):V(r)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:r}):null}a(zk,"WorkbenchRankedList");function Ok({title:e,description:t,items:o,onRemove:r,removeLabel:n=a(()=>"Remove","removeLabel"),actions:i,emptyState:s=null,className:l}){return jsxRuntime.jsxs("section",{"data-monkeys-component":"workbench-selection-tray",className:m("rounded-lg border border-border/70 bg-card p-4 text-card-foreground",l),children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("h2",{className:"text-sm font-semibold text-foreground",children:e}),V(t)?jsxRuntime.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:t}):null]}),jsxRuntime.jsx("span",{className:"rounded-full bg-primary/10 px-2.5 py-1 text-xs font-semibold tabular-nums text-primary",children:o.length})]}),o.length?jsxRuntime.jsx("ul",{className:"mt-3 flex flex-wrap gap-2",children:o.map(d=>jsxRuntime.jsxs("li",{className:"flex max-w-full items-center gap-2 rounded-full border border-border bg-background px-3 py-1.5 text-xs text-foreground",children:[jsxRuntime.jsx("span",{className:"min-w-0 truncate font-medium",children:d.label}),V(d.meta)?jsxRuntime.jsx("span",{className:"shrink-0 text-muted-foreground",children:d.meta}):null,r?jsxRuntime.jsx("button",{type:"button","aria-label":n(d),onClick:()=>r(d),className:"rounded-md px-1 text-muted-foreground outline-hidden hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:"\xD7"}):null]},d.id))}):jsxRuntime.jsx("div",{className:"mt-3 rounded-md border border-dashed border-border px-4 py-5 text-center text-xs text-muted-foreground",children:s}),V(i)?jsxRuntime.jsx("div",{className:"mt-4 flex flex-wrap justify-end gap-2 border-t border-border pt-4",children:i}):null]})}a(Ok,"WorkbenchSelectionTray");function Fk(e,t="milliseconds",o){if(t!=="milliseconds"&&t!=="seconds")return "\u2014";let r;if(typeof e=="number")r=t==="seconds"?e*1e3:e;else if(typeof e=="string"){let i=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,3}))?(Z|[+-]\d{2}:\d{2})$/.exec(e);if(!i)return "\u2014";let s=Number(i[1]),l=Number(i[2]),d=Number(i[3]),c=Number(i[4]),p=Number(i[5]),u=Number(i[6]),g=new Date(0);if(g.setUTCFullYear(s,l-1,d),g.getUTCFullYear()!==s||g.getUTCMonth()!==l-1||g.getUTCDate()!==d||c>23||p>59||u>59)return "\u2014";r=Date.parse(e);}else return "\u2014";if(!Number.isFinite(r))return "\u2014";let n=new Date(r);if(!Number.isFinite(n.getTime()))return "\u2014";try{return n.toLocaleString(o)}catch{return "\u2014"}}a(Fk,"renderDateTimeValue");function Hk({items:e,emptyState:t=null,ariaLabel:o="Evidence",className:r,translate:n=a(i=>i,"translate")}){let{locale:i}=Co();return e.length?jsxRuntime.jsx("ol",{"aria-label":o,"data-monkeys-component":"workbench-evidence-list",className:m("grid min-w-0 gap-0",r),children:e.map((s,l)=>jsxRuntime.jsxs("li",{className:"grid min-w-0 grid-cols-[1.25rem_minmax(0,1fr)_auto] gap-3",children:[jsxRuntime.jsxs("span",{className:"flex flex-col items-center","aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:"mt-1 flex size-5 items-center justify-center rounded-full border border-primary/40 bg-primary/10 text-[0.625rem] font-semibold text-primary",children:s.marker||l+1}),l<e.length-1?jsxRuntime.jsx("span",{className:"min-h-8 w-px flex-1 bg-border"}):null]}),jsxRuntime.jsxs("span",{className:"min-w-0 pb-5",children:[jsxRuntime.jsx("span",{className:"block text-sm font-semibold text-foreground",children:s.titleKey?n(s.titleKey):s.title}),V(s.description)||s.descriptionKey?jsxRuntime.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:s.descriptionKey?n(s.descriptionKey):s.description}):null,V(s.source)||s.sourceKey||V(s.timestamp)||s.timestampValue!==void 0?jsxRuntime.jsxs("span",{className:"mt-1.5 flex flex-wrap gap-x-3 gap-y-1 text-[0.6875rem] text-muted-foreground",children:[V(s.source)||s.sourceKey?jsxRuntime.jsx("span",{children:s.sourceKey?n(s.sourceKey):s.source}):null,V(s.timestamp)||s.timestampValue!==void 0?jsxRuntime.jsx("time",{children:s.timestampValue!==void 0?Fk(s.timestampValue,"milliseconds",i):s.timestamp}):null]}):null]}),V(s.action)?jsxRuntime.jsx("span",{className:"pb-5",children:s.action}):null]},s.id))}):V(t)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:t}):null}a(Hk,"WorkbenchEvidenceList");var BL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activateItem");function _k({items:e,selectedItemId:t,onItemSelect:o,emptyState:r=null,ariaLabel:n="Assets",className:i}){return e.length?jsxRuntime.jsx("div",{"data-monkeys-component":"workbench-asset-gallery",children:jsxRuntime.jsx(Sn,{items:e,config:{getItemKey:a(s=>s.id,"getItemKey"),layout:{mode:"grid",columns:"auto",minCardWidth:"12rem",idealCardWidth:"16rem",gap:12},appearance:{hover:"none"}},ariaLabel:n,className:i,renderItem:s=>{let l=t===s.id;return jsxRuntime.jsxs("button",{type:"button","aria-pressed":o?l:void 0,onClick:o?()=>o(s):void 0,onKeyDown:d=>BL(d,s,o),className:m("group w-full overflow-hidden rounded-lg border bg-card text-left text-card-foreground outline-hidden transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",l?"border-primary ring-1 ring-primary":"border-border/70 hover:border-primary/40",!o&&"cursor-default"),children:[jsxRuntime.jsx("span",{className:"block aspect-[4/3] overflow-hidden bg-muted",children:jsxRuntime.jsx("img",{src:s.url,alt:s.alt,loading:"lazy",className:"size-full object-cover transition-transform duration-200 group-hover:scale-[1.02] motion-reduce:transition-none"})}),jsxRuntime.jsxs("span",{className:"block p-3",children:[V(s.title)?jsxRuntime.jsx("span",{className:"block truncate text-sm font-semibold text-foreground",children:s.title}):null,V(s.description)?jsxRuntime.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:s.description}):null,s.badges?.length?jsxRuntime.jsx("span",{className:"mt-2 flex flex-wrap gap-1.5",children:s.badges.map((d,c)=>jsxRuntime.jsx("span",{className:"rounded-full bg-secondary px-2 py-0.5 text-[0.625rem] text-secondary-foreground",children:d},`${s.id}:badge:${c}`))}):null]})]})}})}):V(r)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:r}):null}a(_k,"WorkbenchAssetGallery");var Gk={primary:"--radar-series-one",secondary:"--radar-series-two",accent:"--radar-series-three",muted:"--radar-series-four"},$k={primary:"var(--primary)",secondary:"var(--secondary-foreground)",accent:"var(--accent-foreground)",muted:"var(--muted-foreground)"},$a=a(e=>`hsl(var(${Gk[e]}, ${$k[e]}))`,"workbenchVisualizationToneColor"),vl=a((e,t)=>`hsl(var(${Gk[e]}, ${$k[e]}) / ${t})`,"workbenchVisualizationToneColorWithAlpha");var WL={backgroundColor:"hsl(var(--radar-canvas, var(--background)))",color:"hsl(var(--foreground))"},jk={backgroundColor:"hsl(var(--radar-panel, var(--card)))",borderColor:"hsl(var(--radar-border, var(--border)))"};function eb({items:e,activeItemId:t,activeChildId:o,onItemSelect:r,onChildSelect:n,footer:i,ariaLabel:s="Radar navigation"}){return jsxRuntime.jsx($i,{kind:"route",routeItems:e.map(l=>({...l,children:l.children?.map(d=>({...d,domProps:{"data-radar-navigation-child-id":d.id}}))})),activeItemId:t,activeChildId:o,onItemSelect:r?l=>r(l):void 0,onChildSelect:n?(l,d)=>n(l,d):void 0,footer:i,ariaLabel:s,dataComponent:"workbench-radar-navigation",widthMode:"fill",resizable:false,collapsible:false,appearance:{density:"default",surface:"outlined",activeVariant:"solid"},className:"min-w-0 self-stretch rounded-lg",classNames:{content:"p-3",list:"gap-2",item:"min-h-11 px-3 py-2 text-sm font-semibold",itemActive:"bg-primary text-primary-foreground shadow-[0_0_1.25rem_hsl(var(--primary)/0.28)]",childList:"ml-5 gap-0.5 border-l border-border/70 py-1 pl-3",childItem:"min-h-9 px-2 text-xs font-medium",childItemActive:"border-primary/40 bg-primary/15 text-primary",footer:"p-3"},style:jk})}a(eb,"WorkbenchRadarNavigation");function Uk({navigationItems:e=[],activeNavigationId:t,activeNavigationChildId:o,onNavigationSelect:r,onNavigationChildSelect:n,navigationFooter:i,navigation:s,children:l,inspector:d,inspectorLabel:c="Context controls",className:p,contentClassName:u,minimumHeight:g="calc(100dvh - 1rem)",ariaLabel:f="Radar workspace"}){return jsxRuntime.jsxs("section",{"data-monkeys-component":"workbench-radar-workspace","data-radar-active-navigation-id":t,"aria-label":f,className:m("grid min-w-0 gap-3 overflow-hidden p-3 lg:grid-cols-[12.5rem_minmax(0,1fr)] xl:grid-cols-[12.5rem_minmax(0,1fr)_20rem]",p),style:{...WL,minHeight:g},children:[V(s)?s:jsxRuntime.jsx(eb,{items:e,activeItemId:t,activeChildId:o,onItemSelect:r,onChildSelect:n,footer:i}),jsxRuntime.jsx("div",{"data-radar-workspace-region":"content",className:m("relative min-h-[42rem] min-w-0 overflow-hidden rounded-lg border",u),style:{backgroundColor:"hsl(var(--radar-canvas, var(--background)))",borderColor:"hsl(var(--radar-shell-border, var(--border)))",boxShadow:"inset 0 0 0 1px hsl(var(--radar-grid, var(--border)) / 0.22)"},children:l}),V(d)?jsxRuntime.jsx("aside",{"aria-label":c,"data-radar-workspace-region":"inspector",className:"min-h-0 overflow-y-auto rounded-lg border lg:col-span-2 xl:col-span-1",style:jk,children:d}):null]})}a(Uk,"WorkbenchRadarWorkspace");function Kk({title:e,icon:t,description:o,children:r,className:n}){return jsxRuntime.jsxs("section",{"data-monkeys-component":"workbench-radar-inspector-section",className:m("border-b border-border/70 p-4 last:border-b-0",n),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-primary",children:[V(t)?jsxRuntime.jsx("span",{"aria-hidden":"true",children:t}):null,jsxRuntime.jsx("h2",{children:e})]}),V(o)?jsxRuntime.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:o}):null,V(r)?jsxRuntime.jsx("div",{className:"mt-3",children:r}):null]})}a(Kk,"WorkbenchRadarInspectorSection");function zL(e){let{disclosure:t,onSelect:o}=e;if(!t&&!o||t?.mode==="integrated"&&(!!o||e.selected!==void 0)||t?.mode==="separate"&&!o)throw new Error("Invalid WorkbenchRadarFilterRow props.")}a(zL,"assertValidRadarFilterRowProps");function qk(e){zL(e);let{label:t,value:o,icon:r,selected:n,disabled:i=false,tone:s,onSelect:l,disclosure:d,className:c}=e,p=n??false,u=p?void 0:"monkeys-workbench-radar-filter-row--idle",g=i?"monkeys-workbench-radar-filter-disabled":void 0,f=s??"primary",b=$a(f),x={"--workbench-radar-filter-tone":b,"--tw-ring-color":s?b:"hsl(var(--ring))",...p||s?{backgroundColor:vl(f,p?.14:.08),borderColor:b}:{}},y=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[V(r)?jsxRuntime.jsx("span",{className:m("flex size-4 shrink-0 items-center justify-center",s?"text-[var(--workbench-radar-filter-tone)]":"text-muted-foreground"),"aria-hidden":"true",children:r}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:t}),V(o)?jsxRuntime.jsx("span",{className:"ml-auto shrink-0 tabular-nums text-muted-foreground",children:o}):null]}),k=d?jsxRuntime.jsx("span",{"aria-hidden":"true",className:m("text-lg leading-none transition-transform motion-reduce:transition-none",d.expanded&&"rotate-90"),children:"\u203A"}):null;if(d?.mode==="separate"){let h=d.expanded?d.collapseLabel:d.expandLabel;return jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-radar-filter-row",className:m("monkeys-workbench-radar-filter-row monkeys-workbench-radar-filter-row--separate",u,g,c),style:x,children:[jsxRuntime.jsx("button",{type:"button","aria-pressed":n,disabled:i,onClick:l,className:m("monkeys-workbench-radar-filter-control monkeys-workbench-radar-filter-row__action",g),children:y}),jsxRuntime.jsx("button",{type:"button","aria-expanded":d.expanded,"aria-controls":d.controls,"aria-label":h,disabled:i,onClick:d.onToggle,className:m("monkeys-workbench-radar-filter-row__disclosure",g),children:k})]})}let w=d?.mode==="integrated"?d:void 0,v=w?w.expanded?w.collapseLabel:w.expandLabel:void 0;return jsxRuntime.jsxs("button",{type:"button","data-monkeys-component":"workbench-radar-filter-row","aria-label":v,"aria-pressed":w?void 0:n,"aria-expanded":w?.expanded,"aria-controls":w?.controls,disabled:i,onClick:w?.onToggle??l,className:m("monkeys-workbench-radar-filter-control monkeys-workbench-radar-filter-row",u,g,c),style:x,children:[y,w?jsxRuntime.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:k}):null]})}a(qk,"WorkbenchRadarFilterRow");function Yk({label:e,value:t,icon:o,selected:r=false,disabled:n=false,onSelect:i,className:s}){let l=!!i||n;return jsxRuntime.jsxs(l?"button":"div",{type:l?"button":void 0,"aria-pressed":i&&!n?r:void 0,disabled:l?n:void 0,onClick:i,className:m("flex min-w-0 items-center border text-xs font-semibold outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none","monkeys-workbench-radar-filter-control rounded-md",r?"border-primary bg-primary/20 text-primary":"border-border bg-background/40 text-foreground hover:border-primary/60 hover:bg-primary/10",n&&"cursor-not-allowed opacity-50",s),children:[V(o)?jsxRuntime.jsx("span",{className:"shrink-0","aria-hidden":"true",children:o}):null,jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:e}),V(t)?jsxRuntime.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:t}):null]})}a(Yk,"WorkbenchRadarFilterChip");var FL=a(e=>e.filter(Number.isFinite),"finiteValues"),tb=a((e,t,o)=>{let r=FL(e),n=Number.isFinite(t)?Number(t):Math.min(...r,0),i=Number.isFinite(o)?Number(o):Math.max(...r,1);return n===i?[n,i+1]:n<i?[n,i]:[i,n]},"getDomain"),fa=a((e,t,o,r)=>o+(e-t[0])/(t[1]-t[0])*(r-o),"scale"),ba=a((e,t,o)=>Math.min(o,Math.max(t,e)),"clamp"),HL=a((e,t,o)=>{!o||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),o(t));},"activatePoint"),VL={"low-high":{x:26,y:8,anchor:"start"},"high-high":{x:974,y:8,anchor:"end"},"low-low":{x:26,y:660,anchor:"start"},"high-low":{x:974,y:660,anchor:"end"}};function Xk({points:e,xAxis:t,yAxis:o,thresholds:r,quadrants:n=[],legend:i=[],selectedPointId:s,onPointSelect:l,width:d=1e3,height:c=700,labelLimit:p=18,emptyState:u=null,ariaLabel:g=`${t.label} by ${o.label} radar matrix`,className:f}){let b=e.filter(M=>Number.isFinite(M.x)&&Number.isFinite(M.y));if(!b.length)return V(u)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:u}):null;let x=tb(b.map(M=>M.x),t.min,t.max),y=tb(b.map(M=>M.y),o.min,o.max),k=tb(b.map(M=>M.size??1)),w=0,v=d,h=0,S=c,T=ba(fa(Number.isFinite(r?.x)?Number(r?.x):(x[0]+x[1])/2,x,w,v),w,v),C=ba(fa(Number.isFinite(r?.y)?Number(r?.y):(y[0]+y[1])/2,y,S,h),h,S),R=new Set([...b].sort((M,I)=>(I.size??0)-(M.size??0)).slice(0,p).map(M=>M.id));return jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-radar-matrix",className:m("relative size-full min-h-[42rem] min-w-0 overflow-hidden",f),style:{backgroundColor:"hsl(var(--radar-canvas, var(--background)))",backgroundImage:"radial-gradient(circle at 78% 20%, hsl(var(--primary) / 0.08), transparent 32%), radial-gradient(circle at 18% 82%, hsl(var(--radar-series-two, var(--accent-foreground)) / 0.06), transparent 30%)"},children:[jsxRuntime.jsxs("svg",{viewBox:`0 0 ${d} ${c}`,preserveAspectRatio:"none",className:"absolute inset-0 size-full",role:"img","aria-label":g,children:[jsxRuntime.jsxs("g",{"aria-hidden":"true",children:[Array.from({length:13},(M,I)=>{let A=d/12*I,N=c/12*I;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:A,y1:0,x2:A,y2:c,style:{stroke:"hsl(var(--radar-grid, var(--border)) / 0.36)"}}),jsxRuntime.jsx("line",{x1:0,y1:N,x2:d,y2:N,style:{stroke:"hsl(var(--radar-grid, var(--border)) / 0.36)"}})]},I)}),jsxRuntime.jsx("line",{x1:T,y1:0,x2:T,y2:c,strokeWidth:"1.5",style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.64)"}}),jsxRuntime.jsx("line",{x1:0,y1:C,x2:d,y2:C,strokeWidth:"1.5",style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.64)"}})]}),n.map(M=>{let I=VL[M.id];return jsxRuntime.jsxs("g",{"aria-hidden":"true",children:[jsxRuntime.jsx("text",{x:I.x,y:I.y+20,textAnchor:I.anchor,className:"fill-muted-foreground text-[0.8125rem] font-semibold",children:M.title}),V(M.description)&&typeof M.description=="string"?jsxRuntime.jsx("text",{x:I.x,y:I.y+40,textAnchor:I.anchor,className:"fill-muted-foreground text-[0.6875rem]",children:M.description}):null]},M.id)}),b.map((M,I)=>{let A=ba(fa(M.x,x,40,d-40),40,d-40),N=ba(fa(M.y,y,c-48,54),54,c-48),D=M.tone||(I%2===0?"primary":"accent"),E=s===M.id,P=R.has(M.id),W=P?ba(fa(M.size??1,k,5,9),5,9):3.5,H=P?ba(fa(M.size??1,k,14,31),14,31):0,B={fill:$a(D),stroke:"hsl(var(--foreground) / 0.74)"},L={fill:$a(D),filter:`drop-shadow(0 0 0.65rem ${vl(D,.72)})`};return jsxRuntime.jsxs("g",{transform:`translate(${A}, ${N})`,role:l?"button":void 0,tabIndex:l?0:void 0,"aria-label":`${M.label}: ${t.label} ${M.x}, ${o.label} ${M.y}`,"aria-pressed":l?E:void 0,onClick:l?()=>l(M):void 0,onKeyDown:F=>HL(F,M,l),className:m(l&&"cursor-pointer outline-hidden"),children:[E?jsxRuntime.jsx("circle",{r:W+10,fill:"none",strokeWidth:"2",style:{stroke:vl(D,.48)}}):null,jsxRuntime.jsx("circle",{r:W,strokeWidth:"1.25",style:B}),P?jsxRuntime.jsx("text",{y:-W-8,textAnchor:"middle",fontSize:H,fontWeight:"700",style:L,className:"pointer-events-none",children:M.label.slice(0,22)}):null,jsxRuntime.jsx("title",{children:M.description||M.label})]},M.id)}),jsxRuntime.jsx("circle",{cx:T,cy:C,r:"10",style:{fill:"hsl(var(--radar-axis, var(--primary)))"}}),jsxRuntime.jsx("circle",{cx:T,cy:C,r:"3",className:"fill-primary-foreground"}),jsxRuntime.jsx("text",{x:d/2,y:c-12,textAnchor:"middle",className:"fill-muted-foreground text-[0.6875rem]",children:t.label}),jsxRuntime.jsx("text",{x:"14",y:c/2,textAnchor:"middle",transform:`rotate(-90 14 ${c/2})`,className:"fill-muted-foreground text-[0.6875rem]",children:o.label})]}),jsxRuntime.jsxs("div",{className:"absolute bottom-4 left-4 hidden w-44 overflow-hidden rounded-[var(--radius)] border bg-card/95 shadow-xl sm:block",style:{borderColor:"hsl(var(--radar-border, var(--border)))"},"aria-hidden":"true",children:[jsxRuntime.jsxs("div",{className:"flex h-9 items-center justify-between border-b border-border px-3 text-xs font-semibold text-muted-foreground",children:[jsxRuntime.jsx("span",{children:"\u2212"}),jsxRuntime.jsx("span",{children:"100%"}),jsxRuntime.jsx("span",{children:"\uFF0B"})]}),jsxRuntime.jsxs("svg",{viewBox:`0 0 ${d} ${c}`,className:"h-24 w-full",children:[jsxRuntime.jsx("rect",{width:d,height:c,style:{fill:"hsl(var(--radar-canvas, var(--background)))"}}),jsxRuntime.jsx("line",{x1:T,y1:0,x2:T,y2:c,style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.7)"},strokeWidth:"6"}),jsxRuntime.jsx("line",{x1:0,y1:C,x2:d,y2:C,style:{stroke:"hsl(var(--radar-axis, var(--primary)) / 0.7)"},strokeWidth:"6"}),b.map((M,I)=>jsxRuntime.jsx("circle",{cx:ba(fa(M.x,x,40,d-40),40,d-40),cy:ba(fa(M.y,y,c-48,54),54,c-48),r:"8",style:{fill:$a(M.tone||(I%2===0?"primary":"accent"))}},M.id)),jsxRuntime.jsx("rect",{x:d*.22,y:c*.12,width:d*.58,height:c*.62,fill:"none",strokeWidth:"8",style:{stroke:"hsl(var(--primary))"}})]})]}),i.length?jsxRuntime.jsx("div",{className:"absolute bottom-4 left-1/2 hidden -translate-x-1/2 items-center gap-4 rounded-full border border-border bg-card/95 px-4 py-2 text-xs font-semibold shadow-xl md:flex",children:i.map(M=>{let I=M.tone||"muted";return jsxRuntime.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[jsxRuntime.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:$a(I)}}),M.label]},M.id)})}):null]})}a(Xk,"WorkbenchRadarMatrix");function Zk({viewMode:e="list",heading:t,metadata:o,message:r,actions:n,outputs:i,children:s,className:l,...d}){return jsxRuntime.jsxs("article",{...d,"data-monkeys-component":"workbench-task-card","data-view-mode":e,className:m("border-border/70 font-[family-name:var(--font-sans)] text-sm leading-5",e==="grid"?"flex h-full flex-col gap-global rounded-lg border bg-card p-global shadow-sm":"grid items-center gap-global border-b py-global last:border-b-0 lg:grid-cols-2",l),children:[jsxRuntime.jsxs("div",{"data-task-part":"details",className:m("flex min-w-0 flex-col",e==="grid"?"flex-1":"min-h-60"),children:[jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global",children:t}),o!=null&&jsxRuntime.jsx("div",{className:"mb-global flex flex-wrap items-center gap-global text-sm tabular-nums text-muted-foreground [&_span]:text-inherit [&_time]:text-inherit",children:o}),s,r!=null&&jsxRuntime.jsx("div",{className:"mt-global break-words text-sm text-destructive-text",children:r}),n!=null&&jsxRuntime.jsx("div",{className:"mt-auto flex flex-wrap gap-global pt-global",children:n})]}),i!=null&&jsxRuntime.jsx("div",{"data-task-part":"outputs",className:m("min-w-0 w-full",e==="grid"&&"-order-1"),children:i})]})}a(Zk,"WorkbenchTaskCard");function e0({title:e,filters:t,sortOrder:o,viewMode:r,onSortOrderChange:n,onViewModeChange:i,labels:s,disabled:l,className:d}){return jsxRuntime.jsx(cu,{"data-monkeys-component":"workbench-task-toolbar",classNames:{root:"min-h-0 flex-row flex-wrap items-center gap-global border-0 p-0 font-[family-name:var(--font-sans)] text-sm leading-5",end:"max-w-full flex-wrap gap-global"},className:d,end:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t,jsxRuntime.jsxs("div",{className:"flex items-center gap-global",children:[jsxRuntime.jsx(dt,{type:"button",variant:"outline",disabled:l,title:s.sort,icon:o==="latest"?jsxRuntime.jsx(lucideReact.ArrowDownWideNarrow,{}):jsxRuntime.jsx(lucideReact.ArrowUpNarrowWide,{}),className:"h-10 min-w-28 gap-global rounded-lg bg-muted/40 px-global py-global-1/2 text-sm font-medium shadow-none hover:bg-muted/70",onClick:()=>n(o==="latest"?"oldest":"latest"),children:o==="latest"?s.latest:s.oldest}),jsxRuntime.jsx(dt,{type:"button",variant:"outline",disabled:l,icon:r==="list"?jsxRuntime.jsx(lucideReact.Grid2X2,{}):jsxRuntime.jsx(lucideReact.LayoutList,{}),className:"h-10 gap-global rounded-lg bg-muted/40 px-global py-global-1/2 text-sm font-medium shadow-none hover:bg-muted/70",onClick:()=>i(r==="list"?"grid":"list"),children:r==="list"?s.gridView:s.listView})]})]}),children:e})}a(e0,"WorkbenchTaskToolbar");function t0({items:e=[],children:t,hasOutputs:o,viewMode:r="list",ariaLabel:n,previewLabel:i,processingLabel:s,processing:l=false,emptyState:d,onPreview:c,className:p}){let u=r==="grid"?"aspect-square w-full":"aspect-square w-[calc((100%-3*var(--global-spacing))/4)] min-w-32 max-w-48";return jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-task-outputs",role:"region","aria-label":n,tabIndex:0,className:m("flex w-full min-w-0 snap-x snap-proximity items-center gap-global overflow-x-auto py-global-1/2 font-[family-name:var(--font-sans)] text-sm leading-5 focus-visible:outline focus-visible:outline-2",p),children:[t,e.map(g=>g.kind==="media"?c?jsxRuntime.jsx("button",{type:"button",onClick:()=>c(g),"aria-label":g.previewLabel||i,className:m("flex shrink-0 snap-start items-center justify-center overflow-hidden rounded-lg border bg-muted/20 focus-visible:outline focus-visible:outline-2",u),children:g.content},g.id):jsxRuntime.jsx("div",{className:m("flex shrink-0 snap-start items-center justify-center overflow-hidden rounded-lg border bg-muted/20",u),children:g.content},g.id):jsxRuntime.jsx("pre",{className:"h-60 w-full min-w-0 shrink-0 snap-start overflow-auto whitespace-pre-wrap break-words rounded-lg border bg-muted/20 p-global font-[family-name:var(--font-sans)] text-sm leading-5",children:g.content},g.id)),!(o??(e.length>0||!!t))&&(l?jsxRuntime.jsx("div",{role:"status","aria-label":s,className:m("flex shrink-0 items-center justify-center rounded-lg border bg-gradient-to-br from-muted via-background to-muted",u),children:jsxRuntime.jsx("span",{"aria-hidden":"true",className:"size-16 animate-spin rounded-full border-[8px] border-muted-foreground/40 border-t-foreground motion-reduce:animate-none sm:size-20"})}):jsxRuntime.jsx("div",{className:"flex min-h-60 w-full items-center justify-center rounded-lg border border-dashed bg-muted/20 p-global text-center text-sm text-muted-foreground",children:d}))]})}a(t0,"WorkbenchTaskOutputs");function o0({src:e,kind:t,alt:o,expanded:r=false,loading:n=false,failed:i=false,loadingLabel:s,errorLabel:l,onError:d,renderMedia:c}){return c?jsxRuntime.jsx(jsxRuntime.Fragment,{children:c({src:e,kind:t,alt:o,expanded:r,loadingLabel:s,errorLabel:l})}):n?jsxRuntime.jsx("span",{role:"status","aria-label":s,children:jsxRuntime.jsx(lucideReact.Loader2,{"aria-hidden":"true",className:"size-6 animate-spin text-muted-foreground motion-reduce:animate-none"})}):i||!e||t==="3d"?jsxRuntime.jsx("span",{role:"img","aria-label":l,children:jsxRuntime.jsx(lucideReact.ImageOff,{"aria-hidden":"true",className:"size-6 text-muted-foreground"})}):t==="video"?jsxRuntime.jsxs("span",{className:r?"contents":"relative block size-full",children:[jsxRuntime.jsx("video",{src:e,"aria-label":o,controls:r,playsInline:true,preload:"metadata",onError:d,className:r?"max-h-[75vh] max-w-full":"size-full object-contain"}),!r&&jsxRuntime.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"flex size-12 items-center justify-center rounded-full bg-[hsl(var(--monkeys-color-media-overlay)/0.6)] shadow-md sm:size-14",children:jsxRuntime.jsx(lucideReact.Play,{className:"ml-0.5 size-5 !fill-[hsl(var(--monkeys-color-media-foreground))] !stroke-[hsl(var(--monkeys-color-media-foreground))] sm:size-6"})})})]}):jsxRuntime.jsx(Ds,{src:e,alt:o,loading:"lazy",onError:d,className:r?"h-auto w-auto max-h-[75vh] max-w-full":void 0})}a(o0,"WorkbenchTaskMedia");function i0({text:e,labels:t,className:o}){let r=ho.useId(),n=ho.useRef(null),[i,s]=ho.useState(false),[l,d]=ho.useState(false),c=e||t.empty;return ho.useEffect(()=>{s(false);},[c]),ho.useEffect(()=>{let p=n.current;if(!p)return;let u=a(()=>{let f=Number.parseFloat(getComputedStyle(p).lineHeight);d(p.scrollHeight>f*3+1);},"measure");if(u(),typeof ResizeObserver>"u")return;let g=new ResizeObserver(u);return g.observe(p),()=>g.disconnect()},[c]),jsxRuntime.jsxs("div",{"data-monkeys-component":"workbench-task-prompt",className:m("min-w-0 font-[family-name:var(--font-sans)] text-sm leading-5",o),children:[jsxRuntime.jsx("p",{ref:n,id:r,className:m("whitespace-pre-wrap break-words text-sm leading-5 text-foreground [overflow-wrap:anywhere]",!i&&"line-clamp-3"),children:c}),l&&jsxRuntime.jsxs("button",{type:"button","aria-expanded":i,"aria-controls":r,onClick:()=>s(p=>!p),className:"mt-global-1/2 inline-flex min-h-8 items-center gap-global-1/2 rounded-lg px-global-1/2 text-sm font-medium text-foreground underline underline-offset-4 hover:bg-muted focus-visible:outline focus-visible:outline-2",children:[i?t.less:t.more,i?jsxRuntime.jsx(lucideReact.ChevronUp,{"aria-hidden":"true",className:"size-4"}):jsxRuntime.jsx(lucideReact.ChevronDown,{"aria-hidden":"true",className:"size-4"})]})]})}a(i0,"WorkbenchTaskPrompt");function cW({item:e,playLabel:t,selectionMode:o}){let[r,n]=ho.useState(false);if(ho.useEffect(()=>n(false),[e.thumbnailSrc,e.src]),e.notice||e.status==="blocked")return jsxRuntime.jsx("div",{className:"flex size-full items-center justify-center bg-muted p-2 text-center text-xs text-muted-foreground",children:e.notice});let i=r?e.src:e.thumbnailSrc||e.src;return i?e.mediaType==="video"?jsxRuntime.jsxs("div",{"data-history-video-surface":true,className:"group relative size-full bg-[hsl(var(--monkeys-color-media-surface))]",children:[jsxRuntime.jsx("video",{src:i,autoPlay:true,muted:true,playsInline:true,preload:"metadata",onLoadedMetadata:({currentTarget:s})=>{Number.isFinite(s.duration)&&s.duration>0&&(s.currentTime=Math.min(.1,s.duration/2));},onLoadedData:({currentTarget:s})=>{s.currentTime>0&&s.pause();},onSeeked:({currentTarget:s})=>s.pause(),className:"size-full object-contain","aria-label":e.alt}),jsxRuntime.jsx("div",{"data-history-video-overlay":true,"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[hsl(var(--monkeys-color-media-overlay)/0)] transition-colors duration-150 group-hover:bg-[hsl(var(--monkeys-color-media-overlay)/.25)] group-focus-within:bg-[hsl(var(--monkeys-color-media-overlay)/.25)]"}),jsxRuntime.jsx(dt,{ariaLabel:t,"data-history-play":true,tabIndex:o?-1:0,variant:"ghost",size:"lg",iconOnly:true,className:"monkeys-media-overlay-action absolute left-1/2 top-1/2 z-10 size-10 -translate-x-1/2 -translate-y-1/2 p-0 [--monkeys-component-media-action-radius:9999px] [--monkeys-component-media-action-opacity:.55] [--monkeys-component-media-action-hover-opacity:.7] focus-visible:ring-2 focus-visible:ring-[hsl(var(--monkeys-color-media-foreground))]",icon:jsxRuntime.jsx(lucideReact.Play,{className:"size-4 fill-current"})})]}):jsxRuntime.jsx("img",{src:i,alt:e.alt??"",loading:"lazy",onError:()=>{!r&&e.src&&i!==e.src&&n(true);},className:"size-full object-contain opacity-100"}):jsxRuntime.jsx("div",{className:"size-full bg-muted","aria-hidden":"true"})}a(cW,"HistoryMedia");function uW({items:e,loading:t=false,loadingMore:o=false,error:r,hasMore:n=false,pageKey:i,expanded:s,selectedIds:l,selectionMode:d,className:c,itemClassName:p,labels:u,busy:g=false,popupScale:f=1,panelClassName:b,buttonClassName:x,buttonVariant:y="outline",onRetry:k,onLoadMore:w,onExpandedChange:v,onSelectionModeChange:h,onSelectedIdsChange:S,onItemActivate:T,onDelete:C,onItemDragStart:R}){let M=ho.useRef(null),[I,A]=ho.useState(),[N,D]=ho.useState(false),[E,P]=ho.useState(false),[W,H]=ho.useState([]),B=s??N,L=d??E,F=l??W,_=ho.useMemo(()=>new Set(F),[F]),$=ho.useRef(F);$.current=F;let G=Number.isFinite(f)&&f>0?f:1;ho.useLayoutEffect(()=>{if(!B||!M.current)return;let O=0,K=a(()=>{let he=M.current?.getBoundingClientRect();he&&A({left:he.left,width:he.width,bottom:Math.max(0,window.innerHeight-he.bottom)});},"measure"),ne=a(()=>{cancelAnimationFrame(O),O=requestAnimationFrame(K);},"schedule");K();let fe=typeof ResizeObserver=="function"?new ResizeObserver(ne):void 0;return fe?.observe(M.current),window.addEventListener("resize",ne),window.addEventListener("scroll",ne,true),()=>{fe?.disconnect(),cancelAnimationFrame(O),window.removeEventListener("resize",ne),window.removeEventListener("scroll",ne,true);}},[B]),ho.useEffect(()=>{let O=new Set(e.map(ne=>ne.id)),K=F.filter(ne=>O.has(ne));K.length!==F.length&&(H(K),S?.(K));},[e,F,S]);let z=a(O=>{s===void 0&&D(O),v?.(O);},"setExpanded"),re=a(O=>{d===void 0&&P(O),h?.(O),O||Z([]);},"setSelection"),Z=a(O=>{$.current=O,l===void 0&&H(O),S?.(O);},"updateSelection"),ae=a(O=>{if(g||O.selectable===false)return;let K=$.current;Z(K.includes(O.id)?K.filter(ne=>ne!==O.id):[...K,O.id]);},"toggle"),ee=a(O=>{let K=_.has(O.id),ne=O.selectable!==false&&!g;return jsxRuntime.jsxs("div",{"data-history-selection-key":O.id,"data-history-item-id":O.id,role:L?"checkbox":"button","aria-checked":L?K:void 0,"aria-label":L?O.label??u.selectItem:O.alt,"aria-disabled":(L?!ne:O.disabled)||void 0,tabIndex:(L?ne:!O.disabled)?0:void 0,draggable:!!(O.draggable&&!L&&!O.disabled),onDragStart:fe=>{if(!O.draggable||L||O.disabled){fe.preventDefault();return}R?.(fe,O);},onClick:fe=>{L?(fe.stopPropagation(),ae(O)):O.disabled||T?.(O);},onKeyDown:fe=>{(fe.key===" "||fe.key==="Enter")&&(fe.preventDefault(),L?ae(O):O.disabled||T?.(O));},...O.dataAttributes,className:m("group relative aspect-square min-w-0 overflow-hidden rounded-md border border-border/60 bg-transparent outline-hidden transition-[box-shadow,border-color,opacity] focus-visible:ring-2 focus-visible:ring-ring",K&&"border-primary ring-2 ring-primary/70",O.disabled&&"opacity-60",L&&ne&&"cursor-pointer",p),children:[jsxRuntime.jsx(cW,{item:O,playLabel:u.playVideo,selectionMode:L}),L&&ne?jsxRuntime.jsx("span",{className:"pointer-events-none absolute right-1 top-1 z-10 flex items-center justify-center rounded-full bg-background/85 p-0.5",children:jsxRuntime.jsx(ki,{checked:K,controlSize:"sm","aria-hidden":"true",tabIndex:-1,readOnly:true})}):null]},O.id)},"renderItem"),q=a(O=>jsxRuntime.jsx(Sn,{items:e,config:{getItemKey:a(K=>K.id,"getItemKey"),layout:{mode:O,cardWidth:O==="rail"?72:void 0,idealCardWidth:72,gap:8,getItemAspectRatio:a(()=>1,"getItemAspectRatio"),scrollOwner:"parent"},state:{loading:t,loadingMore:o&&n,hasMore:n},loading:{rootMargin:"1px",pageKey:i,variant:"spinner",autoFill:true},windowed:true,appearance:{hover:"none"},labels:{collection:u.ariaLabel,loading:u.loading,loadingMore:u.loadingMore,empty:u.empty}},classNames:{loadMore:"h-px min-h-0 overflow-hidden"},slots:{loadMore:jsxRuntime.jsx("span",{"aria-hidden":"true",className:"block h-px"})},callbacks:{onLoadMore:O==="grid"||!B?w:void 0},renderItem:ee}),"collection"),U=a((O,K,ne,fe=false)=>jsxRuntime.jsx(dt,{icon:jsxRuntime.jsx(O,{className:"size-full"}),iconOnly:true,ariaLabel:K,size:"md",variant:y,className:x,disabled:fe,onClick:ne}),"button"),X=jsxRuntime.jsxs("div",{role:"alert",className:"flex min-h-20 flex-col items-center justify-center gap-1 p-2 text-center text-sm",children:[jsxRuntime.jsx("span",{children:u.loadError}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:u.loadErrorDescription}),k?jsxRuntime.jsx(dt,{size:"sm",variant:"outline",label:u.retry,onClick:k}):null]});return jsxRuntime.jsxs("div",{ref:M,"data-workbench-history-result":true,className:m("relative w-full min-w-0 max-w-full rounded-lg",b,c),children:[e.length?jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2 p-3",children:[U(B?lucideReact.Minimize2:lucideReact.Maximize2,B?u.collapse:u.expand,()=>z(!B)),jsxRuntime.jsx("div",{className:"min-w-0 flex-1",children:q("rail")})]}):t?jsxRuntime.jsx(Kr,{title:u.loading,variant:"spinner",className:"min-h-20 p-2"}):r?X:jsxRuntime.jsx(Pi,{title:u.empty,className:"min-h-20 p-2"}),B&&typeof document<"u"?reactDom.createPortal(jsxRuntime.jsxs("div",{"data-history-expanded":true,className:m("fixed z-50 rounded-lg border border-border bg-card text-card-foreground shadow-xl",b),style:{left:I?.left??0,width:(I?.width??0)/G,bottom:I?.bottom??0,transform:`scale(${G})`,transformOrigin:"left bottom"},children:[jsxRuntime.jsxs("div",{className:"max-h-[50vh] overflow-y-auto p-3",style:{marginBottom:72,maxHeight:"50vh",overflowY:"auto"},children:[q("grid"),r&&e.length?jsxRuntime.jsxs("div",{role:"alert",className:"flex items-center gap-2 text-xs",children:[u.refreshError,k?jsxRuntime.jsx(dt,{size:"sm",label:u.retry,onClick:k}):null]}):null]}),jsxRuntime.jsxs("div",{className:"absolute inset-x-3 bottom-3 flex items-center justify-between gap-2",children:[U(lucideReact.Minimize2,u.collapse,()=>z(false)),jsxRuntime.jsx("div",{className:"flex items-center gap-1.5",children:L?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"rounded-full border border-border px-2 py-1 text-xs",children:u.selectedCount}),U(lucideReact.X,u.exitSelection,()=>re(false),g),C?U(lucideReact.Trash2,u.deleteSelected,()=>{g||C(F);},!F.length||g):null]}):C?U(lucideReact.Trash2,u.enterSelection,()=>re(true),g):null})]})]}),document.body):null]})}a(uW,"WorkbenchHistoryResult");function bW({open:e,title:t,description:o,name:r,nameLabel:n,namePlaceholder:i,createLabel:s,cancelLabel:l,closeLabel:d,creating:c=false,error:p,showError:u=true,className:g,onOpenChange:f,onNameChange:b,onCreate:x}){let y=ho.useId(),k=ho.useRef(null),[w,v]=ho.useState(false),[h,S]=ho.useState(null),T=ho.useRef(false),C=ho.useRef(false);ho.useEffect(()=>{e||(T.current=false,S(null),v(false));},[e]);let R=c,M=a(N=>{!R&&!C.current&&f?.(N);},"close"),I=a(async()=>{if(!(!r.trim()||R||C.current||T.current||!x)){C.current=true,v(true);try{await x();}finally{C.current=false;}}},"create"),A={radius:"lg"};return jsxRuntime.jsx(aa,{open:e,onOpenChange:M,title:t,description:o,closeLabel:d,closeOnEscape:!R,closeOnOverlayClick:!R,showCloseButton:!R,portal:true,initialFocus:"explicit",initialFocusRef:k,className:g,classNames:{panel:"w-full max-w-[420px] gap-4 p-6",header:"border-0 p-0",title:"text-lg font-semibold leading-tight",description:"text-sm text-muted-foreground",body:"overflow-visible p-0",footer:"border-0 p-0"},footer:jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(dt,{size:"lg",appearance:A,className:"text-sm",disabled:R,onClick:()=>M(false),children:l}),jsxRuntime.jsx(dt,{size:"lg",tone:"primary",appearance:{...A,slots:{buttonPrimary:"border-primary bg-primary text-primary-foreground hover:bg-primary/90"}},className:"text-sm",loading:c,disabled:R||!r.trim(),onClick:I,children:s})]}),children:jsxRuntime.jsxs("div",{className:"space-y-4","data-monkeys-component":"create-collection-dialog",children:[jsxRuntime.jsxs("div",{className:"space-y-2 py-2",children:[jsxRuntime.jsx("label",{htmlFor:y,className:"text-sm font-medium leading-5",children:n}),jsxRuntime.jsx(wr,{ref:k,id:y,maxLength:80,"aria-label":n,placeholder:i,value:h??r,disabled:R,onCompositionStart:N=>{T.current=true,S(N.currentTarget.value);},onCompositionEnd:N=>{T.current=false,S(null),b?.(N.currentTarget.value);},onChange:N=>{T.current?S(N.currentTarget.value):b?.(N.currentTarget.value);},onKeyDown:N=>{N.key==="Enter"&&!N.nativeEvent.isComposing&&!T.current&&(N.preventDefault(),I());}})]}),w&&!c&&u&&p&&jsxRuntime.jsx("div",{role:"alert",className:"text-sm text-destructive-text",children:p})]})})}a(bW,"WorkbenchCreateCollectionDialog");function kW({open:e,items:t,selectedId:o,name:r,title:n,description:i,nameLabel:s,namePlaceholder:l,createLabel:d,confirmLabel:c,cancelLabel:p,closeLabel:u,loadingLabel:g,emptyLabel:f,loading:b=false,creating:x=false,adding:y=false,createError:k,confirmError:w,showCreateError:v=true,showConfirmError:h=true,className:S,onOpenChange:T,onSelectedIdChange:C,onNameChange:R,onCreate:M,onConfirm:I}){let A=ho.useId(),N=ho.useRef(null),D=ho.useRef(false),E=ho.useRef(false),[P,W]=ho.useState(null);ho.useEffect(()=>{e||(D.current=false);},[e]);let H=x||y||P!==null,B=t.some(_=>_.id===o),L=a(_=>{!H&&!E.current&&T?.(_);},"close"),F=a(async _=>{let $=_==="create"?M:I;if(!(H||E.current||!$||(_==="create"?!r.trim()||D.current:!B))){E.current=true,W(_);try{await $();}catch{}finally{E.current=false,W(null);}}},"submit");return jsxRuntime.jsx(aa,{open:e,onOpenChange:L,title:n,description:i,closeLabel:u,portal:true,closeOnEscape:!H,closeOnOverlayClick:!H,showCloseButton:!H,initialFocus:"explicit",initialFocusRef:N,className:S,classNames:{panel:"w-full max-w-[480px] gap-global-2 p-6",header:"border-0 p-0",title:"text-lg font-semibold leading-tight",description:"text-sm text-muted-foreground",body:"-m-1 min-h-0 p-1",footer:"border-0 p-0"},footer:jsxRuntime.jsxs("div",{className:"flex justify-end gap-global",children:[jsxRuntime.jsx(dt,{variant:"outline",className:"h-10",appearance:{radius:"lg"},disabled:H,onClick:()=>L(false),children:p}),jsxRuntime.jsx(dt,{variant:"outline",className:"h-10",appearance:{radius:"lg"},disabled:H||!B,loading:y||P==="confirm",onClick:()=>F("confirm"),children:c})]}),children:jsxRuntime.jsxs("div",{className:"flex min-h-0 flex-col gap-global-2","data-monkeys-component":"add-to-collection-dialog","aria-busy":H||b,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-global",children:[jsxRuntime.jsx(wr,{ref:N,id:A,"aria-label":s,placeholder:l,appearance:"shadow",className:"min-w-0 flex-1",value:r,disabled:H,onChange:_=>R?.(_.currentTarget.value),onCompositionStart:()=>{D.current=true;},onCompositionEnd:()=>{D.current=false;},onKeyDown:_=>{_.key==="Enter"&&!_.nativeEvent.isComposing&&!D.current&&(_.preventDefault(),F("create"));}}),jsxRuntime.jsx(dt,{variant:"outline",appearance:{radius:"lg"},icon:jsxRuntime.jsx(lucideReact.FolderPlus,{}),className:"h-10 shrink-0",disabled:H||!r.trim(),loading:x||P==="create",onClick:()=>F("create"),children:d})]}),v&&k&&jsxRuntime.jsx("p",{role:"alert",className:"text-sm text-destructive-text",children:k}),jsxRuntime.jsx("div",{className:"-m-1 flex max-h-80 min-h-0 flex-col gap-global overflow-y-auto p-1",role:"group","aria-label":n,children:t.length===0?jsxRuntime.jsx("p",{role:"status",className:"rounded-lg border border-dashed border-border px-global-2 py-global-2 text-center text-sm text-muted-foreground",children:b?g:f}):t.map(_=>jsxRuntime.jsx(dt,{variant:"outline",icon:jsxRuntime.jsx(lucideReact.FolderOpen,{className:"size-4 shrink-0","aria-hidden":"true"}),endIcon:o===_.id?jsxRuntime.jsx(lucideReact.Check,{className:"size-4 shrink-0","aria-hidden":"true"}):void 0,label:_.name,classNames:{label:"min-w-0 flex-1 truncate text-left"},"aria-pressed":o===_.id,disabled:H,className:m("flex h-10 w-full shrink-0 items-center justify-start gap-global rounded-lg border px-global-2 py-global text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",o===_.id?"border-foreground bg-muted text-foreground":"border-border bg-background text-foreground hover:bg-muted"),onClick:()=>C?.(_.id)},_.id))}),h&&w&&jsxRuntime.jsx("p",{role:"alert",className:"text-sm text-destructive-text",children:w})]})})}a(kW,"WorkbenchAddToCollectionDialog");var SW={width:"var(--monkeys-component-app-shell-sidebar-width, 16rem)",borderRadius:"var(--monkeys-component-app-shell-sidebar-radius, var(--radius, 0.75rem))",background:"var(--monkeys-component-app-shell-sidebar-background, hsl(var(--card)))",color:"var(--monkeys-component-app-shell-sidebar-foreground, hsl(var(--card-foreground)))",borderColor:"var(--monkeys-component-app-shell-sidebar-border-color, hsl(var(--border)))",boxShadow:"var(--monkeys-component-app-shell-sidebar-shadow, none)"},TW={padding:"var(--monkeys-component-app-shell-sidebar-header-padding, var(--global-spacing, 0.75rem))",borderColor:"var(--monkeys-component-app-shell-sidebar-header-border-color, hsl(var(--border)))"},NW={padding:"var(--monkeys-component-app-shell-sidebar-navigation-padding, var(--global-spacing, 0.75rem))","--monkeys-component-accordion-item-border-color":"transparent"},RW={padding:"var(--monkeys-component-app-shell-sidebar-footer-padding, var(--global-spacing, 0.75rem))",background:"var(--monkeys-component-app-shell-sidebar-footer-background, hsl(var(--muted) / 0.22))",borderColor:"var(--monkeys-component-app-shell-sidebar-footer-border-color, hsl(var(--border)))"},lb=ho.forwardRef(a(function({navigation:t,header:o,footer:r,width:n,className:i,classNames:s,style:l,"aria-label":d="Application navigation",...c},p){return jsxRuntime.jsxs("aside",{ref:p,"aria-label":d,"data-app-shell-sidebar":"",className:m("relative isolate flex h-full min-h-0 shrink-0 flex-col overflow-hidden border",s?.root,i),style:{...SW,...n===void 0?null:{width:n},...l},...c,children:[o?jsxRuntime.jsx("div",{"data-slot":"header",className:m("shrink-0 border-b",s?.header),style:TW,children:o}):null,jsxRuntime.jsx("div",{"data-slot":"navigation",className:m("relative min-h-0 flex-1 overflow-hidden",s?.navigation),style:NW,children:t}),r?jsxRuntime.jsx("div",{"data-slot":"footer",className:m("shrink-0 border-t",s?.footer),style:RW,children:r}):null]})},"AppShellSidebar"));lb.displayName="AppShellSidebar";var IW={preset:"soft",density:"compact",radius:"lg",border:"subtle",background:"soft"},p0={default:"rounded-md",none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"};function DW(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",className:"h-3 w-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M20 6 9 17l-5-5"})})}a(DW,"CheckIcon");function PW(){return jsxRuntime.jsxs("svg",{"aria-hidden":"true",className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"19",cy:"12",r:"1"}),jsxRuntime.jsx("circle",{cx:"5",cy:"12",r:"1"})]})}a(PW,"MoreIcon");function db(e,t){return e?jsxRuntime.jsx("span",{className:m("inline-flex h-4 w-4 shrink-0 items-center justify-center",t),children:e}):null}a(db,"renderIcon");function EW(e){return e.options.find(t=>t.value===e.value)?.label??e.value}a(EW,"getCurrentOptionLabel");function AW({classNames:e,menuRadius:t,selector:o}){if(o.visible===false||o.options.length===0)return null;let r=p0[t],n=EW(o);return jsxRuntime.jsxs(Bt__namespace.Sub,{children:[jsxRuntime.jsxs(Bt__namespace.SubTrigger,{disabled:o.disabled,className:m("relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[state=open]:bg-[hsl(var(--accent))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r,e?.subTrigger),children:[db(o.icon),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:o.label}),jsxRuntime.jsx("span",{className:"ml-auto min-w-0 max-w-[7rem] truncate text-xs text-[hsl(var(--muted-foreground))]",children:n})]}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.SubContent,{sideOffset:8,className:m("z-50 min-w-40 border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",r,o.contentWidthClassName,e?.subContent),children:jsxRuntime.jsx(Bt__namespace.RadioGroup,{value:o.value,onValueChange:o.onChange,children:o.options.map(i=>jsxRuntime.jsxs(Bt__namespace.RadioItem,{value:i.value,disabled:i.disabled,className:m("relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 pl-8 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r,e?.item),children:[jsxRuntime.jsx(Bt__namespace.ItemIndicator,{className:"absolute left-2 inline-flex h-4 w-4 items-center justify-center",children:jsxRuntime.jsx(DW,{})}),db(i.icon,e?.itemIcon),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:i.label})]},i.value))})})})]})}a(AW,"UserAccountMenuSelector");function m0({align:e="end",appearance:t=IW,ariaLabel:o,className:r,classNames:n,contentWidthClassName:i="w-56",fallbackName:s="User",items:l=[],menuRadius:d="default",selectors:c=[],side:p="bottom",sideOffset:u=8,triggerEndIcon:g,triggerTitle:f,triggerVariant:b="avatar",user:x}){let y=x.name?.trim()||s,k=p0[d],w=c.filter(C=>C.visible!==false&&C.options.length>0),v=l.filter(C=>C.visible!==false),h=w.length>0||v.length>0,S=jsxRuntime.jsx(bc,{appearance:t,alt:x.avatarAlt??y,className:m("h-8 w-8",n?.avatar),initials:x.initials,name:y,size:"sm",src:x.avatarUrl}),T=b==="profile";return jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx(dt,{appearance:t,ariaLabel:o??y,className:m(T?"h-auto w-full justify-start rounded-lg border-transparent bg-transparent px-2 py-2 text-left shadow-none transition-all hover:bg-[hsl(var(--muted))]/60":"h-9 w-9 overflow-visible rounded-md border-transparent bg-transparent p-0 shadow-none transition-all hover:ring-2 hover:ring-[hsl(var(--ring))]/20",r,n?.root,n?.trigger),classNames:{icon:"h-8 w-8",label:T?"min-w-0 flex-1 text-left":void 0},endIcon:T?g??jsxRuntime.jsx(PW,{}):void 0,icon:S,iconOnly:!T,label:T?jsxRuntime.jsxs("span",{className:"flex min-w-0 flex-col items-start",children:[jsxRuntime.jsx("span",{className:"max-w-full truncate text-sm font-medium leading-none text-[hsl(var(--foreground))]",children:y}),x.secondaryText?jsxRuntime.jsx("span",{className:"mt-1 max-w-full truncate text-xs leading-none text-[hsl(var(--muted-foreground))]",children:x.secondaryText}):null]}):void 0,title:f??y,tone:"muted"})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{align:e,side:p,sideOffset:u,className:m("z-50 border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",i,k,n?.content),children:[jsxRuntime.jsx(Bt__namespace.Label,{className:m("px-2 py-1.5 font-normal",n?.label),children:jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[S,jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-col",children:[jsxRuntime.jsx("span",{className:m("truncate text-sm font-medium leading-none",n?.userName),children:y}),x.secondaryText?jsxRuntime.jsx("span",{className:m("truncate pt-1 text-xs leading-none text-[hsl(var(--muted-foreground))]",n?.secondaryText),children:x.secondaryText}):null]})]})}),h?jsxRuntime.jsx(Bt__namespace.Separator,{className:m("my-1 h-px bg-[hsl(var(--border))]",n?.separator)}):null,w.map((C,R)=>jsxRuntime.jsx(AW,{classNames:n,menuRadius:d,selector:C},C.id??`selector-${R}`)),w.length>0&&v.length>0?jsxRuntime.jsx(Bt__namespace.Separator,{className:m("my-1 h-px bg-[hsl(var(--border))]",n?.separator)}):null,v.map(C=>jsxRuntime.jsxs("div",{children:[C.separatorBefore?jsxRuntime.jsx(Bt__namespace.Separator,{className:m("my-1 h-px bg-[hsl(var(--border))]",n?.separator)}):null,jsxRuntime.jsxs(Bt__namespace.Item,{disabled:C.disabled,onSelect:C.disabled?void 0:C.onSelect,className:m("relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",k,C.tone==="danger"&&"text-[hsl(var(--destructive))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--destructive))] focus:text-[hsl(var(--destructive))]",n?.item,C.tone==="danger"&&n?.dangerItem),children:[db(C.icon,n?.itemIcon),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:C.label}),C.shortcut?jsxRuntime.jsx("span",{className:"ml-3 shrink-0 text-xs text-[hsl(var(--muted-foreground))]",children:C.shortcut}):null]})]},C.id))]})})]})}a(m0,"UserAccountMenu");function De(...e){return e.filter(Boolean).join(" ")}a(De,"cn");function Cl({active:e,disabled:t,icon:o,postfix:r,onClick:n,className:i,children:s}){return jsxRuntime.jsxs("button",{type:"button","aria-disabled":t,"aria-pressed":e,disabled:t,className:De("flex w-full cursor-pointer select-none items-center gap-2 rounded-xl border p-2 text-left text-xs text-[hsl(var(--foreground))] transition-colors",e?"border-[hsl(var(--input))] bg-[hsl(var(--muted))] font-bold":t?"border-transparent":"border-transparent hover:border-[hsl(var(--input))]/60 hover:bg-[hsl(var(--muted))]/60",t&&"!cursor-not-allowed opacity-60",i),onClick:n,children:[jsxRuntime.jsx("div",{className:"w-[20px] [&_svg]:h-[16px] [&_svg]:w-[16px]",children:o}),jsxRuntime.jsx("span",{className:"text-sm",children:s}),r]})}a(Cl,"NavButton");function LW({logo:e,tabs:t,activeTab:o,onTabChange:r,user:n,onLogout:i,logoutLabel:s="\u9000\u51FA\u767B\u5F55",userMenuItems:l,extra:d,className:c}){let p=a(u=>u.split(" ").map(g=>g[0]).join("").toUpperCase().slice(0,2),"getUserInitials");return jsxRuntime.jsxs("header",{className:De("flex h-[72px] w-full shrink-0 items-center justify-between gap-4 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]",c),children:[jsxRuntime.jsxs("div",{className:"flex shrink-0 cursor-pointer items-center gap-2",onClick:e.onClick,children:[jsxRuntime.jsx("div",{className:De("flex h-8 w-8 items-center justify-center rounded-lg overflow-hidden",e.url?"bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),children:e.url?jsxRuntime.jsx("img",{src:e.url,alt:e.title,className:"h-full w-full object-contain"}):jsxRuntime.jsx("span",{className:"text-sm font-bold",children:e.title.charAt(0)})}),jsxRuntime.jsx("span",{className:"text-lg font-semibold whitespace-nowrap",children:e.title})]}),t&&t.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"h-1/2 w-px bg-[hsl(var(--border))]"}),jsxRuntime.jsx("div",{className:"flex flex-1 items-center",children:jsxRuntime.jsx("div",{className:"inline-flex h-9 items-center gap-1 rounded-md bg-transparent p-1",children:t.map(u=>jsxRuntime.jsx("button",{className:De("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all",u.id===o?"bg-[hsl(var(--muted))] text-[hsl(var(--foreground))] shadow-sm":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--muted))]/50"),onClick:()=>r?.(u.id),children:u.label},u.id))})})]}),(!t||t.length===0)&&jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-4",children:[d,n&&jsxRuntime.jsxs(Bt__namespace.Root,{children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-md hover:ring-2 hover:ring-[hsl(var(--ring))]/20 transition-all overflow-hidden focus-visible:outline-hidden",children:n.photo?jsxRuntime.jsx("img",{src:n.photo,alt:n.name,className:"h-8 w-8 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium",children:n.name?p(n.name):"U"})})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsxs(Bt__namespace.Content,{className:"z-50 w-52 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",sideOffset:5,align:"end",children:[jsxRuntime.jsxs(Bt__namespace.Label,{className:"flex items-center gap-2 px-2 py-1.5 font-normal",children:[n.photo?jsxRuntime.jsx("img",{src:n.photo,alt:n.name,className:"h-8 w-8 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium",children:n.name?p(n.name):"U"}),jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium leading-none",children:n.name}),n.email&&jsxRuntime.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] leading-none mt-1",children:n.email})]})]}),jsxRuntime.jsx(Bt__namespace.Separator,{className:"h-px bg-[hsl(var(--border))] my-1"}),jsxRuntime.jsxs(Bt__namespace.Group,{children:[l,jsxRuntime.jsxs(Bt__namespace.Item,{className:"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-[hsl(var(--destructive))] outline-hidden transition-colors hover:bg-[hsl(var(--accent))]",onSelect:()=>i?.(),children:[jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),jsxRuntime.jsx("polyline",{points:"16 17 21 12 16 7"}),jsxRuntime.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),s]})]})]})})]})]})]})}a(LW,"AppHeader");function WW({logo:e,navItems:t,activeItemId:o,onNavigate:r,account:n,onLogout:i,logoutLabel:s="\u9000\u51FA\u767B\u5F55",footer:l,defaultExpandedGroups:d,className:c}){return jsxRuntime.jsxs("div",{className:De("flex w-[13.7rem] shrink-0 flex-col justify-between gap-[var(--global-spacing,0.75rem)] overflow-y-hidden rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-5",c),children:[e&&jsxRuntime.jsxs("div",{className:"flex shrink-0 cursor-pointer items-center gap-2",onClick:e.onClick,children:[jsxRuntime.jsx("div",{className:De("flex h-8 w-8 items-center justify-center rounded-lg overflow-hidden",e.url?"bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),children:e.url?jsxRuntime.jsx("img",{src:e.url,alt:e.title,className:"h-full w-full object-contain"}):jsxRuntime.jsx("span",{className:"text-sm font-bold",children:e.title.charAt(0)})}),jsxRuntime.jsx("span",{className:"text-lg font-semibold whitespace-nowrap",children:e.title})]}),jsxRuntime.jsx(zW,{items:t,activeItemId:o,onNavigate:r,defaultExpandedGroups:d}),(n||l)&&jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[n&&jsxRuntime.jsx("div",{className:"flex w-full flex-col gap-2 rounded-lg bg-[hsl(var(--muted))] p-2 shadow-sm",children:jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between px-3 py-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[n.photo?jsxRuntime.jsx("img",{src:n.photo,alt:n.name,className:"h-5 w-5 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-[10px] font-medium",children:n.name?n.name.charAt(0).toUpperCase():"U"}),jsxRuntime.jsx("span",{className:"text-xs font-medium truncate max-w-[100px]",children:n.name})]}),i&&jsxRuntime.jsx("button",{onClick:i,className:"flex items-center justify-center text-[hsl(var(--destructive))] hover:opacity-80 transition-opacity",title:s,children:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),jsxRuntime.jsx("polyline",{points:"16 17 21 12 16 7"}),jsxRuntime.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})})]})}),l]})]})}a(WW,"AppSidebar");function zW({items:e,activeItemId:t,onNavigate:o,defaultExpandedGroups:r}){let[n,i]=ho.useState(()=>{let p={};return (r??e.map(u=>u.id)).forEach(u=>{p[u]=true;}),p}),[s,l]=ho.useState(t);ho.useEffect(()=>{t!==void 0&&l(t);},[t]);let d=a(p=>{i(u=>({...u,[p]:!u[p]}));},"toggle"),c=t??s;return jsxRuntime.jsxs("div",{className:"h-full flex-1 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[jsxRuntime.jsx("style",{children:".monkeys-sidebar-nav::-webkit-scrollbar { display: none; }"}),jsxRuntime.jsx("div",{className:"monkeys-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]",children:e.map(p=>{if(p.children&&p.children.length>0){let u=n[p.id]??true;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Cl,{active:p.id===c,disabled:p.disabled,icon:p.icon,onClick:()=>d(p.id),postfix:jsxRuntime.jsx("div",{className:"flex flex-1 justify-end",children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-[hsl(var(--foreground))] transition-transform duration-200",style:{transform:u?"rotate(90deg)":"rotate(0deg)"},children:jsxRuntime.jsx("path",{d:"m9 18 6-6-6-6"})})}),children:p.label}),u&&!p.disabled&&jsxRuntime.jsx("div",{className:"flex flex-col gap-1 mt-1",children:p.children.map(g=>jsxRuntime.jsx(Cl,{active:g.id===c,disabled:g.disabled,onClick:()=>{l(g.id),o?.(g.id);},children:g.label},g.id))})]},p.id)}return jsxRuntime.jsx(Cl,{icon:p.icon,active:p.id===c,disabled:p.disabled,onClick:()=>{l(p.id),o?.(p.id);},children:p.label},p.id)})})]})}a(zW,"SidebarNavList");function y0({header:e,sidebar:t,children:o,flush:r=false,contentFrame:n=true,className:i}){return jsxRuntime.jsxs("div",{className:De("flex h-screen flex-col gap-[var(--global-spacing,0.75rem)] overflow-hidden p-[var(--global-spacing,0.75rem)]",i),style:{backgroundColor:"hsl(var(--muted))"},children:[e||null,jsxRuntime.jsxs("div",{className:"flex flex-1 gap-[var(--global-spacing,0.75rem)] overflow-hidden min-h-0",children:[t||null,jsxRuntime.jsx("main",{className:De("flex-1 min-h-0 overflow-hidden",n&&"rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))]",!r&&"overflow-y-auto"),children:r?o:jsxRuntime.jsx("div",{className:"h-full overflow-y-auto",children:o})})]})]})}a(y0,"AppLayout");var OW="13.7rem",FW="4.25rem",HW="15rem",VW="cubic-bezier(0.22, 1, 0.36, 1)",_W=72,GW=56,$W=120,x0=64,jW=12,UW=8,KW=44,qW=36,ur={preset:"soft",density:"compact",radius:"lg",border:"subtle",background:"soft"},YW={none:{all:"rounded-none",left:"!rounded-none",right:"!rounded-none"},sm:{all:"rounded-sm",left:"!rounded-l-sm !rounded-r-none",right:"!rounded-l-none !rounded-r-sm"},md:{all:"rounded-md",left:"!rounded-l-md !rounded-r-none",right:"!rounded-l-none !rounded-r-md"},lg:{all:"rounded-lg",left:"!rounded-l-lg !rounded-r-none",right:"!rounded-l-none !rounded-r-lg"},xl:{all:"rounded-xl",left:"!rounded-l-xl !rounded-r-none",right:"!rounded-l-none !rounded-r-xl"},full:{all:"rounded-full",left:"!rounded-l-full !rounded-r-none",right:"!rounded-l-none !rounded-r-full"}};function XW(e){return typeof e!="number"||!Number.isFinite(e)?_W:Math.min($W,Math.max(GW,Math.round(e)))}a(XW,"clampHeadbarHeight");function QW(e){return e<=x0?UW:jW}a(QW,"getHeadbarVerticalPaddingPx");function ZW(e){return e<=x0?qW:KW}a(ZW,"getHeadbarLogoSizePx");function ju(e="default",t="all"){return e==="default"?t==="left"?"rounded-l-lg rounded-r-none":t==="right"?"rounded-l-none rounded-r-lg":"rounded-lg":YW[e][t]}a(ju,"getHeadbarMenuRadiusClass");function JW(e="boxed",t="center"){let o=t==="center"?"grid-cols-[minmax(max-content,1fr)_minmax(0,max-content)_minmax(max-content,1fr)]":"grid-cols-[max-content_minmax(0,1fr)_max-content]";return De(e==="full-bleed"?"sticky top-0 z-40 grid w-full shrink-0 items-center gap-4 rounded-none border-b border-x-0 border-t-0 border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]":"sticky top-0 z-40 grid w-full shrink-0 items-center gap-4 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]",o)}a(JW,"getHeadbarFrameClass");function e3(e="boxed",t,o="card"){let r=QW(t),i={height:`var(--monkeys-component-navigation-headbar-height, ${t}px)`,minHeight:`var(--monkeys-component-navigation-headbar-height, ${t}px)`,paddingTop:`${r}px`,paddingBottom:`${r}px`,background:"var(--monkeys-component-navigation-headbar-frame-background, hsl(var(--background)))",color:"var(--monkeys-component-navigation-headbar-frame-foreground, hsl(var(--foreground)))",borderColor:o==="glassy"?"var(--monkeys-component-navigation-headbar-frame-border-color, rgb(255 255 255 / 0.5))":"var(--monkeys-component-navigation-headbar-frame-border-color, hsl(var(--input)))",borderRadius:e==="full-bleed"?"0":"var(--monkeys-component-navigation-headbar-frame-radius, var(--radius, 0.75rem))",boxShadow:o==="glassy"?"var(--monkeys-component-navigation-headbar-frame-shadow, inset 0 0 0 0 rgb(0 0 0 / 0.1))":"var(--monkeys-component-navigation-headbar-frame-shadow, none)",backdropFilter:`blur(var(--monkeys-component-navigation-headbar-frame-backdrop-blur, ${o==="glassy"?"45px":"0px"}))`};return e==="full-bleed"&&(i.marginLeft="calc(var(--global-spacing,0.75rem) * -1)",i.marginRight="calc(var(--global-spacing,0.75rem) * -1)",i.marginTop="calc(var(--global-spacing,0.75rem) * -1)",i.width="calc(100% + (var(--global-spacing,0.75rem) * 2))"),i}a(e3,"getHeadbarFrameStyle");function t3(e="center"){return e==="left"?"justify-start":e==="right"?"justify-end":"justify-center"}a(t3,"getHeadbarNavClass");function Uu(e,t=true){return {height:"var(--monkeys-component-navigation-headbar-item-height, 2.25rem)",borderRadius:t?"var(--monkeys-component-navigation-headbar-item-radius, var(--radius, 0.5rem))":void 0,paddingInline:"var(--monkeys-component-navigation-headbar-item-padding-inline, 0.75rem)",columnGap:"var(--monkeys-component-navigation-headbar-item-gap, 0.375rem)",color:e?"var(--monkeys-component-navigation-headbar-item-active-foreground, hsl(var(--foreground)))":"var(--monkeys-component-navigation-headbar-item-foreground, hsl(var(--muted-foreground)))",background:e?"var(--monkeys-component-navigation-headbar-item-active-background, hsl(var(--muted)))":"transparent",borderColor:e?"var(--monkeys-component-navigation-headbar-item-active-border-color, transparent)":"transparent",fontSize:"var(--monkeys-component-navigation-headbar-item-font-size, 0.875rem)",fontWeight:"var(--monkeys-component-navigation-headbar-item-font-weight, 500)"}}a(Uu,"getHeadbarItemStyle");function o3(e,t=true){return {...Uu(e,t),paddingInline:void 0,columnGap:void 0}}a(o3,"getHeadbarCompoundStyle");function v0(e,t){for(let o of e)if(o.id===t||Tl(o,t))return o.id;return t}a(v0,"findNavigationRootId");function Tl(e,t){return t?e.id===t?true:e.children?.some(o=>Tl(o,t))??false:false}a(Tl,"containsNavigationItem");function r3(e,t){return e.children?.find(o=>Tl(o,t))}a(r3,"findActiveNavigationBranch");function f0(e){return e.title||(typeof e.label=="string"?e.label:void 0)}a(f0,"getNavigationActionTitle");function b0({actions:e,compact:t}){return e.length?t?jsxRuntime.jsx("div",{className:"flex flex-col items-center gap-2",children:e.map(o=>{let r=f0(o);return jsxRuntime.jsx(To,{appearance:ur,content:o.label,placement:"right",portal:true,children:jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",iconOnly:true,icon:o.icon,onClick:o.onClick,title:r,ariaLabel:r,className:De("h-10 w-10 rounded-lg border-transparent text-[hsl(var(--muted-foreground))] shadow-none","hover:-translate-y-0.5 hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]","active:translate-y-0 active:scale-[0.96]")})},o.id)})}):jsxRuntime.jsx("div",{className:"flex flex-col gap-2",children:e.map(o=>jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",icon:o.icon,label:jsxRuntime.jsx("span",{className:"truncate",children:o.label}),onClick:o.onClick,title:f0(o),className:De("h-9 w-full justify-start gap-2.5 rounded-lg border-transparent px-3 text-left text-[13px] text-[hsl(var(--muted-foreground))] shadow-none","hover:-translate-y-0.5 hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))]/70 hover:text-[hsl(var(--foreground))]","active:translate-y-0 active:scale-[0.985]")},o.id))}):null}a(b0,"NavigationLayoutActionButtons");function w0({activeItemId:e,items:t,onNavigate:o,revealRequest:r}){let n=ho.useRef(null),[i,s]=ho.useState({}),l=r?t.some(p=>Tl(p,r.id)&&!p.disabled):false,d=a(p=>{s(u=>({...u,[p]:!u[p]}));},"toggleRoot");ho.useEffect(()=>{if(!r||!l)return;s(u=>({...u,[r.id]:true}));let p=window.requestAnimationFrame(()=>{let u=n.current?.querySelector(`[data-navigation-sidebar-item-id="${CSS.escape(r.id)}"]`);u instanceof HTMLElement&&u.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"});});return ()=>window.cancelAnimationFrame(p)},[l,r]);let c=a((p,u=0)=>p.map(g=>{let f=!!g.children?.length,b=Tl(g,e),x=!g.disabled&&(i[g.id]??b);return jsxRuntime.jsxs("div",{"data-navigation-sidebar-item-id":g.id,children:[jsxRuntime.jsx(Cl,{active:b,className:u>0?"pl-3":void 0,disabled:g.disabled,icon:g.icon,onClick:()=>f?d(g.id):o?.(g.id),postfix:f?jsxRuntime.jsx("div",{className:"flex flex-1 justify-end",children:jsxRuntime.jsx(ub,{open:false,sideways:true,className:"text-[hsl(var(--foreground))] transition-transform duration-200",style:{transform:x?"rotate(90deg)":"rotate(0deg)"}})}):void 0,children:g.label}),f&&x?jsxRuntime.jsx("div",{className:"mt-1 ml-3 flex flex-col gap-1 border-l border-[hsl(var(--input))] pl-2",children:c(g.children??[],u+1)}):null]},g.id)}),"renderItems");return jsxRuntime.jsxs("div",{className:"h-full flex-1 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[jsxRuntime.jsx("style",{children:".monkeys-navigation-sidebar-nav::-webkit-scrollbar { display: none; }"}),jsxRuntime.jsx("div",{ref:n,className:"monkeys-navigation-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]",children:c(t)})]})}a(w0,"SidebarNavigationList");function g0({collapsed:e,logo:t,title:o}){if(!t)return null;let r=o??t.title,n=jsxRuntime.jsx("div",{className:De("flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",t.url?"bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),children:t.url?jsxRuntime.jsx("img",{src:t.url,alt:t.title,className:"h-full w-full object-contain"}):jsxRuntime.jsx("span",{className:"text-sm font-bold",children:t.title.charAt(0)})});return e?jsxRuntime.jsx(To,{appearance:ur,content:r,placement:"right",portal:true,children:jsxRuntime.jsx(dt,{appearance:ur,ariaLabel:typeof r=="string"?r:t.title,className:"h-10 w-10 rounded-lg border-transparent bg-transparent p-0 shadow-none hover:bg-[hsl(var(--muted))]/60",icon:n,iconOnly:true,onClick:t.onClick,title:typeof r=="string"?r:t.title,tone:"muted"})}):jsxRuntime.jsx(dt,{appearance:ur,ariaLabel:t.title,className:"h-auto w-full justify-start gap-3 border-transparent bg-transparent p-0 text-left shadow-none hover:bg-transparent",classNames:{icon:"h-9 w-9"},icon:n,label:jsxRuntime.jsx("span",{className:"min-w-0 truncate text-sm font-semibold text-[hsl(var(--foreground))]",children:r}),onClick:t.onClick,title:typeof r=="string"?r:t.title,tone:"muted"})}a(g0,"SidebarBrand");function n3({accountMenu:e,activeItemId:t,actions:o=[],collapsed:r,collapsedAccountMenu:n,footer:i,header:s,items:l,logo:d,onCollapsedChange:c,onNavigate:p,onRevealRoot:u,revealRequest:g,title:f}){if(r){let b=v0(l,t);return jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col rounded-xl border border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] p-2 shadow-sm",children:[jsxRuntime.jsx("div",{className:"mb-3 flex shrink-0 justify-center",children:s??jsxRuntime.jsx(g0,{collapsed:true,logo:d,title:f})}),jsxRuntime.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center gap-2 overflow-y-auto pb-3",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:l.map(x=>{let y=b===x.id;return jsxRuntime.jsx(To,{appearance:ur,content:x.label,placement:"right",portal:true,children:jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",active:y,disabled:x.disabled,iconOnly:true,icon:x.icon,onClick:()=>{x.disabled||(u?.(x.id),c?.(false),!x.children?.length&&p?.(x.id));},title:typeof x.label=="string"?x.label:void 0,ariaLabel:typeof x.label=="string"?x.label:x.id,className:De("h-10 w-10 rounded-lg border text-[hsl(var(--muted-foreground))] shadow-none","hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.96]",y?"border-[hsl(var(--input))] bg-[hsl(var(--muted))] text-[hsl(var(--foreground))] shadow-sm":"border-transparent hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))]/70 hover:text-[hsl(var(--foreground))]")})},x.id)})}),jsxRuntime.jsxs("div",{className:"-mx-2 mt-2 border-t border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] px-2 pt-2.5 pb-0.5",children:[jsxRuntime.jsx(b0,{actions:o,compact:true}),n?jsxRuntime.jsx("div",{className:"mt-2 flex justify-center border-t border-[hsl(var(--input))] pt-2",children:n}):null]})]})}return jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col justify-between gap-0 overflow-y-hidden rounded-xl border border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] px-5 pt-5 pb-1.5",children:[jsxRuntime.jsx("div",{className:"mb-4 shrink-0",children:s??jsxRuntime.jsx(g0,{logo:d,title:f})}),jsxRuntime.jsx(w0,{activeItemId:t,items:l,onNavigate:p,revealRequest:g}),jsxRuntime.jsxs("div",{className:"-mx-5 mt-2 border-t border-[hsl(var(--input))] bg-[var(--monkeys-component-navigation-sidebar-background,hsl(var(--background)))] px-4 pt-2.5 pb-1",children:[jsxRuntime.jsx(b0,{actions:o,compact:false}),i,e?jsxRuntime.jsx("div",{className:"mt-2 border-t border-[hsl(var(--input))] pt-2",children:e}):null]})]})}a(n3,"Sidebar");function ub({className:e,open:t,sideways:o=false,style:r}){return jsxRuntime.jsx("svg",{"aria-hidden":"true",className:De("h-4 w-4 shrink-0",!o&&"transition-transform duration-200",!o&&t&&"rotate-180",e),style:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:o?"m9 18 6-6-6-6":"m6 9 6 6 6-6"})})}a(ub,"HeadbarChevronIcon");function a3(e,t){if(typeof e!="string"||typeof t!="string")return;let o=e.trim(),r=t.trim();return o&&r?`${o} / ${r}`:void 0}a(a3,"getHeadbarSummaryTitle");var h0="relative flex w-full min-w-0 cursor-pointer select-none items-center gap-2.5 px-3 py-2 text-sm outline-hidden transition-colors hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] focus:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] focus:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] data-[highlighted]:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] data-[highlighted]:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))]",k0={width:"max-content",maxWidth:"min(20rem, var(--radix-dropdown-menu-content-available-width))",background:"var(--monkeys-component-navigation-headbar-menu-background, hsl(var(--monkeys-color-menu-surface)))",borderColor:"var(--monkeys-component-navigation-headbar-menu-border-color, var(--monkeys-component-overlay-border-color, hsl(var(--monkeys-color-border))))",color:"var(--monkeys-component-navigation-headbar-menu-foreground, hsl(var(--monkeys-color-popover-foreground)))",boxShadow:"var(--monkeys-component-navigation-headbar-menu-shadow, var(--monkeys-component-overlay-menu-shadow, 0 10px 15px -3px rgb(0 0 0 / 0.1)))",backdropFilter:"blur(var(--monkeys-component-navigation-headbar-menu-backdrop-blur, var(--monkeys-component-overlay-backdrop-blur, 0px)))",WebkitBackdropFilter:"blur(var(--monkeys-component-navigation-headbar-menu-backdrop-blur, var(--monkeys-component-overlay-backdrop-blur, 0px)))"};function C0({activeItemId:e,items:t,menuContentRadiusClass:o,menuItemRadiusClass:r,onNavigate:n,onNavigateComplete:i,useTokenRadius:s}){let l=ke();return t.map(d=>{let c=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[d.icon?jsxRuntime.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center text-[hsl(var(--muted-foreground))]",children:d.icon}):null,jsxRuntime.jsx("span",{className:De("min-w-0 truncate",!!d.children?.length&&"flex-1"),children:d.headbarLabel??d.label})]});return d.children?.length?jsxRuntime.jsxs(Bt__namespace.Sub,{children:[jsxRuntime.jsxs(Bt__namespace.SubTrigger,{disabled:d.disabled,className:De(h0,r),children:[c,jsxRuntime.jsx(ub,{open:false,sideways:true})]}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.SubContent,{...l,sideOffset:4,alignOffset:-6,"data-monkeys-component":"navigation-headbar-menu","data-slot":"content","data-surface":"menu",className:De("z-50 border p-1.5 animate-in fade-in-0 zoom-in-95",un("menu"),o),style:{...k0,minWidth:"12rem"},children:jsxRuntime.jsx(C0,{activeItemId:e,items:d.children,menuContentRadiusClass:o,menuItemRadiusClass:r,onNavigate:n,onNavigateComplete:i,useTokenRadius:s})})})]},d.id):jsxRuntime.jsxs(Bt__namespace.Item,{disabled:d.disabled,className:De(h0,r),style:Uu(d.id===e,s),onSelect:()=>{d.disabled||(i(),n?.(d.id));},children:[c,d.trailing]},d.id)})}a(C0,"HeadbarDropdownItems");function i3({activeItemId:e,compound:t,isActive:o,item:r,label:n,menuButtonRadiusClass:i,menuContentRadiusClass:s,menuItemRadiusClass:l,onNavigate:d,title:c,useTokenRadius:p}){let[u,g]=ho.useState(false),f=ke(),b=!r.disabled&&u,x=ho.useRef(null),y=ho.useRef(false),k=a(()=>{x.current&&(clearTimeout(x.current),x.current=null);},"clearCloseTimer"),w=a(()=>{r.disabled||(k(),g(true));},"openMenu"),v=a(()=>{k(),x.current=setTimeout(()=>{g(false),x.current=null;},120);},"scheduleCloseMenu"),h=a(()=>{let S=r.children?.find(T=>!T.disabled);return S?(g(false),d?.(S.id),true):false},"navigateToFirstEnabledChild");return ho.useEffect(()=>k,[]),jsxRuntime.jsxs(Bt__namespace.Root,{modal:false,open:b,onOpenChange:S=>g(!r.disabled&&S),children:[jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",active:o||b,icon:r.icon,endIcon:jsxRuntime.jsx(ub,{open:b}),label:n,title:c,disabled:r.disabled,onClick:()=>{let S=y.current;y.current=false,!(S&&h())&&g(true);},onPointerDown:()=>{y.current=b;},onPointerCancel:()=>{y.current=false;},onKeyDown:S=>{!b||S.key!=="Enter"&&S.key!==" "||h()&&S.preventDefault();},onMouseEnter:w,onMouseLeave:v,style:Uu(o||b,t?false:p),classNames:{icon:"text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",label:"flex shrink-0 items-center !overflow-visible !text-clip text-[inherit] [&_*]:!text-[inherit]"},className:De("shrink-0 border shadow-none",t&&"!rounded-none !border-0 !bg-transparent",i,o||b?"":"hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]")})}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{...f,align:"start",sideOffset:5,"data-monkeys-component":"navigation-headbar-menu","data-slot":"content","data-surface":"menu",onCloseAutoFocus:S=>S.preventDefault(),onMouseEnter:w,onMouseLeave:v,className:De("z-50 border p-1.5 animate-in fade-in-0 zoom-in-95",un("menu"),s),style:{...k0,minWidth:"var(--radix-dropdown-menu-trigger-width)"},children:jsxRuntime.jsx(C0,{activeItemId:e,items:r.children??[],menuContentRadiusClass:s,menuItemRadiusClass:l,onNavigate:d,onNavigateComplete:()=>g(false),useTokenRadius:p})})})]})}a(i3,"HeadbarNavMenuItem");function $u(e){e.preventDefault(),e.stopPropagation();}a($u,"blockEvent");function s3({activeItemId:e,activeRootId:t,items:o,menuRadius:r="default",onNavigate:n}){let i=ju(r),s=ju(r),l=ju(r),d=r==="default";return jsxRuntime.jsx("div",{className:"flex w-max min-w-0 shrink-0 items-center gap-1",children:o.map(c=>{let p=t===c.id||e===c.id,u=!!c.headbarSecondaryAction,g=c.headbarLabel??c.label,f=r3(c,e),b=f?f.headbarLabel??f.label:void 0,x=f?jsxRuntime.jsxs("span",{"data-navigation-headbar-selected-child":f.id,className:"flex shrink-0 items-center gap-1.5 whitespace-nowrap",children:[jsxRuntime.jsx("span",{className:"shrink-0",children:g}),jsxRuntime.jsx("span",{className:"shrink-0",children:"/"}),jsxRuntime.jsx("span",{className:"shrink-0",children:b})]}):jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:g}),y=f?a3(g,b):void 0,k=c.children?.length?jsxRuntime.jsx(i3,{activeItemId:e,compound:u,isActive:p,item:c,label:x,menuButtonRadiusClass:i,menuContentRadiusClass:s,menuItemRadiusClass:l,onNavigate:n,title:y,useTokenRadius:d}):jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",active:p,disabled:c.disabled,icon:c.icon,label:jsxRuntime.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:x}),c.trailing]}),onClick:()=>n?.(c.id),style:Uu(p,u?false:d),classNames:{icon:"text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",label:"shrink-0 !overflow-visible !text-clip text-[inherit] [&_*]:!text-[inherit]"},className:De("shrink-0 border shadow-none",u&&"!rounded-none !border-0 !bg-transparent",i,p?"":"hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]")});return u?jsxRuntime.jsxs("div",{"data-navigation-headbar-compound-item":c.id,"aria-disabled":c.disabled,className:De("inline-flex min-w-0 shrink-0 items-center gap-0 overflow-hidden border shadow-none",i,p?"":"hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]"),style:o3(p,d),children:[jsxRuntime.jsx("span",{"data-navigation-headbar-primary-action":"",className:"inline-flex min-w-0 shrink-0",children:k}),jsxRuntime.jsx("span",{"data-navigation-headbar-secondary-action":c.id,...c.disabled&&{inert:"",onClickCapture:$u,onKeyDownCapture:$u,onKeyUpCapture:$u,onPointerDownCapture:$u},className:De("inline-flex min-w-0 shrink-0 items-center",c.disabled&&"!cursor-not-allowed opacity-60"),children:c.headbarSecondaryAction})]},c.id):jsxRuntime.jsx(ho.Fragment,{children:k},c.id)})})}a(s3,"NavigationHeadbarMenu");function l3({activeItemId:e,activeRootId:t,actions:o,accountMenu:r,className:n,extra:i,layout:s,brand:l,logo:d,navigation:c,navItems:p=[],onNavigate:u}){let g=XW(s?.heightPx),f=s?.layoutMode??"boxed",b=s?.menuRadius??"default",x=s?.surface??"card",y=ZW(g),k=e3(f,g,x),w=!!s?.brandTitle;return jsxRuntime.jsxs("header",{className:De(JW(f,s?.navPosition),n),"data-navigation-headbar":"","data-navigation-headbar-surface":x,style:k,children:[jsxRuntime.jsx("div",{className:"flex min-w-0 items-center justify-start",children:l??(d?jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",icon:jsxRuntime.jsx("div",{className:De("flex items-center justify-center overflow-hidden rounded-lg",d.url?"w-auto max-w-[min(22rem,30vw)] bg-transparent":"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"),style:d.url?{height:y}:{width:y,height:y},children:d.url?jsxRuntime.jsx("img",{src:d.url,alt:d.title,className:"block h-full w-auto object-contain"}):jsxRuntime.jsx("span",{className:"text-base font-bold",children:d.title.charAt(0)})}),label:w?jsxRuntime.jsx("span",{className:"truncate whitespace-nowrap text-base font-medium text-[hsl(var(--foreground))]",children:s?.brandTitle}):null,ariaLabel:d.title,title:d.title,className:"h-auto min-w-0 justify-start border-transparent bg-transparent p-0 shadow-none hover:bg-transparent",classNames:d.url?{icon:"!h-auto !w-auto shrink-0"}:void 0,onClick:d.onClick}):null)}),jsxRuntime.jsx("div",{className:De("flex min-w-0 items-center",t3(s?.navPosition)),children:jsxRuntime.jsx("div",{className:"no-scrollbar flex max-w-full min-w-0 items-center overflow-x-auto overscroll-x-contain",children:c??jsxRuntime.jsx(s3,{activeItemId:e,activeRootId:t,items:p,menuRadius:b,onNavigate:u})})}),jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center justify-end gap-3",children:[o,i,r]})]})}a(l3,"NavigationHeadbar");function d3({activeItemId:e,activeRootId:t,allowModeSwitch:o=false,accountMenu:r,children:n,className:i,collapsedSidebarAccountMenu:s,collapsedSidebarWidth:l=FW,contextualSidebar:d=false,contextualSidebarHeader:c,contextualSidebarWidth:p=HW,defaultMode:u="headbar",defaultSidebarCollapsed:g=false,expandedSidebarWidth:f=OW,expandSidebarLabel:b="Expand sidebar",flush:x=false,contentFrame:y=true,headbarActions:k,headbarLayout:w,logo:v,mode:h,navItems:S,onModeChange:T,onNavigate:C,onSidebarCollapsedChange:R,renderHeadbarExtra:M,collapseSidebarLabel:I="Collapse sidebar",sidebarCollapsed:A,sidebarAccountMenu:N,sidebarFooter:D,sidebarHeader:E,switchToHeadbarLabel:P="Switch to headbar",switchToSidebarLabel:W="Switch to sidebar"}){let[H,B]=ho.useState(u),[L,F]=ho.useState(g),[_,$]=ho.useState(null),G=h!==void 0,z=A!==void 0,re=G?h:H,Z=z?A:L,ae=re==="headbar",ee=Z?l:f,q=t??v0(S,e),U=S.find(me=>me.id===q),X=U?.children??[];ho.useEffect(()=>{G||B(u);},[u,G]),ho.useEffect(()=>{z||F(g);},[g,z]);let O=a(me=>{G||B(me),T?.(me);},"setNavigationMode"),K=a(me=>{z||F(me),R?.(me);},"setCollapsed"),ne=[];o&&ne.push({id:"toggle-headbar",label:P,onClick:a(()=>O("headbar"),"onClick"),icon:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-[18px] w-[18px] rotate-180",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),jsxRuntime.jsx("path",{d:"M3 9h18"})]})}),ne.push({id:"toggle-sidebar",label:Z?b:I,onClick:a(()=>K(!Z),"onClick"),icon:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-[18px] w-[18px]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),jsxRuntime.jsx("path",{d:"M9 3v18"}),jsxRuntime.jsx("path",{d:Z?"m14 9 3 3-3 3":"m16 15-3-3 3-3"})]})});let fe=ae&&d&&X.length?jsxRuntime.jsx("aside",{className:"relative h-full min-h-0 shrink-0 overflow-hidden","data-navigation-contextual-sidebar":q,style:{width:p},children:jsxRuntime.jsxs("div",{className:"flex h-full min-h-0 w-full flex-col gap-3 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] px-4 py-4",children:[jsxRuntime.jsx("div",{className:"shrink-0 px-2 text-sm font-semibold text-[hsl(var(--foreground))]",children:c??U?.label}),jsxRuntime.jsx(w0,{activeItemId:e,items:X,onNavigate:C})]})}):ae?null:jsxRuntime.jsx("div",{className:De("relative h-full min-h-0 shrink-0 transition-[width] duration-260",Z?"z-20 overflow-visible":"z-10 overflow-hidden"),style:{width:ee,transitionTimingFunction:VW},children:jsxRuntime.jsx(n3,{accountMenu:N??r,activeItemId:e,actions:ne,collapsed:Z,collapsedAccountMenu:s??r,footer:D,header:E,items:S,logo:v,onCollapsedChange:K,onNavigate:C,onRevealRoot:me=>$(ie=>({id:me,nonce:(ie?.nonce??0)+1})),revealRequest:_,title:w?.brandTitle})}),he=ae?jsxRuntime.jsx(l3,{activeItemId:e,activeRootId:q,actions:o?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[k,jsxRuntime.jsx(dt,{appearance:ur,tone:"muted",icon:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),jsxRuntime.jsx("path",{d:"M9 3v18"}),jsxRuntime.jsx("path",{d:"m14 9 3 3-3 3"})]}),label:jsxRuntime.jsx("span",{className:"truncate whitespace-nowrap",children:W}),onClick:()=>O("sidebar"),className:De("h-auto min-w-0 shrink px-3 py-2 text-sm font-medium text-[hsl(var(--muted-foreground))] shadow-none hover:border-[hsl(var(--input))]/70 hover:bg-[hsl(var(--muted))]/60 hover:text-[hsl(var(--foreground))]",ju(w?.menuRadius))})]}):k,accountMenu:r,extra:M,layout:w,logo:v,navItems:S,onNavigate:C}):null;return jsxRuntime.jsx(y0,{header:he,sidebar:fe,flush:x,contentFrame:y,className:i,children:n})}a(d3,"NavigationLayout");var m3={variant:"default",density:"default"},f3=ho.createContext(m3);function b3(e,t={}){return {variant:t.variant??e.variant,density:t.density??(t.variant==="trend"?"compact":e.density)}}a(b3,"resolveAgentWorkbenchAppearance");function Nl(e={}){return b3(ho.useContext(f3),e)}a(Nl,"useAgentWorkbenchAppearance");var g3={page:"bg-background text-foreground",panel:"bg-card text-card-foreground",elevated:"border border-border bg-popover text-popover-foreground shadow-sm",subtle:"bg-muted/40 text-foreground",overlay:"border border-border bg-popover text-popover-foreground shadow-lg"};ho.forwardRef(a(function({level:t="panel",variant:o,density:r,className:n,children:i,...s},l){let d=Nl({variant:o,density:r});return jsxRuntime.jsx("div",{...s,ref:l,"data-agent-workbench-surface":t,"data-agent-workbench-variant":d.variant,"data-agent-workbench-density":d.density,className:De(g3[t],n),children:i})},"AgentWorkbenchSurface"));var N0={sparkles:lucideReact.Sparkles,palette:lucideReact.Palette,search:lucideReact.Search,"file-text":lucideReact.FileText,code:lucideReact.Code2,"shopping-bag":lucideReact.ShoppingBag},qa="__quick-start__";function M3({template:e}){let t=N0[e.icon||"sparkles"];return e.coverImageUrl?jsxRuntime.jsx("img",{src:e.coverImageUrl,alt:"",className:"size-full bg-muted object-contain"}):jsxRuntime.jsx("span",{className:"flex size-full items-center justify-center bg-gradient-to-br from-primary/5 via-muted/50 to-primary/15",children:jsxRuntime.jsx("span",{className:"flex size-14 items-center justify-center rounded-2xl border border-primary/10 bg-background/85 text-primary shadow-sm",children:jsxRuntime.jsx(t,{className:"size-7","aria-hidden":"true"})})})}a(M3,"TemplateVisual");function R0({viewModel:e,className:t,onIntent:o}){let r=Ye().agentWorkbench.quickStart,n=ho.useRef(null),[i,s]=ho.useState(),[l,d]=ho.useState(),[c,p]=ho.useState(),u=ho.useMemo(()=>e.categories.map(h=>({...h,sections:h.sections.map(S=>({...S,templates:S.templates.filter(T=>!T.modes||T.modes.includes(e.mode))})).filter(S=>S.templates.length>0)})).filter(h=>h.sections.length>0),[e.categories,e.mode]),g=ho.useMemo(()=>{let h=u.flatMap(S=>S.sections.filter(T=>T.id==="quick-start")).map(S=>S.templates).flat().filter((S,T,C)=>C.findIndex(R=>R.id===S.id)===T);if(h.length!==0)return {id:qa,label:r.label,icon:"sparkles",sections:[{id:"quick-start",label:r.label,templates:h}]}},[u,r.label]),f=i===qa?g:u.find(h=>h.id===i),b=f?.sections.find(h=>h.id===l)||f?.sections[0],x=b?.templates.length?b.templates.every(h=>!h.coverImageUrl):false;if(ho.useEffect(()=>{i&&i!==qa&&!u.some(h=>h.id===i)&&(s(void 0),d(void 0)),i===qa&&!g&&(s(void 0),d(void 0));},[i,u,g]),u.length===0)return null;let y=a(h=>{s(h.id),d(h.sections[0]?.id),o?.({type:"change-category",categoryId:h.id});},"selectCategory"),k=a(()=>{g&&(s(qa),d(g.sections[0]?.id),o?.({type:"change-category"}));},"selectQuickStart"),w=a(h=>{f&&(d(h),o?.({type:"change-section",categoryId:f.id,sectionId:h}));},"selectSection"),v=a(h=>{if(e.disabled)return;if(h.action!=="upload"){o?.({type:"select-template",templateId:h.id,prompt:h.prompt});return}let S=n.current;S&&(S.accept=h.accept||"*/*",S.multiple=h.multiple===true,p(h),S.click());},"selectTemplate");return jsxRuntime.jsxs("section",{className:De("agent-workbench-quick-start min-w-0 max-w-full",t),"aria-label":r.label,children:[jsxRuntime.jsx("input",{ref:n,type:"file",className:"hidden",onChange:h=>{let S=Array.from(h.target.files||[]);c&&S.length>0&&o?.({type:"select-template",templateId:c.id,prompt:c.prompt,files:c.multiple?S:S.slice(0,1)}),p(void 0),h.target.value="";}}),f?jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 max-w-full items-center gap-1 overflow-x-auto pb-1",children:[jsxRuntime.jsxs("button",{type:"button",className:"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-md px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>{s(void 0),d(void 0),o?.({type:"change-category"});},children:[jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"size-4","aria-hidden":"true"}),r.back]}),f.sections.map((h,S)=>jsxRuntime.jsx("button",{type:"button","aria-pressed":b?.id===h.id,className:De("h-9 shrink-0 rounded-md px-4 text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",b?.id===h.id?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"),onClick:()=>w(h.id),children:f.id!==qa&&S===0?f.label:h.label},h.id))]}),jsxRuntime.jsx("div",{"data-quick-start-layout":x?"list":"cards",className:De("grid",x?"grid-cols-1 gap-0":"grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3"),children:b?.templates.map(h=>jsxRuntime.jsxs("button",{type:"button",disabled:e.disabled,"data-quick-start-template-id":h.id,className:De("group min-w-0 overflow-hidden text-left transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",x?"flex min-h-14 items-center rounded-none border-x-0 border-t-0 bg-transparent shadow-none hover:border-border hover:bg-muted/40 last:border-b-0":"rounded-xl border border-border bg-background hover:border-primary/30 hover:bg-muted/20"),onClick:()=>v(h),children:[jsxRuntime.jsxs("span",{className:De(x?"min-w-0 flex-1 px-2 py-2.5":"block px-4 pb-3 pt-4"),children:[jsxRuntime.jsxs("span",{className:De("flex items-center gap-2 text-sm text-foreground",x?"font-medium":"font-semibold"),children:[h.title,h.action==="upload"?jsxRuntime.jsxs("span",{className:"ml-auto inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"size-3","aria-hidden":"true"}),r.addFile]}):null]}),h.description?jsxRuntime.jsx("span",{className:De("line-clamp-2 block text-xs leading-4 text-muted-foreground",x?"mt-0.5 min-h-0 text-muted-foreground/75":"mt-1 min-h-8"),children:h.description}):null]}),x?jsxRuntime.jsx(lucideReact.ArrowUpRight,{className:"mr-2 size-4 shrink-0 text-muted-foreground/45","aria-hidden":"true"}):jsxRuntime.jsx("span",{className:De("block overflow-hidden",h.coverImageUrl?"aspect-[5/2]":"h-28"),children:jsxRuntime.jsx(M3,{template:h})})]},h.id))})]}):jsxRuntime.jsxs("div",{className:"flex max-w-full items-center justify-center gap-2 overflow-x-auto px-1 pb-1",children:[g?jsxRuntime.jsxs("button",{type:"button",className:"inline-flex h-10 shrink-0 items-center gap-2 rounded-md border border-border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring","aria-pressed":i===qa,onClick:k,children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),r.label]}):null,u.map(h=>{let S=N0[h.icon||"sparkles"];return jsxRuntime.jsxs("button",{type:"button",className:"inline-flex h-10 shrink-0 items-center gap-2 rounded-md border border-border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>y(h),children:[jsxRuntime.jsx(S,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),h.label]},h.id)})]})]})}a(R0,"AgentWorkbenchQuickStart");var Ya=ho.forwardRef(a(function({children:t,header:o,search:r,primaryAction:n,actions:i,groups:s,footer:l,className:d,classNames:c,bodyProps:p,bodyScrollable:u=true,status:g="ready",variant:f,density:b,loadingState:x,emptyState:y,errorState:k,...w},v){let h=Nl({variant:f,density:b}),S=h.density==="compact",T=r!==void 0||n!==void 0||i!==void 0,C=g==="loading"?x:g==="empty"?y:g==="error"?k:t;return jsxRuntime.jsxs("nav",{ref:v,"data-agent-workbench-variant":h.variant,"data-agent-workbench-density":h.density,"data-agent-workbench-status":g,className:De("flex h-full min-h-0 flex-col bg-card text-card-foreground",c?.root,d),...w,children:[o!==void 0?jsxRuntime.jsx("div",{className:De("shrink-0",c?.header),children:o}):null,T?jsxRuntime.jsxs("div",{className:De("shrink-0",S?"space-y-2 px-3 pb-2 pt-3":"space-y-3 px-4 pb-2 pt-4",c?.search),children:[r,n!==void 0?jsxRuntime.jsx("div",{className:De(c?.primaryAction),children:n}):null,i!==void 0?jsxRuntime.jsx("div",{className:De("flex min-w-0 items-center gap-2",c?.actions),children:i}):null]}):null,jsxRuntime.jsx("div",{"data-agent-workbench-scroll-region":u?"":void 0,...p,tabIndex:p?.tabIndex??(u?0:void 0),className:De("min-h-0 flex-1",S?"px-3 pb-3":"px-4 pb-4",u&&"overflow-x-hidden overflow-y-auto overscroll-contain",c?.body),children:C}),s!==void 0?jsxRuntime.jsx("div",{className:De("shrink-0",c?.groups),children:s}):null,l!==void 0?jsxRuntime.jsx("div",{className:De("shrink-0",c?.footer),children:l}):null]})},"AgentWorkbenchSidebarContainer"));Ya.displayName="AgentWorkbenchSidebarContainer";function Ku({value:e,label:t,placeholder:o=t,className:r,variant:n="default",onChange:i}){let s=Ye().agentWorkbench.navigation,l=ho.useRef(null);return ho.useEffect(()=>{let d=a(c=>{!(c.ctrlKey||c.metaKey)||c.key.toLocaleLowerCase()!=="k"||(c.preventDefault(),l.current?.focus(),l.current?.select());},"handleShortcut");return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[]),jsxRuntime.jsxs(dy,{className:De(n==="trend"?"h-12 rounded-[var(--radius)] border-border bg-card text-foreground":"h-10 rounded-lg bg-card",r),children:[jsxRuntime.jsx(Yd,{children:jsxRuntime.jsx(lucideReact.Search,{className:"size-4","aria-hidden":"true"})}),jsxRuntime.jsx(hm,{ref:l,type:"search",value:e,"aria-label":t,placeholder:o,className:"min-w-0 [&::-webkit-search-cancel-button]:hidden",onChange:d=>i(d.target.value),onKeyDown:d=>{d.key==="Escape"&&(i(""),d.currentTarget.blur());}}),e?jsxRuntime.jsx(Yd,{align:"inline-end",children:jsxRuntime.jsx(cy,{size:"icon-xs","aria-label":s.clearSearch,onClick:()=>i(""),children:jsxRuntime.jsx(lucideReact.X,{className:"size-3.5","aria-hidden":"true"})})}):jsxRuntime.jsx(Yd,{align:"inline-end",children:jsxRuntime.jsx("kbd",{className:"border border-border px-1.5 py-0.5 text-[10px]",children:"Ctrl K"})})]})}a(Ku,"AgentWorkbenchSidebarSearch");function qu({label:e,className:t,variant:o="default",onClick:r}){return jsxRuntime.jsxs(mt,{type:"button",variant:o==="trend"?"default":"ghost",className:De(o==="trend"?"h-11 w-full justify-center gap-2 rounded-[var(--radius)] border border-primary/60 bg-primary px-3 font-semibold text-primary-foreground hover:bg-primary/90":"h-9 w-full justify-start gap-2 px-3 text-sm",t),onClick:r,children:[jsxRuntime.jsx(lucideReact.SquarePen,{className:"size-4","aria-hidden":"true"}),e]})}a(qu,"AgentWorkbenchSidebarNewSessionButton");function P0({item:e}){let[t,o]=ho.useState(false);return e.thumbnailUrl&&!t?jsxRuntime.jsx("img",{src:e.thumbnailUrl,alt:"",className:"size-full object-cover",loading:"lazy",onError:()=>o(true)}):jsxRuntime.jsx(lucideReact.Image,{className:"size-5","aria-hidden":"true"})}a(P0,"SessionAvatar");function E0({item:e}){let{locale:t}=Co(),o=Ye().agentWorkbench.navigation;return jsxRuntime.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[jsxRuntime.jsx("span",{className:"min-w-0 truncate text-xs text-foreground/80",children:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e.updatedAt))}),e.mode?jsxRuntime.jsx("span",{className:De("shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none",e.mode==="work"?"bg-primary/10 text-primary":"bg-muted text-foreground"),children:e.mode==="work"?o.work:o.chat}):null]})}a(E0,"SessionMeta");function _3({status:e}){let t=Ye().agentWorkbench.navigation;return e==="running"?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 animate-spin text-primary","aria-label":t.running}):e==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"size-4 text-primary","aria-label":t.completed}):e==="error"?jsxRuntime.jsx(lucideReact.AlertCircle,{className:"size-4 text-destructive-text","aria-label":t.failed}):null}a(_3,"StatusIndicator");function Yu({sessions:e,selectedSessionId:t,status:o="ready",error:r,query:n="",emptyLabel:i,noResultsLabel:s,retryLabel:l,groupByMode:d=false,showHeading:c=false,variant:p="default",className:u,itemClassName:g,capabilities:f,onSelect:b,onTogglePin:x,onRename:y,onDelete:k,onRetry:w}){let v=Ye().agentWorkbench.navigation,h=ho.useRef(null),[S,T]=ho.useState(),[C,R]=ho.useState("");ho.useEffect(()=>{S&&(h.current?.focus(),h.current?.select());},[S]);let M=a(()=>{T(void 0),R("");},"cancelRename"),I=a(D=>{let E=C.trim();E&&E!==D.title&&y?.(D.id,E),M();},"saveRename");if(o==="loading"&&e.length===0)return jsxRuntime.jsx("div",{className:"space-y-2 px-1 py-3",role:"status","aria-label":v.loading,children:Array.from({length:4},(D,E)=>jsxRuntime.jsx("div",{"aria-hidden":"true",className:De("animate-pulse rounded-[var(--radius)] bg-muted/70",p==="trend"?"h-10":"h-14")},E))});if(o==="error")return jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-3 px-3 py-8 text-center",children:[jsxRuntime.jsx("p",{className:"max-w-full break-words text-sm text-muted-foreground",role:"alert",children:r}),w?jsxRuntime.jsxs(mt,{type:"button",variant:"ghost",size:"sm",className:"gap-1.5 px-0 text-sm text-primary hover:text-primary",onClick:w,children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"size-3.5","aria-hidden":"true"}),l??v.retry]}):null]});if(e.length===0)return jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:n?s:i});let A=a(D=>jsxRuntime.jsx("div",{className:"space-y-3",children:D.map(E=>jsxRuntime.jsxs("div",{"aria-current":E.id===t?"page":void 0,"data-agent-session-status":E.status??"idle","aria-busy":E.status==="running"?"true":void 0,className:"group flex h-10 w-full min-w-0 items-center rounded-[var(--radius)] border border-transparent bg-muted/60 text-foreground transition hover:bg-muted focus-within:border-ring focus-within:ring-2 focus-within:ring-ring aria-[current=page]:border-primary aria-[current=page]:bg-primary/10",children:[jsxRuntime.jsx("button",{type:"button",title:E.title,className:"h-full min-w-0 flex-1 truncate px-3 text-left text-sm font-semibold",onClick:()=>b(E.id),children:E.title}),f?.delete?jsxRuntime.jsx("span",{"data-agent-workbench-item-actions":true,className:"mr-1 shrink-0 opacity-0 transition-opacity group-aria-[current=page]:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100",onClick:P=>P.stopPropagation(),onKeyDown:P=>P.stopPropagation(),children:jsxRuntime.jsxs(Ns,{children:[jsxRuntime.jsx(Rs,{asChild:true,children:jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon","aria-label":v.actions,className:"size-8 text-muted-foreground",children:jsxRuntime.jsx(lucideReact.Ellipsis,{className:"size-4","aria-hidden":"true"})})}),jsxRuntime.jsx(vi,{align:"end",children:jsxRuntime.jsxs(Ms,{className:"text-destructive-text",onSelect:()=>k?.(E.id),children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"mr-2 size-4","aria-hidden":"true"}),v.delete]})})]})}):null]},E.id))}),"renderTrendItems"),N=a(D=>jsxRuntime.jsx("div",{className:"space-y-1",children:D.map(E=>{let P=E.contextUsage&&E.contextUsage.maxTokens>0?Math.min(100,Math.round(E.contextUsage.usedTokens/E.contextUsage.maxTokens*100)):void 0;return jsxRuntime.jsxs("div",{"aria-current":E.id===t?"page":void 0,className:De("group flex w-full min-w-0 items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted",g),children:[S===E.id?jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[jsxRuntime.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",children:jsxRuntime.jsx(P0,{item:E})}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx(wr,{ref:h,value:C,"aria-label":v.rename,appearance:"compact",className:"h-6 w-full border-primary px-1.5 text-sm font-medium",onChange:W=>R(W.target.value),onClick:W=>W.stopPropagation(),onBlur:()=>I(E),onKeyDown:W=>{W.stopPropagation(),W.key==="Enter"?(W.preventDefault(),I(E)):W.key==="Escape"&&(W.preventDefault(),M());}}),jsxRuntime.jsx(E0,{item:E})]})]}):jsxRuntime.jsxs("button",{type:"button",title:E.title,className:"flex min-w-0 flex-1 items-center gap-3 text-left",onClick:()=>b(E.id),children:[jsxRuntime.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",children:jsxRuntime.jsx(P0,{item:E})}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:"block truncate text-sm font-medium",children:E.title}),jsxRuntime.jsx(E0,{item:E})]})]}),jsxRuntime.jsxs("span",{"data-agent-workbench-item-actions":true,className:"flex shrink-0 items-center gap-1",children:[P!==void 0&&E.status==="idle"?jsxRuntime.jsxs("span",{className:"text-xs text-foreground","aria-label":v.contextUsage({percent:P}),children:[P,"%"]}):jsxRuntime.jsx(_3,{status:E.status}),f?.pin?jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon","aria-label":E.pinned?v.unpin:v.pin,className:De("size-8 text-muted-foreground opacity-0 group-hover:opacity-100",E.pinned&&"text-primary opacity-100"),onClick:W=>{W.stopPropagation(),x?.(E.id,!E.pinned);},children:jsxRuntime.jsx(lucideReact.Pin,{className:De("size-4",E.pinned&&"fill-current")})}):null,f?.rename||f?.delete?jsxRuntime.jsx("span",{onClick:W=>W.stopPropagation(),onKeyDown:W=>W.stopPropagation(),children:jsxRuntime.jsxs(Ns,{children:[jsxRuntime.jsx(Rs,{asChild:true,children:jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon",className:"size-8","aria-label":v.actions,children:jsxRuntime.jsx(lucideReact.Ellipsis,{className:"size-4","aria-hidden":"true"})})}),jsxRuntime.jsxs(vi,{align:"end",children:[f.rename?jsxRuntime.jsxs(Ms,{onSelect:()=>{T(E.id),R(E.title);},children:[jsxRuntime.jsx(lucideReact.Pencil,{className:"mr-2 size-4","aria-hidden":"true"}),v.rename]}):null,f.delete?jsxRuntime.jsxs(Ms,{className:"text-destructive-text",onSelect:()=>k?.(E.id),children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"mr-2 size-4","aria-hidden":"true"}),v.delete]}):null]})]})}):null]})]},E.id)})}),"renderItems");return jsxRuntime.jsxs("div",{className:De("space-y-2",u),children:[c&&!d?jsxRuntime.jsx("h3",{className:"mb-2 px-3 text-xs font-medium text-muted-foreground",children:v.recentSessions}):null,p==="trend"?A(e):d?[{id:"chatbot",label:v.chats,icon:lucideReact.MessageSquare,items:e.filter(D=>D.mode!=="work")},{id:"agent",label:v.agents,icon:lucideReact.Bot,items:e.filter(D=>D.mode==="work")}].map(({id:D,label:E,icon:P,items:W})=>jsxRuntime.jsxs("details",{open:true,"aria-label":E,children:[jsxRuntime.jsxs("summary",{className:"flex h-9 cursor-pointer list-none items-center gap-2 rounded-md px-3 text-sm font-semibold hover:bg-muted",children:[jsxRuntime.jsx(P,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 truncate",children:E})]}),N(W)]},D)):N(e)]})}a(Yu,"AgentWorkbenchSessionList");var Q3={contract:"AgentWorkbenchNavigationViewModel",activeTab:"sessions",searchQuery:"",agents:{status:"loading",items:[]},sessions:{status:"loading",items:[]},capabilities:{createAgent:false,createSession:false,manageCapabilities:false,manageAgentSettings:false,pinAgents:false,pinSessions:false,renameSessions:false,deleteSessions:false}};function Z3({item:e}){let[t,o]=ho.useState(false);if(e.iconUrl&&!t)return jsxRuntime.jsx("img",{src:e.iconUrl,alt:"",className:"size-full object-cover",onError:()=>o(true)});let r=e.name.trim().charAt(0).toLocaleUpperCase();return r?jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:r}):jsxRuntime.jsx(lucideReact.Bot,{className:"size-4"})}a(Z3,"ItemAvatar");function J3({status:e,empty:t,noResults:o,hasItems:r,query:n,error:i,onRetry:s}){let l=Ye().agentWorkbench.navigation;return e==="loading"&&!r?jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:l.loading}):e==="error"?jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-3 px-3 py-8 text-center",children:[jsxRuntime.jsx("p",{className:"max-w-full break-words text-sm text-muted-foreground",role:"alert",children:i}),jsxRuntime.jsxs(mt,{type:"button",variant:"ghost",size:"sm",className:"gap-1.5 px-0 text-sm text-primary hover:text-primary",onClick:s,children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"size-3.5","aria-hidden":"true"}),l.retry]})]}):r?null:jsxRuntime.jsx("div",{className:"px-3 py-8 text-center text-sm text-muted-foreground",children:n?o:t})}a(J3,"CollectionState");function L0({viewModel:e=Q3,navigationMode:t,config:o,header:r,headerActions:n,footer:i,className:s,classNames:l,onIntent:d}){let c=Ye().agentWorkbench.navigation,p=ho.useMemo(()=>monkeys.resolveAgentWorkbenchSidebarConfig(o),[o]),u=ho.useMemo(()=>new Set(p.visibleSections),[p.visibleSections]),g=t==="sessions-only"||t===void 0&&p.navigationMode!=="default",f=u.has("agents")&&!g,b=u.has("sessions"),x=e.searchQuery.trim().toLocaleLowerCase(),y=ho.useMemo(()=>e.agents.items.filter(w=>!x||`${w.name} ${w.description??""}`.toLocaleLowerCase().includes(x)),[x,e.agents.items]),k=ho.useMemo(()=>e.sessions.items.filter(w=>!x||w.title.toLocaleLowerCase().includes(x)),[x,e.sessions.items]);return jsxRuntime.jsx(Ea,{value:g||!f?"sessions":e.activeTab,onValueChange:w=>{!g&&(w==="agents"||w==="sessions")&&d?.({type:"change-tab",tab:w});},className:"h-full min-h-0",children:jsxRuntime.jsxs(Ya,{"data-sidebar-width-percent":p.widthPercent,"aria-label":c.tabsLabel,header:u.has("header")?r:void 0,search:u.has("search")?jsxRuntime.jsx(Ku,{value:e.searchQuery,label:g?c.searchSessions:c.search,className:l?.search,onChange:w=>d?.({type:"change-search",query:w})}):void 0,actions:f&&b||n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[f&&b?jsxRuntime.jsxs(Aa,{className:De("grid min-w-0 flex-1 grid-cols-2 text-foreground",l?.tabs),"aria-label":c.tabsLabel,children:[jsxRuntime.jsx(Kn,{value:"agents",children:c.agents}),jsxRuntime.jsx(Kn,{value:"sessions",children:c.sessions})]}):null,n?jsxRuntime.jsx("div",{className:"flex shrink-0 items-center",children:n}):null]}):void 0,footer:u.has("footer")&&(!g&&e.capabilities.manageAgentSettings||i)?jsxRuntime.jsxs("div",{className:De("border-t border-border p-4",l?.footer),children:[!g&&e.capabilities.manageAgentSettings?jsxRuntime.jsxs(mt,{type:"button",variant:"ghost",className:"h-10 w-full justify-start gap-2 px-3 text-sm",onClick:()=>d?.({type:"open-agent-settings"}),children:[jsxRuntime.jsx(lucideReact.Settings,{className:"size-4","aria-hidden":"true"}),c.settings]}):null,i]}):void 0,bodyScrollable:false,className:s,classNames:{root:l?.root,body:"flex min-h-0 flex-1 flex-col p-0"},children:[f?jsxRuntime.jsxs(mn,{value:"agents","data-agent-workbench-scroll-region":true,className:De("mt-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-4 pb-4",l?.body),children:[e.capabilities.createAgent?jsxRuntime.jsxs(mt,{type:"button",variant:"ghost",className:"mb-3 h-9 w-full justify-start gap-2 px-3 text-sm",onClick:()=>d?.({type:"create-agent"}),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"size-4","aria-hidden":"true"}),c.newAgent]}):null,jsxRuntime.jsx("h3",{className:"mb-2 px-3 text-xs font-medium text-muted-foreground",children:c.allAgents}),jsxRuntime.jsx(J3,{status:e.agents.status,empty:c.emptyAgents,noResults:c.noResults,hasItems:y.length>0,query:x,error:e.agents.error,onRetry:()=>d?.({type:"retry-agents"})}),jsxRuntime.jsx("div",{className:"space-y-1",children:y.map(w=>jsxRuntime.jsxs("div",{"aria-current":w.id===e.selectedAgentItem?"page":void 0,className:De("group flex w-full min-w-0 items-center gap-3 rounded-lg border border-transparent px-3 py-2 text-left hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-muted",l?.item),children:[jsxRuntime.jsxs("button",{type:"button",title:w.name,className:"flex min-w-0 flex-1 items-center gap-3 text-left",onClick:()=>d?.({type:"select-agent",itemId:w.id}),children:[jsxRuntime.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted",children:jsxRuntime.jsx(Z3,{item:w})}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:"block truncate text-sm font-medium",children:w.name}),jsxRuntime.jsx("span",{className:"block truncate text-xs text-foreground/80",children:w.description||c.noDescription})]})]}),w.builtIn?jsxRuntime.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-1 text-[10px] text-foreground",children:c.builtIn}):null,e.capabilities.pinAgents?jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon","aria-label":w.pinned?c.unpin:c.pin,className:De("size-8 text-muted-foreground opacity-0 group-hover:opacity-100",w.pinned&&"text-primary opacity-100"),onClick:v=>{v.stopPropagation(),d?.({type:"toggle-agent-pin",itemId:w.id,pinned:!w.pinned});},onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),d?.({type:"toggle-agent-pin",itemId:w.id,pinned:!w.pinned}));},children:jsxRuntime.jsx(lucideReact.Pin,{className:De("size-4",w.pinned&&"fill-current",w.pinPending&&"animate-pulse")})}):null]},w.id))})]}):null,b?jsxRuntime.jsxs(mn,{value:"sessions","data-agent-workbench-scroll-region":true,className:De("mt-0 min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-4 pb-4",l?.body),children:[u.has("new-session")&&e.capabilities.createSession?jsxRuntime.jsx(qu,{label:c.newSession,onClick:()=>d?.({type:"create-session"})}):null,!g&&e.capabilities.manageCapabilities?jsxRuntime.jsxs(mt,{type:"button",variant:"ghost",className:"mb-3 h-9 w-full justify-start gap-2 px-3 text-sm",onClick:()=>d?.({type:"open-capabilities"}),children:[jsxRuntime.jsx(lucideReact.Blocks,{className:"size-4","aria-hidden":"true"}),c.capabilities]}):null,jsxRuntime.jsx(Yu,{sessions:k,selectedSessionId:e.selectedSessionItem,status:e.sessions.status,error:e.sessions.error,query:x,emptyLabel:c.emptySessions,noResultsLabel:c.noResults,groupByMode:g,showHeading:!g,itemClassName:l?.item,capabilities:{pin:e.capabilities.pinSessions,rename:e.capabilities.renameSessions,delete:e.capabilities.deleteSessions},onSelect:w=>d?.({type:"select-session",sessionId:w}),onTogglePin:(w,v)=>d?.({type:"toggle-session-pin",sessionId:w,pinned:v}),onRename:(w,v)=>d?.({type:"rename-session",sessionId:w,title:v}),onDelete:w=>d?.({type:"delete-session",sessionId:w}),onRetry:()=>d?.({type:"retry-sessions"})})]}):null]})})}a(L0,"AgentWorkbenchSidebar");function W0({item:e,src:t=e.imageUrl,className:o,onError:r}){if(!t)return null;let n=e.mediaVariant??"cover",i=n==="logo",s=n==="cover-with-label",l=e.mediaTreatment==="monochrome-light"?"brightness-0 invert":e.mediaTreatment==="invert"?"invert":"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:De(i?"flex size-full items-center justify-center bg-[hsl(var(--monkeys-color-media-surface))] p-token-xl":"block size-full",o),children:jsxRuntime.jsx("img",{src:t,alt:"",className:De("transition-transform duration-300 group-hover/explore-card:scale-[1.03]",i?"max-h-full max-w-full object-contain":"size-full object-cover",l),onError:r})}),s?jsxRuntime.jsxs("span",{className:"pointer-events-none absolute inset-x-0 bottom-0 text-[hsl(var(--monkeys-color-media-foreground))]",style:{paddingInline:"var(--global-spacing, 0.75rem)",paddingBottom:"var(--global-spacing-sm, 0.5rem)",paddingTop:"var(--global-spacing-2xl, 1.5rem)",backgroundImage:"linear-gradient(to top, hsl(var(--monkeys-color-media-overlay) / 0.8), hsl(var(--monkeys-color-media-overlay) / 0.3), transparent)"},children:[jsxRuntime.jsx("span",{className:"block text-base font-semibold",children:e.title}),e.subtitle?jsxRuntime.jsx("span",{className:"block text-xs opacity-75",style:{marginTop:"calc(var(--global-spacing, 0.75rem) / 6)"},children:e.subtitle}):null]}):null]})}a(W0,"AgentWorkbenchExploreCardMedia");function z0({sessions:e,groups:t,config:o,labels:r,selectedSessionId:n,searchQuery:i="",loading:s=false,error:l,showDraftSession:d=!n,deleteSessions:c=false,variant:p="default",defaultGroupId:u,header:g,footer:f,className:b,renderItemMedia:x,onIntent:y}){let k=ho.useMemo(()=>monkeys.resolveAgentWorkbenchSidebarConfig(o),[o]),w=ho.useMemo(()=>new Set(k.visibleSections),[k.visibleSections]),v=t?.length?t:k.groups,h=u??k.defaultGroupId,[S,T]=ho.useState(h??v[0]?.id??""),C=v.find(D=>D.id===S)??v[0],R=i.trim().toLocaleLowerCase(),M=d&&(!R||r.draftSession.toLocaleLowerCase().includes(R)),I=ho.useMemo(()=>e.filter(D=>!R||D.title.toLocaleLowerCase().includes(R)),[R,e]);ho.useEffect(()=>{v.some(D=>D.id===S)||T(h??v[0]?.id??"");},[S,v,h]);let A=a(D=>{T(D),y?.({type:"change-group",groupId:D});},"changeGroup"),N=w.has("groups")&&C?jsxRuntime.jsx("div",{className:"border-t border-border px-4 pb-4 pt-3",children:jsxRuntime.jsxs(Ea,{value:C.id,onValueChange:A,children:[jsxRuntime.jsx(Aa,{className:"grid h-10 w-full rounded-[var(--radius)] bg-muted p-0.5 text-foreground",style:{gridTemplateColumns:`repeat(${v.length}, minmax(0, 1fr))`},children:v.map(D=>jsxRuntime.jsx(Kn,{value:D.id,className:"rounded-md text-sm font-semibold text-foreground data-[state=active]:border data-[state=active]:border-border data-[state=active]:bg-background",children:D.label},D.id))}),v.map(D=>jsxRuntime.jsx(mn,{value:D.id,className:"mt-3",children:jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:D.items.map(E=>jsxRuntime.jsx("button",{type:"button","aria-label":E.title,className:"group/explore-card relative aspect-[1.27] overflow-hidden rounded-[var(--radius)] border border-border bg-card text-left transition hover:border-primary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",style:Number.isFinite(D.itemAspectRatio)&&Number(D.itemAspectRatio)>0?{aspectRatio:D.itemAspectRatio}:void 0,onClick:()=>y?.({type:"select-item",groupId:D.id,item:E}),children:x?.(E,D)??jsxRuntime.jsx(W0,{item:E})},E.id))})},D.id))]})}):void 0;return jsxRuntime.jsx(Ya,{"data-sidebar-style":"explore","data-sidebar-width-percent":k.widthPercent,"aria-label":r.navigation,variant:p,density:p==="trend"?"compact":void 0,header:w.has("header")?g:void 0,search:w.has("search")?jsxRuntime.jsx(Ku,{value:i,label:r.search,variant:p,onChange:D=>y?.({type:"change-search",query:D})}):void 0,primaryAction:w.has("new-session")?jsxRuntime.jsx(qu,{label:r.newSession,variant:p,onClick:()=>y?.({type:"create-session"})}):void 0,groups:N,footer:w.has("footer")?f:void 0,bodyProps:{"data-agent-workbench-session-scroll-region":""},className:b,classNames:{body:"min-h-[160px] flex-[0_1_280px]"},children:w.has("sessions")?jsxRuntime.jsxs("div",{className:"space-y-2",children:[M?jsxRuntime.jsx("button",{type:"button","aria-current":"page",className:"block h-10 w-full min-w-0 truncate rounded-[var(--radius)] border border-primary bg-primary/10 px-3 text-left text-sm font-semibold text-foreground",onClick:()=>y?.({type:"create-session"}),children:r.draftSession}):null,I.length>0||!M||s||l?jsxRuntime.jsx(Yu,{sessions:I,selectedSessionId:n,status:l?"error":s?"loading":"ready",error:l,query:R,emptyLabel:r.emptySessions,noResultsLabel:r.noResults,retryLabel:r.retry,groupByMode:k.navigationMode!=="default",variant:p,capabilities:{delete:c},onSelect:D=>y?.({type:"select-session",sessionId:D}),onDelete:D=>y?.({type:"delete-session",sessionId:D}),onRetry:r.retry?()=>y?.({type:"retry-sessions"}):void 0}):null]}):null})}a(z0,"AgentWorkbenchExploreSidebar");var a4={reasoning:"reasoning",plan:"plan",task:"tasks",tool:"tools",approval:"approval",artifact:"artifacts",usage:"usage"};function i4(e){let t=e.filter(c=>c.eventType==="status"),o=t.at(-1);if(!o)return;if(o.payload.status!=="stopped"||o.payload.durationMs!==void 0)return o;let r=o.runId?t.filter(c=>c.runId===o.runId&&c.sequence<=o.sequence):t.filter(c=>c.sequence<=o.sequence),n=-1;for(let c=r.length-1;c>=0;c-=1){let p=r[c];if(p.sequence<o.sequence&&p.payload.status==="stopped"){n=c;break}}let i=r.slice(n+1).reverse().find(c=>c.payload.status==="running"||c.payload.status==="queued"),s=i?.payload.startedAt??i?.occurredAt,l=o.payload.stoppedAt??o.occurredAt;if(!s||!l)return o;let d=Date.parse(l)-Date.parse(s);return Number.isFinite(d)&&d>=0?{...o,resolvedDurationMs:d}:o}a(i4,"projectRun");function s4(e,t){let o=a4[e.eventType];return o?t[o]===true:true}a(s4,"isVisible");function as(e,t,o){let r=new Map;for(let n of e){if(n.eventType!==t)continue;let i=n;r.set(o(i),i);}return [...r.values()].sort((n,i)=>n.sequence-i.sequence)}a(as,"latestBy");function Zu(e){let t=e.events.filter(o=>s4(o,e.snapshot.capabilities));return {mode:e.snapshot.mode,status:e.status,reasoning:as(t,"reasoning",o=>o.payload.reasoningId),plans:as(t,"plan",o=>o.payload.planId),tasks:as(t,"task",o=>o.payload.taskId),tools:as(t,"tool",o=>o.payload.toolCallId),approvals:as(t,"approval",o=>o.payload.approvalId),artifacts:as(t,"artifact",o=>o.payload.artifactId),usage:[...t].reverse().find(o=>o.eventType==="usage"),run:i4(t)}}a(Zu,"createAgentWorkbenchActivityModel");function u4({value:e}){if(e===void 0)return null;let t=typeof e=="string"?e:JSON.stringify(e,null,2);return jsxRuntime.jsx("pre",{className:"max-h-48 max-w-full overflow-auto overscroll-contain whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-foreground [overflow-wrap:anywhere]",tabIndex:0,children:t})}a(u4,"JsonValue");function O0({approval:e,className:t,onDecision:o}){let r=Ye().agentWorkbench.approval,n=e.status==="requested",i=e.status==="approved";return jsxRuntime.jsx("article",{className:De("min-w-0 overflow-hidden rounded-lg border border-border bg-card p-3 text-card-foreground",t),"data-agent-approval-status":e.status,children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[n?jsxRuntime.jsx(lucideReact.Clock3,{className:"mt-0.5 size-4 shrink-0 text-warning-foreground","aria-hidden":"true"}):i?jsxRuntime.jsx(lucideReact.Check,{className:"mt-0.5 size-4 shrink-0 text-success","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.X,{className:"mt-0.5 size-4 shrink-0 text-destructive-text","aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("h3",{className:"break-words text-sm font-medium",children:e.title}),e.description?jsxRuntime.jsx("p",{tabIndex:0,className:"mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words text-sm text-muted-foreground [overflow-wrap:anywhere]",children:e.description}):null,e.requestedAction!==void 0?jsxRuntime.jsx("div",{className:"mt-3 min-w-0",children:jsxRuntime.jsx(u4,{value:e.requestedAction})}):null,n?jsxRuntime.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[jsxRuntime.jsx(mt,{type:"button",size:"sm",className:"h-auto px-3 py-1.5 text-sm",disabled:!o,onClick:()=>o?.({approvalId:e.approvalId,approved:true}),children:r.approve}),jsxRuntime.jsx(mt,{type:"button",variant:"outline",size:"sm",className:"h-auto px-3 py-1.5 text-sm",disabled:!o,onClick:()=>o?.({approvalId:e.approvalId,approved:false}),children:r.reject})]}):jsxRuntime.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:i?r.approved:r.rejected})]})]})})}a(O0,"AgentWorkbenchApproval");function F0({value:e,className:t}){if(e===void 0)return null;let o=typeof e=="string"?e:JSON.stringify(e,null,2);return jsxRuntime.jsx("pre",{tabIndex:0,className:De("max-h-64 max-w-full overflow-auto overscroll-contain whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-foreground [overflow-wrap:anywhere]",t),children:o})}a(F0,"JsonValue");function x4({status:e}){Ye().agentWorkbench.tool.status;let o="size-3.5 shrink-0";return e==="pending"?jsxRuntime.jsx(lucideReact.Clock3,{className:o,"aria-hidden":"true"}):e==="running"?jsxRuntime.jsx(lucideReact.Loader2,{className:De(o,"animate-spin"),"aria-hidden":"true"}):e==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:De(o,"text-primary"),"aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.XCircle,{className:De(o,"text-destructive-text"),"aria-hidden":"true"})}a(x4,"ToolStatus");function Ju({event:e,expanded:t,defaultExpanded:o=e.payload.status==="failed",className:r,classNames:n,onExpandedChange:i}){let s=Ye().agentWorkbench.tool,[l,d]=ho.useState(o),c=t!==void 0,p=t??l,u=e.payload.status,g=a(f=>{c||d(f),i?.(f);},"setExpanded");return jsxRuntime.jsxs("details",{open:p,className:De("group min-w-0 overflow-hidden rounded-lg border border-border bg-card text-card-foreground",n?.root,r),"data-tool-status":u,children:[jsxRuntime.jsxs("summary",{className:De("flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",n?.trigger),onClick:f=>{f.preventDefault(),g(!p);},children:[jsxRuntime.jsx(lucideReact.TerminalSquare,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:e.payload.toolName}),jsxRuntime.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-foreground",children:[jsxRuntime.jsx(x4,{status:u}),s.status[u]]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180","aria-hidden":"true"})]}),jsxRuntime.jsxs("div",{className:De("min-w-0 space-y-3 border-t border-border px-3 py-3 text-sm",n?.content),children:[e.payload.input!==void 0?jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s.input}),jsxRuntime.jsx(F0,{value:e.payload.input,className:n?.input})]}):null,e.payload.output!==void 0?jsxRuntime.jsxs("div",{className:"space-y-1.5",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:s.output}),jsxRuntime.jsx(F0,{value:e.payload.output,className:n?.output})]}):null,e.payload.error?jsxRuntime.jsx("p",{tabIndex:0,className:"max-h-32 overflow-auto whitespace-pre-wrap break-words text-sm text-destructive-text [overflow-wrap:anywhere]",role:"alert",children:e.payload.error}):null]})]})}a(Ju,"AgentWorkbenchTool");function D4({artifact:e,label:t,onDownload:o}){let r=ho.useRef(false),[n,i]=ho.useState(false);return jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon","aria-label":t,title:t,disabled:n,className:"text-muted-foreground hover:text-foreground",onClick:async s=>{if(s.preventDefault(),s.stopPropagation(),!r.current){r.current=true,i(true);try{await o(e);}finally{r.current=false,i(false);}}},children:n?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Download,{className:"size-4","aria-hidden":"true"})})}a(D4,"ArtifactDownloadButton");function hb({icon:e,title:t,open:o,streaming:r,className:n,triggerClassName:i,contentClassName:s,children:l}){return jsxRuntime.jsxs("details",{className:De("group min-w-0 overflow-hidden rounded-lg border border-border bg-card text-card-foreground",n),open:o,children:[jsxRuntime.jsxs("summary",{className:De("flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm font-medium outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",i),children:[r?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 shrink-0 animate-spin","aria-hidden":"true"}):jsxRuntime.jsx(e,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180","aria-hidden":"true"})]}),jsxRuntime.jsx("div",{className:De("min-w-0 border-t border-border px-3 py-3 text-sm",s),children:l})]})}a(hb,"ActivityDetails");function H0({status:e}){return e==="completed"||e==="passed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"size-4 text-success","aria-hidden":"true"}):e==="failed"?jsxRuntime.jsx(lucideReact.XCircle,{className:"size-4 text-destructive-text","aria-hidden":"true"}):e==="running"?jsxRuntime.jsx(lucideReact.Clock3,{className:"size-4 animate-pulse text-warning-foreground","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Circle,{className:"size-4 text-muted-foreground","aria-hidden":"true"})}a(H0,"StatusIcon");function P4(e){if(e<1e3)return "<1s";let t=Math.floor(e/1e3),o=Math.floor(t/60),r=t%60;return o>0?`${o}m ${r}s`:`${r}s`}a(P4,"formatDuration");function E4({event:e}){let t=Ye().agentWorkbench,o=e.payload.status;return o!=="stopping"&&o!=="stopped"?null:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",role:"status",children:[o==="stopping"?jsxRuntime.jsx(lucideReact.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.CircleStop,{className:"size-4","aria-hidden":"true"}),jsxRuntime.jsx("span",{children:o==="stopping"?t.run.stopping:t.run.stoppedAfter({duration:P4(e.payload.durationMs??e.resolvedDurationMs??0)})})]})}a(E4,"RunStatus");function V0({viewModel:e,ariaLabel:t,hiddenToolCallIds:o,hideReasoning:r=false,hideStoppedRun:n=false,className:i,classNames:s,onApprovalDecision:l,onArtifactOpen:d,onArtifactDownload:c}){let p=Ye().agentWorkbench;if(!e)return null;let u=Zu(e),g=r?[]:u.reasoning,f=u.tools.filter(v=>!o?.has(v.payload.toolCallId)),b=u.approvals.filter(v=>!v.payload.toolCallId||!o?.has(v.payload.toolCallId)),x=u.usage?.payload,y=typeof x?.contextWindow=="number"&&x.contextWindow>0?x.contextWindow:void 0,k=u.run?.payload.status==="stopping"||u.run?.payload.status==="stopped"&&!n;return g.length>0||u.plans.length>0||u.tasks.length>0||f.length>0||b.length>0||u.artifacts.length>0||k||y!==void 0?jsxRuntime.jsxs("section",{className:De("space-y-3",s?.root,i),"aria-label":t??p.label,"data-agent-workbench-mode":u.mode,"data-agent-workbench-status":u.status,children:[g.map(v=>jsxRuntime.jsx(hb,{icon:lucideReact.Circle,title:p.reasoning,open:v.payload.status==="streaming",streaming:v.payload.status==="streaming",className:s?.item,triggerClassName:s?.trigger,contentClassName:s?.content,children:jsxRuntime.jsx("div",{tabIndex:0,className:"max-h-64 overflow-auto whitespace-pre-wrap break-words text-muted-foreground [overflow-wrap:anywhere]",children:v.payload.text})},v.payload.reasoningId)),u.plans.map(v=>jsxRuntime.jsx(hb,{icon:lucideReact.Circle,title:v.payload.title||p.plan,open:v.payload.status==="running",streaming:v.payload.status==="running",className:s?.item,triggerClassName:s?.trigger,contentClassName:s?.content,children:jsxRuntime.jsx("ol",{className:"space-y-2",children:v.payload.steps.map(h=>jsxRuntime.jsxs("li",{className:"flex min-w-0 items-start gap-2",children:[jsxRuntime.jsx(H0,{status:h.status}),jsxRuntime.jsx("span",{className:"min-w-0 break-words [overflow-wrap:anywhere]",children:h.title})]},h.id))})},v.payload.planId)),u.tasks.map(v=>jsxRuntime.jsx(hb,{icon:lucideReact.Circle,title:v.payload.title,open:v.payload.status==="running",streaming:v.payload.status==="running",className:s?.item,triggerClassName:s?.trigger,contentClassName:s?.content,children:jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[jsxRuntime.jsx(H0,{status:v.payload.status}),jsxRuntime.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-words text-muted-foreground [overflow-wrap:anywhere]",children:v.payload.detail||p.taskNoDetail})]})},v.payload.taskId)),f.map(v=>jsxRuntime.jsx(Ju,{event:v,defaultExpanded:v.payload.status==="failed",classNames:{root:s?.item,trigger:s?.trigger,content:s?.content}},v.payload.toolCallId)),b.map(v=>jsxRuntime.jsx(O0,{approval:v.payload,className:s?.approval,onDecision:l},v.payload.approvalId)),u.artifacts.map(v=>{let h=!!(v.payload.url&&d);return jsxRuntime.jsxs("article",{className:De("flex items-center gap-3 rounded-lg border border-border bg-card p-3 text-card-foreground",s?.artifact),children:[jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:"truncate text-sm font-medium",children:v.payload.name}),jsxRuntime.jsx("div",{className:"text-xs text-muted-foreground",children:p.artifact[v.payload.status]})]}),v.payload.url?jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground","aria-label":p.artifact.open({name:v.payload.name}),title:p.artifact.open({name:v.payload.name}),disabled:!h,onClick:S=>{S.preventDefault(),S.stopPropagation(),v.payload.url&&d?.({artifactId:v.payload.artifactId,name:v.payload.name,url:v.payload.url});},children:jsxRuntime.jsx(lucideReact.PanelRightOpen,{className:"size-4","aria-hidden":"true"})}):null,v.payload.url&&v.payload.status==="ready"&&c?jsxRuntime.jsx(D4,{artifact:{artifactId:v.payload.artifactId,name:v.payload.name,url:v.payload.url},label:p.artifactWorkspace.download({name:v.payload.name}),onDownload:c}):null]},v.payload.artifactId)}),k&&u.run?jsxRuntime.jsx(E4,{event:u.run}):null,x&&y!==void 0?jsxRuntime.jsx("div",{className:De("flex justify-end",s?.usage),"aria-label":p.usage.label,children:jsxRuntime.jsx("span",{className:"rounded-full border border-border bg-muted px-2.5 py-1 text-xs text-foreground",children:p.usage.context({used:x.contextTokens??x.totalTokens??0,total:y})})}):null]}):null}a(V0,"AgentWorkbenchActivity");var A4={diff:"diff","workspace-file":"workspaceFiles",terminal:"terminal","test-result":"testResults",artifact:"artifacts"};function tp(e,t,o){let r=new Map;for(let n of e){if(n.eventType!==t)continue;let i=n;r.set(o(i),i);}return [...r.values()].sort((n,i)=>n.sequence-i.sequence)}a(tp,"latestBy");function B4(e){let t=new Map;for(let o of e){let r=t.get(o.payload.terminalId)??{terminalId:o.payload.terminalId,stdin:"",stdout:"",stderr:"",status:"",sequence:o.sequence},n=o.payload.stream;t.set(o.payload.terminalId,{...r,...n==="status"?{status:o.payload.chunk}:{[n]:`${r[n]}${o.payload.chunk}`},...o.payload.exitCode===void 0?{}:{exitCode:o.payload.exitCode},sequence:o.sequence});}return [...t.values()].sort((o,r)=>o.sequence-r.sequence)}a(B4,"projectTerminals");function op(e){let t=e.snapshot.capabilities,o=e.events.filter(s=>{let l=A4[s.eventType];return l?t[l]===true:false}),r=[...e.events].reverse().find(s=>s.eventType==="status"),n=r?.runId,i=[...e.events].reverse().find(s=>s.eventType==="summary"&&t.summary===true&&(!n||s.runId===n));return {mode:e.snapshot.mode,modelId:e.snapshot.modelId,permissionProfile:e.snapshot.permissionProfile,status:e.status,sessionId:e.sessionId,capabilities:t,resumable:t.resume===true&&e.resumable,summary:i,error:[...e.events].reverse().find(s=>s.eventType==="error"),run:r,usage:t.usage?[...e.events].reverse().find(s=>s.eventType==="usage"):void 0,workspace:{diffs:tp(o,"diff",s=>s.payload.path),files:tp(o,"workspace-file",s=>s.payload.path),terminals:B4(o.filter(s=>s.eventType==="terminal")),tests:tp(o,"test-result",s=>s.payload.testId),artifacts:tp(o,"artifact",s=>s.payload.artifactId)}}}a(op,"createAgentWorkbenchDetailsModel");function G0(e){if(e===void 0)return "-";let t=Math.max(0,Math.round(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}a(G0,"formatDuration");function Z4(e,t){if(!e)return "-";let o=new Date(e);return Number.isNaN(o.getTime())?"-":new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"short"}).format(o)}a(Z4,"formatDate");function $0({value:e}){return jsxRuntime.jsx("span",{className:"rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-semibold text-foreground",children:e})}a($0,"Count");function Rl({title:e,count:t,icon:o,className:r,children:n}){return t===0?null:jsxRuntime.jsxs("details",{className:De("group rounded-lg border border-border bg-card text-card-foreground",r),open:true,children:[jsxRuntime.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm font-medium outline-hidden focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:[jsxRuntime.jsx(o,{className:"size-4 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:e}),jsxRuntime.jsx($0,{value:t}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-180","aria-hidden":"true"})]}),jsxRuntime.jsx("div",{className:"border-t border-border p-3",children:n})]})}a(Rl,"DetailsSection");function j0({status:e}){return e==="completed"||e==="passed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"size-4 text-primary","aria-hidden":"true"}):e==="failed"?jsxRuntime.jsx(lucideReact.XCircle,{className:"size-4 text-destructive-text","aria-hidden":"true"}):e==="running"?jsxRuntime.jsx(lucideReact.Clock3,{className:"size-4 animate-pulse","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Circle,{className:"size-4 text-muted-foreground","aria-hidden":"true"})}a(j0,"StatusIcon");function _0({state:e}){let t=Ye().agentWorkbench.details,o=e==="error";return jsxRuntime.jsxs("div",{className:"flex min-h-48 flex-col items-center justify-center gap-2 px-6 text-center",role:o?"alert":e==="loading"?"status":void 0,"aria-busy":e==="loading"||void 0,children:[e==="loading"?jsxRuntime.jsx(lucideReact.RefreshCw,{className:"size-5 animate-spin text-muted-foreground","aria-hidden":"true"}):o?jsxRuntime.jsx(lucideReact.AlertCircle,{className:"size-5 text-destructive-text","aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-5 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"text-sm font-medium",children:t.state[e].title}),jsxRuntime.jsx("div",{className:"text-xs text-muted-foreground",children:t.state[e].description})]})}a(_0,"StateContent");function J4({model:e,onIntent:t}){let o=Ye().agentWorkbench,r=o.details,n=Co().locale,i=e.summary,s=e.run?.payload,l=e.error,d=e.status==="failed"&&l?.payload.retryable,c=e.resumable&&["stopped","completed","failed"].includes(e.status),p=e.capabilities.threadForking,u=e.capabilities.editAndRerun,g=e.usage?.payload.totalTokens??(e.usage?.payload.inputTokens!==void 0||e.usage?.payload.outputTokens!==void 0?(e.usage.payload.inputTokens??0)+(e.usage.payload.outputTokens??0):void 0);return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("section",{className:"rounded-lg border border-border bg-muted/40 p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(j0,{status:e.status}),jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:r.status[e.status]})]}),jsxRuntime.jsxs("dl",{className:"mt-3 grid grid-cols-2 gap-3 text-xs",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.duration}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:G0(s?.durationMs)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.updated}),jsxRuntime.jsx("dd",{className:"mt-0.5 truncate font-medium",children:Z4(s?.stoppedAt??s?.completedAt??s?.failedAt,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.model}),jsxRuntime.jsx("dd",{className:"mt-0.5 truncate font-medium",children:e.modelId})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.mode}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:o.modes[e.mode]})]}),e.permissionProfile?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.permissions}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:o.composer.permissionOptions[e.permissionProfile]})]}):null,g!==void 0?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("dt",{className:"text-muted-foreground",children:r.tokenUsage}),jsxRuntime.jsx("dd",{className:"mt-0.5 font-medium",children:new Intl.NumberFormat(n).format(g)})]}):null]}),l?jsxRuntime.jsx("div",{className:"mt-3 rounded-md border border-destructive/30 bg-destructive/5 p-2.5 text-sm text-destructive-text",role:"alert",children:l.payload.message}):null,d||c?jsxRuntime.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[d?jsxRuntime.jsx(mt,{type:"button",variant:"outline",size:"sm",className:"h-auto px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"retry",eventId:l.eventId}),children:r.actions.retry}):null,c?jsxRuntime.jsx(mt,{type:"button",size:"sm",className:"h-auto px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"resume",sessionId:e.sessionId}),children:r.actions.resume}):null]}):null]}),jsxRuntime.jsxs("section",{className:"flex flex-wrap gap-2 rounded-lg border border-border bg-card p-3 text-card-foreground",children:[p?jsxRuntime.jsxs(mt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"continue-in-new-task",sessionId:e.sessionId}),children:[jsxRuntime.jsx(lucideReact.GitFork,{className:"size-3.5","aria-hidden":"true"}),r.actions.continueInNewTask]}):null,u?jsxRuntime.jsxs(mt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"edit-and-rerun",sessionId:e.sessionId}),children:[jsxRuntime.jsx(lucideReact.PencilLine,{className:"size-3.5","aria-hidden":"true"}),r.actions.editAndRerun]}):null,jsxRuntime.jsxs(mt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"export",sessionId:e.sessionId}),children:[jsxRuntime.jsx(lucideReact.Download,{className:"size-3.5","aria-hidden":"true"}),r.actions.export]})]}),jsxRuntime.jsxs("section",{className:"rounded-lg border border-border bg-card p-3 text-card-foreground",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold",children:r.summary}),i?.payload.text?jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon",className:"size-8 text-muted-foreground hover:text-foreground","aria-label":r.actions.copySummary,disabled:!t,onClick:()=>t?.({type:"copy-summary",summaryId:i.payload.summaryId,text:i.payload.text}),children:jsxRuntime.jsx(lucideReact.Copy,{className:"size-4","aria-hidden":"true"})}):null]}),i?.payload.status==="failed"?jsxRuntime.jsxs("div",{className:"mt-3 space-y-2",children:[jsxRuntime.jsx("p",{className:"text-sm text-destructive-text",role:"alert",children:r.summaryFailed}),jsxRuntime.jsxs(mt,{type:"button",variant:"outline",size:"sm",className:"h-auto gap-1.5 px-2.5 py-1.5 text-xs",disabled:!t,onClick:()=>t?.({type:"retry-summary",eventId:i.eventId}),children:[jsxRuntime.jsx(lucideReact.RotateCcw,{className:"size-3.5","aria-hidden":"true"}),r.actions.retrySummary]})]}):i?.payload.text?jsxRuntime.jsxs("div",{className:"mt-3 space-y-3 text-sm",children:[jsxRuntime.jsx("p",{className:"whitespace-pre-wrap text-muted-foreground",children:i.payload.text}),i.payload.highlights.length>0?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h4",{className:"text-xs font-medium",children:r.highlights}),jsxRuntime.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-5 text-muted-foreground",children:i.payload.highlights.map(f=>jsxRuntime.jsx("li",{children:f},f))})]}):null,i.payload.pendingItems.length>0?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h4",{className:"text-xs font-medium",children:r.pendingItems}),jsxRuntime.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-5 text-muted-foreground",children:i.payload.pendingItems.map(f=>jsxRuntime.jsx("li",{children:f},f))})]}):null]}):jsxRuntime.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:r.summaryEmpty})]})]})}a(J4,"SummaryPanel");function ez({model:e,sectionClassName:t,codeClassName:o}){let r=Ye().agentWorkbench.details.workspace,n=e.workspace;return jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx(Rl,{title:r.diffs,count:n.diffs.length,icon:lucideReact.FileCode2,className:t,children:jsxRuntime.jsx("div",{className:"space-y-3",children:n.diffs.map(i=>jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[jsxRuntime.jsx("span",{className:"truncate font-medium",children:i.payload.path}),jsxRuntime.jsx("span",{className:"shrink-0 text-muted-foreground",children:r.diffStatus[i.payload.status]})]}),i.payload.patch?jsxRuntime.jsx("pre",{className:De("mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs",o),children:i.payload.patch}):null]},i.payload.path))})}),jsxRuntime.jsx(Rl,{title:r.files,count:n.files.length,icon:lucideReact.Files,className:t,children:jsxRuntime.jsx("ul",{className:"space-y-2 text-xs",children:n.files.map(i=>jsxRuntime.jsxs("li",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-3.5 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.payload.path}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:r.fileOperation[i.payload.operation]})]},i.payload.path))})}),jsxRuntime.jsx(Rl,{title:r.terminals,count:n.terminals.length,icon:lucideReact.TerminalSquare,className:t,children:jsxRuntime.jsx("div",{className:"space-y-3",children:n.terminals.map(i=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between gap-2 text-xs font-medium",children:[jsxRuntime.jsx("span",{children:i.terminalId}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i.exitCode===void 0?i.status:r.exitCode({code:i.exitCode})})]}),jsxRuntime.jsx("pre",{className:De("mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs",o),children:[i.stdin,i.stdout,i.stderr].filter(Boolean).join(`
|
|
67
67
|
`)})]},i.terminalId))})}),jsxRuntime.jsx(Rl,{title:r.tests,count:n.tests.length,icon:lucideReact.TestTube2,className:t,children:jsxRuntime.jsx("ul",{className:"space-y-2 text-xs",children:n.tests.map(i=>jsxRuntime.jsxs("li",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(j0,{status:i.payload.status}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.payload.name}),i.payload.durationMs===void 0?null:jsxRuntime.jsx("span",{className:"text-muted-foreground",children:G0(i.payload.durationMs)})]}),i.payload.output?jsxRuntime.jsx("pre",{className:De("mt-2 max-h-48 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs",o),children:i.payload.output}):null]},i.payload.testId))})}),jsxRuntime.jsx(Rl,{title:r.artifacts,count:n.artifacts.length,icon:lucideReact.FileOutput,className:t,children:jsxRuntime.jsx("ul",{className:"space-y-2 text-xs",children:n.artifacts.map(i=>jsxRuntime.jsxs("li",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.FileOutput,{className:"size-3.5 text-muted-foreground","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.payload.name}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:i.payload.kind})]},i.payload.artifactId))})})]})}a(ez,"WorkspacePanel");function U0({viewModel:e,state:t="ready",activeTab:o="summary",className:r,classNames:n,onActiveTabChange:i,onIntent:s,onExport:l,onCopySummary:d,onRetry:c,onRetrySummary:p}){let u=s||l||d||c||p?w=>{if(w.type==="export"&&l)return l(w);if(w.type==="copy-summary"&&d)return d(w);if(w.type==="retry"&&c)return c(w);if(w.type==="retry-summary"&&p)return p(w);s?.(w);}:void 0,g=Ye().agentWorkbench.details;if(t!=="ready")return jsxRuntime.jsx("aside",{className:De("flex h-full min-h-0 flex-col border-l border-border bg-background",n?.root,r),children:jsxRuntime.jsx(_0,{state:t})});if(!e)return jsxRuntime.jsx("aside",{className:De("flex h-full min-h-0 flex-col border-l border-border bg-background",n?.root,r),children:jsxRuntime.jsx(_0,{state:"empty"})});let f=op(e),b=Object.values(f.workspace).reduce((w,v)=>w+v.length,0),x=b>0,y=o==="workspace"&&!x?"summary":o,k=[{id:"summary",label:g.tabs.summary,count:f.summary?1:0},...x?[{id:"workspace",label:g.tabs.workspace,count:b}]:[]];return jsxRuntime.jsxs("aside",{className:De("flex h-full min-h-0 min-w-0 flex-col border-l border-border bg-background text-foreground",n?.root,r),"data-agent-workbench-mode":f.mode,children:[jsxRuntime.jsxs("header",{className:De("flex shrink-0 items-center gap-2 border-b border-border px-4 py-3",n?.header),children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("h2",{className:"truncate text-sm font-semibold",children:g.title}),jsxRuntime.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:g.description})]}),s?jsxRuntime.jsx(mt,{type:"button",variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground","aria-label":g.actions.close,onClick:()=>s({type:"close"}),children:jsxRuntime.jsx(lucideReact.X,{className:"size-4","aria-hidden":"true"})}):null]}),jsxRuntime.jsxs(Ea,{value:y,className:"flex min-h-0 flex-1 flex-col",onValueChange:w=>i?.(w),children:[jsxRuntime.jsx(Aa,{"aria-label":g.tabs.label,className:De("flex h-auto shrink-0 gap-1 rounded-none border-b border-border bg-transparent px-3 py-2",n?.tabs),children:k.map(w=>jsxRuntime.jsxs(Kn,{value:w.id,className:"min-w-0 flex-1 gap-1 px-2 py-1.5 text-xs shadow-none data-[state=active]:bg-primary/10 data-[state=active]:text-primary data-[state=active]:shadow-none",children:[jsxRuntime.jsx("span",{className:"truncate",children:w.label}),jsxRuntime.jsx($0,{value:w.count})]},w.id))}),jsxRuntime.jsx(mn,{value:"summary",className:De("mt-0 min-h-0 flex-1 overflow-y-auto p-3",n?.body),children:jsxRuntime.jsx(J4,{model:f,onIntent:u})}),x?jsxRuntime.jsx(mn,{value:"workspace",className:De("mt-0 min-h-0 flex-1 overflow-y-auto p-3",n?.body),children:jsxRuntime.jsx(ez,{model:f,sectionClassName:n?.section,codeClassName:n?.code})}):null]})]})}a(U0,"AgentWorkbenchTaskDetails");var ap=Object.freeze({mobile:768,drawer:1200,compact:1440,lowHeight:768});function wb(e,t=ap){return e<t.mobile?"mobile":e<t.drawer?"drawer":e<t.compact?"compact":"wide"}a(wb,"resolveAgentWorkbenchShellLayout");var vb="monkeys-agent-workbench-overlay-open";function K0(e){return typeof e=="number"?`${e}px`:e}a(K0,"cssSize");function np(e,t,o){return Math.min(Math.max(e,t),Math.max(t,o))}a(np,"clamp");function q0(){return typeof window>"u"?{width:1440,height:900}:{width:window.visualViewport?.width??window.innerWidth,height:window.visualViewport?.height??window.innerHeight}}a(q0,"initialMeasuredSize");function az(e){if(!e||typeof window>"u")return {};try{let t=JSON.parse(window.localStorage.getItem(e)??"{}");return typeof t=="object"&&t!==null?t:{}}catch{return {}}}a(az,"readStoredWidths");function iz(e,t){!e||typeof window>"u"||window.localStorage.setItem(e,JSON.stringify(t));}a(iz,"writeStoredWidths");function Y0({sidebar:e,children:t,details:o,sidebarOpen:r=true,sidebarDefaultOpen:n=true,detailsOpen:i=true,onDetailsOpenChange:s,sidebarWidth:l=280,detailsWidth:d=360,sidebarMinWidth:c=240,sidebarMaxWidth:p=400,detailsMinWidth:u=320,detailsMaxWidth:g=720,mainMinWidth:f=600,responsive:b=false,responsiveMeasurement:x="container",responsiveWidth:y,responsiveHeight:k,breakpoints:w=ap,onLayoutChange:v,showResponsiveControls:h=true,overlayGroupId:S,resizable:T=false,widthStorageKey:C,onSidebarWidthChange:R,onDetailsWidthChange:M,labels:I,variant:A,density:N,className:D,classNames:E,style:P,...W}){let H=Nl({variant:A,density:N}),B=ho.useRef(null),L=ho.useRef(null),F=ho.useRef(null),_=ho.useId(),[$,G]=ho.useState(q0),z=ho.useMemo(()=>az(C),[C]),[re,Z]=ho.useState(()=>typeof l=="number"?z.sidebar??l:280),[ae,ee]=ho.useState(()=>typeof d=="number"?z.details??d:360),[q,U]=ho.useState(false),[X,O]=ho.useState(false),[K,ne]=ho.useState(n),fe=ho.useCallback((te,Te=document.activeElement)=>{if(!(Te instanceof HTMLElement)||Te===document.body||Te===document.documentElement)return;let ze=te==="sidebar"?L:F;ze.current=Te;},[]),he=ho.useCallback(te=>{let Te=te==="sidebar"?L:F,ze=Te.current;Te.current=null,ze?.isConnected&&window.requestAnimationFrame(()=>{ze.isConnected&&ze.focus();});},[]);ho.useEffect(()=>{typeof l=="number"&&Z(z.sidebar??l);},[l,z.sidebar]),ho.useEffect(()=>ne(n),[n]),ho.useEffect(()=>{typeof d=="number"&&ee(z.details??d);},[d,z.details]),ho.useEffect(()=>{if(!b)return;let te=a(()=>{let it=q0();G({width:y??it.width,height:k??it.height});},"updateViewport");if(x==="viewport"||y!==void 0||k!==void 0)return te(),y!==void 0&&k!==void 0?void 0:(window.addEventListener("resize",te),window.visualViewport?.addEventListener("resize",te),()=>{window.removeEventListener("resize",te),window.visualViewport?.removeEventListener("resize",te);});let Te=B.current;if(!Te)return;let ze=a(()=>{let it=Te.getBoundingClientRect();G({width:it.width,height:it.height});},"updateContainer");if(ze(),typeof ResizeObserver>"u")return window.addEventListener("resize",ze),()=>window.removeEventListener("resize",ze);let je=new ResizeObserver(ze);return je.observe(Te),()=>je.disconnect()},[b,k,x,y]);let me=b?wb(y??$.width,w):"wide",ie=b&&(k??$.height)<=w.lowHeight;ho.useEffect(()=>v?.(me),[me,v]);let be=e!==void 0&&r,He=o!==void 0&&i,We=me==="drawer"||me==="mobile",Ke=be&&K&&!We,ce=He&&me==="wide",Q=Math.max(c,Math.min(p,me==="compact"?320:p,$.width-(ce?ae:0)-f)),ge=Math.max(u,Math.min(g,$.width-(Ke?re:0)-f)),we=typeof l=="number"?np(re,c,Q):l,Ie=typeof d=="number"?np(ae,u,ge):d,oe=ho.useCallback(te=>{!S||typeof window>"u"||window.dispatchEvent(new CustomEvent(vb,{detail:{groupId:S,ownerId:_,region:te}}));},[S,_]);ho.useEffect(()=>{if(!S||typeof window>"u")return;let te=a(Te=>{let ze=Te.detail;ze?.groupId!==S||ze?.ownerId===_||(U(false),O(je=>(je&&s?.(false),false)));},"handleOverlayOpen");return window.addEventListener(vb,te),()=>window.removeEventListener(vb,te)},[s,S,_]),ho.useEffect(()=>{(Ke||!be)&&U(false);},[be,Ke]),ho.useEffect(()=>{if(ce||!He){O(false);return}fe("details"),oe("details"),O(true);},[He,ce,fe,oe]);let xe=ho.useCallback((te,Te)=>{iz(C,{sidebar:te,details:Te});},[C]),Ve=ho.useCallback((te,Te)=>{if(te==="sidebar"){let je=np(Te,c,Q);return Z(je),R?.(je),je}let ze=np(Te,u,ge);return ee(ze),M?.(ze),ze},[u,M,R,ge,Q,c]),_e=ho.useCallback((te,Te)=>{if(!T||Te.button!==0)return;Te.preventDefault();let ze=Te.clientX,je=te==="sidebar"?re:ae,it=je,Y=document.body.style.cursor,pe=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let Be=a(Ce=>{let Xe=Ce.clientX-ze;it=Ve(te,je+(te==="sidebar"?Xe:-Xe));},"handleMove"),rt=a(()=>{document.body.style.cursor=Y,document.body.style.userSelect=pe,window.removeEventListener("pointermove",Be),window.removeEventListener("pointerup",rt),xe(te==="sidebar"?it:re,te==="details"?it:ae);},"handleUp");window.addEventListener("pointermove",Be),window.addEventListener("pointerup",rt,{once:true});},[ae,xe,T,re,Ve]),Ge=ho.useCallback((te,Te)=>{let je=Ve(te,(te==="sidebar"?re:ae)+Te*16);xe(te==="sidebar"?je:re,te==="details"?je:ae);},[ae,xe,re,Ve]),le={"--agent-workbench-sidebar-width":Ke?K0(we):"0px","--agent-workbench-details-width":ce?K0(Ie):"0px",gridTemplateColumns:Ke&&ce?"var(--agent-workbench-sidebar-width) minmax(0, 1fr) var(--agent-workbench-details-width)":Ke?"var(--agent-workbench-sidebar-width) minmax(0, 1fr)":ce?"minmax(0, 1fr) var(--agent-workbench-details-width)":"minmax(0, 1fr)",...P},Me=be&&We,Ae=be&&!K&&!We,J=He&&!ce,$e=b&&h&&(Me||Ae||J),ue=me==="mobile",Re=ue?"size-11":"size-9",se=ue?"[&>button]:flex [&>button]:size-11 [&>button]:items-center [&>button]:justify-center":"";return jsxRuntime.jsxs("div",{...W,ref:B,role:W.role??"region","aria-label":W["aria-label"]??"Agent workbench","data-agent-workbench-shell":"true","data-agent-workbench-variant":H.variant,"data-agent-workbench-density":H.density,"data-agent-workbench-layout":me,"data-agent-workbench-low-height":ie?"true":"false","data-sidebar-open":be?"true":"false","data-sidebar-expanded":K?"true":"false","data-sidebar-presentation":Ke?"inline":Me?"overlay":"hidden","data-details-open":He?"true":"false","data-details-presentation":ce?"inline":J?"overlay":"hidden",className:De("relative grid size-full min-h-0 min-w-0 overflow-hidden bg-background text-foreground",E?.root,D),style:le,children:[Ke?jsxRuntime.jsx("div",{"data-agent-workbench-region":"sidebar",className:De("min-h-0 min-w-0 overflow-hidden border-r border-border bg-card text-card-foreground",E?.sidebar),children:e}):null,jsxRuntime.jsxs("div",{"data-agent-workbench-region":"main",className:De("flex min-h-0 min-w-0 flex-col overflow-hidden bg-background",E?.main),children:[$e?jsxRuntime.jsxs("div",{"data-agent-workbench-responsive-controls":"true",className:De("flex min-h-11 shrink-0 items-center gap-1 border-b border-border bg-background px-2",ie&&"min-h-10",E?.controls),children:[Me||Ae?jsxRuntime.jsx("button",{type:"button",className:De("inline-flex items-center justify-center rounded-[var(--radius)] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",Re),"aria-label":I?.openSidebar??"Open navigation","aria-expanded":Ae?K:q,onClick:te=>{if(Ae){ne(true);return}fe("sidebar",te.currentTarget),oe("sidebar"),U(true);},children:jsxRuntime.jsx(lucideReact.PanelLeft,{className:"size-5","aria-hidden":"true"})}):null,J&&o?jsxRuntime.jsx("button",{type:"button",className:De("ml-auto inline-flex items-center justify-center rounded-[var(--radius)] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",Re),"aria-label":I?.openDetails??"Open details","aria-expanded":X,onClick:te=>{fe("details",te.currentTarget),oe("details"),O(true);},children:jsxRuntime.jsx(lucideReact.PanelRight,{className:"size-5","aria-hidden":"true"})}):null]}):null,jsxRuntime.jsx("div",{className:"min-h-0 min-w-0 flex-1 overflow-hidden",children:t})]}),ce?jsxRuntime.jsx("div",{"data-agent-workbench-region":"details",className:De("min-h-0 min-w-0 overflow-hidden border-l border-border bg-card text-card-foreground",E?.details),children:o}):null,T&&Ke&&typeof l=="number"?jsxRuntime.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-label":I?.resizeSidebar??"Resize navigation","aria-valuemin":c,"aria-valuemax":Q,"aria-valuenow":Number(we),className:De("absolute inset-y-0 z-20 w-2 -translate-x-1/2 cursor-col-resize touch-none bg-transparent outline-hidden after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-border after:transition-colors hover:after:bg-primary focus-visible:after:w-0.5 focus-visible:after:bg-ring",E?.resizeHandle),style:{left:"var(--agent-workbench-sidebar-width)"},onPointerDown:te=>_e("sidebar",te),onKeyDown:te=>{te.key!=="ArrowLeft"&&te.key!=="ArrowRight"||(te.preventDefault(),Ge("sidebar",te.key==="ArrowRight"?1:-1));}}):null,T&&ce&&typeof d=="number"?jsxRuntime.jsx("button",{type:"button",role:"separator","aria-orientation":"vertical","aria-label":I?.resizeDetails??"Resize details","aria-valuemin":u,"aria-valuemax":ge,"aria-valuenow":Number(Ie),className:De("absolute inset-y-0 right-[var(--agent-workbench-details-width)] z-20 w-2 translate-x-1/2 cursor-col-resize touch-none bg-transparent outline-hidden after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-border after:transition-colors hover:after:bg-primary focus-visible:after:w-0.5 focus-visible:after:bg-ring",E?.resizeHandle),onPointerDown:te=>_e("details",te),onKeyDown:te=>{te.key!=="ArrowLeft"&&te.key!=="ArrowRight"||(te.preventDefault(),Ge("details",te.key==="ArrowLeft"?1:-1));}}):null,Me?jsxRuntime.jsx(Sm,{open:q,onOpenChange:te=>{U(te),te||he("sidebar");},children:jsxRuntime.jsxs(Xd,{side:"left","aria-describedby":void 0,className:De("flex h-dvh flex-col gap-0 overflow-hidden bg-card p-0 text-card-foreground",ue?"inset-0 size-dvw !max-w-none border-0":"w-[min(360px,90vw)] !max-w-none",se,E?.sidebarOverlay),children:[jsxRuntime.jsx(Qd,{className:"sr-only",children:I?.sidebar??"Navigation"}),jsxRuntime.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e})]})}):null,J?jsxRuntime.jsx(Sm,{open:X,onOpenChange:te=>{O(te),te||(he("details"),s?.(false));},children:jsxRuntime.jsxs(Xd,{side:"right","aria-describedby":void 0,className:De("flex h-dvh flex-col gap-0 overflow-hidden bg-card p-0 text-card-foreground",ue?"inset-0 size-dvw !max-w-none border-0":"w-[min(520px,92vw)] !max-w-none",se,E?.detailsOverlay),children:[jsxRuntime.jsx(Qd,{className:"sr-only",children:I?.details??"Details"}),jsxRuntime.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:o})]})}):null]})}a(Y0,"AgentWorkbenchShell");var sz="https://p1-hera.feishucdn.com/tos-cn-i-jbbdkfciu3/84a9f036fe2b44f99b899fff4beeb963~tplv-jbbdkfciu3-image:0:0.image",X0=a(({alt:e="feishu",width:t=16,height:o=16,style:r,...n})=>jsxRuntime.jsx("img",{src:sz,alt:e,width:t,height:o,style:{display:"block",...r},...n}),"FeishuIcon"),Q0=a(({width:e=16,height:t=16,style:o,...r})=>jsxRuntime.jsxs("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",...o},...r,children:[jsxRuntime.jsx("path",{d:"M13.9 5.25c-4.45 0-8.05 2.84-8.05 6.35 0 1.89 1.06 3.6 2.72 4.76l-.45 2.01c-.1.45.38.8.78.57l2.42-1.38c.82.25 1.69.39 2.58.39 4.45 0 8.05-2.84 8.05-6.35s-3.6-6.35-8.05-6.35Z",fill:"#1683FF"}),jsxRuntime.jsx("path",{d:"M10.15 3.7c-4.5 0-8.15 2.86-8.15 6.4 0 1.78.94 3.39 2.45 4.55l-.36 1.88c-.08.43.36.75.75.55l2.18-1.15c.7.18 1.44.27 2.2.27 4.5 0 8.15-2.86 8.15-6.4s-3.65-6.1-7.22-6.1Z",fill:"#07C160"}),jsxRuntime.jsx("circle",{cx:"7.2",cy:"9.75",r:"1.05",fill:"#FFFFFF"}),jsxRuntime.jsx("circle",{cx:"11.1",cy:"9.75",r:"1.05",fill:"#FFFFFF"}),jsxRuntime.jsx("circle",{cx:"15.8",cy:"11.9",r:"0.95",fill:"#FFFFFF"}),jsxRuntime.jsx("circle",{cx:"19",cy:"11.9",r:"0.95",fill:"#FFFFFF"})]}),"WeWorkIcon"),Z0=a(({className:e,width:t=16,height:o=16,style:r,...n})=>jsxRuntime.jsx("svg",{width:t,height:o,viewBox:"64 64 896 896",xmlns:"http://www.w3.org/2000/svg",className:e,style:{display:"block",...r},...n,children:jsxRuntime.jsx("path",{d:"M573.7 252.5C422.5 197.4 201.3 96.7 201.3 96.7c-15.7-4.1-17.9 11.1-17.9 11.1-5 61.1 33.6 160.5 53.6 182.8 19.9 22.3 319.1 113.7 319.1 113.7S326 357.9 270.5 341.9c-55.6-16-37.9 17.8-37.9 17.8 11.4 61.7 64.9 131.8 107.2 138.4 42.2 6.6 220.1 4 220.1 4s-35.5 4.1-93.2 11.9c-42.7 5.8-97 12.5-111.1 17.8-33.1 12.5 24 62.6 24 62.6 84.7 76.8 129.7 50.5 129.7 50.5 33.3-10.7 61.4-18.5 85.2-24.2L565 743.1h84.6L603 928l205.3-271.9H700.8l22.3-38.7c.3.5.4.8.4.8S799.8 496.1 829 433.8l.6-1h-.1c5-10.8 8.6-19.7 10-25.8 17-71.3-114.5-99.4-265.8-154.5z",fill:"#1683FF"})}),"DingtalkIcon"),J0=a(({width:e=16,height:t=16,style:o,...r})=>jsxRuntime.jsxs("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block",...o},...r,children:[jsxRuntime.jsx("path",{d:"M12 2.65 5.35 5.4v5.2c0 4.75 2.85 8.98 6.65 10.75 3.8-1.77 6.65-6 6.65-10.75V5.4L12 2.65Z",fill:"#2563EB"}),jsxRuntime.jsx("path",{d:"M12 4.65 7.15 6.62v4.02c0 3.5 2 6.72 4.85 8.28 2.85-1.56 4.85-4.78 4.85-8.28V6.62L12 4.65Z",fill:"#38BDF8"}),jsxRuntime.jsx("circle",{cx:"12",cy:"10.1",r:"2.15",fill:"#FFFFFF"}),jsxRuntime.jsx("path",{d:"M12 12.25v3.3",stroke:"#FFFFFF",strokeWidth:"1.8",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M12 15.05h2.2",stroke:"#FFFFFF",strokeWidth:"1.8",strokeLinecap:"round"})]}),"SSOIcon");var pz=["top","middle","bottom"],ls=a(e=>e?.trim()||void 0,"normalizeCssValue"),mz=a((e,t)=>{let o=ls(e),r=ls(t);return [o,r?`url(${JSON.stringify(r)})`:void 0].filter(Boolean).join(", ")},"createBackgroundImage"),fz=a(e=>e&&pz.includes(e)?e:"bottom","normalizeLogoPosition"),bz=a(e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0,"normalizeLogoScale"),gz=a(e=>{let t=ls(e?.url),o=ls(e?.lightUrl)||t,r=ls(e?.darkUrl)||t||o;return {lightUrl:o,darkUrl:r}},"resolveLogoUrls"),tC=a(e=>ls(e)?.toLowerCase().replace(/^oauth[-_:]/,"").replace(/[\s_]+/g,"-"),"normalizeProviderType"),hz=a(e=>{switch(tC(e.providerType)??tC(e.id)){case "dingtalk":case "ding-talk":case "dingding":return jsxRuntime.jsx(Z0,{"aria-hidden":"true"});case "feishu":case "lark":return jsxRuntime.jsx(X0,{alt:"","aria-hidden":"true"});case "wework":case "wecom":case "wechat-work":case "wechatwork":return jsxRuntime.jsx(Q0,{"aria-hidden":"true"});case "oidc":case "sso":case "saml":case "saml-sso":return jsxRuntime.jsx(J0,{"aria-hidden":"true"});default:return null}},"getDefaultExternalMethodIcon");function oC({className:e,style:t,background:o,logo:r,toolbar:n,title:i,backAction:s,methods:l,activeMethodId:d,defaultMethodId:c,onMethodChange:p,externalLabel:u,externalMethods:g=[],externalPanel:f,callout:b}){let x=ho.useMemo(()=>l.filter(H=>!H.hidden),[l]),y=c??x[0]?.id,[k,w]=ho.useState(y),v=d??k,h=x.find(H=>H.id===v)??x[0],S=x.length>1,T=!f,C=mz(o?.gradient,o?.imageUrl),R=C?"custom":"default",M=fz(r?.position),I=bz(r?.scale),{lightUrl:A,darkUrl:N}=gz(r),D=!!(A||N),E=!!(A&&N&&A!==N);ho.useEffect(()=>{if(!x.length){w(void 0);return}(!v||!x.some(H=>H.id===v))&&w(y??x[0]?.id);},[x,v,y]);let P=a(H=>{d===void 0&&w(H),p?.(H);},"handleMethodChange"),W=a(H=>{let B=H.icon===void 0?hz(H):H.icon,L=jsxRuntime.jsxs("button",{type:"button",className:"login-page__oauth-button","data-login-part":"external-button","data-login-method-id":H.id,onClick:H.onClick,disabled:H.disabled,children:[B?jsxRuntime.jsx("span",{className:"login-page__oauth-icon","data-login-part":"external-icon",children:B}):null,jsxRuntime.jsx("span",{children:H.label})]});return jsxRuntime.jsx(ho__namespace.default.Fragment,{children:H.render?H.render(L):L},H.id)},"renderExternalMethod");return jsxRuntime.jsxs("main",{className:["login-page",e].filter(Boolean).join(" "),"data-login-page":true,"data-login-part":"root","data-login-background":R,style:t,children:[jsxRuntime.jsx("div",{className:"login-page__background","data-login-part":"background","data-login-background":R,style:C?{backgroundImage:C}:void 0,"aria-hidden":"true"}),n?jsxRuntime.jsx("div",{className:"login-page__toolbar","data-login-part":"toolbar",children:n}):null,D?jsxRuntime.jsx("div",{className:`login-page__logo login-page__logo--${M}`,"data-login-part":"logo","data-logo-position":M,children:E?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("img",{className:"login-page__logo-image login-page__logo-image--light","data-login-part":"logo-image","data-login-logo-mode":"light",src:A,alt:r?.alt??"",style:I?{transform:`scale(${I})`}:void 0}),jsxRuntime.jsx("img",{className:"login-page__logo-image login-page__logo-image--dark","data-login-part":"logo-image","data-login-logo-mode":"dark",src:N,alt:r?.alt??"",style:I?{transform:`scale(${I})`}:void 0})]}):jsxRuntime.jsx("img",{className:"login-page__logo-image","data-login-part":"logo-image",src:A||N,alt:r?.alt??"",style:I?{transform:`scale(${I})`}:void 0})}):null,jsxRuntime.jsxs("section",{className:"login-page__form","data-login-part":"panel","aria-label":typeof i=="string"?i:void 0,children:[s?jsxRuntime.jsxs("button",{type:"button",className:"login-page__back","data-login-part":"back",onClick:s.onClick,children:[s.icon?jsxRuntime.jsx("span",{className:"login-page__back-icon","data-login-part":"back-icon",children:s.icon}):null,jsxRuntime.jsx("span",{children:s.label})]}):null,i?jsxRuntime.jsx("h1",{className:"login-page__title","data-login-part":"title",children:i}):null,T&&S?jsxRuntime.jsx("div",{className:"login-page__tabs","data-login-part":"tabs",role:"tablist",children:x.map(H=>{let B=H.id===h?.id;return jsxRuntime.jsxs("button",{type:"button",role:"tab","aria-selected":B,className:`login-page__tab ${B?"login-page__tab--active":""}`,"data-login-part":"tab","data-login-method-id":H.id,"data-active":B?"true":"false",onClick:()=>P(H.id),children:[H.icon?jsxRuntime.jsx("span",{className:"login-page__tab-icon","data-login-part":"tab-icon",children:H.icon}):null,jsxRuntime.jsx("span",{className:"login-page__tab-label",children:H.label})]},H.id)})}):null,f?jsxRuntime.jsxs("div",{className:"login-page__external-panel","data-login-part":"external-panel",children:[f.title?jsxRuntime.jsx("div",{className:"login-page__external-panel-title","data-login-part":"external-panel-title",children:f.title}):null,f.description?jsxRuntime.jsx("p",{className:"login-page__external-panel-description","data-login-part":"external-panel-description",children:f.description}):null,jsxRuntime.jsx("div",{className:"login-page__external-panel-content","data-login-part":"external-panel-content",children:f.content}),f.footer||f.backAction?jsxRuntime.jsxs("div",{className:"login-page__external-panel-footer","data-login-part":"external-panel-footer",children:[f.footer,f.backAction?jsxRuntime.jsx("button",{type:"button",className:"login-page__external-panel-back","data-login-part":"external-panel-back",onClick:f.backAction.onClick,children:f.backAction.label}):null]}):null]}):T&&h?jsxRuntime.jsxs("form",{className:"login-page__form-fields","data-login-part":"form","data-login-method-id":h.id,onSubmit:h.onSubmit,children:[h.fields.map(H=>jsxRuntime.jsx("div",{className:"login-page__field","data-login-part":"field","data-login-field-name":H.name,children:jsxRuntime.jsx("input",{id:H.id,name:H.name,type:H.type??"text",value:H.value,placeholder:H.placeholder,autoComplete:H.autoComplete,inputMode:H.inputMode,maxLength:H.maxLength,pattern:H.pattern,disabled:h.disabled||h.isLoading||H.disabled,required:H.required,className:"login-page__input","data-login-part":"input",onChange:B=>H.onChange(B.target.value)})},H.name)),h.checkbox?jsxRuntime.jsxs("label",{className:"login-page__remember","data-login-part":"checkbox-label",htmlFor:h.checkbox.id,children:[jsxRuntime.jsx("input",{id:h.checkbox.id,type:"checkbox",className:"login-page__checkbox","data-login-part":"checkbox",checked:h.checkbox.checked,disabled:h.disabled||h.isLoading||h.checkbox.disabled,onChange:H=>h.checkbox?.onChange(H.target.checked)}),jsxRuntime.jsx("span",{children:h.checkbox.label})]}):null,h.footer||h.footerAction?jsxRuntime.jsxs("div",{className:"login-page__method-footer","data-login-part":"method-footer",children:[h.footer,h.footerAction?jsxRuntime.jsx("button",{type:"button",className:"login-page__method-footer-action","data-login-part":"method-footer-action","data-login-method-id":h.id,onClick:h.footerAction.onClick,disabled:h.disabled||h.isLoading||h.footerAction.disabled,children:h.footerAction.label}):null]}):null,jsxRuntime.jsx("button",{type:"submit",className:"login-page__submit","data-login-part":"submit-button",disabled:h.disabled||h.isLoading,children:h.isLoading&&h.loadingLabel?h.loadingLabel:h.submitLabel})]}):null,b?jsxRuntime.jsxs("div",{className:`login-page__callout login-page__callout--${b.tone??"info"}`,"data-login-part":"callout","data-tone":b.tone??"info",children:[jsxRuntime.jsx("div",{className:"login-page__callout-title","data-login-part":"callout-title",children:b.title}),b.description?jsxRuntime.jsx("p",{className:"login-page__callout-description","data-login-part":"callout-description",children:b.description}):null,b.detail?jsxRuntime.jsx("p",{className:"login-page__callout-detail","data-login-part":"callout-detail",children:b.detail}):null,b.action?jsxRuntime.jsx("button",{type:"button",className:"login-page__callout-action","data-login-part":"callout-action",onClick:b.action.onClick,disabled:b.action.disabled,children:b.action.label}):null]}):null,!f&&g.length?jsxRuntime.jsxs("div",{className:"login-page__oauth-section","data-login-part":"external-methods",children:[u?jsxRuntime.jsx("div",{className:"login-page__oauth-label","data-login-part":"external-label",children:u}):null,jsxRuntime.jsx("div",{className:"login-page__oauth-list","data-login-part":"external-list",children:g.map(W)})]}):null]})]})}a(oC,"LoginPage");var kz=5200,rC=1200,Cz=[/^(please|select|enter|provide|write|choose|confirm|fill)\b/i,/^(请|请选择|请先|请输入|请填写|请确认|请留意)/],Sz={toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"},ip=new Map;function Tz(...e){return e.filter(Boolean).join(" ")}a(Tz,"cn");function Nz(e){return !e||typeof e!="object"||ho.isValidElement(e)?false:"title"in e||"description"in e||"variant"in e}a(Nz,"isToastInput");function kb(e){return e==null||typeof e=="string"&&!e.trim()}a(kb,"isEmptyToastContent");function sp(e,t,o){let{description:r,...n}=o??{};return Nz(e)?{...n,...e,variant:e.variant??t}:{...n,title:e,variant:t}}a(sp,"normalizeToastInput");function ds(e,t){return typeof e=="function"?e(t):e}a(ds,"resolveValue");function iC(e){let t=Date.now();for(let[r,n]of ip.entries())t-n>rC&&ip.delete(r);let o=ip.get(e);return o&&t-o<rC?false:(ip.set(e,t),true)}a(iC,"shouldEmitToast");function lp(e,t){return e?e(t,{defaultValue:t}):t}a(lp,"translateMessage");function dp(e,t,o){return e?.[o]??t[o]}a(dp,"getDefaultMessage");function Il(e){let{title:t,description:o,duration:r,variant:n="info",...i}=e,s=kb(t)?o:t;if(kb(s))return;let l=!kb(o)&&o!==s?o:void 0,d={...i,description:l,duration:r??kz};switch(n){case "error":return sonner.toast.error(s,d);case "warning":return sonner.toast.warning(s,d);case "success":return sonner.toast.success(s,d);default:return sonner.toast(s,d)}}a(Il,"emitToast");function Cb(e,t=""){if(!e)return t;if(typeof e=="string")return e.trim()||t;if(e instanceof Error)return String(e.message||"").trim()||t;if(typeof e=="object"&&typeof e.message=="string"){let o=e.message.trim();if(o)return o}if(typeof e=="object"&&typeof e.title=="string"){let o=e.title.trim();if(o)return o}return t}a(Cb,"extractToastMessage");function Rz(e){let t=Cb(e);return Cz.some(o=>o.test(t))?"warning":"error"}a(Rz,"resolveToastVariantForMessage");function Sb({className:e,closeButton:t=true,position:o="bottom-right",richColors:r=true,toastOptions:n,useThemeClassNames:i=true,visibleToasts:s=10,...l}){return jsxRuntime.jsx(sonner.Toaster,{className:Tz("pointer-events-auto toaster group",e),closeButton:t,position:o,richColors:r,toastOptions:{...n,classNames:i?{...Sz,...n?.classNames}:n?.classNames},visibleToasts:s,...l})}a(Sb,"MonkeysToaster");function sC({children:e,toasterProps:t}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e,jsxRuntime.jsx(Sb,{...t})]})}a(sC,"MonkeysToastProvider");function Mz(e,t={}){let o=ho.useRef(null),r=Ye().toast,n=t.translate;ho.useEffect(()=>{if(!e){o.current=null;return}let i=ds(t.variant,e)??"error",s=ds(t.title,e),l=ds(t.fallbackDescription,e),d=ds(t.description,e)??Cb(e,l||""),c=lp(n,s||dp(t.messages,r,i==="warning"?"warningTitle":"errorTitle")),p=lp(n,d||dp(t.messages,r,i==="warning"?"defaultWarningDescription":"defaultErrorDescription")),u=ds(t.signature,e)||[i,c,p].join("|");o.current!==u&&(o.current=u,iC(u)&&Tb.show({variant:i,title:c,description:p,duration:ds(t.duration,e)}));},[t.description,t.duration,t.fallbackDescription,t.messages,t.signature,t.title,t.variant,r,n,e]);}a(Mz,"useToastOnValue");function Iz(e,t={}){let o=ho.useRef(new Set),r=Ye().toast,n=t.translate,i=ho.useCallback((s,l,d)=>{let c=s.variant??"info",p=lp(n,s.title||dp(t.messages,r,c==="warning"?"warningTitle":"errorTitle")),u=lp(n,s.description||dp(t.messages,r,c==="warning"?"defaultWarningDescription":"defaultErrorDescription")),g=s.signature||[c,p,u,l].join("|");d.add(g),!(o.current.has(g)||!iC(g))&&Tb.show({variant:c,title:p,description:u,duration:s.duration});},[r,t.messages,n]);ho.useEffect(()=>{let s=new Set;e.forEach((l,d)=>{l&&i(l,d,s);}),o.current=s;},[i,e]);}a(Iz,"useToastFeed");var Tb=Object.assign((e,t)=>sonner.toast(e,t),{show:Il,error:a((e,t)=>Il(sp(e,"error",t)),"error"),warning:a((e,t)=>Il(sp(e,"warning",t)),"warning"),success:a((e,t)=>Il(sp(e,"success",t)),"success"),info:a((e,t)=>Il(sp(e,"info",t)),"info"),message:sonner.toast.message,promise:sonner.toast.promise,dismiss:sonner.toast.dismiss,loading:sonner.toast.loading,custom:sonner.toast.custom,getHistory:sonner.toast.getHistory,getToasts:sonner.toast.getToasts});function dC({handoff:e,targetPath:t=e.target.path,targetOrigin:o,children:r,onActivate:n,...i}){let s=o?.trim(),l=s?new URL(t,s).toString():t;return jsxRuntime.jsx("a",{...i,href:runtime.buildApplicationHandoffUrl(l,e),"data-monkeys-handoff-id":e.handoffId,"data-monkeys-handoff-source":e.source.product,"data-monkeys-handoff-target":e.target.product,onClick:d=>n?.(e,d),children:r})}a(dC,"ApplicationHandoffLink");var ya=a(e=>e?.id,"refIdentity"),Pl=a(e=>({"data-monkeys-node-id":e.nodeId,"data-monkeys-node-kind":e.kind,"data-monkeys-node-version":e.version,"data-monkeys-owner":e.ownerRepo,"data-monkeys-parent-node":e.parentNodeId,"data-monkeys-slot":e.slot,"data-monkeys-page-id":ya(e.pageRef),"data-monkeys-semantic-id":ya(e.semanticRef),"data-monkeys-data-context-id":ya(e.dataContextRef),"data-monkeys-capability-id":ya(e.capabilityRef),"data-monkeys-provider-id":ya(e.providerRef),"data-monkeys-state-id":ya(e.stateRef),"data-monkeys-frame-owner":e.surface.frameOwner,"data-monkeys-surface-tone":e.surface.tone,"data-monkeys-density":e.surface.density,"data-monkeys-scroll-owner":e.scroll.owner,"data-monkeys-scroll-axis":e.scroll.axis,"data-monkeys-scroll-restore-key":e.scroll.restoreKey,"data-monkeys-virtualization-boundary":e.scroll.virtualizationBoundary,"data-monkeys-activation-id":e.activation.activationId,"data-monkeys-activation-mode":e.activation.mode,"data-monkeys-mount-policy":e.lifecycle.mountPolicy,"data-monkeys-query-policy":e.lifecycle.queryPolicy,"data-monkeys-deep-link":e.lifecycle.deepLink,"data-monkeys-focus-return":e.lifecycle.focusReturn,"data-monkeys-layout-mode":e.layout.mode,"data-monkeys-responsive-rules":e.responsive.length,"data-monkeys-child-count":e.children.length,"data-monkeys-access-id":ya(e.accessRef),"data-monkeys-evidence-id":ya(e.evidenceRef),"data-monkeys-render-state":e.state}),"getRenderNodeDataAttributes"),Nb=a(e=>`monkeys.render.scroll.${e}`,"sessionStorageKey"),Mb={read(e){if(!(typeof window>"u"))try{let t=window.sessionStorage.getItem(Nb(e));if(!t)return;let o=JSON.parse(t);return typeof o.x=="number"&&typeof o.y=="number"?{x:o.x,y:o.y}:void 0}catch{return}},write(e,t){if(!(typeof window>"u"))try{window.sessionStorage.setItem(Nb(e),JSON.stringify(t));}catch{}},remove(e){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(Nb(e));}catch{}}},fC=a((e,t)=>{if(t===void 0)return e.layout;let o=e.responsive.filter(r=>(r.minWidthPx===void 0||t>=r.minWidthPx)&&(r.maxWidthPx===void 0||t<=r.maxWidthPx));return o.length===0?e.layout:o[o.length-1].layout},"resolveRenderNodeLayout"),bC=a((e,t,o)=>{let r=o===void 0?[]:t.filter(n=>(n.minWidthPx===void 0||o>=n.minWidthPx)&&(n.maxWidthPx===void 0||o<=n.maxWidthPx)&&n.style);return r.length===0?e:r.reduce((n,i)=>({...n,...i.style}),{...e??{}})},"resolveRenderNodeResponsiveStyle"),zz={contents:"contents",block:"block",flex:"flex",grid:"grid",absolute:"absolute"},Oz={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},Fz={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"},gC=a(e=>rm(e),"tokenPathToCssVariable"),Hz=a(e=>e?Object.fromEntries(Object.entries(e).map(([t,o])=>[t,typeof o=="string"&&o.startsWith("$")?gC(o):o])):void 0,"resolveRenderNodeStyle"),Vz=a(e=>{if(e.gapTokenRef)return {gap:gC(`$${e.gapTokenRef.id}`)}},"resolveRenderNodeGap"),_z=a(e=>m(zz[e.mode],e.mode==="flex"&&(e.direction==="row"?"flex-row":"flex-col"),e.align&&Oz[e.align],e.justify&&Fz[e.justify]),"getRenderLayoutClassName"),Rb=a((e,t,o)=>e.lifecycle.mountPolicy==="always"?true:e.lifecycle.mountPolicy==="when-visible"?o:t,"shouldMountNode"),Gz=a((e,t,o,r)=>e.lifecycle.queryPolicy==="always"?true:e.lifecycle.queryPolicy==="when-visible"?o:e.lifecycle.queryPolicy==="when-active"?t:r,"shouldQueryNode"),Ib=a((e,t)=>{let o=Rb(e,t.active,t.visible);return {active:t.active,visible:t.visible,mounted:o||e.lifecycle.retainOnDeactivate&&t.previouslyMounted===true,queryEnabled:Gz(e,t.active,t.visible,t.manualQueryEnabled===true)}},"resolveRenderNodePolicyState"),uC=a((e,t,o,r,n)=>e.state==="loading"&&o!==void 0?o:e.state==="empty"&&r!==void 0?r:e.state==="error"&&n!==void 0?n:t,"resolveRenderNodeContent"),pC=a((e,t)=>{typeof e=="function"?e(t):e&&(e.current=t);},"assignRef"),pp=ho.forwardRef(a(function({node:t,as:o="div",active:r=true,visible:n=r,manualQueryEnabled:i=false,asChild:s=false,unframed:l=false,children:d,loading:c,empty:p,error:u,elementRef:g,scrollRestoration:f=Mb,onActivate:b,onManualQueryEnabledChange:x,onRuntimeStateChange:y,onScroll:k,className:w,hidden:v,role:h,"aria-live":S,"aria-atomic":T,...C},R){let M=Go(),I=s?reactSlot.Slot:o,A=ho.useRef(null),[N,D]=ho.useState(()=>typeof window>"u"?void 0:window.innerWidth),[E,P]=ho.useState(()=>Rb(t,r,n)?t.nodeId:void 0),W=Rb(t,r,n);ho.useEffect(()=>{if(t.responsive.length===0||typeof window>"u")return;let q=a(()=>D(window.innerWidth),"handleResize");return q(),window.addEventListener("resize",q,{passive:true}),()=>window.removeEventListener("resize",q)},[t.responsive.length]);let H=ho.useMemo(()=>fC(t,N),[t,N]),B=ho.useMemo(()=>bC(t.style,t.responsive,N),[t.responsive,t.style,N]);ho.useEffect(()=>{if(!r||!n||!t.lifecycle.deepLink||!["page","record"].includes(t.kind))return;let q=A.current;!q||q.style.display==="contents"||q.focus({preventScroll:true});},[r,t.kind,t.lifecycle.deepLink,t.nodeId,n]),ho.useEffect(()=>{W?P(t.nodeId):t.lifecycle.retainOnDeactivate||P(void 0);},[t.lifecycle.retainOnDeactivate,t.nodeId,W]);let L=ho.useMemo(()=>Ib(t,{active:r,visible:n,manualQueryEnabled:i,previouslyMounted:E===t.nodeId}),[r,i,E,t,n]),F=ho.useCallback(()=>{b?.(t.activation,t);},[t,b]),_=ho.useCallback(q=>{x?.(q,t);},[t,x]),$=ho.useMemo(()=>({...L,activate:F,setManualQueryEnabled:_}),[F,L,_]);ho.useEffect(()=>{y?.(L,t);},[t,y,L]);let G=ho.useCallback(q=>{A.current=q,pC(g,q),pC(R,q);},[g,R]),z=f===false?void 0:f,re=z!==void 0&&t.scroll.owner!=="provider"&&!t.scroll.virtualizationBoundary&&t.scroll.axis!=="none"&&t.scroll.restoreKey!==void 0,Z=ho.useCallback(()=>{let q=A.current;return q?{x:t.scroll.axis==="y"?0:q.scrollLeft,y:t.scroll.axis==="x"?0:q.scrollTop}:{x:0,y:0}},[t.scroll.axis]);if(ho.useEffect(()=>{if(!L.mounted||!re||!z)return;let q=t.scroll.restoreKey,U=A.current,X=z.read(q),O;if(U&&X){let K=a(()=>U.scrollTo({left:t.scroll.axis==="y"?U.scrollLeft:X.x,top:t.scroll.axis==="x"?U.scrollTop:X.y,behavior:"auto"}),"restore");typeof window<"u"&&typeof window.requestAnimationFrame=="function"?O=window.requestAnimationFrame(K):K();}return ()=>{O!==void 0&&typeof window<"u"&&window.cancelAnimationFrame(O),z.write(q,Z());}},[t.scroll.axis,t.scroll.restoreKey,L.mounted,Z,re,z]),!L.mounted)return null;let ae={...C,...Pl(t),ref:G,className:m((!l||H.mode!=="contents")&&_z(H),w),style:{...H.mode==="grid"&&H.columns?{gridTemplateColumns:`repeat(${H.columns}, minmax(0, 1fr))`}:{},...M>0&&["flex","grid"].includes(H.mode)?{gap:"var(--monkeys-bento-gap, var(--global-spacing, 0.75rem))"}:{},...Vz(H),...Hz(B),...C.style},hidden:v||!L.visible||void 0,role:h??(t.state==="error"?"alert":t.state==="loading"||t.state==="empty"?"status":void 0),tabIndex:C.tabIndex??(t.lifecycle.deepLink&&["page","record"].includes(t.kind)?-1:void 0),"data-monkeys-active":L.active,"data-monkeys-mounted":L.mounted,"data-monkeys-query-enabled":L.queryEnabled,"aria-busy":t.state==="loading"||void 0,"aria-disabled":t.state==="disabled"||void 0,"aria-hidden":!L.visible||void 0,"aria-live":S??(t.state==="error"?"assertive":t.state==="loading"||t.state==="empty"?"polite":void 0),"aria-atomic":T??(t.state==="loading"||t.state==="empty"||t.state==="error"?true:void 0),onScroll:a(q=>{re&&z&&t.scroll.restoreKey&&z.write(t.scroll.restoreKey,Z()),k?.(q);},"onScroll")},ee=typeof d=="function"?d(l?{...$,elementProps:ae}:$):d;return l?jsxRuntime.jsx(jsxRuntime.Fragment,{children:uC(t,ee,c,p,u)}):jsxRuntime.jsx(I,{...ae,ref:G,children:uC(t,ee,c,p,u)})},"RenderNodeHost"));var Uz={popover:40,drawer:50,modal:60,fullscreen:70,system:80},Db=a(e=>Uz[e],"getOverlayZIndex"),Kz={drawer:{content:"!items-stretch !justify-end !p-0",panel:"!h-dvh !max-h-none !w-full !max-w-[min(100vw,40rem)] !rounded-none !border-y-0 !border-r-0",body:"min-h-0 flex-1 overflow-auto"},modal:{},fullscreen:{content:"!items-stretch !justify-stretch !p-0",panel:"!h-dvh !max-h-none !w-screen !max-w-none !rounded-none !border-0",body:"min-h-0 flex-1 overflow-auto"}},Pb=a(e=>({...Kz[e]}),"getOverlayPresentationClassNames"),qz=a((e,t)=>e.startsWith("/")&&!e.startsWith("//")?`${t.pathname}${t.search}${t.hash}`:t.toString(),"relativeUrl"),El=a((e,t)=>new URL(t,"https://monkeys.local").searchParams.get(e.url.parameter)===e.url.value,"isOverlayUrlActive"),Eb=a((e,t,o)=>{let r=new URL(t,"https://monkeys.local");return o?r.searchParams.set(e.url.parameter,e.url.value):r.searchParams.get(e.url.parameter)===e.url.value&&r.searchParams.delete(e.url.parameter),qz(t,r)},"buildOverlayUrl"),Ab={getCurrentUrl(){return typeof window>"u"?"https://monkeys.local/":window.location.href},push(e){typeof window<"u"&&window.history.pushState(window.history.state,"",e);},replace(e){typeof window<"u"&&window.history.replaceState(window.history.state,"",e);},back(){typeof window<"u"&&window.history.back();},subscribe(e){if(typeof window>"u")return ()=>{};let t=a(()=>e(window.location.href),"handlePopState");return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)}},Yz=a(e=>{e?.isConnected&&(typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>e.focus()):e.focus());},"scheduleFocus");function wC({node:e,open:t,renderStrategy:o="dialog",title:r,description:n,footer:i,closeLabel:s,children:l,appearance:d,className:c,classNames:p,initialFocusRef:u,focusReturnRef:g,historyAdapter:f=Ab,manualQueryEnabled:b=false,onActivate:x,onRuntimeStateChange:y,onOpenChange:k}){let w=ho.useRef(false),v=ho.useRef(false),h=Db(e.zIndexLane),S=ho.useCallback(I=>{if(!e.renderNode.lifecycle.deepLink||f===false)return;let A=f.getCurrentUrl();if(El(e,A)===I)return;let N=Eb(e,A,I);if(I){e.url.openMode==="push"?(f.push(N),w.current=true):(f.replace(N),w.current=false);return}e.url.closeMode==="back"&&w.current?(w.current=false,f.back()):(f.replace(N),w.current=false);},[f,e]),T=ho.useCallback(I=>{S(I),k(I);},[k,S]);ho.useEffect(()=>{if(!e.renderNode.lifecycle.deepLink||f===false)return;let I=El(e,f.getCurrentUrl());return v.current?I!==t&&S(t):(v.current=true,I&&!t?k(true):!I&&t&&S(true)),f.subscribe(A=>{w.current=false;let N=El(e,A);N!==t&&k(N);})},[f,e,k,t,S]),ho.useEffect(()=>{if(!t||!e.renderNode.lifecycle.focusReturn||typeof document>"u")return;let I=g?.current??(document.activeElement instanceof HTMLElement?document.activeElement:null);return ()=>Yz(g?.current??I)},[g,e.renderNode.lifecycle.focusReturn,t]);let C=ho.useMemo(()=>Pl(e.renderNode),[e.renderNode]),R=Pb(e.presentation),M={...p,body:p?.body??R.body,content:p?.content??R.content,panel:p?.panel??R.panel};return jsxRuntime.jsx(pp,{node:e.renderNode,active:t,visible:t,manualQueryEnabled:b,className:c,style:o==="delegate"?{display:"contents"}:void 0,onActivate:x,onRuntimeStateChange:y,children:I=>{let A={...I,open:t,zIndexLane:e.zIndexLane,zIndex:h,initialFocusRef:u,focusReturnRef:g,renderNodeAttributes:C,onOpenChange:T,requestClose:a(()=>T(false),"requestClose")},N=typeof l=="function"?l(A):l;return o==="delegate"?N:jsxRuntime.jsx(aa,{id:e.overlayId,open:t,title:r,description:n,footer:i,closeLabel:s,closeOnEscape:e.close.escape,closeOnOverlayClick:e.close.backdrop,keepMounted:e.renderNode.lifecycle.retainOnDeactivate,trapFocus:e.focus.trap,restoreFocus:false,initialFocus:e.focus.initial,initialFocusRef:u,zIndex:h,appearance:d,classNames:M,"data-monkeys-overlay-presentation":e.presentation,"data-monkeys-overlay-z-index-lane":e.zIndexLane,onOpenChange:T,children:N})}})}a(wC,"OverlayNodeHost");function Bb(...e){return e.filter(Boolean).join(" ")}a(Bb,"cn");function Lb({className:e}){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"4"}),jsxRuntime.jsx("path",{d:"M12 2v2"}),jsxRuntime.jsx("path",{d:"M12 20v2"}),jsxRuntime.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),jsxRuntime.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),jsxRuntime.jsx("path",{d:"M2 12h2"}),jsxRuntime.jsx("path",{d:"M20 12h2"}),jsxRuntime.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),jsxRuntime.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}a(Lb,"SunIcon");function Wb({className:e}){return jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:jsxRuntime.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}a(Wb,"MoonIcon");function zb({className:e}){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[jsxRuntime.jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),jsxRuntime.jsx("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),jsxRuntime.jsx("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]})}a(zb,"MonitorIcon");var Xz={light:Lb,dark:Wb,auto:zb};function kC({mode:e,onModeChange:t,labels:o={},tooltip:r,className:n}){let i=Co(),s=ke(),l=i.messages.toolbar.theme,d=Xz[e],c={auto:o.auto??l.auto,light:o.light??l.light,dark:o.dark??l.dark},p=[{value:"auto",label:c.auto,Icon:zb},{value:"light",label:c.light,Icon:Lb},{value:"dark",label:c.dark,Icon:Wb}],u=jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{...s,className:Bb("inline-flex h-8 w-8 items-center justify-center rounded-md text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] transition-colors focus-visible:outline-hidden",n),children:[jsxRuntime.jsx(d,{}),jsxRuntime.jsx("span",{className:"sr-only",children:r??l.toggle})]})});return jsxRuntime.jsxs(Bt__namespace.Root,{children:[r?jsxRuntime.jsx(fr__namespace.Provider,{delayDuration:300,children:jsxRuntime.jsxs(fr__namespace.Root,{children:[jsxRuntime.jsx(fr__namespace.Trigger,{asChild:true,children:u}),jsxRuntime.jsx(fr__namespace.Portal,{children:jsxRuntime.jsxs(fr__namespace.Content,{className:"rounded-md bg-[hsl(var(--popover))] px-3 py-1.5 text-xs text-[hsl(var(--popover-foreground))] shadow-md border border-[hsl(var(--border))] animate-in fade-in-0 zoom-in-95",sideOffset:5,children:[r,jsxRuntime.jsx(fr__namespace.Arrow,{className:"fill-[hsl(var(--popover))]"})]})})]})}):u,jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{className:"z-50 min-w-[8rem] rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",sideOffset:5,align:"end",children:p.map(({value:g,label:f,Icon:b})=>jsxRuntime.jsxs(Bt__namespace.Item,{className:Bb("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",e===g&&"bg-[hsl(var(--accent))]"),onSelect:()=>t(g),children:[jsxRuntime.jsx(b,{className:"h-4 w-4"}),f]},g))})})]})}a(kC,"DarkModeSelector");function Qz({className:e}){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[jsxRuntime.jsx("path",{d:"M12 8a2.83 2.83 0 0 0 4 4 4 4 0 1 1-4-4"}),jsxRuntime.jsx("path",{d:"M12 2v2"}),jsxRuntime.jsx("path",{d:"M12 20v2"}),jsxRuntime.jsx("path",{d:"m4.9 4.9 1.4 1.4"}),jsxRuntime.jsx("path",{d:"m17.7 17.7 1.4 1.4"}),jsxRuntime.jsx("path",{d:"M2 12h2"}),jsxRuntime.jsx("path",{d:"M20 12h2"}),jsxRuntime.jsx("path",{d:"m6.3 17.7-1.4 1.4"}),jsxRuntime.jsx("path",{d:"m19.1 4.9-1.4 1.4"})]})}a(Qz,"SunMoonIcon");function CC({mode:e,onModeChange:t,label:o,labels:r={}}){let n=Co(),i=ke(),s=n.messages.toolbar.theme,l=n.provided?s:{label:"\u5916\u89C2",auto:"\u8DDF\u968F\u7CFB\u7EDF",light:"\u6D45\u8272\u6A21\u5F0F",dark:"\u6DF1\u8272\u6A21\u5F0F"},d={auto:r.auto??l.auto,light:r.light??l.light,dark:r.dark??l.dark},c=e==="auto"?d.auto:e==="dark"?d.dark:d.light,p=[{value:"auto",label:d.auto,Icon:zb},{value:"light",label:d.light,Icon:Lb},{value:"dark",label:d.dark,Icon:Wb}];return jsxRuntime.jsxs(Bt__namespace.Sub,{children:[jsxRuntime.jsxs(Bt__namespace.SubTrigger,{...i,className:"relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[state=open]:bg-[hsl(var(--accent))]",children:[jsxRuntime.jsx(Qz,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:o??l.label}),jsxRuntime.jsx("span",{className:"ml-auto text-xs text-[hsl(var(--muted-foreground))]",children:c})]}),jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.SubContent,{className:"z-50 min-w-[8rem] rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",sideOffset:8,children:p.map(({value:u,label:g,Icon:f})=>jsxRuntime.jsxs(Bt__namespace.CheckboxItem,{checked:e===u,disabled:e===u,className:Bb("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 pl-7 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50"),onCheckedChange:()=>t(u),children:[jsxRuntime.jsx(Bt__namespace.ItemIndicator,{className:"absolute left-2 inline-flex items-center justify-center",children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M20 6 9 17l-5-5"})})}),jsxRuntime.jsx(f,{className:"h-4 w-4"}),g]},u))})})]})}a(CC,"DarkModeSubMenu");function SC(...e){return e.filter(Boolean).join(" ")}a(SC,"cn");function Zz({className:e}){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),jsxRuntime.jsx("path",{d:"M2 12h20"})]})}a(Zz,"GlobeIcon");function TC({languages:e,currentLanguage:t,onLanguageChange:o,tooltip:r,className:n}){let i=Co(),s=ke(),l=jsxRuntime.jsx(Bt__namespace.Trigger,{asChild:true,children:jsxRuntime.jsxs("button",{...s,className:SC("inline-flex h-8 w-8 items-center justify-center rounded-md text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] transition-colors focus-visible:outline-hidden",n),children:[jsxRuntime.jsx(Zz,{}),jsxRuntime.jsx("span",{className:"sr-only",children:r??i.messages.toolbar.language.switch})]})});return jsxRuntime.jsxs(Bt__namespace.Root,{children:[r?jsxRuntime.jsx(fr__namespace.Provider,{delayDuration:300,children:jsxRuntime.jsxs(fr__namespace.Root,{children:[jsxRuntime.jsx(fr__namespace.Trigger,{asChild:true,children:l}),jsxRuntime.jsx(fr__namespace.Portal,{children:jsxRuntime.jsxs(fr__namespace.Content,{className:"rounded-md bg-[hsl(var(--popover))] px-3 py-1.5 text-xs text-[hsl(var(--popover-foreground))] shadow-md border border-[hsl(var(--border))] animate-in fade-in-0 zoom-in-95",sideOffset:5,children:[r,jsxRuntime.jsx(fr__namespace.Arrow,{className:"fill-[hsl(var(--popover))]"})]})})]})}):l,jsxRuntime.jsx(Bt__namespace.Portal,{children:jsxRuntime.jsx(Bt__namespace.Content,{className:"z-50 min-w-[8rem] rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",sideOffset:5,align:"end",children:e.map(({code:d,label:c})=>jsxRuntime.jsx(Bt__namespace.Item,{className:SC("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",t===d&&"bg-[hsl(var(--accent))]"),onSelect:()=>o(d),children:c},d))})})]})}a(TC,"I18nSelector");var RC=zod.z.enum(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),NC=zod.z.enum(["core","star","potential","all"]),Ob={position:RC.default("bottom-left"),offsetX:zod.z.number().min(0).max(500).default(12),offsetY:zod.z.number().min(0).max(500).default(12)},Jz=zod.z.object({rendering:zod.z.object({mode:zod.z.enum(["canvas","hybrid"]).default("canvas")}).strict().prefault({}),guides:zod.z.array(zod.z.object({id:zod.z.string().min(1),label:zod.z.string(),description:zod.z.string().default(""),...Ob}).strict()).optional(),minimap:zod.z.object({...Ob,visible:zod.z.boolean().default(true),width:zod.z.number().min(100).max(500).default(168),height:zod.z.number().min(50).max(300).default(108),zoomControls:zod.z.boolean().default(true),avoidViewRail:zod.z.boolean().default(true),interactive:zod.z.boolean().default(true)}).strict().prefault({}),views:zod.z.object({...Ob,position:RC.default("bottom-center"),visible:zod.z.boolean().default(true),initial:NC.default("core"),items:zod.z.array(zod.z.object({id:NC,label:zod.z.string(),center:zod.z.object({x:zod.z.number().finite(),y:zod.z.number().finite()}).strict().optional(),zoomPercent:zod.z.number().min(10).max(1e3).optional()}).strict()).max(4).optional(),animated:zod.z.boolean().default(true)}).strict().prefault({}),interaction:zod.z.object({pan:zod.z.boolean().default(true),zoom:zod.z.boolean().default(true),wheel:zod.z.boolean().default(true),keyboard:zod.z.boolean().default(true),threshold:zod.z.boolean().default(true),openPoints:zod.z.boolean().default(true)}).strict().prefault({}),zoom:zod.z.object({min:zod.z.number().min(10).max(100).default(80),max:zod.z.number().min(100).max(1e3).default(200),step:zod.z.number().min(1).max(100).default(20)}).strict().prefault({}),hover:zod.z.object({enabled:zod.z.boolean().default(true),content:zod.z.enum(["radar","summary"]).default("radar"),delay:zod.z.number().min(0).max(5e3).default(0),trigger:zod.z.enum(["hover","focus","both"]).default("both"),scale:zod.z.number().min(1).max(2).default(1),highlight:zod.z.boolean().default(true)}).strict().prefault({}),appearance:zod.z.object({grid:zod.z.boolean().default(true),axes:zod.z.boolean().default(true),axisLabels:zod.z.boolean().default(true),thresholdHandle:zod.z.boolean().default(true),pointSize:zod.z.number().min(2).max(24).default(5),labelScale:zod.z.number().min(.5).max(2).default(1)}).strict().prefault({}),data:zod.z.object({mode:zod.z.enum(["representative","all"]).default("representative")}).strict().prefault({}),performance:zod.z.object({canvasThreshold:zod.z.number().int().min(100).max(1e3).default(300),maxDomLabels:zod.z.number().int().min(0).max(500).default(160),collisionAttempts:zod.z.number().int().min(1).max(2e4).default(4096)}).strict().prefault({})}).strict().superRefine((e,t)=>{for(let[o,r]of [["guides",e.guides],["views",e.views.items]])r&&new Set(r.map(n=>n.id)).size!==r.length&&t.addIssue({code:"custom",path:[o],message:"IDs must be unique"});});function Fb(e={}){return Jz.parse(e)}a(Fb,"resolveQuadrantConfig");var eO={guides:[],data:{mode:"all"},hover:{content:"summary"},views:{items:[{id:"core",label:"\u4E2D\u5FC3"},{id:"star",label:"\u53F3\u4E0A"},{id:"potential",label:"\u5DE6\u4E0A"},{id:"all",label:"\u5168\u89C8"}]}};function Qa(e){return {top:e.position.startsWith("top")?e.offsetY:"auto",bottom:e.position.startsWith("bottom")?e.offsetY:"auto",left:e.position.endsWith("left")?e.offsetX:e.position.endsWith("center")?"50%":"auto",right:e.position.endsWith("right")?e.offsetX:"auto",transform:e.position.endsWith("center")?"translateX(-50%)":void 0}}a(Qa,"quadrantDockStyle");var ro=a((e,t,o,r)=>Number.isFinite(e)?Math.min(r,Math.max(o,e)):t,"finite");function mp(e={}){return {layout:{mode:e.layout?.mode??"clustered",radius:ro(e.layout?.radius,18,1,1e3),depth:ro(e.layout?.depth,8,0,1e3),spacing:ro(e.layout?.spacing,1.8,.1,50),iterations:Math.round(ro(e.layout?.iterations,60,0,200)),linkStrength:ro(e.layout?.linkStrength,.035,0,.5)},camera:{fieldOfView:ro(e.camera?.fieldOfView,48,15,100),fitPadding:ro(e.camera?.fitPadding,1.2,1,3),rotateSpeed:ro(e.camera?.rotateSpeed,.5,.01,5),autoRotate:e.camera?.autoRotate??false,autoRotateSpeed:ro(e.camera?.autoRotateSpeed,.5,-10,10),enablePan:e.camera?.enablePan??true,enableZoom:e.camera?.enableZoom??true},nodes:{size:ro(e.nodes?.size,.8,.05,10),opacity:ro(e.nodes?.opacity,1,0,1),glow:e.nodes?.glow??true,defaultColor:e.nodes?.defaultColor,groupColors:e.nodes?.groupColors??{}},edges:{opacity:ro(e.edges?.opacity,.4,0,1),dimOpacity:ro(e.edges?.dimOpacity,.08,0,1),defaultColor:e.edges?.defaultColor},labels:{visible:e.labels?.visible??true,fontSize:ro(e.labels?.fontSize,12,8,32),maxVisible:Math.round(ro(e.labels?.maxVisible,100,0,1e3)),collisionPadding:ro(e.labels?.collisionPadding,6,0,50),color:e.labels?.color},controls:{visible:e.controls?.visible??true,placement:e.controls?.placement??"top-right",resetLabel:e.controls?.resetLabel,zoomInLabel:e.controls?.zoomInLabel,zoomOutLabel:e.controls?.zoomOutLabel},interaction:{enabled:e.interaction?.enabled??true,openOn:e.interaction?.openOn??"click",hitRadius:ro(e.interaction?.hitRadius,14,4,100)},minHeight:ro(e.minHeight,320,0,2e3),pixelRatioLimit:ro(e.pixelRatioLimit,2,.5,3)}}a(mp,"resolveRelationship3DConfig");var MC=a(e=>Array.from(e).reduce((t,o)=>Math.imul(t^o.charCodeAt(0),16777619)>>>0,2166136261),"hash"),cs=Math.PI*(3-Math.sqrt(5));function Hb(e,t,o={}){let{layout:r}=mp(o),n=new Set;for(let f of e){if(!f.id||n.has(f.id))throw new TypeError("3D graph node IDs must be nonempty and unique.");n.add(f.id);}let i=[...e].sort((f,b)=>f.id<b.id?-1:f.id>b.id?1:0),s=[...new Set(i.map(f=>f.group??""))].sort(),l=new Map,d=new Map(s.map(f=>[f,i.filter(b=>(b.group??"")===f).length])),c=i.map((f,b)=>{let x=f.group??"",y=l.get(x)??0;l.set(x,y+1);let k,w,v;if(r.mode==="provided"){if(!f.position||![f.position.x,f.position.y,f.position.z].every(Number.isFinite))throw new TypeError("Provided 3D layouts require finite x, y and z for every node.");({x:k,y:w,z:v}=f.position);}else if(r.mode==="sphere"){let h=1-2*(b+.5)/Math.max(i.length,1),S=Math.sqrt(1-h*h);k=Math.cos(b*cs)*S*r.radius,w=h*r.radius,v=Math.sin(b*cs)*S*r.depth;}else {let h=s.indexOf(x),S=h*cs-Math.PI/2,T=s.length>1?r.radius*.6:0,C=Math.sqrt(y)*r.spacing,R=MC(x)/4294967295*Math.PI*2;k=Math.cos(S)*T+Math.cos(y*cs+R)*C,w=Math.sin(S)*T*.8+Math.sin(y*cs+R)*C*.8,v=(s.length>1?(h/(s.length-1)-.5)*r.depth:0)+Math.sin(y*cs*1.37+R)*Math.min(r.depth*.4,Math.sqrt(d.get(x))*.7);}return {...f,x:k,y:w,z:v,anchorX:k,anchorY:w,anchorZ:v}}),p=new Map(c.map(f=>[f.id,f])),u=t.filter(f=>n.has(f.sourceId)&&n.has(f.targetId)&&f.sourceId!==f.targetId),g=new Map(c.map(f=>[f.id,new Set]));if(u.forEach(f=>{g.get(f.sourceId).add(f.targetId),g.get(f.targetId).add(f.sourceId);}),r.mode==="clustered")for(let f=0;f<r.iterations;f++){for(let y of u){let k=p.get(y.sourceId),w=p.get(y.targetId),v=r.linkStrength*((k.group??"")===(w.group??"")?1:.12)*ro(y.weight,.5,0,1);for(let h of ["x","y","z"]){let S=(w[h]-k[h])*v;k[h]+=S,w[h]-=S;}}let b=new Map,x=r.spacing;for(let y of c){y.x+=(y.anchorX-y.x)*.1,y.y+=(y.anchorY-y.y)*.1,y.z+=(y.anchorZ-y.z)*.1;let k=Math.floor(y.x/x),w=Math.floor(y.y/x),v=Math.floor(y.z/x);for(let T=-1;T<=1;T++)for(let C=-1;C<=1;C++)for(let R=-1;R<=1;R++)for(let M of b.get(`${k+T},${w+C},${v+R}`)??[]){let I=y.x-M.x,A=y.y-M.y,N=y.z-M.z,D=Math.hypot(I,A,N);if(D>=x)continue;let E=(x-D)*.22/Math.max(D,.001),P=MC(y.id+M.id)/4294967295*Math.PI*2,W=D?I:Math.cos(P)*.001,H=D?A:Math.sin(P)*.001,B=D?N:.001;y.x+=W*E,y.y+=H*E,y.z+=B*E,M.x-=W*E,M.y-=H*E,M.z-=B*E;}let h=`${k},${w},${v}`,S=b.get(h)??[];S.push(y),b.set(h,S);}}return {points:c,links:u,neighbors:g}}a(Hb,"buildRelationship3DLayout");function nO({nodes:e,edges:t,ariaLabel:o,config:r,selectedNodeId:n,onNodeSelect:i,onUnavailable:s,className:l,emptyLabel:d="No related nodes"}){let c=Ye(),p=ho.useRef(null),u=ho.useRef(new Map),g=ho.useRef({onNodeSelect:i,onUnavailable:s,selectedNodeId:n,nodes:e});g.current={onNodeSelect:i,onUnavailable:s,selectedNodeId:n,nodes:e};let f=ho.useRef({reset:a(()=>{},"reset"),zoomIn:a(()=>{},"zoomIn"),zoomOut:a(()=>{},"zoomOut"),invalidate:a(()=>{},"invalidate")}),[b,x]=ho.useState(false),[y,k]=ho.useState(0),w=JSON.stringify([e,t,r]),v=ho.useMemo(()=>Hb(e,t,r),[w]),h=ho.useMemo(()=>mp(r),[w]);ho.useEffect(()=>{f.current.invalidate();},[n]),ho.useEffect(()=>{let T=a(()=>{let M=p.current&&getComputedStyle(p.current);return ["--radar-canvas","--background","--radar-series-one","--primary"].map(I=>M?.getPropertyValue(I)).join("|")},"signature"),C=T(),R=new MutationObserver(()=>{let M=T();M!==C&&(C=M,k(I=>I+1));});for(let M=p.current?.parentElement;M;M=M.parentElement)R.observe(M,{attributes:true,attributeFilter:["class","style","data-theme"]});return ()=>R.disconnect()},[]),ho.useEffect(()=>{let T=p.current;if(!T||!v.points.length)return;let C=false,R=[],M=a(()=>{for(;R.length;)R.pop()();},"release");x(false);let I=a(()=>{M(),C||(x(true),g.current.onUnavailable?.("webgl-unavailable"));},"fail");return Promise.all([import('three'),import('three/examples/jsm/controls/OrbitControls.js')]).then(([A,{OrbitControls:N}])=>{if(C)return;let D=new A.WebGLRenderer({antialias:true});R.push(()=>{D.dispose(),D.forceContextLoss(),D.domElement.remove();}),D.setPixelRatio(Math.min(window.devicePixelRatio||1,h.pixelRatioLimit)),D.domElement.style.cssText="position:absolute;inset:0;width:100%;height:100%;touch-action:none",D.domElement.setAttribute("aria-hidden","true"),T.prepend(D.domElement);let E=new A.Scene,P=getComputedStyle(T),W=a((ue,Re)=>{let se=document.createElement("span");se.style.color=`hsl(${P.getPropertyValue(ue).trim()||P.getPropertyValue(Re).trim()})`,T.append(se);let te=new A.Color(getComputedStyle(se).color);return se.remove(),te},"token");E.background=W("--radar-canvas","--background");let H=h.nodes.defaultColor?new A.Color(h.nodes.defaultColor):W("--radar-series-one","--primary"),B=new Map(v.points.map(ue=>[ue.id,new A.Color(ue.color??h.nodes.groupColors[ue.group??""]??H)])),L=new Map(v.points.map(ue=>[ue.id,new A.Vector3(ue.x,ue.y,ue.z)])),F=new A.PerspectiveCamera(h.camera.fieldOfView,1,.01,1e5),_=new N(F,D.domElement);R.push(()=>_.dispose()),_.enableDamping=true,_.dampingFactor=.1,_.rotateSpeed=h.camera.rotateSpeed,_.enablePan=h.camera.enablePan,_.enableZoom=h.camera.enableZoom;let $=window.matchMedia?.("(prefers-reduced-motion: reduce)"),G=a(()=>{_.autoRotate=h.camera.autoRotate&&!$?.matches,we();},"motionChange");_.autoRotate=h.camera.autoRotate&&!$?.matches,_.autoRotateSpeed=h.camera.autoRotateSpeed,$?.addEventListener("change",G),R.push(()=>$?.removeEventListener("change",G));let z=64,re=new Uint8Array(z*z*4);for(let ue=0;ue<z;ue++)for(let Re=0;Re<z;Re++){let se=Math.hypot(Re+.5-z/2,ue+.5-z/2)/(z/2),te=h.nodes.glow?se<.1?1:Math.exp(-se*7.5):se<.45?1:0;re.set([255,255,255,Math.round(te*255)],(ue*z+Re)*4);}let Z=new A.DataTexture(re,z,z,A.RGBAFormat);Z.minFilter=Z.magFilter=A.LinearFilter,Z.needsUpdate=true,R.push(()=>Z.dispose());let ae=v.points.map(ue=>{let Re=new A.SpriteMaterial({map:Z,color:B.get(ue.id),transparent:true,depthWrite:false,blending:h.nodes.glow?A.AdditiveBlending:A.NormalBlending});R.push(()=>Re.dispose());let se=new A.Sprite(Re);return se.position.copy(L.get(ue.id)),E.add(se),se}),ee=new A.BufferGeometry;R.push(()=>ee.dispose()),ee.setAttribute("position",new A.Float32BufferAttribute(v.links.flatMap(ue=>[...L.get(ue.sourceId).toArray(),...L.get(ue.targetId).toArray()]),3));let q=new Float32Array(v.links.length*6);ee.setAttribute("color",new A.BufferAttribute(q,3));let U=new A.LineBasicMaterial({vertexColors:true,transparent:true,opacity:h.edges.opacity,depthWrite:false});R.push(()=>U.dispose()),E.add(new A.LineSegments(ee,U));let X=new A.Box3().setFromPoints([...L.values()]),O=X.getCenter(new A.Vector3),K=X.getSize(new A.Vector3),ne=Math.max(K.length()/2,1),fe=0,he=0,me=false,ie=0,be,He,We,Ke=false,ce=new A.Vector3,Q=[...v.points].sort((ue,Re)=>(v.neighbors.get(Re.id)?.size??0)-(v.neighbors.get(ue.id)?.size??0)),ge=a(()=>{let ue=A.MathUtils.degToRad(F.fov/2),Re=ne*h.camera.fitPadding/Math.sin(Math.atan(Math.tan(ue)*Math.min(F.aspect,1)));_.target.copy(O),F.position.copy(O).add(new A.Vector3(0,0,Re)),F.near=Math.max(Re/1e4,.01),F.far=Math.max(Re*100,1e3),_.minDistance=Math.max(ne*.15,.1),_.maxDistance=Re*8,F.updateProjectionMatrix(),_.update(),we();},"fit");function we(){!C&&!ie&&(ie=requestAnimationFrame(Ie));}a(we,"invalidate");function Ie(){if(ie=0,C||!fe||!he||document.hidden)return;_.update(),F.updateMatrixWorld();let ue=g.current.selectedNodeId,Re=be??ue,se=Re?v.neighbors.get(Re):void 0;(!Ke||We!==Re)&&(We=Re,Ke=true,v.links.forEach((je,it)=>{let Y=!Re||je.sourceId===Re||je.targetId===Re,pe=new A.Color(je.color??h.edges.defaultColor??B.get(je.targetId)).multiplyScalar(Y?1:h.edges.dimOpacity);q.set([...pe.toArray(),...pe.toArray()],it*6);}),ee.attributes.color.needsUpdate=true),ae.forEach((je,it)=>{let Y=v.points[it],pe=Re===Y.id;je.scale.setScalar((Y.size&&Number.isFinite(Y.size)?Math.min(10,Math.max(.05,Y.size)):h.nodes.size)*(pe?1.5:1)),je.material.opacity=h.nodes.opacity*(!Re||pe||se?.has(Y.id)?1:.3);});let te=new Map,Te=Re?[...Q.filter(je=>je.id===Re),...Q.filter(je=>je.id!==Re)]:Q,ze=0;for(let je of Te){let it=u.current.get(je.id);if(!it)continue;ce.copy(L.get(je.id)).project(F);let Y=(ce.x+1)*fe/2,pe=(-ce.y+1)*he/2+8,Be=Math.min(180,Math.max(h.labels.fontSize*je.label.length*.7,h.labels.fontSize*2)),rt=h.labels.fontSize+8,Ce={x:Y-Be/2,y:pe,w:Be,h:rt},Xe=[];for(let qe=Math.floor(Ce.x/64);qe<=Math.floor((Ce.x+Be+h.labels.collisionPadding)/64);qe++)for(let Le=Math.floor(pe/32);Le<=Math.floor((pe+rt+h.labels.collisionPadding)/32);Le++)Xe.push(`${qe},${Le}`);let de=Xe.some(qe=>te.get(qe)?.some(Le=>Ce.x<Le.x+Le.w+h.labels.collisionPadding&&Ce.x+Be+h.labels.collisionPadding>Le.x&&pe<Le.y+Le.h+h.labels.collisionPadding&&pe+rt+h.labels.collisionPadding>Le.y)),Ee=h.labels.visible&&ze<h.labels.maxVisible&&ce.z>-1&&ce.z<1&&Ce.x>0&&Ce.x+Be<fe&&pe>0&&pe+rt<he&&(!de||je.id===Re);if(it.style.display=Ee?"block":"none",it.tabIndex=Ee&&h.interaction.enabled?0:-1,Ee){it.style.transform=`translate(${Y}px,${pe}px) translate(-50%,0)`,it.style.color=h.labels.color??"#"+B.get(je.id).getHexString(),it.style.opacity=!Re||je.id===Re||se?.has(je.id)?"1":"0.4";for(let qe of Xe){let Le=te.get(qe)??[];Le.push(Ce),te.set(qe,Le);}ze++;}}D.render(E,F),_.autoRotate&&we();}a(Ie,"draw"),_.addEventListener("change",we),R.push(()=>{_.removeEventListener("change",we),cancelAnimationFrame(ie);}),f.current={reset:ge,zoomIn:a(()=>{F.position.sub(_.target).multiplyScalar(.8).add(_.target),_.update(),we();},"zoomIn"),zoomOut:a(()=>{F.position.sub(_.target).multiplyScalar(1.25).add(_.target),_.update(),we();},"zoomOut"),invalidate:we},R.push(()=>{f.current={reset:a(()=>{},"reset"),zoomIn:a(()=>{},"zoomIn"),zoomOut:a(()=>{},"zoomOut"),invalidate:a(()=>{},"invalidate")};});let oe=new ResizeObserver(()=>{let ue=T.getBoundingClientRect();fe=ue.width,he=ue.height,!(!fe||!he)&&(F.aspect=fe/he,F.updateProjectionMatrix(),D.setSize(fe,he,false),me?we():(me=true,ge()));});oe.observe(T),R.push(()=>oe.disconnect());let xe=a(ue=>{let Re=D.domElement.getBoundingClientRect(),se,te=h.interaction.hitRadius;for(let Te of v.points){if(ce.copy(L.get(Te.id)).project(F),ce.z<-1||ce.z>1)continue;let ze=Math.hypot((ce.x+1)*fe/2-(ue.clientX-Re.left),(-ce.y+1)*he/2-(ue.clientY-Re.top));ze<te&&(se=Te,te=ze);}return se?g.current.nodes.find(Te=>Te.id===se.id):void 0},"hit"),Ve=a(ue=>{He={x:ue.clientX,y:ue.clientY,pointerId:ue.pointerId};},"onDown"),_e=a(ue=>{be=xe(ue)?.id,D.domElement.style.cursor=be&&h.interaction.enabled?"pointer":"grab",we();},"onMove"),Ge=a(()=>{be=void 0,He=void 0,we();},"onLeave"),le=a(ue=>{let Re=He?.pointerId===ue.pointerId&&Math.hypot(ue.clientX-He.x,ue.clientY-He.y)<5;if(He=void 0,Re&&h.interaction.enabled&&h.interaction.openOn==="click"){let se=xe(ue);se&&g.current.onNodeSelect?.(se);}},"onUp"),Me=a(ue=>{if(h.interaction.enabled&&h.interaction.openOn==="double-click"){let Re=xe(ue);Re&&g.current.onNodeSelect?.(Re);}},"onDouble"),Ae=a(ue=>{ue.preventDefault(),I();},"contextLost"),J=a(()=>{document.hidden||we();},"visibility"),$e={pointerdown:Ve,pointermove:_e,pointerup:le,pointerleave:Ge,pointercancel:Ge,dblclick:Me,webglcontextlost:Ae};for(let[ue,Re]of Object.entries($e))D.domElement.addEventListener(ue,Re);document.addEventListener("visibilitychange",J),R.push(()=>{for(let[ue,Re]of Object.entries($e))D.domElement.removeEventListener(ue,Re);document.removeEventListener("visibilitychange",J);});}).catch(I),()=>{C=true,M();}},[v,h,y]);let S=h.controls.placement;return jsxRuntime.jsxs("div",{ref:p,role:"group","aria-label":o,className:l,"data-monkeys-component":"relationship-graph-3d","data-renderer-status":b?"unavailable":"webgl",style:{position:"relative",width:"100%",height:"100%",minHeight:h.minHeight,overflow:"hidden",background:"hsl(var(--radar-canvas, var(--background)))"},children:[e.map(T=>jsxRuntime.jsx("button",{ref:C=>{C?u.current.set(T.id,C):u.current.delete(T.id);},type:"button",disabled:!h.interaction.enabled,tabIndex:b&&h.interaction.enabled?0:-1,"aria-pressed":n===T.id,title:T.meta,onClick:()=>{h.interaction.enabled&&(b||h.interaction.openOn==="click")&&g.current.onNodeSelect?.(T);},onDoubleClick:()=>{h.interaction.enabled&&h.interaction.openOn==="double-click"&&g.current.onNodeSelect?.(T);},onKeyDown:C=>{h.interaction.enabled&&h.interaction.openOn==="double-click"&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),g.current.onNodeSelect?.(T));},className:"font-sans focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary",style:{display:b?"inline-block":"none",position:b?"relative":"absolute",transform:b?"none":void 0,opacity:b?1:void 0,color:b?"hsl(var(--foreground))":void 0,left:0,top:0,border:0,background:"transparent",padding:2,maxWidth:180,fontSize:h.labels.fontSize,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",cursor:h.interaction.enabled?"pointer":"default"},children:T.label},T.id)),!e.length&&jsxRuntime.jsx("div",{role:"status",className:"grid size-full place-items-center text-sm text-muted-foreground",children:d}),b&&jsxRuntime.jsx("div",{role:"alert",className:"relative p-3 text-foreground",children:c.workbench.collection.loadError}),!b&&h.controls.visible&&jsxRuntime.jsxs("div",{className:"absolute z-10 flex items-center gap-1 rounded-lg border border-border bg-background/90 p-1 text-foreground",style:{[S.startsWith("top")?"top":"bottom"]:12,[S.endsWith("left")?"left":"right"]:12},children:[h.camera.enableZoom&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",className:"rounded p-1.5 hover:bg-muted","aria-label":h.controls.zoomOutLabel??"Zoom out",title:h.controls.zoomOutLabel??"Zoom out",onClick:()=>f.current.zoomOut(),children:jsxRuntime.jsx(lucideReact.Minus,{size:14})}),jsxRuntime.jsx("button",{type:"button",className:"rounded p-1.5 hover:bg-muted","aria-label":h.controls.zoomInLabel??"Zoom in",title:h.controls.zoomInLabel??"Zoom in",onClick:()=>f.current.zoomIn(),children:jsxRuntime.jsx(lucideReact.Plus,{size:14})})]}),jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded p-1.5 text-xs hover:bg-muted","aria-label":h.controls.resetLabel??"Reset view",onClick:()=>f.current.reset(),children:[jsxRuntime.jsx(lucideReact.LocateFixed,{size:14}),h.controls.resetLabel??"Reset view"]})]})]})}a(nO,"RelationshipGraph3D");function _b(e,{size:t=128,inner:o="rgba(255,255,255,1)",middle:r="rgba(255,255,255,.42)"}={}){let n=document.createElement("canvas");n.width=t,n.height=t;let i=n.getContext("2d");if(!i)throw new Error("Unable to initialize the glow texture canvas.");let s=t/2,l=i.createRadialGradient(s,s,0,s,s,s);l.addColorStop(0,o),l.addColorStop(.16,r),l.addColorStop(.48,"rgba(255,255,255,.12)"),l.addColorStop(1,"rgba(255,255,255,0)"),i.fillStyle=l,i.fillRect(0,0,t,t);let d=new e.CanvasTexture(n);return d.colorSpace=e.SRGBColorSpace,d}a(_b,"createRadialTexture");var PC=`
|
|
68
68
|
attribute float aSize;
|
|
69
69
|
attribute float aAlpha;
|