groove-dev 0.27.135 → 0.27.136

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.
Files changed (31) hide show
  1. package/node_modules/@groove-dev/cli/package.json +1 -1
  2. package/node_modules/@groove-dev/daemon/package.json +1 -1
  3. package/node_modules/@groove-dev/daemon/src/api.js +32 -0
  4. package/node_modules/@groove-dev/daemon/src/journalist.js +14 -12
  5. package/node_modules/@groove-dev/daemon/src/model-lab.js +50 -67
  6. package/node_modules/@groove-dev/daemon/src/rotator.js +1 -1
  7. package/node_modules/@groove-dev/gui/dist/assets/{index-D4JZyMWH.js → index-BrZHF7pK.js} +7 -7
  8. package/node_modules/@groove-dev/gui/dist/index.html +1 -1
  9. package/node_modules/@groove-dev/gui/package.json +1 -1
  10. package/node_modules/@groove-dev/gui/src/components/agents/agent-feed.jsx +5 -1
  11. package/node_modules/@groove-dev/gui/src/components/agents/agent-file-tree.jsx +1 -1
  12. package/node_modules/@groove-dev/gui/src/components/editor/code-editor.jsx +8 -8
  13. package/node_modules/@groove-dev/gui/src/components/editor/file-tree.jsx +1 -1
  14. package/node_modules/@groove-dev/gui/src/components/lab/system-prompt-editor.jsx +3 -3
  15. package/node_modules/@groove-dev/gui/src/components/layout/breadcrumb-bar.jsx +1 -1
  16. package/package.json +1 -1
  17. package/packages/cli/package.json +1 -1
  18. package/packages/daemon/package.json +1 -1
  19. package/packages/daemon/src/api.js +32 -0
  20. package/packages/daemon/src/journalist.js +14 -12
  21. package/packages/daemon/src/model-lab.js +50 -67
  22. package/packages/daemon/src/rotator.js +1 -1
  23. package/packages/gui/dist/assets/{index-D4JZyMWH.js → index-BrZHF7pK.js} +7 -7
  24. package/packages/gui/dist/index.html +1 -1
  25. package/packages/gui/package.json +1 -1
  26. package/packages/gui/src/components/agents/agent-feed.jsx +5 -1
  27. package/packages/gui/src/components/agents/agent-file-tree.jsx +1 -1
  28. package/packages/gui/src/components/editor/code-editor.jsx +8 -8
  29. package/packages/gui/src/components/editor/file-tree.jsx +1 -1
  30. package/packages/gui/src/components/lab/system-prompt-editor.jsx +3 -3
  31. package/packages/gui/src/components/layout/breadcrumb-bar.jsx +1 -1
@@ -8568,7 +8568,7 @@ ${s}`);const c={chatHistory:[...a().chatHistory[n]||[]],activityLog:[...a().acti
8568
8568
  *
8569
8569
  * This source code is licensed under the ISC license.
8570
8570
  * See the LICENSE file in the root directory of this source tree.
8571
- */const tSe=Object.freeze(Object.defineProperty({__proto__:null,AArrowDown:Qf,AArrowUp:Bf,ALargeSmall:_f,Accessibility:Lf,Activity:Ys,AirVent:Tf,Airplay:$f,AlarmClock:Uf,AlarmClockCheck:$i,AlarmClockMinus:Ii,AlarmClockOff:If,AlarmClockPlus:Ui,AlarmSmoke:Pf,Album:Ef,AlignCenterHorizontal:zf,AlignCenterVertical:Ff,AlignEndHorizontal:Rf,AlignEndVertical:Hf,AlignHorizontalDistributeCenter:qf,AlignHorizontalDistributeEnd:Df,AlignHorizontalDistributeStart:Vf,AlignHorizontalJustifyCenter:Xf,AlignHorizontalJustifyEnd:Zf,AlignHorizontalJustifyStart:Gf,AlignHorizontalSpaceAround:Wf,AlignHorizontalSpaceBetween:Yf,AlignStartHorizontal:Kf,AlignStartVertical:Jf,AlignVerticalDistributeCenter:ex,AlignVerticalDistributeEnd:tx,AlignVerticalDistributeStart:ax,AlignVerticalJustifyCenter:nx,AlignVerticalJustifyEnd:rx,AlignVerticalJustifyStart:sx,AlignVerticalSpaceAround:ox,AlignVerticalSpaceBetween:ix,Ambulance:cx,Ampersand:lx,Ampersands:Ax,Amphora:dx,Anchor:ux,Angry:hx,Annoyed:px,Antenna:fx,Anvil:xx,Aperture:mx,AppWindow:yx,AppWindowMac:gx,Apple:vx,Archive:CA,ArchiveRestore:kx,ArchiveX:Ox,Armchair:bx,ArrowBigDown:jx,ArrowBigDownDash:wx,ArrowBigLeft:Nx,ArrowBigLeftDash:Cx,ArrowBigRight:Sx,ArrowBigRightDash:Mx,ArrowBigUp:Qx,ArrowBigUpDash:Bx,ArrowDown:i0,ArrowDown01:_x,ArrowDown10:Lx,ArrowDownAZ:Pi,ArrowDownFromLine:Tx,ArrowDownLeft:o0,ArrowDownNarrowWide:$x,ArrowDownRight:Ix,ArrowDownToDot:Ux,ArrowDownToLine:Px,ArrowDownUp:Ex,ArrowDownWideNarrow:Ei,ArrowDownZA:zi,ArrowLeft:J1,ArrowLeftFromLine:zx,ArrowLeftRight:Fx,ArrowLeftToLine:Rx,ArrowRight:Fr,ArrowRightFromLine:Hx,ArrowRightLeft:qx,ArrowRightToLine:Dx,ArrowUp:eu,ArrowUp01:Vx,ArrowUp10:Xx,ArrowUpAZ:Fi,ArrowUpDown:Zx,ArrowUpFromDot:Gx,ArrowUpFromLine:Wx,ArrowUpLeft:Kx,ArrowUpNarrowWide:Ri,ArrowUpRight:c0,ArrowUpToLine:Yx,ArrowUpWideNarrow:Jx,ArrowUpZA:Hi,ArrowsUpFromLine:em,Asterisk:tm,AtSign:am,Atom:nm,AudioLines:sm,AudioWaveform:rm,Award:om,Axe:im,Axis3d:qi,Baby:cm,Backpack:lm,Badge:jm,BadgeAlert:dm,BadgeCent:Am,BadgeCheck:Di,BadgeDollarSign:um,BadgeEuro:hm,BadgeIndianRupee:pm,BadgeInfo:fm,BadgeJapaneseYen:xm,BadgeMinus:mm,BadgePercent:gm,BadgePlus:ym,BadgePoundSterling:vm,BadgeQuestionMark:Vi,BadgeRussianRuble:km,BadgeSwissFranc:Om,BadgeTurkishLira:bm,BadgeX:wm,BaggageClaim:Cm,Balloon:Nm,Ban:Mm,Banana:Sm,Bandage:Qm,Banknote:Tm,BanknoteArrowDown:Bm,BanknoteArrowUp:_m,BanknoteX:Lm,Barcode:$m,Barrel:Im,Baseline:Um,Bath:Pm,Battery:Dm,BatteryCharging:Em,BatteryFull:zm,BatteryLow:Fm,BatteryMedium:Rm,BatteryPlus:Hm,BatteryWarning:qm,Beaker:Vm,Bean:Zm,BeanOff:Xm,Bed:Km,BedDouble:Gm,BedSingle:Wm,Beef:Jm,BeefOff:Ym,Beer:tg,BeerOff:eg,Bell:lg,BellCheck:ag,BellDot:ng,BellElectric:sg,BellMinus:rg,BellOff:og,BellPlus:ig,BellRing:cg,BetweenHorizontalEnd:Xi,BetweenHorizontalStart:Zi,BetweenVerticalEnd:dg,BetweenVerticalStart:Ag,BicepsFlexed:ug,Bike:hg,Binary:pg,Binoculars:fg,Biohazard:xg,Bird:mg,Birdhouse:gg,Bitcoin:yg,Blend:vg,Blinds:kg,Blocks:Og,Bluetooth:Cg,BluetoothConnected:bg,BluetoothOff:wg,BluetoothSearching:jg,Bold:Ng,Bolt:Mg,Bomb:l0,Bone:Sg,Book:Jg,BookA:Qg,BookAlert:Bg,BookAudio:_g,BookCheck:Lg,BookCopy:Tg,BookDashed:Gi,BookDown:$g,BookHeadphones:Ig,BookHeart:Ug,BookImage:Pg,BookKey:Eg,BookLock:zg,BookMarked:Fg,BookMinus:Rg,BookOpen:Go,BookOpenCheck:Hg,BookOpenText:qg,BookPlus:Dg,BookSearch:Vg,BookText:Xg,BookType:Zg,BookUp:Wg,BookUp2:Gg,BookUser:Kg,BookX:Yg,Bookmark:sy,BookmarkCheck:d0,BookmarkMinus:ey,BookmarkOff:ty,BookmarkPlus:ay,BookmarkX:ny,BoomBox:ry,Bot:Os,BotMessageSquare:oy,BotOff:iy,BottleWine:cy,BowArrow:ly,Box:on,Boxes:dy,Braces:Wi,Brackets:Ay,Brain:A0,BrainCircuit:uy,BrainCog:hy,BrickWall:xy,BrickWallFire:py,BrickWallShield:fy,Briefcase:vy,BriefcaseBusiness:my,BriefcaseConveyorBelt:gy,BriefcaseMedical:yy,BringToFront:ky,Brush:by,BrushCleaning:Oy,Bubbles:wy,Bug:Ny,BugOff:jy,BugPlay:Cy,Building:My,Building2:Sy,Bus:By,BusFront:Qy,Cable:_y,CableCar:Ly,Cake:$y,CakeSlice:Ty,Calculator:tu,Calendar:Wo,Calendar1:Iy,CalendarArrowDown:Uy,CalendarArrowUp:Py,CalendarCheck:zy,CalendarCheck2:Ey,CalendarClock:Fy,CalendarCog:Ry,CalendarDays:Hy,CalendarFold:qy,CalendarHeart:Dy,CalendarMinus:Xy,CalendarMinus2:Vy,CalendarOff:Zy,CalendarPlus:Wy,CalendarPlus2:Gy,CalendarRange:Ky,CalendarSearch:Yy,CalendarSync:Jy,CalendarX:tv,CalendarX2:ev,Calendars:av,Camera:au,CameraOff:nv,Candy:ov,CandyCane:sv,CandyOff:rv,Cannabis:cv,CannabisOff:iv,Captions:Ki,CaptionsOff:lv,Car:uv,CarFront:dv,CarTaxiFront:Av,Caravan:hv,CardSim:pv,Carrot:fv,CaseLower:xv,CaseSensitive:mv,CaseUpper:gv,CassetteTape:yv,Cast:vv,Castle:kv,Cat:Ov,Cctv:wv,CctvOff:bv,ChartArea:Yi,ChartBar:ec,ChartBarBig:Ji,ChartBarDecreasing:jv,ChartBarIncreasing:Cv,ChartBarStacked:Nv,ChartCandlestick:tc,ChartColumn:hs,ChartColumnBig:ac,ChartColumnDecreasing:Mv,ChartColumnIncreasing:nc,ChartColumnStacked:Sv,ChartGantt:Qv,ChartLine:sc,ChartNetwork:Bv,ChartNoAxesColumn:oc,ChartNoAxesColumnDecreasing:_v,ChartNoAxesColumnIncreasing:rc,ChartNoAxesCombined:Lv,ChartNoAxesGantt:ic,ChartPie:cc,ChartScatter:lc,ChartSpline:nu,Check:De,CheckCheck:Tv,CheckLine:$v,ChefHat:Iv,Cherry:Uv,ChessBishop:Pv,ChessKing:Ev,ChessKnight:zv,ChessPawn:Fv,ChessQueen:Rv,ChessRook:Hv,ChevronDown:bt,ChevronFirst:qv,ChevronLast:Dv,ChevronLeft:bs,ChevronRight:Rt,ChevronUp:su,ChevronsDown:Vv,ChevronsDownUp:ru,ChevronsLeft:Gv,ChevronsLeftRight:Zv,ChevronsLeftRightEllipsis:Xv,ChevronsRight:Kv,ChevronsRightLeft:Wv,ChevronsUp:Jv,ChevronsUpDown:Yv,Church:ek,Cigarette:ak,CigaretteOff:tk,Circle:mk,CircleAlert:Xt,CircleArrowDown:dc,CircleArrowLeft:Ac,CircleArrowOutDownLeft:hc,CircleArrowOutDownRight:uc,CircleArrowOutUpLeft:pc,CircleArrowOutUpRight:xc,CircleArrowRight:fc,CircleArrowUp:za,CircleCheck:Hn,CircleCheckBig:Sa,CircleChevronDown:mc,CircleChevronLeft:gc,CircleChevronRight:yc,CircleChevronUp:vc,CircleDashed:nk,CircleDivide:kc,CircleDollarSign:sk,CircleDot:ok,CircleDotDashed:rk,CircleEllipsis:ik,CircleEqual:ck,CircleFadingArrowUp:lk,CircleFadingPlus:dk,CircleGauge:Oc,CircleMinus:bc,CircleOff:Ak,CircleParking:jc,CircleParkingOff:wc,CirclePause:Cc,CirclePercent:Nc,CirclePile:uk,CirclePlay:Mc,CirclePlus:Sc,CirclePoundSterling:hk,CirclePower:Qc,CircleQuestionMark:Na,CircleSlash:pk,CircleSlash2:Bc,CircleSmall:fk,CircleStar:xk,CircleStop:_c,CircleUser:Tc,CircleUserRound:Lc,CircleX:qn,CircuitBoard:gk,Citrus:vk,Clapperboard:yk,Clipboard:Sk,ClipboardCheck:u0,ClipboardClock:kk,ClipboardCopy:Ok,ClipboardList:bk,ClipboardMinus:wk,ClipboardPaste:jk,ClipboardPen:Ic,ClipboardPenLine:$c,ClipboardPlus:Ck,ClipboardType:Nk,ClipboardX:Mk,Clock:Rr,Clock1:Qk,Clock10:Bk,Clock11:_k,Clock12:Lk,Clock2:Tk,Clock3:$k,Clock4:Ik,Clock5:Uk,Clock6:Pk,Clock7:Ek,Clock8:zk,Clock9:Fk,ClockAlert:Rk,ClockArrowDown:Hk,ClockArrowUp:qk,ClockCheck:Dk,ClockFading:Vk,ClockPlus:Xk,ClosedCaption:Zk,Cloud:NA,CloudAlert:Gk,CloudBackup:Wk,CloudCheck:Kk,CloudCog:Yk,CloudDownload:Uc,CloudDrizzle:Jk,CloudFog:eO,CloudHail:tO,CloudLightning:aO,CloudMoon:sO,CloudMoonRain:nO,CloudOff:rO,CloudRain:iO,CloudRainWind:oO,CloudSnow:cO,CloudSun:dO,CloudSunRain:lO,CloudSync:AO,CloudUpload:Pc,Cloudy:uO,Clover:hO,Club:pO,Code:fO,CodeXml:Zt,Coffee:xO,Cog:mO,Coins:gO,Columns2:Ec,Columns3:zc,Columns3Cog:Es,Columns4:yO,Combine:vO,Command:kO,Compass:OO,Component:bO,Computer:wO,ConciergeBell:jO,Cone:NO,Construction:CO,Contact:MO,ContactRound:Fc,Container:SO,Contrast:QO,Cookie:BO,CookingPot:_O,Copy:wn,CopyCheck:LO,CopyMinus:TO,CopyPlus:$O,CopySlash:IO,CopyX:UO,Copyleft:PO,Copyright:EO,CornerDownLeft:zO,CornerDownRight:FO,CornerLeftDown:RO,CornerLeftUp:qO,CornerRightDown:HO,CornerRightUp:DO,CornerUpLeft:VO,CornerUpRight:XO,Cpu:Ba,CreativeCommons:ZO,CreditCard:GO,Croissant:WO,Crop:KO,Cross:YO,Crosshair:JO,Crown:e4,Cuboid:t4,CupSoda:a4,Currency:n4,Cylinder:s4,Dam:r4,Database:MA,DatabaseBackup:o4,DatabaseSearch:i4,DatabaseZap:c4,DecimalsArrowLeft:l4,DecimalsArrowRight:d4,Delete:A4,Dessert:u4,Diameter:h4,Diamond:x4,DiamondMinus:p4,DiamondPercent:Rc,DiamondPlus:f4,Dice1:m4,Dice2:g4,Dice3:y4,Dice4:v4,Dice5:k4,Dice6:O4,Dices:b4,Diff:w4,Disc:N4,Disc2:j4,Disc3:M4,DiscAlbum:C4,Divide:S4,Dna:B4,DnaOff:Q4,Dock:_4,Dog:L4,DollarSign:h0,Donut:T4,DoorClosed:I4,DoorClosedLocked:$4,DoorOpen:U4,Dot:P4,Download:_a,DraftingCompass:E4,Drama:z4,Drill:F4,Drone:R4,Droplet:q4,DropletOff:H4,Droplets:D4,Drum:V4,Drumstick:X4,Dumbbell:Z4,Ear:W4,EarOff:G4,Earth:Hc,EarthLock:K4,Eclipse:Y4,Egg:t5,EggFried:J4,EggOff:e5,Ellipse:a5,Ellipsis:Uo,EllipsisVertical:qc,Equal:r5,EqualApproximately:n5,EqualNot:s5,Eraser:o5,EthernetPort:i5,Euro:c5,EvCharger:l5,Expand:d5,ExternalLink:ma,Eye:na,EyeClosed:A5,EyeOff:jn,Factory:u5,Fan:h5,FastForward:p5,Feather:f5,Fence:x5,FerrisWheel:m5,File:iu,FileArchive:g5,FileAxis3d:Dc,FileBadge:Vc,FileBox:y5,FileBraces:Gc,FileBracesCorner:Xc,FileChartColumn:Wc,FileChartColumnIncreasing:Zc,FileChartLine:Kc,FileChartPie:Yc,FileCheck:v5,FileCheckCorner:Jc,FileClock:k5,FileCode:ou,FileCodeCorner:el,FileCog:tl,FileDiff:O5,FileDigit:b5,FileDown:w5,FileExclamationPoint:al,FileHeadphone:zs,FileHeart:j5,FileImage:C5,FileInput:N5,FileKey:nl,FileLock:sl,FileMinus:S5,FileMinusCorner:rl,FileMusic:M5,FileOutput:Q5,FilePen:ps,FilePenLine:ol,FilePlay:il,FilePlus:Hr,FilePlusCorner:cl,FileQuestionMark:ll,FileScan:B5,FileSearch:_5,FileSearchCorner:dl,FileSignal:Al,FileSliders:L5,FileSpreadsheet:T5,FileStack:$5,FileSymlink:I5,FileTerminal:U5,FileText:Va,FileType:P5,FileTypeCorner:ul,FileUp:E5,FileUser:z5,FileVideoCamera:hl,FileVolume:F5,FileX:R5,FileXCorner:pl,Files:H5,Film:q5,FingerprintPattern:fl,FireExtinguisher:D5,Fish:W5,FishOff:V5,FishSymbol:X5,FishingHook:Z5,FishingRod:G5,Flag:eb,FlagOff:K5,FlagTriangleLeft:Y5,FlagTriangleRight:J5,Flame:p0,FlameKindling:tb,Flashlight:nb,FlashlightOff:ab,FlaskConical:cu,FlaskConicalOff:sb,FlaskRound:rb,FlipHorizontal2:ob,FlipVertical2:ib,Flower:lb,Flower2:cb,Focus:db,FoldHorizontal:Ab,FoldVertical:ub,Folder:Ko,FolderArchive:hb,FolderCheck:pb,FolderClock:fb,FolderClosed:f0,FolderCode:xb,FolderCog:xl,FolderDot:mb,FolderDown:gb,FolderGit:vb,FolderGit2:yb,FolderHeart:kb,FolderInput:Ob,FolderKanban:bb,FolderKey:wb,FolderLock:jb,FolderMinus:Cb,FolderOpen:ga,FolderOpenDot:Nb,FolderOutput:Mb,FolderPen:ml,FolderPlus:qr,FolderRoot:Sb,FolderSearch:SA,FolderSearch2:Qb,FolderSymlink:Bb,FolderSync:_b,FolderTree:Lb,FolderUp:Tb,FolderX:$b,Folders:Ib,Footprints:Ub,Forklift:Pb,Form:Eb,Forward:zb,Frame:Fb,Frown:Rb,Fuel:Hb,Fullscreen:qb,Funnel:yl,FunnelPlus:Db,FunnelX:gl,GalleryHorizontal:Vb,GalleryHorizontalEnd:Xb,GalleryThumbnails:Zb,GalleryVertical:Wb,GalleryVerticalEnd:Gb,Gamepad:Kb,Gamepad2:QA,GamepadDirectional:Yb,Gauge:x0,Gavel:Jb,Gem:e3,GeorgianLari:t3,Ghost:a3,Gift:m0,GitBranch:Js,GitBranchMinus:n3,GitBranchPlus:s3,GitCommitHorizontal:vl,GitCommitVertical:r3,GitCompare:o3,GitCompareArrows:g0,GitFork:i3,GitGraph:c3,GitMerge:d3,GitMergeConflict:l3,GitPullRequest:x3,GitPullRequestArrow:A3,GitPullRequestClosed:u3,GitPullRequestCreate:p3,GitPullRequestCreateArrow:h3,GitPullRequestDraft:f3,GlassWater:m3,Glasses:g3,Globe:sa,GlobeLock:y3,GlobeOff:v3,GlobeX:k3,Goal:O3,Gpu:b3,GraduationCap:w3,Grape:j3,Grid2x2:wl,Grid2x2Check:kl,Grid2x2Plus:Ol,Grid2x2X:bl,Grid3x2:C3,Grid3x3:Fs,Grip:N3,GripHorizontal:lu,GripVertical:y0,Group:M3,Guitar:Q3,Ham:S3,Hamburger:B3,Hammer:_3,Hand:P3,HandCoins:L3,HandFist:T3,HandGrab:jl,HandHeart:$3,HandHelping:Cl,HandMetal:I3,HandPlatter:U3,Handbag:E3,Handshake:z3,HardDrive:Kn,HardDriveDownload:F3,HardDriveUpload:R3,HardHat:H3,Hash:du,HatGlasses:D3,Haze:q3,Hd:V3,HdmiPort:X3,Heading:J3,Heading1:G3,Heading2:Z3,Heading3:W3,Heading4:K3,Heading5:Y3,Heading6:ew,HeadphoneOff:tw,Headphones:Au,Headset:aw,Heart:v0,HeartCrack:nw,HeartHandshake:sw,HeartMinus:rw,HeartOff:ow,HeartPlus:iw,HeartPulse:cw,HeartX:lw,Heater:dw,Helicopter:Aw,Hexagon:uw,Highlighter:hw,History:pw,Hop:xw,HopOff:fw,Hospital:mw,Hotel:gw,Hourglass:yw,House:Po,HouseHeart:vw,HousePlug:kw,HousePlus:Ow,HouseWifi:bw,IceCreamBowl:Nl,IceCreamCone:Ml,IdCard:jw,IdCardLanyard:ww,Image:Zn,ImageDown:Cw,ImageMinus:Mw,ImageOff:Nw,ImagePlay:Sw,ImagePlus:Qw,ImageUp:Bw,ImageUpscale:_w,Images:Lw,Import:Tw,Inbox:$w,IndianRupee:Iw,Infinity:Uw,Info:uu,InspectionPanel:Pw,Italic:Ew,IterationCcw:zw,IterationCw:Fw,JapaneseYen:Rw,Joystick:Hw,Kanban:qw,Kayak:Dw,Key:ws,KeyRound:hu,KeySquare:Vw,Keyboard:Gw,KeyboardMusic:Xw,KeyboardOff:Zw,Lamp:t8,LampCeiling:Kw,LampDesk:Ww,LampFloor:Yw,LampWallDown:Jw,LampWallUp:e8,LandPlot:a8,Landmark:n8,Languages:s8,Laptop:o8,LaptopMinimal:Sl,LaptopMinimalCheck:r8,Lasso:c8,LassoSelect:i8,Laugh:l8,Layers:Dn,Layers2:d8,LayersMinus:A8,LayersPlus:u8,LayoutDashboard:k0,LayoutGrid:O0,LayoutList:h8,LayoutPanelLeft:p8,LayoutPanelTop:f8,LayoutTemplate:x8,Leaf:m8,LeafyGreen:g8,Lectern:y8,LensConcave:v8,LensConvex:O8,Library:b8,LibraryBig:k8,LifeBuoy:j8,Ligature:w8,Lightbulb:N8,LightbulbOff:C8,LineDotRightHorizontal:M8,LineSquiggle:S8,LineStyle:Q8,Link:b0,Link2:Yo,Link2Off:B8,List:G8,ListCheck:_8,ListChecks:w0,ListChevronsDownUp:L8,ListChevronsUpDown:$8,ListCollapse:T8,ListEnd:I8,ListFilter:P8,ListFilterPlus:U8,ListIndentDecrease:Rs,ListIndentIncrease:Hs,ListMinus:E8,ListMusic:z8,ListOrdered:F8,ListPlus:R8,ListRestart:H8,ListStart:q8,ListTodo:D8,ListTree:X8,ListVideo:V8,ListX:Z8,Loader:K8,LoaderCircle:$e,LoaderPinwheel:W8,Locate:e6,LocateFixed:Y8,LocateOff:J8,Lock:j0,LockKeyhole:t6,LockKeyholeOpen:Ql,LockOpen:Bl,LogIn:pu,LogOut:C0,Logs:a6,Lollipop:n6,Luggage:s6,Magnet:r6,Mail:h6,MailCheck:o6,MailMinus:i6,MailOpen:c6,MailPlus:l6,MailQuestionMark:_l,MailSearch:d6,MailWarning:A6,MailX:u6,Mailbox:p6,Mails:f6,Map:N0,MapMinus:m6,MapPin:S6,MapPinCheck:g6,MapPinCheckInside:x6,MapPinHouse:y6,MapPinMinus:k6,MapPinMinusInside:v6,MapPinOff:O6,MapPinPen:Ll,MapPinPlus:w6,MapPinPlusInside:b6,MapPinSearch:j6,MapPinX:N6,MapPinXInside:C6,MapPinned:M6,MapPlus:Q6,Mars:_6,MarsStroke:B6,Martini:L6,Maximize:T6,Maximize2:BA,Medal:$6,Megaphone:_A,MegaphoneOff:I6,Meh:U6,MemoryStick:M0,Menu:P6,Merge:E6,MessageCircle:Yn,MessageCircleCheck:z6,MessageCircleCode:F6,MessageCircleDashed:R6,MessageCircleHeart:H6,MessageCircleMore:q6,MessageCircleOff:D6,MessageCirclePlus:V6,MessageCircleQuestionMark:Tl,MessageCircleReply:X6,MessageCircleWarning:Z6,MessageCircleX:G6,MessageSquare:Cn,MessageSquareCheck:W6,MessageSquareCode:K6,MessageSquareDashed:Y6,MessageSquareDiff:J6,MessageSquareDot:tj,MessageSquareHeart:aj,MessageSquareLock:ej,MessageSquareMore:nj,MessageSquareOff:sj,MessageSquarePlus:rj,MessageSquareQuote:oj,MessageSquareReply:ij,MessageSquareShare:cj,MessageSquareText:lj,MessageSquareWarning:dj,MessageSquareX:Aj,MessagesSquare:uj,Metronome:hj,Mic:fj,MicOff:pj,MicVocal:$l,Microchip:xj,Microscope:mj,Microwave:yj,Milestone:gj,Milk:kj,MilkOff:vj,Minimize:Oj,Minimize2:S0,Minus:bj,MirrorRectangular:wj,MirrorRound:jj,Monitor:Dr,MonitorCheck:Cj,MonitorCloud:Nj,MonitorCog:Mj,MonitorDot:Sj,MonitorDown:Qj,MonitorOff:Bj,MonitorPause:_j,MonitorPlay:Lj,MonitorSmartphone:Tj,MonitorSpeaker:$j,MonitorStop:Ij,MonitorUp:Uj,MonitorX:Q0,Moon:Ej,MoonStar:Pj,Motorbike:zj,Mountain:Rj,MountainSnow:Fj,Mouse:Kj,MouseLeft:Hj,MouseOff:qj,MousePointer:Gj,MousePointer2:Vj,MousePointer2Off:Dj,MousePointerBan:Xj,MousePointerClick:Zj,MouseRight:Wj,Move:dC,Move3d:Il,MoveDiagonal:Jj,MoveDiagonal2:Yj,MoveDown:aC,MoveDownLeft:eC,MoveDownRight:tC,MoveHorizontal:nC,MoveLeft:sC,MoveRight:rC,MoveUp:cC,MoveUpLeft:oC,MoveUpRight:iC,MoveVertical:lC,Music:pC,Music2:AC,Music3:uC,Music4:hC,Navigation:gC,Navigation2:xC,Navigation2Off:fC,NavigationOff:mC,Network:fu,Newspaper:Jo,Nfc:yC,NonBinary:vC,Notebook:wC,NotebookPen:kC,NotebookTabs:OC,NotebookText:bC,NotepadText:CC,NotepadTextDashed:jC,Nut:MC,NutOff:NC,Octagon:QC,OctagonAlert:Ul,OctagonMinus:SC,OctagonPause:Pl,OctagonX:El,Omega:BC,Option:_C,Orbit:LC,Origami:TC,Package:xu,Package2:IC,PackageCheck:$C,PackageMinus:UC,PackageOpen:PC,PackagePlus:EC,PackageSearch:zC,PackageX:FC,PaintBucket:RC,PaintRoller:HC,Paintbrush:qC,PaintbrushVertical:zl,Palette:DC,Panda:VC,PanelBottom:GC,PanelBottomClose:XC,PanelBottomDashed:Fl,PanelBottomOpen:ZC,PanelLeft:Hl,PanelLeftClose:fs,PanelLeftDashed:Rl,PanelLeftOpen:xs,PanelLeftRightDashed:WC,PanelRight:KC,PanelRightClose:B0,PanelRightDashed:ql,PanelRightOpen:_0,PanelTop:t7,PanelTopBottomDashed:YC,PanelTopClose:JC,PanelTopDashed:Dl,PanelTopOpen:e7,PanelsLeftBottom:a7,PanelsRightBottom:n7,PanelsTopLeft:Vl,Paperclip:mu,Parentheses:s7,ParkingMeter:r7,PartyPopper:o7,Pause:L0,PawPrint:i7,PcCase:c7,Pen:Lr,PenLine:Eo,PenOff:l7,PenTool:d7,Pencil:js,PencilLine:A7,PencilOff:u7,PencilRuler:h7,Pentagon:p7,Percent:f7,PersonStanding:x7,PhilippinePeso:m7,Phone:w7,PhoneCall:g7,PhoneForwarded:y7,PhoneIncoming:v7,PhoneMissed:k7,PhoneOff:O7,PhoneOutgoing:b7,Pi:j7,Piano:C7,Pickaxe:N7,PictureInPicture:S7,PictureInPicture2:M7,PiggyBank:Q7,Pilcrow:L7,PilcrowLeft:B7,PilcrowRight:_7,Pill:$7,PillBottle:T7,Pin:LA,PinOff:gu,Pipette:I7,Pizza:U7,Plane:z7,PlaneLanding:P7,PlaneTakeoff:E7,Play:ei,Plug:da,Plug2:F7,PlugZap:Tr,Plus:ht,PocketKnife:H7,Podcast:R7,Pointer:D7,PointerOff:q7,Popcorn:V7,Popsicle:X7,PoundSterling:Z7,Power:W7,PowerOff:G7,Presentation:yu,Printer:J7,PrinterCheck:K7,PrinterX:Y7,Projector:eN,Proportions:tN,Puzzle:vu,Pyramid:aN,QrCode:nN,Quote:sN,Rabbit:oN,Radar:rN,Radiation:iN,Radical:cN,Radio:Jn,RadioOff:lN,RadioReceiver:dN,RadioTower:AN,Radius:uN,Rainbow:hN,Rat:pN,Ratio:fN,Receipt:jN,ReceiptCent:xN,ReceiptEuro:mN,ReceiptIndianRupee:gN,ReceiptJapaneseYen:yN,ReceiptPoundSterling:vN,ReceiptRussianRuble:kN,ReceiptSwissFranc:ON,ReceiptText:bN,ReceiptTurkishLira:wN,RectangleCircle:CN,RectangleEllipsis:Xl,RectangleGoggles:NN,RectangleHorizontal:MN,RectangleVertical:QN,Recycle:SN,Redo:LN,Redo2:BN,RedoDot:_N,RefreshCcw:$N,RefreshCcwDot:TN,RefreshCw:ra,RefreshCwOff:IN,Refrigerator:UN,Regex:PN,RemoveFormatting:EN,Repeat:RN,Repeat1:zN,Repeat2:FN,Replace:qN,ReplaceAll:HN,Reply:XN,ReplyAll:DN,Rewind:VN,Ribbon:ZN,Road:GN,Rocket:es,RockingChair:WN,RollerCoaster:KN,Rose:YN,Rotate3d:Zl,RotateCcw:Cs,RotateCcwKey:JN,RotateCcwSquare:eM,RotateCw:Vr,RotateCwSquare:tM,Route:aM,RouteOff:nM,Router:sM,Rows2:Gl,Rows3:Wl,Rows4:rM,Rss:oM,Ruler:cM,RulerDimensionLine:iM,RussianRuble:lM,Sailboat:dM,Salad:AM,Sandwich:uM,Satellite:pM,SatelliteDish:hM,SaudiRiyal:fM,Save:Xr,SaveAll:xM,SaveOff:mM,Scale:gM,Scale3d:Kl,Scaling:yM,Scan:MM,ScanBarcode:vM,ScanEye:kM,ScanFace:OM,ScanHeart:bM,ScanLine:wM,ScanQrCode:jM,ScanSearch:NM,ScanText:CM,School:SM,Scissors:QM,ScissorsLineDashed:BM,Scooter:_M,ScreenShare:TM,ScreenShareOff:LM,Scroll:IM,ScrollText:$M,Search:oa,SearchAlert:UM,SearchCheck:PM,SearchCode:EM,SearchSlash:zM,SearchX:FM,Section:RM,Send:Xa,SendHorizontal:Yl,SendToBack:HM,SeparatorHorizontal:qM,SeparatorVertical:VM,Server:aa,ServerCog:DM,ServerCrash:XM,ServerOff:ZM,Settings:Zr,Settings2:T0,Shapes:GM,Share:WM,Share2:$0,Sheet:KM,Shell:YM,ShelvingUnit:JM,Shield:La,ShieldAlert:tS,ShieldBan:eS,ShieldCheck:ku,ShieldCog:nS,ShieldCogCorner:aS,ShieldEllipsis:sS,ShieldHalf:oS,ShieldMinus:rS,ShieldOff:iS,ShieldPlus:cS,ShieldQuestionMark:Jl,ShieldUser:lS,ShieldX:$r,Ship:AS,ShipWheel:dS,Shirt:uS,ShoppingBag:TA,ShoppingBasket:hS,ShoppingCart:pS,Shovel:fS,ShowerHead:mS,Shredder:xS,Shrimp:gS,Shrink:yS,Shrub:vS,Shuffle:kS,Sigma:OS,Signal:NS,SignalHigh:bS,SignalLow:wS,SignalMedium:jS,SignalZero:CS,Signature:MS,Signpost:QS,SignpostBig:SS,Siren:_S,SkipBack:BS,SkipForward:LS,Skull:$A,Slash:$S,Slice:TS,SlidersHorizontal:IS,SlidersVertical:ed,Smartphone:I0,SmartphoneCharging:US,SmartphoneNfc:PS,Smile:zS,SmilePlus:ES,Snail:FS,Snowflake:RS,SoapDispenserDroplet:HS,Sofa:qS,SolarPanel:DS,Soup:VS,Space:XS,Spade:ZS,Sparkle:GS,Sparkles:It,Speaker:WS,Speech:KS,SpellCheck:JS,SpellCheck2:YS,Spline:eQ,SplinePointer:tQ,Split:aQ,Spool:nQ,SportShoe:sQ,Spotlight:rQ,SprayCan:oQ,Sprout:iQ,Square:Gr,SquareActivity:td,SquareArrowDown:nd,SquareArrowDownLeft:ad,SquareArrowDownRight:sd,SquareArrowLeft:rd,SquareArrowOutDownLeft:od,SquareArrowOutDownRight:id,SquareArrowOutUpLeft:ld,SquareArrowOutUpRight:cd,SquareArrowRight:dd,SquareArrowRightEnter:cQ,SquareArrowRightExit:lQ,SquareArrowUp:hd,SquareArrowUpLeft:Ad,SquareArrowUpRight:ud,SquareAsterisk:pd,SquareBottomDashedScissors:fd,SquareCenterlineDashedHorizontal:xd,SquareCenterlineDashedVertical:gd,SquareChartGantt:qs,SquareCheck:yd,SquareCheckBig:md,SquareChevronDown:vd,SquareChevronLeft:kd,SquareChevronRight:Od,SquareChevronUp:wd,SquareCode:bd,SquareDashed:Nd,SquareDashedBottom:AQ,SquareDashedBottomCode:dQ,SquareDashedKanban:jd,SquareDashedMousePointer:Cd,SquareDashedText:Ds,SquareDashedTopSolid:uQ,SquareDivide:Md,SquareDot:Sd,SquareEqual:Qd,SquareFunction:Bd,SquareKanban:_d,SquareLibrary:Ld,SquareM:Td,SquareMenu:$d,SquareMinus:Ud,SquareMousePointer:Id,SquareParking:Ed,SquareParkingOff:Pd,SquarePause:hQ,SquarePen:sn,SquarePercent:zd,SquarePi:Fd,SquarePilcrow:Rd,SquarePlay:Hd,SquarePlus:qd,SquarePower:Dd,SquareRadical:pQ,SquareRoundCorner:fQ,SquareScissors:Vd,SquareSigma:Xd,SquareSlash:Zd,SquareSplitHorizontal:Gd,SquareSplitVertical:Wd,SquareSquare:xQ,SquareStack:mQ,SquareStar:gQ,SquareStop:yQ,SquareTerminal:Yd,SquareUser:Jd,SquareUserRound:Kd,SquareX:eA,SquaresExclude:vQ,SquaresIntersect:kQ,SquaresSubtract:OQ,SquaresUnite:bQ,Squircle:jQ,SquircleDashed:wQ,Squirrel:CQ,Stamp:NQ,Star:IA,StarHalf:MQ,StarOff:SQ,StepBack:QQ,StepForward:BQ,Stethoscope:_Q,Sticker:LQ,StickyNote:TQ,Stone:$Q,Store:IQ,StretchHorizontal:UQ,StretchVertical:PQ,Strikethrough:EQ,Subscript:zQ,Sun:DQ,SunDim:FQ,SunMedium:RQ,SunMoon:HQ,SunSnow:qQ,Sunrise:VQ,Sunset:XQ,Superscript:ZQ,SwatchBook:GQ,SwissFranc:WQ,SwitchCamera:KQ,Sword:YQ,Swords:JQ,Syringe:eB,Table:cB,Table2:tB,TableCellsMerge:aB,TableCellsSplit:nB,TableColumnsSplit:sB,TableOfContents:rB,TableProperties:oB,TableRowsSplit:iB,Tablet:U0,TabletSmartphone:lB,Tablets:dB,Tag:AB,Tags:uB,Tally1:hB,Tally2:pB,Tally3:fB,Tally4:xB,Tally5:mB,Tangent:gB,Target:yB,Telescope:vB,Tent:OB,TentTree:kB,Terminal:Ns,TestTube:ti,TestTubeDiagonal:tA,TestTubes:bB,TextAlignCenter:aA,TextAlignEnd:sA,TextAlignJustify:nA,TextAlignStart:Vs,TextCursor:jB,TextCursorInput:wB,TextInitial:rA,TextQuote:CB,TextSearch:NB,TextWrap:oA,Theater:MB,Thermometer:BB,ThermometerSnowflake:SB,ThermometerSun:QB,ThumbsDown:_B,ThumbsUp:LB,Ticket:zB,TicketCheck:TB,TicketMinus:$B,TicketPercent:IB,TicketPlus:UB,TicketSlash:PB,TicketX:EB,Tickets:RB,TicketsPlane:FB,Timeline:HB,Timer:P0,TimerOff:qB,TimerReset:DB,ToggleLeft:VB,ToggleRight:XB,Toilet:ZB,ToolCase:GB,Toolbox:WB,Tornado:KB,Torus:YB,Touchpad:e9,TouchpadOff:JB,TowelRack:t9,TowerControl:a9,ToyBrick:r9,Tractor:n9,TrafficCone:s9,TrainFront:c9,TrainFrontTunnel:o9,TrainTrack:i9,TramFront:iA,Transgender:l9,Trash:d9,Trash2:At,TreeDeciduous:A9,TreePalm:cA,TreePine:u9,Trees:h9,TrendingDown:p9,TrendingUp:x9,TrendingUpDown:f9,Triangle:y9,TriangleAlert:Gt,TriangleDashed:m9,TriangleRight:g9,Trophy:v9,Truck:O9,TruckElectric:k9,TurkishLira:b9,Turntable:w9,Turtle:j9,Tv:N9,TvMinimal:lA,TvMinimalPlay:C9,Type:M9,TypeOutline:S9,Umbrella:_9,UmbrellaOff:B9,Underline:Q9,Undo:$9,Undo2:L9,UndoDot:T9,UnfoldHorizontal:I9,UnfoldVertical:U9,Ungroup:P9,University:dA,Unlink:z9,Unlink2:E9,Unplug:ai,Upload:E0,Usb:F9,User:z0,UserCheck:Ou,UserCog:R9,UserKey:H9,UserLock:q9,UserMinus:D9,UserPen:V9,UserPlus:bu,UserRound:xA,UserRoundCheck:AA,UserRoundCog:uA,UserRoundKey:X9,UserRoundMinus:hA,UserRoundPen:Z9,UserRoundPlus:pA,UserRoundSearch:G9,UserRoundX:fA,UserSearch:W9,UserStar:K9,UserX:Y9,Users:Fa,UsersRound:mA,Utensils:yA,UtensilsCrossed:gA,UtilityPole:J9,Van:e_,Variable:t_,Vault:a_,VectorSquare:n_,Vegan:s_,VenetianMask:r_,Venus:i_,VenusAndMars:o_,Vibrate:l_,VibrateOff:c_,Video:A_,VideoOff:d_,Videotape:u_,View:h_,Voicemail:p_,Volleyball:f_,Volume:v_,Volume1:x_,Volume2:m_,VolumeOff:g_,VolumeX:y_,Vote:k_,Wallet:wu,WalletCards:O_,WalletMinimal:vA,Wallpaper:w_,Wand:b_,WandSparkles:kA,Warehouse:j_,WashingMachine:C_,Watch:N_,Waves:B_,WavesArrowDown:M_,WavesArrowUp:S_,WavesLadder:Q_,Waypoints:__,Webcam:L_,Webhook:$_,WebhookOff:T_,Weight:P_,WeightTilde:I_,Wheat:E_,WheatOff:U_,WholeWord:z_,Wifi:UA,WifiCog:F_,WifiHigh:R_,WifiLow:H_,WifiOff:F0,WifiPen:q_,WifiSync:V_,WifiZero:D_,Wind:Z_,WindArrowDown:X_,Wine:W_,WineOff:G_,Workflow:K_,Worm:Y_,Wrench:ju,X:Ge,XLineTop:J_,Zap:wt,ZapOff:eL,ZodiacAquarius:tL,ZodiacAries:aL,ZodiacCancer:nL,ZodiacCapricorn:sL,ZodiacGemini:rL,ZodiacLeo:oL,ZodiacLibra:iL,ZodiacOphiuchus:cL,ZodiacPisces:lL,ZodiacSagittarius:dL,ZodiacScorpio:AL,ZodiacTaurus:uL,ZodiacVirgo:hL,ZoomIn:pL,ZoomOut:fL},Symbol.toStringTag,{value:"Module"})),TL=Object.freeze(Object.defineProperty({__proto__:null,AArrowDown:Qf,AArrowDownIcon:Qf,AArrowUp:Bf,AArrowUpIcon:Bf,ALargeSmall:_f,ALargeSmallIcon:_f,Accessibility:Lf,AccessibilityIcon:Lf,Activity:Ys,ActivityIcon:Ys,ActivitySquare:td,ActivitySquareIcon:td,AirVent:Tf,AirVentIcon:Tf,Airplay:$f,AirplayIcon:$f,AlarmCheck:$i,AlarmCheckIcon:$i,AlarmClock:Uf,AlarmClockCheck:$i,AlarmClockCheckIcon:$i,AlarmClockIcon:Uf,AlarmClockMinus:Ii,AlarmClockMinusIcon:Ii,AlarmClockOff:If,AlarmClockOffIcon:If,AlarmClockPlus:Ui,AlarmClockPlusIcon:Ui,AlarmMinus:Ii,AlarmMinusIcon:Ii,AlarmPlus:Ui,AlarmPlusIcon:Ui,AlarmSmoke:Pf,AlarmSmokeIcon:Pf,Album:Ef,AlbumIcon:Ef,AlertCircle:Xt,AlertCircleIcon:Xt,AlertOctagon:Ul,AlertOctagonIcon:Ul,AlertTriangle:Gt,AlertTriangleIcon:Gt,AlignCenter:aA,AlignCenterHorizontal:zf,AlignCenterHorizontalIcon:zf,AlignCenterIcon:aA,AlignCenterVertical:Ff,AlignCenterVerticalIcon:Ff,AlignEndHorizontal:Rf,AlignEndHorizontalIcon:Rf,AlignEndVertical:Hf,AlignEndVerticalIcon:Hf,AlignHorizontalDistributeCenter:qf,AlignHorizontalDistributeCenterIcon:qf,AlignHorizontalDistributeEnd:Df,AlignHorizontalDistributeEndIcon:Df,AlignHorizontalDistributeStart:Vf,AlignHorizontalDistributeStartIcon:Vf,AlignHorizontalJustifyCenter:Xf,AlignHorizontalJustifyCenterIcon:Xf,AlignHorizontalJustifyEnd:Zf,AlignHorizontalJustifyEndIcon:Zf,AlignHorizontalJustifyStart:Gf,AlignHorizontalJustifyStartIcon:Gf,AlignHorizontalSpaceAround:Wf,AlignHorizontalSpaceAroundIcon:Wf,AlignHorizontalSpaceBetween:Yf,AlignHorizontalSpaceBetweenIcon:Yf,AlignJustify:nA,AlignJustifyIcon:nA,AlignLeft:Vs,AlignLeftIcon:Vs,AlignRight:sA,AlignRightIcon:sA,AlignStartHorizontal:Kf,AlignStartHorizontalIcon:Kf,AlignStartVertical:Jf,AlignStartVerticalIcon:Jf,AlignVerticalDistributeCenter:ex,AlignVerticalDistributeCenterIcon:ex,AlignVerticalDistributeEnd:tx,AlignVerticalDistributeEndIcon:tx,AlignVerticalDistributeStart:ax,AlignVerticalDistributeStartIcon:ax,AlignVerticalJustifyCenter:nx,AlignVerticalJustifyCenterIcon:nx,AlignVerticalJustifyEnd:rx,AlignVerticalJustifyEndIcon:rx,AlignVerticalJustifyStart:sx,AlignVerticalJustifyStartIcon:sx,AlignVerticalSpaceAround:ox,AlignVerticalSpaceAroundIcon:ox,AlignVerticalSpaceBetween:ix,AlignVerticalSpaceBetweenIcon:ix,Ambulance:cx,AmbulanceIcon:cx,Ampersand:lx,AmpersandIcon:lx,Ampersands:Ax,AmpersandsIcon:Ax,Amphora:dx,AmphoraIcon:dx,Anchor:ux,AnchorIcon:ux,Angry:hx,AngryIcon:hx,Annoyed:px,AnnoyedIcon:px,Antenna:fx,AntennaIcon:fx,Anvil:xx,AnvilIcon:xx,Aperture:mx,ApertureIcon:mx,AppWindow:yx,AppWindowIcon:yx,AppWindowMac:gx,AppWindowMacIcon:gx,Apple:vx,AppleIcon:vx,Archive:CA,ArchiveIcon:CA,ArchiveRestore:kx,ArchiveRestoreIcon:kx,ArchiveX:Ox,ArchiveXIcon:Ox,AreaChart:Yi,AreaChartIcon:Yi,Armchair:bx,ArmchairIcon:bx,ArrowBigDown:jx,ArrowBigDownDash:wx,ArrowBigDownDashIcon:wx,ArrowBigDownIcon:jx,ArrowBigLeft:Nx,ArrowBigLeftDash:Cx,ArrowBigLeftDashIcon:Cx,ArrowBigLeftIcon:Nx,ArrowBigRight:Sx,ArrowBigRightDash:Mx,ArrowBigRightDashIcon:Mx,ArrowBigRightIcon:Sx,ArrowBigUp:Qx,ArrowBigUpDash:Bx,ArrowBigUpDashIcon:Bx,ArrowBigUpIcon:Qx,ArrowDown:i0,ArrowDown01:_x,ArrowDown01Icon:_x,ArrowDown10:Lx,ArrowDown10Icon:Lx,ArrowDownAZ:Pi,ArrowDownAZIcon:Pi,ArrowDownAz:Pi,ArrowDownAzIcon:Pi,ArrowDownCircle:dc,ArrowDownCircleIcon:dc,ArrowDownFromLine:Tx,ArrowDownFromLineIcon:Tx,ArrowDownIcon:i0,ArrowDownLeft:o0,ArrowDownLeftFromCircle:hc,ArrowDownLeftFromCircleIcon:hc,ArrowDownLeftFromSquare:od,ArrowDownLeftFromSquareIcon:od,ArrowDownLeftIcon:o0,ArrowDownLeftSquare:ad,ArrowDownLeftSquareIcon:ad,ArrowDownNarrowWide:$x,ArrowDownNarrowWideIcon:$x,ArrowDownRight:Ix,ArrowDownRightFromCircle:uc,ArrowDownRightFromCircleIcon:uc,ArrowDownRightFromSquare:id,ArrowDownRightFromSquareIcon:id,ArrowDownRightIcon:Ix,ArrowDownRightSquare:sd,ArrowDownRightSquareIcon:sd,ArrowDownSquare:nd,ArrowDownSquareIcon:nd,ArrowDownToDot:Ux,ArrowDownToDotIcon:Ux,ArrowDownToLine:Px,ArrowDownToLineIcon:Px,ArrowDownUp:Ex,ArrowDownUpIcon:Ex,ArrowDownWideNarrow:Ei,ArrowDownWideNarrowIcon:Ei,ArrowDownZA:zi,ArrowDownZAIcon:zi,ArrowDownZa:zi,ArrowDownZaIcon:zi,ArrowLeft:J1,ArrowLeftCircle:Ac,ArrowLeftCircleIcon:Ac,ArrowLeftFromLine:zx,ArrowLeftFromLineIcon:zx,ArrowLeftIcon:J1,ArrowLeftRight:Fx,ArrowLeftRightIcon:Fx,ArrowLeftSquare:rd,ArrowLeftSquareIcon:rd,ArrowLeftToLine:Rx,ArrowLeftToLineIcon:Rx,ArrowRight:Fr,ArrowRightCircle:fc,ArrowRightCircleIcon:fc,ArrowRightFromLine:Hx,ArrowRightFromLineIcon:Hx,ArrowRightIcon:Fr,ArrowRightLeft:qx,ArrowRightLeftIcon:qx,ArrowRightSquare:dd,ArrowRightSquareIcon:dd,ArrowRightToLine:Dx,ArrowRightToLineIcon:Dx,ArrowUp:eu,ArrowUp01:Vx,ArrowUp01Icon:Vx,ArrowUp10:Xx,ArrowUp10Icon:Xx,ArrowUpAZ:Fi,ArrowUpAZIcon:Fi,ArrowUpAz:Fi,ArrowUpAzIcon:Fi,ArrowUpCircle:za,ArrowUpCircleIcon:za,ArrowUpDown:Zx,ArrowUpDownIcon:Zx,ArrowUpFromDot:Gx,ArrowUpFromDotIcon:Gx,ArrowUpFromLine:Wx,ArrowUpFromLineIcon:Wx,ArrowUpIcon:eu,ArrowUpLeft:Kx,ArrowUpLeftFromCircle:pc,ArrowUpLeftFromCircleIcon:pc,ArrowUpLeftFromSquare:ld,ArrowUpLeftFromSquareIcon:ld,ArrowUpLeftIcon:Kx,ArrowUpLeftSquare:Ad,ArrowUpLeftSquareIcon:Ad,ArrowUpNarrowWide:Ri,ArrowUpNarrowWideIcon:Ri,ArrowUpRight:c0,ArrowUpRightFromCircle:xc,ArrowUpRightFromCircleIcon:xc,ArrowUpRightFromSquare:cd,ArrowUpRightFromSquareIcon:cd,ArrowUpRightIcon:c0,ArrowUpRightSquare:ud,ArrowUpRightSquareIcon:ud,ArrowUpSquare:hd,ArrowUpSquareIcon:hd,ArrowUpToLine:Yx,ArrowUpToLineIcon:Yx,ArrowUpWideNarrow:Jx,ArrowUpWideNarrowIcon:Jx,ArrowUpZA:Hi,ArrowUpZAIcon:Hi,ArrowUpZa:Hi,ArrowUpZaIcon:Hi,ArrowsUpFromLine:em,ArrowsUpFromLineIcon:em,Asterisk:tm,AsteriskIcon:tm,AsteriskSquare:pd,AsteriskSquareIcon:pd,AtSign:am,AtSignIcon:am,Atom:nm,AtomIcon:nm,AudioLines:sm,AudioLinesIcon:sm,AudioWaveform:rm,AudioWaveformIcon:rm,Award:om,AwardIcon:om,Axe:im,AxeIcon:im,Axis3D:qi,Axis3DIcon:qi,Axis3d:qi,Axis3dIcon:qi,Baby:cm,BabyIcon:cm,Backpack:lm,BackpackIcon:lm,Badge:jm,BadgeAlert:dm,BadgeAlertIcon:dm,BadgeCent:Am,BadgeCentIcon:Am,BadgeCheck:Di,BadgeCheckIcon:Di,BadgeDollarSign:um,BadgeDollarSignIcon:um,BadgeEuro:hm,BadgeEuroIcon:hm,BadgeHelp:Vi,BadgeHelpIcon:Vi,BadgeIcon:jm,BadgeIndianRupee:pm,BadgeIndianRupeeIcon:pm,BadgeInfo:fm,BadgeInfoIcon:fm,BadgeJapaneseYen:xm,BadgeJapaneseYenIcon:xm,BadgeMinus:mm,BadgeMinusIcon:mm,BadgePercent:gm,BadgePercentIcon:gm,BadgePlus:ym,BadgePlusIcon:ym,BadgePoundSterling:vm,BadgePoundSterlingIcon:vm,BadgeQuestionMark:Vi,BadgeQuestionMarkIcon:Vi,BadgeRussianRuble:km,BadgeRussianRubleIcon:km,BadgeSwissFranc:Om,BadgeSwissFrancIcon:Om,BadgeTurkishLira:bm,BadgeTurkishLiraIcon:bm,BadgeX:wm,BadgeXIcon:wm,BaggageClaim:Cm,BaggageClaimIcon:Cm,Balloon:Nm,BalloonIcon:Nm,Ban:Mm,BanIcon:Mm,Banana:Sm,BananaIcon:Sm,Bandage:Qm,BandageIcon:Qm,Banknote:Tm,BanknoteArrowDown:Bm,BanknoteArrowDownIcon:Bm,BanknoteArrowUp:_m,BanknoteArrowUpIcon:_m,BanknoteIcon:Tm,BanknoteX:Lm,BanknoteXIcon:Lm,BarChart:rc,BarChart2:oc,BarChart2Icon:oc,BarChart3:hs,BarChart3Icon:hs,BarChart4:nc,BarChart4Icon:nc,BarChartBig:ac,BarChartBigIcon:ac,BarChartHorizontal:ec,BarChartHorizontalBig:Ji,BarChartHorizontalBigIcon:Ji,BarChartHorizontalIcon:ec,BarChartIcon:rc,Barcode:$m,BarcodeIcon:$m,Barrel:Im,BarrelIcon:Im,Baseline:Um,BaselineIcon:Um,Bath:Pm,BathIcon:Pm,Battery:Dm,BatteryCharging:Em,BatteryChargingIcon:Em,BatteryFull:zm,BatteryFullIcon:zm,BatteryIcon:Dm,BatteryLow:Fm,BatteryLowIcon:Fm,BatteryMedium:Rm,BatteryMediumIcon:Rm,BatteryPlus:Hm,BatteryPlusIcon:Hm,BatteryWarning:qm,BatteryWarningIcon:qm,Beaker:Vm,BeakerIcon:Vm,Bean:Zm,BeanIcon:Zm,BeanOff:Xm,BeanOffIcon:Xm,Bed:Km,BedDouble:Gm,BedDoubleIcon:Gm,BedIcon:Km,BedSingle:Wm,BedSingleIcon:Wm,Beef:Jm,BeefIcon:Jm,BeefOff:Ym,BeefOffIcon:Ym,Beer:tg,BeerIcon:tg,BeerOff:eg,BeerOffIcon:eg,Bell:lg,BellCheck:ag,BellCheckIcon:ag,BellDot:ng,BellDotIcon:ng,BellElectric:sg,BellElectricIcon:sg,BellIcon:lg,BellMinus:rg,BellMinusIcon:rg,BellOff:og,BellOffIcon:og,BellPlus:ig,BellPlusIcon:ig,BellRing:cg,BellRingIcon:cg,BetweenHorizonalEnd:Xi,BetweenHorizonalEndIcon:Xi,BetweenHorizonalStart:Zi,BetweenHorizonalStartIcon:Zi,BetweenHorizontalEnd:Xi,BetweenHorizontalEndIcon:Xi,BetweenHorizontalStart:Zi,BetweenHorizontalStartIcon:Zi,BetweenVerticalEnd:dg,BetweenVerticalEndIcon:dg,BetweenVerticalStart:Ag,BetweenVerticalStartIcon:Ag,BicepsFlexed:ug,BicepsFlexedIcon:ug,Bike:hg,BikeIcon:hg,Binary:pg,BinaryIcon:pg,Binoculars:fg,BinocularsIcon:fg,Biohazard:xg,BiohazardIcon:xg,Bird:mg,BirdIcon:mg,Birdhouse:gg,BirdhouseIcon:gg,Bitcoin:yg,BitcoinIcon:yg,Blend:vg,BlendIcon:vg,Blinds:kg,BlindsIcon:kg,Blocks:Og,BlocksIcon:Og,Bluetooth:Cg,BluetoothConnected:bg,BluetoothConnectedIcon:bg,BluetoothIcon:Cg,BluetoothOff:wg,BluetoothOffIcon:wg,BluetoothSearching:jg,BluetoothSearchingIcon:jg,Bold:Ng,BoldIcon:Ng,Bolt:Mg,BoltIcon:Mg,Bomb:l0,BombIcon:l0,Bone:Sg,BoneIcon:Sg,Book:Jg,BookA:Qg,BookAIcon:Qg,BookAlert:Bg,BookAlertIcon:Bg,BookAudio:_g,BookAudioIcon:_g,BookCheck:Lg,BookCheckIcon:Lg,BookCopy:Tg,BookCopyIcon:Tg,BookDashed:Gi,BookDashedIcon:Gi,BookDown:$g,BookDownIcon:$g,BookHeadphones:Ig,BookHeadphonesIcon:Ig,BookHeart:Ug,BookHeartIcon:Ug,BookIcon:Jg,BookImage:Pg,BookImageIcon:Pg,BookKey:Eg,BookKeyIcon:Eg,BookLock:zg,BookLockIcon:zg,BookMarked:Fg,BookMarkedIcon:Fg,BookMinus:Rg,BookMinusIcon:Rg,BookOpen:Go,BookOpenCheck:Hg,BookOpenCheckIcon:Hg,BookOpenIcon:Go,BookOpenText:qg,BookOpenTextIcon:qg,BookPlus:Dg,BookPlusIcon:Dg,BookSearch:Vg,BookSearchIcon:Vg,BookTemplate:Gi,BookTemplateIcon:Gi,BookText:Xg,BookTextIcon:Xg,BookType:Zg,BookTypeIcon:Zg,BookUp:Wg,BookUp2:Gg,BookUp2Icon:Gg,BookUpIcon:Wg,BookUser:Kg,BookUserIcon:Kg,BookX:Yg,BookXIcon:Yg,Bookmark:sy,BookmarkCheck:d0,BookmarkCheckIcon:d0,BookmarkIcon:sy,BookmarkMinus:ey,BookmarkMinusIcon:ey,BookmarkOff:ty,BookmarkOffIcon:ty,BookmarkPlus:ay,BookmarkPlusIcon:ay,BookmarkX:ny,BookmarkXIcon:ny,BoomBox:ry,BoomBoxIcon:ry,Bot:Os,BotIcon:Os,BotMessageSquare:oy,BotMessageSquareIcon:oy,BotOff:iy,BotOffIcon:iy,BottleWine:cy,BottleWineIcon:cy,BowArrow:ly,BowArrowIcon:ly,Box:on,BoxIcon:on,BoxSelect:Nd,BoxSelectIcon:Nd,Boxes:dy,BoxesIcon:dy,Braces:Wi,BracesIcon:Wi,Brackets:Ay,BracketsIcon:Ay,Brain:A0,BrainCircuit:uy,BrainCircuitIcon:uy,BrainCog:hy,BrainCogIcon:hy,BrainIcon:A0,BrickWall:xy,BrickWallFire:py,BrickWallFireIcon:py,BrickWallIcon:xy,BrickWallShield:fy,BrickWallShieldIcon:fy,Briefcase:vy,BriefcaseBusiness:my,BriefcaseBusinessIcon:my,BriefcaseConveyorBelt:gy,BriefcaseConveyorBeltIcon:gy,BriefcaseIcon:vy,BriefcaseMedical:yy,BriefcaseMedicalIcon:yy,BringToFront:ky,BringToFrontIcon:ky,Brush:by,BrushCleaning:Oy,BrushCleaningIcon:Oy,BrushIcon:by,Bubbles:wy,BubblesIcon:wy,Bug:Ny,BugIcon:Ny,BugOff:jy,BugOffIcon:jy,BugPlay:Cy,BugPlayIcon:Cy,Building:My,Building2:Sy,Building2Icon:Sy,BuildingIcon:My,Bus:By,BusFront:Qy,BusFrontIcon:Qy,BusIcon:By,Cable:_y,CableCar:Ly,CableCarIcon:Ly,CableIcon:_y,Cake:$y,CakeIcon:$y,CakeSlice:Ty,CakeSliceIcon:Ty,Calculator:tu,CalculatorIcon:tu,Calendar:Wo,Calendar1:Iy,Calendar1Icon:Iy,CalendarArrowDown:Uy,CalendarArrowDownIcon:Uy,CalendarArrowUp:Py,CalendarArrowUpIcon:Py,CalendarCheck:zy,CalendarCheck2:Ey,CalendarCheck2Icon:Ey,CalendarCheckIcon:zy,CalendarClock:Fy,CalendarClockIcon:Fy,CalendarCog:Ry,CalendarCogIcon:Ry,CalendarDays:Hy,CalendarDaysIcon:Hy,CalendarFold:qy,CalendarFoldIcon:qy,CalendarHeart:Dy,CalendarHeartIcon:Dy,CalendarIcon:Wo,CalendarMinus:Xy,CalendarMinus2:Vy,CalendarMinus2Icon:Vy,CalendarMinusIcon:Xy,CalendarOff:Zy,CalendarOffIcon:Zy,CalendarPlus:Wy,CalendarPlus2:Gy,CalendarPlus2Icon:Gy,CalendarPlusIcon:Wy,CalendarRange:Ky,CalendarRangeIcon:Ky,CalendarSearch:Yy,CalendarSearchIcon:Yy,CalendarSync:Jy,CalendarSyncIcon:Jy,CalendarX:tv,CalendarX2:ev,CalendarX2Icon:ev,CalendarXIcon:tv,Calendars:av,CalendarsIcon:av,Camera:au,CameraIcon:au,CameraOff:nv,CameraOffIcon:nv,CandlestickChart:tc,CandlestickChartIcon:tc,Candy:ov,CandyCane:sv,CandyCaneIcon:sv,CandyIcon:ov,CandyOff:rv,CandyOffIcon:rv,Cannabis:cv,CannabisIcon:cv,CannabisOff:iv,CannabisOffIcon:iv,Captions:Ki,CaptionsIcon:Ki,CaptionsOff:lv,CaptionsOffIcon:lv,Car:uv,CarFront:dv,CarFrontIcon:dv,CarIcon:uv,CarTaxiFront:Av,CarTaxiFrontIcon:Av,Caravan:hv,CaravanIcon:hv,CardSim:pv,CardSimIcon:pv,Carrot:fv,CarrotIcon:fv,CaseLower:xv,CaseLowerIcon:xv,CaseSensitive:mv,CaseSensitiveIcon:mv,CaseUpper:gv,CaseUpperIcon:gv,CassetteTape:yv,CassetteTapeIcon:yv,Cast:vv,CastIcon:vv,Castle:kv,CastleIcon:kv,Cat:Ov,CatIcon:Ov,Cctv:wv,CctvIcon:wv,CctvOff:bv,CctvOffIcon:bv,ChartArea:Yi,ChartAreaIcon:Yi,ChartBar:ec,ChartBarBig:Ji,ChartBarBigIcon:Ji,ChartBarDecreasing:jv,ChartBarDecreasingIcon:jv,ChartBarIcon:ec,ChartBarIncreasing:Cv,ChartBarIncreasingIcon:Cv,ChartBarStacked:Nv,ChartBarStackedIcon:Nv,ChartCandlestick:tc,ChartCandlestickIcon:tc,ChartColumn:hs,ChartColumnBig:ac,ChartColumnBigIcon:ac,ChartColumnDecreasing:Mv,ChartColumnDecreasingIcon:Mv,ChartColumnIcon:hs,ChartColumnIncreasing:nc,ChartColumnIncreasingIcon:nc,ChartColumnStacked:Sv,ChartColumnStackedIcon:Sv,ChartGantt:Qv,ChartGanttIcon:Qv,ChartLine:sc,ChartLineIcon:sc,ChartNetwork:Bv,ChartNetworkIcon:Bv,ChartNoAxesColumn:oc,ChartNoAxesColumnDecreasing:_v,ChartNoAxesColumnDecreasingIcon:_v,ChartNoAxesColumnIcon:oc,ChartNoAxesColumnIncreasing:rc,ChartNoAxesColumnIncreasingIcon:rc,ChartNoAxesCombined:Lv,ChartNoAxesCombinedIcon:Lv,ChartNoAxesGantt:ic,ChartNoAxesGanttIcon:ic,ChartPie:cc,ChartPieIcon:cc,ChartScatter:lc,ChartScatterIcon:lc,ChartSpline:nu,ChartSplineIcon:nu,Check:De,CheckCheck:Tv,CheckCheckIcon:Tv,CheckCircle:Sa,CheckCircle2:Hn,CheckCircle2Icon:Hn,CheckCircleIcon:Sa,CheckIcon:De,CheckLine:$v,CheckLineIcon:$v,CheckSquare:md,CheckSquare2:yd,CheckSquare2Icon:yd,CheckSquareIcon:md,ChefHat:Iv,ChefHatIcon:Iv,Cherry:Uv,CherryIcon:Uv,ChessBishop:Pv,ChessBishopIcon:Pv,ChessKing:Ev,ChessKingIcon:Ev,ChessKnight:zv,ChessKnightIcon:zv,ChessPawn:Fv,ChessPawnIcon:Fv,ChessQueen:Rv,ChessQueenIcon:Rv,ChessRook:Hv,ChessRookIcon:Hv,ChevronDown:bt,ChevronDownCircle:mc,ChevronDownCircleIcon:mc,ChevronDownIcon:bt,ChevronDownSquare:vd,ChevronDownSquareIcon:vd,ChevronFirst:qv,ChevronFirstIcon:qv,ChevronLast:Dv,ChevronLastIcon:Dv,ChevronLeft:bs,ChevronLeftCircle:gc,ChevronLeftCircleIcon:gc,ChevronLeftIcon:bs,ChevronLeftSquare:kd,ChevronLeftSquareIcon:kd,ChevronRight:Rt,ChevronRightCircle:yc,ChevronRightCircleIcon:yc,ChevronRightIcon:Rt,ChevronRightSquare:Od,ChevronRightSquareIcon:Od,ChevronUp:su,ChevronUpCircle:vc,ChevronUpCircleIcon:vc,ChevronUpIcon:su,ChevronUpSquare:wd,ChevronUpSquareIcon:wd,ChevronsDown:Vv,ChevronsDownIcon:Vv,ChevronsDownUp:ru,ChevronsDownUpIcon:ru,ChevronsLeft:Gv,ChevronsLeftIcon:Gv,ChevronsLeftRight:Zv,ChevronsLeftRightEllipsis:Xv,ChevronsLeftRightEllipsisIcon:Xv,ChevronsLeftRightIcon:Zv,ChevronsRight:Kv,ChevronsRightIcon:Kv,ChevronsRightLeft:Wv,ChevronsRightLeftIcon:Wv,ChevronsUp:Jv,ChevronsUpDown:Yv,ChevronsUpDownIcon:Yv,ChevronsUpIcon:Jv,Church:ek,ChurchIcon:ek,Cigarette:ak,CigaretteIcon:ak,CigaretteOff:tk,CigaretteOffIcon:tk,Circle:mk,CircleAlert:Xt,CircleAlertIcon:Xt,CircleArrowDown:dc,CircleArrowDownIcon:dc,CircleArrowLeft:Ac,CircleArrowLeftIcon:Ac,CircleArrowOutDownLeft:hc,CircleArrowOutDownLeftIcon:hc,CircleArrowOutDownRight:uc,CircleArrowOutDownRightIcon:uc,CircleArrowOutUpLeft:pc,CircleArrowOutUpLeftIcon:pc,CircleArrowOutUpRight:xc,CircleArrowOutUpRightIcon:xc,CircleArrowRight:fc,CircleArrowRightIcon:fc,CircleArrowUp:za,CircleArrowUpIcon:za,CircleCheck:Hn,CircleCheckBig:Sa,CircleCheckBigIcon:Sa,CircleCheckIcon:Hn,CircleChevronDown:mc,CircleChevronDownIcon:mc,CircleChevronLeft:gc,CircleChevronLeftIcon:gc,CircleChevronRight:yc,CircleChevronRightIcon:yc,CircleChevronUp:vc,CircleChevronUpIcon:vc,CircleDashed:nk,CircleDashedIcon:nk,CircleDivide:kc,CircleDivideIcon:kc,CircleDollarSign:sk,CircleDollarSignIcon:sk,CircleDot:ok,CircleDotDashed:rk,CircleDotDashedIcon:rk,CircleDotIcon:ok,CircleEllipsis:ik,CircleEllipsisIcon:ik,CircleEqual:ck,CircleEqualIcon:ck,CircleFadingArrowUp:lk,CircleFadingArrowUpIcon:lk,CircleFadingPlus:dk,CircleFadingPlusIcon:dk,CircleGauge:Oc,CircleGaugeIcon:Oc,CircleHelp:Na,CircleHelpIcon:Na,CircleIcon:mk,CircleMinus:bc,CircleMinusIcon:bc,CircleOff:Ak,CircleOffIcon:Ak,CircleParking:jc,CircleParkingIcon:jc,CircleParkingOff:wc,CircleParkingOffIcon:wc,CirclePause:Cc,CirclePauseIcon:Cc,CirclePercent:Nc,CirclePercentIcon:Nc,CirclePile:uk,CirclePileIcon:uk,CirclePlay:Mc,CirclePlayIcon:Mc,CirclePlus:Sc,CirclePlusIcon:Sc,CirclePoundSterling:hk,CirclePoundSterlingIcon:hk,CirclePower:Qc,CirclePowerIcon:Qc,CircleQuestionMark:Na,CircleQuestionMarkIcon:Na,CircleSlash:pk,CircleSlash2:Bc,CircleSlash2Icon:Bc,CircleSlashIcon:pk,CircleSlashed:Bc,CircleSlashedIcon:Bc,CircleSmall:fk,CircleSmallIcon:fk,CircleStar:xk,CircleStarIcon:xk,CircleStop:_c,CircleStopIcon:_c,CircleUser:Tc,CircleUserIcon:Tc,CircleUserRound:Lc,CircleUserRoundIcon:Lc,CircleX:qn,CircleXIcon:qn,CircuitBoard:gk,CircuitBoardIcon:gk,Citrus:vk,CitrusIcon:vk,Clapperboard:yk,ClapperboardIcon:yk,Clipboard:Sk,ClipboardCheck:u0,ClipboardCheckIcon:u0,ClipboardClock:kk,ClipboardClockIcon:kk,ClipboardCopy:Ok,ClipboardCopyIcon:Ok,ClipboardEdit:Ic,ClipboardEditIcon:Ic,ClipboardIcon:Sk,ClipboardList:bk,ClipboardListIcon:bk,ClipboardMinus:wk,ClipboardMinusIcon:wk,ClipboardPaste:jk,ClipboardPasteIcon:jk,ClipboardPen:Ic,ClipboardPenIcon:Ic,ClipboardPenLine:$c,ClipboardPenLineIcon:$c,ClipboardPlus:Ck,ClipboardPlusIcon:Ck,ClipboardSignature:$c,ClipboardSignatureIcon:$c,ClipboardType:Nk,ClipboardTypeIcon:Nk,ClipboardX:Mk,ClipboardXIcon:Mk,Clock:Rr,Clock1:Qk,Clock10:Bk,Clock10Icon:Bk,Clock11:_k,Clock11Icon:_k,Clock12:Lk,Clock12Icon:Lk,Clock1Icon:Qk,Clock2:Tk,Clock2Icon:Tk,Clock3:$k,Clock3Icon:$k,Clock4:Ik,Clock4Icon:Ik,Clock5:Uk,Clock5Icon:Uk,Clock6:Pk,Clock6Icon:Pk,Clock7:Ek,Clock7Icon:Ek,Clock8:zk,Clock8Icon:zk,Clock9:Fk,Clock9Icon:Fk,ClockAlert:Rk,ClockAlertIcon:Rk,ClockArrowDown:Hk,ClockArrowDownIcon:Hk,ClockArrowUp:qk,ClockArrowUpIcon:qk,ClockCheck:Dk,ClockCheckIcon:Dk,ClockFading:Vk,ClockFadingIcon:Vk,ClockIcon:Rr,ClockPlus:Xk,ClockPlusIcon:Xk,ClosedCaption:Zk,ClosedCaptionIcon:Zk,Cloud:NA,CloudAlert:Gk,CloudAlertIcon:Gk,CloudBackup:Wk,CloudBackupIcon:Wk,CloudCheck:Kk,CloudCheckIcon:Kk,CloudCog:Yk,CloudCogIcon:Yk,CloudDownload:Uc,CloudDownloadIcon:Uc,CloudDrizzle:Jk,CloudDrizzleIcon:Jk,CloudFog:eO,CloudFogIcon:eO,CloudHail:tO,CloudHailIcon:tO,CloudIcon:NA,CloudLightning:aO,CloudLightningIcon:aO,CloudMoon:sO,CloudMoonIcon:sO,CloudMoonRain:nO,CloudMoonRainIcon:nO,CloudOff:rO,CloudOffIcon:rO,CloudRain:iO,CloudRainIcon:iO,CloudRainWind:oO,CloudRainWindIcon:oO,CloudSnow:cO,CloudSnowIcon:cO,CloudSun:dO,CloudSunIcon:dO,CloudSunRain:lO,CloudSunRainIcon:lO,CloudSync:AO,CloudSyncIcon:AO,CloudUpload:Pc,CloudUploadIcon:Pc,Cloudy:uO,CloudyIcon:uO,Clover:hO,CloverIcon:hO,Club:pO,ClubIcon:pO,Code:fO,Code2:Zt,Code2Icon:Zt,CodeIcon:fO,CodeSquare:bd,CodeSquareIcon:bd,CodeXml:Zt,CodeXmlIcon:Zt,Coffee:xO,CoffeeIcon:xO,Cog:mO,CogIcon:mO,Coins:gO,CoinsIcon:gO,Columns:Ec,Columns2:Ec,Columns2Icon:Ec,Columns3:zc,Columns3Cog:Es,Columns3CogIcon:Es,Columns3Icon:zc,Columns4:yO,Columns4Icon:yO,ColumnsIcon:Ec,ColumnsSettings:Es,ColumnsSettingsIcon:Es,Combine:vO,CombineIcon:vO,Command:kO,CommandIcon:kO,Compass:OO,CompassIcon:OO,Component:bO,ComponentIcon:bO,Computer:wO,ComputerIcon:wO,ConciergeBell:jO,ConciergeBellIcon:jO,Cone:NO,ConeIcon:NO,Construction:CO,ConstructionIcon:CO,Contact:MO,Contact2:Fc,Contact2Icon:Fc,ContactIcon:MO,ContactRound:Fc,ContactRoundIcon:Fc,Container:SO,ContainerIcon:SO,Contrast:QO,ContrastIcon:QO,Cookie:BO,CookieIcon:BO,CookingPot:_O,CookingPotIcon:_O,Copy:wn,CopyCheck:LO,CopyCheckIcon:LO,CopyIcon:wn,CopyMinus:TO,CopyMinusIcon:TO,CopyPlus:$O,CopyPlusIcon:$O,CopySlash:IO,CopySlashIcon:IO,CopyX:UO,CopyXIcon:UO,Copyleft:PO,CopyleftIcon:PO,Copyright:EO,CopyrightIcon:EO,CornerDownLeft:zO,CornerDownLeftIcon:zO,CornerDownRight:FO,CornerDownRightIcon:FO,CornerLeftDown:RO,CornerLeftDownIcon:RO,CornerLeftUp:qO,CornerLeftUpIcon:qO,CornerRightDown:HO,CornerRightDownIcon:HO,CornerRightUp:DO,CornerRightUpIcon:DO,CornerUpLeft:VO,CornerUpLeftIcon:VO,CornerUpRight:XO,CornerUpRightIcon:XO,Cpu:Ba,CpuIcon:Ba,CreativeCommons:ZO,CreativeCommonsIcon:ZO,CreditCard:GO,CreditCardIcon:GO,Croissant:WO,CroissantIcon:WO,Crop:KO,CropIcon:KO,Cross:YO,CrossIcon:YO,Crosshair:JO,CrosshairIcon:JO,Crown:e4,CrownIcon:e4,Cuboid:t4,CuboidIcon:t4,CupSoda:a4,CupSodaIcon:a4,CurlyBraces:Wi,CurlyBracesIcon:Wi,Currency:n4,CurrencyIcon:n4,Cylinder:s4,CylinderIcon:s4,Dam:r4,DamIcon:r4,Database:MA,DatabaseBackup:o4,DatabaseBackupIcon:o4,DatabaseIcon:MA,DatabaseSearch:i4,DatabaseSearchIcon:i4,DatabaseZap:c4,DatabaseZapIcon:c4,DecimalsArrowLeft:l4,DecimalsArrowLeftIcon:l4,DecimalsArrowRight:d4,DecimalsArrowRightIcon:d4,Delete:A4,DeleteIcon:A4,Dessert:u4,DessertIcon:u4,Diameter:h4,DiameterIcon:h4,Diamond:x4,DiamondIcon:x4,DiamondMinus:p4,DiamondMinusIcon:p4,DiamondPercent:Rc,DiamondPercentIcon:Rc,DiamondPlus:f4,DiamondPlusIcon:f4,Dice1:m4,Dice1Icon:m4,Dice2:g4,Dice2Icon:g4,Dice3:y4,Dice3Icon:y4,Dice4:v4,Dice4Icon:v4,Dice5:k4,Dice5Icon:k4,Dice6:O4,Dice6Icon:O4,Dices:b4,DicesIcon:b4,Diff:w4,DiffIcon:w4,Disc:N4,Disc2:j4,Disc2Icon:j4,Disc3:M4,Disc3Icon:M4,DiscAlbum:C4,DiscAlbumIcon:C4,DiscIcon:N4,Divide:S4,DivideCircle:kc,DivideCircleIcon:kc,DivideIcon:S4,DivideSquare:Md,DivideSquareIcon:Md,Dna:B4,DnaIcon:B4,DnaOff:Q4,DnaOffIcon:Q4,Dock:_4,DockIcon:_4,Dog:L4,DogIcon:L4,DollarSign:h0,DollarSignIcon:h0,Donut:T4,DonutIcon:T4,DoorClosed:I4,DoorClosedIcon:I4,DoorClosedLocked:$4,DoorClosedLockedIcon:$4,DoorOpen:U4,DoorOpenIcon:U4,Dot:P4,DotIcon:P4,DotSquare:Sd,DotSquareIcon:Sd,Download:_a,DownloadCloud:Uc,DownloadCloudIcon:Uc,DownloadIcon:_a,DraftingCompass:E4,DraftingCompassIcon:E4,Drama:z4,DramaIcon:z4,Drill:F4,DrillIcon:F4,Drone:R4,DroneIcon:R4,Droplet:q4,DropletIcon:q4,DropletOff:H4,DropletOffIcon:H4,Droplets:D4,DropletsIcon:D4,Drum:V4,DrumIcon:V4,Drumstick:X4,DrumstickIcon:X4,Dumbbell:Z4,DumbbellIcon:Z4,Ear:W4,EarIcon:W4,EarOff:G4,EarOffIcon:G4,Earth:Hc,EarthIcon:Hc,EarthLock:K4,EarthLockIcon:K4,Eclipse:Y4,EclipseIcon:Y4,Edit:sn,Edit2:Lr,Edit2Icon:Lr,Edit3:Eo,Edit3Icon:Eo,EditIcon:sn,Egg:t5,EggFried:J4,EggFriedIcon:J4,EggIcon:t5,EggOff:e5,EggOffIcon:e5,Ellipse:a5,EllipseIcon:a5,Ellipsis:Uo,EllipsisIcon:Uo,EllipsisVertical:qc,EllipsisVerticalIcon:qc,Equal:r5,EqualApproximately:n5,EqualApproximatelyIcon:n5,EqualIcon:r5,EqualNot:s5,EqualNotIcon:s5,EqualSquare:Qd,EqualSquareIcon:Qd,Eraser:o5,EraserIcon:o5,EthernetPort:i5,EthernetPortIcon:i5,Euro:c5,EuroIcon:c5,EvCharger:l5,EvChargerIcon:l5,Expand:d5,ExpandIcon:d5,ExternalLink:ma,ExternalLinkIcon:ma,Eye:na,EyeClosed:A5,EyeClosedIcon:A5,EyeIcon:na,EyeOff:jn,EyeOffIcon:jn,Factory:u5,FactoryIcon:u5,Fan:h5,FanIcon:h5,FastForward:p5,FastForwardIcon:p5,Feather:f5,FeatherIcon:f5,Fence:x5,FenceIcon:x5,FerrisWheel:m5,FerrisWheelIcon:m5,File:iu,FileArchive:g5,FileArchiveIcon:g5,FileAudio:zs,FileAudio2:zs,FileAudio2Icon:zs,FileAudioIcon:zs,FileAxis3D:Dc,FileAxis3DIcon:Dc,FileAxis3d:Dc,FileAxis3dIcon:Dc,FileBadge:Vc,FileBadge2:Vc,FileBadge2Icon:Vc,FileBadgeIcon:Vc,FileBarChart:Zc,FileBarChart2:Wc,FileBarChart2Icon:Wc,FileBarChartIcon:Zc,FileBox:y5,FileBoxIcon:y5,FileBraces:Gc,FileBracesCorner:Xc,FileBracesCornerIcon:Xc,FileBracesIcon:Gc,FileChartColumn:Wc,FileChartColumnIcon:Wc,FileChartColumnIncreasing:Zc,FileChartColumnIncreasingIcon:Zc,FileChartLine:Kc,FileChartLineIcon:Kc,FileChartPie:Yc,FileChartPieIcon:Yc,FileCheck:v5,FileCheck2:Jc,FileCheck2Icon:Jc,FileCheckCorner:Jc,FileCheckCornerIcon:Jc,FileCheckIcon:v5,FileClock:k5,FileClockIcon:k5,FileCode:ou,FileCode2:el,FileCode2Icon:el,FileCodeCorner:el,FileCodeCornerIcon:el,FileCodeIcon:ou,FileCog:tl,FileCog2:tl,FileCog2Icon:tl,FileCogIcon:tl,FileDiff:O5,FileDiffIcon:O5,FileDigit:b5,FileDigitIcon:b5,FileDown:w5,FileDownIcon:w5,FileEdit:ps,FileEditIcon:ps,FileExclamationPoint:al,FileExclamationPointIcon:al,FileHeadphone:zs,FileHeadphoneIcon:zs,FileHeart:j5,FileHeartIcon:j5,FileIcon:iu,FileImage:C5,FileImageIcon:C5,FileInput:N5,FileInputIcon:N5,FileJson:Gc,FileJson2:Xc,FileJson2Icon:Xc,FileJsonIcon:Gc,FileKey:nl,FileKey2:nl,FileKey2Icon:nl,FileKeyIcon:nl,FileLineChart:Kc,FileLineChartIcon:Kc,FileLock:sl,FileLock2:sl,FileLock2Icon:sl,FileLockIcon:sl,FileMinus:S5,FileMinus2:rl,FileMinus2Icon:rl,FileMinusCorner:rl,FileMinusCornerIcon:rl,FileMinusIcon:S5,FileMusic:M5,FileMusicIcon:M5,FileOutput:Q5,FileOutputIcon:Q5,FilePen:ps,FilePenIcon:ps,FilePenLine:ol,FilePenLineIcon:ol,FilePieChart:Yc,FilePieChartIcon:Yc,FilePlay:il,FilePlayIcon:il,FilePlus:Hr,FilePlus2:cl,FilePlus2Icon:cl,FilePlusCorner:cl,FilePlusCornerIcon:cl,FilePlusIcon:Hr,FileQuestion:ll,FileQuestionIcon:ll,FileQuestionMark:ll,FileQuestionMarkIcon:ll,FileScan:B5,FileScanIcon:B5,FileSearch:_5,FileSearch2:dl,FileSearch2Icon:dl,FileSearchCorner:dl,FileSearchCornerIcon:dl,FileSearchIcon:_5,FileSignal:Al,FileSignalIcon:Al,FileSignature:ol,FileSignatureIcon:ol,FileSliders:L5,FileSlidersIcon:L5,FileSpreadsheet:T5,FileSpreadsheetIcon:T5,FileStack:$5,FileStackIcon:$5,FileSymlink:I5,FileSymlinkIcon:I5,FileTerminal:U5,FileTerminalIcon:U5,FileText:Va,FileTextIcon:Va,FileType:P5,FileType2:ul,FileType2Icon:ul,FileTypeCorner:ul,FileTypeCornerIcon:ul,FileTypeIcon:P5,FileUp:E5,FileUpIcon:E5,FileUser:z5,FileUserIcon:z5,FileVideo:il,FileVideo2:hl,FileVideo2Icon:hl,FileVideoCamera:hl,FileVideoCameraIcon:hl,FileVideoIcon:il,FileVolume:F5,FileVolume2:Al,FileVolume2Icon:Al,FileVolumeIcon:F5,FileWarning:al,FileWarningIcon:al,FileX:R5,FileX2:pl,FileX2Icon:pl,FileXCorner:pl,FileXCornerIcon:pl,FileXIcon:R5,Files:H5,FilesIcon:H5,Film:q5,FilmIcon:q5,Filter:yl,FilterIcon:yl,FilterX:gl,FilterXIcon:gl,Fingerprint:fl,FingerprintIcon:fl,FingerprintPattern:fl,FingerprintPatternIcon:fl,FireExtinguisher:D5,FireExtinguisherIcon:D5,Fish:W5,FishIcon:W5,FishOff:V5,FishOffIcon:V5,FishSymbol:X5,FishSymbolIcon:X5,FishingHook:Z5,FishingHookIcon:Z5,FishingRod:G5,FishingRodIcon:G5,Flag:eb,FlagIcon:eb,FlagOff:K5,FlagOffIcon:K5,FlagTriangleLeft:Y5,FlagTriangleLeftIcon:Y5,FlagTriangleRight:J5,FlagTriangleRightIcon:J5,Flame:p0,FlameIcon:p0,FlameKindling:tb,FlameKindlingIcon:tb,Flashlight:nb,FlashlightIcon:nb,FlashlightOff:ab,FlashlightOffIcon:ab,FlaskConical:cu,FlaskConicalIcon:cu,FlaskConicalOff:sb,FlaskConicalOffIcon:sb,FlaskRound:rb,FlaskRoundIcon:rb,FlipHorizontal:xd,FlipHorizontal2:ob,FlipHorizontal2Icon:ob,FlipHorizontalIcon:xd,FlipVertical:gd,FlipVertical2:ib,FlipVertical2Icon:ib,FlipVerticalIcon:gd,Flower:lb,Flower2:cb,Flower2Icon:cb,FlowerIcon:lb,Focus:db,FocusIcon:db,FoldHorizontal:Ab,FoldHorizontalIcon:Ab,FoldVertical:ub,FoldVerticalIcon:ub,Folder:Ko,FolderArchive:hb,FolderArchiveIcon:hb,FolderCheck:pb,FolderCheckIcon:pb,FolderClock:fb,FolderClockIcon:fb,FolderClosed:f0,FolderClosedIcon:f0,FolderCode:xb,FolderCodeIcon:xb,FolderCog:xl,FolderCog2:xl,FolderCog2Icon:xl,FolderCogIcon:xl,FolderDot:mb,FolderDotIcon:mb,FolderDown:gb,FolderDownIcon:gb,FolderEdit:ml,FolderEditIcon:ml,FolderGit:vb,FolderGit2:yb,FolderGit2Icon:yb,FolderGitIcon:vb,FolderHeart:kb,FolderHeartIcon:kb,FolderIcon:Ko,FolderInput:Ob,FolderInputIcon:Ob,FolderKanban:bb,FolderKanbanIcon:bb,FolderKey:wb,FolderKeyIcon:wb,FolderLock:jb,FolderLockIcon:jb,FolderMinus:Cb,FolderMinusIcon:Cb,FolderOpen:ga,FolderOpenDot:Nb,FolderOpenDotIcon:Nb,FolderOpenIcon:ga,FolderOutput:Mb,FolderOutputIcon:Mb,FolderPen:ml,FolderPenIcon:ml,FolderPlus:qr,FolderPlusIcon:qr,FolderRoot:Sb,FolderRootIcon:Sb,FolderSearch:SA,FolderSearch2:Qb,FolderSearch2Icon:Qb,FolderSearchIcon:SA,FolderSymlink:Bb,FolderSymlinkIcon:Bb,FolderSync:_b,FolderSyncIcon:_b,FolderTree:Lb,FolderTreeIcon:Lb,FolderUp:Tb,FolderUpIcon:Tb,FolderX:$b,FolderXIcon:$b,Folders:Ib,FoldersIcon:Ib,Footprints:Ub,FootprintsIcon:Ub,ForkKnife:yA,ForkKnifeCrossed:gA,ForkKnifeCrossedIcon:gA,ForkKnifeIcon:yA,Forklift:Pb,ForkliftIcon:Pb,Form:Eb,FormIcon:Eb,FormInput:Xl,FormInputIcon:Xl,Forward:zb,ForwardIcon:zb,Frame:Fb,FrameIcon:Fb,Frown:Rb,FrownIcon:Rb,Fuel:Hb,FuelIcon:Hb,Fullscreen:qb,FullscreenIcon:qb,FunctionSquare:Bd,FunctionSquareIcon:Bd,Funnel:yl,FunnelIcon:yl,FunnelPlus:Db,FunnelPlusIcon:Db,FunnelX:gl,FunnelXIcon:gl,GalleryHorizontal:Vb,GalleryHorizontalEnd:Xb,GalleryHorizontalEndIcon:Xb,GalleryHorizontalIcon:Vb,GalleryThumbnails:Zb,GalleryThumbnailsIcon:Zb,GalleryVertical:Wb,GalleryVerticalEnd:Gb,GalleryVerticalEndIcon:Gb,GalleryVerticalIcon:Wb,Gamepad:Kb,Gamepad2:QA,Gamepad2Icon:QA,GamepadDirectional:Yb,GamepadDirectionalIcon:Yb,GamepadIcon:Kb,GanttChart:ic,GanttChartIcon:ic,GanttChartSquare:qs,GanttChartSquareIcon:qs,Gauge:x0,GaugeCircle:Oc,GaugeCircleIcon:Oc,GaugeIcon:x0,Gavel:Jb,GavelIcon:Jb,Gem:e3,GemIcon:e3,GeorgianLari:t3,GeorgianLariIcon:t3,Ghost:a3,GhostIcon:a3,Gift:m0,GiftIcon:m0,GitBranch:Js,GitBranchIcon:Js,GitBranchMinus:n3,GitBranchMinusIcon:n3,GitBranchPlus:s3,GitBranchPlusIcon:s3,GitCommit:vl,GitCommitHorizontal:vl,GitCommitHorizontalIcon:vl,GitCommitIcon:vl,GitCommitVertical:r3,GitCommitVerticalIcon:r3,GitCompare:o3,GitCompareArrows:g0,GitCompareArrowsIcon:g0,GitCompareIcon:o3,GitFork:i3,GitForkIcon:i3,GitGraph:c3,GitGraphIcon:c3,GitMerge:d3,GitMergeConflict:l3,GitMergeConflictIcon:l3,GitMergeIcon:d3,GitPullRequest:x3,GitPullRequestArrow:A3,GitPullRequestArrowIcon:A3,GitPullRequestClosed:u3,GitPullRequestClosedIcon:u3,GitPullRequestCreate:p3,GitPullRequestCreateArrow:h3,GitPullRequestCreateArrowIcon:h3,GitPullRequestCreateIcon:p3,GitPullRequestDraft:f3,GitPullRequestDraftIcon:f3,GitPullRequestIcon:x3,GlassWater:m3,GlassWaterIcon:m3,Glasses:g3,GlassesIcon:g3,Globe:sa,Globe2:Hc,Globe2Icon:Hc,GlobeIcon:sa,GlobeLock:y3,GlobeLockIcon:y3,GlobeOff:v3,GlobeOffIcon:v3,GlobeX:k3,GlobeXIcon:k3,Goal:O3,GoalIcon:O3,Gpu:b3,GpuIcon:b3,Grab:jl,GrabIcon:jl,GraduationCap:w3,GraduationCapIcon:w3,Grape:j3,GrapeIcon:j3,Grid:Fs,Grid2X2:wl,Grid2X2Check:kl,Grid2X2CheckIcon:kl,Grid2X2Icon:wl,Grid2X2Plus:Ol,Grid2X2PlusIcon:Ol,Grid2X2X:bl,Grid2X2XIcon:bl,Grid2x2:wl,Grid2x2Check:kl,Grid2x2CheckIcon:kl,Grid2x2Icon:wl,Grid2x2Plus:Ol,Grid2x2PlusIcon:Ol,Grid2x2X:bl,Grid2x2XIcon:bl,Grid3X3:Fs,Grid3X3Icon:Fs,Grid3x2:C3,Grid3x2Icon:C3,Grid3x3:Fs,Grid3x3Icon:Fs,GridIcon:Fs,Grip:N3,GripHorizontal:lu,GripHorizontalIcon:lu,GripIcon:N3,GripVertical:y0,GripVerticalIcon:y0,Group:M3,GroupIcon:M3,Guitar:Q3,GuitarIcon:Q3,Ham:S3,HamIcon:S3,Hamburger:B3,HamburgerIcon:B3,Hammer:_3,HammerIcon:_3,Hand:P3,HandCoins:L3,HandCoinsIcon:L3,HandFist:T3,HandFistIcon:T3,HandGrab:jl,HandGrabIcon:jl,HandHeart:$3,HandHeartIcon:$3,HandHelping:Cl,HandHelpingIcon:Cl,HandIcon:P3,HandMetal:I3,HandMetalIcon:I3,HandPlatter:U3,HandPlatterIcon:U3,Handbag:E3,HandbagIcon:E3,Handshake:z3,HandshakeIcon:z3,HardDrive:Kn,HardDriveDownload:F3,HardDriveDownloadIcon:F3,HardDriveIcon:Kn,HardDriveUpload:R3,HardDriveUploadIcon:R3,HardHat:H3,HardHatIcon:H3,Hash:du,HashIcon:du,HatGlasses:D3,HatGlassesIcon:D3,Haze:q3,HazeIcon:q3,Hd:V3,HdIcon:V3,HdmiPort:X3,HdmiPortIcon:X3,Heading:J3,Heading1:G3,Heading1Icon:G3,Heading2:Z3,Heading2Icon:Z3,Heading3:W3,Heading3Icon:W3,Heading4:K3,Heading4Icon:K3,Heading5:Y3,Heading5Icon:Y3,Heading6:ew,Heading6Icon:ew,HeadingIcon:J3,HeadphoneOff:tw,HeadphoneOffIcon:tw,Headphones:Au,HeadphonesIcon:Au,Headset:aw,HeadsetIcon:aw,Heart:v0,HeartCrack:nw,HeartCrackIcon:nw,HeartHandshake:sw,HeartHandshakeIcon:sw,HeartIcon:v0,HeartMinus:rw,HeartMinusIcon:rw,HeartOff:ow,HeartOffIcon:ow,HeartPlus:iw,HeartPlusIcon:iw,HeartPulse:cw,HeartPulseIcon:cw,HeartX:lw,HeartXIcon:lw,Heater:dw,HeaterIcon:dw,Helicopter:Aw,HelicopterIcon:Aw,HelpCircle:Na,HelpCircleIcon:Na,HelpingHand:Cl,HelpingHandIcon:Cl,Hexagon:uw,HexagonIcon:uw,Highlighter:hw,HighlighterIcon:hw,History:pw,HistoryIcon:pw,Home:Po,HomeIcon:Po,Hop:xw,HopIcon:xw,HopOff:fw,HopOffIcon:fw,Hospital:mw,HospitalIcon:mw,Hotel:gw,HotelIcon:gw,Hourglass:yw,HourglassIcon:yw,House:Po,HouseHeart:vw,HouseHeartIcon:vw,HouseIcon:Po,HousePlug:kw,HousePlugIcon:kw,HousePlus:Ow,HousePlusIcon:Ow,HouseWifi:bw,HouseWifiIcon:bw,IceCream:Ml,IceCream2:Nl,IceCream2Icon:Nl,IceCreamBowl:Nl,IceCreamBowlIcon:Nl,IceCreamCone:Ml,IceCreamConeIcon:Ml,IceCreamIcon:Ml,Icon:uG,IdCard:jw,IdCardIcon:jw,IdCardLanyard:ww,IdCardLanyardIcon:ww,Image:Zn,ImageDown:Cw,ImageDownIcon:Cw,ImageIcon:Zn,ImageMinus:Mw,ImageMinusIcon:Mw,ImageOff:Nw,ImageOffIcon:Nw,ImagePlay:Sw,ImagePlayIcon:Sw,ImagePlus:Qw,ImagePlusIcon:Qw,ImageUp:Bw,ImageUpIcon:Bw,ImageUpscale:_w,ImageUpscaleIcon:_w,Images:Lw,ImagesIcon:Lw,Import:Tw,ImportIcon:Tw,Inbox:$w,InboxIcon:$w,Indent:Hs,IndentDecrease:Rs,IndentDecreaseIcon:Rs,IndentIcon:Hs,IndentIncrease:Hs,IndentIncreaseIcon:Hs,IndianRupee:Iw,IndianRupeeIcon:Iw,Infinity:Uw,InfinityIcon:Uw,Info:uu,InfoIcon:uu,Inspect:Id,InspectIcon:Id,InspectionPanel:Pw,InspectionPanelIcon:Pw,Italic:Ew,ItalicIcon:Ew,IterationCcw:zw,IterationCcwIcon:zw,IterationCw:Fw,IterationCwIcon:Fw,JapaneseYen:Rw,JapaneseYenIcon:Rw,Joystick:Hw,JoystickIcon:Hw,Kanban:qw,KanbanIcon:qw,KanbanSquare:_d,KanbanSquareDashed:jd,KanbanSquareDashedIcon:jd,KanbanSquareIcon:_d,Kayak:Dw,KayakIcon:Dw,Key:ws,KeyIcon:ws,KeyRound:hu,KeyRoundIcon:hu,KeySquare:Vw,KeySquareIcon:Vw,Keyboard:Gw,KeyboardIcon:Gw,KeyboardMusic:Xw,KeyboardMusicIcon:Xw,KeyboardOff:Zw,KeyboardOffIcon:Zw,Lamp:t8,LampCeiling:Kw,LampCeilingIcon:Kw,LampDesk:Ww,LampDeskIcon:Ww,LampFloor:Yw,LampFloorIcon:Yw,LampIcon:t8,LampWallDown:Jw,LampWallDownIcon:Jw,LampWallUp:e8,LampWallUpIcon:e8,LandPlot:a8,LandPlotIcon:a8,Landmark:n8,LandmarkIcon:n8,Languages:s8,LanguagesIcon:s8,Laptop:o8,Laptop2:Sl,Laptop2Icon:Sl,LaptopIcon:o8,LaptopMinimal:Sl,LaptopMinimalCheck:r8,LaptopMinimalCheckIcon:r8,LaptopMinimalIcon:Sl,Lasso:c8,LassoIcon:c8,LassoSelect:i8,LassoSelectIcon:i8,Laugh:l8,LaughIcon:l8,Layers:Dn,Layers2:d8,Layers2Icon:d8,Layers3:Dn,Layers3Icon:Dn,LayersIcon:Dn,LayersMinus:A8,LayersMinusIcon:A8,LayersPlus:u8,LayersPlusIcon:u8,Layout:Vl,LayoutDashboard:k0,LayoutDashboardIcon:k0,LayoutGrid:O0,LayoutGridIcon:O0,LayoutIcon:Vl,LayoutList:h8,LayoutListIcon:h8,LayoutPanelLeft:p8,LayoutPanelLeftIcon:p8,LayoutPanelTop:f8,LayoutPanelTopIcon:f8,LayoutTemplate:x8,LayoutTemplateIcon:x8,Leaf:m8,LeafIcon:m8,LeafyGreen:g8,LeafyGreenIcon:g8,Lectern:y8,LecternIcon:y8,LensConcave:v8,LensConcaveIcon:v8,LensConvex:O8,LensConvexIcon:O8,LetterText:rA,LetterTextIcon:rA,Library:b8,LibraryBig:k8,LibraryBigIcon:k8,LibraryIcon:b8,LibrarySquare:Ld,LibrarySquareIcon:Ld,LifeBuoy:j8,LifeBuoyIcon:j8,Ligature:w8,LigatureIcon:w8,Lightbulb:N8,LightbulbIcon:N8,LightbulbOff:C8,LightbulbOffIcon:C8,LineChart:sc,LineChartIcon:sc,LineDotRightHorizontal:M8,LineDotRightHorizontalIcon:M8,LineSquiggle:S8,LineSquiggleIcon:S8,LineStyle:Q8,LineStyleIcon:Q8,Link:b0,Link2:Yo,Link2Icon:Yo,Link2Off:B8,Link2OffIcon:B8,LinkIcon:b0,List:G8,ListCheck:_8,ListCheckIcon:_8,ListChecks:w0,ListChecksIcon:w0,ListChevronsDownUp:L8,ListChevronsDownUpIcon:L8,ListChevronsUpDown:$8,ListChevronsUpDownIcon:$8,ListCollapse:T8,ListCollapseIcon:T8,ListEnd:I8,ListEndIcon:I8,ListFilter:P8,ListFilterIcon:P8,ListFilterPlus:U8,ListFilterPlusIcon:U8,ListIcon:G8,ListIndentDecrease:Rs,ListIndentDecreaseIcon:Rs,ListIndentIncrease:Hs,ListIndentIncreaseIcon:Hs,ListMinus:E8,ListMinusIcon:E8,ListMusic:z8,ListMusicIcon:z8,ListOrdered:F8,ListOrderedIcon:F8,ListPlus:R8,ListPlusIcon:R8,ListRestart:H8,ListRestartIcon:H8,ListStart:q8,ListStartIcon:q8,ListTodo:D8,ListTodoIcon:D8,ListTree:X8,ListTreeIcon:X8,ListVideo:V8,ListVideoIcon:V8,ListX:Z8,ListXIcon:Z8,Loader:K8,Loader2:$e,Loader2Icon:$e,LoaderCircle:$e,LoaderCircleIcon:$e,LoaderIcon:K8,LoaderPinwheel:W8,LoaderPinwheelIcon:W8,Locate:e6,LocateFixed:Y8,LocateFixedIcon:Y8,LocateIcon:e6,LocateOff:J8,LocateOffIcon:J8,LocationEdit:Ll,LocationEditIcon:Ll,Lock:j0,LockIcon:j0,LockKeyhole:t6,LockKeyholeIcon:t6,LockKeyholeOpen:Ql,LockKeyholeOpenIcon:Ql,LockOpen:Bl,LockOpenIcon:Bl,LogIn:pu,LogInIcon:pu,LogOut:C0,LogOutIcon:C0,Logs:a6,LogsIcon:a6,Lollipop:n6,LollipopIcon:n6,LucideAArrowDown:Qf,LucideAArrowUp:Bf,LucideALargeSmall:_f,LucideAccessibility:Lf,LucideActivity:Ys,LucideActivitySquare:td,LucideAirVent:Tf,LucideAirplay:$f,LucideAlarmCheck:$i,LucideAlarmClock:Uf,LucideAlarmClockCheck:$i,LucideAlarmClockMinus:Ii,LucideAlarmClockOff:If,LucideAlarmClockPlus:Ui,LucideAlarmMinus:Ii,LucideAlarmPlus:Ui,LucideAlarmSmoke:Pf,LucideAlbum:Ef,LucideAlertCircle:Xt,LucideAlertOctagon:Ul,LucideAlertTriangle:Gt,LucideAlignCenter:aA,LucideAlignCenterHorizontal:zf,LucideAlignCenterVertical:Ff,LucideAlignEndHorizontal:Rf,LucideAlignEndVertical:Hf,LucideAlignHorizontalDistributeCenter:qf,LucideAlignHorizontalDistributeEnd:Df,LucideAlignHorizontalDistributeStart:Vf,LucideAlignHorizontalJustifyCenter:Xf,LucideAlignHorizontalJustifyEnd:Zf,LucideAlignHorizontalJustifyStart:Gf,LucideAlignHorizontalSpaceAround:Wf,LucideAlignHorizontalSpaceBetween:Yf,LucideAlignJustify:nA,LucideAlignLeft:Vs,LucideAlignRight:sA,LucideAlignStartHorizontal:Kf,LucideAlignStartVertical:Jf,LucideAlignVerticalDistributeCenter:ex,LucideAlignVerticalDistributeEnd:tx,LucideAlignVerticalDistributeStart:ax,LucideAlignVerticalJustifyCenter:nx,LucideAlignVerticalJustifyEnd:rx,LucideAlignVerticalJustifyStart:sx,LucideAlignVerticalSpaceAround:ox,LucideAlignVerticalSpaceBetween:ix,LucideAmbulance:cx,LucideAmpersand:lx,LucideAmpersands:Ax,LucideAmphora:dx,LucideAnchor:ux,LucideAngry:hx,LucideAnnoyed:px,LucideAntenna:fx,LucideAnvil:xx,LucideAperture:mx,LucideAppWindow:yx,LucideAppWindowMac:gx,LucideApple:vx,LucideArchive:CA,LucideArchiveRestore:kx,LucideArchiveX:Ox,LucideAreaChart:Yi,LucideArmchair:bx,LucideArrowBigDown:jx,LucideArrowBigDownDash:wx,LucideArrowBigLeft:Nx,LucideArrowBigLeftDash:Cx,LucideArrowBigRight:Sx,LucideArrowBigRightDash:Mx,LucideArrowBigUp:Qx,LucideArrowBigUpDash:Bx,LucideArrowDown:i0,LucideArrowDown01:_x,LucideArrowDown10:Lx,LucideArrowDownAZ:Pi,LucideArrowDownAz:Pi,LucideArrowDownCircle:dc,LucideArrowDownFromLine:Tx,LucideArrowDownLeft:o0,LucideArrowDownLeftFromCircle:hc,LucideArrowDownLeftFromSquare:od,LucideArrowDownLeftSquare:ad,LucideArrowDownNarrowWide:$x,LucideArrowDownRight:Ix,LucideArrowDownRightFromCircle:uc,LucideArrowDownRightFromSquare:id,LucideArrowDownRightSquare:sd,LucideArrowDownSquare:nd,LucideArrowDownToDot:Ux,LucideArrowDownToLine:Px,LucideArrowDownUp:Ex,LucideArrowDownWideNarrow:Ei,LucideArrowDownZA:zi,LucideArrowDownZa:zi,LucideArrowLeft:J1,LucideArrowLeftCircle:Ac,LucideArrowLeftFromLine:zx,LucideArrowLeftRight:Fx,LucideArrowLeftSquare:rd,LucideArrowLeftToLine:Rx,LucideArrowRight:Fr,LucideArrowRightCircle:fc,LucideArrowRightFromLine:Hx,LucideArrowRightLeft:qx,LucideArrowRightSquare:dd,LucideArrowRightToLine:Dx,LucideArrowUp:eu,LucideArrowUp01:Vx,LucideArrowUp10:Xx,LucideArrowUpAZ:Fi,LucideArrowUpAz:Fi,LucideArrowUpCircle:za,LucideArrowUpDown:Zx,LucideArrowUpFromDot:Gx,LucideArrowUpFromLine:Wx,LucideArrowUpLeft:Kx,LucideArrowUpLeftFromCircle:pc,LucideArrowUpLeftFromSquare:ld,LucideArrowUpLeftSquare:Ad,LucideArrowUpNarrowWide:Ri,LucideArrowUpRight:c0,LucideArrowUpRightFromCircle:xc,LucideArrowUpRightFromSquare:cd,LucideArrowUpRightSquare:ud,LucideArrowUpSquare:hd,LucideArrowUpToLine:Yx,LucideArrowUpWideNarrow:Jx,LucideArrowUpZA:Hi,LucideArrowUpZa:Hi,LucideArrowsUpFromLine:em,LucideAsterisk:tm,LucideAsteriskSquare:pd,LucideAtSign:am,LucideAtom:nm,LucideAudioLines:sm,LucideAudioWaveform:rm,LucideAward:om,LucideAxe:im,LucideAxis3D:qi,LucideAxis3d:qi,LucideBaby:cm,LucideBackpack:lm,LucideBadge:jm,LucideBadgeAlert:dm,LucideBadgeCent:Am,LucideBadgeCheck:Di,LucideBadgeDollarSign:um,LucideBadgeEuro:hm,LucideBadgeHelp:Vi,LucideBadgeIndianRupee:pm,LucideBadgeInfo:fm,LucideBadgeJapaneseYen:xm,LucideBadgeMinus:mm,LucideBadgePercent:gm,LucideBadgePlus:ym,LucideBadgePoundSterling:vm,LucideBadgeQuestionMark:Vi,LucideBadgeRussianRuble:km,LucideBadgeSwissFranc:Om,LucideBadgeTurkishLira:bm,LucideBadgeX:wm,LucideBaggageClaim:Cm,LucideBalloon:Nm,LucideBan:Mm,LucideBanana:Sm,LucideBandage:Qm,LucideBanknote:Tm,LucideBanknoteArrowDown:Bm,LucideBanknoteArrowUp:_m,LucideBanknoteX:Lm,LucideBarChart:rc,LucideBarChart2:oc,LucideBarChart3:hs,LucideBarChart4:nc,LucideBarChartBig:ac,LucideBarChartHorizontal:ec,LucideBarChartHorizontalBig:Ji,LucideBarcode:$m,LucideBarrel:Im,LucideBaseline:Um,LucideBath:Pm,LucideBattery:Dm,LucideBatteryCharging:Em,LucideBatteryFull:zm,LucideBatteryLow:Fm,LucideBatteryMedium:Rm,LucideBatteryPlus:Hm,LucideBatteryWarning:qm,LucideBeaker:Vm,LucideBean:Zm,LucideBeanOff:Xm,LucideBed:Km,LucideBedDouble:Gm,LucideBedSingle:Wm,LucideBeef:Jm,LucideBeefOff:Ym,LucideBeer:tg,LucideBeerOff:eg,LucideBell:lg,LucideBellCheck:ag,LucideBellDot:ng,LucideBellElectric:sg,LucideBellMinus:rg,LucideBellOff:og,LucideBellPlus:ig,LucideBellRing:cg,LucideBetweenHorizonalEnd:Xi,LucideBetweenHorizonalStart:Zi,LucideBetweenHorizontalEnd:Xi,LucideBetweenHorizontalStart:Zi,LucideBetweenVerticalEnd:dg,LucideBetweenVerticalStart:Ag,LucideBicepsFlexed:ug,LucideBike:hg,LucideBinary:pg,LucideBinoculars:fg,LucideBiohazard:xg,LucideBird:mg,LucideBirdhouse:gg,LucideBitcoin:yg,LucideBlend:vg,LucideBlinds:kg,LucideBlocks:Og,LucideBluetooth:Cg,LucideBluetoothConnected:bg,LucideBluetoothOff:wg,LucideBluetoothSearching:jg,LucideBold:Ng,LucideBolt:Mg,LucideBomb:l0,LucideBone:Sg,LucideBook:Jg,LucideBookA:Qg,LucideBookAlert:Bg,LucideBookAudio:_g,LucideBookCheck:Lg,LucideBookCopy:Tg,LucideBookDashed:Gi,LucideBookDown:$g,LucideBookHeadphones:Ig,LucideBookHeart:Ug,LucideBookImage:Pg,LucideBookKey:Eg,LucideBookLock:zg,LucideBookMarked:Fg,LucideBookMinus:Rg,LucideBookOpen:Go,LucideBookOpenCheck:Hg,LucideBookOpenText:qg,LucideBookPlus:Dg,LucideBookSearch:Vg,LucideBookTemplate:Gi,LucideBookText:Xg,LucideBookType:Zg,LucideBookUp:Wg,LucideBookUp2:Gg,LucideBookUser:Kg,LucideBookX:Yg,LucideBookmark:sy,LucideBookmarkCheck:d0,LucideBookmarkMinus:ey,LucideBookmarkOff:ty,LucideBookmarkPlus:ay,LucideBookmarkX:ny,LucideBoomBox:ry,LucideBot:Os,LucideBotMessageSquare:oy,LucideBotOff:iy,LucideBottleWine:cy,LucideBowArrow:ly,LucideBox:on,LucideBoxSelect:Nd,LucideBoxes:dy,LucideBraces:Wi,LucideBrackets:Ay,LucideBrain:A0,LucideBrainCircuit:uy,LucideBrainCog:hy,LucideBrickWall:xy,LucideBrickWallFire:py,LucideBrickWallShield:fy,LucideBriefcase:vy,LucideBriefcaseBusiness:my,LucideBriefcaseConveyorBelt:gy,LucideBriefcaseMedical:yy,LucideBringToFront:ky,LucideBrush:by,LucideBrushCleaning:Oy,LucideBubbles:wy,LucideBug:Ny,LucideBugOff:jy,LucideBugPlay:Cy,LucideBuilding:My,LucideBuilding2:Sy,LucideBus:By,LucideBusFront:Qy,LucideCable:_y,LucideCableCar:Ly,LucideCake:$y,LucideCakeSlice:Ty,LucideCalculator:tu,LucideCalendar:Wo,LucideCalendar1:Iy,LucideCalendarArrowDown:Uy,LucideCalendarArrowUp:Py,LucideCalendarCheck:zy,LucideCalendarCheck2:Ey,LucideCalendarClock:Fy,LucideCalendarCog:Ry,LucideCalendarDays:Hy,LucideCalendarFold:qy,LucideCalendarHeart:Dy,LucideCalendarMinus:Xy,LucideCalendarMinus2:Vy,LucideCalendarOff:Zy,LucideCalendarPlus:Wy,LucideCalendarPlus2:Gy,LucideCalendarRange:Ky,LucideCalendarSearch:Yy,LucideCalendarSync:Jy,LucideCalendarX:tv,LucideCalendarX2:ev,LucideCalendars:av,LucideCamera:au,LucideCameraOff:nv,LucideCandlestickChart:tc,LucideCandy:ov,LucideCandyCane:sv,LucideCandyOff:rv,LucideCannabis:cv,LucideCannabisOff:iv,LucideCaptions:Ki,LucideCaptionsOff:lv,LucideCar:uv,LucideCarFront:dv,LucideCarTaxiFront:Av,LucideCaravan:hv,LucideCardSim:pv,LucideCarrot:fv,LucideCaseLower:xv,LucideCaseSensitive:mv,LucideCaseUpper:gv,LucideCassetteTape:yv,LucideCast:vv,LucideCastle:kv,LucideCat:Ov,LucideCctv:wv,LucideCctvOff:bv,LucideChartArea:Yi,LucideChartBar:ec,LucideChartBarBig:Ji,LucideChartBarDecreasing:jv,LucideChartBarIncreasing:Cv,LucideChartBarStacked:Nv,LucideChartCandlestick:tc,LucideChartColumn:hs,LucideChartColumnBig:ac,LucideChartColumnDecreasing:Mv,LucideChartColumnIncreasing:nc,LucideChartColumnStacked:Sv,LucideChartGantt:Qv,LucideChartLine:sc,LucideChartNetwork:Bv,LucideChartNoAxesColumn:oc,LucideChartNoAxesColumnDecreasing:_v,LucideChartNoAxesColumnIncreasing:rc,LucideChartNoAxesCombined:Lv,LucideChartNoAxesGantt:ic,LucideChartPie:cc,LucideChartScatter:lc,LucideChartSpline:nu,LucideCheck:De,LucideCheckCheck:Tv,LucideCheckCircle:Sa,LucideCheckCircle2:Hn,LucideCheckLine:$v,LucideCheckSquare:md,LucideCheckSquare2:yd,LucideChefHat:Iv,LucideCherry:Uv,LucideChessBishop:Pv,LucideChessKing:Ev,LucideChessKnight:zv,LucideChessPawn:Fv,LucideChessQueen:Rv,LucideChessRook:Hv,LucideChevronDown:bt,LucideChevronDownCircle:mc,LucideChevronDownSquare:vd,LucideChevronFirst:qv,LucideChevronLast:Dv,LucideChevronLeft:bs,LucideChevronLeftCircle:gc,LucideChevronLeftSquare:kd,LucideChevronRight:Rt,LucideChevronRightCircle:yc,LucideChevronRightSquare:Od,LucideChevronUp:su,LucideChevronUpCircle:vc,LucideChevronUpSquare:wd,LucideChevronsDown:Vv,LucideChevronsDownUp:ru,LucideChevronsLeft:Gv,LucideChevronsLeftRight:Zv,LucideChevronsLeftRightEllipsis:Xv,LucideChevronsRight:Kv,LucideChevronsRightLeft:Wv,LucideChevronsUp:Jv,LucideChevronsUpDown:Yv,LucideChurch:ek,LucideCigarette:ak,LucideCigaretteOff:tk,LucideCircle:mk,LucideCircleAlert:Xt,LucideCircleArrowDown:dc,LucideCircleArrowLeft:Ac,LucideCircleArrowOutDownLeft:hc,LucideCircleArrowOutDownRight:uc,LucideCircleArrowOutUpLeft:pc,LucideCircleArrowOutUpRight:xc,LucideCircleArrowRight:fc,LucideCircleArrowUp:za,LucideCircleCheck:Hn,LucideCircleCheckBig:Sa,LucideCircleChevronDown:mc,LucideCircleChevronLeft:gc,LucideCircleChevronRight:yc,LucideCircleChevronUp:vc,LucideCircleDashed:nk,LucideCircleDivide:kc,LucideCircleDollarSign:sk,LucideCircleDot:ok,LucideCircleDotDashed:rk,LucideCircleEllipsis:ik,LucideCircleEqual:ck,LucideCircleFadingArrowUp:lk,LucideCircleFadingPlus:dk,LucideCircleGauge:Oc,LucideCircleHelp:Na,LucideCircleMinus:bc,LucideCircleOff:Ak,LucideCircleParking:jc,LucideCircleParkingOff:wc,LucideCirclePause:Cc,LucideCirclePercent:Nc,LucideCirclePile:uk,LucideCirclePlay:Mc,LucideCirclePlus:Sc,LucideCirclePoundSterling:hk,LucideCirclePower:Qc,LucideCircleQuestionMark:Na,LucideCircleSlash:pk,LucideCircleSlash2:Bc,LucideCircleSlashed:Bc,LucideCircleSmall:fk,LucideCircleStar:xk,LucideCircleStop:_c,LucideCircleUser:Tc,LucideCircleUserRound:Lc,LucideCircleX:qn,LucideCircuitBoard:gk,LucideCitrus:vk,LucideClapperboard:yk,LucideClipboard:Sk,LucideClipboardCheck:u0,LucideClipboardClock:kk,LucideClipboardCopy:Ok,LucideClipboardEdit:Ic,LucideClipboardList:bk,LucideClipboardMinus:wk,LucideClipboardPaste:jk,LucideClipboardPen:Ic,LucideClipboardPenLine:$c,LucideClipboardPlus:Ck,LucideClipboardSignature:$c,LucideClipboardType:Nk,LucideClipboardX:Mk,LucideClock:Rr,LucideClock1:Qk,LucideClock10:Bk,LucideClock11:_k,LucideClock12:Lk,LucideClock2:Tk,LucideClock3:$k,LucideClock4:Ik,LucideClock5:Uk,LucideClock6:Pk,LucideClock7:Ek,LucideClock8:zk,LucideClock9:Fk,LucideClockAlert:Rk,LucideClockArrowDown:Hk,LucideClockArrowUp:qk,LucideClockCheck:Dk,LucideClockFading:Vk,LucideClockPlus:Xk,LucideClosedCaption:Zk,LucideCloud:NA,LucideCloudAlert:Gk,LucideCloudBackup:Wk,LucideCloudCheck:Kk,LucideCloudCog:Yk,LucideCloudDownload:Uc,LucideCloudDrizzle:Jk,LucideCloudFog:eO,LucideCloudHail:tO,LucideCloudLightning:aO,LucideCloudMoon:sO,LucideCloudMoonRain:nO,LucideCloudOff:rO,LucideCloudRain:iO,LucideCloudRainWind:oO,LucideCloudSnow:cO,LucideCloudSun:dO,LucideCloudSunRain:lO,LucideCloudSync:AO,LucideCloudUpload:Pc,LucideCloudy:uO,LucideClover:hO,LucideClub:pO,LucideCode:fO,LucideCode2:Zt,LucideCodeSquare:bd,LucideCodeXml:Zt,LucideCoffee:xO,LucideCog:mO,LucideCoins:gO,LucideColumns:Ec,LucideColumns2:Ec,LucideColumns3:zc,LucideColumns3Cog:Es,LucideColumns4:yO,LucideColumnsSettings:Es,LucideCombine:vO,LucideCommand:kO,LucideCompass:OO,LucideComponent:bO,LucideComputer:wO,LucideConciergeBell:jO,LucideCone:NO,LucideConstruction:CO,LucideContact:MO,LucideContact2:Fc,LucideContactRound:Fc,LucideContainer:SO,LucideContrast:QO,LucideCookie:BO,LucideCookingPot:_O,LucideCopy:wn,LucideCopyCheck:LO,LucideCopyMinus:TO,LucideCopyPlus:$O,LucideCopySlash:IO,LucideCopyX:UO,LucideCopyleft:PO,LucideCopyright:EO,LucideCornerDownLeft:zO,LucideCornerDownRight:FO,LucideCornerLeftDown:RO,LucideCornerLeftUp:qO,LucideCornerRightDown:HO,LucideCornerRightUp:DO,LucideCornerUpLeft:VO,LucideCornerUpRight:XO,LucideCpu:Ba,LucideCreativeCommons:ZO,LucideCreditCard:GO,LucideCroissant:WO,LucideCrop:KO,LucideCross:YO,LucideCrosshair:JO,LucideCrown:e4,LucideCuboid:t4,LucideCupSoda:a4,LucideCurlyBraces:Wi,LucideCurrency:n4,LucideCylinder:s4,LucideDam:r4,LucideDatabase:MA,LucideDatabaseBackup:o4,LucideDatabaseSearch:i4,LucideDatabaseZap:c4,LucideDecimalsArrowLeft:l4,LucideDecimalsArrowRight:d4,LucideDelete:A4,LucideDessert:u4,LucideDiameter:h4,LucideDiamond:x4,LucideDiamondMinus:p4,LucideDiamondPercent:Rc,LucideDiamondPlus:f4,LucideDice1:m4,LucideDice2:g4,LucideDice3:y4,LucideDice4:v4,LucideDice5:k4,LucideDice6:O4,LucideDices:b4,LucideDiff:w4,LucideDisc:N4,LucideDisc2:j4,LucideDisc3:M4,LucideDiscAlbum:C4,LucideDivide:S4,LucideDivideCircle:kc,LucideDivideSquare:Md,LucideDna:B4,LucideDnaOff:Q4,LucideDock:_4,LucideDog:L4,LucideDollarSign:h0,LucideDonut:T4,LucideDoorClosed:I4,LucideDoorClosedLocked:$4,LucideDoorOpen:U4,LucideDot:P4,LucideDotSquare:Sd,LucideDownload:_a,LucideDownloadCloud:Uc,LucideDraftingCompass:E4,LucideDrama:z4,LucideDrill:F4,LucideDrone:R4,LucideDroplet:q4,LucideDropletOff:H4,LucideDroplets:D4,LucideDrum:V4,LucideDrumstick:X4,LucideDumbbell:Z4,LucideEar:W4,LucideEarOff:G4,LucideEarth:Hc,LucideEarthLock:K4,LucideEclipse:Y4,LucideEdit:sn,LucideEdit2:Lr,LucideEdit3:Eo,LucideEgg:t5,LucideEggFried:J4,LucideEggOff:e5,LucideEllipse:a5,LucideEllipsis:Uo,LucideEllipsisVertical:qc,LucideEqual:r5,LucideEqualApproximately:n5,LucideEqualNot:s5,LucideEqualSquare:Qd,LucideEraser:o5,LucideEthernetPort:i5,LucideEuro:c5,LucideEvCharger:l5,LucideExpand:d5,LucideExternalLink:ma,LucideEye:na,LucideEyeClosed:A5,LucideEyeOff:jn,LucideFactory:u5,LucideFan:h5,LucideFastForward:p5,LucideFeather:f5,LucideFence:x5,LucideFerrisWheel:m5,LucideFile:iu,LucideFileArchive:g5,LucideFileAudio:zs,LucideFileAudio2:zs,LucideFileAxis3D:Dc,LucideFileAxis3d:Dc,LucideFileBadge:Vc,LucideFileBadge2:Vc,LucideFileBarChart:Zc,LucideFileBarChart2:Wc,LucideFileBox:y5,LucideFileBraces:Gc,LucideFileBracesCorner:Xc,LucideFileChartColumn:Wc,LucideFileChartColumnIncreasing:Zc,LucideFileChartLine:Kc,LucideFileChartPie:Yc,LucideFileCheck:v5,LucideFileCheck2:Jc,LucideFileCheckCorner:Jc,LucideFileClock:k5,LucideFileCode:ou,LucideFileCode2:el,LucideFileCodeCorner:el,LucideFileCog:tl,LucideFileCog2:tl,LucideFileDiff:O5,LucideFileDigit:b5,LucideFileDown:w5,LucideFileEdit:ps,LucideFileExclamationPoint:al,LucideFileHeadphone:zs,LucideFileHeart:j5,LucideFileImage:C5,LucideFileInput:N5,LucideFileJson:Gc,LucideFileJson2:Xc,LucideFileKey:nl,LucideFileKey2:nl,LucideFileLineChart:Kc,LucideFileLock:sl,LucideFileLock2:sl,LucideFileMinus:S5,LucideFileMinus2:rl,LucideFileMinusCorner:rl,LucideFileMusic:M5,LucideFileOutput:Q5,LucideFilePen:ps,LucideFilePenLine:ol,LucideFilePieChart:Yc,LucideFilePlay:il,LucideFilePlus:Hr,LucideFilePlus2:cl,LucideFilePlusCorner:cl,LucideFileQuestion:ll,LucideFileQuestionMark:ll,LucideFileScan:B5,LucideFileSearch:_5,LucideFileSearch2:dl,LucideFileSearchCorner:dl,LucideFileSignal:Al,LucideFileSignature:ol,LucideFileSliders:L5,LucideFileSpreadsheet:T5,LucideFileStack:$5,LucideFileSymlink:I5,LucideFileTerminal:U5,LucideFileText:Va,LucideFileType:P5,LucideFileType2:ul,LucideFileTypeCorner:ul,LucideFileUp:E5,LucideFileUser:z5,LucideFileVideo:il,LucideFileVideo2:hl,LucideFileVideoCamera:hl,LucideFileVolume:F5,LucideFileVolume2:Al,LucideFileWarning:al,LucideFileX:R5,LucideFileX2:pl,LucideFileXCorner:pl,LucideFiles:H5,LucideFilm:q5,LucideFilter:yl,LucideFilterX:gl,LucideFingerprint:fl,LucideFingerprintPattern:fl,LucideFireExtinguisher:D5,LucideFish:W5,LucideFishOff:V5,LucideFishSymbol:X5,LucideFishingHook:Z5,LucideFishingRod:G5,LucideFlag:eb,LucideFlagOff:K5,LucideFlagTriangleLeft:Y5,LucideFlagTriangleRight:J5,LucideFlame:p0,LucideFlameKindling:tb,LucideFlashlight:nb,LucideFlashlightOff:ab,LucideFlaskConical:cu,LucideFlaskConicalOff:sb,LucideFlaskRound:rb,LucideFlipHorizontal:xd,LucideFlipHorizontal2:ob,LucideFlipVertical:gd,LucideFlipVertical2:ib,LucideFlower:lb,LucideFlower2:cb,LucideFocus:db,LucideFoldHorizontal:Ab,LucideFoldVertical:ub,LucideFolder:Ko,LucideFolderArchive:hb,LucideFolderCheck:pb,LucideFolderClock:fb,LucideFolderClosed:f0,LucideFolderCode:xb,LucideFolderCog:xl,LucideFolderCog2:xl,LucideFolderDot:mb,LucideFolderDown:gb,LucideFolderEdit:ml,LucideFolderGit:vb,LucideFolderGit2:yb,LucideFolderHeart:kb,LucideFolderInput:Ob,LucideFolderKanban:bb,LucideFolderKey:wb,LucideFolderLock:jb,LucideFolderMinus:Cb,LucideFolderOpen:ga,LucideFolderOpenDot:Nb,LucideFolderOutput:Mb,LucideFolderPen:ml,LucideFolderPlus:qr,LucideFolderRoot:Sb,LucideFolderSearch:SA,LucideFolderSearch2:Qb,LucideFolderSymlink:Bb,LucideFolderSync:_b,LucideFolderTree:Lb,LucideFolderUp:Tb,LucideFolderX:$b,LucideFolders:Ib,LucideFootprints:Ub,LucideForkKnife:yA,LucideForkKnifeCrossed:gA,LucideForklift:Pb,LucideForm:Eb,LucideFormInput:Xl,LucideForward:zb,LucideFrame:Fb,LucideFrown:Rb,LucideFuel:Hb,LucideFullscreen:qb,LucideFunctionSquare:Bd,LucideFunnel:yl,LucideFunnelPlus:Db,LucideFunnelX:gl,LucideGalleryHorizontal:Vb,LucideGalleryHorizontalEnd:Xb,LucideGalleryThumbnails:Zb,LucideGalleryVertical:Wb,LucideGalleryVerticalEnd:Gb,LucideGamepad:Kb,LucideGamepad2:QA,LucideGamepadDirectional:Yb,LucideGanttChart:ic,LucideGanttChartSquare:qs,LucideGauge:x0,LucideGaugeCircle:Oc,LucideGavel:Jb,LucideGem:e3,LucideGeorgianLari:t3,LucideGhost:a3,LucideGift:m0,LucideGitBranch:Js,LucideGitBranchMinus:n3,LucideGitBranchPlus:s3,LucideGitCommit:vl,LucideGitCommitHorizontal:vl,LucideGitCommitVertical:r3,LucideGitCompare:o3,LucideGitCompareArrows:g0,LucideGitFork:i3,LucideGitGraph:c3,LucideGitMerge:d3,LucideGitMergeConflict:l3,LucideGitPullRequest:x3,LucideGitPullRequestArrow:A3,LucideGitPullRequestClosed:u3,LucideGitPullRequestCreate:p3,LucideGitPullRequestCreateArrow:h3,LucideGitPullRequestDraft:f3,LucideGlassWater:m3,LucideGlasses:g3,LucideGlobe:sa,LucideGlobe2:Hc,LucideGlobeLock:y3,LucideGlobeOff:v3,LucideGlobeX:k3,LucideGoal:O3,LucideGpu:b3,LucideGrab:jl,LucideGraduationCap:w3,LucideGrape:j3,LucideGrid:Fs,LucideGrid2X2:wl,LucideGrid2X2Check:kl,LucideGrid2X2Plus:Ol,LucideGrid2X2X:bl,LucideGrid2x2:wl,LucideGrid2x2Check:kl,LucideGrid2x2Plus:Ol,LucideGrid2x2X:bl,LucideGrid3X3:Fs,LucideGrid3x2:C3,LucideGrid3x3:Fs,LucideGrip:N3,LucideGripHorizontal:lu,LucideGripVertical:y0,LucideGroup:M3,LucideGuitar:Q3,LucideHam:S3,LucideHamburger:B3,LucideHammer:_3,LucideHand:P3,LucideHandCoins:L3,LucideHandFist:T3,LucideHandGrab:jl,LucideHandHeart:$3,LucideHandHelping:Cl,LucideHandMetal:I3,LucideHandPlatter:U3,LucideHandbag:E3,LucideHandshake:z3,LucideHardDrive:Kn,LucideHardDriveDownload:F3,LucideHardDriveUpload:R3,LucideHardHat:H3,LucideHash:du,LucideHatGlasses:D3,LucideHaze:q3,LucideHd:V3,LucideHdmiPort:X3,LucideHeading:J3,LucideHeading1:G3,LucideHeading2:Z3,LucideHeading3:W3,LucideHeading4:K3,LucideHeading5:Y3,LucideHeading6:ew,LucideHeadphoneOff:tw,LucideHeadphones:Au,LucideHeadset:aw,LucideHeart:v0,LucideHeartCrack:nw,LucideHeartHandshake:sw,LucideHeartMinus:rw,LucideHeartOff:ow,LucideHeartPlus:iw,LucideHeartPulse:cw,LucideHeartX:lw,LucideHeater:dw,LucideHelicopter:Aw,LucideHelpCircle:Na,LucideHelpingHand:Cl,LucideHexagon:uw,LucideHighlighter:hw,LucideHistory:pw,LucideHome:Po,LucideHop:xw,LucideHopOff:fw,LucideHospital:mw,LucideHotel:gw,LucideHourglass:yw,LucideHouse:Po,LucideHouseHeart:vw,LucideHousePlug:kw,LucideHousePlus:Ow,LucideHouseWifi:bw,LucideIceCream:Ml,LucideIceCream2:Nl,LucideIceCreamBowl:Nl,LucideIceCreamCone:Ml,LucideIdCard:jw,LucideIdCardLanyard:ww,LucideImage:Zn,LucideImageDown:Cw,LucideImageMinus:Mw,LucideImageOff:Nw,LucideImagePlay:Sw,LucideImagePlus:Qw,LucideImageUp:Bw,LucideImageUpscale:_w,LucideImages:Lw,LucideImport:Tw,LucideInbox:$w,LucideIndent:Hs,LucideIndentDecrease:Rs,LucideIndentIncrease:Hs,LucideIndianRupee:Iw,LucideInfinity:Uw,LucideInfo:uu,LucideInspect:Id,LucideInspectionPanel:Pw,LucideItalic:Ew,LucideIterationCcw:zw,LucideIterationCw:Fw,LucideJapaneseYen:Rw,LucideJoystick:Hw,LucideKanban:qw,LucideKanbanSquare:_d,LucideKanbanSquareDashed:jd,LucideKayak:Dw,LucideKey:ws,LucideKeyRound:hu,LucideKeySquare:Vw,LucideKeyboard:Gw,LucideKeyboardMusic:Xw,LucideKeyboardOff:Zw,LucideLamp:t8,LucideLampCeiling:Kw,LucideLampDesk:Ww,LucideLampFloor:Yw,LucideLampWallDown:Jw,LucideLampWallUp:e8,LucideLandPlot:a8,LucideLandmark:n8,LucideLanguages:s8,LucideLaptop:o8,LucideLaptop2:Sl,LucideLaptopMinimal:Sl,LucideLaptopMinimalCheck:r8,LucideLasso:c8,LucideLassoSelect:i8,LucideLaugh:l8,LucideLayers:Dn,LucideLayers2:d8,LucideLayers3:Dn,LucideLayersMinus:A8,LucideLayersPlus:u8,LucideLayout:Vl,LucideLayoutDashboard:k0,LucideLayoutGrid:O0,LucideLayoutList:h8,LucideLayoutPanelLeft:p8,LucideLayoutPanelTop:f8,LucideLayoutTemplate:x8,LucideLeaf:m8,LucideLeafyGreen:g8,LucideLectern:y8,LucideLensConcave:v8,LucideLensConvex:O8,LucideLetterText:rA,LucideLibrary:b8,LucideLibraryBig:k8,LucideLibrarySquare:Ld,LucideLifeBuoy:j8,LucideLigature:w8,LucideLightbulb:N8,LucideLightbulbOff:C8,LucideLineChart:sc,LucideLineDotRightHorizontal:M8,LucideLineSquiggle:S8,LucideLineStyle:Q8,LucideLink:b0,LucideLink2:Yo,LucideLink2Off:B8,LucideList:G8,LucideListCheck:_8,LucideListChecks:w0,LucideListChevronsDownUp:L8,LucideListChevronsUpDown:$8,LucideListCollapse:T8,LucideListEnd:I8,LucideListFilter:P8,LucideListFilterPlus:U8,LucideListIndentDecrease:Rs,LucideListIndentIncrease:Hs,LucideListMinus:E8,LucideListMusic:z8,LucideListOrdered:F8,LucideListPlus:R8,LucideListRestart:H8,LucideListStart:q8,LucideListTodo:D8,LucideListTree:X8,LucideListVideo:V8,LucideListX:Z8,LucideLoader:K8,LucideLoader2:$e,LucideLoaderCircle:$e,LucideLoaderPinwheel:W8,LucideLocate:e6,LucideLocateFixed:Y8,LucideLocateOff:J8,LucideLocationEdit:Ll,LucideLock:j0,LucideLockKeyhole:t6,LucideLockKeyholeOpen:Ql,LucideLockOpen:Bl,LucideLogIn:pu,LucideLogOut:C0,LucideLogs:a6,LucideLollipop:n6,LucideLuggage:s6,LucideMSquare:Td,LucideMagnet:r6,LucideMail:h6,LucideMailCheck:o6,LucideMailMinus:i6,LucideMailOpen:c6,LucideMailPlus:l6,LucideMailQuestion:_l,LucideMailQuestionMark:_l,LucideMailSearch:d6,LucideMailWarning:A6,LucideMailX:u6,LucideMailbox:p6,LucideMails:f6,LucideMap:N0,LucideMapMinus:m6,LucideMapPin:S6,LucideMapPinCheck:g6,LucideMapPinCheckInside:x6,LucideMapPinHouse:y6,LucideMapPinMinus:k6,LucideMapPinMinusInside:v6,LucideMapPinOff:O6,LucideMapPinPen:Ll,LucideMapPinPlus:w6,LucideMapPinPlusInside:b6,LucideMapPinSearch:j6,LucideMapPinX:N6,LucideMapPinXInside:C6,LucideMapPinned:M6,LucideMapPlus:Q6,LucideMars:_6,LucideMarsStroke:B6,LucideMartini:L6,LucideMaximize:T6,LucideMaximize2:BA,LucideMedal:$6,LucideMegaphone:_A,LucideMegaphoneOff:I6,LucideMeh:U6,LucideMemoryStick:M0,LucideMenu:P6,LucideMenuSquare:$d,LucideMerge:E6,LucideMessageCircle:Yn,LucideMessageCircleCheck:z6,LucideMessageCircleCode:F6,LucideMessageCircleDashed:R6,LucideMessageCircleHeart:H6,LucideMessageCircleMore:q6,LucideMessageCircleOff:D6,LucideMessageCirclePlus:V6,LucideMessageCircleQuestion:Tl,LucideMessageCircleQuestionMark:Tl,LucideMessageCircleReply:X6,LucideMessageCircleWarning:Z6,LucideMessageCircleX:G6,LucideMessageSquare:Cn,LucideMessageSquareCheck:W6,LucideMessageSquareCode:K6,LucideMessageSquareDashed:Y6,LucideMessageSquareDiff:J6,LucideMessageSquareDot:tj,LucideMessageSquareHeart:aj,LucideMessageSquareLock:ej,LucideMessageSquareMore:nj,LucideMessageSquareOff:sj,LucideMessageSquarePlus:rj,LucideMessageSquareQuote:oj,LucideMessageSquareReply:ij,LucideMessageSquareShare:cj,LucideMessageSquareText:lj,LucideMessageSquareWarning:dj,LucideMessageSquareX:Aj,LucideMessagesSquare:uj,LucideMetronome:hj,LucideMic:fj,LucideMic2:$l,LucideMicOff:pj,LucideMicVocal:$l,LucideMicrochip:xj,LucideMicroscope:mj,LucideMicrowave:yj,LucideMilestone:gj,LucideMilk:kj,LucideMilkOff:vj,LucideMinimize:Oj,LucideMinimize2:S0,LucideMinus:bj,LucideMinusCircle:bc,LucideMinusSquare:Ud,LucideMirrorRectangular:wj,LucideMirrorRound:jj,LucideMonitor:Dr,LucideMonitorCheck:Cj,LucideMonitorCloud:Nj,LucideMonitorCog:Mj,LucideMonitorDot:Sj,LucideMonitorDown:Qj,LucideMonitorOff:Bj,LucideMonitorPause:_j,LucideMonitorPlay:Lj,LucideMonitorSmartphone:Tj,LucideMonitorSpeaker:$j,LucideMonitorStop:Ij,LucideMonitorUp:Uj,LucideMonitorX:Q0,LucideMoon:Ej,LucideMoonStar:Pj,LucideMoreHorizontal:Uo,LucideMoreVertical:qc,LucideMotorbike:zj,LucideMountain:Rj,LucideMountainSnow:Fj,LucideMouse:Kj,LucideMouseLeft:Hj,LucideMouseOff:qj,LucideMousePointer:Gj,LucideMousePointer2:Vj,LucideMousePointer2Off:Dj,LucideMousePointerBan:Xj,LucideMousePointerClick:Zj,LucideMousePointerSquareDashed:Cd,LucideMouseRight:Wj,LucideMove:dC,LucideMove3D:Il,LucideMove3d:Il,LucideMoveDiagonal:Jj,LucideMoveDiagonal2:Yj,LucideMoveDown:aC,LucideMoveDownLeft:eC,LucideMoveDownRight:tC,LucideMoveHorizontal:nC,LucideMoveLeft:sC,LucideMoveRight:rC,LucideMoveUp:cC,LucideMoveUpLeft:oC,LucideMoveUpRight:iC,LucideMoveVertical:lC,LucideMusic:pC,LucideMusic2:AC,LucideMusic3:uC,LucideMusic4:hC,LucideNavigation:gC,LucideNavigation2:xC,LucideNavigation2Off:fC,LucideNavigationOff:mC,LucideNetwork:fu,LucideNewspaper:Jo,LucideNfc:yC,LucideNonBinary:vC,LucideNotebook:wC,LucideNotebookPen:kC,LucideNotebookTabs:OC,LucideNotebookText:bC,LucideNotepadText:CC,LucideNotepadTextDashed:jC,LucideNut:MC,LucideNutOff:NC,LucideOctagon:QC,LucideOctagonAlert:Ul,LucideOctagonMinus:SC,LucideOctagonPause:Pl,LucideOctagonX:El,LucideOmega:BC,LucideOption:_C,LucideOrbit:LC,LucideOrigami:TC,LucideOutdent:Rs,LucidePackage:xu,LucidePackage2:IC,LucidePackageCheck:$C,LucidePackageMinus:UC,LucidePackageOpen:PC,LucidePackagePlus:EC,LucidePackageSearch:zC,LucidePackageX:FC,LucidePaintBucket:RC,LucidePaintRoller:HC,LucidePaintbrush:qC,LucidePaintbrush2:zl,LucidePaintbrushVertical:zl,LucidePalette:DC,LucidePalmtree:cA,LucidePanda:VC,LucidePanelBottom:GC,LucidePanelBottomClose:XC,LucidePanelBottomDashed:Fl,LucidePanelBottomInactive:Fl,LucidePanelBottomOpen:ZC,LucidePanelLeft:Hl,LucidePanelLeftClose:fs,LucidePanelLeftDashed:Rl,LucidePanelLeftInactive:Rl,LucidePanelLeftOpen:xs,LucidePanelLeftRightDashed:WC,LucidePanelRight:KC,LucidePanelRightClose:B0,LucidePanelRightDashed:ql,LucidePanelRightInactive:ql,LucidePanelRightOpen:_0,LucidePanelTop:t7,LucidePanelTopBottomDashed:YC,LucidePanelTopClose:JC,LucidePanelTopDashed:Dl,LucidePanelTopInactive:Dl,LucidePanelTopOpen:e7,LucidePanelsLeftBottom:a7,LucidePanelsLeftRight:zc,LucidePanelsRightBottom:n7,LucidePanelsTopBottom:Wl,LucidePanelsTopLeft:Vl,LucidePaperclip:mu,LucideParentheses:s7,LucideParkingCircle:jc,LucideParkingCircleOff:wc,LucideParkingMeter:r7,LucideParkingSquare:Ed,LucideParkingSquareOff:Pd,LucidePartyPopper:o7,LucidePause:L0,LucidePauseCircle:Cc,LucidePauseOctagon:Pl,LucidePawPrint:i7,LucidePcCase:c7,LucidePen:Lr,LucidePenBox:sn,LucidePenLine:Eo,LucidePenOff:l7,LucidePenSquare:sn,LucidePenTool:d7,LucidePencil:js,LucidePencilLine:A7,LucidePencilOff:u7,LucidePencilRuler:h7,LucidePentagon:p7,LucidePercent:f7,LucidePercentCircle:Nc,LucidePercentDiamond:Rc,LucidePercentSquare:zd,LucidePersonStanding:x7,LucidePhilippinePeso:m7,LucidePhone:w7,LucidePhoneCall:g7,LucidePhoneForwarded:y7,LucidePhoneIncoming:v7,LucidePhoneMissed:k7,LucidePhoneOff:O7,LucidePhoneOutgoing:b7,LucidePi:j7,LucidePiSquare:Fd,LucidePiano:C7,LucidePickaxe:N7,LucidePictureInPicture:S7,LucidePictureInPicture2:M7,LucidePieChart:cc,LucidePiggyBank:Q7,LucidePilcrow:L7,LucidePilcrowLeft:B7,LucidePilcrowRight:_7,LucidePilcrowSquare:Rd,LucidePill:$7,LucidePillBottle:T7,LucidePin:LA,LucidePinOff:gu,LucidePipette:I7,LucidePizza:U7,LucidePlane:z7,LucidePlaneLanding:P7,LucidePlaneTakeoff:E7,LucidePlay:ei,LucidePlayCircle:Mc,LucidePlaySquare:Hd,LucidePlug:da,LucidePlug2:F7,LucidePlugZap:Tr,LucidePlugZap2:Tr,LucidePlus:ht,LucidePlusCircle:Sc,LucidePlusSquare:qd,LucidePocketKnife:H7,LucidePodcast:R7,LucidePointer:D7,LucidePointerOff:q7,LucidePopcorn:V7,LucidePopsicle:X7,LucidePoundSterling:Z7,LucidePower:W7,LucidePowerCircle:Qc,LucidePowerOff:G7,LucidePowerSquare:Dd,LucidePresentation:yu,LucidePrinter:J7,LucidePrinterCheck:K7,LucidePrinterX:Y7,LucideProjector:eN,LucideProportions:tN,LucideProvider:Soe,LucidePuzzle:vu,LucidePyramid:aN,LucideQrCode:nN,LucideQuote:sN,LucideRabbit:oN,LucideRadar:rN,LucideRadiation:iN,LucideRadical:cN,LucideRadio:Jn,LucideRadioOff:lN,LucideRadioReceiver:dN,LucideRadioTower:AN,LucideRadius:uN,LucideRainbow:hN,LucideRat:pN,LucideRatio:fN,LucideReceipt:jN,LucideReceiptCent:xN,LucideReceiptEuro:mN,LucideReceiptIndianRupee:gN,LucideReceiptJapaneseYen:yN,LucideReceiptPoundSterling:vN,LucideReceiptRussianRuble:kN,LucideReceiptSwissFranc:ON,LucideReceiptText:bN,LucideReceiptTurkishLira:wN,LucideRectangleCircle:CN,LucideRectangleEllipsis:Xl,LucideRectangleGoggles:NN,LucideRectangleHorizontal:MN,LucideRectangleVertical:QN,LucideRecycle:SN,LucideRedo:LN,LucideRedo2:BN,LucideRedoDot:_N,LucideRefreshCcw:$N,LucideRefreshCcwDot:TN,LucideRefreshCw:ra,LucideRefreshCwOff:IN,LucideRefrigerator:UN,LucideRegex:PN,LucideRemoveFormatting:EN,LucideRepeat:RN,LucideRepeat1:zN,LucideRepeat2:FN,LucideReplace:qN,LucideReplaceAll:HN,LucideReply:XN,LucideReplyAll:DN,LucideRewind:VN,LucideRibbon:ZN,LucideRoad:GN,LucideRocket:es,LucideRockingChair:WN,LucideRollerCoaster:KN,LucideRose:YN,LucideRotate3D:Zl,LucideRotate3d:Zl,LucideRotateCcw:Cs,LucideRotateCcwKey:JN,LucideRotateCcwSquare:eM,LucideRotateCw:Vr,LucideRotateCwSquare:tM,LucideRoute:aM,LucideRouteOff:nM,LucideRouter:sM,LucideRows:Gl,LucideRows2:Gl,LucideRows3:Wl,LucideRows4:rM,LucideRss:oM,LucideRuler:cM,LucideRulerDimensionLine:iM,LucideRussianRuble:lM,LucideSailboat:dM,LucideSalad:AM,LucideSandwich:uM,LucideSatellite:pM,LucideSatelliteDish:hM,LucideSaudiRiyal:fM,LucideSave:Xr,LucideSaveAll:xM,LucideSaveOff:mM,LucideScale:gM,LucideScale3D:Kl,LucideScale3d:Kl,LucideScaling:yM,LucideScan:MM,LucideScanBarcode:vM,LucideScanEye:kM,LucideScanFace:OM,LucideScanHeart:bM,LucideScanLine:wM,LucideScanQrCode:jM,LucideScanSearch:NM,LucideScanText:CM,LucideScatterChart:lc,LucideSchool:SM,LucideSchool2:dA,LucideScissors:QM,LucideScissorsLineDashed:BM,LucideScissorsSquare:Vd,LucideScissorsSquareDashedBottom:fd,LucideScooter:_M,LucideScreenShare:TM,LucideScreenShareOff:LM,LucideScroll:IM,LucideScrollText:$M,LucideSearch:oa,LucideSearchAlert:UM,LucideSearchCheck:PM,LucideSearchCode:EM,LucideSearchSlash:zM,LucideSearchX:FM,LucideSection:RM,LucideSend:Xa,LucideSendHorizonal:Yl,LucideSendHorizontal:Yl,LucideSendToBack:HM,LucideSeparatorHorizontal:qM,LucideSeparatorVertical:VM,LucideServer:aa,LucideServerCog:DM,LucideServerCrash:XM,LucideServerOff:ZM,LucideSettings:Zr,LucideSettings2:T0,LucideShapes:GM,LucideShare:WM,LucideShare2:$0,LucideSheet:KM,LucideShell:YM,LucideShelvingUnit:JM,LucideShield:La,LucideShieldAlert:tS,LucideShieldBan:eS,LucideShieldCheck:ku,LucideShieldClose:$r,LucideShieldCog:nS,LucideShieldCogCorner:aS,LucideShieldEllipsis:sS,LucideShieldHalf:oS,LucideShieldMinus:rS,LucideShieldOff:iS,LucideShieldPlus:cS,LucideShieldQuestion:Jl,LucideShieldQuestionMark:Jl,LucideShieldUser:lS,LucideShieldX:$r,LucideShip:AS,LucideShipWheel:dS,LucideShirt:uS,LucideShoppingBag:TA,LucideShoppingBasket:hS,LucideShoppingCart:pS,LucideShovel:fS,LucideShowerHead:mS,LucideShredder:xS,LucideShrimp:gS,LucideShrink:yS,LucideShrub:vS,LucideShuffle:kS,LucideSidebar:Hl,LucideSidebarClose:fs,LucideSidebarOpen:xs,LucideSigma:OS,LucideSigmaSquare:Xd,LucideSignal:NS,LucideSignalHigh:bS,LucideSignalLow:wS,LucideSignalMedium:jS,LucideSignalZero:CS,LucideSignature:MS,LucideSignpost:QS,LucideSignpostBig:SS,LucideSiren:_S,LucideSkipBack:BS,LucideSkipForward:LS,LucideSkull:$A,LucideSlash:$S,LucideSlashSquare:Zd,LucideSlice:TS,LucideSliders:ed,LucideSlidersHorizontal:IS,LucideSlidersVertical:ed,LucideSmartphone:I0,LucideSmartphoneCharging:US,LucideSmartphoneNfc:PS,LucideSmile:zS,LucideSmilePlus:ES,LucideSnail:FS,LucideSnowflake:RS,LucideSoapDispenserDroplet:HS,LucideSofa:qS,LucideSolarPanel:DS,LucideSortAsc:Ri,LucideSortDesc:Ei,LucideSoup:VS,LucideSpace:XS,LucideSpade:ZS,LucideSparkle:GS,LucideSparkles:It,LucideSpeaker:WS,LucideSpeech:KS,LucideSpellCheck:JS,LucideSpellCheck2:YS,LucideSpline:eQ,LucideSplinePointer:tQ,LucideSplit:aQ,LucideSplitSquareHorizontal:Gd,LucideSplitSquareVertical:Wd,LucideSpool:nQ,LucideSportShoe:sQ,LucideSpotlight:rQ,LucideSprayCan:oQ,LucideSprout:iQ,LucideSquare:Gr,LucideSquareActivity:td,LucideSquareArrowDown:nd,LucideSquareArrowDownLeft:ad,LucideSquareArrowDownRight:sd,LucideSquareArrowLeft:rd,LucideSquareArrowOutDownLeft:od,LucideSquareArrowOutDownRight:id,LucideSquareArrowOutUpLeft:ld,LucideSquareArrowOutUpRight:cd,LucideSquareArrowRight:dd,LucideSquareArrowRightEnter:cQ,LucideSquareArrowRightExit:lQ,LucideSquareArrowUp:hd,LucideSquareArrowUpLeft:Ad,LucideSquareArrowUpRight:ud,LucideSquareAsterisk:pd,LucideSquareBottomDashedScissors:fd,LucideSquareCenterlineDashedHorizontal:xd,LucideSquareCenterlineDashedVertical:gd,LucideSquareChartGantt:qs,LucideSquareCheck:yd,LucideSquareCheckBig:md,LucideSquareChevronDown:vd,LucideSquareChevronLeft:kd,LucideSquareChevronRight:Od,LucideSquareChevronUp:wd,LucideSquareCode:bd,LucideSquareDashed:Nd,LucideSquareDashedBottom:AQ,LucideSquareDashedBottomCode:dQ,LucideSquareDashedKanban:jd,LucideSquareDashedMousePointer:Cd,LucideSquareDashedText:Ds,LucideSquareDashedTopSolid:uQ,LucideSquareDivide:Md,LucideSquareDot:Sd,LucideSquareEqual:Qd,LucideSquareFunction:Bd,LucideSquareGanttChart:qs,LucideSquareKanban:_d,LucideSquareLibrary:Ld,LucideSquareM:Td,LucideSquareMenu:$d,LucideSquareMinus:Ud,LucideSquareMousePointer:Id,LucideSquareParking:Ed,LucideSquareParkingOff:Pd,LucideSquarePause:hQ,LucideSquarePen:sn,LucideSquarePercent:zd,LucideSquarePi:Fd,LucideSquarePilcrow:Rd,LucideSquarePlay:Hd,LucideSquarePlus:qd,LucideSquarePower:Dd,LucideSquareRadical:pQ,LucideSquareRoundCorner:fQ,LucideSquareScissors:Vd,LucideSquareSigma:Xd,LucideSquareSlash:Zd,LucideSquareSplitHorizontal:Gd,LucideSquareSplitVertical:Wd,LucideSquareSquare:xQ,LucideSquareStack:mQ,LucideSquareStar:gQ,LucideSquareStop:yQ,LucideSquareTerminal:Yd,LucideSquareUser:Jd,LucideSquareUserRound:Kd,LucideSquareX:eA,LucideSquaresExclude:vQ,LucideSquaresIntersect:kQ,LucideSquaresSubtract:OQ,LucideSquaresUnite:bQ,LucideSquircle:jQ,LucideSquircleDashed:wQ,LucideSquirrel:CQ,LucideStamp:NQ,LucideStar:IA,LucideStarHalf:MQ,LucideStarOff:SQ,LucideStars:It,LucideStepBack:QQ,LucideStepForward:BQ,LucideStethoscope:_Q,LucideSticker:LQ,LucideStickyNote:TQ,LucideStone:$Q,LucideStopCircle:_c,LucideStore:IQ,LucideStretchHorizontal:UQ,LucideStretchVertical:PQ,LucideStrikethrough:EQ,LucideSubscript:zQ,LucideSubtitles:Ki,LucideSun:DQ,LucideSunDim:FQ,LucideSunMedium:RQ,LucideSunMoon:HQ,LucideSunSnow:qQ,LucideSunrise:VQ,LucideSunset:XQ,LucideSuperscript:ZQ,LucideSwatchBook:GQ,LucideSwissFranc:WQ,LucideSwitchCamera:KQ,LucideSword:YQ,LucideSwords:JQ,LucideSyringe:eB,LucideTable:cB,LucideTable2:tB,LucideTableCellsMerge:aB,LucideTableCellsSplit:nB,LucideTableColumnsSplit:sB,LucideTableConfig:Es,LucideTableOfContents:rB,LucideTableProperties:oB,LucideTableRowsSplit:iB,LucideTablet:U0,LucideTabletSmartphone:lB,LucideTablets:dB,LucideTag:AB,LucideTags:uB,LucideTally1:hB,LucideTally2:pB,LucideTally3:fB,LucideTally4:xB,LucideTally5:mB,LucideTangent:gB,LucideTarget:yB,LucideTelescope:vB,LucideTent:OB,LucideTentTree:kB,LucideTerminal:Ns,LucideTerminalSquare:Yd,LucideTestTube:ti,LucideTestTube2:tA,LucideTestTubeDiagonal:tA,LucideTestTubes:bB,LucideText:Vs,LucideTextAlignCenter:aA,LucideTextAlignEnd:sA,LucideTextAlignJustify:nA,LucideTextAlignStart:Vs,LucideTextCursor:jB,LucideTextCursorInput:wB,LucideTextInitial:rA,LucideTextQuote:CB,LucideTextSearch:NB,LucideTextSelect:Ds,LucideTextSelection:Ds,LucideTextWrap:oA,LucideTheater:MB,LucideThermometer:BB,LucideThermometerSnowflake:SB,LucideThermometerSun:QB,LucideThumbsDown:_B,LucideThumbsUp:LB,LucideTicket:zB,LucideTicketCheck:TB,LucideTicketMinus:$B,LucideTicketPercent:IB,LucideTicketPlus:UB,LucideTicketSlash:PB,LucideTicketX:EB,LucideTickets:RB,LucideTicketsPlane:FB,LucideTimeline:HB,LucideTimer:P0,LucideTimerOff:qB,LucideTimerReset:DB,LucideToggleLeft:VB,LucideToggleRight:XB,LucideToilet:ZB,LucideToolCase:GB,LucideToolbox:WB,LucideTornado:KB,LucideTorus:YB,LucideTouchpad:e9,LucideTouchpadOff:JB,LucideTowelRack:t9,LucideTowerControl:a9,LucideToyBrick:r9,LucideTractor:n9,LucideTrafficCone:s9,LucideTrain:iA,LucideTrainFront:c9,LucideTrainFrontTunnel:o9,LucideTrainTrack:i9,LucideTramFront:iA,LucideTransgender:l9,LucideTrash:d9,LucideTrash2:At,LucideTreeDeciduous:A9,LucideTreePalm:cA,LucideTreePine:u9,LucideTrees:h9,LucideTrendingDown:p9,LucideTrendingUp:x9,LucideTrendingUpDown:f9,LucideTriangle:y9,LucideTriangleAlert:Gt,LucideTriangleDashed:m9,LucideTriangleRight:g9,LucideTrophy:v9,LucideTruck:O9,LucideTruckElectric:k9,LucideTurkishLira:b9,LucideTurntable:w9,LucideTurtle:j9,LucideTv:N9,LucideTv2:lA,LucideTvMinimal:lA,LucideTvMinimalPlay:C9,LucideType:M9,LucideTypeOutline:S9,LucideUmbrella:_9,LucideUmbrellaOff:B9,LucideUnderline:Q9,LucideUndo:$9,LucideUndo2:L9,LucideUndoDot:T9,LucideUnfoldHorizontal:I9,LucideUnfoldVertical:U9,LucideUngroup:P9,LucideUniversity:dA,LucideUnlink:z9,LucideUnlink2:E9,LucideUnlock:Bl,LucideUnlockKeyhole:Ql,LucideUnplug:ai,LucideUpload:E0,LucideUploadCloud:Pc,LucideUsb:F9,LucideUser:z0,LucideUser2:xA,LucideUserCheck:Ou,LucideUserCheck2:AA,LucideUserCircle:Tc,LucideUserCircle2:Lc,LucideUserCog:R9,LucideUserCog2:uA,LucideUserKey:H9,LucideUserLock:q9,LucideUserMinus:D9,LucideUserMinus2:hA,LucideUserPen:V9,LucideUserPlus:bu,LucideUserPlus2:pA,LucideUserRound:xA,LucideUserRoundCheck:AA,LucideUserRoundCog:uA,LucideUserRoundKey:X9,LucideUserRoundMinus:hA,LucideUserRoundPen:Z9,LucideUserRoundPlus:pA,LucideUserRoundSearch:G9,LucideUserRoundX:fA,LucideUserSearch:W9,LucideUserSquare:Jd,LucideUserSquare2:Kd,LucideUserStar:K9,LucideUserX:Y9,LucideUserX2:fA,LucideUsers:Fa,LucideUsers2:mA,LucideUsersRound:mA,LucideUtensils:yA,LucideUtensilsCrossed:gA,LucideUtilityPole:J9,LucideVan:e_,LucideVariable:t_,LucideVault:a_,LucideVectorSquare:n_,LucideVegan:s_,LucideVenetianMask:r_,LucideVenus:i_,LucideVenusAndMars:o_,LucideVerified:Di,LucideVibrate:l_,LucideVibrateOff:c_,LucideVideo:A_,LucideVideoOff:d_,LucideVideotape:u_,LucideView:h_,LucideVoicemail:p_,LucideVolleyball:f_,LucideVolume:v_,LucideVolume1:x_,LucideVolume2:m_,LucideVolumeOff:g_,LucideVolumeX:y_,LucideVote:k_,LucideWallet:wu,LucideWallet2:vA,LucideWalletCards:O_,LucideWalletMinimal:vA,LucideWallpaper:w_,LucideWand:b_,LucideWand2:kA,LucideWandSparkles:kA,LucideWarehouse:j_,LucideWashingMachine:C_,LucideWatch:N_,LucideWaves:B_,LucideWavesArrowDown:M_,LucideWavesArrowUp:S_,LucideWavesLadder:Q_,LucideWaypoints:__,LucideWebcam:L_,LucideWebhook:$_,LucideWebhookOff:T_,LucideWeight:P_,LucideWeightTilde:I_,LucideWheat:E_,LucideWheatOff:U_,LucideWholeWord:z_,LucideWifi:UA,LucideWifiCog:F_,LucideWifiHigh:R_,LucideWifiLow:H_,LucideWifiOff:F0,LucideWifiPen:q_,LucideWifiSync:V_,LucideWifiZero:D_,LucideWind:Z_,LucideWindArrowDown:X_,LucideWine:W_,LucideWineOff:G_,LucideWorkflow:K_,LucideWorm:Y_,LucideWrapText:oA,LucideWrench:ju,LucideX:Ge,LucideXCircle:qn,LucideXLineTop:J_,LucideXOctagon:El,LucideXSquare:eA,LucideZap:wt,LucideZapOff:eL,LucideZodiacAquarius:tL,LucideZodiacAries:aL,LucideZodiacCancer:nL,LucideZodiacCapricorn:sL,LucideZodiacGemini:rL,LucideZodiacLeo:oL,LucideZodiacLibra:iL,LucideZodiacOphiuchus:cL,LucideZodiacPisces:lL,LucideZodiacSagittarius:dL,LucideZodiacScorpio:AL,LucideZodiacTaurus:uL,LucideZodiacVirgo:hL,LucideZoomIn:pL,LucideZoomOut:fL,Luggage:s6,LuggageIcon:s6,MSquare:Td,MSquareIcon:Td,Magnet:r6,MagnetIcon:r6,Mail:h6,MailCheck:o6,MailCheckIcon:o6,MailIcon:h6,MailMinus:i6,MailMinusIcon:i6,MailOpen:c6,MailOpenIcon:c6,MailPlus:l6,MailPlusIcon:l6,MailQuestion:_l,MailQuestionIcon:_l,MailQuestionMark:_l,MailQuestionMarkIcon:_l,MailSearch:d6,MailSearchIcon:d6,MailWarning:A6,MailWarningIcon:A6,MailX:u6,MailXIcon:u6,Mailbox:p6,MailboxIcon:p6,Mails:f6,MailsIcon:f6,Map:N0,MapIcon:N0,MapMinus:m6,MapMinusIcon:m6,MapPin:S6,MapPinCheck:g6,MapPinCheckIcon:g6,MapPinCheckInside:x6,MapPinCheckInsideIcon:x6,MapPinHouse:y6,MapPinHouseIcon:y6,MapPinIcon:S6,MapPinMinus:k6,MapPinMinusIcon:k6,MapPinMinusInside:v6,MapPinMinusInsideIcon:v6,MapPinOff:O6,MapPinOffIcon:O6,MapPinPen:Ll,MapPinPenIcon:Ll,MapPinPlus:w6,MapPinPlusIcon:w6,MapPinPlusInside:b6,MapPinPlusInsideIcon:b6,MapPinSearch:j6,MapPinSearchIcon:j6,MapPinX:N6,MapPinXIcon:N6,MapPinXInside:C6,MapPinXInsideIcon:C6,MapPinned:M6,MapPinnedIcon:M6,MapPlus:Q6,MapPlusIcon:Q6,Mars:_6,MarsIcon:_6,MarsStroke:B6,MarsStrokeIcon:B6,Martini:L6,MartiniIcon:L6,Maximize:T6,Maximize2:BA,Maximize2Icon:BA,MaximizeIcon:T6,Medal:$6,MedalIcon:$6,Megaphone:_A,MegaphoneIcon:_A,MegaphoneOff:I6,MegaphoneOffIcon:I6,Meh:U6,MehIcon:U6,MemoryStick:M0,MemoryStickIcon:M0,Menu:P6,MenuIcon:P6,MenuSquare:$d,MenuSquareIcon:$d,Merge:E6,MergeIcon:E6,MessageCircle:Yn,MessageCircleCheck:z6,MessageCircleCheckIcon:z6,MessageCircleCode:F6,MessageCircleCodeIcon:F6,MessageCircleDashed:R6,MessageCircleDashedIcon:R6,MessageCircleHeart:H6,MessageCircleHeartIcon:H6,MessageCircleIcon:Yn,MessageCircleMore:q6,MessageCircleMoreIcon:q6,MessageCircleOff:D6,MessageCircleOffIcon:D6,MessageCirclePlus:V6,MessageCirclePlusIcon:V6,MessageCircleQuestion:Tl,MessageCircleQuestionIcon:Tl,MessageCircleQuestionMark:Tl,MessageCircleQuestionMarkIcon:Tl,MessageCircleReply:X6,MessageCircleReplyIcon:X6,MessageCircleWarning:Z6,MessageCircleWarningIcon:Z6,MessageCircleX:G6,MessageCircleXIcon:G6,MessageSquare:Cn,MessageSquareCheck:W6,MessageSquareCheckIcon:W6,MessageSquareCode:K6,MessageSquareCodeIcon:K6,MessageSquareDashed:Y6,MessageSquareDashedIcon:Y6,MessageSquareDiff:J6,MessageSquareDiffIcon:J6,MessageSquareDot:tj,MessageSquareDotIcon:tj,MessageSquareHeart:aj,MessageSquareHeartIcon:aj,MessageSquareIcon:Cn,MessageSquareLock:ej,MessageSquareLockIcon:ej,MessageSquareMore:nj,MessageSquareMoreIcon:nj,MessageSquareOff:sj,MessageSquareOffIcon:sj,MessageSquarePlus:rj,MessageSquarePlusIcon:rj,MessageSquareQuote:oj,MessageSquareQuoteIcon:oj,MessageSquareReply:ij,MessageSquareReplyIcon:ij,MessageSquareShare:cj,MessageSquareShareIcon:cj,MessageSquareText:lj,MessageSquareTextIcon:lj,MessageSquareWarning:dj,MessageSquareWarningIcon:dj,MessageSquareX:Aj,MessageSquareXIcon:Aj,MessagesSquare:uj,MessagesSquareIcon:uj,Metronome:hj,MetronomeIcon:hj,Mic:fj,Mic2:$l,Mic2Icon:$l,MicIcon:fj,MicOff:pj,MicOffIcon:pj,MicVocal:$l,MicVocalIcon:$l,Microchip:xj,MicrochipIcon:xj,Microscope:mj,MicroscopeIcon:mj,Microwave:yj,MicrowaveIcon:yj,Milestone:gj,MilestoneIcon:gj,Milk:kj,MilkIcon:kj,MilkOff:vj,MilkOffIcon:vj,Minimize:Oj,Minimize2:S0,Minimize2Icon:S0,MinimizeIcon:Oj,Minus:bj,MinusCircle:bc,MinusCircleIcon:bc,MinusIcon:bj,MinusSquare:Ud,MinusSquareIcon:Ud,MirrorRectangular:wj,MirrorRectangularIcon:wj,MirrorRound:jj,MirrorRoundIcon:jj,Monitor:Dr,MonitorCheck:Cj,MonitorCheckIcon:Cj,MonitorCloud:Nj,MonitorCloudIcon:Nj,MonitorCog:Mj,MonitorCogIcon:Mj,MonitorDot:Sj,MonitorDotIcon:Sj,MonitorDown:Qj,MonitorDownIcon:Qj,MonitorIcon:Dr,MonitorOff:Bj,MonitorOffIcon:Bj,MonitorPause:_j,MonitorPauseIcon:_j,MonitorPlay:Lj,MonitorPlayIcon:Lj,MonitorSmartphone:Tj,MonitorSmartphoneIcon:Tj,MonitorSpeaker:$j,MonitorSpeakerIcon:$j,MonitorStop:Ij,MonitorStopIcon:Ij,MonitorUp:Uj,MonitorUpIcon:Uj,MonitorX:Q0,MonitorXIcon:Q0,Moon:Ej,MoonIcon:Ej,MoonStar:Pj,MoonStarIcon:Pj,MoreHorizontal:Uo,MoreHorizontalIcon:Uo,MoreVertical:qc,MoreVerticalIcon:qc,Motorbike:zj,MotorbikeIcon:zj,Mountain:Rj,MountainIcon:Rj,MountainSnow:Fj,MountainSnowIcon:Fj,Mouse:Kj,MouseIcon:Kj,MouseLeft:Hj,MouseLeftIcon:Hj,MouseOff:qj,MouseOffIcon:qj,MousePointer:Gj,MousePointer2:Vj,MousePointer2Icon:Vj,MousePointer2Off:Dj,MousePointer2OffIcon:Dj,MousePointerBan:Xj,MousePointerBanIcon:Xj,MousePointerClick:Zj,MousePointerClickIcon:Zj,MousePointerIcon:Gj,MousePointerSquareDashed:Cd,MousePointerSquareDashedIcon:Cd,MouseRight:Wj,MouseRightIcon:Wj,Move:dC,Move3D:Il,Move3DIcon:Il,Move3d:Il,Move3dIcon:Il,MoveDiagonal:Jj,MoveDiagonal2:Yj,MoveDiagonal2Icon:Yj,MoveDiagonalIcon:Jj,MoveDown:aC,MoveDownIcon:aC,MoveDownLeft:eC,MoveDownLeftIcon:eC,MoveDownRight:tC,MoveDownRightIcon:tC,MoveHorizontal:nC,MoveHorizontalIcon:nC,MoveIcon:dC,MoveLeft:sC,MoveLeftIcon:sC,MoveRight:rC,MoveRightIcon:rC,MoveUp:cC,MoveUpIcon:cC,MoveUpLeft:oC,MoveUpLeftIcon:oC,MoveUpRight:iC,MoveUpRightIcon:iC,MoveVertical:lC,MoveVerticalIcon:lC,Music:pC,Music2:AC,Music2Icon:AC,Music3:uC,Music3Icon:uC,Music4:hC,Music4Icon:hC,MusicIcon:pC,Navigation:gC,Navigation2:xC,Navigation2Icon:xC,Navigation2Off:fC,Navigation2OffIcon:fC,NavigationIcon:gC,NavigationOff:mC,NavigationOffIcon:mC,Network:fu,NetworkIcon:fu,Newspaper:Jo,NewspaperIcon:Jo,Nfc:yC,NfcIcon:yC,NonBinary:vC,NonBinaryIcon:vC,Notebook:wC,NotebookIcon:wC,NotebookPen:kC,NotebookPenIcon:kC,NotebookTabs:OC,NotebookTabsIcon:OC,NotebookText:bC,NotebookTextIcon:bC,NotepadText:CC,NotepadTextDashed:jC,NotepadTextDashedIcon:jC,NotepadTextIcon:CC,Nut:MC,NutIcon:MC,NutOff:NC,NutOffIcon:NC,Octagon:QC,OctagonAlert:Ul,OctagonAlertIcon:Ul,OctagonIcon:QC,OctagonMinus:SC,OctagonMinusIcon:SC,OctagonPause:Pl,OctagonPauseIcon:Pl,OctagonX:El,OctagonXIcon:El,Omega:BC,OmegaIcon:BC,Option:_C,OptionIcon:_C,Orbit:LC,OrbitIcon:LC,Origami:TC,OrigamiIcon:TC,Outdent:Rs,OutdentIcon:Rs,Package:xu,Package2:IC,Package2Icon:IC,PackageCheck:$C,PackageCheckIcon:$C,PackageIcon:xu,PackageMinus:UC,PackageMinusIcon:UC,PackageOpen:PC,PackageOpenIcon:PC,PackagePlus:EC,PackagePlusIcon:EC,PackageSearch:zC,PackageSearchIcon:zC,PackageX:FC,PackageXIcon:FC,PaintBucket:RC,PaintBucketIcon:RC,PaintRoller:HC,PaintRollerIcon:HC,Paintbrush:qC,Paintbrush2:zl,Paintbrush2Icon:zl,PaintbrushIcon:qC,PaintbrushVertical:zl,PaintbrushVerticalIcon:zl,Palette:DC,PaletteIcon:DC,Palmtree:cA,PalmtreeIcon:cA,Panda:VC,PandaIcon:VC,PanelBottom:GC,PanelBottomClose:XC,PanelBottomCloseIcon:XC,PanelBottomDashed:Fl,PanelBottomDashedIcon:Fl,PanelBottomIcon:GC,PanelBottomInactive:Fl,PanelBottomInactiveIcon:Fl,PanelBottomOpen:ZC,PanelBottomOpenIcon:ZC,PanelLeft:Hl,PanelLeftClose:fs,PanelLeftCloseIcon:fs,PanelLeftDashed:Rl,PanelLeftDashedIcon:Rl,PanelLeftIcon:Hl,PanelLeftInactive:Rl,PanelLeftInactiveIcon:Rl,PanelLeftOpen:xs,PanelLeftOpenIcon:xs,PanelLeftRightDashed:WC,PanelLeftRightDashedIcon:WC,PanelRight:KC,PanelRightClose:B0,PanelRightCloseIcon:B0,PanelRightDashed:ql,PanelRightDashedIcon:ql,PanelRightIcon:KC,PanelRightInactive:ql,PanelRightInactiveIcon:ql,PanelRightOpen:_0,PanelRightOpenIcon:_0,PanelTop:t7,PanelTopBottomDashed:YC,PanelTopBottomDashedIcon:YC,PanelTopClose:JC,PanelTopCloseIcon:JC,PanelTopDashed:Dl,PanelTopDashedIcon:Dl,PanelTopIcon:t7,PanelTopInactive:Dl,PanelTopInactiveIcon:Dl,PanelTopOpen:e7,PanelTopOpenIcon:e7,PanelsLeftBottom:a7,PanelsLeftBottomIcon:a7,PanelsLeftRight:zc,PanelsLeftRightIcon:zc,PanelsRightBottom:n7,PanelsRightBottomIcon:n7,PanelsTopBottom:Wl,PanelsTopBottomIcon:Wl,PanelsTopLeft:Vl,PanelsTopLeftIcon:Vl,Paperclip:mu,PaperclipIcon:mu,Parentheses:s7,ParenthesesIcon:s7,ParkingCircle:jc,ParkingCircleIcon:jc,ParkingCircleOff:wc,ParkingCircleOffIcon:wc,ParkingMeter:r7,ParkingMeterIcon:r7,ParkingSquare:Ed,ParkingSquareIcon:Ed,ParkingSquareOff:Pd,ParkingSquareOffIcon:Pd,PartyPopper:o7,PartyPopperIcon:o7,Pause:L0,PauseCircle:Cc,PauseCircleIcon:Cc,PauseIcon:L0,PauseOctagon:Pl,PauseOctagonIcon:Pl,PawPrint:i7,PawPrintIcon:i7,PcCase:c7,PcCaseIcon:c7,Pen:Lr,PenBox:sn,PenBoxIcon:sn,PenIcon:Lr,PenLine:Eo,PenLineIcon:Eo,PenOff:l7,PenOffIcon:l7,PenSquare:sn,PenSquareIcon:sn,PenTool:d7,PenToolIcon:d7,Pencil:js,PencilIcon:js,PencilLine:A7,PencilLineIcon:A7,PencilOff:u7,PencilOffIcon:u7,PencilRuler:h7,PencilRulerIcon:h7,Pentagon:p7,PentagonIcon:p7,Percent:f7,PercentCircle:Nc,PercentCircleIcon:Nc,PercentDiamond:Rc,PercentDiamondIcon:Rc,PercentIcon:f7,PercentSquare:zd,PercentSquareIcon:zd,PersonStanding:x7,PersonStandingIcon:x7,PhilippinePeso:m7,PhilippinePesoIcon:m7,Phone:w7,PhoneCall:g7,PhoneCallIcon:g7,PhoneForwarded:y7,PhoneForwardedIcon:y7,PhoneIcon:w7,PhoneIncoming:v7,PhoneIncomingIcon:v7,PhoneMissed:k7,PhoneMissedIcon:k7,PhoneOff:O7,PhoneOffIcon:O7,PhoneOutgoing:b7,PhoneOutgoingIcon:b7,Pi:j7,PiIcon:j7,PiSquare:Fd,PiSquareIcon:Fd,Piano:C7,PianoIcon:C7,Pickaxe:N7,PickaxeIcon:N7,PictureInPicture:S7,PictureInPicture2:M7,PictureInPicture2Icon:M7,PictureInPictureIcon:S7,PieChart:cc,PieChartIcon:cc,PiggyBank:Q7,PiggyBankIcon:Q7,Pilcrow:L7,PilcrowIcon:L7,PilcrowLeft:B7,PilcrowLeftIcon:B7,PilcrowRight:_7,PilcrowRightIcon:_7,PilcrowSquare:Rd,PilcrowSquareIcon:Rd,Pill:$7,PillBottle:T7,PillBottleIcon:T7,PillIcon:$7,Pin:LA,PinIcon:LA,PinOff:gu,PinOffIcon:gu,Pipette:I7,PipetteIcon:I7,Pizza:U7,PizzaIcon:U7,Plane:z7,PlaneIcon:z7,PlaneLanding:P7,PlaneLandingIcon:P7,PlaneTakeoff:E7,PlaneTakeoffIcon:E7,Play:ei,PlayCircle:Mc,PlayCircleIcon:Mc,PlayIcon:ei,PlaySquare:Hd,PlaySquareIcon:Hd,Plug:da,Plug2:F7,Plug2Icon:F7,PlugIcon:da,PlugZap:Tr,PlugZap2:Tr,PlugZap2Icon:Tr,PlugZapIcon:Tr,Plus:ht,PlusCircle:Sc,PlusCircleIcon:Sc,PlusIcon:ht,PlusSquare:qd,PlusSquareIcon:qd,PocketKnife:H7,PocketKnifeIcon:H7,Podcast:R7,PodcastIcon:R7,Pointer:D7,PointerIcon:D7,PointerOff:q7,PointerOffIcon:q7,Popcorn:V7,PopcornIcon:V7,Popsicle:X7,PopsicleIcon:X7,PoundSterling:Z7,PoundSterlingIcon:Z7,Power:W7,PowerCircle:Qc,PowerCircleIcon:Qc,PowerIcon:W7,PowerOff:G7,PowerOffIcon:G7,PowerSquare:Dd,PowerSquareIcon:Dd,Presentation:yu,PresentationIcon:yu,Printer:J7,PrinterCheck:K7,PrinterCheckIcon:K7,PrinterIcon:J7,PrinterX:Y7,PrinterXIcon:Y7,Projector:eN,ProjectorIcon:eN,Proportions:tN,ProportionsIcon:tN,Puzzle:vu,PuzzleIcon:vu,Pyramid:aN,PyramidIcon:aN,QrCode:nN,QrCodeIcon:nN,Quote:sN,QuoteIcon:sN,Rabbit:oN,RabbitIcon:oN,Radar:rN,RadarIcon:rN,Radiation:iN,RadiationIcon:iN,Radical:cN,RadicalIcon:cN,Radio:Jn,RadioIcon:Jn,RadioOff:lN,RadioOffIcon:lN,RadioReceiver:dN,RadioReceiverIcon:dN,RadioTower:AN,RadioTowerIcon:AN,Radius:uN,RadiusIcon:uN,Rainbow:hN,RainbowIcon:hN,Rat:pN,RatIcon:pN,Ratio:fN,RatioIcon:fN,Receipt:jN,ReceiptCent:xN,ReceiptCentIcon:xN,ReceiptEuro:mN,ReceiptEuroIcon:mN,ReceiptIcon:jN,ReceiptIndianRupee:gN,ReceiptIndianRupeeIcon:gN,ReceiptJapaneseYen:yN,ReceiptJapaneseYenIcon:yN,ReceiptPoundSterling:vN,ReceiptPoundSterlingIcon:vN,ReceiptRussianRuble:kN,ReceiptRussianRubleIcon:kN,ReceiptSwissFranc:ON,ReceiptSwissFrancIcon:ON,ReceiptText:bN,ReceiptTextIcon:bN,ReceiptTurkishLira:wN,ReceiptTurkishLiraIcon:wN,RectangleCircle:CN,RectangleCircleIcon:CN,RectangleEllipsis:Xl,RectangleEllipsisIcon:Xl,RectangleGoggles:NN,RectangleGogglesIcon:NN,RectangleHorizontal:MN,RectangleHorizontalIcon:MN,RectangleVertical:QN,RectangleVerticalIcon:QN,Recycle:SN,RecycleIcon:SN,Redo:LN,Redo2:BN,Redo2Icon:BN,RedoDot:_N,RedoDotIcon:_N,RedoIcon:LN,RefreshCcw:$N,RefreshCcwDot:TN,RefreshCcwDotIcon:TN,RefreshCcwIcon:$N,RefreshCw:ra,RefreshCwIcon:ra,RefreshCwOff:IN,RefreshCwOffIcon:IN,Refrigerator:UN,RefrigeratorIcon:UN,Regex:PN,RegexIcon:PN,RemoveFormatting:EN,RemoveFormattingIcon:EN,Repeat:RN,Repeat1:zN,Repeat1Icon:zN,Repeat2:FN,Repeat2Icon:FN,RepeatIcon:RN,Replace:qN,ReplaceAll:HN,ReplaceAllIcon:HN,ReplaceIcon:qN,Reply:XN,ReplyAll:DN,ReplyAllIcon:DN,ReplyIcon:XN,Rewind:VN,RewindIcon:VN,Ribbon:ZN,RibbonIcon:ZN,Road:GN,RoadIcon:GN,Rocket:es,RocketIcon:es,RockingChair:WN,RockingChairIcon:WN,RollerCoaster:KN,RollerCoasterIcon:KN,Rose:YN,RoseIcon:YN,Rotate3D:Zl,Rotate3DIcon:Zl,Rotate3d:Zl,Rotate3dIcon:Zl,RotateCcw:Cs,RotateCcwIcon:Cs,RotateCcwKey:JN,RotateCcwKeyIcon:JN,RotateCcwSquare:eM,RotateCcwSquareIcon:eM,RotateCw:Vr,RotateCwIcon:Vr,RotateCwSquare:tM,RotateCwSquareIcon:tM,Route:aM,RouteIcon:aM,RouteOff:nM,RouteOffIcon:nM,Router:sM,RouterIcon:sM,Rows:Gl,Rows2:Gl,Rows2Icon:Gl,Rows3:Wl,Rows3Icon:Wl,Rows4:rM,Rows4Icon:rM,RowsIcon:Gl,Rss:oM,RssIcon:oM,Ruler:cM,RulerDimensionLine:iM,RulerDimensionLineIcon:iM,RulerIcon:cM,RussianRuble:lM,RussianRubleIcon:lM,Sailboat:dM,SailboatIcon:dM,Salad:AM,SaladIcon:AM,Sandwich:uM,SandwichIcon:uM,Satellite:pM,SatelliteDish:hM,SatelliteDishIcon:hM,SatelliteIcon:pM,SaudiRiyal:fM,SaudiRiyalIcon:fM,Save:Xr,SaveAll:xM,SaveAllIcon:xM,SaveIcon:Xr,SaveOff:mM,SaveOffIcon:mM,Scale:gM,Scale3D:Kl,Scale3DIcon:Kl,Scale3d:Kl,Scale3dIcon:Kl,ScaleIcon:gM,Scaling:yM,ScalingIcon:yM,Scan:MM,ScanBarcode:vM,ScanBarcodeIcon:vM,ScanEye:kM,ScanEyeIcon:kM,ScanFace:OM,ScanFaceIcon:OM,ScanHeart:bM,ScanHeartIcon:bM,ScanIcon:MM,ScanLine:wM,ScanLineIcon:wM,ScanQrCode:jM,ScanQrCodeIcon:jM,ScanSearch:NM,ScanSearchIcon:NM,ScanText:CM,ScanTextIcon:CM,ScatterChart:lc,ScatterChartIcon:lc,School:SM,School2:dA,School2Icon:dA,SchoolIcon:SM,Scissors:QM,ScissorsIcon:QM,ScissorsLineDashed:BM,ScissorsLineDashedIcon:BM,ScissorsSquare:Vd,ScissorsSquareDashedBottom:fd,ScissorsSquareDashedBottomIcon:fd,ScissorsSquareIcon:Vd,Scooter:_M,ScooterIcon:_M,ScreenShare:TM,ScreenShareIcon:TM,ScreenShareOff:LM,ScreenShareOffIcon:LM,Scroll:IM,ScrollIcon:IM,ScrollText:$M,ScrollTextIcon:$M,Search:oa,SearchAlert:UM,SearchAlertIcon:UM,SearchCheck:PM,SearchCheckIcon:PM,SearchCode:EM,SearchCodeIcon:EM,SearchIcon:oa,SearchSlash:zM,SearchSlashIcon:zM,SearchX:FM,SearchXIcon:FM,Section:RM,SectionIcon:RM,Send:Xa,SendHorizonal:Yl,SendHorizonalIcon:Yl,SendHorizontal:Yl,SendHorizontalIcon:Yl,SendIcon:Xa,SendToBack:HM,SendToBackIcon:HM,SeparatorHorizontal:qM,SeparatorHorizontalIcon:qM,SeparatorVertical:VM,SeparatorVerticalIcon:VM,Server:aa,ServerCog:DM,ServerCogIcon:DM,ServerCrash:XM,ServerCrashIcon:XM,ServerIcon:aa,ServerOff:ZM,ServerOffIcon:ZM,Settings:Zr,Settings2:T0,Settings2Icon:T0,SettingsIcon:Zr,Shapes:GM,ShapesIcon:GM,Share:WM,Share2:$0,Share2Icon:$0,ShareIcon:WM,Sheet:KM,SheetIcon:KM,Shell:YM,ShellIcon:YM,ShelvingUnit:JM,ShelvingUnitIcon:JM,Shield:La,ShieldAlert:tS,ShieldAlertIcon:tS,ShieldBan:eS,ShieldBanIcon:eS,ShieldCheck:ku,ShieldCheckIcon:ku,ShieldClose:$r,ShieldCloseIcon:$r,ShieldCog:nS,ShieldCogCorner:aS,ShieldCogCornerIcon:aS,ShieldCogIcon:nS,ShieldEllipsis:sS,ShieldEllipsisIcon:sS,ShieldHalf:oS,ShieldHalfIcon:oS,ShieldIcon:La,ShieldMinus:rS,ShieldMinusIcon:rS,ShieldOff:iS,ShieldOffIcon:iS,ShieldPlus:cS,ShieldPlusIcon:cS,ShieldQuestion:Jl,ShieldQuestionIcon:Jl,ShieldQuestionMark:Jl,ShieldQuestionMarkIcon:Jl,ShieldUser:lS,ShieldUserIcon:lS,ShieldX:$r,ShieldXIcon:$r,Ship:AS,ShipIcon:AS,ShipWheel:dS,ShipWheelIcon:dS,Shirt:uS,ShirtIcon:uS,ShoppingBag:TA,ShoppingBagIcon:TA,ShoppingBasket:hS,ShoppingBasketIcon:hS,ShoppingCart:pS,ShoppingCartIcon:pS,Shovel:fS,ShovelIcon:fS,ShowerHead:mS,ShowerHeadIcon:mS,Shredder:xS,ShredderIcon:xS,Shrimp:gS,ShrimpIcon:gS,Shrink:yS,ShrinkIcon:yS,Shrub:vS,ShrubIcon:vS,Shuffle:kS,ShuffleIcon:kS,Sidebar:Hl,SidebarClose:fs,SidebarCloseIcon:fs,SidebarIcon:Hl,SidebarOpen:xs,SidebarOpenIcon:xs,Sigma:OS,SigmaIcon:OS,SigmaSquare:Xd,SigmaSquareIcon:Xd,Signal:NS,SignalHigh:bS,SignalHighIcon:bS,SignalIcon:NS,SignalLow:wS,SignalLowIcon:wS,SignalMedium:jS,SignalMediumIcon:jS,SignalZero:CS,SignalZeroIcon:CS,Signature:MS,SignatureIcon:MS,Signpost:QS,SignpostBig:SS,SignpostBigIcon:SS,SignpostIcon:QS,Siren:_S,SirenIcon:_S,SkipBack:BS,SkipBackIcon:BS,SkipForward:LS,SkipForwardIcon:LS,Skull:$A,SkullIcon:$A,Slash:$S,SlashIcon:$S,SlashSquare:Zd,SlashSquareIcon:Zd,Slice:TS,SliceIcon:TS,Sliders:ed,SlidersHorizontal:IS,SlidersHorizontalIcon:IS,SlidersIcon:ed,SlidersVertical:ed,SlidersVerticalIcon:ed,Smartphone:I0,SmartphoneCharging:US,SmartphoneChargingIcon:US,SmartphoneIcon:I0,SmartphoneNfc:PS,SmartphoneNfcIcon:PS,Smile:zS,SmileIcon:zS,SmilePlus:ES,SmilePlusIcon:ES,Snail:FS,SnailIcon:FS,Snowflake:RS,SnowflakeIcon:RS,SoapDispenserDroplet:HS,SoapDispenserDropletIcon:HS,Sofa:qS,SofaIcon:qS,SolarPanel:DS,SolarPanelIcon:DS,SortAsc:Ri,SortAscIcon:Ri,SortDesc:Ei,SortDescIcon:Ei,Soup:VS,SoupIcon:VS,Space:XS,SpaceIcon:XS,Spade:ZS,SpadeIcon:ZS,Sparkle:GS,SparkleIcon:GS,Sparkles:It,SparklesIcon:It,Speaker:WS,SpeakerIcon:WS,Speech:KS,SpeechIcon:KS,SpellCheck:JS,SpellCheck2:YS,SpellCheck2Icon:YS,SpellCheckIcon:JS,Spline:eQ,SplineIcon:eQ,SplinePointer:tQ,SplinePointerIcon:tQ,Split:aQ,SplitIcon:aQ,SplitSquareHorizontal:Gd,SplitSquareHorizontalIcon:Gd,SplitSquareVertical:Wd,SplitSquareVerticalIcon:Wd,Spool:nQ,SpoolIcon:nQ,SportShoe:sQ,SportShoeIcon:sQ,Spotlight:rQ,SpotlightIcon:rQ,SprayCan:oQ,SprayCanIcon:oQ,Sprout:iQ,SproutIcon:iQ,Square:Gr,SquareActivity:td,SquareActivityIcon:td,SquareArrowDown:nd,SquareArrowDownIcon:nd,SquareArrowDownLeft:ad,SquareArrowDownLeftIcon:ad,SquareArrowDownRight:sd,SquareArrowDownRightIcon:sd,SquareArrowLeft:rd,SquareArrowLeftIcon:rd,SquareArrowOutDownLeft:od,SquareArrowOutDownLeftIcon:od,SquareArrowOutDownRight:id,SquareArrowOutDownRightIcon:id,SquareArrowOutUpLeft:ld,SquareArrowOutUpLeftIcon:ld,SquareArrowOutUpRight:cd,SquareArrowOutUpRightIcon:cd,SquareArrowRight:dd,SquareArrowRightEnter:cQ,SquareArrowRightEnterIcon:cQ,SquareArrowRightExit:lQ,SquareArrowRightExitIcon:lQ,SquareArrowRightIcon:dd,SquareArrowUp:hd,SquareArrowUpIcon:hd,SquareArrowUpLeft:Ad,SquareArrowUpLeftIcon:Ad,SquareArrowUpRight:ud,SquareArrowUpRightIcon:ud,SquareAsterisk:pd,SquareAsteriskIcon:pd,SquareBottomDashedScissors:fd,SquareBottomDashedScissorsIcon:fd,SquareCenterlineDashedHorizontal:xd,SquareCenterlineDashedHorizontalIcon:xd,SquareCenterlineDashedVertical:gd,SquareCenterlineDashedVerticalIcon:gd,SquareChartGantt:qs,SquareChartGanttIcon:qs,SquareCheck:yd,SquareCheckBig:md,SquareCheckBigIcon:md,SquareCheckIcon:yd,SquareChevronDown:vd,SquareChevronDownIcon:vd,SquareChevronLeft:kd,SquareChevronLeftIcon:kd,SquareChevronRight:Od,SquareChevronRightIcon:Od,SquareChevronUp:wd,SquareChevronUpIcon:wd,SquareCode:bd,SquareCodeIcon:bd,SquareDashed:Nd,SquareDashedBottom:AQ,SquareDashedBottomCode:dQ,SquareDashedBottomCodeIcon:dQ,SquareDashedBottomIcon:AQ,SquareDashedIcon:Nd,SquareDashedKanban:jd,SquareDashedKanbanIcon:jd,SquareDashedMousePointer:Cd,SquareDashedMousePointerIcon:Cd,SquareDashedText:Ds,SquareDashedTextIcon:Ds,SquareDashedTopSolid:uQ,SquareDashedTopSolidIcon:uQ,SquareDivide:Md,SquareDivideIcon:Md,SquareDot:Sd,SquareDotIcon:Sd,SquareEqual:Qd,SquareEqualIcon:Qd,SquareFunction:Bd,SquareFunctionIcon:Bd,SquareGanttChart:qs,SquareGanttChartIcon:qs,SquareIcon:Gr,SquareKanban:_d,SquareKanbanIcon:_d,SquareLibrary:Ld,SquareLibraryIcon:Ld,SquareM:Td,SquareMIcon:Td,SquareMenu:$d,SquareMenuIcon:$d,SquareMinus:Ud,SquareMinusIcon:Ud,SquareMousePointer:Id,SquareMousePointerIcon:Id,SquareParking:Ed,SquareParkingIcon:Ed,SquareParkingOff:Pd,SquareParkingOffIcon:Pd,SquarePause:hQ,SquarePauseIcon:hQ,SquarePen:sn,SquarePenIcon:sn,SquarePercent:zd,SquarePercentIcon:zd,SquarePi:Fd,SquarePiIcon:Fd,SquarePilcrow:Rd,SquarePilcrowIcon:Rd,SquarePlay:Hd,SquarePlayIcon:Hd,SquarePlus:qd,SquarePlusIcon:qd,SquarePower:Dd,SquarePowerIcon:Dd,SquareRadical:pQ,SquareRadicalIcon:pQ,SquareRoundCorner:fQ,SquareRoundCornerIcon:fQ,SquareScissors:Vd,SquareScissorsIcon:Vd,SquareSigma:Xd,SquareSigmaIcon:Xd,SquareSlash:Zd,SquareSlashIcon:Zd,SquareSplitHorizontal:Gd,SquareSplitHorizontalIcon:Gd,SquareSplitVertical:Wd,SquareSplitVerticalIcon:Wd,SquareSquare:xQ,SquareSquareIcon:xQ,SquareStack:mQ,SquareStackIcon:mQ,SquareStar:gQ,SquareStarIcon:gQ,SquareStop:yQ,SquareStopIcon:yQ,SquareTerminal:Yd,SquareTerminalIcon:Yd,SquareUser:Jd,SquareUserIcon:Jd,SquareUserRound:Kd,SquareUserRoundIcon:Kd,SquareX:eA,SquareXIcon:eA,SquaresExclude:vQ,SquaresExcludeIcon:vQ,SquaresIntersect:kQ,SquaresIntersectIcon:kQ,SquaresSubtract:OQ,SquaresSubtractIcon:OQ,SquaresUnite:bQ,SquaresUniteIcon:bQ,Squircle:jQ,SquircleDashed:wQ,SquircleDashedIcon:wQ,SquircleIcon:jQ,Squirrel:CQ,SquirrelIcon:CQ,Stamp:NQ,StampIcon:NQ,Star:IA,StarHalf:MQ,StarHalfIcon:MQ,StarIcon:IA,StarOff:SQ,StarOffIcon:SQ,Stars:It,StarsIcon:It,StepBack:QQ,StepBackIcon:QQ,StepForward:BQ,StepForwardIcon:BQ,Stethoscope:_Q,StethoscopeIcon:_Q,Sticker:LQ,StickerIcon:LQ,StickyNote:TQ,StickyNoteIcon:TQ,Stone:$Q,StoneIcon:$Q,StopCircle:_c,StopCircleIcon:_c,Store:IQ,StoreIcon:IQ,StretchHorizontal:UQ,StretchHorizontalIcon:UQ,StretchVertical:PQ,StretchVerticalIcon:PQ,Strikethrough:EQ,StrikethroughIcon:EQ,Subscript:zQ,SubscriptIcon:zQ,Subtitles:Ki,SubtitlesIcon:Ki,Sun:DQ,SunDim:FQ,SunDimIcon:FQ,SunIcon:DQ,SunMedium:RQ,SunMediumIcon:RQ,SunMoon:HQ,SunMoonIcon:HQ,SunSnow:qQ,SunSnowIcon:qQ,Sunrise:VQ,SunriseIcon:VQ,Sunset:XQ,SunsetIcon:XQ,Superscript:ZQ,SuperscriptIcon:ZQ,SwatchBook:GQ,SwatchBookIcon:GQ,SwissFranc:WQ,SwissFrancIcon:WQ,SwitchCamera:KQ,SwitchCameraIcon:KQ,Sword:YQ,SwordIcon:YQ,Swords:JQ,SwordsIcon:JQ,Syringe:eB,SyringeIcon:eB,Table:cB,Table2:tB,Table2Icon:tB,TableCellsMerge:aB,TableCellsMergeIcon:aB,TableCellsSplit:nB,TableCellsSplitIcon:nB,TableColumnsSplit:sB,TableColumnsSplitIcon:sB,TableConfig:Es,TableConfigIcon:Es,TableIcon:cB,TableOfContents:rB,TableOfContentsIcon:rB,TableProperties:oB,TablePropertiesIcon:oB,TableRowsSplit:iB,TableRowsSplitIcon:iB,Tablet:U0,TabletIcon:U0,TabletSmartphone:lB,TabletSmartphoneIcon:lB,Tablets:dB,TabletsIcon:dB,Tag:AB,TagIcon:AB,Tags:uB,TagsIcon:uB,Tally1:hB,Tally1Icon:hB,Tally2:pB,Tally2Icon:pB,Tally3:fB,Tally3Icon:fB,Tally4:xB,Tally4Icon:xB,Tally5:mB,Tally5Icon:mB,Tangent:gB,TangentIcon:gB,Target:yB,TargetIcon:yB,Telescope:vB,TelescopeIcon:vB,Tent:OB,TentIcon:OB,TentTree:kB,TentTreeIcon:kB,Terminal:Ns,TerminalIcon:Ns,TerminalSquare:Yd,TerminalSquareIcon:Yd,TestTube:ti,TestTube2:tA,TestTube2Icon:tA,TestTubeDiagonal:tA,TestTubeDiagonalIcon:tA,TestTubeIcon:ti,TestTubes:bB,TestTubesIcon:bB,Text:Vs,TextAlignCenter:aA,TextAlignCenterIcon:aA,TextAlignEnd:sA,TextAlignEndIcon:sA,TextAlignJustify:nA,TextAlignJustifyIcon:nA,TextAlignStart:Vs,TextAlignStartIcon:Vs,TextCursor:jB,TextCursorIcon:jB,TextCursorInput:wB,TextCursorInputIcon:wB,TextIcon:Vs,TextInitial:rA,TextInitialIcon:rA,TextQuote:CB,TextQuoteIcon:CB,TextSearch:NB,TextSearchIcon:NB,TextSelect:Ds,TextSelectIcon:Ds,TextSelection:Ds,TextSelectionIcon:Ds,TextWrap:oA,TextWrapIcon:oA,Theater:MB,TheaterIcon:MB,Thermometer:BB,ThermometerIcon:BB,ThermometerSnowflake:SB,ThermometerSnowflakeIcon:SB,ThermometerSun:QB,ThermometerSunIcon:QB,ThumbsDown:_B,ThumbsDownIcon:_B,ThumbsUp:LB,ThumbsUpIcon:LB,Ticket:zB,TicketCheck:TB,TicketCheckIcon:TB,TicketIcon:zB,TicketMinus:$B,TicketMinusIcon:$B,TicketPercent:IB,TicketPercentIcon:IB,TicketPlus:UB,TicketPlusIcon:UB,TicketSlash:PB,TicketSlashIcon:PB,TicketX:EB,TicketXIcon:EB,Tickets:RB,TicketsIcon:RB,TicketsPlane:FB,TicketsPlaneIcon:FB,Timeline:HB,TimelineIcon:HB,Timer:P0,TimerIcon:P0,TimerOff:qB,TimerOffIcon:qB,TimerReset:DB,TimerResetIcon:DB,ToggleLeft:VB,ToggleLeftIcon:VB,ToggleRight:XB,ToggleRightIcon:XB,Toilet:ZB,ToiletIcon:ZB,ToolCase:GB,ToolCaseIcon:GB,Toolbox:WB,ToolboxIcon:WB,Tornado:KB,TornadoIcon:KB,Torus:YB,TorusIcon:YB,Touchpad:e9,TouchpadIcon:e9,TouchpadOff:JB,TouchpadOffIcon:JB,TowelRack:t9,TowelRackIcon:t9,TowerControl:a9,TowerControlIcon:a9,ToyBrick:r9,ToyBrickIcon:r9,Tractor:n9,TractorIcon:n9,TrafficCone:s9,TrafficConeIcon:s9,Train:iA,TrainFront:c9,TrainFrontIcon:c9,TrainFrontTunnel:o9,TrainFrontTunnelIcon:o9,TrainIcon:iA,TrainTrack:i9,TrainTrackIcon:i9,TramFront:iA,TramFrontIcon:iA,Transgender:l9,TransgenderIcon:l9,Trash:d9,Trash2:At,Trash2Icon:At,TrashIcon:d9,TreeDeciduous:A9,TreeDeciduousIcon:A9,TreePalm:cA,TreePalmIcon:cA,TreePine:u9,TreePineIcon:u9,Trees:h9,TreesIcon:h9,TrendingDown:p9,TrendingDownIcon:p9,TrendingUp:x9,TrendingUpDown:f9,TrendingUpDownIcon:f9,TrendingUpIcon:x9,Triangle:y9,TriangleAlert:Gt,TriangleAlertIcon:Gt,TriangleDashed:m9,TriangleDashedIcon:m9,TriangleIcon:y9,TriangleRight:g9,TriangleRightIcon:g9,Trophy:v9,TrophyIcon:v9,Truck:O9,TruckElectric:k9,TruckElectricIcon:k9,TruckIcon:O9,TurkishLira:b9,TurkishLiraIcon:b9,Turntable:w9,TurntableIcon:w9,Turtle:j9,TurtleIcon:j9,Tv:N9,Tv2:lA,Tv2Icon:lA,TvIcon:N9,TvMinimal:lA,TvMinimalIcon:lA,TvMinimalPlay:C9,TvMinimalPlayIcon:C9,Type:M9,TypeIcon:M9,TypeOutline:S9,TypeOutlineIcon:S9,Umbrella:_9,UmbrellaIcon:_9,UmbrellaOff:B9,UmbrellaOffIcon:B9,Underline:Q9,UnderlineIcon:Q9,Undo:$9,Undo2:L9,Undo2Icon:L9,UndoDot:T9,UndoDotIcon:T9,UndoIcon:$9,UnfoldHorizontal:I9,UnfoldHorizontalIcon:I9,UnfoldVertical:U9,UnfoldVerticalIcon:U9,Ungroup:P9,UngroupIcon:P9,University:dA,UniversityIcon:dA,Unlink:z9,Unlink2:E9,Unlink2Icon:E9,UnlinkIcon:z9,Unlock:Bl,UnlockIcon:Bl,UnlockKeyhole:Ql,UnlockKeyholeIcon:Ql,Unplug:ai,UnplugIcon:ai,Upload:E0,UploadCloud:Pc,UploadCloudIcon:Pc,UploadIcon:E0,Usb:F9,UsbIcon:F9,User:z0,User2:xA,User2Icon:xA,UserCheck:Ou,UserCheck2:AA,UserCheck2Icon:AA,UserCheckIcon:Ou,UserCircle:Tc,UserCircle2:Lc,UserCircle2Icon:Lc,UserCircleIcon:Tc,UserCog:R9,UserCog2:uA,UserCog2Icon:uA,UserCogIcon:R9,UserIcon:z0,UserKey:H9,UserKeyIcon:H9,UserLock:q9,UserLockIcon:q9,UserMinus:D9,UserMinus2:hA,UserMinus2Icon:hA,UserMinusIcon:D9,UserPen:V9,UserPenIcon:V9,UserPlus:bu,UserPlus2:pA,UserPlus2Icon:pA,UserPlusIcon:bu,UserRound:xA,UserRoundCheck:AA,UserRoundCheckIcon:AA,UserRoundCog:uA,UserRoundCogIcon:uA,UserRoundIcon:xA,UserRoundKey:X9,UserRoundKeyIcon:X9,UserRoundMinus:hA,UserRoundMinusIcon:hA,UserRoundPen:Z9,UserRoundPenIcon:Z9,UserRoundPlus:pA,UserRoundPlusIcon:pA,UserRoundSearch:G9,UserRoundSearchIcon:G9,UserRoundX:fA,UserRoundXIcon:fA,UserSearch:W9,UserSearchIcon:W9,UserSquare:Jd,UserSquare2:Kd,UserSquare2Icon:Kd,UserSquareIcon:Jd,UserStar:K9,UserStarIcon:K9,UserX:Y9,UserX2:fA,UserX2Icon:fA,UserXIcon:Y9,Users:Fa,Users2:mA,Users2Icon:mA,UsersIcon:Fa,UsersRound:mA,UsersRoundIcon:mA,Utensils:yA,UtensilsCrossed:gA,UtensilsCrossedIcon:gA,UtensilsIcon:yA,UtilityPole:J9,UtilityPoleIcon:J9,Van:e_,VanIcon:e_,Variable:t_,VariableIcon:t_,Vault:a_,VaultIcon:a_,VectorSquare:n_,VectorSquareIcon:n_,Vegan:s_,VeganIcon:s_,VenetianMask:r_,VenetianMaskIcon:r_,Venus:i_,VenusAndMars:o_,VenusAndMarsIcon:o_,VenusIcon:i_,Verified:Di,VerifiedIcon:Di,Vibrate:l_,VibrateIcon:l_,VibrateOff:c_,VibrateOffIcon:c_,Video:A_,VideoIcon:A_,VideoOff:d_,VideoOffIcon:d_,Videotape:u_,VideotapeIcon:u_,View:h_,ViewIcon:h_,Voicemail:p_,VoicemailIcon:p_,Volleyball:f_,VolleyballIcon:f_,Volume:v_,Volume1:x_,Volume1Icon:x_,Volume2:m_,Volume2Icon:m_,VolumeIcon:v_,VolumeOff:g_,VolumeOffIcon:g_,VolumeX:y_,VolumeXIcon:y_,Vote:k_,VoteIcon:k_,Wallet:wu,Wallet2:vA,Wallet2Icon:vA,WalletCards:O_,WalletCardsIcon:O_,WalletIcon:wu,WalletMinimal:vA,WalletMinimalIcon:vA,Wallpaper:w_,WallpaperIcon:w_,Wand:b_,Wand2:kA,Wand2Icon:kA,WandIcon:b_,WandSparkles:kA,WandSparklesIcon:kA,Warehouse:j_,WarehouseIcon:j_,WashingMachine:C_,WashingMachineIcon:C_,Watch:N_,WatchIcon:N_,Waves:B_,WavesArrowDown:M_,WavesArrowDownIcon:M_,WavesArrowUp:S_,WavesArrowUpIcon:S_,WavesIcon:B_,WavesLadder:Q_,WavesLadderIcon:Q_,Waypoints:__,WaypointsIcon:__,Webcam:L_,WebcamIcon:L_,Webhook:$_,WebhookIcon:$_,WebhookOff:T_,WebhookOffIcon:T_,Weight:P_,WeightIcon:P_,WeightTilde:I_,WeightTildeIcon:I_,Wheat:E_,WheatIcon:E_,WheatOff:U_,WheatOffIcon:U_,WholeWord:z_,WholeWordIcon:z_,Wifi:UA,WifiCog:F_,WifiCogIcon:F_,WifiHigh:R_,WifiHighIcon:R_,WifiIcon:UA,WifiLow:H_,WifiLowIcon:H_,WifiOff:F0,WifiOffIcon:F0,WifiPen:q_,WifiPenIcon:q_,WifiSync:V_,WifiSyncIcon:V_,WifiZero:D_,WifiZeroIcon:D_,Wind:Z_,WindArrowDown:X_,WindArrowDownIcon:X_,WindIcon:Z_,Wine:W_,WineIcon:W_,WineOff:G_,WineOffIcon:G_,Workflow:K_,WorkflowIcon:K_,Worm:Y_,WormIcon:Y_,WrapText:oA,WrapTextIcon:oA,Wrench:ju,WrenchIcon:ju,X:Ge,XCircle:qn,XCircleIcon:qn,XIcon:Ge,XLineTop:J_,XLineTopIcon:J_,XOctagon:El,XOctagonIcon:El,XSquare:eA,XSquareIcon:eA,Zap:wt,ZapIcon:wt,ZapOff:eL,ZapOffIcon:eL,ZodiacAquarius:tL,ZodiacAquariusIcon:tL,ZodiacAries:aL,ZodiacAriesIcon:aL,ZodiacCancer:nL,ZodiacCancerIcon:nL,ZodiacCapricorn:sL,ZodiacCapricornIcon:sL,ZodiacGemini:rL,ZodiacGeminiIcon:rL,ZodiacLeo:oL,ZodiacLeoIcon:oL,ZodiacLibra:iL,ZodiacLibraIcon:iL,ZodiacOphiuchus:cL,ZodiacOphiuchusIcon:cL,ZodiacPisces:lL,ZodiacPiscesIcon:lL,ZodiacSagittarius:dL,ZodiacSagittariusIcon:dL,ZodiacScorpio:AL,ZodiacScorpioIcon:AL,ZodiacTaurus:uL,ZodiacTaurusIcon:uL,ZodiacVirgo:hL,ZodiacVirgoIcon:hL,ZoomIn:pL,ZoomInIcon:pL,ZoomOut:fL,ZoomOutIcon:fL,createLucideIcon:h,icons:tSe,useLucideContext:AG},Symbol.toStringTag,{value:"Module"})),aSe={success:Sa,error:Xt,info:uu,warning:Gt},nSe={success:"border-l-success",error:"border-l-danger",info:"border-l-accent",warning:"border-l-warning"},sSe={success:"text-success",error:"text-danger",info:"text-accent",warning:"text-warning"},rSe={success:3e3,error:0,info:5e3,warning:5e3};function oSe({toast:t}){var o,c;const a=$(l=>l.removeToast),n=aSe[t.type]||uu,s=t.persistent?0:t.duration??rSe[t.type];return g.useEffect(()=>{if(!s)return;const l=setTimeout(()=>a(t.id),s);return()=>clearTimeout(l)},[t.id,s,a]),e.jsxs(as.div,{layout:!0,initial:{opacity:0,x:80,scale:.95},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:80,scale:.95},transition:{duration:.2},className:V("w-80 border border-border bg-surface-1 shadow-xl","border-l-2 flex items-center gap-3 px-4 py-3",nSe[t.type]),children:[e.jsx(n,{size:16,className:V("flex-shrink-0",sSe[t.type])}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm text-text-0 font-sans",children:t.message}),t.detail&&e.jsx("p",{className:"text-xs text-text-3 font-sans mt-0.5",children:t.detail})]}),(((o=t.action)==null?void 0:o.url)||((c=t.action)==null?void 0:c.onClick))&&e.jsx("button",{onClick:l=>{if(l.stopPropagation(),t.action.onClick)t.action.onClick();else if(t.action.url)try{window.open(t.action.url,"_blank","noopener")}catch{}a(t.id)},className:"text-xs font-medium text-accent hover:text-accent-hover bg-surface-5 hover:bg-surface-6 px-3 py-1.5 rounded transition-colors cursor-pointer flex-shrink-0 whitespace-nowrap",children:t.action.label||"Open"}),e.jsx("button",{onClick:l=>{l.stopPropagation(),a(t.id)},className:"p-1.5 text-text-4 hover:text-text-1 hover:bg-surface-5 rounded transition-colors cursor-pointer flex-shrink-0 z-10",children:e.jsx(Ge,{size:14})})]})}function hG(){const t=$(a=>a.toasts);return e.jsx("div",{className:"fixed bottom-10 left-[60px] z-[100] flex flex-col-reverse gap-2",children:e.jsx(Pu,{mode:"popLayout",children:t.slice(-3).map(a=>e.jsx(oSe,{toast:a},a.id))})})}const pD=[{id:"agents",icon:fu,label:"Agents"},{id:"chat",icon:Yn,label:"Chat"},{id:"editor",icon:Zt,label:"Editor"},{id:"dashboard",icon:nu,label:"Dashboard"},{id:"teams",icon:Fa,label:"Teams"},{id:"marketplace",icon:vu,label:"Marketplace"},{id:"toys",icon:QA,label:"Toys"},{id:"models",icon:on,label:"Models"},{id:"model-lab",icon:cu,label:"Model Lab"}],iSe={id:"network",icon:sa,label:"Network"},cSe={id:"preview",icon:na,label:"Preview"},lSe=[{id:"journalist",icon:Jo,label:"Journalist",panel:!0},{id:"settings",icon:Zr,label:"Settings",nav:!0}];function dSe({activeView:t,detailPanel:a,onNavigate:n,onTogglePanel:s}){const o=d2()&&dZ()==="darwin",c=$(u=>u.networkUnlocked);let A=$(u=>u.previewState.url)?[...pD,cSe]:pD;return c&&(A=[...A,iSe]),e.jsxs("nav",{className:"w-12 flex-shrink-0 flex flex-col bg-surface-3 border-r border-border",children:[o&&e.jsx("div",{className:"flex-shrink-0 h-9 flex items-end justify-center pb-0.5",children:e.jsx("img",{src:"/favicon.png",alt:"Groove",className:"h-6 w-6 rounded-full"})}),e.jsx("div",{className:"flex flex-col items-center gap-1.5 pt-2.5",children:A.map(u=>e.jsx(Nt,{content:u.label,side:"right",children:e.jsx("button",{onClick:()=>n(u.id),className:V("w-8 h-8 flex items-center justify-center rounded-md transition-colors cursor-pointer",t===u.id?"text-accent bg-accent/10":"text-text-3 hover:text-accent hover:bg-accent/10"),children:e.jsx(u.icon,{size:16,strokeWidth:t===u.id?2:1.5})})},u.id))}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex flex-col items-center gap-1.5 pb-3",children:lSe.map(u=>{const f=u.panel?(a==null?void 0:a.type)===u.id:t===u.id;return e.jsx(Nt,{content:u.label,side:"right",children:e.jsx("button",{onClick:()=>u.panel?s(u.id):n(u.id),className:V("w-8 h-8 flex items-center justify-center rounded-md transition-colors cursor-pointer",f?"text-accent bg-accent/10":"text-text-3 hover:text-accent hover:bg-accent/10"),children:e.jsx(u.icon,{size:16,strokeWidth:f?2:1.5})})},u.id)})})]})}function ASe({user:t,size:a=24}){const[n,s]=g.useState(!1),o=(t==null?void 0:t.avatar)||(t==null?void 0:t.picture)||(t==null?void 0:t.photoURL)||(t==null?void 0:t.photo);return o&&!n?e.jsx("img",{src:o,alt:"",className:"rounded-full",style:{width:a,height:a},referrerPolicy:"no-referrer",crossOrigin:"anonymous",onError:()=>s(!0)}):e.jsx("div",{className:"rounded-full bg-accent/10 flex items-center justify-center",style:{width:a,height:a},children:e.jsx(z0,{size:Math.round(a*.5),className:"text-accent"})})}function uSe(){const t=$(l=>l.marketplaceAuthenticated),a=$(l=>l.marketplaceUser);$(l=>l.marketplaceLogin);const n=$(l=>l.marketplaceLogout),[s,o]=g.useState(!1),c=g.useRef(null);return g.useEffect(()=>{if(!s)return;function l(A){c.current&&!c.current.contains(A.target)&&o(!1)}return document.addEventListener("mousedown",l,!0),()=>document.removeEventListener("mousedown",l,!0)},[s]),t?e.jsxs("div",{ref:c,className:"relative flex-shrink-0",children:[e.jsxs("button",{onClick:()=>o(!s),className:V("flex items-center gap-2 h-7 pl-2 pr-1 rounded-md transition-colors cursor-pointer select-none",s?"bg-surface-1 border border-border":"hover:bg-surface-1 border border-transparent"),children:[e.jsx("span",{className:"text-xs text-text-1 font-sans font-medium max-w-[100px] truncate",children:(a==null?void 0:a.displayName)||(a==null?void 0:a.id)||"Account"}),e.jsx(ASe,{user:a,size:20}),e.jsx(bt,{size:10,className:V("text-text-4 transition-transform",s&&"rotate-180")})]}),s&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 w-48 py-1 rounded-md bg-surface-1 border border-border shadow-lg z-50",children:[e.jsxs("div",{className:"px-3 py-2 border-b border-border-subtle",children:[e.jsx("p",{className:"text-xs font-medium text-text-0 font-sans truncate",children:(a==null?void 0:a.displayName)||"Account"}),(a==null?void 0:a.email)&&e.jsx("p",{className:"text-2xs text-text-4 font-sans truncate",children:a.email})]}),e.jsxs("a",{href:"https://docs.groovedev.ai",target:"_blank",rel:"noopener noreferrer",onClick:()=>o(!1),className:"flex items-center gap-2 px-3 py-1.5 text-xs text-text-2 hover:text-text-0 hover:bg-surface-3 font-sans cursor-pointer transition-colors",children:[e.jsx(Go,{size:12}),"Docs",e.jsx(ma,{size:9,className:"ml-auto text-text-4"})]}),e.jsxs("a",{href:"https://groovedev.ai",target:"_blank",rel:"noopener noreferrer",onClick:()=>o(!1),className:"flex items-center gap-2 px-3 py-1.5 text-xs text-text-2 hover:text-text-0 hover:bg-surface-3 font-sans cursor-pointer transition-colors",children:[e.jsx(ma,{size:12}),"groovedev.ai"]}),e.jsx("div",{className:"my-1 h-px bg-border-subtle"}),e.jsxs("button",{onClick:()=>{o(!1),n()},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-text-3 hover:text-danger hover:bg-surface-3 font-sans cursor-pointer transition-colors",children:[e.jsx(C0,{size:12}),"Sign out"]})]})]}):null}const hSe={agents:"Agents",editor:"Editor",dashboard:"Dashboard",marketplace:"Marketplace",teams:"Teams"};function pSe({activeView:t,connected:a,tunneled:n,daemonHost:s,editorActiveFile:o,onOpenCommandPalette:c}){const l=$(v=>v.projectDir),A=$(v=>v.toggleProjectPicker),u=["Groove",hSe[t]||t];t==="editor"&&o&&u.push(o.split("/").pop());const x=d2()&&dZ()==="darwin",[m,y]=g.useState(null);return g.useEffect(()=>{var v;if((v=window.groove)!=null&&v.getInstanceInfo)window.groove.getInstanceInfo().then(O=>{O!=null&&O.name&&y(O.name)});else{const O=new URLSearchParams(window.location.search).get("instance");O&&y(O)}},[]),e.jsxs("header",{className:V("h-11 flex-shrink-0 flex items-center gap-3 px-4 pt-0.5 bg-surface-3 border-b border-border relative",x&&"pl-24 electron-drag electron-no-drag-children"),children:[!x&&e.jsx("img",{src:"/favicon.png",alt:"Groove",className:"h-7 w-7 rounded-full flex-shrink-0"}),m&&e.jsxs("button",{onClick:()=>{var v,O;return(O=(v=window.groove)==null?void 0:v.openFolder)==null?void 0:O.call(v)},className:"text-2xs font-mono font-semibold text-accent bg-accent/10 px-1.5 py-0.5 rounded flex-shrink-0 hover:bg-accent/20 transition-colors cursor-pointer",children:["/",m]}),!m&&s&&e.jsx("span",{className:"text-2xs font-mono font-semibold text-text-3 bg-surface-5 px-1.5 py-0.5 rounded flex-shrink-0",children:s}),n&&l&&e.jsxs("button",{onClick:A,className:"flex items-center gap-1 text-2xs font-mono font-medium text-text-2 bg-surface-5 px-1.5 py-0.5 rounded flex-shrink-0 hover:bg-surface-4 hover:text-text-0 transition-colors cursor-pointer",title:l,children:[e.jsx(ga,{size:11}),l.split("/").pop()||"/"]}),e.jsx("div",{className:"flex-1 min-w-4"}),e.jsx("div",{className:"flex items-center gap-1 text-xs font-sans text-text-3 flex-shrink-0",children:u.map((v,O)=>e.jsxs("span",{className:"flex items-center gap-1",children:[O>0&&e.jsx(Rt,{size:11,className:"text-text-4"}),e.jsx("span",{className:V(O===u.length-1?"text-text-2":"text-text-4"),children:v})]},O))}),e.jsx(uSe,{}),e.jsxs("button",{onClick:c,className:V("absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center gap-2.5 h-8 px-4 rounded-md w-full max-w-md","bg-surface-1 border border-border-subtle","text-xs text-text-4 font-sans","hover:border-border hover:text-text-3 transition-colors cursor-pointer"),children:[e.jsx(oa,{size:14,className:"flex-shrink-0"}),e.jsx("span",{className:"flex-1 text-left",children:"Search commands..."}),e.jsx("kbd",{className:"text-2xs font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-4 ml-1",children:"Cmd+K"})]})]})}const fSe={running:"var(--color-success)",starting:"var(--color-warning)",stopped:"var(--color-text-3)",crashed:"var(--color-danger)",completed:"var(--color-accent)",killed:"var(--color-text-3)",rotating:"var(--color-purple)"};function qE(t){return fSe[t]||"var(--color-text-3)"}const xSe={planner:{bg:"rgba(74, 225, 104, 0.12)",text:"#4ae168",border:"#4ae168"},backend:{bg:"rgba(51, 175, 188, 0.12)",text:"#33afbc",border:"#33afbc"},frontend:{bg:"rgba(229, 192, 123, 0.12)",text:"#e5c07b",border:"#e5c07b"},fullstack:{bg:"rgba(74, 225, 104, 0.12)",text:"#4ae168",border:"#4ae168"},testing:{bg:"rgba(97, 175, 239, 0.12)",text:"#61afef",border:"#61afef"},devops:{bg:"rgba(209, 154, 102, 0.12)",text:"#d19a66",border:"#d19a66"},docs:{bg:"rgba(139, 146, 158, 0.12)",text:"#8b929e",border:"#8b929e"},security:{bg:"rgba(224, 108, 117, 0.12)",text:"#e06c75",border:"#e06c75"},database:{bg:"rgba(198, 120, 221, 0.12)",text:"#c678dd",border:"#c678dd"},cmo:{bg:"rgba(229, 192, 123, 0.12)",text:"#e5c07b",border:"#e5c07b"},cfo:{bg:"rgba(74, 225, 104, 0.12)",text:"#4ae168",border:"#4ae168"},ea:{bg:"rgba(97, 175, 239, 0.12)",text:"#61afef",border:"#61afef"},support:{bg:"rgba(51, 175, 188, 0.12)",text:"#33afbc",border:"#33afbc"},analyst:{bg:"rgba(198, 120, 221, 0.12)",text:"#c678dd",border:"#c678dd"},creative:{bg:"rgba(229, 192, 123, 0.12)",text:"#e5c07b",border:"#e5c07b"},slides:{bg:"rgba(209, 154, 102, 0.12)",text:"#d19a66",border:"#d19a66"},chat:{bg:"rgba(198, 120, 221, 0.12)",text:"#c678dd",border:"#c678dd"}};function On(t){const a=(t||"").toLowerCase();return xSe[a]||{bg:"rgba(139, 146, 158, 0.12)",text:"#8b929e",border:"#8b929e"}}function ia({status:t,size:a="md",className:n}){const s=t==="running"||t==="starting",o=a==="sm"?"w-1.5 h-1.5":a==="lg"?"w-3 h-3":"w-2 h-2";return e.jsx("span",{className:V("rounded-full inline-block flex-shrink-0",s&&"animate-pulse",o,n),style:{background:qE(t)}})}const mSe={default:"bg-surface-4 text-text-2",accent:"bg-accent/12 text-accent",success:"bg-success/12 text-success",warning:"bg-warning/12 text-warning",danger:"bg-danger/12 text-danger",info:"bg-info/12 text-info",purple:"bg-purple/12 text-purple",orange:"bg-orange/12 text-orange"};function be({children:t,variant:a="default",className:n,dot:s,...o}){return e.jsxs("span",{className:V("inline-flex items-center gap-1 px-1.5 py-0.5","text-2xs font-semibold uppercase tracking-wider rounded","font-sans select-none whitespace-nowrap",mSe[a],n),...o,children:[s&&e.jsx("span",{className:V("w-1.5 h-1.5 rounded-full",s==="pulse"&&"animate-pulse"),style:{background:"currentColor"}}),t]})}function pt(t){return t==null||isNaN(t)?"0":t>=1e9?(t/1e9).toFixed(1).replace(/\.0$/,"")+"B":t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"k":Math.round(t).toLocaleString()}function Ai(t){return t==null||isNaN(t)?"$0":t>=1e3?"$"+(t/1e3).toFixed(1).replace(/\.0$/,"")+"k":t>=1||t>=.01?"$"+t.toFixed(2):"$"+t.toFixed(3)}function us(t){return t==null||isNaN(t)?"0%":Math.round(t)+"%"}function WA(t){if(!t||t<0)return"0s";const a=Math.floor(t/86400),n=Math.floor(t%86400/3600),s=Math.floor(t%3600/60),o=Math.floor(t%60);return a>0?`${a}d ${n}h`:n>0?`${n}h ${s}m`:s>0?`${s}m ${o}s`:`${o}s`}function Mt(t){if(!t)return"";const a=(Date.now()-new Date(t).getTime())/1e3;return a<5?"just now":a<60?`${Math.floor(a)}s ago`:a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:`${Math.floor(a/86400)}d ago`}var pU="focusScope.autoFocusOnMount",fU="focusScope.autoFocusOnUnmount",fD={bubbles:!1,cancelable:!0},gSe="FocusScope",mT=g.forwardRef((t,a)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:o,onUnmountAutoFocus:c,...l}=t,[A,u]=g.useState(null),f=xa(o),x=xa(c),m=g.useRef(null),y=rt(a,b=>u(b)),v=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let b=function(M){if(v.paused||!A)return;const Q=M.target;A.contains(Q)?m.current=Q:To(m.current,{select:!0})},C=function(M){if(v.paused||!A)return;const Q=M.relatedTarget;Q!==null&&(A.contains(Q)||To(m.current,{select:!0}))},j=function(M){if(document.activeElement===document.body)for(const L of M)L.removedNodes.length>0&&To(A)};document.addEventListener("focusin",b),document.addEventListener("focusout",C);const N=new MutationObserver(j);return A&&N.observe(A,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",C),N.disconnect()}}},[s,A,v.paused]),g.useEffect(()=>{if(A){mD.add(v);const b=document.activeElement;if(!A.contains(b)){const j=new CustomEvent(pU,fD);A.addEventListener(pU,f),A.dispatchEvent(j),j.defaultPrevented||(ySe(wSe(pG(A)),{select:!0}),document.activeElement===b&&To(A))}return()=>{A.removeEventListener(pU,f),setTimeout(()=>{const j=new CustomEvent(fU,fD);A.addEventListener(fU,x),A.dispatchEvent(j),j.defaultPrevented||To(b??document.body,{select:!0}),A.removeEventListener(fU,x),mD.remove(v)},0)}}},[A,f,x,v]);const O=g.useCallback(b=>{if(!n&&!s||v.paused)return;const C=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,j=document.activeElement;if(C&&j){const N=b.currentTarget,[M,Q]=vSe(N);M&&Q?!b.shiftKey&&j===Q?(b.preventDefault(),n&&To(M,{select:!0})):b.shiftKey&&j===M&&(b.preventDefault(),n&&To(Q,{select:!0})):j===N&&b.preventDefault()}},[n,s,v.paused]);return e.jsx(Ve.div,{tabIndex:-1,...l,ref:y,onKeyDown:O})});mT.displayName=gSe;function ySe(t,{select:a=!1}={}){const n=document.activeElement;for(const s of t)if(To(s,{select:a}),document.activeElement!==n)return}function vSe(t){const a=pG(t),n=xD(a,t),s=xD(a.reverse(),t);return[n,s]}function pG(t){const a=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)a.push(n.currentNode);return a}function xD(t,a){for(const n of t)if(!kSe(n,{upTo:a}))return n}function kSe(t,{upTo:a}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(a!==void 0&&t===a)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function OSe(t){return t instanceof HTMLInputElement&&"select"in t}function To(t,{select:a=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&OSe(t)&&a&&t.select()}}var mD=bSe();function bSe(){let t=[];return{add(a){const n=t[0];a!==n&&(n==null||n.pause()),t=gD(t,a),t.unshift(a)},remove(a){var n;t=gD(t,a),(n=t[0])==null||n.resume()}}}function gD(t,a){const n=[...t],s=n.indexOf(a);return s!==-1&&n.splice(s,1),n}function wSe(t){return t.filter(a=>a.tagName!=="A")}var xU=0;function DE(){g.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??yD()),document.body.insertAdjacentElement("beforeend",t[1]??yD()),xU++,()=>{xU===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),xU--}},[])}function yD(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Zs=function(){return Zs=Object.assign||function(a){for(var n,s=1,o=arguments.length;s<o;s++){n=arguments[s];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(a[c]=n[c])}return a},Zs.apply(this,arguments)};function fG(t,a){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&a.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);o<s.length;o++)a.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(n[s[o]]=t[s[o]]);return n}function jSe(t,a,n){if(n||arguments.length===2)for(var s=0,o=a.length,c;s<o;s++)(c||!(s in a))&&(c||(c=Array.prototype.slice.call(a,0,s)),c[s]=a[s]);return t.concat(c||Array.prototype.slice.call(a))}var xL="right-scroll-bar-position",mL="width-before-scroll-bar",CSe="with-scroll-bars-hidden",NSe="--removed-body-scroll-bar-size";function mU(t,a){return typeof t=="function"?t(a):t&&(t.current=a),t}function MSe(t,a){var n=g.useState(function(){return{value:t,callback:a,facade:{get current(){return n.value},set current(s){var o=n.value;o!==s&&(n.value=s,n.callback(s,o))}}}})[0];return n.callback=a,n.facade}var SSe=typeof window<"u"?g.useLayoutEffect:g.useEffect,vD=new WeakMap;function QSe(t,a){var n=MSe(null,function(s){return t.forEach(function(o){return mU(o,s)})});return SSe(function(){var s=vD.get(n);if(s){var o=new Set(s),c=new Set(t),l=n.current;o.forEach(function(A){c.has(A)||mU(A,null)}),c.forEach(function(A){o.has(A)||mU(A,l)})}vD.set(n,t)},[t]),n}function BSe(t){return t}function _Se(t,a){a===void 0&&(a=BSe);var n=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(c){var l=a(c,s);return n.push(l),function(){n=n.filter(function(A){return A!==l})}},assignSyncMedium:function(c){for(s=!0;n.length;){var l=n;n=[],l.forEach(c)}n={push:function(A){return c(A)},filter:function(){return n}}},assignMedium:function(c){s=!0;var l=[];if(n.length){var A=n;n=[],A.forEach(c),l=n}var u=function(){var x=l;l=[],x.forEach(c)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(x){l.push(x),f()},filter:function(x){return l=l.filter(x),n}}}};return o}function LSe(t){t===void 0&&(t={});var a=_Se(null);return a.options=Zs({async:!0,ssr:!1},t),a}var xG=function(t){var a=t.sideCar,n=fG(t,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=a.read();if(!s)throw new Error("Sidecar medium not found");return g.createElement(s,Zs({},n))};xG.isSideCarExport=!0;function TSe(t,a){return t.useMedium(a),xG}var mG=LSe(),gU=function(){},gT=g.forwardRef(function(t,a){var n=g.useRef(null),s=g.useState({onScrollCapture:gU,onWheelCapture:gU,onTouchMoveCapture:gU}),o=s[0],c=s[1],l=t.forwardProps,A=t.children,u=t.className,f=t.removeScrollBar,x=t.enabled,m=t.shards,y=t.sideCar,v=t.noRelative,O=t.noIsolation,b=t.inert,C=t.allowPinchZoom,j=t.as,N=j===void 0?"div":j,M=t.gapMode,Q=fG(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=y,B=QSe([n,a]),S=Zs(Zs({},Q),o);return g.createElement(g.Fragment,null,x&&g.createElement(L,{sideCar:mG,removeScrollBar:f,shards:m,noRelative:v,noIsolation:O,inert:b,setCallbacks:c,allowPinchZoom:!!C,lockRef:n,gapMode:M}),l?g.cloneElement(g.Children.only(A),Zs(Zs({},S),{ref:B})):g.createElement(N,Zs({},S,{className:u,ref:B}),A))});gT.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gT.classNames={fullWidth:mL,zeroRight:xL};var $Se=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ISe(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var a=$Se();return a&&t.setAttribute("nonce",a),t}function USe(t,a){t.styleSheet?t.styleSheet.cssText=a:t.appendChild(document.createTextNode(a))}function PSe(t){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(t)}var ESe=function(){var t=0,a=null;return{add:function(n){t==0&&(a=ISe())&&(USe(a,n),PSe(a)),t++},remove:function(){t--,!t&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},zSe=function(){var t=ESe();return function(a,n){g.useEffect(function(){return t.add(a),function(){t.remove()}},[a&&n])}},gG=function(){var t=zSe(),a=function(n){var s=n.styles,o=n.dynamic;return t(s,o),null};return a},FSe={left:0,top:0,right:0,gap:0},yU=function(t){return parseInt(t||"",10)||0},RSe=function(t){var a=window.getComputedStyle(document.body),n=a[t==="padding"?"paddingLeft":"marginLeft"],s=a[t==="padding"?"paddingTop":"marginTop"],o=a[t==="padding"?"paddingRight":"marginRight"];return[yU(n),yU(s),yU(o)]},HSe=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return FSe;var a=RSe(t),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,s-n+a[2]-a[0])}},qSe=gG(),Cu="data-scroll-locked",DSe=function(t,a,n,s){var o=t.left,c=t.top,l=t.right,A=t.gap;return n===void 0&&(n="margin"),`
8571
+ */const tSe=Object.freeze(Object.defineProperty({__proto__:null,AArrowDown:Qf,AArrowUp:Bf,ALargeSmall:_f,Accessibility:Lf,Activity:Ys,AirVent:Tf,Airplay:$f,AlarmClock:Uf,AlarmClockCheck:$i,AlarmClockMinus:Ii,AlarmClockOff:If,AlarmClockPlus:Ui,AlarmSmoke:Pf,Album:Ef,AlignCenterHorizontal:zf,AlignCenterVertical:Ff,AlignEndHorizontal:Rf,AlignEndVertical:Hf,AlignHorizontalDistributeCenter:qf,AlignHorizontalDistributeEnd:Df,AlignHorizontalDistributeStart:Vf,AlignHorizontalJustifyCenter:Xf,AlignHorizontalJustifyEnd:Zf,AlignHorizontalJustifyStart:Gf,AlignHorizontalSpaceAround:Wf,AlignHorizontalSpaceBetween:Yf,AlignStartHorizontal:Kf,AlignStartVertical:Jf,AlignVerticalDistributeCenter:ex,AlignVerticalDistributeEnd:tx,AlignVerticalDistributeStart:ax,AlignVerticalJustifyCenter:nx,AlignVerticalJustifyEnd:rx,AlignVerticalJustifyStart:sx,AlignVerticalSpaceAround:ox,AlignVerticalSpaceBetween:ix,Ambulance:cx,Ampersand:lx,Ampersands:Ax,Amphora:dx,Anchor:ux,Angry:hx,Annoyed:px,Antenna:fx,Anvil:xx,Aperture:mx,AppWindow:yx,AppWindowMac:gx,Apple:vx,Archive:CA,ArchiveRestore:kx,ArchiveX:Ox,Armchair:bx,ArrowBigDown:jx,ArrowBigDownDash:wx,ArrowBigLeft:Nx,ArrowBigLeftDash:Cx,ArrowBigRight:Sx,ArrowBigRightDash:Mx,ArrowBigUp:Qx,ArrowBigUpDash:Bx,ArrowDown:i0,ArrowDown01:_x,ArrowDown10:Lx,ArrowDownAZ:Pi,ArrowDownFromLine:Tx,ArrowDownLeft:o0,ArrowDownNarrowWide:$x,ArrowDownRight:Ix,ArrowDownToDot:Ux,ArrowDownToLine:Px,ArrowDownUp:Ex,ArrowDownWideNarrow:Ei,ArrowDownZA:zi,ArrowLeft:J1,ArrowLeftFromLine:zx,ArrowLeftRight:Fx,ArrowLeftToLine:Rx,ArrowRight:Fr,ArrowRightFromLine:Hx,ArrowRightLeft:qx,ArrowRightToLine:Dx,ArrowUp:eu,ArrowUp01:Vx,ArrowUp10:Xx,ArrowUpAZ:Fi,ArrowUpDown:Zx,ArrowUpFromDot:Gx,ArrowUpFromLine:Wx,ArrowUpLeft:Kx,ArrowUpNarrowWide:Ri,ArrowUpRight:c0,ArrowUpToLine:Yx,ArrowUpWideNarrow:Jx,ArrowUpZA:Hi,ArrowsUpFromLine:em,Asterisk:tm,AtSign:am,Atom:nm,AudioLines:sm,AudioWaveform:rm,Award:om,Axe:im,Axis3d:qi,Baby:cm,Backpack:lm,Badge:jm,BadgeAlert:dm,BadgeCent:Am,BadgeCheck:Di,BadgeDollarSign:um,BadgeEuro:hm,BadgeIndianRupee:pm,BadgeInfo:fm,BadgeJapaneseYen:xm,BadgeMinus:mm,BadgePercent:gm,BadgePlus:ym,BadgePoundSterling:vm,BadgeQuestionMark:Vi,BadgeRussianRuble:km,BadgeSwissFranc:Om,BadgeTurkishLira:bm,BadgeX:wm,BaggageClaim:Cm,Balloon:Nm,Ban:Mm,Banana:Sm,Bandage:Qm,Banknote:Tm,BanknoteArrowDown:Bm,BanknoteArrowUp:_m,BanknoteX:Lm,Barcode:$m,Barrel:Im,Baseline:Um,Bath:Pm,Battery:Dm,BatteryCharging:Em,BatteryFull:zm,BatteryLow:Fm,BatteryMedium:Rm,BatteryPlus:Hm,BatteryWarning:qm,Beaker:Vm,Bean:Zm,BeanOff:Xm,Bed:Km,BedDouble:Gm,BedSingle:Wm,Beef:Jm,BeefOff:Ym,Beer:tg,BeerOff:eg,Bell:lg,BellCheck:ag,BellDot:ng,BellElectric:sg,BellMinus:rg,BellOff:og,BellPlus:ig,BellRing:cg,BetweenHorizontalEnd:Xi,BetweenHorizontalStart:Zi,BetweenVerticalEnd:dg,BetweenVerticalStart:Ag,BicepsFlexed:ug,Bike:hg,Binary:pg,Binoculars:fg,Biohazard:xg,Bird:mg,Birdhouse:gg,Bitcoin:yg,Blend:vg,Blinds:kg,Blocks:Og,Bluetooth:Cg,BluetoothConnected:bg,BluetoothOff:wg,BluetoothSearching:jg,Bold:Ng,Bolt:Mg,Bomb:l0,Bone:Sg,Book:Jg,BookA:Qg,BookAlert:Bg,BookAudio:_g,BookCheck:Lg,BookCopy:Tg,BookDashed:Gi,BookDown:$g,BookHeadphones:Ig,BookHeart:Ug,BookImage:Pg,BookKey:Eg,BookLock:zg,BookMarked:Fg,BookMinus:Rg,BookOpen:Go,BookOpenCheck:Hg,BookOpenText:qg,BookPlus:Dg,BookSearch:Vg,BookText:Xg,BookType:Zg,BookUp:Wg,BookUp2:Gg,BookUser:Kg,BookX:Yg,Bookmark:sy,BookmarkCheck:d0,BookmarkMinus:ey,BookmarkOff:ty,BookmarkPlus:ay,BookmarkX:ny,BoomBox:ry,Bot:Os,BotMessageSquare:oy,BotOff:iy,BottleWine:cy,BowArrow:ly,Box:on,Boxes:dy,Braces:Wi,Brackets:Ay,Brain:A0,BrainCircuit:uy,BrainCog:hy,BrickWall:xy,BrickWallFire:py,BrickWallShield:fy,Briefcase:vy,BriefcaseBusiness:my,BriefcaseConveyorBelt:gy,BriefcaseMedical:yy,BringToFront:ky,Brush:by,BrushCleaning:Oy,Bubbles:wy,Bug:Ny,BugOff:jy,BugPlay:Cy,Building:My,Building2:Sy,Bus:By,BusFront:Qy,Cable:_y,CableCar:Ly,Cake:$y,CakeSlice:Ty,Calculator:tu,Calendar:Wo,Calendar1:Iy,CalendarArrowDown:Uy,CalendarArrowUp:Py,CalendarCheck:zy,CalendarCheck2:Ey,CalendarClock:Fy,CalendarCog:Ry,CalendarDays:Hy,CalendarFold:qy,CalendarHeart:Dy,CalendarMinus:Xy,CalendarMinus2:Vy,CalendarOff:Zy,CalendarPlus:Wy,CalendarPlus2:Gy,CalendarRange:Ky,CalendarSearch:Yy,CalendarSync:Jy,CalendarX:tv,CalendarX2:ev,Calendars:av,Camera:au,CameraOff:nv,Candy:ov,CandyCane:sv,CandyOff:rv,Cannabis:cv,CannabisOff:iv,Captions:Ki,CaptionsOff:lv,Car:uv,CarFront:dv,CarTaxiFront:Av,Caravan:hv,CardSim:pv,Carrot:fv,CaseLower:xv,CaseSensitive:mv,CaseUpper:gv,CassetteTape:yv,Cast:vv,Castle:kv,Cat:Ov,Cctv:wv,CctvOff:bv,ChartArea:Yi,ChartBar:ec,ChartBarBig:Ji,ChartBarDecreasing:jv,ChartBarIncreasing:Cv,ChartBarStacked:Nv,ChartCandlestick:tc,ChartColumn:hs,ChartColumnBig:ac,ChartColumnDecreasing:Mv,ChartColumnIncreasing:nc,ChartColumnStacked:Sv,ChartGantt:Qv,ChartLine:sc,ChartNetwork:Bv,ChartNoAxesColumn:oc,ChartNoAxesColumnDecreasing:_v,ChartNoAxesColumnIncreasing:rc,ChartNoAxesCombined:Lv,ChartNoAxesGantt:ic,ChartPie:cc,ChartScatter:lc,ChartSpline:nu,Check:De,CheckCheck:Tv,CheckLine:$v,ChefHat:Iv,Cherry:Uv,ChessBishop:Pv,ChessKing:Ev,ChessKnight:zv,ChessPawn:Fv,ChessQueen:Rv,ChessRook:Hv,ChevronDown:bt,ChevronFirst:qv,ChevronLast:Dv,ChevronLeft:bs,ChevronRight:Rt,ChevronUp:su,ChevronsDown:Vv,ChevronsDownUp:ru,ChevronsLeft:Gv,ChevronsLeftRight:Zv,ChevronsLeftRightEllipsis:Xv,ChevronsRight:Kv,ChevronsRightLeft:Wv,ChevronsUp:Jv,ChevronsUpDown:Yv,Church:ek,Cigarette:ak,CigaretteOff:tk,Circle:mk,CircleAlert:Xt,CircleArrowDown:dc,CircleArrowLeft:Ac,CircleArrowOutDownLeft:hc,CircleArrowOutDownRight:uc,CircleArrowOutUpLeft:pc,CircleArrowOutUpRight:xc,CircleArrowRight:fc,CircleArrowUp:za,CircleCheck:Hn,CircleCheckBig:Sa,CircleChevronDown:mc,CircleChevronLeft:gc,CircleChevronRight:yc,CircleChevronUp:vc,CircleDashed:nk,CircleDivide:kc,CircleDollarSign:sk,CircleDot:ok,CircleDotDashed:rk,CircleEllipsis:ik,CircleEqual:ck,CircleFadingArrowUp:lk,CircleFadingPlus:dk,CircleGauge:Oc,CircleMinus:bc,CircleOff:Ak,CircleParking:jc,CircleParkingOff:wc,CirclePause:Cc,CirclePercent:Nc,CirclePile:uk,CirclePlay:Mc,CirclePlus:Sc,CirclePoundSterling:hk,CirclePower:Qc,CircleQuestionMark:Na,CircleSlash:pk,CircleSlash2:Bc,CircleSmall:fk,CircleStar:xk,CircleStop:_c,CircleUser:Tc,CircleUserRound:Lc,CircleX:qn,CircuitBoard:gk,Citrus:vk,Clapperboard:yk,Clipboard:Sk,ClipboardCheck:u0,ClipboardClock:kk,ClipboardCopy:Ok,ClipboardList:bk,ClipboardMinus:wk,ClipboardPaste:jk,ClipboardPen:Ic,ClipboardPenLine:$c,ClipboardPlus:Ck,ClipboardType:Nk,ClipboardX:Mk,Clock:Rr,Clock1:Qk,Clock10:Bk,Clock11:_k,Clock12:Lk,Clock2:Tk,Clock3:$k,Clock4:Ik,Clock5:Uk,Clock6:Pk,Clock7:Ek,Clock8:zk,Clock9:Fk,ClockAlert:Rk,ClockArrowDown:Hk,ClockArrowUp:qk,ClockCheck:Dk,ClockFading:Vk,ClockPlus:Xk,ClosedCaption:Zk,Cloud:NA,CloudAlert:Gk,CloudBackup:Wk,CloudCheck:Kk,CloudCog:Yk,CloudDownload:Uc,CloudDrizzle:Jk,CloudFog:eO,CloudHail:tO,CloudLightning:aO,CloudMoon:sO,CloudMoonRain:nO,CloudOff:rO,CloudRain:iO,CloudRainWind:oO,CloudSnow:cO,CloudSun:dO,CloudSunRain:lO,CloudSync:AO,CloudUpload:Pc,Cloudy:uO,Clover:hO,Club:pO,Code:fO,CodeXml:Zt,Coffee:xO,Cog:mO,Coins:gO,Columns2:Ec,Columns3:zc,Columns3Cog:Es,Columns4:yO,Combine:vO,Command:kO,Compass:OO,Component:bO,Computer:wO,ConciergeBell:jO,Cone:NO,Construction:CO,Contact:MO,ContactRound:Fc,Container:SO,Contrast:QO,Cookie:BO,CookingPot:_O,Copy:wn,CopyCheck:LO,CopyMinus:TO,CopyPlus:$O,CopySlash:IO,CopyX:UO,Copyleft:PO,Copyright:EO,CornerDownLeft:zO,CornerDownRight:FO,CornerLeftDown:RO,CornerLeftUp:qO,CornerRightDown:HO,CornerRightUp:DO,CornerUpLeft:VO,CornerUpRight:XO,Cpu:Ba,CreativeCommons:ZO,CreditCard:GO,Croissant:WO,Crop:KO,Cross:YO,Crosshair:JO,Crown:e4,Cuboid:t4,CupSoda:a4,Currency:n4,Cylinder:s4,Dam:r4,Database:MA,DatabaseBackup:o4,DatabaseSearch:i4,DatabaseZap:c4,DecimalsArrowLeft:l4,DecimalsArrowRight:d4,Delete:A4,Dessert:u4,Diameter:h4,Diamond:x4,DiamondMinus:p4,DiamondPercent:Rc,DiamondPlus:f4,Dice1:m4,Dice2:g4,Dice3:y4,Dice4:v4,Dice5:k4,Dice6:O4,Dices:b4,Diff:w4,Disc:N4,Disc2:j4,Disc3:M4,DiscAlbum:C4,Divide:S4,Dna:B4,DnaOff:Q4,Dock:_4,Dog:L4,DollarSign:h0,Donut:T4,DoorClosed:I4,DoorClosedLocked:$4,DoorOpen:U4,Dot:P4,Download:_a,DraftingCompass:E4,Drama:z4,Drill:F4,Drone:R4,Droplet:q4,DropletOff:H4,Droplets:D4,Drum:V4,Drumstick:X4,Dumbbell:Z4,Ear:W4,EarOff:G4,Earth:Hc,EarthLock:K4,Eclipse:Y4,Egg:t5,EggFried:J4,EggOff:e5,Ellipse:a5,Ellipsis:Uo,EllipsisVertical:qc,Equal:r5,EqualApproximately:n5,EqualNot:s5,Eraser:o5,EthernetPort:i5,Euro:c5,EvCharger:l5,Expand:d5,ExternalLink:ma,Eye:na,EyeClosed:A5,EyeOff:jn,Factory:u5,Fan:h5,FastForward:p5,Feather:f5,Fence:x5,FerrisWheel:m5,File:iu,FileArchive:g5,FileAxis3d:Dc,FileBadge:Vc,FileBox:y5,FileBraces:Gc,FileBracesCorner:Xc,FileChartColumn:Wc,FileChartColumnIncreasing:Zc,FileChartLine:Kc,FileChartPie:Yc,FileCheck:v5,FileCheckCorner:Jc,FileClock:k5,FileCode:ou,FileCodeCorner:el,FileCog:tl,FileDiff:O5,FileDigit:b5,FileDown:w5,FileExclamationPoint:al,FileHeadphone:zs,FileHeart:j5,FileImage:C5,FileInput:N5,FileKey:nl,FileLock:sl,FileMinus:S5,FileMinusCorner:rl,FileMusic:M5,FileOutput:Q5,FilePen:ps,FilePenLine:ol,FilePlay:il,FilePlus:Hr,FilePlusCorner:cl,FileQuestionMark:ll,FileScan:B5,FileSearch:_5,FileSearchCorner:dl,FileSignal:Al,FileSliders:L5,FileSpreadsheet:T5,FileStack:$5,FileSymlink:I5,FileTerminal:U5,FileText:Va,FileType:P5,FileTypeCorner:ul,FileUp:E5,FileUser:z5,FileVideoCamera:hl,FileVolume:F5,FileX:R5,FileXCorner:pl,Files:H5,Film:q5,FingerprintPattern:fl,FireExtinguisher:D5,Fish:W5,FishOff:V5,FishSymbol:X5,FishingHook:Z5,FishingRod:G5,Flag:eb,FlagOff:K5,FlagTriangleLeft:Y5,FlagTriangleRight:J5,Flame:p0,FlameKindling:tb,Flashlight:nb,FlashlightOff:ab,FlaskConical:cu,FlaskConicalOff:sb,FlaskRound:rb,FlipHorizontal2:ob,FlipVertical2:ib,Flower:lb,Flower2:cb,Focus:db,FoldHorizontal:Ab,FoldVertical:ub,Folder:Ko,FolderArchive:hb,FolderCheck:pb,FolderClock:fb,FolderClosed:f0,FolderCode:xb,FolderCog:xl,FolderDot:mb,FolderDown:gb,FolderGit:vb,FolderGit2:yb,FolderHeart:kb,FolderInput:Ob,FolderKanban:bb,FolderKey:wb,FolderLock:jb,FolderMinus:Cb,FolderOpen:ga,FolderOpenDot:Nb,FolderOutput:Mb,FolderPen:ml,FolderPlus:qr,FolderRoot:Sb,FolderSearch:SA,FolderSearch2:Qb,FolderSymlink:Bb,FolderSync:_b,FolderTree:Lb,FolderUp:Tb,FolderX:$b,Folders:Ib,Footprints:Ub,Forklift:Pb,Form:Eb,Forward:zb,Frame:Fb,Frown:Rb,Fuel:Hb,Fullscreen:qb,Funnel:yl,FunnelPlus:Db,FunnelX:gl,GalleryHorizontal:Vb,GalleryHorizontalEnd:Xb,GalleryThumbnails:Zb,GalleryVertical:Wb,GalleryVerticalEnd:Gb,Gamepad:Kb,Gamepad2:QA,GamepadDirectional:Yb,Gauge:x0,Gavel:Jb,Gem:e3,GeorgianLari:t3,Ghost:a3,Gift:m0,GitBranch:Js,GitBranchMinus:n3,GitBranchPlus:s3,GitCommitHorizontal:vl,GitCommitVertical:r3,GitCompare:o3,GitCompareArrows:g0,GitFork:i3,GitGraph:c3,GitMerge:d3,GitMergeConflict:l3,GitPullRequest:x3,GitPullRequestArrow:A3,GitPullRequestClosed:u3,GitPullRequestCreate:p3,GitPullRequestCreateArrow:h3,GitPullRequestDraft:f3,GlassWater:m3,Glasses:g3,Globe:sa,GlobeLock:y3,GlobeOff:v3,GlobeX:k3,Goal:O3,Gpu:b3,GraduationCap:w3,Grape:j3,Grid2x2:wl,Grid2x2Check:kl,Grid2x2Plus:Ol,Grid2x2X:bl,Grid3x2:C3,Grid3x3:Fs,Grip:N3,GripHorizontal:lu,GripVertical:y0,Group:M3,Guitar:Q3,Ham:S3,Hamburger:B3,Hammer:_3,Hand:P3,HandCoins:L3,HandFist:T3,HandGrab:jl,HandHeart:$3,HandHelping:Cl,HandMetal:I3,HandPlatter:U3,Handbag:E3,Handshake:z3,HardDrive:Kn,HardDriveDownload:F3,HardDriveUpload:R3,HardHat:H3,Hash:du,HatGlasses:D3,Haze:q3,Hd:V3,HdmiPort:X3,Heading:J3,Heading1:G3,Heading2:Z3,Heading3:W3,Heading4:K3,Heading5:Y3,Heading6:ew,HeadphoneOff:tw,Headphones:Au,Headset:aw,Heart:v0,HeartCrack:nw,HeartHandshake:sw,HeartMinus:rw,HeartOff:ow,HeartPlus:iw,HeartPulse:cw,HeartX:lw,Heater:dw,Helicopter:Aw,Hexagon:uw,Highlighter:hw,History:pw,Hop:xw,HopOff:fw,Hospital:mw,Hotel:gw,Hourglass:yw,House:Po,HouseHeart:vw,HousePlug:kw,HousePlus:Ow,HouseWifi:bw,IceCreamBowl:Nl,IceCreamCone:Ml,IdCard:jw,IdCardLanyard:ww,Image:Zn,ImageDown:Cw,ImageMinus:Mw,ImageOff:Nw,ImagePlay:Sw,ImagePlus:Qw,ImageUp:Bw,ImageUpscale:_w,Images:Lw,Import:Tw,Inbox:$w,IndianRupee:Iw,Infinity:Uw,Info:uu,InspectionPanel:Pw,Italic:Ew,IterationCcw:zw,IterationCw:Fw,JapaneseYen:Rw,Joystick:Hw,Kanban:qw,Kayak:Dw,Key:ws,KeyRound:hu,KeySquare:Vw,Keyboard:Gw,KeyboardMusic:Xw,KeyboardOff:Zw,Lamp:t8,LampCeiling:Kw,LampDesk:Ww,LampFloor:Yw,LampWallDown:Jw,LampWallUp:e8,LandPlot:a8,Landmark:n8,Languages:s8,Laptop:o8,LaptopMinimal:Sl,LaptopMinimalCheck:r8,Lasso:c8,LassoSelect:i8,Laugh:l8,Layers:Dn,Layers2:d8,LayersMinus:A8,LayersPlus:u8,LayoutDashboard:k0,LayoutGrid:O0,LayoutList:h8,LayoutPanelLeft:p8,LayoutPanelTop:f8,LayoutTemplate:x8,Leaf:m8,LeafyGreen:g8,Lectern:y8,LensConcave:v8,LensConvex:O8,Library:b8,LibraryBig:k8,LifeBuoy:j8,Ligature:w8,Lightbulb:N8,LightbulbOff:C8,LineDotRightHorizontal:M8,LineSquiggle:S8,LineStyle:Q8,Link:b0,Link2:Yo,Link2Off:B8,List:G8,ListCheck:_8,ListChecks:w0,ListChevronsDownUp:L8,ListChevronsUpDown:$8,ListCollapse:T8,ListEnd:I8,ListFilter:P8,ListFilterPlus:U8,ListIndentDecrease:Rs,ListIndentIncrease:Hs,ListMinus:E8,ListMusic:z8,ListOrdered:F8,ListPlus:R8,ListRestart:H8,ListStart:q8,ListTodo:D8,ListTree:X8,ListVideo:V8,ListX:Z8,Loader:K8,LoaderCircle:$e,LoaderPinwheel:W8,Locate:e6,LocateFixed:Y8,LocateOff:J8,Lock:j0,LockKeyhole:t6,LockKeyholeOpen:Ql,LockOpen:Bl,LogIn:pu,LogOut:C0,Logs:a6,Lollipop:n6,Luggage:s6,Magnet:r6,Mail:h6,MailCheck:o6,MailMinus:i6,MailOpen:c6,MailPlus:l6,MailQuestionMark:_l,MailSearch:d6,MailWarning:A6,MailX:u6,Mailbox:p6,Mails:f6,Map:N0,MapMinus:m6,MapPin:S6,MapPinCheck:g6,MapPinCheckInside:x6,MapPinHouse:y6,MapPinMinus:k6,MapPinMinusInside:v6,MapPinOff:O6,MapPinPen:Ll,MapPinPlus:w6,MapPinPlusInside:b6,MapPinSearch:j6,MapPinX:N6,MapPinXInside:C6,MapPinned:M6,MapPlus:Q6,Mars:_6,MarsStroke:B6,Martini:L6,Maximize:T6,Maximize2:BA,Medal:$6,Megaphone:_A,MegaphoneOff:I6,Meh:U6,MemoryStick:M0,Menu:P6,Merge:E6,MessageCircle:Yn,MessageCircleCheck:z6,MessageCircleCode:F6,MessageCircleDashed:R6,MessageCircleHeart:H6,MessageCircleMore:q6,MessageCircleOff:D6,MessageCirclePlus:V6,MessageCircleQuestionMark:Tl,MessageCircleReply:X6,MessageCircleWarning:Z6,MessageCircleX:G6,MessageSquare:Cn,MessageSquareCheck:W6,MessageSquareCode:K6,MessageSquareDashed:Y6,MessageSquareDiff:J6,MessageSquareDot:tj,MessageSquareHeart:aj,MessageSquareLock:ej,MessageSquareMore:nj,MessageSquareOff:sj,MessageSquarePlus:rj,MessageSquareQuote:oj,MessageSquareReply:ij,MessageSquareShare:cj,MessageSquareText:lj,MessageSquareWarning:dj,MessageSquareX:Aj,MessagesSquare:uj,Metronome:hj,Mic:fj,MicOff:pj,MicVocal:$l,Microchip:xj,Microscope:mj,Microwave:yj,Milestone:gj,Milk:kj,MilkOff:vj,Minimize:Oj,Minimize2:S0,Minus:bj,MirrorRectangular:wj,MirrorRound:jj,Monitor:Dr,MonitorCheck:Cj,MonitorCloud:Nj,MonitorCog:Mj,MonitorDot:Sj,MonitorDown:Qj,MonitorOff:Bj,MonitorPause:_j,MonitorPlay:Lj,MonitorSmartphone:Tj,MonitorSpeaker:$j,MonitorStop:Ij,MonitorUp:Uj,MonitorX:Q0,Moon:Ej,MoonStar:Pj,Motorbike:zj,Mountain:Rj,MountainSnow:Fj,Mouse:Kj,MouseLeft:Hj,MouseOff:qj,MousePointer:Gj,MousePointer2:Vj,MousePointer2Off:Dj,MousePointerBan:Xj,MousePointerClick:Zj,MouseRight:Wj,Move:dC,Move3d:Il,MoveDiagonal:Jj,MoveDiagonal2:Yj,MoveDown:aC,MoveDownLeft:eC,MoveDownRight:tC,MoveHorizontal:nC,MoveLeft:sC,MoveRight:rC,MoveUp:cC,MoveUpLeft:oC,MoveUpRight:iC,MoveVertical:lC,Music:pC,Music2:AC,Music3:uC,Music4:hC,Navigation:gC,Navigation2:xC,Navigation2Off:fC,NavigationOff:mC,Network:fu,Newspaper:Jo,Nfc:yC,NonBinary:vC,Notebook:wC,NotebookPen:kC,NotebookTabs:OC,NotebookText:bC,NotepadText:CC,NotepadTextDashed:jC,Nut:MC,NutOff:NC,Octagon:QC,OctagonAlert:Ul,OctagonMinus:SC,OctagonPause:Pl,OctagonX:El,Omega:BC,Option:_C,Orbit:LC,Origami:TC,Package:xu,Package2:IC,PackageCheck:$C,PackageMinus:UC,PackageOpen:PC,PackagePlus:EC,PackageSearch:zC,PackageX:FC,PaintBucket:RC,PaintRoller:HC,Paintbrush:qC,PaintbrushVertical:zl,Palette:DC,Panda:VC,PanelBottom:GC,PanelBottomClose:XC,PanelBottomDashed:Fl,PanelBottomOpen:ZC,PanelLeft:Hl,PanelLeftClose:fs,PanelLeftDashed:Rl,PanelLeftOpen:xs,PanelLeftRightDashed:WC,PanelRight:KC,PanelRightClose:B0,PanelRightDashed:ql,PanelRightOpen:_0,PanelTop:t7,PanelTopBottomDashed:YC,PanelTopClose:JC,PanelTopDashed:Dl,PanelTopOpen:e7,PanelsLeftBottom:a7,PanelsRightBottom:n7,PanelsTopLeft:Vl,Paperclip:mu,Parentheses:s7,ParkingMeter:r7,PartyPopper:o7,Pause:L0,PawPrint:i7,PcCase:c7,Pen:Lr,PenLine:Eo,PenOff:l7,PenTool:d7,Pencil:js,PencilLine:A7,PencilOff:u7,PencilRuler:h7,Pentagon:p7,Percent:f7,PersonStanding:x7,PhilippinePeso:m7,Phone:w7,PhoneCall:g7,PhoneForwarded:y7,PhoneIncoming:v7,PhoneMissed:k7,PhoneOff:O7,PhoneOutgoing:b7,Pi:j7,Piano:C7,Pickaxe:N7,PictureInPicture:S7,PictureInPicture2:M7,PiggyBank:Q7,Pilcrow:L7,PilcrowLeft:B7,PilcrowRight:_7,Pill:$7,PillBottle:T7,Pin:LA,PinOff:gu,Pipette:I7,Pizza:U7,Plane:z7,PlaneLanding:P7,PlaneTakeoff:E7,Play:ei,Plug:da,Plug2:F7,PlugZap:Tr,Plus:ht,PocketKnife:H7,Podcast:R7,Pointer:D7,PointerOff:q7,Popcorn:V7,Popsicle:X7,PoundSterling:Z7,Power:W7,PowerOff:G7,Presentation:yu,Printer:J7,PrinterCheck:K7,PrinterX:Y7,Projector:eN,Proportions:tN,Puzzle:vu,Pyramid:aN,QrCode:nN,Quote:sN,Rabbit:oN,Radar:rN,Radiation:iN,Radical:cN,Radio:Jn,RadioOff:lN,RadioReceiver:dN,RadioTower:AN,Radius:uN,Rainbow:hN,Rat:pN,Ratio:fN,Receipt:jN,ReceiptCent:xN,ReceiptEuro:mN,ReceiptIndianRupee:gN,ReceiptJapaneseYen:yN,ReceiptPoundSterling:vN,ReceiptRussianRuble:kN,ReceiptSwissFranc:ON,ReceiptText:bN,ReceiptTurkishLira:wN,RectangleCircle:CN,RectangleEllipsis:Xl,RectangleGoggles:NN,RectangleHorizontal:MN,RectangleVertical:QN,Recycle:SN,Redo:LN,Redo2:BN,RedoDot:_N,RefreshCcw:$N,RefreshCcwDot:TN,RefreshCw:ra,RefreshCwOff:IN,Refrigerator:UN,Regex:PN,RemoveFormatting:EN,Repeat:RN,Repeat1:zN,Repeat2:FN,Replace:qN,ReplaceAll:HN,Reply:XN,ReplyAll:DN,Rewind:VN,Ribbon:ZN,Road:GN,Rocket:es,RockingChair:WN,RollerCoaster:KN,Rose:YN,Rotate3d:Zl,RotateCcw:Cs,RotateCcwKey:JN,RotateCcwSquare:eM,RotateCw:Vr,RotateCwSquare:tM,Route:aM,RouteOff:nM,Router:sM,Rows2:Gl,Rows3:Wl,Rows4:rM,Rss:oM,Ruler:cM,RulerDimensionLine:iM,RussianRuble:lM,Sailboat:dM,Salad:AM,Sandwich:uM,Satellite:pM,SatelliteDish:hM,SaudiRiyal:fM,Save:Xr,SaveAll:xM,SaveOff:mM,Scale:gM,Scale3d:Kl,Scaling:yM,Scan:MM,ScanBarcode:vM,ScanEye:kM,ScanFace:OM,ScanHeart:bM,ScanLine:wM,ScanQrCode:jM,ScanSearch:NM,ScanText:CM,School:SM,Scissors:QM,ScissorsLineDashed:BM,Scooter:_M,ScreenShare:TM,ScreenShareOff:LM,Scroll:IM,ScrollText:$M,Search:oa,SearchAlert:UM,SearchCheck:PM,SearchCode:EM,SearchSlash:zM,SearchX:FM,Section:RM,Send:Xa,SendHorizontal:Yl,SendToBack:HM,SeparatorHorizontal:qM,SeparatorVertical:VM,Server:aa,ServerCog:DM,ServerCrash:XM,ServerOff:ZM,Settings:Zr,Settings2:T0,Shapes:GM,Share:WM,Share2:$0,Sheet:KM,Shell:YM,ShelvingUnit:JM,Shield:La,ShieldAlert:tS,ShieldBan:eS,ShieldCheck:ku,ShieldCog:nS,ShieldCogCorner:aS,ShieldEllipsis:sS,ShieldHalf:oS,ShieldMinus:rS,ShieldOff:iS,ShieldPlus:cS,ShieldQuestionMark:Jl,ShieldUser:lS,ShieldX:$r,Ship:AS,ShipWheel:dS,Shirt:uS,ShoppingBag:TA,ShoppingBasket:hS,ShoppingCart:pS,Shovel:fS,ShowerHead:mS,Shredder:xS,Shrimp:gS,Shrink:yS,Shrub:vS,Shuffle:kS,Sigma:OS,Signal:NS,SignalHigh:bS,SignalLow:wS,SignalMedium:jS,SignalZero:CS,Signature:MS,Signpost:QS,SignpostBig:SS,Siren:_S,SkipBack:BS,SkipForward:LS,Skull:$A,Slash:$S,Slice:TS,SlidersHorizontal:IS,SlidersVertical:ed,Smartphone:I0,SmartphoneCharging:US,SmartphoneNfc:PS,Smile:zS,SmilePlus:ES,Snail:FS,Snowflake:RS,SoapDispenserDroplet:HS,Sofa:qS,SolarPanel:DS,Soup:VS,Space:XS,Spade:ZS,Sparkle:GS,Sparkles:It,Speaker:WS,Speech:KS,SpellCheck:JS,SpellCheck2:YS,Spline:eQ,SplinePointer:tQ,Split:aQ,Spool:nQ,SportShoe:sQ,Spotlight:rQ,SprayCan:oQ,Sprout:iQ,Square:Gr,SquareActivity:td,SquareArrowDown:nd,SquareArrowDownLeft:ad,SquareArrowDownRight:sd,SquareArrowLeft:rd,SquareArrowOutDownLeft:od,SquareArrowOutDownRight:id,SquareArrowOutUpLeft:ld,SquareArrowOutUpRight:cd,SquareArrowRight:dd,SquareArrowRightEnter:cQ,SquareArrowRightExit:lQ,SquareArrowUp:hd,SquareArrowUpLeft:Ad,SquareArrowUpRight:ud,SquareAsterisk:pd,SquareBottomDashedScissors:fd,SquareCenterlineDashedHorizontal:xd,SquareCenterlineDashedVertical:gd,SquareChartGantt:qs,SquareCheck:yd,SquareCheckBig:md,SquareChevronDown:vd,SquareChevronLeft:kd,SquareChevronRight:Od,SquareChevronUp:wd,SquareCode:bd,SquareDashed:Nd,SquareDashedBottom:AQ,SquareDashedBottomCode:dQ,SquareDashedKanban:jd,SquareDashedMousePointer:Cd,SquareDashedText:Ds,SquareDashedTopSolid:uQ,SquareDivide:Md,SquareDot:Sd,SquareEqual:Qd,SquareFunction:Bd,SquareKanban:_d,SquareLibrary:Ld,SquareM:Td,SquareMenu:$d,SquareMinus:Ud,SquareMousePointer:Id,SquareParking:Ed,SquareParkingOff:Pd,SquarePause:hQ,SquarePen:sn,SquarePercent:zd,SquarePi:Fd,SquarePilcrow:Rd,SquarePlay:Hd,SquarePlus:qd,SquarePower:Dd,SquareRadical:pQ,SquareRoundCorner:fQ,SquareScissors:Vd,SquareSigma:Xd,SquareSlash:Zd,SquareSplitHorizontal:Gd,SquareSplitVertical:Wd,SquareSquare:xQ,SquareStack:mQ,SquareStar:gQ,SquareStop:yQ,SquareTerminal:Yd,SquareUser:Jd,SquareUserRound:Kd,SquareX:eA,SquaresExclude:vQ,SquaresIntersect:kQ,SquaresSubtract:OQ,SquaresUnite:bQ,Squircle:jQ,SquircleDashed:wQ,Squirrel:CQ,Stamp:NQ,Star:IA,StarHalf:MQ,StarOff:SQ,StepBack:QQ,StepForward:BQ,Stethoscope:_Q,Sticker:LQ,StickyNote:TQ,Stone:$Q,Store:IQ,StretchHorizontal:UQ,StretchVertical:PQ,Strikethrough:EQ,Subscript:zQ,Sun:DQ,SunDim:FQ,SunMedium:RQ,SunMoon:HQ,SunSnow:qQ,Sunrise:VQ,Sunset:XQ,Superscript:ZQ,SwatchBook:GQ,SwissFranc:WQ,SwitchCamera:KQ,Sword:YQ,Swords:JQ,Syringe:eB,Table:cB,Table2:tB,TableCellsMerge:aB,TableCellsSplit:nB,TableColumnsSplit:sB,TableOfContents:rB,TableProperties:oB,TableRowsSplit:iB,Tablet:U0,TabletSmartphone:lB,Tablets:dB,Tag:AB,Tags:uB,Tally1:hB,Tally2:pB,Tally3:fB,Tally4:xB,Tally5:mB,Tangent:gB,Target:yB,Telescope:vB,Tent:OB,TentTree:kB,Terminal:Ns,TestTube:ti,TestTubeDiagonal:tA,TestTubes:bB,TextAlignCenter:aA,TextAlignEnd:sA,TextAlignJustify:nA,TextAlignStart:Vs,TextCursor:jB,TextCursorInput:wB,TextInitial:rA,TextQuote:CB,TextSearch:NB,TextWrap:oA,Theater:MB,Thermometer:BB,ThermometerSnowflake:SB,ThermometerSun:QB,ThumbsDown:_B,ThumbsUp:LB,Ticket:zB,TicketCheck:TB,TicketMinus:$B,TicketPercent:IB,TicketPlus:UB,TicketSlash:PB,TicketX:EB,Tickets:RB,TicketsPlane:FB,Timeline:HB,Timer:P0,TimerOff:qB,TimerReset:DB,ToggleLeft:VB,ToggleRight:XB,Toilet:ZB,ToolCase:GB,Toolbox:WB,Tornado:KB,Torus:YB,Touchpad:e9,TouchpadOff:JB,TowelRack:t9,TowerControl:a9,ToyBrick:r9,Tractor:n9,TrafficCone:s9,TrainFront:c9,TrainFrontTunnel:o9,TrainTrack:i9,TramFront:iA,Transgender:l9,Trash:d9,Trash2:At,TreeDeciduous:A9,TreePalm:cA,TreePine:u9,Trees:h9,TrendingDown:p9,TrendingUp:x9,TrendingUpDown:f9,Triangle:y9,TriangleAlert:Gt,TriangleDashed:m9,TriangleRight:g9,Trophy:v9,Truck:O9,TruckElectric:k9,TurkishLira:b9,Turntable:w9,Turtle:j9,Tv:N9,TvMinimal:lA,TvMinimalPlay:C9,Type:M9,TypeOutline:S9,Umbrella:_9,UmbrellaOff:B9,Underline:Q9,Undo:$9,Undo2:L9,UndoDot:T9,UnfoldHorizontal:I9,UnfoldVertical:U9,Ungroup:P9,University:dA,Unlink:z9,Unlink2:E9,Unplug:ai,Upload:E0,Usb:F9,User:z0,UserCheck:Ou,UserCog:R9,UserKey:H9,UserLock:q9,UserMinus:D9,UserPen:V9,UserPlus:bu,UserRound:xA,UserRoundCheck:AA,UserRoundCog:uA,UserRoundKey:X9,UserRoundMinus:hA,UserRoundPen:Z9,UserRoundPlus:pA,UserRoundSearch:G9,UserRoundX:fA,UserSearch:W9,UserStar:K9,UserX:Y9,Users:Fa,UsersRound:mA,Utensils:yA,UtensilsCrossed:gA,UtilityPole:J9,Van:e_,Variable:t_,Vault:a_,VectorSquare:n_,Vegan:s_,VenetianMask:r_,Venus:i_,VenusAndMars:o_,Vibrate:l_,VibrateOff:c_,Video:A_,VideoOff:d_,Videotape:u_,View:h_,Voicemail:p_,Volleyball:f_,Volume:v_,Volume1:x_,Volume2:m_,VolumeOff:g_,VolumeX:y_,Vote:k_,Wallet:wu,WalletCards:O_,WalletMinimal:vA,Wallpaper:w_,Wand:b_,WandSparkles:kA,Warehouse:j_,WashingMachine:C_,Watch:N_,Waves:B_,WavesArrowDown:M_,WavesArrowUp:S_,WavesLadder:Q_,Waypoints:__,Webcam:L_,Webhook:$_,WebhookOff:T_,Weight:P_,WeightTilde:I_,Wheat:E_,WheatOff:U_,WholeWord:z_,Wifi:UA,WifiCog:F_,WifiHigh:R_,WifiLow:H_,WifiOff:F0,WifiPen:q_,WifiSync:V_,WifiZero:D_,Wind:Z_,WindArrowDown:X_,Wine:W_,WineOff:G_,Workflow:K_,Worm:Y_,Wrench:ju,X:Ge,XLineTop:J_,Zap:wt,ZapOff:eL,ZodiacAquarius:tL,ZodiacAries:aL,ZodiacCancer:nL,ZodiacCapricorn:sL,ZodiacGemini:rL,ZodiacLeo:oL,ZodiacLibra:iL,ZodiacOphiuchus:cL,ZodiacPisces:lL,ZodiacSagittarius:dL,ZodiacScorpio:AL,ZodiacTaurus:uL,ZodiacVirgo:hL,ZoomIn:pL,ZoomOut:fL},Symbol.toStringTag,{value:"Module"})),TL=Object.freeze(Object.defineProperty({__proto__:null,AArrowDown:Qf,AArrowDownIcon:Qf,AArrowUp:Bf,AArrowUpIcon:Bf,ALargeSmall:_f,ALargeSmallIcon:_f,Accessibility:Lf,AccessibilityIcon:Lf,Activity:Ys,ActivityIcon:Ys,ActivitySquare:td,ActivitySquareIcon:td,AirVent:Tf,AirVentIcon:Tf,Airplay:$f,AirplayIcon:$f,AlarmCheck:$i,AlarmCheckIcon:$i,AlarmClock:Uf,AlarmClockCheck:$i,AlarmClockCheckIcon:$i,AlarmClockIcon:Uf,AlarmClockMinus:Ii,AlarmClockMinusIcon:Ii,AlarmClockOff:If,AlarmClockOffIcon:If,AlarmClockPlus:Ui,AlarmClockPlusIcon:Ui,AlarmMinus:Ii,AlarmMinusIcon:Ii,AlarmPlus:Ui,AlarmPlusIcon:Ui,AlarmSmoke:Pf,AlarmSmokeIcon:Pf,Album:Ef,AlbumIcon:Ef,AlertCircle:Xt,AlertCircleIcon:Xt,AlertOctagon:Ul,AlertOctagonIcon:Ul,AlertTriangle:Gt,AlertTriangleIcon:Gt,AlignCenter:aA,AlignCenterHorizontal:zf,AlignCenterHorizontalIcon:zf,AlignCenterIcon:aA,AlignCenterVertical:Ff,AlignCenterVerticalIcon:Ff,AlignEndHorizontal:Rf,AlignEndHorizontalIcon:Rf,AlignEndVertical:Hf,AlignEndVerticalIcon:Hf,AlignHorizontalDistributeCenter:qf,AlignHorizontalDistributeCenterIcon:qf,AlignHorizontalDistributeEnd:Df,AlignHorizontalDistributeEndIcon:Df,AlignHorizontalDistributeStart:Vf,AlignHorizontalDistributeStartIcon:Vf,AlignHorizontalJustifyCenter:Xf,AlignHorizontalJustifyCenterIcon:Xf,AlignHorizontalJustifyEnd:Zf,AlignHorizontalJustifyEndIcon:Zf,AlignHorizontalJustifyStart:Gf,AlignHorizontalJustifyStartIcon:Gf,AlignHorizontalSpaceAround:Wf,AlignHorizontalSpaceAroundIcon:Wf,AlignHorizontalSpaceBetween:Yf,AlignHorizontalSpaceBetweenIcon:Yf,AlignJustify:nA,AlignJustifyIcon:nA,AlignLeft:Vs,AlignLeftIcon:Vs,AlignRight:sA,AlignRightIcon:sA,AlignStartHorizontal:Kf,AlignStartHorizontalIcon:Kf,AlignStartVertical:Jf,AlignStartVerticalIcon:Jf,AlignVerticalDistributeCenter:ex,AlignVerticalDistributeCenterIcon:ex,AlignVerticalDistributeEnd:tx,AlignVerticalDistributeEndIcon:tx,AlignVerticalDistributeStart:ax,AlignVerticalDistributeStartIcon:ax,AlignVerticalJustifyCenter:nx,AlignVerticalJustifyCenterIcon:nx,AlignVerticalJustifyEnd:rx,AlignVerticalJustifyEndIcon:rx,AlignVerticalJustifyStart:sx,AlignVerticalJustifyStartIcon:sx,AlignVerticalSpaceAround:ox,AlignVerticalSpaceAroundIcon:ox,AlignVerticalSpaceBetween:ix,AlignVerticalSpaceBetweenIcon:ix,Ambulance:cx,AmbulanceIcon:cx,Ampersand:lx,AmpersandIcon:lx,Ampersands:Ax,AmpersandsIcon:Ax,Amphora:dx,AmphoraIcon:dx,Anchor:ux,AnchorIcon:ux,Angry:hx,AngryIcon:hx,Annoyed:px,AnnoyedIcon:px,Antenna:fx,AntennaIcon:fx,Anvil:xx,AnvilIcon:xx,Aperture:mx,ApertureIcon:mx,AppWindow:yx,AppWindowIcon:yx,AppWindowMac:gx,AppWindowMacIcon:gx,Apple:vx,AppleIcon:vx,Archive:CA,ArchiveIcon:CA,ArchiveRestore:kx,ArchiveRestoreIcon:kx,ArchiveX:Ox,ArchiveXIcon:Ox,AreaChart:Yi,AreaChartIcon:Yi,Armchair:bx,ArmchairIcon:bx,ArrowBigDown:jx,ArrowBigDownDash:wx,ArrowBigDownDashIcon:wx,ArrowBigDownIcon:jx,ArrowBigLeft:Nx,ArrowBigLeftDash:Cx,ArrowBigLeftDashIcon:Cx,ArrowBigLeftIcon:Nx,ArrowBigRight:Sx,ArrowBigRightDash:Mx,ArrowBigRightDashIcon:Mx,ArrowBigRightIcon:Sx,ArrowBigUp:Qx,ArrowBigUpDash:Bx,ArrowBigUpDashIcon:Bx,ArrowBigUpIcon:Qx,ArrowDown:i0,ArrowDown01:_x,ArrowDown01Icon:_x,ArrowDown10:Lx,ArrowDown10Icon:Lx,ArrowDownAZ:Pi,ArrowDownAZIcon:Pi,ArrowDownAz:Pi,ArrowDownAzIcon:Pi,ArrowDownCircle:dc,ArrowDownCircleIcon:dc,ArrowDownFromLine:Tx,ArrowDownFromLineIcon:Tx,ArrowDownIcon:i0,ArrowDownLeft:o0,ArrowDownLeftFromCircle:hc,ArrowDownLeftFromCircleIcon:hc,ArrowDownLeftFromSquare:od,ArrowDownLeftFromSquareIcon:od,ArrowDownLeftIcon:o0,ArrowDownLeftSquare:ad,ArrowDownLeftSquareIcon:ad,ArrowDownNarrowWide:$x,ArrowDownNarrowWideIcon:$x,ArrowDownRight:Ix,ArrowDownRightFromCircle:uc,ArrowDownRightFromCircleIcon:uc,ArrowDownRightFromSquare:id,ArrowDownRightFromSquareIcon:id,ArrowDownRightIcon:Ix,ArrowDownRightSquare:sd,ArrowDownRightSquareIcon:sd,ArrowDownSquare:nd,ArrowDownSquareIcon:nd,ArrowDownToDot:Ux,ArrowDownToDotIcon:Ux,ArrowDownToLine:Px,ArrowDownToLineIcon:Px,ArrowDownUp:Ex,ArrowDownUpIcon:Ex,ArrowDownWideNarrow:Ei,ArrowDownWideNarrowIcon:Ei,ArrowDownZA:zi,ArrowDownZAIcon:zi,ArrowDownZa:zi,ArrowDownZaIcon:zi,ArrowLeft:J1,ArrowLeftCircle:Ac,ArrowLeftCircleIcon:Ac,ArrowLeftFromLine:zx,ArrowLeftFromLineIcon:zx,ArrowLeftIcon:J1,ArrowLeftRight:Fx,ArrowLeftRightIcon:Fx,ArrowLeftSquare:rd,ArrowLeftSquareIcon:rd,ArrowLeftToLine:Rx,ArrowLeftToLineIcon:Rx,ArrowRight:Fr,ArrowRightCircle:fc,ArrowRightCircleIcon:fc,ArrowRightFromLine:Hx,ArrowRightFromLineIcon:Hx,ArrowRightIcon:Fr,ArrowRightLeft:qx,ArrowRightLeftIcon:qx,ArrowRightSquare:dd,ArrowRightSquareIcon:dd,ArrowRightToLine:Dx,ArrowRightToLineIcon:Dx,ArrowUp:eu,ArrowUp01:Vx,ArrowUp01Icon:Vx,ArrowUp10:Xx,ArrowUp10Icon:Xx,ArrowUpAZ:Fi,ArrowUpAZIcon:Fi,ArrowUpAz:Fi,ArrowUpAzIcon:Fi,ArrowUpCircle:za,ArrowUpCircleIcon:za,ArrowUpDown:Zx,ArrowUpDownIcon:Zx,ArrowUpFromDot:Gx,ArrowUpFromDotIcon:Gx,ArrowUpFromLine:Wx,ArrowUpFromLineIcon:Wx,ArrowUpIcon:eu,ArrowUpLeft:Kx,ArrowUpLeftFromCircle:pc,ArrowUpLeftFromCircleIcon:pc,ArrowUpLeftFromSquare:ld,ArrowUpLeftFromSquareIcon:ld,ArrowUpLeftIcon:Kx,ArrowUpLeftSquare:Ad,ArrowUpLeftSquareIcon:Ad,ArrowUpNarrowWide:Ri,ArrowUpNarrowWideIcon:Ri,ArrowUpRight:c0,ArrowUpRightFromCircle:xc,ArrowUpRightFromCircleIcon:xc,ArrowUpRightFromSquare:cd,ArrowUpRightFromSquareIcon:cd,ArrowUpRightIcon:c0,ArrowUpRightSquare:ud,ArrowUpRightSquareIcon:ud,ArrowUpSquare:hd,ArrowUpSquareIcon:hd,ArrowUpToLine:Yx,ArrowUpToLineIcon:Yx,ArrowUpWideNarrow:Jx,ArrowUpWideNarrowIcon:Jx,ArrowUpZA:Hi,ArrowUpZAIcon:Hi,ArrowUpZa:Hi,ArrowUpZaIcon:Hi,ArrowsUpFromLine:em,ArrowsUpFromLineIcon:em,Asterisk:tm,AsteriskIcon:tm,AsteriskSquare:pd,AsteriskSquareIcon:pd,AtSign:am,AtSignIcon:am,Atom:nm,AtomIcon:nm,AudioLines:sm,AudioLinesIcon:sm,AudioWaveform:rm,AudioWaveformIcon:rm,Award:om,AwardIcon:om,Axe:im,AxeIcon:im,Axis3D:qi,Axis3DIcon:qi,Axis3d:qi,Axis3dIcon:qi,Baby:cm,BabyIcon:cm,Backpack:lm,BackpackIcon:lm,Badge:jm,BadgeAlert:dm,BadgeAlertIcon:dm,BadgeCent:Am,BadgeCentIcon:Am,BadgeCheck:Di,BadgeCheckIcon:Di,BadgeDollarSign:um,BadgeDollarSignIcon:um,BadgeEuro:hm,BadgeEuroIcon:hm,BadgeHelp:Vi,BadgeHelpIcon:Vi,BadgeIcon:jm,BadgeIndianRupee:pm,BadgeIndianRupeeIcon:pm,BadgeInfo:fm,BadgeInfoIcon:fm,BadgeJapaneseYen:xm,BadgeJapaneseYenIcon:xm,BadgeMinus:mm,BadgeMinusIcon:mm,BadgePercent:gm,BadgePercentIcon:gm,BadgePlus:ym,BadgePlusIcon:ym,BadgePoundSterling:vm,BadgePoundSterlingIcon:vm,BadgeQuestionMark:Vi,BadgeQuestionMarkIcon:Vi,BadgeRussianRuble:km,BadgeRussianRubleIcon:km,BadgeSwissFranc:Om,BadgeSwissFrancIcon:Om,BadgeTurkishLira:bm,BadgeTurkishLiraIcon:bm,BadgeX:wm,BadgeXIcon:wm,BaggageClaim:Cm,BaggageClaimIcon:Cm,Balloon:Nm,BalloonIcon:Nm,Ban:Mm,BanIcon:Mm,Banana:Sm,BananaIcon:Sm,Bandage:Qm,BandageIcon:Qm,Banknote:Tm,BanknoteArrowDown:Bm,BanknoteArrowDownIcon:Bm,BanknoteArrowUp:_m,BanknoteArrowUpIcon:_m,BanknoteIcon:Tm,BanknoteX:Lm,BanknoteXIcon:Lm,BarChart:rc,BarChart2:oc,BarChart2Icon:oc,BarChart3:hs,BarChart3Icon:hs,BarChart4:nc,BarChart4Icon:nc,BarChartBig:ac,BarChartBigIcon:ac,BarChartHorizontal:ec,BarChartHorizontalBig:Ji,BarChartHorizontalBigIcon:Ji,BarChartHorizontalIcon:ec,BarChartIcon:rc,Barcode:$m,BarcodeIcon:$m,Barrel:Im,BarrelIcon:Im,Baseline:Um,BaselineIcon:Um,Bath:Pm,BathIcon:Pm,Battery:Dm,BatteryCharging:Em,BatteryChargingIcon:Em,BatteryFull:zm,BatteryFullIcon:zm,BatteryIcon:Dm,BatteryLow:Fm,BatteryLowIcon:Fm,BatteryMedium:Rm,BatteryMediumIcon:Rm,BatteryPlus:Hm,BatteryPlusIcon:Hm,BatteryWarning:qm,BatteryWarningIcon:qm,Beaker:Vm,BeakerIcon:Vm,Bean:Zm,BeanIcon:Zm,BeanOff:Xm,BeanOffIcon:Xm,Bed:Km,BedDouble:Gm,BedDoubleIcon:Gm,BedIcon:Km,BedSingle:Wm,BedSingleIcon:Wm,Beef:Jm,BeefIcon:Jm,BeefOff:Ym,BeefOffIcon:Ym,Beer:tg,BeerIcon:tg,BeerOff:eg,BeerOffIcon:eg,Bell:lg,BellCheck:ag,BellCheckIcon:ag,BellDot:ng,BellDotIcon:ng,BellElectric:sg,BellElectricIcon:sg,BellIcon:lg,BellMinus:rg,BellMinusIcon:rg,BellOff:og,BellOffIcon:og,BellPlus:ig,BellPlusIcon:ig,BellRing:cg,BellRingIcon:cg,BetweenHorizonalEnd:Xi,BetweenHorizonalEndIcon:Xi,BetweenHorizonalStart:Zi,BetweenHorizonalStartIcon:Zi,BetweenHorizontalEnd:Xi,BetweenHorizontalEndIcon:Xi,BetweenHorizontalStart:Zi,BetweenHorizontalStartIcon:Zi,BetweenVerticalEnd:dg,BetweenVerticalEndIcon:dg,BetweenVerticalStart:Ag,BetweenVerticalStartIcon:Ag,BicepsFlexed:ug,BicepsFlexedIcon:ug,Bike:hg,BikeIcon:hg,Binary:pg,BinaryIcon:pg,Binoculars:fg,BinocularsIcon:fg,Biohazard:xg,BiohazardIcon:xg,Bird:mg,BirdIcon:mg,Birdhouse:gg,BirdhouseIcon:gg,Bitcoin:yg,BitcoinIcon:yg,Blend:vg,BlendIcon:vg,Blinds:kg,BlindsIcon:kg,Blocks:Og,BlocksIcon:Og,Bluetooth:Cg,BluetoothConnected:bg,BluetoothConnectedIcon:bg,BluetoothIcon:Cg,BluetoothOff:wg,BluetoothOffIcon:wg,BluetoothSearching:jg,BluetoothSearchingIcon:jg,Bold:Ng,BoldIcon:Ng,Bolt:Mg,BoltIcon:Mg,Bomb:l0,BombIcon:l0,Bone:Sg,BoneIcon:Sg,Book:Jg,BookA:Qg,BookAIcon:Qg,BookAlert:Bg,BookAlertIcon:Bg,BookAudio:_g,BookAudioIcon:_g,BookCheck:Lg,BookCheckIcon:Lg,BookCopy:Tg,BookCopyIcon:Tg,BookDashed:Gi,BookDashedIcon:Gi,BookDown:$g,BookDownIcon:$g,BookHeadphones:Ig,BookHeadphonesIcon:Ig,BookHeart:Ug,BookHeartIcon:Ug,BookIcon:Jg,BookImage:Pg,BookImageIcon:Pg,BookKey:Eg,BookKeyIcon:Eg,BookLock:zg,BookLockIcon:zg,BookMarked:Fg,BookMarkedIcon:Fg,BookMinus:Rg,BookMinusIcon:Rg,BookOpen:Go,BookOpenCheck:Hg,BookOpenCheckIcon:Hg,BookOpenIcon:Go,BookOpenText:qg,BookOpenTextIcon:qg,BookPlus:Dg,BookPlusIcon:Dg,BookSearch:Vg,BookSearchIcon:Vg,BookTemplate:Gi,BookTemplateIcon:Gi,BookText:Xg,BookTextIcon:Xg,BookType:Zg,BookTypeIcon:Zg,BookUp:Wg,BookUp2:Gg,BookUp2Icon:Gg,BookUpIcon:Wg,BookUser:Kg,BookUserIcon:Kg,BookX:Yg,BookXIcon:Yg,Bookmark:sy,BookmarkCheck:d0,BookmarkCheckIcon:d0,BookmarkIcon:sy,BookmarkMinus:ey,BookmarkMinusIcon:ey,BookmarkOff:ty,BookmarkOffIcon:ty,BookmarkPlus:ay,BookmarkPlusIcon:ay,BookmarkX:ny,BookmarkXIcon:ny,BoomBox:ry,BoomBoxIcon:ry,Bot:Os,BotIcon:Os,BotMessageSquare:oy,BotMessageSquareIcon:oy,BotOff:iy,BotOffIcon:iy,BottleWine:cy,BottleWineIcon:cy,BowArrow:ly,BowArrowIcon:ly,Box:on,BoxIcon:on,BoxSelect:Nd,BoxSelectIcon:Nd,Boxes:dy,BoxesIcon:dy,Braces:Wi,BracesIcon:Wi,Brackets:Ay,BracketsIcon:Ay,Brain:A0,BrainCircuit:uy,BrainCircuitIcon:uy,BrainCog:hy,BrainCogIcon:hy,BrainIcon:A0,BrickWall:xy,BrickWallFire:py,BrickWallFireIcon:py,BrickWallIcon:xy,BrickWallShield:fy,BrickWallShieldIcon:fy,Briefcase:vy,BriefcaseBusiness:my,BriefcaseBusinessIcon:my,BriefcaseConveyorBelt:gy,BriefcaseConveyorBeltIcon:gy,BriefcaseIcon:vy,BriefcaseMedical:yy,BriefcaseMedicalIcon:yy,BringToFront:ky,BringToFrontIcon:ky,Brush:by,BrushCleaning:Oy,BrushCleaningIcon:Oy,BrushIcon:by,Bubbles:wy,BubblesIcon:wy,Bug:Ny,BugIcon:Ny,BugOff:jy,BugOffIcon:jy,BugPlay:Cy,BugPlayIcon:Cy,Building:My,Building2:Sy,Building2Icon:Sy,BuildingIcon:My,Bus:By,BusFront:Qy,BusFrontIcon:Qy,BusIcon:By,Cable:_y,CableCar:Ly,CableCarIcon:Ly,CableIcon:_y,Cake:$y,CakeIcon:$y,CakeSlice:Ty,CakeSliceIcon:Ty,Calculator:tu,CalculatorIcon:tu,Calendar:Wo,Calendar1:Iy,Calendar1Icon:Iy,CalendarArrowDown:Uy,CalendarArrowDownIcon:Uy,CalendarArrowUp:Py,CalendarArrowUpIcon:Py,CalendarCheck:zy,CalendarCheck2:Ey,CalendarCheck2Icon:Ey,CalendarCheckIcon:zy,CalendarClock:Fy,CalendarClockIcon:Fy,CalendarCog:Ry,CalendarCogIcon:Ry,CalendarDays:Hy,CalendarDaysIcon:Hy,CalendarFold:qy,CalendarFoldIcon:qy,CalendarHeart:Dy,CalendarHeartIcon:Dy,CalendarIcon:Wo,CalendarMinus:Xy,CalendarMinus2:Vy,CalendarMinus2Icon:Vy,CalendarMinusIcon:Xy,CalendarOff:Zy,CalendarOffIcon:Zy,CalendarPlus:Wy,CalendarPlus2:Gy,CalendarPlus2Icon:Gy,CalendarPlusIcon:Wy,CalendarRange:Ky,CalendarRangeIcon:Ky,CalendarSearch:Yy,CalendarSearchIcon:Yy,CalendarSync:Jy,CalendarSyncIcon:Jy,CalendarX:tv,CalendarX2:ev,CalendarX2Icon:ev,CalendarXIcon:tv,Calendars:av,CalendarsIcon:av,Camera:au,CameraIcon:au,CameraOff:nv,CameraOffIcon:nv,CandlestickChart:tc,CandlestickChartIcon:tc,Candy:ov,CandyCane:sv,CandyCaneIcon:sv,CandyIcon:ov,CandyOff:rv,CandyOffIcon:rv,Cannabis:cv,CannabisIcon:cv,CannabisOff:iv,CannabisOffIcon:iv,Captions:Ki,CaptionsIcon:Ki,CaptionsOff:lv,CaptionsOffIcon:lv,Car:uv,CarFront:dv,CarFrontIcon:dv,CarIcon:uv,CarTaxiFront:Av,CarTaxiFrontIcon:Av,Caravan:hv,CaravanIcon:hv,CardSim:pv,CardSimIcon:pv,Carrot:fv,CarrotIcon:fv,CaseLower:xv,CaseLowerIcon:xv,CaseSensitive:mv,CaseSensitiveIcon:mv,CaseUpper:gv,CaseUpperIcon:gv,CassetteTape:yv,CassetteTapeIcon:yv,Cast:vv,CastIcon:vv,Castle:kv,CastleIcon:kv,Cat:Ov,CatIcon:Ov,Cctv:wv,CctvIcon:wv,CctvOff:bv,CctvOffIcon:bv,ChartArea:Yi,ChartAreaIcon:Yi,ChartBar:ec,ChartBarBig:Ji,ChartBarBigIcon:Ji,ChartBarDecreasing:jv,ChartBarDecreasingIcon:jv,ChartBarIcon:ec,ChartBarIncreasing:Cv,ChartBarIncreasingIcon:Cv,ChartBarStacked:Nv,ChartBarStackedIcon:Nv,ChartCandlestick:tc,ChartCandlestickIcon:tc,ChartColumn:hs,ChartColumnBig:ac,ChartColumnBigIcon:ac,ChartColumnDecreasing:Mv,ChartColumnDecreasingIcon:Mv,ChartColumnIcon:hs,ChartColumnIncreasing:nc,ChartColumnIncreasingIcon:nc,ChartColumnStacked:Sv,ChartColumnStackedIcon:Sv,ChartGantt:Qv,ChartGanttIcon:Qv,ChartLine:sc,ChartLineIcon:sc,ChartNetwork:Bv,ChartNetworkIcon:Bv,ChartNoAxesColumn:oc,ChartNoAxesColumnDecreasing:_v,ChartNoAxesColumnDecreasingIcon:_v,ChartNoAxesColumnIcon:oc,ChartNoAxesColumnIncreasing:rc,ChartNoAxesColumnIncreasingIcon:rc,ChartNoAxesCombined:Lv,ChartNoAxesCombinedIcon:Lv,ChartNoAxesGantt:ic,ChartNoAxesGanttIcon:ic,ChartPie:cc,ChartPieIcon:cc,ChartScatter:lc,ChartScatterIcon:lc,ChartSpline:nu,ChartSplineIcon:nu,Check:De,CheckCheck:Tv,CheckCheckIcon:Tv,CheckCircle:Sa,CheckCircle2:Hn,CheckCircle2Icon:Hn,CheckCircleIcon:Sa,CheckIcon:De,CheckLine:$v,CheckLineIcon:$v,CheckSquare:md,CheckSquare2:yd,CheckSquare2Icon:yd,CheckSquareIcon:md,ChefHat:Iv,ChefHatIcon:Iv,Cherry:Uv,CherryIcon:Uv,ChessBishop:Pv,ChessBishopIcon:Pv,ChessKing:Ev,ChessKingIcon:Ev,ChessKnight:zv,ChessKnightIcon:zv,ChessPawn:Fv,ChessPawnIcon:Fv,ChessQueen:Rv,ChessQueenIcon:Rv,ChessRook:Hv,ChessRookIcon:Hv,ChevronDown:bt,ChevronDownCircle:mc,ChevronDownCircleIcon:mc,ChevronDownIcon:bt,ChevronDownSquare:vd,ChevronDownSquareIcon:vd,ChevronFirst:qv,ChevronFirstIcon:qv,ChevronLast:Dv,ChevronLastIcon:Dv,ChevronLeft:bs,ChevronLeftCircle:gc,ChevronLeftCircleIcon:gc,ChevronLeftIcon:bs,ChevronLeftSquare:kd,ChevronLeftSquareIcon:kd,ChevronRight:Rt,ChevronRightCircle:yc,ChevronRightCircleIcon:yc,ChevronRightIcon:Rt,ChevronRightSquare:Od,ChevronRightSquareIcon:Od,ChevronUp:su,ChevronUpCircle:vc,ChevronUpCircleIcon:vc,ChevronUpIcon:su,ChevronUpSquare:wd,ChevronUpSquareIcon:wd,ChevronsDown:Vv,ChevronsDownIcon:Vv,ChevronsDownUp:ru,ChevronsDownUpIcon:ru,ChevronsLeft:Gv,ChevronsLeftIcon:Gv,ChevronsLeftRight:Zv,ChevronsLeftRightEllipsis:Xv,ChevronsLeftRightEllipsisIcon:Xv,ChevronsLeftRightIcon:Zv,ChevronsRight:Kv,ChevronsRightIcon:Kv,ChevronsRightLeft:Wv,ChevronsRightLeftIcon:Wv,ChevronsUp:Jv,ChevronsUpDown:Yv,ChevronsUpDownIcon:Yv,ChevronsUpIcon:Jv,Church:ek,ChurchIcon:ek,Cigarette:ak,CigaretteIcon:ak,CigaretteOff:tk,CigaretteOffIcon:tk,Circle:mk,CircleAlert:Xt,CircleAlertIcon:Xt,CircleArrowDown:dc,CircleArrowDownIcon:dc,CircleArrowLeft:Ac,CircleArrowLeftIcon:Ac,CircleArrowOutDownLeft:hc,CircleArrowOutDownLeftIcon:hc,CircleArrowOutDownRight:uc,CircleArrowOutDownRightIcon:uc,CircleArrowOutUpLeft:pc,CircleArrowOutUpLeftIcon:pc,CircleArrowOutUpRight:xc,CircleArrowOutUpRightIcon:xc,CircleArrowRight:fc,CircleArrowRightIcon:fc,CircleArrowUp:za,CircleArrowUpIcon:za,CircleCheck:Hn,CircleCheckBig:Sa,CircleCheckBigIcon:Sa,CircleCheckIcon:Hn,CircleChevronDown:mc,CircleChevronDownIcon:mc,CircleChevronLeft:gc,CircleChevronLeftIcon:gc,CircleChevronRight:yc,CircleChevronRightIcon:yc,CircleChevronUp:vc,CircleChevronUpIcon:vc,CircleDashed:nk,CircleDashedIcon:nk,CircleDivide:kc,CircleDivideIcon:kc,CircleDollarSign:sk,CircleDollarSignIcon:sk,CircleDot:ok,CircleDotDashed:rk,CircleDotDashedIcon:rk,CircleDotIcon:ok,CircleEllipsis:ik,CircleEllipsisIcon:ik,CircleEqual:ck,CircleEqualIcon:ck,CircleFadingArrowUp:lk,CircleFadingArrowUpIcon:lk,CircleFadingPlus:dk,CircleFadingPlusIcon:dk,CircleGauge:Oc,CircleGaugeIcon:Oc,CircleHelp:Na,CircleHelpIcon:Na,CircleIcon:mk,CircleMinus:bc,CircleMinusIcon:bc,CircleOff:Ak,CircleOffIcon:Ak,CircleParking:jc,CircleParkingIcon:jc,CircleParkingOff:wc,CircleParkingOffIcon:wc,CirclePause:Cc,CirclePauseIcon:Cc,CirclePercent:Nc,CirclePercentIcon:Nc,CirclePile:uk,CirclePileIcon:uk,CirclePlay:Mc,CirclePlayIcon:Mc,CirclePlus:Sc,CirclePlusIcon:Sc,CirclePoundSterling:hk,CirclePoundSterlingIcon:hk,CirclePower:Qc,CirclePowerIcon:Qc,CircleQuestionMark:Na,CircleQuestionMarkIcon:Na,CircleSlash:pk,CircleSlash2:Bc,CircleSlash2Icon:Bc,CircleSlashIcon:pk,CircleSlashed:Bc,CircleSlashedIcon:Bc,CircleSmall:fk,CircleSmallIcon:fk,CircleStar:xk,CircleStarIcon:xk,CircleStop:_c,CircleStopIcon:_c,CircleUser:Tc,CircleUserIcon:Tc,CircleUserRound:Lc,CircleUserRoundIcon:Lc,CircleX:qn,CircleXIcon:qn,CircuitBoard:gk,CircuitBoardIcon:gk,Citrus:vk,CitrusIcon:vk,Clapperboard:yk,ClapperboardIcon:yk,Clipboard:Sk,ClipboardCheck:u0,ClipboardCheckIcon:u0,ClipboardClock:kk,ClipboardClockIcon:kk,ClipboardCopy:Ok,ClipboardCopyIcon:Ok,ClipboardEdit:Ic,ClipboardEditIcon:Ic,ClipboardIcon:Sk,ClipboardList:bk,ClipboardListIcon:bk,ClipboardMinus:wk,ClipboardMinusIcon:wk,ClipboardPaste:jk,ClipboardPasteIcon:jk,ClipboardPen:Ic,ClipboardPenIcon:Ic,ClipboardPenLine:$c,ClipboardPenLineIcon:$c,ClipboardPlus:Ck,ClipboardPlusIcon:Ck,ClipboardSignature:$c,ClipboardSignatureIcon:$c,ClipboardType:Nk,ClipboardTypeIcon:Nk,ClipboardX:Mk,ClipboardXIcon:Mk,Clock:Rr,Clock1:Qk,Clock10:Bk,Clock10Icon:Bk,Clock11:_k,Clock11Icon:_k,Clock12:Lk,Clock12Icon:Lk,Clock1Icon:Qk,Clock2:Tk,Clock2Icon:Tk,Clock3:$k,Clock3Icon:$k,Clock4:Ik,Clock4Icon:Ik,Clock5:Uk,Clock5Icon:Uk,Clock6:Pk,Clock6Icon:Pk,Clock7:Ek,Clock7Icon:Ek,Clock8:zk,Clock8Icon:zk,Clock9:Fk,Clock9Icon:Fk,ClockAlert:Rk,ClockAlertIcon:Rk,ClockArrowDown:Hk,ClockArrowDownIcon:Hk,ClockArrowUp:qk,ClockArrowUpIcon:qk,ClockCheck:Dk,ClockCheckIcon:Dk,ClockFading:Vk,ClockFadingIcon:Vk,ClockIcon:Rr,ClockPlus:Xk,ClockPlusIcon:Xk,ClosedCaption:Zk,ClosedCaptionIcon:Zk,Cloud:NA,CloudAlert:Gk,CloudAlertIcon:Gk,CloudBackup:Wk,CloudBackupIcon:Wk,CloudCheck:Kk,CloudCheckIcon:Kk,CloudCog:Yk,CloudCogIcon:Yk,CloudDownload:Uc,CloudDownloadIcon:Uc,CloudDrizzle:Jk,CloudDrizzleIcon:Jk,CloudFog:eO,CloudFogIcon:eO,CloudHail:tO,CloudHailIcon:tO,CloudIcon:NA,CloudLightning:aO,CloudLightningIcon:aO,CloudMoon:sO,CloudMoonIcon:sO,CloudMoonRain:nO,CloudMoonRainIcon:nO,CloudOff:rO,CloudOffIcon:rO,CloudRain:iO,CloudRainIcon:iO,CloudRainWind:oO,CloudRainWindIcon:oO,CloudSnow:cO,CloudSnowIcon:cO,CloudSun:dO,CloudSunIcon:dO,CloudSunRain:lO,CloudSunRainIcon:lO,CloudSync:AO,CloudSyncIcon:AO,CloudUpload:Pc,CloudUploadIcon:Pc,Cloudy:uO,CloudyIcon:uO,Clover:hO,CloverIcon:hO,Club:pO,ClubIcon:pO,Code:fO,Code2:Zt,Code2Icon:Zt,CodeIcon:fO,CodeSquare:bd,CodeSquareIcon:bd,CodeXml:Zt,CodeXmlIcon:Zt,Coffee:xO,CoffeeIcon:xO,Cog:mO,CogIcon:mO,Coins:gO,CoinsIcon:gO,Columns:Ec,Columns2:Ec,Columns2Icon:Ec,Columns3:zc,Columns3Cog:Es,Columns3CogIcon:Es,Columns3Icon:zc,Columns4:yO,Columns4Icon:yO,ColumnsIcon:Ec,ColumnsSettings:Es,ColumnsSettingsIcon:Es,Combine:vO,CombineIcon:vO,Command:kO,CommandIcon:kO,Compass:OO,CompassIcon:OO,Component:bO,ComponentIcon:bO,Computer:wO,ComputerIcon:wO,ConciergeBell:jO,ConciergeBellIcon:jO,Cone:NO,ConeIcon:NO,Construction:CO,ConstructionIcon:CO,Contact:MO,Contact2:Fc,Contact2Icon:Fc,ContactIcon:MO,ContactRound:Fc,ContactRoundIcon:Fc,Container:SO,ContainerIcon:SO,Contrast:QO,ContrastIcon:QO,Cookie:BO,CookieIcon:BO,CookingPot:_O,CookingPotIcon:_O,Copy:wn,CopyCheck:LO,CopyCheckIcon:LO,CopyIcon:wn,CopyMinus:TO,CopyMinusIcon:TO,CopyPlus:$O,CopyPlusIcon:$O,CopySlash:IO,CopySlashIcon:IO,CopyX:UO,CopyXIcon:UO,Copyleft:PO,CopyleftIcon:PO,Copyright:EO,CopyrightIcon:EO,CornerDownLeft:zO,CornerDownLeftIcon:zO,CornerDownRight:FO,CornerDownRightIcon:FO,CornerLeftDown:RO,CornerLeftDownIcon:RO,CornerLeftUp:qO,CornerLeftUpIcon:qO,CornerRightDown:HO,CornerRightDownIcon:HO,CornerRightUp:DO,CornerRightUpIcon:DO,CornerUpLeft:VO,CornerUpLeftIcon:VO,CornerUpRight:XO,CornerUpRightIcon:XO,Cpu:Ba,CpuIcon:Ba,CreativeCommons:ZO,CreativeCommonsIcon:ZO,CreditCard:GO,CreditCardIcon:GO,Croissant:WO,CroissantIcon:WO,Crop:KO,CropIcon:KO,Cross:YO,CrossIcon:YO,Crosshair:JO,CrosshairIcon:JO,Crown:e4,CrownIcon:e4,Cuboid:t4,CuboidIcon:t4,CupSoda:a4,CupSodaIcon:a4,CurlyBraces:Wi,CurlyBracesIcon:Wi,Currency:n4,CurrencyIcon:n4,Cylinder:s4,CylinderIcon:s4,Dam:r4,DamIcon:r4,Database:MA,DatabaseBackup:o4,DatabaseBackupIcon:o4,DatabaseIcon:MA,DatabaseSearch:i4,DatabaseSearchIcon:i4,DatabaseZap:c4,DatabaseZapIcon:c4,DecimalsArrowLeft:l4,DecimalsArrowLeftIcon:l4,DecimalsArrowRight:d4,DecimalsArrowRightIcon:d4,Delete:A4,DeleteIcon:A4,Dessert:u4,DessertIcon:u4,Diameter:h4,DiameterIcon:h4,Diamond:x4,DiamondIcon:x4,DiamondMinus:p4,DiamondMinusIcon:p4,DiamondPercent:Rc,DiamondPercentIcon:Rc,DiamondPlus:f4,DiamondPlusIcon:f4,Dice1:m4,Dice1Icon:m4,Dice2:g4,Dice2Icon:g4,Dice3:y4,Dice3Icon:y4,Dice4:v4,Dice4Icon:v4,Dice5:k4,Dice5Icon:k4,Dice6:O4,Dice6Icon:O4,Dices:b4,DicesIcon:b4,Diff:w4,DiffIcon:w4,Disc:N4,Disc2:j4,Disc2Icon:j4,Disc3:M4,Disc3Icon:M4,DiscAlbum:C4,DiscAlbumIcon:C4,DiscIcon:N4,Divide:S4,DivideCircle:kc,DivideCircleIcon:kc,DivideIcon:S4,DivideSquare:Md,DivideSquareIcon:Md,Dna:B4,DnaIcon:B4,DnaOff:Q4,DnaOffIcon:Q4,Dock:_4,DockIcon:_4,Dog:L4,DogIcon:L4,DollarSign:h0,DollarSignIcon:h0,Donut:T4,DonutIcon:T4,DoorClosed:I4,DoorClosedIcon:I4,DoorClosedLocked:$4,DoorClosedLockedIcon:$4,DoorOpen:U4,DoorOpenIcon:U4,Dot:P4,DotIcon:P4,DotSquare:Sd,DotSquareIcon:Sd,Download:_a,DownloadCloud:Uc,DownloadCloudIcon:Uc,DownloadIcon:_a,DraftingCompass:E4,DraftingCompassIcon:E4,Drama:z4,DramaIcon:z4,Drill:F4,DrillIcon:F4,Drone:R4,DroneIcon:R4,Droplet:q4,DropletIcon:q4,DropletOff:H4,DropletOffIcon:H4,Droplets:D4,DropletsIcon:D4,Drum:V4,DrumIcon:V4,Drumstick:X4,DrumstickIcon:X4,Dumbbell:Z4,DumbbellIcon:Z4,Ear:W4,EarIcon:W4,EarOff:G4,EarOffIcon:G4,Earth:Hc,EarthIcon:Hc,EarthLock:K4,EarthLockIcon:K4,Eclipse:Y4,EclipseIcon:Y4,Edit:sn,Edit2:Lr,Edit2Icon:Lr,Edit3:Eo,Edit3Icon:Eo,EditIcon:sn,Egg:t5,EggFried:J4,EggFriedIcon:J4,EggIcon:t5,EggOff:e5,EggOffIcon:e5,Ellipse:a5,EllipseIcon:a5,Ellipsis:Uo,EllipsisIcon:Uo,EllipsisVertical:qc,EllipsisVerticalIcon:qc,Equal:r5,EqualApproximately:n5,EqualApproximatelyIcon:n5,EqualIcon:r5,EqualNot:s5,EqualNotIcon:s5,EqualSquare:Qd,EqualSquareIcon:Qd,Eraser:o5,EraserIcon:o5,EthernetPort:i5,EthernetPortIcon:i5,Euro:c5,EuroIcon:c5,EvCharger:l5,EvChargerIcon:l5,Expand:d5,ExpandIcon:d5,ExternalLink:ma,ExternalLinkIcon:ma,Eye:na,EyeClosed:A5,EyeClosedIcon:A5,EyeIcon:na,EyeOff:jn,EyeOffIcon:jn,Factory:u5,FactoryIcon:u5,Fan:h5,FanIcon:h5,FastForward:p5,FastForwardIcon:p5,Feather:f5,FeatherIcon:f5,Fence:x5,FenceIcon:x5,FerrisWheel:m5,FerrisWheelIcon:m5,File:iu,FileArchive:g5,FileArchiveIcon:g5,FileAudio:zs,FileAudio2:zs,FileAudio2Icon:zs,FileAudioIcon:zs,FileAxis3D:Dc,FileAxis3DIcon:Dc,FileAxis3d:Dc,FileAxis3dIcon:Dc,FileBadge:Vc,FileBadge2:Vc,FileBadge2Icon:Vc,FileBadgeIcon:Vc,FileBarChart:Zc,FileBarChart2:Wc,FileBarChart2Icon:Wc,FileBarChartIcon:Zc,FileBox:y5,FileBoxIcon:y5,FileBraces:Gc,FileBracesCorner:Xc,FileBracesCornerIcon:Xc,FileBracesIcon:Gc,FileChartColumn:Wc,FileChartColumnIcon:Wc,FileChartColumnIncreasing:Zc,FileChartColumnIncreasingIcon:Zc,FileChartLine:Kc,FileChartLineIcon:Kc,FileChartPie:Yc,FileChartPieIcon:Yc,FileCheck:v5,FileCheck2:Jc,FileCheck2Icon:Jc,FileCheckCorner:Jc,FileCheckCornerIcon:Jc,FileCheckIcon:v5,FileClock:k5,FileClockIcon:k5,FileCode:ou,FileCode2:el,FileCode2Icon:el,FileCodeCorner:el,FileCodeCornerIcon:el,FileCodeIcon:ou,FileCog:tl,FileCog2:tl,FileCog2Icon:tl,FileCogIcon:tl,FileDiff:O5,FileDiffIcon:O5,FileDigit:b5,FileDigitIcon:b5,FileDown:w5,FileDownIcon:w5,FileEdit:ps,FileEditIcon:ps,FileExclamationPoint:al,FileExclamationPointIcon:al,FileHeadphone:zs,FileHeadphoneIcon:zs,FileHeart:j5,FileHeartIcon:j5,FileIcon:iu,FileImage:C5,FileImageIcon:C5,FileInput:N5,FileInputIcon:N5,FileJson:Gc,FileJson2:Xc,FileJson2Icon:Xc,FileJsonIcon:Gc,FileKey:nl,FileKey2:nl,FileKey2Icon:nl,FileKeyIcon:nl,FileLineChart:Kc,FileLineChartIcon:Kc,FileLock:sl,FileLock2:sl,FileLock2Icon:sl,FileLockIcon:sl,FileMinus:S5,FileMinus2:rl,FileMinus2Icon:rl,FileMinusCorner:rl,FileMinusCornerIcon:rl,FileMinusIcon:S5,FileMusic:M5,FileMusicIcon:M5,FileOutput:Q5,FileOutputIcon:Q5,FilePen:ps,FilePenIcon:ps,FilePenLine:ol,FilePenLineIcon:ol,FilePieChart:Yc,FilePieChartIcon:Yc,FilePlay:il,FilePlayIcon:il,FilePlus:Hr,FilePlus2:cl,FilePlus2Icon:cl,FilePlusCorner:cl,FilePlusCornerIcon:cl,FilePlusIcon:Hr,FileQuestion:ll,FileQuestionIcon:ll,FileQuestionMark:ll,FileQuestionMarkIcon:ll,FileScan:B5,FileScanIcon:B5,FileSearch:_5,FileSearch2:dl,FileSearch2Icon:dl,FileSearchCorner:dl,FileSearchCornerIcon:dl,FileSearchIcon:_5,FileSignal:Al,FileSignalIcon:Al,FileSignature:ol,FileSignatureIcon:ol,FileSliders:L5,FileSlidersIcon:L5,FileSpreadsheet:T5,FileSpreadsheetIcon:T5,FileStack:$5,FileStackIcon:$5,FileSymlink:I5,FileSymlinkIcon:I5,FileTerminal:U5,FileTerminalIcon:U5,FileText:Va,FileTextIcon:Va,FileType:P5,FileType2:ul,FileType2Icon:ul,FileTypeCorner:ul,FileTypeCornerIcon:ul,FileTypeIcon:P5,FileUp:E5,FileUpIcon:E5,FileUser:z5,FileUserIcon:z5,FileVideo:il,FileVideo2:hl,FileVideo2Icon:hl,FileVideoCamera:hl,FileVideoCameraIcon:hl,FileVideoIcon:il,FileVolume:F5,FileVolume2:Al,FileVolume2Icon:Al,FileVolumeIcon:F5,FileWarning:al,FileWarningIcon:al,FileX:R5,FileX2:pl,FileX2Icon:pl,FileXCorner:pl,FileXCornerIcon:pl,FileXIcon:R5,Files:H5,FilesIcon:H5,Film:q5,FilmIcon:q5,Filter:yl,FilterIcon:yl,FilterX:gl,FilterXIcon:gl,Fingerprint:fl,FingerprintIcon:fl,FingerprintPattern:fl,FingerprintPatternIcon:fl,FireExtinguisher:D5,FireExtinguisherIcon:D5,Fish:W5,FishIcon:W5,FishOff:V5,FishOffIcon:V5,FishSymbol:X5,FishSymbolIcon:X5,FishingHook:Z5,FishingHookIcon:Z5,FishingRod:G5,FishingRodIcon:G5,Flag:eb,FlagIcon:eb,FlagOff:K5,FlagOffIcon:K5,FlagTriangleLeft:Y5,FlagTriangleLeftIcon:Y5,FlagTriangleRight:J5,FlagTriangleRightIcon:J5,Flame:p0,FlameIcon:p0,FlameKindling:tb,FlameKindlingIcon:tb,Flashlight:nb,FlashlightIcon:nb,FlashlightOff:ab,FlashlightOffIcon:ab,FlaskConical:cu,FlaskConicalIcon:cu,FlaskConicalOff:sb,FlaskConicalOffIcon:sb,FlaskRound:rb,FlaskRoundIcon:rb,FlipHorizontal:xd,FlipHorizontal2:ob,FlipHorizontal2Icon:ob,FlipHorizontalIcon:xd,FlipVertical:gd,FlipVertical2:ib,FlipVertical2Icon:ib,FlipVerticalIcon:gd,Flower:lb,Flower2:cb,Flower2Icon:cb,FlowerIcon:lb,Focus:db,FocusIcon:db,FoldHorizontal:Ab,FoldHorizontalIcon:Ab,FoldVertical:ub,FoldVerticalIcon:ub,Folder:Ko,FolderArchive:hb,FolderArchiveIcon:hb,FolderCheck:pb,FolderCheckIcon:pb,FolderClock:fb,FolderClockIcon:fb,FolderClosed:f0,FolderClosedIcon:f0,FolderCode:xb,FolderCodeIcon:xb,FolderCog:xl,FolderCog2:xl,FolderCog2Icon:xl,FolderCogIcon:xl,FolderDot:mb,FolderDotIcon:mb,FolderDown:gb,FolderDownIcon:gb,FolderEdit:ml,FolderEditIcon:ml,FolderGit:vb,FolderGit2:yb,FolderGit2Icon:yb,FolderGitIcon:vb,FolderHeart:kb,FolderHeartIcon:kb,FolderIcon:Ko,FolderInput:Ob,FolderInputIcon:Ob,FolderKanban:bb,FolderKanbanIcon:bb,FolderKey:wb,FolderKeyIcon:wb,FolderLock:jb,FolderLockIcon:jb,FolderMinus:Cb,FolderMinusIcon:Cb,FolderOpen:ga,FolderOpenDot:Nb,FolderOpenDotIcon:Nb,FolderOpenIcon:ga,FolderOutput:Mb,FolderOutputIcon:Mb,FolderPen:ml,FolderPenIcon:ml,FolderPlus:qr,FolderPlusIcon:qr,FolderRoot:Sb,FolderRootIcon:Sb,FolderSearch:SA,FolderSearch2:Qb,FolderSearch2Icon:Qb,FolderSearchIcon:SA,FolderSymlink:Bb,FolderSymlinkIcon:Bb,FolderSync:_b,FolderSyncIcon:_b,FolderTree:Lb,FolderTreeIcon:Lb,FolderUp:Tb,FolderUpIcon:Tb,FolderX:$b,FolderXIcon:$b,Folders:Ib,FoldersIcon:Ib,Footprints:Ub,FootprintsIcon:Ub,ForkKnife:yA,ForkKnifeCrossed:gA,ForkKnifeCrossedIcon:gA,ForkKnifeIcon:yA,Forklift:Pb,ForkliftIcon:Pb,Form:Eb,FormIcon:Eb,FormInput:Xl,FormInputIcon:Xl,Forward:zb,ForwardIcon:zb,Frame:Fb,FrameIcon:Fb,Frown:Rb,FrownIcon:Rb,Fuel:Hb,FuelIcon:Hb,Fullscreen:qb,FullscreenIcon:qb,FunctionSquare:Bd,FunctionSquareIcon:Bd,Funnel:yl,FunnelIcon:yl,FunnelPlus:Db,FunnelPlusIcon:Db,FunnelX:gl,FunnelXIcon:gl,GalleryHorizontal:Vb,GalleryHorizontalEnd:Xb,GalleryHorizontalEndIcon:Xb,GalleryHorizontalIcon:Vb,GalleryThumbnails:Zb,GalleryThumbnailsIcon:Zb,GalleryVertical:Wb,GalleryVerticalEnd:Gb,GalleryVerticalEndIcon:Gb,GalleryVerticalIcon:Wb,Gamepad:Kb,Gamepad2:QA,Gamepad2Icon:QA,GamepadDirectional:Yb,GamepadDirectionalIcon:Yb,GamepadIcon:Kb,GanttChart:ic,GanttChartIcon:ic,GanttChartSquare:qs,GanttChartSquareIcon:qs,Gauge:x0,GaugeCircle:Oc,GaugeCircleIcon:Oc,GaugeIcon:x0,Gavel:Jb,GavelIcon:Jb,Gem:e3,GemIcon:e3,GeorgianLari:t3,GeorgianLariIcon:t3,Ghost:a3,GhostIcon:a3,Gift:m0,GiftIcon:m0,GitBranch:Js,GitBranchIcon:Js,GitBranchMinus:n3,GitBranchMinusIcon:n3,GitBranchPlus:s3,GitBranchPlusIcon:s3,GitCommit:vl,GitCommitHorizontal:vl,GitCommitHorizontalIcon:vl,GitCommitIcon:vl,GitCommitVertical:r3,GitCommitVerticalIcon:r3,GitCompare:o3,GitCompareArrows:g0,GitCompareArrowsIcon:g0,GitCompareIcon:o3,GitFork:i3,GitForkIcon:i3,GitGraph:c3,GitGraphIcon:c3,GitMerge:d3,GitMergeConflict:l3,GitMergeConflictIcon:l3,GitMergeIcon:d3,GitPullRequest:x3,GitPullRequestArrow:A3,GitPullRequestArrowIcon:A3,GitPullRequestClosed:u3,GitPullRequestClosedIcon:u3,GitPullRequestCreate:p3,GitPullRequestCreateArrow:h3,GitPullRequestCreateArrowIcon:h3,GitPullRequestCreateIcon:p3,GitPullRequestDraft:f3,GitPullRequestDraftIcon:f3,GitPullRequestIcon:x3,GlassWater:m3,GlassWaterIcon:m3,Glasses:g3,GlassesIcon:g3,Globe:sa,Globe2:Hc,Globe2Icon:Hc,GlobeIcon:sa,GlobeLock:y3,GlobeLockIcon:y3,GlobeOff:v3,GlobeOffIcon:v3,GlobeX:k3,GlobeXIcon:k3,Goal:O3,GoalIcon:O3,Gpu:b3,GpuIcon:b3,Grab:jl,GrabIcon:jl,GraduationCap:w3,GraduationCapIcon:w3,Grape:j3,GrapeIcon:j3,Grid:Fs,Grid2X2:wl,Grid2X2Check:kl,Grid2X2CheckIcon:kl,Grid2X2Icon:wl,Grid2X2Plus:Ol,Grid2X2PlusIcon:Ol,Grid2X2X:bl,Grid2X2XIcon:bl,Grid2x2:wl,Grid2x2Check:kl,Grid2x2CheckIcon:kl,Grid2x2Icon:wl,Grid2x2Plus:Ol,Grid2x2PlusIcon:Ol,Grid2x2X:bl,Grid2x2XIcon:bl,Grid3X3:Fs,Grid3X3Icon:Fs,Grid3x2:C3,Grid3x2Icon:C3,Grid3x3:Fs,Grid3x3Icon:Fs,GridIcon:Fs,Grip:N3,GripHorizontal:lu,GripHorizontalIcon:lu,GripIcon:N3,GripVertical:y0,GripVerticalIcon:y0,Group:M3,GroupIcon:M3,Guitar:Q3,GuitarIcon:Q3,Ham:S3,HamIcon:S3,Hamburger:B3,HamburgerIcon:B3,Hammer:_3,HammerIcon:_3,Hand:P3,HandCoins:L3,HandCoinsIcon:L3,HandFist:T3,HandFistIcon:T3,HandGrab:jl,HandGrabIcon:jl,HandHeart:$3,HandHeartIcon:$3,HandHelping:Cl,HandHelpingIcon:Cl,HandIcon:P3,HandMetal:I3,HandMetalIcon:I3,HandPlatter:U3,HandPlatterIcon:U3,Handbag:E3,HandbagIcon:E3,Handshake:z3,HandshakeIcon:z3,HardDrive:Kn,HardDriveDownload:F3,HardDriveDownloadIcon:F3,HardDriveIcon:Kn,HardDriveUpload:R3,HardDriveUploadIcon:R3,HardHat:H3,HardHatIcon:H3,Hash:du,HashIcon:du,HatGlasses:D3,HatGlassesIcon:D3,Haze:q3,HazeIcon:q3,Hd:V3,HdIcon:V3,HdmiPort:X3,HdmiPortIcon:X3,Heading:J3,Heading1:G3,Heading1Icon:G3,Heading2:Z3,Heading2Icon:Z3,Heading3:W3,Heading3Icon:W3,Heading4:K3,Heading4Icon:K3,Heading5:Y3,Heading5Icon:Y3,Heading6:ew,Heading6Icon:ew,HeadingIcon:J3,HeadphoneOff:tw,HeadphoneOffIcon:tw,Headphones:Au,HeadphonesIcon:Au,Headset:aw,HeadsetIcon:aw,Heart:v0,HeartCrack:nw,HeartCrackIcon:nw,HeartHandshake:sw,HeartHandshakeIcon:sw,HeartIcon:v0,HeartMinus:rw,HeartMinusIcon:rw,HeartOff:ow,HeartOffIcon:ow,HeartPlus:iw,HeartPlusIcon:iw,HeartPulse:cw,HeartPulseIcon:cw,HeartX:lw,HeartXIcon:lw,Heater:dw,HeaterIcon:dw,Helicopter:Aw,HelicopterIcon:Aw,HelpCircle:Na,HelpCircleIcon:Na,HelpingHand:Cl,HelpingHandIcon:Cl,Hexagon:uw,HexagonIcon:uw,Highlighter:hw,HighlighterIcon:hw,History:pw,HistoryIcon:pw,Home:Po,HomeIcon:Po,Hop:xw,HopIcon:xw,HopOff:fw,HopOffIcon:fw,Hospital:mw,HospitalIcon:mw,Hotel:gw,HotelIcon:gw,Hourglass:yw,HourglassIcon:yw,House:Po,HouseHeart:vw,HouseHeartIcon:vw,HouseIcon:Po,HousePlug:kw,HousePlugIcon:kw,HousePlus:Ow,HousePlusIcon:Ow,HouseWifi:bw,HouseWifiIcon:bw,IceCream:Ml,IceCream2:Nl,IceCream2Icon:Nl,IceCreamBowl:Nl,IceCreamBowlIcon:Nl,IceCreamCone:Ml,IceCreamConeIcon:Ml,IceCreamIcon:Ml,Icon:uG,IdCard:jw,IdCardIcon:jw,IdCardLanyard:ww,IdCardLanyardIcon:ww,Image:Zn,ImageDown:Cw,ImageDownIcon:Cw,ImageIcon:Zn,ImageMinus:Mw,ImageMinusIcon:Mw,ImageOff:Nw,ImageOffIcon:Nw,ImagePlay:Sw,ImagePlayIcon:Sw,ImagePlus:Qw,ImagePlusIcon:Qw,ImageUp:Bw,ImageUpIcon:Bw,ImageUpscale:_w,ImageUpscaleIcon:_w,Images:Lw,ImagesIcon:Lw,Import:Tw,ImportIcon:Tw,Inbox:$w,InboxIcon:$w,Indent:Hs,IndentDecrease:Rs,IndentDecreaseIcon:Rs,IndentIcon:Hs,IndentIncrease:Hs,IndentIncreaseIcon:Hs,IndianRupee:Iw,IndianRupeeIcon:Iw,Infinity:Uw,InfinityIcon:Uw,Info:uu,InfoIcon:uu,Inspect:Id,InspectIcon:Id,InspectionPanel:Pw,InspectionPanelIcon:Pw,Italic:Ew,ItalicIcon:Ew,IterationCcw:zw,IterationCcwIcon:zw,IterationCw:Fw,IterationCwIcon:Fw,JapaneseYen:Rw,JapaneseYenIcon:Rw,Joystick:Hw,JoystickIcon:Hw,Kanban:qw,KanbanIcon:qw,KanbanSquare:_d,KanbanSquareDashed:jd,KanbanSquareDashedIcon:jd,KanbanSquareIcon:_d,Kayak:Dw,KayakIcon:Dw,Key:ws,KeyIcon:ws,KeyRound:hu,KeyRoundIcon:hu,KeySquare:Vw,KeySquareIcon:Vw,Keyboard:Gw,KeyboardIcon:Gw,KeyboardMusic:Xw,KeyboardMusicIcon:Xw,KeyboardOff:Zw,KeyboardOffIcon:Zw,Lamp:t8,LampCeiling:Kw,LampCeilingIcon:Kw,LampDesk:Ww,LampDeskIcon:Ww,LampFloor:Yw,LampFloorIcon:Yw,LampIcon:t8,LampWallDown:Jw,LampWallDownIcon:Jw,LampWallUp:e8,LampWallUpIcon:e8,LandPlot:a8,LandPlotIcon:a8,Landmark:n8,LandmarkIcon:n8,Languages:s8,LanguagesIcon:s8,Laptop:o8,Laptop2:Sl,Laptop2Icon:Sl,LaptopIcon:o8,LaptopMinimal:Sl,LaptopMinimalCheck:r8,LaptopMinimalCheckIcon:r8,LaptopMinimalIcon:Sl,Lasso:c8,LassoIcon:c8,LassoSelect:i8,LassoSelectIcon:i8,Laugh:l8,LaughIcon:l8,Layers:Dn,Layers2:d8,Layers2Icon:d8,Layers3:Dn,Layers3Icon:Dn,LayersIcon:Dn,LayersMinus:A8,LayersMinusIcon:A8,LayersPlus:u8,LayersPlusIcon:u8,Layout:Vl,LayoutDashboard:k0,LayoutDashboardIcon:k0,LayoutGrid:O0,LayoutGridIcon:O0,LayoutIcon:Vl,LayoutList:h8,LayoutListIcon:h8,LayoutPanelLeft:p8,LayoutPanelLeftIcon:p8,LayoutPanelTop:f8,LayoutPanelTopIcon:f8,LayoutTemplate:x8,LayoutTemplateIcon:x8,Leaf:m8,LeafIcon:m8,LeafyGreen:g8,LeafyGreenIcon:g8,Lectern:y8,LecternIcon:y8,LensConcave:v8,LensConcaveIcon:v8,LensConvex:O8,LensConvexIcon:O8,LetterText:rA,LetterTextIcon:rA,Library:b8,LibraryBig:k8,LibraryBigIcon:k8,LibraryIcon:b8,LibrarySquare:Ld,LibrarySquareIcon:Ld,LifeBuoy:j8,LifeBuoyIcon:j8,Ligature:w8,LigatureIcon:w8,Lightbulb:N8,LightbulbIcon:N8,LightbulbOff:C8,LightbulbOffIcon:C8,LineChart:sc,LineChartIcon:sc,LineDotRightHorizontal:M8,LineDotRightHorizontalIcon:M8,LineSquiggle:S8,LineSquiggleIcon:S8,LineStyle:Q8,LineStyleIcon:Q8,Link:b0,Link2:Yo,Link2Icon:Yo,Link2Off:B8,Link2OffIcon:B8,LinkIcon:b0,List:G8,ListCheck:_8,ListCheckIcon:_8,ListChecks:w0,ListChecksIcon:w0,ListChevronsDownUp:L8,ListChevronsDownUpIcon:L8,ListChevronsUpDown:$8,ListChevronsUpDownIcon:$8,ListCollapse:T8,ListCollapseIcon:T8,ListEnd:I8,ListEndIcon:I8,ListFilter:P8,ListFilterIcon:P8,ListFilterPlus:U8,ListFilterPlusIcon:U8,ListIcon:G8,ListIndentDecrease:Rs,ListIndentDecreaseIcon:Rs,ListIndentIncrease:Hs,ListIndentIncreaseIcon:Hs,ListMinus:E8,ListMinusIcon:E8,ListMusic:z8,ListMusicIcon:z8,ListOrdered:F8,ListOrderedIcon:F8,ListPlus:R8,ListPlusIcon:R8,ListRestart:H8,ListRestartIcon:H8,ListStart:q8,ListStartIcon:q8,ListTodo:D8,ListTodoIcon:D8,ListTree:X8,ListTreeIcon:X8,ListVideo:V8,ListVideoIcon:V8,ListX:Z8,ListXIcon:Z8,Loader:K8,Loader2:$e,Loader2Icon:$e,LoaderCircle:$e,LoaderCircleIcon:$e,LoaderIcon:K8,LoaderPinwheel:W8,LoaderPinwheelIcon:W8,Locate:e6,LocateFixed:Y8,LocateFixedIcon:Y8,LocateIcon:e6,LocateOff:J8,LocateOffIcon:J8,LocationEdit:Ll,LocationEditIcon:Ll,Lock:j0,LockIcon:j0,LockKeyhole:t6,LockKeyholeIcon:t6,LockKeyholeOpen:Ql,LockKeyholeOpenIcon:Ql,LockOpen:Bl,LockOpenIcon:Bl,LogIn:pu,LogInIcon:pu,LogOut:C0,LogOutIcon:C0,Logs:a6,LogsIcon:a6,Lollipop:n6,LollipopIcon:n6,LucideAArrowDown:Qf,LucideAArrowUp:Bf,LucideALargeSmall:_f,LucideAccessibility:Lf,LucideActivity:Ys,LucideActivitySquare:td,LucideAirVent:Tf,LucideAirplay:$f,LucideAlarmCheck:$i,LucideAlarmClock:Uf,LucideAlarmClockCheck:$i,LucideAlarmClockMinus:Ii,LucideAlarmClockOff:If,LucideAlarmClockPlus:Ui,LucideAlarmMinus:Ii,LucideAlarmPlus:Ui,LucideAlarmSmoke:Pf,LucideAlbum:Ef,LucideAlertCircle:Xt,LucideAlertOctagon:Ul,LucideAlertTriangle:Gt,LucideAlignCenter:aA,LucideAlignCenterHorizontal:zf,LucideAlignCenterVertical:Ff,LucideAlignEndHorizontal:Rf,LucideAlignEndVertical:Hf,LucideAlignHorizontalDistributeCenter:qf,LucideAlignHorizontalDistributeEnd:Df,LucideAlignHorizontalDistributeStart:Vf,LucideAlignHorizontalJustifyCenter:Xf,LucideAlignHorizontalJustifyEnd:Zf,LucideAlignHorizontalJustifyStart:Gf,LucideAlignHorizontalSpaceAround:Wf,LucideAlignHorizontalSpaceBetween:Yf,LucideAlignJustify:nA,LucideAlignLeft:Vs,LucideAlignRight:sA,LucideAlignStartHorizontal:Kf,LucideAlignStartVertical:Jf,LucideAlignVerticalDistributeCenter:ex,LucideAlignVerticalDistributeEnd:tx,LucideAlignVerticalDistributeStart:ax,LucideAlignVerticalJustifyCenter:nx,LucideAlignVerticalJustifyEnd:rx,LucideAlignVerticalJustifyStart:sx,LucideAlignVerticalSpaceAround:ox,LucideAlignVerticalSpaceBetween:ix,LucideAmbulance:cx,LucideAmpersand:lx,LucideAmpersands:Ax,LucideAmphora:dx,LucideAnchor:ux,LucideAngry:hx,LucideAnnoyed:px,LucideAntenna:fx,LucideAnvil:xx,LucideAperture:mx,LucideAppWindow:yx,LucideAppWindowMac:gx,LucideApple:vx,LucideArchive:CA,LucideArchiveRestore:kx,LucideArchiveX:Ox,LucideAreaChart:Yi,LucideArmchair:bx,LucideArrowBigDown:jx,LucideArrowBigDownDash:wx,LucideArrowBigLeft:Nx,LucideArrowBigLeftDash:Cx,LucideArrowBigRight:Sx,LucideArrowBigRightDash:Mx,LucideArrowBigUp:Qx,LucideArrowBigUpDash:Bx,LucideArrowDown:i0,LucideArrowDown01:_x,LucideArrowDown10:Lx,LucideArrowDownAZ:Pi,LucideArrowDownAz:Pi,LucideArrowDownCircle:dc,LucideArrowDownFromLine:Tx,LucideArrowDownLeft:o0,LucideArrowDownLeftFromCircle:hc,LucideArrowDownLeftFromSquare:od,LucideArrowDownLeftSquare:ad,LucideArrowDownNarrowWide:$x,LucideArrowDownRight:Ix,LucideArrowDownRightFromCircle:uc,LucideArrowDownRightFromSquare:id,LucideArrowDownRightSquare:sd,LucideArrowDownSquare:nd,LucideArrowDownToDot:Ux,LucideArrowDownToLine:Px,LucideArrowDownUp:Ex,LucideArrowDownWideNarrow:Ei,LucideArrowDownZA:zi,LucideArrowDownZa:zi,LucideArrowLeft:J1,LucideArrowLeftCircle:Ac,LucideArrowLeftFromLine:zx,LucideArrowLeftRight:Fx,LucideArrowLeftSquare:rd,LucideArrowLeftToLine:Rx,LucideArrowRight:Fr,LucideArrowRightCircle:fc,LucideArrowRightFromLine:Hx,LucideArrowRightLeft:qx,LucideArrowRightSquare:dd,LucideArrowRightToLine:Dx,LucideArrowUp:eu,LucideArrowUp01:Vx,LucideArrowUp10:Xx,LucideArrowUpAZ:Fi,LucideArrowUpAz:Fi,LucideArrowUpCircle:za,LucideArrowUpDown:Zx,LucideArrowUpFromDot:Gx,LucideArrowUpFromLine:Wx,LucideArrowUpLeft:Kx,LucideArrowUpLeftFromCircle:pc,LucideArrowUpLeftFromSquare:ld,LucideArrowUpLeftSquare:Ad,LucideArrowUpNarrowWide:Ri,LucideArrowUpRight:c0,LucideArrowUpRightFromCircle:xc,LucideArrowUpRightFromSquare:cd,LucideArrowUpRightSquare:ud,LucideArrowUpSquare:hd,LucideArrowUpToLine:Yx,LucideArrowUpWideNarrow:Jx,LucideArrowUpZA:Hi,LucideArrowUpZa:Hi,LucideArrowsUpFromLine:em,LucideAsterisk:tm,LucideAsteriskSquare:pd,LucideAtSign:am,LucideAtom:nm,LucideAudioLines:sm,LucideAudioWaveform:rm,LucideAward:om,LucideAxe:im,LucideAxis3D:qi,LucideAxis3d:qi,LucideBaby:cm,LucideBackpack:lm,LucideBadge:jm,LucideBadgeAlert:dm,LucideBadgeCent:Am,LucideBadgeCheck:Di,LucideBadgeDollarSign:um,LucideBadgeEuro:hm,LucideBadgeHelp:Vi,LucideBadgeIndianRupee:pm,LucideBadgeInfo:fm,LucideBadgeJapaneseYen:xm,LucideBadgeMinus:mm,LucideBadgePercent:gm,LucideBadgePlus:ym,LucideBadgePoundSterling:vm,LucideBadgeQuestionMark:Vi,LucideBadgeRussianRuble:km,LucideBadgeSwissFranc:Om,LucideBadgeTurkishLira:bm,LucideBadgeX:wm,LucideBaggageClaim:Cm,LucideBalloon:Nm,LucideBan:Mm,LucideBanana:Sm,LucideBandage:Qm,LucideBanknote:Tm,LucideBanknoteArrowDown:Bm,LucideBanknoteArrowUp:_m,LucideBanknoteX:Lm,LucideBarChart:rc,LucideBarChart2:oc,LucideBarChart3:hs,LucideBarChart4:nc,LucideBarChartBig:ac,LucideBarChartHorizontal:ec,LucideBarChartHorizontalBig:Ji,LucideBarcode:$m,LucideBarrel:Im,LucideBaseline:Um,LucideBath:Pm,LucideBattery:Dm,LucideBatteryCharging:Em,LucideBatteryFull:zm,LucideBatteryLow:Fm,LucideBatteryMedium:Rm,LucideBatteryPlus:Hm,LucideBatteryWarning:qm,LucideBeaker:Vm,LucideBean:Zm,LucideBeanOff:Xm,LucideBed:Km,LucideBedDouble:Gm,LucideBedSingle:Wm,LucideBeef:Jm,LucideBeefOff:Ym,LucideBeer:tg,LucideBeerOff:eg,LucideBell:lg,LucideBellCheck:ag,LucideBellDot:ng,LucideBellElectric:sg,LucideBellMinus:rg,LucideBellOff:og,LucideBellPlus:ig,LucideBellRing:cg,LucideBetweenHorizonalEnd:Xi,LucideBetweenHorizonalStart:Zi,LucideBetweenHorizontalEnd:Xi,LucideBetweenHorizontalStart:Zi,LucideBetweenVerticalEnd:dg,LucideBetweenVerticalStart:Ag,LucideBicepsFlexed:ug,LucideBike:hg,LucideBinary:pg,LucideBinoculars:fg,LucideBiohazard:xg,LucideBird:mg,LucideBirdhouse:gg,LucideBitcoin:yg,LucideBlend:vg,LucideBlinds:kg,LucideBlocks:Og,LucideBluetooth:Cg,LucideBluetoothConnected:bg,LucideBluetoothOff:wg,LucideBluetoothSearching:jg,LucideBold:Ng,LucideBolt:Mg,LucideBomb:l0,LucideBone:Sg,LucideBook:Jg,LucideBookA:Qg,LucideBookAlert:Bg,LucideBookAudio:_g,LucideBookCheck:Lg,LucideBookCopy:Tg,LucideBookDashed:Gi,LucideBookDown:$g,LucideBookHeadphones:Ig,LucideBookHeart:Ug,LucideBookImage:Pg,LucideBookKey:Eg,LucideBookLock:zg,LucideBookMarked:Fg,LucideBookMinus:Rg,LucideBookOpen:Go,LucideBookOpenCheck:Hg,LucideBookOpenText:qg,LucideBookPlus:Dg,LucideBookSearch:Vg,LucideBookTemplate:Gi,LucideBookText:Xg,LucideBookType:Zg,LucideBookUp:Wg,LucideBookUp2:Gg,LucideBookUser:Kg,LucideBookX:Yg,LucideBookmark:sy,LucideBookmarkCheck:d0,LucideBookmarkMinus:ey,LucideBookmarkOff:ty,LucideBookmarkPlus:ay,LucideBookmarkX:ny,LucideBoomBox:ry,LucideBot:Os,LucideBotMessageSquare:oy,LucideBotOff:iy,LucideBottleWine:cy,LucideBowArrow:ly,LucideBox:on,LucideBoxSelect:Nd,LucideBoxes:dy,LucideBraces:Wi,LucideBrackets:Ay,LucideBrain:A0,LucideBrainCircuit:uy,LucideBrainCog:hy,LucideBrickWall:xy,LucideBrickWallFire:py,LucideBrickWallShield:fy,LucideBriefcase:vy,LucideBriefcaseBusiness:my,LucideBriefcaseConveyorBelt:gy,LucideBriefcaseMedical:yy,LucideBringToFront:ky,LucideBrush:by,LucideBrushCleaning:Oy,LucideBubbles:wy,LucideBug:Ny,LucideBugOff:jy,LucideBugPlay:Cy,LucideBuilding:My,LucideBuilding2:Sy,LucideBus:By,LucideBusFront:Qy,LucideCable:_y,LucideCableCar:Ly,LucideCake:$y,LucideCakeSlice:Ty,LucideCalculator:tu,LucideCalendar:Wo,LucideCalendar1:Iy,LucideCalendarArrowDown:Uy,LucideCalendarArrowUp:Py,LucideCalendarCheck:zy,LucideCalendarCheck2:Ey,LucideCalendarClock:Fy,LucideCalendarCog:Ry,LucideCalendarDays:Hy,LucideCalendarFold:qy,LucideCalendarHeart:Dy,LucideCalendarMinus:Xy,LucideCalendarMinus2:Vy,LucideCalendarOff:Zy,LucideCalendarPlus:Wy,LucideCalendarPlus2:Gy,LucideCalendarRange:Ky,LucideCalendarSearch:Yy,LucideCalendarSync:Jy,LucideCalendarX:tv,LucideCalendarX2:ev,LucideCalendars:av,LucideCamera:au,LucideCameraOff:nv,LucideCandlestickChart:tc,LucideCandy:ov,LucideCandyCane:sv,LucideCandyOff:rv,LucideCannabis:cv,LucideCannabisOff:iv,LucideCaptions:Ki,LucideCaptionsOff:lv,LucideCar:uv,LucideCarFront:dv,LucideCarTaxiFront:Av,LucideCaravan:hv,LucideCardSim:pv,LucideCarrot:fv,LucideCaseLower:xv,LucideCaseSensitive:mv,LucideCaseUpper:gv,LucideCassetteTape:yv,LucideCast:vv,LucideCastle:kv,LucideCat:Ov,LucideCctv:wv,LucideCctvOff:bv,LucideChartArea:Yi,LucideChartBar:ec,LucideChartBarBig:Ji,LucideChartBarDecreasing:jv,LucideChartBarIncreasing:Cv,LucideChartBarStacked:Nv,LucideChartCandlestick:tc,LucideChartColumn:hs,LucideChartColumnBig:ac,LucideChartColumnDecreasing:Mv,LucideChartColumnIncreasing:nc,LucideChartColumnStacked:Sv,LucideChartGantt:Qv,LucideChartLine:sc,LucideChartNetwork:Bv,LucideChartNoAxesColumn:oc,LucideChartNoAxesColumnDecreasing:_v,LucideChartNoAxesColumnIncreasing:rc,LucideChartNoAxesCombined:Lv,LucideChartNoAxesGantt:ic,LucideChartPie:cc,LucideChartScatter:lc,LucideChartSpline:nu,LucideCheck:De,LucideCheckCheck:Tv,LucideCheckCircle:Sa,LucideCheckCircle2:Hn,LucideCheckLine:$v,LucideCheckSquare:md,LucideCheckSquare2:yd,LucideChefHat:Iv,LucideCherry:Uv,LucideChessBishop:Pv,LucideChessKing:Ev,LucideChessKnight:zv,LucideChessPawn:Fv,LucideChessQueen:Rv,LucideChessRook:Hv,LucideChevronDown:bt,LucideChevronDownCircle:mc,LucideChevronDownSquare:vd,LucideChevronFirst:qv,LucideChevronLast:Dv,LucideChevronLeft:bs,LucideChevronLeftCircle:gc,LucideChevronLeftSquare:kd,LucideChevronRight:Rt,LucideChevronRightCircle:yc,LucideChevronRightSquare:Od,LucideChevronUp:su,LucideChevronUpCircle:vc,LucideChevronUpSquare:wd,LucideChevronsDown:Vv,LucideChevronsDownUp:ru,LucideChevronsLeft:Gv,LucideChevronsLeftRight:Zv,LucideChevronsLeftRightEllipsis:Xv,LucideChevronsRight:Kv,LucideChevronsRightLeft:Wv,LucideChevronsUp:Jv,LucideChevronsUpDown:Yv,LucideChurch:ek,LucideCigarette:ak,LucideCigaretteOff:tk,LucideCircle:mk,LucideCircleAlert:Xt,LucideCircleArrowDown:dc,LucideCircleArrowLeft:Ac,LucideCircleArrowOutDownLeft:hc,LucideCircleArrowOutDownRight:uc,LucideCircleArrowOutUpLeft:pc,LucideCircleArrowOutUpRight:xc,LucideCircleArrowRight:fc,LucideCircleArrowUp:za,LucideCircleCheck:Hn,LucideCircleCheckBig:Sa,LucideCircleChevronDown:mc,LucideCircleChevronLeft:gc,LucideCircleChevronRight:yc,LucideCircleChevronUp:vc,LucideCircleDashed:nk,LucideCircleDivide:kc,LucideCircleDollarSign:sk,LucideCircleDot:ok,LucideCircleDotDashed:rk,LucideCircleEllipsis:ik,LucideCircleEqual:ck,LucideCircleFadingArrowUp:lk,LucideCircleFadingPlus:dk,LucideCircleGauge:Oc,LucideCircleHelp:Na,LucideCircleMinus:bc,LucideCircleOff:Ak,LucideCircleParking:jc,LucideCircleParkingOff:wc,LucideCirclePause:Cc,LucideCirclePercent:Nc,LucideCirclePile:uk,LucideCirclePlay:Mc,LucideCirclePlus:Sc,LucideCirclePoundSterling:hk,LucideCirclePower:Qc,LucideCircleQuestionMark:Na,LucideCircleSlash:pk,LucideCircleSlash2:Bc,LucideCircleSlashed:Bc,LucideCircleSmall:fk,LucideCircleStar:xk,LucideCircleStop:_c,LucideCircleUser:Tc,LucideCircleUserRound:Lc,LucideCircleX:qn,LucideCircuitBoard:gk,LucideCitrus:vk,LucideClapperboard:yk,LucideClipboard:Sk,LucideClipboardCheck:u0,LucideClipboardClock:kk,LucideClipboardCopy:Ok,LucideClipboardEdit:Ic,LucideClipboardList:bk,LucideClipboardMinus:wk,LucideClipboardPaste:jk,LucideClipboardPen:Ic,LucideClipboardPenLine:$c,LucideClipboardPlus:Ck,LucideClipboardSignature:$c,LucideClipboardType:Nk,LucideClipboardX:Mk,LucideClock:Rr,LucideClock1:Qk,LucideClock10:Bk,LucideClock11:_k,LucideClock12:Lk,LucideClock2:Tk,LucideClock3:$k,LucideClock4:Ik,LucideClock5:Uk,LucideClock6:Pk,LucideClock7:Ek,LucideClock8:zk,LucideClock9:Fk,LucideClockAlert:Rk,LucideClockArrowDown:Hk,LucideClockArrowUp:qk,LucideClockCheck:Dk,LucideClockFading:Vk,LucideClockPlus:Xk,LucideClosedCaption:Zk,LucideCloud:NA,LucideCloudAlert:Gk,LucideCloudBackup:Wk,LucideCloudCheck:Kk,LucideCloudCog:Yk,LucideCloudDownload:Uc,LucideCloudDrizzle:Jk,LucideCloudFog:eO,LucideCloudHail:tO,LucideCloudLightning:aO,LucideCloudMoon:sO,LucideCloudMoonRain:nO,LucideCloudOff:rO,LucideCloudRain:iO,LucideCloudRainWind:oO,LucideCloudSnow:cO,LucideCloudSun:dO,LucideCloudSunRain:lO,LucideCloudSync:AO,LucideCloudUpload:Pc,LucideCloudy:uO,LucideClover:hO,LucideClub:pO,LucideCode:fO,LucideCode2:Zt,LucideCodeSquare:bd,LucideCodeXml:Zt,LucideCoffee:xO,LucideCog:mO,LucideCoins:gO,LucideColumns:Ec,LucideColumns2:Ec,LucideColumns3:zc,LucideColumns3Cog:Es,LucideColumns4:yO,LucideColumnsSettings:Es,LucideCombine:vO,LucideCommand:kO,LucideCompass:OO,LucideComponent:bO,LucideComputer:wO,LucideConciergeBell:jO,LucideCone:NO,LucideConstruction:CO,LucideContact:MO,LucideContact2:Fc,LucideContactRound:Fc,LucideContainer:SO,LucideContrast:QO,LucideCookie:BO,LucideCookingPot:_O,LucideCopy:wn,LucideCopyCheck:LO,LucideCopyMinus:TO,LucideCopyPlus:$O,LucideCopySlash:IO,LucideCopyX:UO,LucideCopyleft:PO,LucideCopyright:EO,LucideCornerDownLeft:zO,LucideCornerDownRight:FO,LucideCornerLeftDown:RO,LucideCornerLeftUp:qO,LucideCornerRightDown:HO,LucideCornerRightUp:DO,LucideCornerUpLeft:VO,LucideCornerUpRight:XO,LucideCpu:Ba,LucideCreativeCommons:ZO,LucideCreditCard:GO,LucideCroissant:WO,LucideCrop:KO,LucideCross:YO,LucideCrosshair:JO,LucideCrown:e4,LucideCuboid:t4,LucideCupSoda:a4,LucideCurlyBraces:Wi,LucideCurrency:n4,LucideCylinder:s4,LucideDam:r4,LucideDatabase:MA,LucideDatabaseBackup:o4,LucideDatabaseSearch:i4,LucideDatabaseZap:c4,LucideDecimalsArrowLeft:l4,LucideDecimalsArrowRight:d4,LucideDelete:A4,LucideDessert:u4,LucideDiameter:h4,LucideDiamond:x4,LucideDiamondMinus:p4,LucideDiamondPercent:Rc,LucideDiamondPlus:f4,LucideDice1:m4,LucideDice2:g4,LucideDice3:y4,LucideDice4:v4,LucideDice5:k4,LucideDice6:O4,LucideDices:b4,LucideDiff:w4,LucideDisc:N4,LucideDisc2:j4,LucideDisc3:M4,LucideDiscAlbum:C4,LucideDivide:S4,LucideDivideCircle:kc,LucideDivideSquare:Md,LucideDna:B4,LucideDnaOff:Q4,LucideDock:_4,LucideDog:L4,LucideDollarSign:h0,LucideDonut:T4,LucideDoorClosed:I4,LucideDoorClosedLocked:$4,LucideDoorOpen:U4,LucideDot:P4,LucideDotSquare:Sd,LucideDownload:_a,LucideDownloadCloud:Uc,LucideDraftingCompass:E4,LucideDrama:z4,LucideDrill:F4,LucideDrone:R4,LucideDroplet:q4,LucideDropletOff:H4,LucideDroplets:D4,LucideDrum:V4,LucideDrumstick:X4,LucideDumbbell:Z4,LucideEar:W4,LucideEarOff:G4,LucideEarth:Hc,LucideEarthLock:K4,LucideEclipse:Y4,LucideEdit:sn,LucideEdit2:Lr,LucideEdit3:Eo,LucideEgg:t5,LucideEggFried:J4,LucideEggOff:e5,LucideEllipse:a5,LucideEllipsis:Uo,LucideEllipsisVertical:qc,LucideEqual:r5,LucideEqualApproximately:n5,LucideEqualNot:s5,LucideEqualSquare:Qd,LucideEraser:o5,LucideEthernetPort:i5,LucideEuro:c5,LucideEvCharger:l5,LucideExpand:d5,LucideExternalLink:ma,LucideEye:na,LucideEyeClosed:A5,LucideEyeOff:jn,LucideFactory:u5,LucideFan:h5,LucideFastForward:p5,LucideFeather:f5,LucideFence:x5,LucideFerrisWheel:m5,LucideFile:iu,LucideFileArchive:g5,LucideFileAudio:zs,LucideFileAudio2:zs,LucideFileAxis3D:Dc,LucideFileAxis3d:Dc,LucideFileBadge:Vc,LucideFileBadge2:Vc,LucideFileBarChart:Zc,LucideFileBarChart2:Wc,LucideFileBox:y5,LucideFileBraces:Gc,LucideFileBracesCorner:Xc,LucideFileChartColumn:Wc,LucideFileChartColumnIncreasing:Zc,LucideFileChartLine:Kc,LucideFileChartPie:Yc,LucideFileCheck:v5,LucideFileCheck2:Jc,LucideFileCheckCorner:Jc,LucideFileClock:k5,LucideFileCode:ou,LucideFileCode2:el,LucideFileCodeCorner:el,LucideFileCog:tl,LucideFileCog2:tl,LucideFileDiff:O5,LucideFileDigit:b5,LucideFileDown:w5,LucideFileEdit:ps,LucideFileExclamationPoint:al,LucideFileHeadphone:zs,LucideFileHeart:j5,LucideFileImage:C5,LucideFileInput:N5,LucideFileJson:Gc,LucideFileJson2:Xc,LucideFileKey:nl,LucideFileKey2:nl,LucideFileLineChart:Kc,LucideFileLock:sl,LucideFileLock2:sl,LucideFileMinus:S5,LucideFileMinus2:rl,LucideFileMinusCorner:rl,LucideFileMusic:M5,LucideFileOutput:Q5,LucideFilePen:ps,LucideFilePenLine:ol,LucideFilePieChart:Yc,LucideFilePlay:il,LucideFilePlus:Hr,LucideFilePlus2:cl,LucideFilePlusCorner:cl,LucideFileQuestion:ll,LucideFileQuestionMark:ll,LucideFileScan:B5,LucideFileSearch:_5,LucideFileSearch2:dl,LucideFileSearchCorner:dl,LucideFileSignal:Al,LucideFileSignature:ol,LucideFileSliders:L5,LucideFileSpreadsheet:T5,LucideFileStack:$5,LucideFileSymlink:I5,LucideFileTerminal:U5,LucideFileText:Va,LucideFileType:P5,LucideFileType2:ul,LucideFileTypeCorner:ul,LucideFileUp:E5,LucideFileUser:z5,LucideFileVideo:il,LucideFileVideo2:hl,LucideFileVideoCamera:hl,LucideFileVolume:F5,LucideFileVolume2:Al,LucideFileWarning:al,LucideFileX:R5,LucideFileX2:pl,LucideFileXCorner:pl,LucideFiles:H5,LucideFilm:q5,LucideFilter:yl,LucideFilterX:gl,LucideFingerprint:fl,LucideFingerprintPattern:fl,LucideFireExtinguisher:D5,LucideFish:W5,LucideFishOff:V5,LucideFishSymbol:X5,LucideFishingHook:Z5,LucideFishingRod:G5,LucideFlag:eb,LucideFlagOff:K5,LucideFlagTriangleLeft:Y5,LucideFlagTriangleRight:J5,LucideFlame:p0,LucideFlameKindling:tb,LucideFlashlight:nb,LucideFlashlightOff:ab,LucideFlaskConical:cu,LucideFlaskConicalOff:sb,LucideFlaskRound:rb,LucideFlipHorizontal:xd,LucideFlipHorizontal2:ob,LucideFlipVertical:gd,LucideFlipVertical2:ib,LucideFlower:lb,LucideFlower2:cb,LucideFocus:db,LucideFoldHorizontal:Ab,LucideFoldVertical:ub,LucideFolder:Ko,LucideFolderArchive:hb,LucideFolderCheck:pb,LucideFolderClock:fb,LucideFolderClosed:f0,LucideFolderCode:xb,LucideFolderCog:xl,LucideFolderCog2:xl,LucideFolderDot:mb,LucideFolderDown:gb,LucideFolderEdit:ml,LucideFolderGit:vb,LucideFolderGit2:yb,LucideFolderHeart:kb,LucideFolderInput:Ob,LucideFolderKanban:bb,LucideFolderKey:wb,LucideFolderLock:jb,LucideFolderMinus:Cb,LucideFolderOpen:ga,LucideFolderOpenDot:Nb,LucideFolderOutput:Mb,LucideFolderPen:ml,LucideFolderPlus:qr,LucideFolderRoot:Sb,LucideFolderSearch:SA,LucideFolderSearch2:Qb,LucideFolderSymlink:Bb,LucideFolderSync:_b,LucideFolderTree:Lb,LucideFolderUp:Tb,LucideFolderX:$b,LucideFolders:Ib,LucideFootprints:Ub,LucideForkKnife:yA,LucideForkKnifeCrossed:gA,LucideForklift:Pb,LucideForm:Eb,LucideFormInput:Xl,LucideForward:zb,LucideFrame:Fb,LucideFrown:Rb,LucideFuel:Hb,LucideFullscreen:qb,LucideFunctionSquare:Bd,LucideFunnel:yl,LucideFunnelPlus:Db,LucideFunnelX:gl,LucideGalleryHorizontal:Vb,LucideGalleryHorizontalEnd:Xb,LucideGalleryThumbnails:Zb,LucideGalleryVertical:Wb,LucideGalleryVerticalEnd:Gb,LucideGamepad:Kb,LucideGamepad2:QA,LucideGamepadDirectional:Yb,LucideGanttChart:ic,LucideGanttChartSquare:qs,LucideGauge:x0,LucideGaugeCircle:Oc,LucideGavel:Jb,LucideGem:e3,LucideGeorgianLari:t3,LucideGhost:a3,LucideGift:m0,LucideGitBranch:Js,LucideGitBranchMinus:n3,LucideGitBranchPlus:s3,LucideGitCommit:vl,LucideGitCommitHorizontal:vl,LucideGitCommitVertical:r3,LucideGitCompare:o3,LucideGitCompareArrows:g0,LucideGitFork:i3,LucideGitGraph:c3,LucideGitMerge:d3,LucideGitMergeConflict:l3,LucideGitPullRequest:x3,LucideGitPullRequestArrow:A3,LucideGitPullRequestClosed:u3,LucideGitPullRequestCreate:p3,LucideGitPullRequestCreateArrow:h3,LucideGitPullRequestDraft:f3,LucideGlassWater:m3,LucideGlasses:g3,LucideGlobe:sa,LucideGlobe2:Hc,LucideGlobeLock:y3,LucideGlobeOff:v3,LucideGlobeX:k3,LucideGoal:O3,LucideGpu:b3,LucideGrab:jl,LucideGraduationCap:w3,LucideGrape:j3,LucideGrid:Fs,LucideGrid2X2:wl,LucideGrid2X2Check:kl,LucideGrid2X2Plus:Ol,LucideGrid2X2X:bl,LucideGrid2x2:wl,LucideGrid2x2Check:kl,LucideGrid2x2Plus:Ol,LucideGrid2x2X:bl,LucideGrid3X3:Fs,LucideGrid3x2:C3,LucideGrid3x3:Fs,LucideGrip:N3,LucideGripHorizontal:lu,LucideGripVertical:y0,LucideGroup:M3,LucideGuitar:Q3,LucideHam:S3,LucideHamburger:B3,LucideHammer:_3,LucideHand:P3,LucideHandCoins:L3,LucideHandFist:T3,LucideHandGrab:jl,LucideHandHeart:$3,LucideHandHelping:Cl,LucideHandMetal:I3,LucideHandPlatter:U3,LucideHandbag:E3,LucideHandshake:z3,LucideHardDrive:Kn,LucideHardDriveDownload:F3,LucideHardDriveUpload:R3,LucideHardHat:H3,LucideHash:du,LucideHatGlasses:D3,LucideHaze:q3,LucideHd:V3,LucideHdmiPort:X3,LucideHeading:J3,LucideHeading1:G3,LucideHeading2:Z3,LucideHeading3:W3,LucideHeading4:K3,LucideHeading5:Y3,LucideHeading6:ew,LucideHeadphoneOff:tw,LucideHeadphones:Au,LucideHeadset:aw,LucideHeart:v0,LucideHeartCrack:nw,LucideHeartHandshake:sw,LucideHeartMinus:rw,LucideHeartOff:ow,LucideHeartPlus:iw,LucideHeartPulse:cw,LucideHeartX:lw,LucideHeater:dw,LucideHelicopter:Aw,LucideHelpCircle:Na,LucideHelpingHand:Cl,LucideHexagon:uw,LucideHighlighter:hw,LucideHistory:pw,LucideHome:Po,LucideHop:xw,LucideHopOff:fw,LucideHospital:mw,LucideHotel:gw,LucideHourglass:yw,LucideHouse:Po,LucideHouseHeart:vw,LucideHousePlug:kw,LucideHousePlus:Ow,LucideHouseWifi:bw,LucideIceCream:Ml,LucideIceCream2:Nl,LucideIceCreamBowl:Nl,LucideIceCreamCone:Ml,LucideIdCard:jw,LucideIdCardLanyard:ww,LucideImage:Zn,LucideImageDown:Cw,LucideImageMinus:Mw,LucideImageOff:Nw,LucideImagePlay:Sw,LucideImagePlus:Qw,LucideImageUp:Bw,LucideImageUpscale:_w,LucideImages:Lw,LucideImport:Tw,LucideInbox:$w,LucideIndent:Hs,LucideIndentDecrease:Rs,LucideIndentIncrease:Hs,LucideIndianRupee:Iw,LucideInfinity:Uw,LucideInfo:uu,LucideInspect:Id,LucideInspectionPanel:Pw,LucideItalic:Ew,LucideIterationCcw:zw,LucideIterationCw:Fw,LucideJapaneseYen:Rw,LucideJoystick:Hw,LucideKanban:qw,LucideKanbanSquare:_d,LucideKanbanSquareDashed:jd,LucideKayak:Dw,LucideKey:ws,LucideKeyRound:hu,LucideKeySquare:Vw,LucideKeyboard:Gw,LucideKeyboardMusic:Xw,LucideKeyboardOff:Zw,LucideLamp:t8,LucideLampCeiling:Kw,LucideLampDesk:Ww,LucideLampFloor:Yw,LucideLampWallDown:Jw,LucideLampWallUp:e8,LucideLandPlot:a8,LucideLandmark:n8,LucideLanguages:s8,LucideLaptop:o8,LucideLaptop2:Sl,LucideLaptopMinimal:Sl,LucideLaptopMinimalCheck:r8,LucideLasso:c8,LucideLassoSelect:i8,LucideLaugh:l8,LucideLayers:Dn,LucideLayers2:d8,LucideLayers3:Dn,LucideLayersMinus:A8,LucideLayersPlus:u8,LucideLayout:Vl,LucideLayoutDashboard:k0,LucideLayoutGrid:O0,LucideLayoutList:h8,LucideLayoutPanelLeft:p8,LucideLayoutPanelTop:f8,LucideLayoutTemplate:x8,LucideLeaf:m8,LucideLeafyGreen:g8,LucideLectern:y8,LucideLensConcave:v8,LucideLensConvex:O8,LucideLetterText:rA,LucideLibrary:b8,LucideLibraryBig:k8,LucideLibrarySquare:Ld,LucideLifeBuoy:j8,LucideLigature:w8,LucideLightbulb:N8,LucideLightbulbOff:C8,LucideLineChart:sc,LucideLineDotRightHorizontal:M8,LucideLineSquiggle:S8,LucideLineStyle:Q8,LucideLink:b0,LucideLink2:Yo,LucideLink2Off:B8,LucideList:G8,LucideListCheck:_8,LucideListChecks:w0,LucideListChevronsDownUp:L8,LucideListChevronsUpDown:$8,LucideListCollapse:T8,LucideListEnd:I8,LucideListFilter:P8,LucideListFilterPlus:U8,LucideListIndentDecrease:Rs,LucideListIndentIncrease:Hs,LucideListMinus:E8,LucideListMusic:z8,LucideListOrdered:F8,LucideListPlus:R8,LucideListRestart:H8,LucideListStart:q8,LucideListTodo:D8,LucideListTree:X8,LucideListVideo:V8,LucideListX:Z8,LucideLoader:K8,LucideLoader2:$e,LucideLoaderCircle:$e,LucideLoaderPinwheel:W8,LucideLocate:e6,LucideLocateFixed:Y8,LucideLocateOff:J8,LucideLocationEdit:Ll,LucideLock:j0,LucideLockKeyhole:t6,LucideLockKeyholeOpen:Ql,LucideLockOpen:Bl,LucideLogIn:pu,LucideLogOut:C0,LucideLogs:a6,LucideLollipop:n6,LucideLuggage:s6,LucideMSquare:Td,LucideMagnet:r6,LucideMail:h6,LucideMailCheck:o6,LucideMailMinus:i6,LucideMailOpen:c6,LucideMailPlus:l6,LucideMailQuestion:_l,LucideMailQuestionMark:_l,LucideMailSearch:d6,LucideMailWarning:A6,LucideMailX:u6,LucideMailbox:p6,LucideMails:f6,LucideMap:N0,LucideMapMinus:m6,LucideMapPin:S6,LucideMapPinCheck:g6,LucideMapPinCheckInside:x6,LucideMapPinHouse:y6,LucideMapPinMinus:k6,LucideMapPinMinusInside:v6,LucideMapPinOff:O6,LucideMapPinPen:Ll,LucideMapPinPlus:w6,LucideMapPinPlusInside:b6,LucideMapPinSearch:j6,LucideMapPinX:N6,LucideMapPinXInside:C6,LucideMapPinned:M6,LucideMapPlus:Q6,LucideMars:_6,LucideMarsStroke:B6,LucideMartini:L6,LucideMaximize:T6,LucideMaximize2:BA,LucideMedal:$6,LucideMegaphone:_A,LucideMegaphoneOff:I6,LucideMeh:U6,LucideMemoryStick:M0,LucideMenu:P6,LucideMenuSquare:$d,LucideMerge:E6,LucideMessageCircle:Yn,LucideMessageCircleCheck:z6,LucideMessageCircleCode:F6,LucideMessageCircleDashed:R6,LucideMessageCircleHeart:H6,LucideMessageCircleMore:q6,LucideMessageCircleOff:D6,LucideMessageCirclePlus:V6,LucideMessageCircleQuestion:Tl,LucideMessageCircleQuestionMark:Tl,LucideMessageCircleReply:X6,LucideMessageCircleWarning:Z6,LucideMessageCircleX:G6,LucideMessageSquare:Cn,LucideMessageSquareCheck:W6,LucideMessageSquareCode:K6,LucideMessageSquareDashed:Y6,LucideMessageSquareDiff:J6,LucideMessageSquareDot:tj,LucideMessageSquareHeart:aj,LucideMessageSquareLock:ej,LucideMessageSquareMore:nj,LucideMessageSquareOff:sj,LucideMessageSquarePlus:rj,LucideMessageSquareQuote:oj,LucideMessageSquareReply:ij,LucideMessageSquareShare:cj,LucideMessageSquareText:lj,LucideMessageSquareWarning:dj,LucideMessageSquareX:Aj,LucideMessagesSquare:uj,LucideMetronome:hj,LucideMic:fj,LucideMic2:$l,LucideMicOff:pj,LucideMicVocal:$l,LucideMicrochip:xj,LucideMicroscope:mj,LucideMicrowave:yj,LucideMilestone:gj,LucideMilk:kj,LucideMilkOff:vj,LucideMinimize:Oj,LucideMinimize2:S0,LucideMinus:bj,LucideMinusCircle:bc,LucideMinusSquare:Ud,LucideMirrorRectangular:wj,LucideMirrorRound:jj,LucideMonitor:Dr,LucideMonitorCheck:Cj,LucideMonitorCloud:Nj,LucideMonitorCog:Mj,LucideMonitorDot:Sj,LucideMonitorDown:Qj,LucideMonitorOff:Bj,LucideMonitorPause:_j,LucideMonitorPlay:Lj,LucideMonitorSmartphone:Tj,LucideMonitorSpeaker:$j,LucideMonitorStop:Ij,LucideMonitorUp:Uj,LucideMonitorX:Q0,LucideMoon:Ej,LucideMoonStar:Pj,LucideMoreHorizontal:Uo,LucideMoreVertical:qc,LucideMotorbike:zj,LucideMountain:Rj,LucideMountainSnow:Fj,LucideMouse:Kj,LucideMouseLeft:Hj,LucideMouseOff:qj,LucideMousePointer:Gj,LucideMousePointer2:Vj,LucideMousePointer2Off:Dj,LucideMousePointerBan:Xj,LucideMousePointerClick:Zj,LucideMousePointerSquareDashed:Cd,LucideMouseRight:Wj,LucideMove:dC,LucideMove3D:Il,LucideMove3d:Il,LucideMoveDiagonal:Jj,LucideMoveDiagonal2:Yj,LucideMoveDown:aC,LucideMoveDownLeft:eC,LucideMoveDownRight:tC,LucideMoveHorizontal:nC,LucideMoveLeft:sC,LucideMoveRight:rC,LucideMoveUp:cC,LucideMoveUpLeft:oC,LucideMoveUpRight:iC,LucideMoveVertical:lC,LucideMusic:pC,LucideMusic2:AC,LucideMusic3:uC,LucideMusic4:hC,LucideNavigation:gC,LucideNavigation2:xC,LucideNavigation2Off:fC,LucideNavigationOff:mC,LucideNetwork:fu,LucideNewspaper:Jo,LucideNfc:yC,LucideNonBinary:vC,LucideNotebook:wC,LucideNotebookPen:kC,LucideNotebookTabs:OC,LucideNotebookText:bC,LucideNotepadText:CC,LucideNotepadTextDashed:jC,LucideNut:MC,LucideNutOff:NC,LucideOctagon:QC,LucideOctagonAlert:Ul,LucideOctagonMinus:SC,LucideOctagonPause:Pl,LucideOctagonX:El,LucideOmega:BC,LucideOption:_C,LucideOrbit:LC,LucideOrigami:TC,LucideOutdent:Rs,LucidePackage:xu,LucidePackage2:IC,LucidePackageCheck:$C,LucidePackageMinus:UC,LucidePackageOpen:PC,LucidePackagePlus:EC,LucidePackageSearch:zC,LucidePackageX:FC,LucidePaintBucket:RC,LucidePaintRoller:HC,LucidePaintbrush:qC,LucidePaintbrush2:zl,LucidePaintbrushVertical:zl,LucidePalette:DC,LucidePalmtree:cA,LucidePanda:VC,LucidePanelBottom:GC,LucidePanelBottomClose:XC,LucidePanelBottomDashed:Fl,LucidePanelBottomInactive:Fl,LucidePanelBottomOpen:ZC,LucidePanelLeft:Hl,LucidePanelLeftClose:fs,LucidePanelLeftDashed:Rl,LucidePanelLeftInactive:Rl,LucidePanelLeftOpen:xs,LucidePanelLeftRightDashed:WC,LucidePanelRight:KC,LucidePanelRightClose:B0,LucidePanelRightDashed:ql,LucidePanelRightInactive:ql,LucidePanelRightOpen:_0,LucidePanelTop:t7,LucidePanelTopBottomDashed:YC,LucidePanelTopClose:JC,LucidePanelTopDashed:Dl,LucidePanelTopInactive:Dl,LucidePanelTopOpen:e7,LucidePanelsLeftBottom:a7,LucidePanelsLeftRight:zc,LucidePanelsRightBottom:n7,LucidePanelsTopBottom:Wl,LucidePanelsTopLeft:Vl,LucidePaperclip:mu,LucideParentheses:s7,LucideParkingCircle:jc,LucideParkingCircleOff:wc,LucideParkingMeter:r7,LucideParkingSquare:Ed,LucideParkingSquareOff:Pd,LucidePartyPopper:o7,LucidePause:L0,LucidePauseCircle:Cc,LucidePauseOctagon:Pl,LucidePawPrint:i7,LucidePcCase:c7,LucidePen:Lr,LucidePenBox:sn,LucidePenLine:Eo,LucidePenOff:l7,LucidePenSquare:sn,LucidePenTool:d7,LucidePencil:js,LucidePencilLine:A7,LucidePencilOff:u7,LucidePencilRuler:h7,LucidePentagon:p7,LucidePercent:f7,LucidePercentCircle:Nc,LucidePercentDiamond:Rc,LucidePercentSquare:zd,LucidePersonStanding:x7,LucidePhilippinePeso:m7,LucidePhone:w7,LucidePhoneCall:g7,LucidePhoneForwarded:y7,LucidePhoneIncoming:v7,LucidePhoneMissed:k7,LucidePhoneOff:O7,LucidePhoneOutgoing:b7,LucidePi:j7,LucidePiSquare:Fd,LucidePiano:C7,LucidePickaxe:N7,LucidePictureInPicture:S7,LucidePictureInPicture2:M7,LucidePieChart:cc,LucidePiggyBank:Q7,LucidePilcrow:L7,LucidePilcrowLeft:B7,LucidePilcrowRight:_7,LucidePilcrowSquare:Rd,LucidePill:$7,LucidePillBottle:T7,LucidePin:LA,LucidePinOff:gu,LucidePipette:I7,LucidePizza:U7,LucidePlane:z7,LucidePlaneLanding:P7,LucidePlaneTakeoff:E7,LucidePlay:ei,LucidePlayCircle:Mc,LucidePlaySquare:Hd,LucidePlug:da,LucidePlug2:F7,LucidePlugZap:Tr,LucidePlugZap2:Tr,LucidePlus:ht,LucidePlusCircle:Sc,LucidePlusSquare:qd,LucidePocketKnife:H7,LucidePodcast:R7,LucidePointer:D7,LucidePointerOff:q7,LucidePopcorn:V7,LucidePopsicle:X7,LucidePoundSterling:Z7,LucidePower:W7,LucidePowerCircle:Qc,LucidePowerOff:G7,LucidePowerSquare:Dd,LucidePresentation:yu,LucidePrinter:J7,LucidePrinterCheck:K7,LucidePrinterX:Y7,LucideProjector:eN,LucideProportions:tN,LucideProvider:Soe,LucidePuzzle:vu,LucidePyramid:aN,LucideQrCode:nN,LucideQuote:sN,LucideRabbit:oN,LucideRadar:rN,LucideRadiation:iN,LucideRadical:cN,LucideRadio:Jn,LucideRadioOff:lN,LucideRadioReceiver:dN,LucideRadioTower:AN,LucideRadius:uN,LucideRainbow:hN,LucideRat:pN,LucideRatio:fN,LucideReceipt:jN,LucideReceiptCent:xN,LucideReceiptEuro:mN,LucideReceiptIndianRupee:gN,LucideReceiptJapaneseYen:yN,LucideReceiptPoundSterling:vN,LucideReceiptRussianRuble:kN,LucideReceiptSwissFranc:ON,LucideReceiptText:bN,LucideReceiptTurkishLira:wN,LucideRectangleCircle:CN,LucideRectangleEllipsis:Xl,LucideRectangleGoggles:NN,LucideRectangleHorizontal:MN,LucideRectangleVertical:QN,LucideRecycle:SN,LucideRedo:LN,LucideRedo2:BN,LucideRedoDot:_N,LucideRefreshCcw:$N,LucideRefreshCcwDot:TN,LucideRefreshCw:ra,LucideRefreshCwOff:IN,LucideRefrigerator:UN,LucideRegex:PN,LucideRemoveFormatting:EN,LucideRepeat:RN,LucideRepeat1:zN,LucideRepeat2:FN,LucideReplace:qN,LucideReplaceAll:HN,LucideReply:XN,LucideReplyAll:DN,LucideRewind:VN,LucideRibbon:ZN,LucideRoad:GN,LucideRocket:es,LucideRockingChair:WN,LucideRollerCoaster:KN,LucideRose:YN,LucideRotate3D:Zl,LucideRotate3d:Zl,LucideRotateCcw:Cs,LucideRotateCcwKey:JN,LucideRotateCcwSquare:eM,LucideRotateCw:Vr,LucideRotateCwSquare:tM,LucideRoute:aM,LucideRouteOff:nM,LucideRouter:sM,LucideRows:Gl,LucideRows2:Gl,LucideRows3:Wl,LucideRows4:rM,LucideRss:oM,LucideRuler:cM,LucideRulerDimensionLine:iM,LucideRussianRuble:lM,LucideSailboat:dM,LucideSalad:AM,LucideSandwich:uM,LucideSatellite:pM,LucideSatelliteDish:hM,LucideSaudiRiyal:fM,LucideSave:Xr,LucideSaveAll:xM,LucideSaveOff:mM,LucideScale:gM,LucideScale3D:Kl,LucideScale3d:Kl,LucideScaling:yM,LucideScan:MM,LucideScanBarcode:vM,LucideScanEye:kM,LucideScanFace:OM,LucideScanHeart:bM,LucideScanLine:wM,LucideScanQrCode:jM,LucideScanSearch:NM,LucideScanText:CM,LucideScatterChart:lc,LucideSchool:SM,LucideSchool2:dA,LucideScissors:QM,LucideScissorsLineDashed:BM,LucideScissorsSquare:Vd,LucideScissorsSquareDashedBottom:fd,LucideScooter:_M,LucideScreenShare:TM,LucideScreenShareOff:LM,LucideScroll:IM,LucideScrollText:$M,LucideSearch:oa,LucideSearchAlert:UM,LucideSearchCheck:PM,LucideSearchCode:EM,LucideSearchSlash:zM,LucideSearchX:FM,LucideSection:RM,LucideSend:Xa,LucideSendHorizonal:Yl,LucideSendHorizontal:Yl,LucideSendToBack:HM,LucideSeparatorHorizontal:qM,LucideSeparatorVertical:VM,LucideServer:aa,LucideServerCog:DM,LucideServerCrash:XM,LucideServerOff:ZM,LucideSettings:Zr,LucideSettings2:T0,LucideShapes:GM,LucideShare:WM,LucideShare2:$0,LucideSheet:KM,LucideShell:YM,LucideShelvingUnit:JM,LucideShield:La,LucideShieldAlert:tS,LucideShieldBan:eS,LucideShieldCheck:ku,LucideShieldClose:$r,LucideShieldCog:nS,LucideShieldCogCorner:aS,LucideShieldEllipsis:sS,LucideShieldHalf:oS,LucideShieldMinus:rS,LucideShieldOff:iS,LucideShieldPlus:cS,LucideShieldQuestion:Jl,LucideShieldQuestionMark:Jl,LucideShieldUser:lS,LucideShieldX:$r,LucideShip:AS,LucideShipWheel:dS,LucideShirt:uS,LucideShoppingBag:TA,LucideShoppingBasket:hS,LucideShoppingCart:pS,LucideShovel:fS,LucideShowerHead:mS,LucideShredder:xS,LucideShrimp:gS,LucideShrink:yS,LucideShrub:vS,LucideShuffle:kS,LucideSidebar:Hl,LucideSidebarClose:fs,LucideSidebarOpen:xs,LucideSigma:OS,LucideSigmaSquare:Xd,LucideSignal:NS,LucideSignalHigh:bS,LucideSignalLow:wS,LucideSignalMedium:jS,LucideSignalZero:CS,LucideSignature:MS,LucideSignpost:QS,LucideSignpostBig:SS,LucideSiren:_S,LucideSkipBack:BS,LucideSkipForward:LS,LucideSkull:$A,LucideSlash:$S,LucideSlashSquare:Zd,LucideSlice:TS,LucideSliders:ed,LucideSlidersHorizontal:IS,LucideSlidersVertical:ed,LucideSmartphone:I0,LucideSmartphoneCharging:US,LucideSmartphoneNfc:PS,LucideSmile:zS,LucideSmilePlus:ES,LucideSnail:FS,LucideSnowflake:RS,LucideSoapDispenserDroplet:HS,LucideSofa:qS,LucideSolarPanel:DS,LucideSortAsc:Ri,LucideSortDesc:Ei,LucideSoup:VS,LucideSpace:XS,LucideSpade:ZS,LucideSparkle:GS,LucideSparkles:It,LucideSpeaker:WS,LucideSpeech:KS,LucideSpellCheck:JS,LucideSpellCheck2:YS,LucideSpline:eQ,LucideSplinePointer:tQ,LucideSplit:aQ,LucideSplitSquareHorizontal:Gd,LucideSplitSquareVertical:Wd,LucideSpool:nQ,LucideSportShoe:sQ,LucideSpotlight:rQ,LucideSprayCan:oQ,LucideSprout:iQ,LucideSquare:Gr,LucideSquareActivity:td,LucideSquareArrowDown:nd,LucideSquareArrowDownLeft:ad,LucideSquareArrowDownRight:sd,LucideSquareArrowLeft:rd,LucideSquareArrowOutDownLeft:od,LucideSquareArrowOutDownRight:id,LucideSquareArrowOutUpLeft:ld,LucideSquareArrowOutUpRight:cd,LucideSquareArrowRight:dd,LucideSquareArrowRightEnter:cQ,LucideSquareArrowRightExit:lQ,LucideSquareArrowUp:hd,LucideSquareArrowUpLeft:Ad,LucideSquareArrowUpRight:ud,LucideSquareAsterisk:pd,LucideSquareBottomDashedScissors:fd,LucideSquareCenterlineDashedHorizontal:xd,LucideSquareCenterlineDashedVertical:gd,LucideSquareChartGantt:qs,LucideSquareCheck:yd,LucideSquareCheckBig:md,LucideSquareChevronDown:vd,LucideSquareChevronLeft:kd,LucideSquareChevronRight:Od,LucideSquareChevronUp:wd,LucideSquareCode:bd,LucideSquareDashed:Nd,LucideSquareDashedBottom:AQ,LucideSquareDashedBottomCode:dQ,LucideSquareDashedKanban:jd,LucideSquareDashedMousePointer:Cd,LucideSquareDashedText:Ds,LucideSquareDashedTopSolid:uQ,LucideSquareDivide:Md,LucideSquareDot:Sd,LucideSquareEqual:Qd,LucideSquareFunction:Bd,LucideSquareGanttChart:qs,LucideSquareKanban:_d,LucideSquareLibrary:Ld,LucideSquareM:Td,LucideSquareMenu:$d,LucideSquareMinus:Ud,LucideSquareMousePointer:Id,LucideSquareParking:Ed,LucideSquareParkingOff:Pd,LucideSquarePause:hQ,LucideSquarePen:sn,LucideSquarePercent:zd,LucideSquarePi:Fd,LucideSquarePilcrow:Rd,LucideSquarePlay:Hd,LucideSquarePlus:qd,LucideSquarePower:Dd,LucideSquareRadical:pQ,LucideSquareRoundCorner:fQ,LucideSquareScissors:Vd,LucideSquareSigma:Xd,LucideSquareSlash:Zd,LucideSquareSplitHorizontal:Gd,LucideSquareSplitVertical:Wd,LucideSquareSquare:xQ,LucideSquareStack:mQ,LucideSquareStar:gQ,LucideSquareStop:yQ,LucideSquareTerminal:Yd,LucideSquareUser:Jd,LucideSquareUserRound:Kd,LucideSquareX:eA,LucideSquaresExclude:vQ,LucideSquaresIntersect:kQ,LucideSquaresSubtract:OQ,LucideSquaresUnite:bQ,LucideSquircle:jQ,LucideSquircleDashed:wQ,LucideSquirrel:CQ,LucideStamp:NQ,LucideStar:IA,LucideStarHalf:MQ,LucideStarOff:SQ,LucideStars:It,LucideStepBack:QQ,LucideStepForward:BQ,LucideStethoscope:_Q,LucideSticker:LQ,LucideStickyNote:TQ,LucideStone:$Q,LucideStopCircle:_c,LucideStore:IQ,LucideStretchHorizontal:UQ,LucideStretchVertical:PQ,LucideStrikethrough:EQ,LucideSubscript:zQ,LucideSubtitles:Ki,LucideSun:DQ,LucideSunDim:FQ,LucideSunMedium:RQ,LucideSunMoon:HQ,LucideSunSnow:qQ,LucideSunrise:VQ,LucideSunset:XQ,LucideSuperscript:ZQ,LucideSwatchBook:GQ,LucideSwissFranc:WQ,LucideSwitchCamera:KQ,LucideSword:YQ,LucideSwords:JQ,LucideSyringe:eB,LucideTable:cB,LucideTable2:tB,LucideTableCellsMerge:aB,LucideTableCellsSplit:nB,LucideTableColumnsSplit:sB,LucideTableConfig:Es,LucideTableOfContents:rB,LucideTableProperties:oB,LucideTableRowsSplit:iB,LucideTablet:U0,LucideTabletSmartphone:lB,LucideTablets:dB,LucideTag:AB,LucideTags:uB,LucideTally1:hB,LucideTally2:pB,LucideTally3:fB,LucideTally4:xB,LucideTally5:mB,LucideTangent:gB,LucideTarget:yB,LucideTelescope:vB,LucideTent:OB,LucideTentTree:kB,LucideTerminal:Ns,LucideTerminalSquare:Yd,LucideTestTube:ti,LucideTestTube2:tA,LucideTestTubeDiagonal:tA,LucideTestTubes:bB,LucideText:Vs,LucideTextAlignCenter:aA,LucideTextAlignEnd:sA,LucideTextAlignJustify:nA,LucideTextAlignStart:Vs,LucideTextCursor:jB,LucideTextCursorInput:wB,LucideTextInitial:rA,LucideTextQuote:CB,LucideTextSearch:NB,LucideTextSelect:Ds,LucideTextSelection:Ds,LucideTextWrap:oA,LucideTheater:MB,LucideThermometer:BB,LucideThermometerSnowflake:SB,LucideThermometerSun:QB,LucideThumbsDown:_B,LucideThumbsUp:LB,LucideTicket:zB,LucideTicketCheck:TB,LucideTicketMinus:$B,LucideTicketPercent:IB,LucideTicketPlus:UB,LucideTicketSlash:PB,LucideTicketX:EB,LucideTickets:RB,LucideTicketsPlane:FB,LucideTimeline:HB,LucideTimer:P0,LucideTimerOff:qB,LucideTimerReset:DB,LucideToggleLeft:VB,LucideToggleRight:XB,LucideToilet:ZB,LucideToolCase:GB,LucideToolbox:WB,LucideTornado:KB,LucideTorus:YB,LucideTouchpad:e9,LucideTouchpadOff:JB,LucideTowelRack:t9,LucideTowerControl:a9,LucideToyBrick:r9,LucideTractor:n9,LucideTrafficCone:s9,LucideTrain:iA,LucideTrainFront:c9,LucideTrainFrontTunnel:o9,LucideTrainTrack:i9,LucideTramFront:iA,LucideTransgender:l9,LucideTrash:d9,LucideTrash2:At,LucideTreeDeciduous:A9,LucideTreePalm:cA,LucideTreePine:u9,LucideTrees:h9,LucideTrendingDown:p9,LucideTrendingUp:x9,LucideTrendingUpDown:f9,LucideTriangle:y9,LucideTriangleAlert:Gt,LucideTriangleDashed:m9,LucideTriangleRight:g9,LucideTrophy:v9,LucideTruck:O9,LucideTruckElectric:k9,LucideTurkishLira:b9,LucideTurntable:w9,LucideTurtle:j9,LucideTv:N9,LucideTv2:lA,LucideTvMinimal:lA,LucideTvMinimalPlay:C9,LucideType:M9,LucideTypeOutline:S9,LucideUmbrella:_9,LucideUmbrellaOff:B9,LucideUnderline:Q9,LucideUndo:$9,LucideUndo2:L9,LucideUndoDot:T9,LucideUnfoldHorizontal:I9,LucideUnfoldVertical:U9,LucideUngroup:P9,LucideUniversity:dA,LucideUnlink:z9,LucideUnlink2:E9,LucideUnlock:Bl,LucideUnlockKeyhole:Ql,LucideUnplug:ai,LucideUpload:E0,LucideUploadCloud:Pc,LucideUsb:F9,LucideUser:z0,LucideUser2:xA,LucideUserCheck:Ou,LucideUserCheck2:AA,LucideUserCircle:Tc,LucideUserCircle2:Lc,LucideUserCog:R9,LucideUserCog2:uA,LucideUserKey:H9,LucideUserLock:q9,LucideUserMinus:D9,LucideUserMinus2:hA,LucideUserPen:V9,LucideUserPlus:bu,LucideUserPlus2:pA,LucideUserRound:xA,LucideUserRoundCheck:AA,LucideUserRoundCog:uA,LucideUserRoundKey:X9,LucideUserRoundMinus:hA,LucideUserRoundPen:Z9,LucideUserRoundPlus:pA,LucideUserRoundSearch:G9,LucideUserRoundX:fA,LucideUserSearch:W9,LucideUserSquare:Jd,LucideUserSquare2:Kd,LucideUserStar:K9,LucideUserX:Y9,LucideUserX2:fA,LucideUsers:Fa,LucideUsers2:mA,LucideUsersRound:mA,LucideUtensils:yA,LucideUtensilsCrossed:gA,LucideUtilityPole:J9,LucideVan:e_,LucideVariable:t_,LucideVault:a_,LucideVectorSquare:n_,LucideVegan:s_,LucideVenetianMask:r_,LucideVenus:i_,LucideVenusAndMars:o_,LucideVerified:Di,LucideVibrate:l_,LucideVibrateOff:c_,LucideVideo:A_,LucideVideoOff:d_,LucideVideotape:u_,LucideView:h_,LucideVoicemail:p_,LucideVolleyball:f_,LucideVolume:v_,LucideVolume1:x_,LucideVolume2:m_,LucideVolumeOff:g_,LucideVolumeX:y_,LucideVote:k_,LucideWallet:wu,LucideWallet2:vA,LucideWalletCards:O_,LucideWalletMinimal:vA,LucideWallpaper:w_,LucideWand:b_,LucideWand2:kA,LucideWandSparkles:kA,LucideWarehouse:j_,LucideWashingMachine:C_,LucideWatch:N_,LucideWaves:B_,LucideWavesArrowDown:M_,LucideWavesArrowUp:S_,LucideWavesLadder:Q_,LucideWaypoints:__,LucideWebcam:L_,LucideWebhook:$_,LucideWebhookOff:T_,LucideWeight:P_,LucideWeightTilde:I_,LucideWheat:E_,LucideWheatOff:U_,LucideWholeWord:z_,LucideWifi:UA,LucideWifiCog:F_,LucideWifiHigh:R_,LucideWifiLow:H_,LucideWifiOff:F0,LucideWifiPen:q_,LucideWifiSync:V_,LucideWifiZero:D_,LucideWind:Z_,LucideWindArrowDown:X_,LucideWine:W_,LucideWineOff:G_,LucideWorkflow:K_,LucideWorm:Y_,LucideWrapText:oA,LucideWrench:ju,LucideX:Ge,LucideXCircle:qn,LucideXLineTop:J_,LucideXOctagon:El,LucideXSquare:eA,LucideZap:wt,LucideZapOff:eL,LucideZodiacAquarius:tL,LucideZodiacAries:aL,LucideZodiacCancer:nL,LucideZodiacCapricorn:sL,LucideZodiacGemini:rL,LucideZodiacLeo:oL,LucideZodiacLibra:iL,LucideZodiacOphiuchus:cL,LucideZodiacPisces:lL,LucideZodiacSagittarius:dL,LucideZodiacScorpio:AL,LucideZodiacTaurus:uL,LucideZodiacVirgo:hL,LucideZoomIn:pL,LucideZoomOut:fL,Luggage:s6,LuggageIcon:s6,MSquare:Td,MSquareIcon:Td,Magnet:r6,MagnetIcon:r6,Mail:h6,MailCheck:o6,MailCheckIcon:o6,MailIcon:h6,MailMinus:i6,MailMinusIcon:i6,MailOpen:c6,MailOpenIcon:c6,MailPlus:l6,MailPlusIcon:l6,MailQuestion:_l,MailQuestionIcon:_l,MailQuestionMark:_l,MailQuestionMarkIcon:_l,MailSearch:d6,MailSearchIcon:d6,MailWarning:A6,MailWarningIcon:A6,MailX:u6,MailXIcon:u6,Mailbox:p6,MailboxIcon:p6,Mails:f6,MailsIcon:f6,Map:N0,MapIcon:N0,MapMinus:m6,MapMinusIcon:m6,MapPin:S6,MapPinCheck:g6,MapPinCheckIcon:g6,MapPinCheckInside:x6,MapPinCheckInsideIcon:x6,MapPinHouse:y6,MapPinHouseIcon:y6,MapPinIcon:S6,MapPinMinus:k6,MapPinMinusIcon:k6,MapPinMinusInside:v6,MapPinMinusInsideIcon:v6,MapPinOff:O6,MapPinOffIcon:O6,MapPinPen:Ll,MapPinPenIcon:Ll,MapPinPlus:w6,MapPinPlusIcon:w6,MapPinPlusInside:b6,MapPinPlusInsideIcon:b6,MapPinSearch:j6,MapPinSearchIcon:j6,MapPinX:N6,MapPinXIcon:N6,MapPinXInside:C6,MapPinXInsideIcon:C6,MapPinned:M6,MapPinnedIcon:M6,MapPlus:Q6,MapPlusIcon:Q6,Mars:_6,MarsIcon:_6,MarsStroke:B6,MarsStrokeIcon:B6,Martini:L6,MartiniIcon:L6,Maximize:T6,Maximize2:BA,Maximize2Icon:BA,MaximizeIcon:T6,Medal:$6,MedalIcon:$6,Megaphone:_A,MegaphoneIcon:_A,MegaphoneOff:I6,MegaphoneOffIcon:I6,Meh:U6,MehIcon:U6,MemoryStick:M0,MemoryStickIcon:M0,Menu:P6,MenuIcon:P6,MenuSquare:$d,MenuSquareIcon:$d,Merge:E6,MergeIcon:E6,MessageCircle:Yn,MessageCircleCheck:z6,MessageCircleCheckIcon:z6,MessageCircleCode:F6,MessageCircleCodeIcon:F6,MessageCircleDashed:R6,MessageCircleDashedIcon:R6,MessageCircleHeart:H6,MessageCircleHeartIcon:H6,MessageCircleIcon:Yn,MessageCircleMore:q6,MessageCircleMoreIcon:q6,MessageCircleOff:D6,MessageCircleOffIcon:D6,MessageCirclePlus:V6,MessageCirclePlusIcon:V6,MessageCircleQuestion:Tl,MessageCircleQuestionIcon:Tl,MessageCircleQuestionMark:Tl,MessageCircleQuestionMarkIcon:Tl,MessageCircleReply:X6,MessageCircleReplyIcon:X6,MessageCircleWarning:Z6,MessageCircleWarningIcon:Z6,MessageCircleX:G6,MessageCircleXIcon:G6,MessageSquare:Cn,MessageSquareCheck:W6,MessageSquareCheckIcon:W6,MessageSquareCode:K6,MessageSquareCodeIcon:K6,MessageSquareDashed:Y6,MessageSquareDashedIcon:Y6,MessageSquareDiff:J6,MessageSquareDiffIcon:J6,MessageSquareDot:tj,MessageSquareDotIcon:tj,MessageSquareHeart:aj,MessageSquareHeartIcon:aj,MessageSquareIcon:Cn,MessageSquareLock:ej,MessageSquareLockIcon:ej,MessageSquareMore:nj,MessageSquareMoreIcon:nj,MessageSquareOff:sj,MessageSquareOffIcon:sj,MessageSquarePlus:rj,MessageSquarePlusIcon:rj,MessageSquareQuote:oj,MessageSquareQuoteIcon:oj,MessageSquareReply:ij,MessageSquareReplyIcon:ij,MessageSquareShare:cj,MessageSquareShareIcon:cj,MessageSquareText:lj,MessageSquareTextIcon:lj,MessageSquareWarning:dj,MessageSquareWarningIcon:dj,MessageSquareX:Aj,MessageSquareXIcon:Aj,MessagesSquare:uj,MessagesSquareIcon:uj,Metronome:hj,MetronomeIcon:hj,Mic:fj,Mic2:$l,Mic2Icon:$l,MicIcon:fj,MicOff:pj,MicOffIcon:pj,MicVocal:$l,MicVocalIcon:$l,Microchip:xj,MicrochipIcon:xj,Microscope:mj,MicroscopeIcon:mj,Microwave:yj,MicrowaveIcon:yj,Milestone:gj,MilestoneIcon:gj,Milk:kj,MilkIcon:kj,MilkOff:vj,MilkOffIcon:vj,Minimize:Oj,Minimize2:S0,Minimize2Icon:S0,MinimizeIcon:Oj,Minus:bj,MinusCircle:bc,MinusCircleIcon:bc,MinusIcon:bj,MinusSquare:Ud,MinusSquareIcon:Ud,MirrorRectangular:wj,MirrorRectangularIcon:wj,MirrorRound:jj,MirrorRoundIcon:jj,Monitor:Dr,MonitorCheck:Cj,MonitorCheckIcon:Cj,MonitorCloud:Nj,MonitorCloudIcon:Nj,MonitorCog:Mj,MonitorCogIcon:Mj,MonitorDot:Sj,MonitorDotIcon:Sj,MonitorDown:Qj,MonitorDownIcon:Qj,MonitorIcon:Dr,MonitorOff:Bj,MonitorOffIcon:Bj,MonitorPause:_j,MonitorPauseIcon:_j,MonitorPlay:Lj,MonitorPlayIcon:Lj,MonitorSmartphone:Tj,MonitorSmartphoneIcon:Tj,MonitorSpeaker:$j,MonitorSpeakerIcon:$j,MonitorStop:Ij,MonitorStopIcon:Ij,MonitorUp:Uj,MonitorUpIcon:Uj,MonitorX:Q0,MonitorXIcon:Q0,Moon:Ej,MoonIcon:Ej,MoonStar:Pj,MoonStarIcon:Pj,MoreHorizontal:Uo,MoreHorizontalIcon:Uo,MoreVertical:qc,MoreVerticalIcon:qc,Motorbike:zj,MotorbikeIcon:zj,Mountain:Rj,MountainIcon:Rj,MountainSnow:Fj,MountainSnowIcon:Fj,Mouse:Kj,MouseIcon:Kj,MouseLeft:Hj,MouseLeftIcon:Hj,MouseOff:qj,MouseOffIcon:qj,MousePointer:Gj,MousePointer2:Vj,MousePointer2Icon:Vj,MousePointer2Off:Dj,MousePointer2OffIcon:Dj,MousePointerBan:Xj,MousePointerBanIcon:Xj,MousePointerClick:Zj,MousePointerClickIcon:Zj,MousePointerIcon:Gj,MousePointerSquareDashed:Cd,MousePointerSquareDashedIcon:Cd,MouseRight:Wj,MouseRightIcon:Wj,Move:dC,Move3D:Il,Move3DIcon:Il,Move3d:Il,Move3dIcon:Il,MoveDiagonal:Jj,MoveDiagonal2:Yj,MoveDiagonal2Icon:Yj,MoveDiagonalIcon:Jj,MoveDown:aC,MoveDownIcon:aC,MoveDownLeft:eC,MoveDownLeftIcon:eC,MoveDownRight:tC,MoveDownRightIcon:tC,MoveHorizontal:nC,MoveHorizontalIcon:nC,MoveIcon:dC,MoveLeft:sC,MoveLeftIcon:sC,MoveRight:rC,MoveRightIcon:rC,MoveUp:cC,MoveUpIcon:cC,MoveUpLeft:oC,MoveUpLeftIcon:oC,MoveUpRight:iC,MoveUpRightIcon:iC,MoveVertical:lC,MoveVerticalIcon:lC,Music:pC,Music2:AC,Music2Icon:AC,Music3:uC,Music3Icon:uC,Music4:hC,Music4Icon:hC,MusicIcon:pC,Navigation:gC,Navigation2:xC,Navigation2Icon:xC,Navigation2Off:fC,Navigation2OffIcon:fC,NavigationIcon:gC,NavigationOff:mC,NavigationOffIcon:mC,Network:fu,NetworkIcon:fu,Newspaper:Jo,NewspaperIcon:Jo,Nfc:yC,NfcIcon:yC,NonBinary:vC,NonBinaryIcon:vC,Notebook:wC,NotebookIcon:wC,NotebookPen:kC,NotebookPenIcon:kC,NotebookTabs:OC,NotebookTabsIcon:OC,NotebookText:bC,NotebookTextIcon:bC,NotepadText:CC,NotepadTextDashed:jC,NotepadTextDashedIcon:jC,NotepadTextIcon:CC,Nut:MC,NutIcon:MC,NutOff:NC,NutOffIcon:NC,Octagon:QC,OctagonAlert:Ul,OctagonAlertIcon:Ul,OctagonIcon:QC,OctagonMinus:SC,OctagonMinusIcon:SC,OctagonPause:Pl,OctagonPauseIcon:Pl,OctagonX:El,OctagonXIcon:El,Omega:BC,OmegaIcon:BC,Option:_C,OptionIcon:_C,Orbit:LC,OrbitIcon:LC,Origami:TC,OrigamiIcon:TC,Outdent:Rs,OutdentIcon:Rs,Package:xu,Package2:IC,Package2Icon:IC,PackageCheck:$C,PackageCheckIcon:$C,PackageIcon:xu,PackageMinus:UC,PackageMinusIcon:UC,PackageOpen:PC,PackageOpenIcon:PC,PackagePlus:EC,PackagePlusIcon:EC,PackageSearch:zC,PackageSearchIcon:zC,PackageX:FC,PackageXIcon:FC,PaintBucket:RC,PaintBucketIcon:RC,PaintRoller:HC,PaintRollerIcon:HC,Paintbrush:qC,Paintbrush2:zl,Paintbrush2Icon:zl,PaintbrushIcon:qC,PaintbrushVertical:zl,PaintbrushVerticalIcon:zl,Palette:DC,PaletteIcon:DC,Palmtree:cA,PalmtreeIcon:cA,Panda:VC,PandaIcon:VC,PanelBottom:GC,PanelBottomClose:XC,PanelBottomCloseIcon:XC,PanelBottomDashed:Fl,PanelBottomDashedIcon:Fl,PanelBottomIcon:GC,PanelBottomInactive:Fl,PanelBottomInactiveIcon:Fl,PanelBottomOpen:ZC,PanelBottomOpenIcon:ZC,PanelLeft:Hl,PanelLeftClose:fs,PanelLeftCloseIcon:fs,PanelLeftDashed:Rl,PanelLeftDashedIcon:Rl,PanelLeftIcon:Hl,PanelLeftInactive:Rl,PanelLeftInactiveIcon:Rl,PanelLeftOpen:xs,PanelLeftOpenIcon:xs,PanelLeftRightDashed:WC,PanelLeftRightDashedIcon:WC,PanelRight:KC,PanelRightClose:B0,PanelRightCloseIcon:B0,PanelRightDashed:ql,PanelRightDashedIcon:ql,PanelRightIcon:KC,PanelRightInactive:ql,PanelRightInactiveIcon:ql,PanelRightOpen:_0,PanelRightOpenIcon:_0,PanelTop:t7,PanelTopBottomDashed:YC,PanelTopBottomDashedIcon:YC,PanelTopClose:JC,PanelTopCloseIcon:JC,PanelTopDashed:Dl,PanelTopDashedIcon:Dl,PanelTopIcon:t7,PanelTopInactive:Dl,PanelTopInactiveIcon:Dl,PanelTopOpen:e7,PanelTopOpenIcon:e7,PanelsLeftBottom:a7,PanelsLeftBottomIcon:a7,PanelsLeftRight:zc,PanelsLeftRightIcon:zc,PanelsRightBottom:n7,PanelsRightBottomIcon:n7,PanelsTopBottom:Wl,PanelsTopBottomIcon:Wl,PanelsTopLeft:Vl,PanelsTopLeftIcon:Vl,Paperclip:mu,PaperclipIcon:mu,Parentheses:s7,ParenthesesIcon:s7,ParkingCircle:jc,ParkingCircleIcon:jc,ParkingCircleOff:wc,ParkingCircleOffIcon:wc,ParkingMeter:r7,ParkingMeterIcon:r7,ParkingSquare:Ed,ParkingSquareIcon:Ed,ParkingSquareOff:Pd,ParkingSquareOffIcon:Pd,PartyPopper:o7,PartyPopperIcon:o7,Pause:L0,PauseCircle:Cc,PauseCircleIcon:Cc,PauseIcon:L0,PauseOctagon:Pl,PauseOctagonIcon:Pl,PawPrint:i7,PawPrintIcon:i7,PcCase:c7,PcCaseIcon:c7,Pen:Lr,PenBox:sn,PenBoxIcon:sn,PenIcon:Lr,PenLine:Eo,PenLineIcon:Eo,PenOff:l7,PenOffIcon:l7,PenSquare:sn,PenSquareIcon:sn,PenTool:d7,PenToolIcon:d7,Pencil:js,PencilIcon:js,PencilLine:A7,PencilLineIcon:A7,PencilOff:u7,PencilOffIcon:u7,PencilRuler:h7,PencilRulerIcon:h7,Pentagon:p7,PentagonIcon:p7,Percent:f7,PercentCircle:Nc,PercentCircleIcon:Nc,PercentDiamond:Rc,PercentDiamondIcon:Rc,PercentIcon:f7,PercentSquare:zd,PercentSquareIcon:zd,PersonStanding:x7,PersonStandingIcon:x7,PhilippinePeso:m7,PhilippinePesoIcon:m7,Phone:w7,PhoneCall:g7,PhoneCallIcon:g7,PhoneForwarded:y7,PhoneForwardedIcon:y7,PhoneIcon:w7,PhoneIncoming:v7,PhoneIncomingIcon:v7,PhoneMissed:k7,PhoneMissedIcon:k7,PhoneOff:O7,PhoneOffIcon:O7,PhoneOutgoing:b7,PhoneOutgoingIcon:b7,Pi:j7,PiIcon:j7,PiSquare:Fd,PiSquareIcon:Fd,Piano:C7,PianoIcon:C7,Pickaxe:N7,PickaxeIcon:N7,PictureInPicture:S7,PictureInPicture2:M7,PictureInPicture2Icon:M7,PictureInPictureIcon:S7,PieChart:cc,PieChartIcon:cc,PiggyBank:Q7,PiggyBankIcon:Q7,Pilcrow:L7,PilcrowIcon:L7,PilcrowLeft:B7,PilcrowLeftIcon:B7,PilcrowRight:_7,PilcrowRightIcon:_7,PilcrowSquare:Rd,PilcrowSquareIcon:Rd,Pill:$7,PillBottle:T7,PillBottleIcon:T7,PillIcon:$7,Pin:LA,PinIcon:LA,PinOff:gu,PinOffIcon:gu,Pipette:I7,PipetteIcon:I7,Pizza:U7,PizzaIcon:U7,Plane:z7,PlaneIcon:z7,PlaneLanding:P7,PlaneLandingIcon:P7,PlaneTakeoff:E7,PlaneTakeoffIcon:E7,Play:ei,PlayCircle:Mc,PlayCircleIcon:Mc,PlayIcon:ei,PlaySquare:Hd,PlaySquareIcon:Hd,Plug:da,Plug2:F7,Plug2Icon:F7,PlugIcon:da,PlugZap:Tr,PlugZap2:Tr,PlugZap2Icon:Tr,PlugZapIcon:Tr,Plus:ht,PlusCircle:Sc,PlusCircleIcon:Sc,PlusIcon:ht,PlusSquare:qd,PlusSquareIcon:qd,PocketKnife:H7,PocketKnifeIcon:H7,Podcast:R7,PodcastIcon:R7,Pointer:D7,PointerIcon:D7,PointerOff:q7,PointerOffIcon:q7,Popcorn:V7,PopcornIcon:V7,Popsicle:X7,PopsicleIcon:X7,PoundSterling:Z7,PoundSterlingIcon:Z7,Power:W7,PowerCircle:Qc,PowerCircleIcon:Qc,PowerIcon:W7,PowerOff:G7,PowerOffIcon:G7,PowerSquare:Dd,PowerSquareIcon:Dd,Presentation:yu,PresentationIcon:yu,Printer:J7,PrinterCheck:K7,PrinterCheckIcon:K7,PrinterIcon:J7,PrinterX:Y7,PrinterXIcon:Y7,Projector:eN,ProjectorIcon:eN,Proportions:tN,ProportionsIcon:tN,Puzzle:vu,PuzzleIcon:vu,Pyramid:aN,PyramidIcon:aN,QrCode:nN,QrCodeIcon:nN,Quote:sN,QuoteIcon:sN,Rabbit:oN,RabbitIcon:oN,Radar:rN,RadarIcon:rN,Radiation:iN,RadiationIcon:iN,Radical:cN,RadicalIcon:cN,Radio:Jn,RadioIcon:Jn,RadioOff:lN,RadioOffIcon:lN,RadioReceiver:dN,RadioReceiverIcon:dN,RadioTower:AN,RadioTowerIcon:AN,Radius:uN,RadiusIcon:uN,Rainbow:hN,RainbowIcon:hN,Rat:pN,RatIcon:pN,Ratio:fN,RatioIcon:fN,Receipt:jN,ReceiptCent:xN,ReceiptCentIcon:xN,ReceiptEuro:mN,ReceiptEuroIcon:mN,ReceiptIcon:jN,ReceiptIndianRupee:gN,ReceiptIndianRupeeIcon:gN,ReceiptJapaneseYen:yN,ReceiptJapaneseYenIcon:yN,ReceiptPoundSterling:vN,ReceiptPoundSterlingIcon:vN,ReceiptRussianRuble:kN,ReceiptRussianRubleIcon:kN,ReceiptSwissFranc:ON,ReceiptSwissFrancIcon:ON,ReceiptText:bN,ReceiptTextIcon:bN,ReceiptTurkishLira:wN,ReceiptTurkishLiraIcon:wN,RectangleCircle:CN,RectangleCircleIcon:CN,RectangleEllipsis:Xl,RectangleEllipsisIcon:Xl,RectangleGoggles:NN,RectangleGogglesIcon:NN,RectangleHorizontal:MN,RectangleHorizontalIcon:MN,RectangleVertical:QN,RectangleVerticalIcon:QN,Recycle:SN,RecycleIcon:SN,Redo:LN,Redo2:BN,Redo2Icon:BN,RedoDot:_N,RedoDotIcon:_N,RedoIcon:LN,RefreshCcw:$N,RefreshCcwDot:TN,RefreshCcwDotIcon:TN,RefreshCcwIcon:$N,RefreshCw:ra,RefreshCwIcon:ra,RefreshCwOff:IN,RefreshCwOffIcon:IN,Refrigerator:UN,RefrigeratorIcon:UN,Regex:PN,RegexIcon:PN,RemoveFormatting:EN,RemoveFormattingIcon:EN,Repeat:RN,Repeat1:zN,Repeat1Icon:zN,Repeat2:FN,Repeat2Icon:FN,RepeatIcon:RN,Replace:qN,ReplaceAll:HN,ReplaceAllIcon:HN,ReplaceIcon:qN,Reply:XN,ReplyAll:DN,ReplyAllIcon:DN,ReplyIcon:XN,Rewind:VN,RewindIcon:VN,Ribbon:ZN,RibbonIcon:ZN,Road:GN,RoadIcon:GN,Rocket:es,RocketIcon:es,RockingChair:WN,RockingChairIcon:WN,RollerCoaster:KN,RollerCoasterIcon:KN,Rose:YN,RoseIcon:YN,Rotate3D:Zl,Rotate3DIcon:Zl,Rotate3d:Zl,Rotate3dIcon:Zl,RotateCcw:Cs,RotateCcwIcon:Cs,RotateCcwKey:JN,RotateCcwKeyIcon:JN,RotateCcwSquare:eM,RotateCcwSquareIcon:eM,RotateCw:Vr,RotateCwIcon:Vr,RotateCwSquare:tM,RotateCwSquareIcon:tM,Route:aM,RouteIcon:aM,RouteOff:nM,RouteOffIcon:nM,Router:sM,RouterIcon:sM,Rows:Gl,Rows2:Gl,Rows2Icon:Gl,Rows3:Wl,Rows3Icon:Wl,Rows4:rM,Rows4Icon:rM,RowsIcon:Gl,Rss:oM,RssIcon:oM,Ruler:cM,RulerDimensionLine:iM,RulerDimensionLineIcon:iM,RulerIcon:cM,RussianRuble:lM,RussianRubleIcon:lM,Sailboat:dM,SailboatIcon:dM,Salad:AM,SaladIcon:AM,Sandwich:uM,SandwichIcon:uM,Satellite:pM,SatelliteDish:hM,SatelliteDishIcon:hM,SatelliteIcon:pM,SaudiRiyal:fM,SaudiRiyalIcon:fM,Save:Xr,SaveAll:xM,SaveAllIcon:xM,SaveIcon:Xr,SaveOff:mM,SaveOffIcon:mM,Scale:gM,Scale3D:Kl,Scale3DIcon:Kl,Scale3d:Kl,Scale3dIcon:Kl,ScaleIcon:gM,Scaling:yM,ScalingIcon:yM,Scan:MM,ScanBarcode:vM,ScanBarcodeIcon:vM,ScanEye:kM,ScanEyeIcon:kM,ScanFace:OM,ScanFaceIcon:OM,ScanHeart:bM,ScanHeartIcon:bM,ScanIcon:MM,ScanLine:wM,ScanLineIcon:wM,ScanQrCode:jM,ScanQrCodeIcon:jM,ScanSearch:NM,ScanSearchIcon:NM,ScanText:CM,ScanTextIcon:CM,ScatterChart:lc,ScatterChartIcon:lc,School:SM,School2:dA,School2Icon:dA,SchoolIcon:SM,Scissors:QM,ScissorsIcon:QM,ScissorsLineDashed:BM,ScissorsLineDashedIcon:BM,ScissorsSquare:Vd,ScissorsSquareDashedBottom:fd,ScissorsSquareDashedBottomIcon:fd,ScissorsSquareIcon:Vd,Scooter:_M,ScooterIcon:_M,ScreenShare:TM,ScreenShareIcon:TM,ScreenShareOff:LM,ScreenShareOffIcon:LM,Scroll:IM,ScrollIcon:IM,ScrollText:$M,ScrollTextIcon:$M,Search:oa,SearchAlert:UM,SearchAlertIcon:UM,SearchCheck:PM,SearchCheckIcon:PM,SearchCode:EM,SearchCodeIcon:EM,SearchIcon:oa,SearchSlash:zM,SearchSlashIcon:zM,SearchX:FM,SearchXIcon:FM,Section:RM,SectionIcon:RM,Send:Xa,SendHorizonal:Yl,SendHorizonalIcon:Yl,SendHorizontal:Yl,SendHorizontalIcon:Yl,SendIcon:Xa,SendToBack:HM,SendToBackIcon:HM,SeparatorHorizontal:qM,SeparatorHorizontalIcon:qM,SeparatorVertical:VM,SeparatorVerticalIcon:VM,Server:aa,ServerCog:DM,ServerCogIcon:DM,ServerCrash:XM,ServerCrashIcon:XM,ServerIcon:aa,ServerOff:ZM,ServerOffIcon:ZM,Settings:Zr,Settings2:T0,Settings2Icon:T0,SettingsIcon:Zr,Shapes:GM,ShapesIcon:GM,Share:WM,Share2:$0,Share2Icon:$0,ShareIcon:WM,Sheet:KM,SheetIcon:KM,Shell:YM,ShellIcon:YM,ShelvingUnit:JM,ShelvingUnitIcon:JM,Shield:La,ShieldAlert:tS,ShieldAlertIcon:tS,ShieldBan:eS,ShieldBanIcon:eS,ShieldCheck:ku,ShieldCheckIcon:ku,ShieldClose:$r,ShieldCloseIcon:$r,ShieldCog:nS,ShieldCogCorner:aS,ShieldCogCornerIcon:aS,ShieldCogIcon:nS,ShieldEllipsis:sS,ShieldEllipsisIcon:sS,ShieldHalf:oS,ShieldHalfIcon:oS,ShieldIcon:La,ShieldMinus:rS,ShieldMinusIcon:rS,ShieldOff:iS,ShieldOffIcon:iS,ShieldPlus:cS,ShieldPlusIcon:cS,ShieldQuestion:Jl,ShieldQuestionIcon:Jl,ShieldQuestionMark:Jl,ShieldQuestionMarkIcon:Jl,ShieldUser:lS,ShieldUserIcon:lS,ShieldX:$r,ShieldXIcon:$r,Ship:AS,ShipIcon:AS,ShipWheel:dS,ShipWheelIcon:dS,Shirt:uS,ShirtIcon:uS,ShoppingBag:TA,ShoppingBagIcon:TA,ShoppingBasket:hS,ShoppingBasketIcon:hS,ShoppingCart:pS,ShoppingCartIcon:pS,Shovel:fS,ShovelIcon:fS,ShowerHead:mS,ShowerHeadIcon:mS,Shredder:xS,ShredderIcon:xS,Shrimp:gS,ShrimpIcon:gS,Shrink:yS,ShrinkIcon:yS,Shrub:vS,ShrubIcon:vS,Shuffle:kS,ShuffleIcon:kS,Sidebar:Hl,SidebarClose:fs,SidebarCloseIcon:fs,SidebarIcon:Hl,SidebarOpen:xs,SidebarOpenIcon:xs,Sigma:OS,SigmaIcon:OS,SigmaSquare:Xd,SigmaSquareIcon:Xd,Signal:NS,SignalHigh:bS,SignalHighIcon:bS,SignalIcon:NS,SignalLow:wS,SignalLowIcon:wS,SignalMedium:jS,SignalMediumIcon:jS,SignalZero:CS,SignalZeroIcon:CS,Signature:MS,SignatureIcon:MS,Signpost:QS,SignpostBig:SS,SignpostBigIcon:SS,SignpostIcon:QS,Siren:_S,SirenIcon:_S,SkipBack:BS,SkipBackIcon:BS,SkipForward:LS,SkipForwardIcon:LS,Skull:$A,SkullIcon:$A,Slash:$S,SlashIcon:$S,SlashSquare:Zd,SlashSquareIcon:Zd,Slice:TS,SliceIcon:TS,Sliders:ed,SlidersHorizontal:IS,SlidersHorizontalIcon:IS,SlidersIcon:ed,SlidersVertical:ed,SlidersVerticalIcon:ed,Smartphone:I0,SmartphoneCharging:US,SmartphoneChargingIcon:US,SmartphoneIcon:I0,SmartphoneNfc:PS,SmartphoneNfcIcon:PS,Smile:zS,SmileIcon:zS,SmilePlus:ES,SmilePlusIcon:ES,Snail:FS,SnailIcon:FS,Snowflake:RS,SnowflakeIcon:RS,SoapDispenserDroplet:HS,SoapDispenserDropletIcon:HS,Sofa:qS,SofaIcon:qS,SolarPanel:DS,SolarPanelIcon:DS,SortAsc:Ri,SortAscIcon:Ri,SortDesc:Ei,SortDescIcon:Ei,Soup:VS,SoupIcon:VS,Space:XS,SpaceIcon:XS,Spade:ZS,SpadeIcon:ZS,Sparkle:GS,SparkleIcon:GS,Sparkles:It,SparklesIcon:It,Speaker:WS,SpeakerIcon:WS,Speech:KS,SpeechIcon:KS,SpellCheck:JS,SpellCheck2:YS,SpellCheck2Icon:YS,SpellCheckIcon:JS,Spline:eQ,SplineIcon:eQ,SplinePointer:tQ,SplinePointerIcon:tQ,Split:aQ,SplitIcon:aQ,SplitSquareHorizontal:Gd,SplitSquareHorizontalIcon:Gd,SplitSquareVertical:Wd,SplitSquareVerticalIcon:Wd,Spool:nQ,SpoolIcon:nQ,SportShoe:sQ,SportShoeIcon:sQ,Spotlight:rQ,SpotlightIcon:rQ,SprayCan:oQ,SprayCanIcon:oQ,Sprout:iQ,SproutIcon:iQ,Square:Gr,SquareActivity:td,SquareActivityIcon:td,SquareArrowDown:nd,SquareArrowDownIcon:nd,SquareArrowDownLeft:ad,SquareArrowDownLeftIcon:ad,SquareArrowDownRight:sd,SquareArrowDownRightIcon:sd,SquareArrowLeft:rd,SquareArrowLeftIcon:rd,SquareArrowOutDownLeft:od,SquareArrowOutDownLeftIcon:od,SquareArrowOutDownRight:id,SquareArrowOutDownRightIcon:id,SquareArrowOutUpLeft:ld,SquareArrowOutUpLeftIcon:ld,SquareArrowOutUpRight:cd,SquareArrowOutUpRightIcon:cd,SquareArrowRight:dd,SquareArrowRightEnter:cQ,SquareArrowRightEnterIcon:cQ,SquareArrowRightExit:lQ,SquareArrowRightExitIcon:lQ,SquareArrowRightIcon:dd,SquareArrowUp:hd,SquareArrowUpIcon:hd,SquareArrowUpLeft:Ad,SquareArrowUpLeftIcon:Ad,SquareArrowUpRight:ud,SquareArrowUpRightIcon:ud,SquareAsterisk:pd,SquareAsteriskIcon:pd,SquareBottomDashedScissors:fd,SquareBottomDashedScissorsIcon:fd,SquareCenterlineDashedHorizontal:xd,SquareCenterlineDashedHorizontalIcon:xd,SquareCenterlineDashedVertical:gd,SquareCenterlineDashedVerticalIcon:gd,SquareChartGantt:qs,SquareChartGanttIcon:qs,SquareCheck:yd,SquareCheckBig:md,SquareCheckBigIcon:md,SquareCheckIcon:yd,SquareChevronDown:vd,SquareChevronDownIcon:vd,SquareChevronLeft:kd,SquareChevronLeftIcon:kd,SquareChevronRight:Od,SquareChevronRightIcon:Od,SquareChevronUp:wd,SquareChevronUpIcon:wd,SquareCode:bd,SquareCodeIcon:bd,SquareDashed:Nd,SquareDashedBottom:AQ,SquareDashedBottomCode:dQ,SquareDashedBottomCodeIcon:dQ,SquareDashedBottomIcon:AQ,SquareDashedIcon:Nd,SquareDashedKanban:jd,SquareDashedKanbanIcon:jd,SquareDashedMousePointer:Cd,SquareDashedMousePointerIcon:Cd,SquareDashedText:Ds,SquareDashedTextIcon:Ds,SquareDashedTopSolid:uQ,SquareDashedTopSolidIcon:uQ,SquareDivide:Md,SquareDivideIcon:Md,SquareDot:Sd,SquareDotIcon:Sd,SquareEqual:Qd,SquareEqualIcon:Qd,SquareFunction:Bd,SquareFunctionIcon:Bd,SquareGanttChart:qs,SquareGanttChartIcon:qs,SquareIcon:Gr,SquareKanban:_d,SquareKanbanIcon:_d,SquareLibrary:Ld,SquareLibraryIcon:Ld,SquareM:Td,SquareMIcon:Td,SquareMenu:$d,SquareMenuIcon:$d,SquareMinus:Ud,SquareMinusIcon:Ud,SquareMousePointer:Id,SquareMousePointerIcon:Id,SquareParking:Ed,SquareParkingIcon:Ed,SquareParkingOff:Pd,SquareParkingOffIcon:Pd,SquarePause:hQ,SquarePauseIcon:hQ,SquarePen:sn,SquarePenIcon:sn,SquarePercent:zd,SquarePercentIcon:zd,SquarePi:Fd,SquarePiIcon:Fd,SquarePilcrow:Rd,SquarePilcrowIcon:Rd,SquarePlay:Hd,SquarePlayIcon:Hd,SquarePlus:qd,SquarePlusIcon:qd,SquarePower:Dd,SquarePowerIcon:Dd,SquareRadical:pQ,SquareRadicalIcon:pQ,SquareRoundCorner:fQ,SquareRoundCornerIcon:fQ,SquareScissors:Vd,SquareScissorsIcon:Vd,SquareSigma:Xd,SquareSigmaIcon:Xd,SquareSlash:Zd,SquareSlashIcon:Zd,SquareSplitHorizontal:Gd,SquareSplitHorizontalIcon:Gd,SquareSplitVertical:Wd,SquareSplitVerticalIcon:Wd,SquareSquare:xQ,SquareSquareIcon:xQ,SquareStack:mQ,SquareStackIcon:mQ,SquareStar:gQ,SquareStarIcon:gQ,SquareStop:yQ,SquareStopIcon:yQ,SquareTerminal:Yd,SquareTerminalIcon:Yd,SquareUser:Jd,SquareUserIcon:Jd,SquareUserRound:Kd,SquareUserRoundIcon:Kd,SquareX:eA,SquareXIcon:eA,SquaresExclude:vQ,SquaresExcludeIcon:vQ,SquaresIntersect:kQ,SquaresIntersectIcon:kQ,SquaresSubtract:OQ,SquaresSubtractIcon:OQ,SquaresUnite:bQ,SquaresUniteIcon:bQ,Squircle:jQ,SquircleDashed:wQ,SquircleDashedIcon:wQ,SquircleIcon:jQ,Squirrel:CQ,SquirrelIcon:CQ,Stamp:NQ,StampIcon:NQ,Star:IA,StarHalf:MQ,StarHalfIcon:MQ,StarIcon:IA,StarOff:SQ,StarOffIcon:SQ,Stars:It,StarsIcon:It,StepBack:QQ,StepBackIcon:QQ,StepForward:BQ,StepForwardIcon:BQ,Stethoscope:_Q,StethoscopeIcon:_Q,Sticker:LQ,StickerIcon:LQ,StickyNote:TQ,StickyNoteIcon:TQ,Stone:$Q,StoneIcon:$Q,StopCircle:_c,StopCircleIcon:_c,Store:IQ,StoreIcon:IQ,StretchHorizontal:UQ,StretchHorizontalIcon:UQ,StretchVertical:PQ,StretchVerticalIcon:PQ,Strikethrough:EQ,StrikethroughIcon:EQ,Subscript:zQ,SubscriptIcon:zQ,Subtitles:Ki,SubtitlesIcon:Ki,Sun:DQ,SunDim:FQ,SunDimIcon:FQ,SunIcon:DQ,SunMedium:RQ,SunMediumIcon:RQ,SunMoon:HQ,SunMoonIcon:HQ,SunSnow:qQ,SunSnowIcon:qQ,Sunrise:VQ,SunriseIcon:VQ,Sunset:XQ,SunsetIcon:XQ,Superscript:ZQ,SuperscriptIcon:ZQ,SwatchBook:GQ,SwatchBookIcon:GQ,SwissFranc:WQ,SwissFrancIcon:WQ,SwitchCamera:KQ,SwitchCameraIcon:KQ,Sword:YQ,SwordIcon:YQ,Swords:JQ,SwordsIcon:JQ,Syringe:eB,SyringeIcon:eB,Table:cB,Table2:tB,Table2Icon:tB,TableCellsMerge:aB,TableCellsMergeIcon:aB,TableCellsSplit:nB,TableCellsSplitIcon:nB,TableColumnsSplit:sB,TableColumnsSplitIcon:sB,TableConfig:Es,TableConfigIcon:Es,TableIcon:cB,TableOfContents:rB,TableOfContentsIcon:rB,TableProperties:oB,TablePropertiesIcon:oB,TableRowsSplit:iB,TableRowsSplitIcon:iB,Tablet:U0,TabletIcon:U0,TabletSmartphone:lB,TabletSmartphoneIcon:lB,Tablets:dB,TabletsIcon:dB,Tag:AB,TagIcon:AB,Tags:uB,TagsIcon:uB,Tally1:hB,Tally1Icon:hB,Tally2:pB,Tally2Icon:pB,Tally3:fB,Tally3Icon:fB,Tally4:xB,Tally4Icon:xB,Tally5:mB,Tally5Icon:mB,Tangent:gB,TangentIcon:gB,Target:yB,TargetIcon:yB,Telescope:vB,TelescopeIcon:vB,Tent:OB,TentIcon:OB,TentTree:kB,TentTreeIcon:kB,Terminal:Ns,TerminalIcon:Ns,TerminalSquare:Yd,TerminalSquareIcon:Yd,TestTube:ti,TestTube2:tA,TestTube2Icon:tA,TestTubeDiagonal:tA,TestTubeDiagonalIcon:tA,TestTubeIcon:ti,TestTubes:bB,TestTubesIcon:bB,Text:Vs,TextAlignCenter:aA,TextAlignCenterIcon:aA,TextAlignEnd:sA,TextAlignEndIcon:sA,TextAlignJustify:nA,TextAlignJustifyIcon:nA,TextAlignStart:Vs,TextAlignStartIcon:Vs,TextCursor:jB,TextCursorIcon:jB,TextCursorInput:wB,TextCursorInputIcon:wB,TextIcon:Vs,TextInitial:rA,TextInitialIcon:rA,TextQuote:CB,TextQuoteIcon:CB,TextSearch:NB,TextSearchIcon:NB,TextSelect:Ds,TextSelectIcon:Ds,TextSelection:Ds,TextSelectionIcon:Ds,TextWrap:oA,TextWrapIcon:oA,Theater:MB,TheaterIcon:MB,Thermometer:BB,ThermometerIcon:BB,ThermometerSnowflake:SB,ThermometerSnowflakeIcon:SB,ThermometerSun:QB,ThermometerSunIcon:QB,ThumbsDown:_B,ThumbsDownIcon:_B,ThumbsUp:LB,ThumbsUpIcon:LB,Ticket:zB,TicketCheck:TB,TicketCheckIcon:TB,TicketIcon:zB,TicketMinus:$B,TicketMinusIcon:$B,TicketPercent:IB,TicketPercentIcon:IB,TicketPlus:UB,TicketPlusIcon:UB,TicketSlash:PB,TicketSlashIcon:PB,TicketX:EB,TicketXIcon:EB,Tickets:RB,TicketsIcon:RB,TicketsPlane:FB,TicketsPlaneIcon:FB,Timeline:HB,TimelineIcon:HB,Timer:P0,TimerIcon:P0,TimerOff:qB,TimerOffIcon:qB,TimerReset:DB,TimerResetIcon:DB,ToggleLeft:VB,ToggleLeftIcon:VB,ToggleRight:XB,ToggleRightIcon:XB,Toilet:ZB,ToiletIcon:ZB,ToolCase:GB,ToolCaseIcon:GB,Toolbox:WB,ToolboxIcon:WB,Tornado:KB,TornadoIcon:KB,Torus:YB,TorusIcon:YB,Touchpad:e9,TouchpadIcon:e9,TouchpadOff:JB,TouchpadOffIcon:JB,TowelRack:t9,TowelRackIcon:t9,TowerControl:a9,TowerControlIcon:a9,ToyBrick:r9,ToyBrickIcon:r9,Tractor:n9,TractorIcon:n9,TrafficCone:s9,TrafficConeIcon:s9,Train:iA,TrainFront:c9,TrainFrontIcon:c9,TrainFrontTunnel:o9,TrainFrontTunnelIcon:o9,TrainIcon:iA,TrainTrack:i9,TrainTrackIcon:i9,TramFront:iA,TramFrontIcon:iA,Transgender:l9,TransgenderIcon:l9,Trash:d9,Trash2:At,Trash2Icon:At,TrashIcon:d9,TreeDeciduous:A9,TreeDeciduousIcon:A9,TreePalm:cA,TreePalmIcon:cA,TreePine:u9,TreePineIcon:u9,Trees:h9,TreesIcon:h9,TrendingDown:p9,TrendingDownIcon:p9,TrendingUp:x9,TrendingUpDown:f9,TrendingUpDownIcon:f9,TrendingUpIcon:x9,Triangle:y9,TriangleAlert:Gt,TriangleAlertIcon:Gt,TriangleDashed:m9,TriangleDashedIcon:m9,TriangleIcon:y9,TriangleRight:g9,TriangleRightIcon:g9,Trophy:v9,TrophyIcon:v9,Truck:O9,TruckElectric:k9,TruckElectricIcon:k9,TruckIcon:O9,TurkishLira:b9,TurkishLiraIcon:b9,Turntable:w9,TurntableIcon:w9,Turtle:j9,TurtleIcon:j9,Tv:N9,Tv2:lA,Tv2Icon:lA,TvIcon:N9,TvMinimal:lA,TvMinimalIcon:lA,TvMinimalPlay:C9,TvMinimalPlayIcon:C9,Type:M9,TypeIcon:M9,TypeOutline:S9,TypeOutlineIcon:S9,Umbrella:_9,UmbrellaIcon:_9,UmbrellaOff:B9,UmbrellaOffIcon:B9,Underline:Q9,UnderlineIcon:Q9,Undo:$9,Undo2:L9,Undo2Icon:L9,UndoDot:T9,UndoDotIcon:T9,UndoIcon:$9,UnfoldHorizontal:I9,UnfoldHorizontalIcon:I9,UnfoldVertical:U9,UnfoldVerticalIcon:U9,Ungroup:P9,UngroupIcon:P9,University:dA,UniversityIcon:dA,Unlink:z9,Unlink2:E9,Unlink2Icon:E9,UnlinkIcon:z9,Unlock:Bl,UnlockIcon:Bl,UnlockKeyhole:Ql,UnlockKeyholeIcon:Ql,Unplug:ai,UnplugIcon:ai,Upload:E0,UploadCloud:Pc,UploadCloudIcon:Pc,UploadIcon:E0,Usb:F9,UsbIcon:F9,User:z0,User2:xA,User2Icon:xA,UserCheck:Ou,UserCheck2:AA,UserCheck2Icon:AA,UserCheckIcon:Ou,UserCircle:Tc,UserCircle2:Lc,UserCircle2Icon:Lc,UserCircleIcon:Tc,UserCog:R9,UserCog2:uA,UserCog2Icon:uA,UserCogIcon:R9,UserIcon:z0,UserKey:H9,UserKeyIcon:H9,UserLock:q9,UserLockIcon:q9,UserMinus:D9,UserMinus2:hA,UserMinus2Icon:hA,UserMinusIcon:D9,UserPen:V9,UserPenIcon:V9,UserPlus:bu,UserPlus2:pA,UserPlus2Icon:pA,UserPlusIcon:bu,UserRound:xA,UserRoundCheck:AA,UserRoundCheckIcon:AA,UserRoundCog:uA,UserRoundCogIcon:uA,UserRoundIcon:xA,UserRoundKey:X9,UserRoundKeyIcon:X9,UserRoundMinus:hA,UserRoundMinusIcon:hA,UserRoundPen:Z9,UserRoundPenIcon:Z9,UserRoundPlus:pA,UserRoundPlusIcon:pA,UserRoundSearch:G9,UserRoundSearchIcon:G9,UserRoundX:fA,UserRoundXIcon:fA,UserSearch:W9,UserSearchIcon:W9,UserSquare:Jd,UserSquare2:Kd,UserSquare2Icon:Kd,UserSquareIcon:Jd,UserStar:K9,UserStarIcon:K9,UserX:Y9,UserX2:fA,UserX2Icon:fA,UserXIcon:Y9,Users:Fa,Users2:mA,Users2Icon:mA,UsersIcon:Fa,UsersRound:mA,UsersRoundIcon:mA,Utensils:yA,UtensilsCrossed:gA,UtensilsCrossedIcon:gA,UtensilsIcon:yA,UtilityPole:J9,UtilityPoleIcon:J9,Van:e_,VanIcon:e_,Variable:t_,VariableIcon:t_,Vault:a_,VaultIcon:a_,VectorSquare:n_,VectorSquareIcon:n_,Vegan:s_,VeganIcon:s_,VenetianMask:r_,VenetianMaskIcon:r_,Venus:i_,VenusAndMars:o_,VenusAndMarsIcon:o_,VenusIcon:i_,Verified:Di,VerifiedIcon:Di,Vibrate:l_,VibrateIcon:l_,VibrateOff:c_,VibrateOffIcon:c_,Video:A_,VideoIcon:A_,VideoOff:d_,VideoOffIcon:d_,Videotape:u_,VideotapeIcon:u_,View:h_,ViewIcon:h_,Voicemail:p_,VoicemailIcon:p_,Volleyball:f_,VolleyballIcon:f_,Volume:v_,Volume1:x_,Volume1Icon:x_,Volume2:m_,Volume2Icon:m_,VolumeIcon:v_,VolumeOff:g_,VolumeOffIcon:g_,VolumeX:y_,VolumeXIcon:y_,Vote:k_,VoteIcon:k_,Wallet:wu,Wallet2:vA,Wallet2Icon:vA,WalletCards:O_,WalletCardsIcon:O_,WalletIcon:wu,WalletMinimal:vA,WalletMinimalIcon:vA,Wallpaper:w_,WallpaperIcon:w_,Wand:b_,Wand2:kA,Wand2Icon:kA,WandIcon:b_,WandSparkles:kA,WandSparklesIcon:kA,Warehouse:j_,WarehouseIcon:j_,WashingMachine:C_,WashingMachineIcon:C_,Watch:N_,WatchIcon:N_,Waves:B_,WavesArrowDown:M_,WavesArrowDownIcon:M_,WavesArrowUp:S_,WavesArrowUpIcon:S_,WavesIcon:B_,WavesLadder:Q_,WavesLadderIcon:Q_,Waypoints:__,WaypointsIcon:__,Webcam:L_,WebcamIcon:L_,Webhook:$_,WebhookIcon:$_,WebhookOff:T_,WebhookOffIcon:T_,Weight:P_,WeightIcon:P_,WeightTilde:I_,WeightTildeIcon:I_,Wheat:E_,WheatIcon:E_,WheatOff:U_,WheatOffIcon:U_,WholeWord:z_,WholeWordIcon:z_,Wifi:UA,WifiCog:F_,WifiCogIcon:F_,WifiHigh:R_,WifiHighIcon:R_,WifiIcon:UA,WifiLow:H_,WifiLowIcon:H_,WifiOff:F0,WifiOffIcon:F0,WifiPen:q_,WifiPenIcon:q_,WifiSync:V_,WifiSyncIcon:V_,WifiZero:D_,WifiZeroIcon:D_,Wind:Z_,WindArrowDown:X_,WindArrowDownIcon:X_,WindIcon:Z_,Wine:W_,WineIcon:W_,WineOff:G_,WineOffIcon:G_,Workflow:K_,WorkflowIcon:K_,Worm:Y_,WormIcon:Y_,WrapText:oA,WrapTextIcon:oA,Wrench:ju,WrenchIcon:ju,X:Ge,XCircle:qn,XCircleIcon:qn,XIcon:Ge,XLineTop:J_,XLineTopIcon:J_,XOctagon:El,XOctagonIcon:El,XSquare:eA,XSquareIcon:eA,Zap:wt,ZapIcon:wt,ZapOff:eL,ZapOffIcon:eL,ZodiacAquarius:tL,ZodiacAquariusIcon:tL,ZodiacAries:aL,ZodiacAriesIcon:aL,ZodiacCancer:nL,ZodiacCancerIcon:nL,ZodiacCapricorn:sL,ZodiacCapricornIcon:sL,ZodiacGemini:rL,ZodiacGeminiIcon:rL,ZodiacLeo:oL,ZodiacLeoIcon:oL,ZodiacLibra:iL,ZodiacLibraIcon:iL,ZodiacOphiuchus:cL,ZodiacOphiuchusIcon:cL,ZodiacPisces:lL,ZodiacPiscesIcon:lL,ZodiacSagittarius:dL,ZodiacSagittariusIcon:dL,ZodiacScorpio:AL,ZodiacScorpioIcon:AL,ZodiacTaurus:uL,ZodiacTaurusIcon:uL,ZodiacVirgo:hL,ZodiacVirgoIcon:hL,ZoomIn:pL,ZoomInIcon:pL,ZoomOut:fL,ZoomOutIcon:fL,createLucideIcon:h,icons:tSe,useLucideContext:AG},Symbol.toStringTag,{value:"Module"})),aSe={success:Sa,error:Xt,info:uu,warning:Gt},nSe={success:"border-l-success",error:"border-l-danger",info:"border-l-accent",warning:"border-l-warning"},sSe={success:"text-success",error:"text-danger",info:"text-accent",warning:"text-warning"},rSe={success:3e3,error:0,info:5e3,warning:5e3};function oSe({toast:t}){var o,c;const a=$(l=>l.removeToast),n=aSe[t.type]||uu,s=t.persistent?0:t.duration??rSe[t.type];return g.useEffect(()=>{if(!s)return;const l=setTimeout(()=>a(t.id),s);return()=>clearTimeout(l)},[t.id,s,a]),e.jsxs(as.div,{layout:!0,initial:{opacity:0,x:80,scale:.95},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:80,scale:.95},transition:{duration:.2},className:V("w-80 border border-border bg-surface-1 shadow-xl","border-l-2 flex items-center gap-3 px-4 py-3",nSe[t.type]),children:[e.jsx(n,{size:16,className:V("flex-shrink-0",sSe[t.type])}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm text-text-0 font-sans",children:t.message}),t.detail&&e.jsx("p",{className:"text-xs text-text-3 font-sans mt-0.5",children:t.detail})]}),(((o=t.action)==null?void 0:o.url)||((c=t.action)==null?void 0:c.onClick))&&e.jsx("button",{onClick:l=>{if(l.stopPropagation(),t.action.onClick)t.action.onClick();else if(t.action.url)try{window.open(t.action.url,"_blank","noopener")}catch{}a(t.id)},className:"text-xs font-medium text-accent hover:text-accent-hover bg-surface-5 hover:bg-surface-6 px-3 py-1.5 rounded transition-colors cursor-pointer flex-shrink-0 whitespace-nowrap",children:t.action.label||"Open"}),e.jsx("button",{onClick:l=>{l.stopPropagation(),a(t.id)},className:"p-1.5 text-text-4 hover:text-text-1 hover:bg-surface-5 rounded transition-colors cursor-pointer flex-shrink-0 z-10",children:e.jsx(Ge,{size:14})})]})}function hG(){const t=$(a=>a.toasts);return e.jsx("div",{className:"fixed bottom-10 left-[60px] z-[100] flex flex-col-reverse gap-2",children:e.jsx(Pu,{mode:"popLayout",children:t.slice(-3).map(a=>e.jsx(oSe,{toast:a},a.id))})})}const pD=[{id:"agents",icon:fu,label:"Agents"},{id:"chat",icon:Yn,label:"Chat"},{id:"editor",icon:Zt,label:"Editor"},{id:"dashboard",icon:nu,label:"Dashboard"},{id:"teams",icon:Fa,label:"Teams"},{id:"marketplace",icon:vu,label:"Marketplace"},{id:"toys",icon:QA,label:"Toys"},{id:"models",icon:on,label:"Models"},{id:"model-lab",icon:cu,label:"Model Lab"}],iSe={id:"network",icon:sa,label:"Network"},cSe={id:"preview",icon:na,label:"Preview"},lSe=[{id:"journalist",icon:Jo,label:"Journalist",panel:!0},{id:"settings",icon:Zr,label:"Settings",nav:!0}];function dSe({activeView:t,detailPanel:a,onNavigate:n,onTogglePanel:s}){const o=d2()&&dZ()==="darwin",c=$(u=>u.networkUnlocked);let A=$(u=>u.previewState.url)?[...pD,cSe]:pD;return c&&(A=[...A,iSe]),e.jsxs("nav",{className:"w-12 flex-shrink-0 flex flex-col bg-surface-3 border-r border-border",children:[o&&e.jsx("div",{className:"flex-shrink-0 h-9 flex items-end justify-center pb-0.5",children:e.jsx("img",{src:"/favicon.png",alt:"Groove",className:"h-6 w-6 rounded-full"})}),e.jsx("div",{className:"flex flex-col items-center gap-1.5 pt-2.5",children:A.map(u=>e.jsx(Nt,{content:u.label,side:"right",children:e.jsx("button",{onClick:()=>n(u.id),className:V("w-8 h-8 flex items-center justify-center rounded-md transition-colors cursor-pointer",t===u.id?"text-accent bg-accent/10":"text-text-3 hover:text-accent hover:bg-accent/10"),children:e.jsx(u.icon,{size:16,strokeWidth:t===u.id?2:1.5})})},u.id))}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex flex-col items-center gap-1.5 pb-3",children:lSe.map(u=>{const f=u.panel?(a==null?void 0:a.type)===u.id:t===u.id;return e.jsx(Nt,{content:u.label,side:"right",children:e.jsx("button",{onClick:()=>u.panel?s(u.id):n(u.id),className:V("w-8 h-8 flex items-center justify-center rounded-md transition-colors cursor-pointer",f?"text-accent bg-accent/10":"text-text-3 hover:text-accent hover:bg-accent/10"),children:e.jsx(u.icon,{size:16,strokeWidth:f?2:1.5})})},u.id)})})]})}function ASe({user:t,size:a=24}){const[n,s]=g.useState(!1),o=(t==null?void 0:t.avatar)||(t==null?void 0:t.picture)||(t==null?void 0:t.photoURL)||(t==null?void 0:t.photo);return o&&!n?e.jsx("img",{src:o,alt:"",className:"rounded-full",style:{width:a,height:a},referrerPolicy:"no-referrer",crossOrigin:"anonymous",onError:()=>s(!0)}):e.jsx("div",{className:"rounded-full bg-accent/10 flex items-center justify-center",style:{width:a,height:a},children:e.jsx(z0,{size:Math.round(a*.5),className:"text-accent"})})}function uSe(){const t=$(l=>l.marketplaceAuthenticated),a=$(l=>l.marketplaceUser);$(l=>l.marketplaceLogin);const n=$(l=>l.marketplaceLogout),[s,o]=g.useState(!1),c=g.useRef(null);return g.useEffect(()=>{if(!s)return;function l(A){c.current&&!c.current.contains(A.target)&&o(!1)}return document.addEventListener("mousedown",l,!0),()=>document.removeEventListener("mousedown",l,!0)},[s]),t?e.jsxs("div",{ref:c,className:"relative flex-shrink-0",children:[e.jsxs("button",{onClick:()=>o(!s),className:V("flex items-center gap-2 h-7 pl-2 pr-1 rounded-md transition-colors cursor-pointer select-none",s?"bg-surface-1 border border-border":"hover:bg-surface-1 border border-transparent"),children:[e.jsx("span",{className:"text-xs text-text-1 font-sans font-medium max-w-[100px] truncate",children:(a==null?void 0:a.displayName)||(a==null?void 0:a.id)||"Account"}),e.jsx(ASe,{user:a,size:20}),e.jsx(bt,{size:10,className:V("text-text-4 transition-transform",s&&"rotate-180")})]}),s&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 w-48 py-1 rounded-md bg-surface-1 border border-border shadow-lg z-50",children:[e.jsxs("div",{className:"px-3 py-2 border-b border-border-subtle",children:[e.jsx("p",{className:"text-xs font-medium text-text-0 font-sans truncate",children:(a==null?void 0:a.displayName)||"Account"}),(a==null?void 0:a.email)&&e.jsx("p",{className:"text-2xs text-text-4 font-sans truncate",children:a.email})]}),e.jsxs("a",{href:"https://docs.groovedev.ai",target:"_blank",rel:"noopener noreferrer",onClick:()=>o(!1),className:"flex items-center gap-2 px-3 py-1.5 text-xs text-text-2 hover:text-text-0 hover:bg-surface-3 font-sans cursor-pointer transition-colors",children:[e.jsx(Go,{size:12}),"Docs",e.jsx(ma,{size:9,className:"ml-auto text-text-4"})]}),e.jsxs("a",{href:"https://groovedev.ai",target:"_blank",rel:"noopener noreferrer",onClick:()=>o(!1),className:"flex items-center gap-2 px-3 py-1.5 text-xs text-text-2 hover:text-text-0 hover:bg-surface-3 font-sans cursor-pointer transition-colors",children:[e.jsx(ma,{size:12}),"groovedev.ai"]}),e.jsx("div",{className:"my-1 h-px bg-border-subtle"}),e.jsxs("button",{onClick:()=>{o(!1),n()},className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-text-3 hover:text-danger hover:bg-surface-3 font-sans cursor-pointer transition-colors",children:[e.jsx(C0,{size:12}),"Sign out"]})]})]}):null}const hSe={agents:"Agents",editor:"Editor",dashboard:"Dashboard",marketplace:"Marketplace",teams:"Teams"};function pSe({activeView:t,connected:a,tunneled:n,daemonHost:s,editorActiveFile:o,onOpenCommandPalette:c}){const l=$(v=>v.projectDir),A=$(v=>v.toggleProjectPicker),u=["Groove",hSe[t]||t];t==="editor"&&o&&u.push(o.split("/").pop());const x=d2()&&dZ()==="darwin",[m,y]=g.useState(null);return g.useEffect(()=>{var v;if((v=window.groove)!=null&&v.getInstanceInfo)window.groove.getInstanceInfo().then(O=>{O!=null&&O.name&&y(O.name)});else{const O=new URLSearchParams(window.location.search).get("instance");O&&y(O)}},[]),e.jsxs("header",{className:V("h-12 flex-shrink-0 flex items-center gap-3 px-4 bg-surface-3 border-b border-border relative",x&&"pl-24 electron-drag electron-no-drag-children"),children:[!x&&e.jsx("img",{src:"/favicon.png",alt:"Groove",className:"h-7 w-7 rounded-full flex-shrink-0"}),m&&e.jsxs("button",{onClick:()=>{var v,O;return(O=(v=window.groove)==null?void 0:v.openFolder)==null?void 0:O.call(v)},className:"text-2xs font-mono font-semibold text-accent bg-accent/10 px-1.5 py-0.5 rounded flex-shrink-0 hover:bg-accent/20 transition-colors cursor-pointer",children:["/",m]}),!m&&s&&e.jsx("span",{className:"text-2xs font-mono font-semibold text-text-3 bg-surface-5 px-1.5 py-0.5 rounded flex-shrink-0",children:s}),n&&l&&e.jsxs("button",{onClick:A,className:"flex items-center gap-1 text-2xs font-mono font-medium text-text-2 bg-surface-5 px-1.5 py-0.5 rounded flex-shrink-0 hover:bg-surface-4 hover:text-text-0 transition-colors cursor-pointer",title:l,children:[e.jsx(ga,{size:11}),l.split("/").pop()||"/"]}),e.jsx("div",{className:"flex-1 min-w-4"}),e.jsx("div",{className:"flex items-center gap-1 text-xs font-sans text-text-3 flex-shrink-0",children:u.map((v,O)=>e.jsxs("span",{className:"flex items-center gap-1",children:[O>0&&e.jsx(Rt,{size:11,className:"text-text-4"}),e.jsx("span",{className:V(O===u.length-1?"text-text-2":"text-text-4"),children:v})]},O))}),e.jsx(uSe,{}),e.jsxs("button",{onClick:c,className:V("absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center gap-2.5 h-8 px-4 rounded-md w-full max-w-md","bg-surface-1 border border-border-subtle","text-xs text-text-4 font-sans","hover:border-border hover:text-text-3 transition-colors cursor-pointer"),children:[e.jsx(oa,{size:14,className:"flex-shrink-0"}),e.jsx("span",{className:"flex-1 text-left",children:"Search commands..."}),e.jsx("kbd",{className:"text-2xs font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-4 ml-1",children:"Cmd+K"})]})]})}const fSe={running:"var(--color-success)",starting:"var(--color-warning)",stopped:"var(--color-text-3)",crashed:"var(--color-danger)",completed:"var(--color-accent)",killed:"var(--color-text-3)",rotating:"var(--color-purple)"};function qE(t){return fSe[t]||"var(--color-text-3)"}const xSe={planner:{bg:"rgba(74, 225, 104, 0.12)",text:"#4ae168",border:"#4ae168"},backend:{bg:"rgba(51, 175, 188, 0.12)",text:"#33afbc",border:"#33afbc"},frontend:{bg:"rgba(229, 192, 123, 0.12)",text:"#e5c07b",border:"#e5c07b"},fullstack:{bg:"rgba(74, 225, 104, 0.12)",text:"#4ae168",border:"#4ae168"},testing:{bg:"rgba(97, 175, 239, 0.12)",text:"#61afef",border:"#61afef"},devops:{bg:"rgba(209, 154, 102, 0.12)",text:"#d19a66",border:"#d19a66"},docs:{bg:"rgba(139, 146, 158, 0.12)",text:"#8b929e",border:"#8b929e"},security:{bg:"rgba(224, 108, 117, 0.12)",text:"#e06c75",border:"#e06c75"},database:{bg:"rgba(198, 120, 221, 0.12)",text:"#c678dd",border:"#c678dd"},cmo:{bg:"rgba(229, 192, 123, 0.12)",text:"#e5c07b",border:"#e5c07b"},cfo:{bg:"rgba(74, 225, 104, 0.12)",text:"#4ae168",border:"#4ae168"},ea:{bg:"rgba(97, 175, 239, 0.12)",text:"#61afef",border:"#61afef"},support:{bg:"rgba(51, 175, 188, 0.12)",text:"#33afbc",border:"#33afbc"},analyst:{bg:"rgba(198, 120, 221, 0.12)",text:"#c678dd",border:"#c678dd"},creative:{bg:"rgba(229, 192, 123, 0.12)",text:"#e5c07b",border:"#e5c07b"},slides:{bg:"rgba(209, 154, 102, 0.12)",text:"#d19a66",border:"#d19a66"},chat:{bg:"rgba(198, 120, 221, 0.12)",text:"#c678dd",border:"#c678dd"}};function On(t){const a=(t||"").toLowerCase();return xSe[a]||{bg:"rgba(139, 146, 158, 0.12)",text:"#8b929e",border:"#8b929e"}}function ia({status:t,size:a="md",className:n}){const s=t==="running"||t==="starting",o=a==="sm"?"w-1.5 h-1.5":a==="lg"?"w-3 h-3":"w-2 h-2";return e.jsx("span",{className:V("rounded-full inline-block flex-shrink-0",s&&"animate-pulse",o,n),style:{background:qE(t)}})}const mSe={default:"bg-surface-4 text-text-2",accent:"bg-accent/12 text-accent",success:"bg-success/12 text-success",warning:"bg-warning/12 text-warning",danger:"bg-danger/12 text-danger",info:"bg-info/12 text-info",purple:"bg-purple/12 text-purple",orange:"bg-orange/12 text-orange"};function be({children:t,variant:a="default",className:n,dot:s,...o}){return e.jsxs("span",{className:V("inline-flex items-center gap-1 px-1.5 py-0.5","text-2xs font-semibold uppercase tracking-wider rounded","font-sans select-none whitespace-nowrap",mSe[a],n),...o,children:[s&&e.jsx("span",{className:V("w-1.5 h-1.5 rounded-full",s==="pulse"&&"animate-pulse"),style:{background:"currentColor"}}),t]})}function pt(t){return t==null||isNaN(t)?"0":t>=1e9?(t/1e9).toFixed(1).replace(/\.0$/,"")+"B":t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"k":Math.round(t).toLocaleString()}function Ai(t){return t==null||isNaN(t)?"$0":t>=1e3?"$"+(t/1e3).toFixed(1).replace(/\.0$/,"")+"k":t>=1||t>=.01?"$"+t.toFixed(2):"$"+t.toFixed(3)}function us(t){return t==null||isNaN(t)?"0%":Math.round(t)+"%"}function WA(t){if(!t||t<0)return"0s";const a=Math.floor(t/86400),n=Math.floor(t%86400/3600),s=Math.floor(t%3600/60),o=Math.floor(t%60);return a>0?`${a}d ${n}h`:n>0?`${n}h ${s}m`:s>0?`${s}m ${o}s`:`${o}s`}function Mt(t){if(!t)return"";const a=(Date.now()-new Date(t).getTime())/1e3;return a<5?"just now":a<60?`${Math.floor(a)}s ago`:a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:`${Math.floor(a/86400)}d ago`}var pU="focusScope.autoFocusOnMount",fU="focusScope.autoFocusOnUnmount",fD={bubbles:!1,cancelable:!0},gSe="FocusScope",mT=g.forwardRef((t,a)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:o,onUnmountAutoFocus:c,...l}=t,[A,u]=g.useState(null),f=xa(o),x=xa(c),m=g.useRef(null),y=rt(a,b=>u(b)),v=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let b=function(M){if(v.paused||!A)return;const Q=M.target;A.contains(Q)?m.current=Q:To(m.current,{select:!0})},C=function(M){if(v.paused||!A)return;const Q=M.relatedTarget;Q!==null&&(A.contains(Q)||To(m.current,{select:!0}))},j=function(M){if(document.activeElement===document.body)for(const L of M)L.removedNodes.length>0&&To(A)};document.addEventListener("focusin",b),document.addEventListener("focusout",C);const N=new MutationObserver(j);return A&&N.observe(A,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",C),N.disconnect()}}},[s,A,v.paused]),g.useEffect(()=>{if(A){mD.add(v);const b=document.activeElement;if(!A.contains(b)){const j=new CustomEvent(pU,fD);A.addEventListener(pU,f),A.dispatchEvent(j),j.defaultPrevented||(ySe(wSe(pG(A)),{select:!0}),document.activeElement===b&&To(A))}return()=>{A.removeEventListener(pU,f),setTimeout(()=>{const j=new CustomEvent(fU,fD);A.addEventListener(fU,x),A.dispatchEvent(j),j.defaultPrevented||To(b??document.body,{select:!0}),A.removeEventListener(fU,x),mD.remove(v)},0)}}},[A,f,x,v]);const O=g.useCallback(b=>{if(!n&&!s||v.paused)return;const C=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,j=document.activeElement;if(C&&j){const N=b.currentTarget,[M,Q]=vSe(N);M&&Q?!b.shiftKey&&j===Q?(b.preventDefault(),n&&To(M,{select:!0})):b.shiftKey&&j===M&&(b.preventDefault(),n&&To(Q,{select:!0})):j===N&&b.preventDefault()}},[n,s,v.paused]);return e.jsx(Ve.div,{tabIndex:-1,...l,ref:y,onKeyDown:O})});mT.displayName=gSe;function ySe(t,{select:a=!1}={}){const n=document.activeElement;for(const s of t)if(To(s,{select:a}),document.activeElement!==n)return}function vSe(t){const a=pG(t),n=xD(a,t),s=xD(a.reverse(),t);return[n,s]}function pG(t){const a=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)a.push(n.currentNode);return a}function xD(t,a){for(const n of t)if(!kSe(n,{upTo:a}))return n}function kSe(t,{upTo:a}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(a!==void 0&&t===a)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function OSe(t){return t instanceof HTMLInputElement&&"select"in t}function To(t,{select:a=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&OSe(t)&&a&&t.select()}}var mD=bSe();function bSe(){let t=[];return{add(a){const n=t[0];a!==n&&(n==null||n.pause()),t=gD(t,a),t.unshift(a)},remove(a){var n;t=gD(t,a),(n=t[0])==null||n.resume()}}}function gD(t,a){const n=[...t],s=n.indexOf(a);return s!==-1&&n.splice(s,1),n}function wSe(t){return t.filter(a=>a.tagName!=="A")}var xU=0;function DE(){g.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??yD()),document.body.insertAdjacentElement("beforeend",t[1]??yD()),xU++,()=>{xU===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),xU--}},[])}function yD(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Zs=function(){return Zs=Object.assign||function(a){for(var n,s=1,o=arguments.length;s<o;s++){n=arguments[s];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(a[c]=n[c])}return a},Zs.apply(this,arguments)};function fG(t,a){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&a.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);o<s.length;o++)a.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(n[s[o]]=t[s[o]]);return n}function jSe(t,a,n){if(n||arguments.length===2)for(var s=0,o=a.length,c;s<o;s++)(c||!(s in a))&&(c||(c=Array.prototype.slice.call(a,0,s)),c[s]=a[s]);return t.concat(c||Array.prototype.slice.call(a))}var xL="right-scroll-bar-position",mL="width-before-scroll-bar",CSe="with-scroll-bars-hidden",NSe="--removed-body-scroll-bar-size";function mU(t,a){return typeof t=="function"?t(a):t&&(t.current=a),t}function MSe(t,a){var n=g.useState(function(){return{value:t,callback:a,facade:{get current(){return n.value},set current(s){var o=n.value;o!==s&&(n.value=s,n.callback(s,o))}}}})[0];return n.callback=a,n.facade}var SSe=typeof window<"u"?g.useLayoutEffect:g.useEffect,vD=new WeakMap;function QSe(t,a){var n=MSe(null,function(s){return t.forEach(function(o){return mU(o,s)})});return SSe(function(){var s=vD.get(n);if(s){var o=new Set(s),c=new Set(t),l=n.current;o.forEach(function(A){c.has(A)||mU(A,null)}),c.forEach(function(A){o.has(A)||mU(A,l)})}vD.set(n,t)},[t]),n}function BSe(t){return t}function _Se(t,a){a===void 0&&(a=BSe);var n=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(c){var l=a(c,s);return n.push(l),function(){n=n.filter(function(A){return A!==l})}},assignSyncMedium:function(c){for(s=!0;n.length;){var l=n;n=[],l.forEach(c)}n={push:function(A){return c(A)},filter:function(){return n}}},assignMedium:function(c){s=!0;var l=[];if(n.length){var A=n;n=[],A.forEach(c),l=n}var u=function(){var x=l;l=[],x.forEach(c)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(x){l.push(x),f()},filter:function(x){return l=l.filter(x),n}}}};return o}function LSe(t){t===void 0&&(t={});var a=_Se(null);return a.options=Zs({async:!0,ssr:!1},t),a}var xG=function(t){var a=t.sideCar,n=fG(t,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=a.read();if(!s)throw new Error("Sidecar medium not found");return g.createElement(s,Zs({},n))};xG.isSideCarExport=!0;function TSe(t,a){return t.useMedium(a),xG}var mG=LSe(),gU=function(){},gT=g.forwardRef(function(t,a){var n=g.useRef(null),s=g.useState({onScrollCapture:gU,onWheelCapture:gU,onTouchMoveCapture:gU}),o=s[0],c=s[1],l=t.forwardProps,A=t.children,u=t.className,f=t.removeScrollBar,x=t.enabled,m=t.shards,y=t.sideCar,v=t.noRelative,O=t.noIsolation,b=t.inert,C=t.allowPinchZoom,j=t.as,N=j===void 0?"div":j,M=t.gapMode,Q=fG(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=y,B=QSe([n,a]),S=Zs(Zs({},Q),o);return g.createElement(g.Fragment,null,x&&g.createElement(L,{sideCar:mG,removeScrollBar:f,shards:m,noRelative:v,noIsolation:O,inert:b,setCallbacks:c,allowPinchZoom:!!C,lockRef:n,gapMode:M}),l?g.cloneElement(g.Children.only(A),Zs(Zs({},S),{ref:B})):g.createElement(N,Zs({},S,{className:u,ref:B}),A))});gT.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gT.classNames={fullWidth:mL,zeroRight:xL};var $Se=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ISe(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var a=$Se();return a&&t.setAttribute("nonce",a),t}function USe(t,a){t.styleSheet?t.styleSheet.cssText=a:t.appendChild(document.createTextNode(a))}function PSe(t){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(t)}var ESe=function(){var t=0,a=null;return{add:function(n){t==0&&(a=ISe())&&(USe(a,n),PSe(a)),t++},remove:function(){t--,!t&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},zSe=function(){var t=ESe();return function(a,n){g.useEffect(function(){return t.add(a),function(){t.remove()}},[a&&n])}},gG=function(){var t=zSe(),a=function(n){var s=n.styles,o=n.dynamic;return t(s,o),null};return a},FSe={left:0,top:0,right:0,gap:0},yU=function(t){return parseInt(t||"",10)||0},RSe=function(t){var a=window.getComputedStyle(document.body),n=a[t==="padding"?"paddingLeft":"marginLeft"],s=a[t==="padding"?"paddingTop":"marginTop"],o=a[t==="padding"?"paddingRight":"marginRight"];return[yU(n),yU(s),yU(o)]},HSe=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return FSe;var a=RSe(t),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,s-n+a[2]-a[0])}},qSe=gG(),Cu="data-scroll-locked",DSe=function(t,a,n,s){var o=t.left,c=t.top,l=t.right,A=t.gap;return n===void 0&&(n="margin"),`
8572
8572
  .`.concat(CSe,` {
8573
8573
  overflow: hidden `).concat(s,`;
8574
8574
  padding-right: `).concat(A,"px ").concat(s,`;
@@ -8637,7 +8637,7 @@ PERFORMANCE OF THIS SOFTWARE.
8637
8637
  `),n=[];let s=0,o=[];for(;s<a.length;){const c=a[s];if(c.includes("|")&&s+1<a.length&&/^\|?\s*[-:]+/.test(a[s+1])){o.length>0&&(n.push({type:"text",content:o.join(`
8638
8638
  `)}),o=[]);const l=c.split("|").map(u=>u.trim()).filter(Boolean);s+=2;const A=[];for(;s<a.length&&a[s].includes("|");)A.push(a[s].split("|").map(u=>u.trim()).filter(Boolean)),s++;n.push({type:"table",headers:l,rows:A})}else o.push(c),s++}return o.length>0&&n.push({type:"text",content:o.join(`
8639
8639
  `)}),n}function u$e({text:t}){if(!t)return null;const a=A$e(t);return e.jsx(e.Fragment,{children:a.map((n,s)=>{if(n.type==="table")return e.jsx(sz,{headers:n.headers,rows:n.rows},s);const o=n.content.split(/(```[\s\S]*?```|`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*)/g);return e.jsx("span",{children:o.map((c,l)=>{if(!c)return null;if(c.startsWith("```")&&c.endsWith("```")){const A=c.slice(3,-3),u=A.indexOf(`
8640
- `),f=u>=0?A.slice(u+1):A;return e.jsx("pre",{className:"my-2 px-3 py-2 rounded-lg bg-surface-0 border border-border-subtle overflow-x-auto",children:e.jsx("code",{className:"text-xs font-mono text-text-1 whitespace-pre",children:f})},l)}return c.startsWith("`")&&c.endsWith("`")?e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-surface-0 text-xs font-mono text-accent",children:c.slice(1,-1)},l):c.startsWith("**")&&c.endsWith("**")?e.jsx("strong",{className:"font-semibold text-text-0",children:c.slice(2,-2)},l):c.startsWith("*")&&c.endsWith("*")?e.jsx("em",{className:"italic",children:c.slice(1,-1)},l):e.jsx("span",{children:c},l)})},s)})})}function h$e({msg:t}){return t.role==="user"?e.jsx("div",{className:"flex justify-end animate-chat-fade-in",children:e.jsxs("div",{className:"max-w-[85%]",children:[t.screenshot&&e.jsx("img",{src:t.screenshot,alt:"Screenshot",className:"mb-2 rounded-lg border border-border-subtle max-h-40 object-contain"}),e.jsx("div",{className:"px-4 py-3 rounded-2xl rounded-br-md bg-gradient-to-br from-accent/12 to-accent/6 border border-accent/15",children:e.jsx("p",{className:"text-sm text-text-0 font-sans whitespace-pre-wrap break-words leading-relaxed",children:t.content})}),e.jsx("div",{className:"text-2xs text-text-4 font-sans mt-1 text-right",children:Mt(t.timestamp)})]})}):e.jsxs("div",{className:"max-w-[85%] animate-chat-fade-in",children:[e.jsx("div",{className:"rounded-2xl rounded-tl-md bg-surface-1/80 border border-border-subtle px-4 py-3",children:e.jsx("p",{className:"text-sm text-text-1 font-sans whitespace-pre-wrap break-words leading-relaxed",children:e.jsx(u$e,{text:t.content})})}),e.jsx("div",{className:"text-2xs text-text-4 font-sans mt-1",children:Mt(t.timestamp)})]})}function p$e(){const t=$(y=>y.previewChat),a=$(y=>y.previewState),n=$(y=>y.iteratePreview),s=$(y=>y.previewIterating),[o,c]=g.useState(""),l=g.useRef(null),A=g.useRef(null),u=g.useRef(!0);g.useEffect(()=>{const y=l.current;if(!y)return;function v(){u.current=y.scrollHeight-y.scrollTop-y.clientHeight<50}return y.addEventListener("scroll",v),()=>y.removeEventListener("scroll",v)},[]),g.useEffect(()=>{u.current&&l.current&&(l.current.scrollTop=l.current.scrollHeight)},[t==null?void 0:t.length]);const f=g.useCallback(()=>{const y=A.current;y&&(y.style.height="auto",y.style.height=Math.min(y.scrollHeight,160)+"px")},[]);g.useEffect(()=>{f()},[o,f]);function x(){const y=o.trim();!y||s||(n(y),c(""),A.current&&(A.current.style.height="auto"))}function m(y){y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),x())}return e.jsxs("div",{className:"flex flex-col h-full bg-surface-0",children:[e.jsx("div",{className:"flex-shrink-0 h-10 flex items-center px-4 border-b border-border bg-surface-3",children:e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"Iterate"})}),e.jsx("div",{className:"flex-shrink-0 px-4 py-2 bg-accent/5 border-b border-accent/10",children:e.jsxs("p",{className:"text-2xs text-accent font-sans",children:["Iterating on ",e.jsx("span",{className:"font-semibold",children:a.teamId||"project"})," — changes auto-refresh via hot reload"]})}),e.jsxs("div",{ref:l,className:"flex-1 overflow-y-auto px-4 py-4 space-y-4",children:[t.length===0&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"max-w-xs w-full px-5 py-5 bg-surface-1 border border-border-subtle rounded-xl text-center",children:[e.jsx(Yn,{size:24,className:"mx-auto text-accent mb-3"}),e.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans mb-3",children:"Preview is live!"}),e.jsxs("ul",{className:"text-left space-y-2 text-2xs text-text-2 font-sans",children:[e.jsxs("li",{className:"flex gap-2",children:[e.jsx(Xa,{size:11,className:"text-text-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Type a message to request changes — your feedback goes to the team planner who routes it to the right agent"})]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx(au,{size:11,className:"text-text-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Use the camera icon to screenshot a specific area and annotate it"})]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx(ra,{size:11,className:"text-text-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Changes auto-refresh via hot module reload"})]})]})]})}),t.map((y,v)=>e.jsx(h$e,{msg:y},v)),s&&e.jsx("div",{className:"max-w-[85%] animate-chat-fade-in",children:e.jsx("div",{className:"rounded-2xl rounded-tl-md bg-surface-1/80 border border-border-subtle px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{size:14,className:"text-accent animate-spin"}),e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Routing to planner..."})]})})})]}),e.jsx("div",{className:"flex-shrink-0 px-3 py-3 border-t border-border",children:e.jsxs("div",{className:"flex items-end gap-2 rounded-2xl bg-surface-1/80 border border-accent/8 px-3 py-2",children:[e.jsx("textarea",{ref:A,value:o,onChange:y=>c(y.target.value),onKeyDown:m,placeholder:"Describe changes...",rows:1,style:{minHeight:"36px"},className:"flex-1 resize-none bg-transparent text-sm text-text-0 font-sans placeholder:text-text-4 focus:outline-none py-1.5"}),e.jsx("button",{onClick:x,disabled:!o.trim()||s,className:V("w-9 h-9 flex items-center justify-center rounded-xl transition-all cursor-pointer flex-shrink-0","disabled:opacity-20 disabled:cursor-not-allowed",o.trim()&&!s?"bg-accent/15 text-accent hover:bg-accent/25 border border-accent/25":"bg-surface-4 text-text-4"),children:e.jsx(Xa,{size:16})})]})})]})}function f$e(){return e.jsx("div",{className:"flex-1 flex items-center justify-center bg-surface-0",children:e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx(Q0,{size:40,className:"mx-auto text-text-4"}),e.jsx("h2",{className:"text-lg font-semibold text-text-1 font-sans",children:"No preview active"}),e.jsx("p",{className:"text-sm text-text-3 font-sans max-w-xs",children:"Build a project with a planner team to see it here."})]})})}const x$e={desktop:"100%",tablet:"768px",mobile:"375px"};function KW({embedded:t=!1}){const a=$(f=>f.previewState),n=g.useRef(null),[s,o]=g.useState(0),c=g.useCallback(()=>{o(f=>f+1)},[]);if(!a.url)return e.jsx(f$e,{});const l=a.teamId?`/api/preview/${a.teamId}/proxy/`:a.url,A=x$e[a.deviceSize]||"100%",u=a.deviceSize==="desktop";return e.jsxs("div",{className:"flex flex-col h-full bg-surface-0 md:flex-row",children:[e.jsxs("div",{className:"flex flex-col flex-[3] min-w-0 min-h-0",children:[e.jsx(PQe,{onRefresh:c}),e.jsxs("div",{className:"flex-1 relative overflow-hidden bg-surface-1",children:[a.screenshotMode&&e.jsx(d$e,{iframeRef:n}),e.jsx("div",{className:V("h-full transition-all duration-200",u?"w-full":"mx-auto"),style:u?void 0:{width:A,maxWidth:"100%"},children:e.jsx("iframe",{ref:n,src:l,title:"Preview",className:"w-full h-full border-0 bg-white",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"},s)})]})]}),!t&&e.jsx("div",{className:"flex-[2] min-w-[280px] max-w-[480px] border-l border-border md:max-w-none md:flex-[2]",children:e.jsx(p$e,{})})]})}var m$e=g.createContext(void 0);function m2(t){const a=g.useContext(m$e);return t||a||"ltr"}function tE(t,[a,n]){return Math.min(n,Math.max(a,t))}function g$e(t,a){return g.useReducer((n,s)=>a[n][s]??n,t)}var rz="ScrollArea",[YW]=tr(rz),[y$e,ns]=YW(rz),JW=g.forwardRef((t,a)=>{const{__scopeScrollArea:n,type:s="hover",dir:o,scrollHideDelay:c=600,...l}=t,[A,u]=g.useState(null),[f,x]=g.useState(null),[m,y]=g.useState(null),[v,O]=g.useState(null),[b,C]=g.useState(null),[j,N]=g.useState(0),[M,Q]=g.useState(0),[L,B]=g.useState(!1),[S,I]=g.useState(!1),z=rt(a,F=>u(F)),P=m2(o);return e.jsx(y$e,{scope:n,type:s,dir:P,scrollHideDelay:c,scrollArea:A,viewport:f,onViewportChange:x,content:m,onContentChange:y,scrollbarX:v,onScrollbarXChange:O,scrollbarXEnabled:L,onScrollbarXEnabledChange:B,scrollbarY:b,onScrollbarYChange:C,scrollbarYEnabled:S,onScrollbarYEnabledChange:I,onCornerWidthChange:N,onCornerHeightChange:Q,children:e.jsx(Ve.div,{dir:P,...l,ref:z,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":M+"px",...t.style}})})});JW.displayName=rz;var eK="ScrollAreaViewport",tK=g.forwardRef((t,a)=>{const{__scopeScrollArea:n,children:s,nonce:o,...c}=t,l=ns(eK,n),A=g.useRef(null),u=rt(a,A,l.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),e.jsx(Ve.div,{"data-radix-scroll-area-viewport":"",...c,ref:u,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});tK.displayName=eK;var rr="ScrollAreaScrollbar",aK=g.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=ns(rr,t.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:l}=o,A=t.orientation==="horizontal";return g.useEffect(()=>(A?c(!0):l(!0),()=>{A?c(!1):l(!1)}),[A,c,l]),o.type==="hover"?e.jsx(v$e,{...s,ref:a,forceMount:n}):o.type==="scroll"?e.jsx(k$e,{...s,ref:a,forceMount:n}):o.type==="auto"?e.jsx(nK,{...s,ref:a,forceMount:n}):o.type==="always"?e.jsx(oz,{...s,ref:a}):null});aK.displayName=rr;var v$e=g.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=ns(rr,t.__scopeScrollArea),[c,l]=g.useState(!1);return g.useEffect(()=>{const A=o.scrollArea;let u=0;if(A){const f=()=>{window.clearTimeout(u),l(!0)},x=()=>{u=window.setTimeout(()=>l(!1),o.scrollHideDelay)};return A.addEventListener("pointerenter",f),A.addEventListener("pointerleave",x),()=>{window.clearTimeout(u),A.removeEventListener("pointerenter",f),A.removeEventListener("pointerleave",x)}}},[o.scrollArea,o.scrollHideDelay]),e.jsx(Za,{present:n||c,children:e.jsx(nK,{"data-state":c?"visible":"hidden",...s,ref:a})})}),k$e=g.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=ns(rr,t.__scopeScrollArea),c=t.orientation==="horizontal",l=LT(()=>u("SCROLL_END"),100),[A,u]=g$e("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(A==="idle"){const f=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[A,o.scrollHideDelay,u]),g.useEffect(()=>{const f=o.viewport,x=c?"scrollLeft":"scrollTop";if(f){let m=f[x];const y=()=>{const v=f[x];m!==v&&(u("SCROLL"),l()),m=v};return f.addEventListener("scroll",y),()=>f.removeEventListener("scroll",y)}},[o.viewport,c,u,l]),e.jsx(Za,{present:n||A!=="hidden",children:e.jsx(oz,{"data-state":A==="hidden"?"hidden":"visible",...s,ref:a,onPointerEnter:Se(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Se(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),nK=g.forwardRef((t,a)=>{const n=ns(rr,t.__scopeScrollArea),{forceMount:s,...o}=t,[c,l]=g.useState(!1),A=t.orientation==="horizontal",u=LT(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,x=n.viewport.offsetHeight<n.viewport.scrollHeight;l(A?f:x)}},10);return Tu(n.viewport,u),Tu(n.content,u),e.jsx(Za,{present:s||c,children:e.jsx(oz,{"data-state":c?"visible":"hidden",...o,ref:a})})}),oz=g.forwardRef((t,a)=>{const{orientation:n="vertical",...s}=t,o=ns(rr,t.__scopeScrollArea),c=g.useRef(null),l=g.useRef(0),[A,u]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=cK(A.viewport,A.content),x={...s,sizes:A,onSizesChange:u,hasThumb:f>0&&f<1,onThumbChange:y=>c.current=y,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:y=>l.current=y};function m(y,v){return N$e(y,l.current,A,v)}return n==="horizontal"?e.jsx(O$e,{...x,ref:a,onThumbPositionChange:()=>{if(o.viewport&&c.current){const y=o.viewport.scrollLeft,v=NV(y,A,o.dir);c.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollLeft=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollLeft=m(y,o.dir))}}):n==="vertical"?e.jsx(b$e,{...x,ref:a,onThumbPositionChange:()=>{if(o.viewport&&c.current){const y=o.viewport.scrollTop,v=NV(y,A);c.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollTop=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollTop=m(y))}}):null}),O$e=g.forwardRef((t,a)=>{const{sizes:n,onSizesChange:s,...o}=t,c=ns(rr,t.__scopeScrollArea),[l,A]=g.useState(),u=g.useRef(null),f=rt(a,u,c.onScrollbarXChange);return g.useEffect(()=>{u.current&&A(getComputedStyle(u.current))},[u]),e.jsx(rK,{"data-orientation":"horizontal",...o,ref:f,sizes:n,style:{bottom:0,left:c.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:c.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":_T(n)+"px",...t.style},onThumbPointerDown:x=>t.onThumbPointerDown(x.x),onDragScroll:x=>t.onDragScroll(x.x),onWheelScroll:(x,m)=>{if(c.viewport){const y=c.viewport.scrollLeft+x.deltaX;t.onWheelScroll(y),dK(y,m)&&x.preventDefault()}},onResize:()=>{u.current&&c.viewport&&l&&s({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:XL(l.paddingLeft),paddingEnd:XL(l.paddingRight)}})}})}),b$e=g.forwardRef((t,a)=>{const{sizes:n,onSizesChange:s,...o}=t,c=ns(rr,t.__scopeScrollArea),[l,A]=g.useState(),u=g.useRef(null),f=rt(a,u,c.onScrollbarYChange);return g.useEffect(()=>{u.current&&A(getComputedStyle(u.current))},[u]),e.jsx(rK,{"data-orientation":"vertical",...o,ref:f,sizes:n,style:{top:0,right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":_T(n)+"px",...t.style},onThumbPointerDown:x=>t.onThumbPointerDown(x.y),onDragScroll:x=>t.onDragScroll(x.y),onWheelScroll:(x,m)=>{if(c.viewport){const y=c.viewport.scrollTop+x.deltaY;t.onWheelScroll(y),dK(y,m)&&x.preventDefault()}},onResize:()=>{u.current&&c.viewport&&l&&s({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:XL(l.paddingTop),paddingEnd:XL(l.paddingBottom)}})}})}),[w$e,sK]=YW(rr),rK=g.forwardRef((t,a)=>{const{__scopeScrollArea:n,sizes:s,hasThumb:o,onThumbChange:c,onThumbPointerUp:l,onThumbPointerDown:A,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:x,onResize:m,...y}=t,v=ns(rr,n),[O,b]=g.useState(null),C=rt(a,z=>b(z)),j=g.useRef(null),N=g.useRef(""),M=v.viewport,Q=s.content-s.viewport,L=xa(x),B=xa(u),S=LT(m,10);function I(z){if(j.current){const P=z.clientX-j.current.left,F=z.clientY-j.current.top;f({x:P,y:F})}}return g.useEffect(()=>{const z=P=>{const F=P.target;(O==null?void 0:O.contains(F))&&L(P,Q)};return document.addEventListener("wheel",z,{passive:!1}),()=>document.removeEventListener("wheel",z,{passive:!1})},[M,O,Q,L]),g.useEffect(B,[s,B]),Tu(O,S),Tu(v.content,S),e.jsx(w$e,{scope:n,scrollbar:O,hasThumb:o,onThumbChange:xa(c),onThumbPointerUp:xa(l),onThumbPositionChange:B,onThumbPointerDown:xa(A),children:e.jsx(Ve.div,{...y,ref:C,style:{position:"absolute",...y.style},onPointerDown:Se(t.onPointerDown,z=>{z.button===0&&(z.target.setPointerCapture(z.pointerId),j.current=O.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),I(z))}),onPointerMove:Se(t.onPointerMove,I),onPointerUp:Se(t.onPointerUp,z=>{const P=z.target;P.hasPointerCapture(z.pointerId)&&P.releasePointerCapture(z.pointerId),document.body.style.webkitUserSelect=N.current,v.viewport&&(v.viewport.style.scrollBehavior=""),j.current=null})})})}),VL="ScrollAreaThumb",oK=g.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=sK(VL,t.__scopeScrollArea);return e.jsx(Za,{present:n||o.hasThumb,children:e.jsx(j$e,{ref:a,...s})})}),j$e=g.forwardRef((t,a)=>{const{__scopeScrollArea:n,style:s,...o}=t,c=ns(VL,n),l=sK(VL,n),{onThumbPositionChange:A}=l,u=rt(a,m=>l.onThumbChange(m)),f=g.useRef(void 0),x=LT(()=>{f.current&&(f.current(),f.current=void 0)},100);return g.useEffect(()=>{const m=c.viewport;if(m){const y=()=>{if(x(),!f.current){const v=M$e(m,A);f.current=v,A()}};return A(),m.addEventListener("scroll",y),()=>m.removeEventListener("scroll",y)}},[c.viewport,x,A]),e.jsx(Ve.div,{"data-state":l.hasThumb?"visible":"hidden",...o,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:Se(t.onPointerDownCapture,m=>{const v=m.target.getBoundingClientRect(),O=m.clientX-v.left,b=m.clientY-v.top;l.onThumbPointerDown({x:O,y:b})}),onPointerUp:Se(t.onPointerUp,l.onThumbPointerUp)})});oK.displayName=VL;var iz="ScrollAreaCorner",iK=g.forwardRef((t,a)=>{const n=ns(iz,t.__scopeScrollArea),s=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&s?e.jsx(C$e,{...t,ref:a}):null});iK.displayName=iz;var C$e=g.forwardRef((t,a)=>{const{__scopeScrollArea:n,...s}=t,o=ns(iz,n),[c,l]=g.useState(0),[A,u]=g.useState(0),f=!!(c&&A);return Tu(o.scrollbarX,()=>{var m;const x=((m=o.scrollbarX)==null?void 0:m.offsetHeight)||0;o.onCornerHeightChange(x),u(x)}),Tu(o.scrollbarY,()=>{var m;const x=((m=o.scrollbarY)==null?void 0:m.offsetWidth)||0;o.onCornerWidthChange(x),l(x)}),f?e.jsx(Ve.div,{...s,ref:a,style:{width:c,height:A,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function XL(t){return t?parseInt(t,10):0}function cK(t,a){const n=t/a;return isNaN(n)?0:n}function _T(t){const a=cK(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=(t.scrollbar.size-n)*a;return Math.max(s,18)}function N$e(t,a,n,s="ltr"){const o=_T(n),c=o/2,l=a||c,A=o-l,u=n.scrollbar.paddingStart+l,f=n.scrollbar.size-n.scrollbar.paddingEnd-A,x=n.content-n.viewport,m=s==="ltr"?[0,x]:[x*-1,0];return lK([u,f],m)(t)}function NV(t,a,n="ltr"){const s=_T(a),o=a.scrollbar.paddingStart+a.scrollbar.paddingEnd,c=a.scrollbar.size-o,l=a.content-a.viewport,A=c-s,u=n==="ltr"?[0,l]:[l*-1,0],f=tE(t,u);return lK([0,l],[0,A])(f)}function lK(t,a){return n=>{if(t[0]===t[1]||a[0]===a[1])return a[0];const s=(a[1]-a[0])/(t[1]-t[0]);return a[0]+s*(n-t[0])}}function dK(t,a){return t>0&&t<a}var M$e=(t,a=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},s=0;return(function o(){const c={left:t.scrollLeft,top:t.scrollTop},l=n.left!==c.left,A=n.top!==c.top;(l||A)&&a(),n=c,s=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(s)};function LT(t,a){const n=xa(t),s=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(s.current),[]),g.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(n,a)},[n,a])}function Tu(t,a){const n=xa(a);Ta(()=>{let s=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(n)});return o.observe(t),()=>{window.cancelAnimationFrame(s),o.unobserve(t)}}},[t,n])}var S$e=JW,Q$e=tK,MV=aK,SV=oK,B$e=iK;function it({children:t,className:a,...n}){return e.jsxs(S$e,{className:V("overflow-hidden",a),...n,children:[e.jsx(Q$e,{className:"h-full w-full rounded-[inherit]",children:t}),e.jsx(MV,{orientation:"vertical",className:"flex touch-none select-none p-0.5 transition-colors w-2",children:e.jsx(SV,{className:"relative flex-1 rounded-full bg-surface-5 hover:bg-surface-6"})}),e.jsx(MV,{orientation:"horizontal",className:"flex touch-none select-none flex-col p-0.5 transition-colors h-2",children:e.jsx(SV,{className:"relative flex-1 rounded-full bg-surface-5 hover:bg-surface-6"})}),e.jsx(B$e,{})]})}const _$e={js:"text-text-2",jsx:"text-text-2",ts:"text-text-2",tsx:"text-text-2",css:"text-text-3",html:"text-text-3",json:"text-text-3",md:"text-text-3",py:"text-text-2",rs:"text-text-3",go:"text-text-2",sh:"text-text-3",yaml:"text-text-3",yml:"text-text-3",sql:"text-text-3",xml:"text-text-3",svg:"text-text-3"};function L$e(t){var n;const a=(n=t.split(".").pop())==null?void 0:n.toLowerCase();return _$e[a]||"text-text-3"}function QV({defaultValue:t="",placeholder:a,onSubmit:n,onCancel:s,depth:o=0}){const[c,l]=g.useState(t),A=g.useRef(null);g.useEffect(()=>{var f,x;(f=A.current)==null||f.focus(),t&&((x=A.current)==null||x.select())},[t]);function u(f){if(f.key==="Enter"){const x=c.trim();x&&n(x)}f.key==="Escape"&&s()}return e.jsx("div",{className:"flex items-center py-0.5",style:{paddingLeft:o*16+8},children:e.jsx("input",{ref:A,value:c,onChange:f=>l(f.target.value),onKeyDown:u,onBlur:s,placeholder:a,className:"w-full h-5 px-1.5 text-xs bg-surface-0 border border-accent rounded text-text-0 font-sans focus:outline-none"})})}function T$e({x:t,y:a,items:n,onClose:s}){const o=g.useRef(null);return g.useEffect(()=>{function c(l){o.current&&!o.current.contains(l.target)&&s()}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[s]),e.jsx("div",{ref:o,className:"fixed z-50 min-w-[160px] py-1 bg-surface-2 border border-border rounded-lg shadow-xl",style:{left:t,top:a},children:n.map((c,l)=>c.separator?e.jsx("div",{className:"h-px bg-border-subtle my-1"},l):e.jsxs("button",{onClick:()=>{c.action(),s()},className:V("w-full flex items-center gap-2.5 px-3 py-1.5 text-xs font-sans text-left cursor-pointer transition-colors",c.danger?"text-danger hover:bg-danger/10":"text-text-1 hover:bg-surface-5"),children:[c.icon&&e.jsx(c.icon,{size:12,className:c.danger?"text-danger":"text-text-3"}),c.label]},l))})}function AK({entry:t,depth:a,onOpen:n,expandedDirs:s,onToggleDir:o,onContextMenu:c,dragState:l,onDragStartEntry:A,onDragEndEntry:u,onSetDragOver:f,onDropOnDir:x}){var j;const m=t.type==="dir",y=s.has(t.path),v=m?"text-accent":L$e(t.name),O=(l==null?void 0:l.draggingPath)===t.path,b=m&&(l==null?void 0:l.dragOverPath)===t.path;function C(N){N.preventDefault(),N.stopPropagation(),c==null||c(N,t)}return e.jsxs(e.Fragment,{children:[e.jsxs("button",{draggable:!0,onDragStart:N=>{N.dataTransfer.setData("application/json",JSON.stringify({path:t.path,name:t.name,type:t.type})),N.dataTransfer.effectAllowed="move",A(t.path)},onDragEnd:u,onDragOver:m?N=>{N.preventDefault(),N.stopPropagation(),f(t.path)}:void 0,onDrop:m?N=>x(t.path,N):void 0,onClick:()=>m?o(t.path):n(t.path),onDoubleClick:C,onContextMenu:C,className:V("w-full flex items-center gap-1.5 py-[3px] text-[13px] font-sans cursor-pointer","hover:bg-surface-4/50 transition-colors text-left",O&&"opacity-50",b&&"bg-accent/15 ring-1 ring-accent/50 rounded"),style:{paddingLeft:a*14+8},children:[m?e.jsxs(e.Fragment,{children:[y?e.jsx(bt,{size:12,className:"text-text-4 flex-shrink-0"}):e.jsx(Rt,{size:12,className:"text-text-4 flex-shrink-0"}),y?e.jsx(ga,{size:13,className:V(v,"flex-shrink-0")}):e.jsx(Ko,{size:13,className:V(v,"flex-shrink-0")})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-3 flex-shrink-0"}),e.jsx(iu,{size:13,className:V(v,"flex-shrink-0")})]}),e.jsx("span",{className:"truncate text-text-1",children:t.name})]}),m&&y&&((j=t.children)==null?void 0:j.map(N=>e.jsx(AK,{entry:N,depth:a+1,onOpen:n,expandedDirs:s,onToggleDir:o,onContextMenu:c,dragState:l,onDragStartEntry:A,onDragEndEntry:u,onSetDragOver:f,onDropOnDir:x},N.path)))]})}function $$e({agentId:t,onCollapse:a}){const n=$(ee=>ee.agents),s=$(ee=>ee.openFile),o=$(ee=>ee.editorActiveFile),c=$(ee=>ee.createFile),l=$(ee=>ee.addToast);$(ee=>ee.fetchTreeDir);const A=n.find(ee=>ee.id===t),u=(A==null?void 0:A.scope)||[],f=(A==null?void 0:A.workingDir)||"",x=(A==null?void 0:A.status)==="running"||(A==null?void 0:A.status)==="starting",[m,y]=g.useState([]),[v,O]=g.useState(new Set),[b,C]=g.useState(!0),[j,N]=g.useState([]),[M,Q]=g.useState(null),[L,B]=g.useState(null),[S,I]=g.useState({draggingPath:null,dragOverPath:null}),z=g.useRef(new Set);g.useEffect(()=>{let ee=!1;async function ke(){try{const Ne=await D.get(`/agents/${encodeURIComponent(t)}/files-touched`);!ee&&Ne.files&&N(Ne.files)}catch{}}ke();const ye=x?setInterval(ke,5e3):null;return()=>{ee=!0,ye&&clearInterval(ye)}},[t,x]);const P=g.useCallback(async ee=>{if(!z.current.has(ee)){z.current.add(ee);try{return(await D.get(`/files/tree?path=${encodeURIComponent(ee)}`)).entries||[]}catch{return[]}}},[]);g.useEffect(()=>{let ee=!1;async function ke(){if(C(!0),z.current=new Set,u.length===0){const ze=await P("");ee||y(ze),C(!1);return}const ye=new Set;for(const ze of u){const He=ze.split("/");let Tt="";for(let Et=0;Et<He.length&&!He[Et].includes("*");Et++)Tt=Tt?`${Tt}/${He[Et]}`:He[Et];Tt&&ye.add(Tt)}if(ye.size===0){const ze=await P("");ee||y(ze),C(!1);return}const Ne=[];for(const ze of ye){const He=await P(ze);He.length>0&&Ne.push({name:ze.split("/").pop(),path:ze,type:"dir",children:He})}ee||y(Ne),C(!1)}return ke(),()=>{ee=!0}},[t,u.join(","),P]);async function F(ee){const ke=new Set(v);if(ke.has(ee))ke.delete(ee);else{ke.add(ee);const ye=await P(ee);y(Ne=>uK(Ne,ee,ye))}O(ke)}function K(ee){s(ee)}function G(){Q({type:"file",onSubmit:async ee=>{Q(null),await(c==null?void 0:c(ee))},onCancel:()=>Q(null)})}function H(){Q({type:"folder",onSubmit:async ee=>{Q(null);try{await D.post("/files/mkdir",{path:ee}),l("success",`Created ${ee}/`),q()}catch(ke){l("error","Create folder failed",ke.message)}},onCancel:()=>Q(null)})}function q(){z.current=new Set,O(new Set),C(!0),P("").then(ee=>{y(ee||[]),C(!1)})}function _(){O(new Set)}function R(ee){I({draggingPath:ee,dragOverPath:null})}function U(){I({draggingPath:null,dragOverPath:null})}function Z(ee){I(ke=>ke.dragOverPath===ee?ke:{...ke,dragOverPath:ee})}async function J(ee,ke){ke.preventDefault(),ke.stopPropagation(),I({draggingPath:null,dragOverPath:null});let ye;try{ye=JSON.parse(ke.dataTransfer.getData("application/json"))}catch{return}if(!(ye!=null&&ye.path))return;if(ye.type==="dir"&&(ee===ye.path||ee.startsWith(ye.path+"/"))){l("error","Cannot move a folder into itself");return}if(W(ye.path)===ee)return;const ze=ee?`${ee}/${ye.name}`:ye.name;try{await D.post("/files/rename",{oldPath:ye.path,newPath:ze}),l("success",`Moved ${ye.name} to ${ee||"/"}`),q()}catch(He){l("error","Move failed",He.message)}}function Ae(ee){return!ee||!ee.startsWith("/")?ee:f&&ee.startsWith(f+"/")?ee.slice(f.length+1):ee}function W(ee){const ke=ee.split("/");return ke.pop(),ke.join("/")}function ae(ee,ke){var ye;(ye=ee.preventDefault)==null||ye.call(ee),B({x:ee.clientX,y:ee.clientY,entry:ke})}function Oe(ee){O(ke=>new Set([...ke,ee])),Q({type:"file",parentPath:ee,onSubmit:async ke=>{const ye=ee?`${ee}/${ke}`:ke;try{await D.post("/files/create",{path:ye,content:""}),l("success",`Created ${ke}`),q(),s(ye)}catch(Ne){l("error","Create failed",Ne.message)}Q(null)},onCancel:()=>Q(null)})}function ve(ee){O(ke=>new Set([...ke,ee])),Q({type:"folder",parentPath:ee,onSubmit:async ke=>{const ye=ee?`${ee}/${ke}`:ke;try{await D.post("/files/mkdir",{path:ye}),l("success",`Created ${ke}/`),q()}catch(Ne){l("error","Create folder failed",Ne.message)}Q(null)},onCancel:()=>Q(null)})}function ce(ee){Q({type:"rename",renamePath:ee.path,defaultValue:ee.name,onSubmit:async ke=>{const ye=W(ee.path),Ne=ye?`${ye}/${ke}`:ke;try{await D.post("/files/rename",{oldPath:ee.path,newPath:Ne}),l("success",`Renamed to ${ke}`),q()}catch(ze){l("error","Rename failed",ze.message)}Q(null)},onCancel:()=>Q(null)})}async function he(ee){const ke=ee.type==="dir"?`folder "${ee.name}" and all contents`:`"${ee.name}"`;if(window.confirm(`Delete ${ke}?`))try{await D.delete(`/files/delete?path=${encodeURIComponent(ee.path)}`),l("success",`Deleted ${ee.name}`),q()}catch(ye){l("error","Delete failed",ye.message)}}function je(ee){const ke=ee.type==="dir",ye=[];return ke&&(ye.push({icon:Hr,label:"New File",action:()=>Oe(ee.path)}),ye.push({icon:qr,label:"New Folder",action:()=>ve(ee.path)}),ye.push({separator:!0})),ye.push({icon:js,label:"Rename",action:()=>ce(ee)}),ye.push({icon:At,label:"Delete",danger:!0,action:()=>he(ee)}),ye}return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-0.5 px-2 py-1.5 border-b border-border-subtle flex-shrink-0",children:[e.jsx("span",{className:"flex-1 text-2xs font-semibold text-text-3 uppercase tracking-wider px-1",children:"Files"}),e.jsx("button",{onClick:G,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"New file",children:e.jsx(Hr,{size:12})}),e.jsx("button",{onClick:H,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"New folder",children:e.jsx(qr,{size:12})}),e.jsx("button",{onClick:q,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Refresh",children:e.jsx(ra,{size:12})}),e.jsx("button",{onClick:_,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Collapse all",children:e.jsx(ru,{size:12})}),a&&e.jsx("button",{onClick:a,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Collapse sidebar",children:e.jsx(fs,{size:12})})]}),e.jsx(it,{className:"flex-1 min-h-0",children:e.jsxs("div",{className:"py-2",children:[M&&e.jsx(QV,{placeholder:M.type==="file"?"filename.ext":"folder-name",onSubmit:M.onSubmit,onCancel:M.onCancel,depth:0}),j.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 text-2xs font-semibold text-text-3 uppercase tracking-wider",children:[e.jsx(ps,{size:10}),"Agent Files"]}),j.slice(0,15).map(ee=>{const ke=Ae(ee.path),ye=ke.split("/").pop(),Ne=ee.writes>0;return e.jsxs("button",{onClick:()=>s(ke),onContextMenu:ze=>{ze.preventDefault(),ze.stopPropagation(),ae(ze,{path:ke,name:ye,type:"file"})},onDoubleClick:ze=>{ze.preventDefault(),ze.stopPropagation(),ae(ze,{path:ke,name:ye,type:"file"})},className:V("w-full flex items-center gap-1.5 px-3 py-1 text-xs font-sans cursor-pointer","hover:bg-surface-4/50 transition-colors text-left",(o===ee.path||o===ke)&&"bg-accent/8 text-accent"),children:[Ne?e.jsx(ps,{size:12,className:"text-warning flex-shrink-0"}):e.jsx(na,{size:12,className:"text-info flex-shrink-0"}),e.jsx("span",{className:"truncate text-text-1 flex-1",children:ye}),Ne&&e.jsxs("span",{className:"text-2xs text-warning/60 flex-shrink-0",children:[ee.writes,"w"]})]},ee.path)}),e.jsx("div",{className:"h-px bg-border-subtle mx-3 mt-2"})]}),b?e.jsx("div",{className:"flex items-center justify-center py-8 text-text-4 text-xs font-sans",children:"Loading..."}):m.length===0?e.jsx("div",{className:"flex items-center justify-center py-8 text-text-4 text-xs font-sans",children:"No files in scope"}):e.jsxs("div",{className:"px-1",onDragOver:ee=>{S.draggingPath&&(ee.preventDefault(),Z(null))},onDrop:ee=>J("",ee),children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 text-2xs font-semibold text-text-3 uppercase tracking-wider",children:[e.jsx(Ko,{size:10}),"Scope"]}),m.map(ee=>(M==null?void 0:M.renamePath)===ee.path?e.jsx(QV,{defaultValue:ee.name,onSubmit:M.onSubmit,onCancel:M.onCancel,depth:0},ee.path):e.jsx(AK,{entry:ee,depth:0,onOpen:K,expandedDirs:v,onToggleDir:F,onContextMenu:ae,dragState:S,onDragStartEntry:R,onDragEndEntry:U,onSetDragOver:Z,onDropOnDir:J},ee.path))]})]})}),L&&e.jsx(T$e,{x:L.x,y:L.y,items:je(L.entry),onClose:()=>B(null)})]})}function uK(t,a,n){return t.map(s=>s.path===a?{...s,children:n}:s.children?{...s,children:uK(s.children,a,n)}:s)}function I$e(t,a){const n=(t||"").split(`
8640
+ `),f=u>=0?A.slice(u+1):A;return e.jsx("pre",{className:"my-2 px-3 py-2 rounded-lg bg-surface-0 border border-border-subtle overflow-x-auto",children:e.jsx("code",{className:"text-xs font-mono text-text-1 whitespace-pre",children:f})},l)}return c.startsWith("`")&&c.endsWith("`")?e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-surface-0 text-xs font-mono text-accent",children:c.slice(1,-1)},l):c.startsWith("**")&&c.endsWith("**")?e.jsx("strong",{className:"font-semibold text-text-0",children:c.slice(2,-2)},l):c.startsWith("*")&&c.endsWith("*")?e.jsx("em",{className:"italic",children:c.slice(1,-1)},l):e.jsx("span",{children:c},l)})},s)})})}function h$e({msg:t}){return t.role==="user"?e.jsx("div",{className:"flex justify-end animate-chat-fade-in",children:e.jsxs("div",{className:"max-w-[85%]",children:[t.screenshot&&e.jsx("img",{src:t.screenshot,alt:"Screenshot",className:"mb-2 rounded-lg border border-border-subtle max-h-40 object-contain"}),e.jsx("div",{className:"px-4 py-3 rounded-2xl rounded-br-md bg-gradient-to-br from-accent/12 to-accent/6 border border-accent/15",children:e.jsx("p",{className:"text-sm text-text-0 font-sans whitespace-pre-wrap break-words leading-relaxed",children:t.content})}),e.jsx("div",{className:"text-2xs text-text-4 font-sans mt-1 text-right",children:Mt(t.timestamp)})]})}):e.jsxs("div",{className:"max-w-[85%] animate-chat-fade-in",children:[e.jsx("div",{className:"rounded-2xl rounded-tl-md bg-surface-1/80 border border-border-subtle px-4 py-3",children:e.jsx("p",{className:"text-sm text-text-1 font-sans whitespace-pre-wrap break-words leading-relaxed",children:e.jsx(u$e,{text:t.content})})}),e.jsx("div",{className:"text-2xs text-text-4 font-sans mt-1",children:Mt(t.timestamp)})]})}function p$e(){const t=$(y=>y.previewChat),a=$(y=>y.previewState),n=$(y=>y.iteratePreview),s=$(y=>y.previewIterating),[o,c]=g.useState(""),l=g.useRef(null),A=g.useRef(null),u=g.useRef(!0);g.useEffect(()=>{const y=l.current;if(!y)return;function v(){u.current=y.scrollHeight-y.scrollTop-y.clientHeight<50}return y.addEventListener("scroll",v),()=>y.removeEventListener("scroll",v)},[]),g.useEffect(()=>{u.current&&l.current&&(l.current.scrollTop=l.current.scrollHeight)},[t==null?void 0:t.length]);const f=g.useCallback(()=>{const y=A.current;y&&(y.style.height="auto",y.style.height=Math.min(y.scrollHeight,160)+"px")},[]);g.useEffect(()=>{f()},[o,f]);function x(){const y=o.trim();!y||s||(n(y),c(""),A.current&&(A.current.style.height="auto"))}function m(y){y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),x())}return e.jsxs("div",{className:"flex flex-col h-full bg-surface-0",children:[e.jsx("div",{className:"flex-shrink-0 h-10 flex items-center px-4 border-b border-border bg-surface-3",children:e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"Iterate"})}),e.jsx("div",{className:"flex-shrink-0 px-4 py-2 bg-accent/5 border-b border-accent/10",children:e.jsxs("p",{className:"text-2xs text-accent font-sans",children:["Iterating on ",e.jsx("span",{className:"font-semibold",children:a.teamId||"project"})," — changes auto-refresh via hot reload"]})}),e.jsxs("div",{ref:l,className:"flex-1 overflow-y-auto px-4 py-4 space-y-4",children:[t.length===0&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"max-w-xs w-full px-5 py-5 bg-surface-1 border border-border-subtle rounded-xl text-center",children:[e.jsx(Yn,{size:24,className:"mx-auto text-accent mb-3"}),e.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans mb-3",children:"Preview is live!"}),e.jsxs("ul",{className:"text-left space-y-2 text-2xs text-text-2 font-sans",children:[e.jsxs("li",{className:"flex gap-2",children:[e.jsx(Xa,{size:11,className:"text-text-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Type a message to request changes — your feedback goes to the team planner who routes it to the right agent"})]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx(au,{size:11,className:"text-text-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Use the camera icon to screenshot a specific area and annotate it"})]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx(ra,{size:11,className:"text-text-3 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"Changes auto-refresh via hot module reload"})]})]})]})}),t.map((y,v)=>e.jsx(h$e,{msg:y},v)),s&&e.jsx("div",{className:"max-w-[85%] animate-chat-fade-in",children:e.jsx("div",{className:"rounded-2xl rounded-tl-md bg-surface-1/80 border border-border-subtle px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{size:14,className:"text-accent animate-spin"}),e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Routing to planner..."})]})})})]}),e.jsx("div",{className:"flex-shrink-0 px-3 py-3 border-t border-border",children:e.jsxs("div",{className:"flex items-end gap-2 rounded-2xl bg-surface-1/80 border border-accent/8 px-3 py-2",children:[e.jsx("textarea",{ref:A,value:o,onChange:y=>c(y.target.value),onKeyDown:m,placeholder:"Describe changes...",rows:1,style:{minHeight:"36px"},className:"flex-1 resize-none bg-transparent text-sm text-text-0 font-sans placeholder:text-text-4 focus:outline-none py-1.5"}),e.jsx("button",{onClick:x,disabled:!o.trim()||s,className:V("w-9 h-9 flex items-center justify-center rounded-xl transition-all cursor-pointer flex-shrink-0","disabled:opacity-20 disabled:cursor-not-allowed",o.trim()&&!s?"bg-accent/15 text-accent hover:bg-accent/25 border border-accent/25":"bg-surface-4 text-text-4"),children:e.jsx(Xa,{size:16})})]})})]})}function f$e(){return e.jsx("div",{className:"flex-1 flex items-center justify-center bg-surface-0",children:e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx(Q0,{size:40,className:"mx-auto text-text-4"}),e.jsx("h2",{className:"text-lg font-semibold text-text-1 font-sans",children:"No preview active"}),e.jsx("p",{className:"text-sm text-text-3 font-sans max-w-xs",children:"Build a project with a planner team to see it here."})]})})}const x$e={desktop:"100%",tablet:"768px",mobile:"375px"};function KW({embedded:t=!1}){const a=$(f=>f.previewState),n=g.useRef(null),[s,o]=g.useState(0),c=g.useCallback(()=>{o(f=>f+1)},[]);if(!a.url)return e.jsx(f$e,{});const l=a.teamId?`/api/preview/${a.teamId}/proxy/`:a.url,A=x$e[a.deviceSize]||"100%",u=a.deviceSize==="desktop";return e.jsxs("div",{className:"flex flex-col h-full bg-surface-0 md:flex-row",children:[e.jsxs("div",{className:"flex flex-col flex-[3] min-w-0 min-h-0",children:[e.jsx(PQe,{onRefresh:c}),e.jsxs("div",{className:"flex-1 relative overflow-hidden bg-surface-1",children:[a.screenshotMode&&e.jsx(d$e,{iframeRef:n}),e.jsx("div",{className:V("h-full transition-all duration-200",u?"w-full":"mx-auto"),style:u?void 0:{width:A,maxWidth:"100%"},children:e.jsx("iframe",{ref:n,src:l,title:"Preview",className:"w-full h-full border-0 bg-white",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"},s)})]})]}),!t&&e.jsx("div",{className:"flex-[2] min-w-[280px] max-w-[480px] border-l border-border md:max-w-none md:flex-[2]",children:e.jsx(p$e,{})})]})}var m$e=g.createContext(void 0);function m2(t){const a=g.useContext(m$e);return t||a||"ltr"}function tE(t,[a,n]){return Math.min(n,Math.max(a,t))}function g$e(t,a){return g.useReducer((n,s)=>a[n][s]??n,t)}var rz="ScrollArea",[YW]=tr(rz),[y$e,ns]=YW(rz),JW=g.forwardRef((t,a)=>{const{__scopeScrollArea:n,type:s="hover",dir:o,scrollHideDelay:c=600,...l}=t,[A,u]=g.useState(null),[f,x]=g.useState(null),[m,y]=g.useState(null),[v,O]=g.useState(null),[b,C]=g.useState(null),[j,N]=g.useState(0),[M,Q]=g.useState(0),[L,B]=g.useState(!1),[S,I]=g.useState(!1),z=rt(a,F=>u(F)),P=m2(o);return e.jsx(y$e,{scope:n,type:s,dir:P,scrollHideDelay:c,scrollArea:A,viewport:f,onViewportChange:x,content:m,onContentChange:y,scrollbarX:v,onScrollbarXChange:O,scrollbarXEnabled:L,onScrollbarXEnabledChange:B,scrollbarY:b,onScrollbarYChange:C,scrollbarYEnabled:S,onScrollbarYEnabledChange:I,onCornerWidthChange:N,onCornerHeightChange:Q,children:e.jsx(Ve.div,{dir:P,...l,ref:z,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":M+"px",...t.style}})})});JW.displayName=rz;var eK="ScrollAreaViewport",tK=g.forwardRef((t,a)=>{const{__scopeScrollArea:n,children:s,nonce:o,...c}=t,l=ns(eK,n),A=g.useRef(null),u=rt(a,A,l.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),e.jsx(Ve.div,{"data-radix-scroll-area-viewport":"",...c,ref:u,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});tK.displayName=eK;var rr="ScrollAreaScrollbar",aK=g.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=ns(rr,t.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:l}=o,A=t.orientation==="horizontal";return g.useEffect(()=>(A?c(!0):l(!0),()=>{A?c(!1):l(!1)}),[A,c,l]),o.type==="hover"?e.jsx(v$e,{...s,ref:a,forceMount:n}):o.type==="scroll"?e.jsx(k$e,{...s,ref:a,forceMount:n}):o.type==="auto"?e.jsx(nK,{...s,ref:a,forceMount:n}):o.type==="always"?e.jsx(oz,{...s,ref:a}):null});aK.displayName=rr;var v$e=g.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=ns(rr,t.__scopeScrollArea),[c,l]=g.useState(!1);return g.useEffect(()=>{const A=o.scrollArea;let u=0;if(A){const f=()=>{window.clearTimeout(u),l(!0)},x=()=>{u=window.setTimeout(()=>l(!1),o.scrollHideDelay)};return A.addEventListener("pointerenter",f),A.addEventListener("pointerleave",x),()=>{window.clearTimeout(u),A.removeEventListener("pointerenter",f),A.removeEventListener("pointerleave",x)}}},[o.scrollArea,o.scrollHideDelay]),e.jsx(Za,{present:n||c,children:e.jsx(nK,{"data-state":c?"visible":"hidden",...s,ref:a})})}),k$e=g.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=ns(rr,t.__scopeScrollArea),c=t.orientation==="horizontal",l=LT(()=>u("SCROLL_END"),100),[A,u]=g$e("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(A==="idle"){const f=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[A,o.scrollHideDelay,u]),g.useEffect(()=>{const f=o.viewport,x=c?"scrollLeft":"scrollTop";if(f){let m=f[x];const y=()=>{const v=f[x];m!==v&&(u("SCROLL"),l()),m=v};return f.addEventListener("scroll",y),()=>f.removeEventListener("scroll",y)}},[o.viewport,c,u,l]),e.jsx(Za,{present:n||A!=="hidden",children:e.jsx(oz,{"data-state":A==="hidden"?"hidden":"visible",...s,ref:a,onPointerEnter:Se(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Se(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),nK=g.forwardRef((t,a)=>{const n=ns(rr,t.__scopeScrollArea),{forceMount:s,...o}=t,[c,l]=g.useState(!1),A=t.orientation==="horizontal",u=LT(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,x=n.viewport.offsetHeight<n.viewport.scrollHeight;l(A?f:x)}},10);return Tu(n.viewport,u),Tu(n.content,u),e.jsx(Za,{present:s||c,children:e.jsx(oz,{"data-state":c?"visible":"hidden",...o,ref:a})})}),oz=g.forwardRef((t,a)=>{const{orientation:n="vertical",...s}=t,o=ns(rr,t.__scopeScrollArea),c=g.useRef(null),l=g.useRef(0),[A,u]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=cK(A.viewport,A.content),x={...s,sizes:A,onSizesChange:u,hasThumb:f>0&&f<1,onThumbChange:y=>c.current=y,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:y=>l.current=y};function m(y,v){return N$e(y,l.current,A,v)}return n==="horizontal"?e.jsx(O$e,{...x,ref:a,onThumbPositionChange:()=>{if(o.viewport&&c.current){const y=o.viewport.scrollLeft,v=NV(y,A,o.dir);c.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollLeft=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollLeft=m(y,o.dir))}}):n==="vertical"?e.jsx(b$e,{...x,ref:a,onThumbPositionChange:()=>{if(o.viewport&&c.current){const y=o.viewport.scrollTop,v=NV(y,A);c.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:y=>{o.viewport&&(o.viewport.scrollTop=y)},onDragScroll:y=>{o.viewport&&(o.viewport.scrollTop=m(y))}}):null}),O$e=g.forwardRef((t,a)=>{const{sizes:n,onSizesChange:s,...o}=t,c=ns(rr,t.__scopeScrollArea),[l,A]=g.useState(),u=g.useRef(null),f=rt(a,u,c.onScrollbarXChange);return g.useEffect(()=>{u.current&&A(getComputedStyle(u.current))},[u]),e.jsx(rK,{"data-orientation":"horizontal",...o,ref:f,sizes:n,style:{bottom:0,left:c.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:c.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":_T(n)+"px",...t.style},onThumbPointerDown:x=>t.onThumbPointerDown(x.x),onDragScroll:x=>t.onDragScroll(x.x),onWheelScroll:(x,m)=>{if(c.viewport){const y=c.viewport.scrollLeft+x.deltaX;t.onWheelScroll(y),dK(y,m)&&x.preventDefault()}},onResize:()=>{u.current&&c.viewport&&l&&s({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:XL(l.paddingLeft),paddingEnd:XL(l.paddingRight)}})}})}),b$e=g.forwardRef((t,a)=>{const{sizes:n,onSizesChange:s,...o}=t,c=ns(rr,t.__scopeScrollArea),[l,A]=g.useState(),u=g.useRef(null),f=rt(a,u,c.onScrollbarYChange);return g.useEffect(()=>{u.current&&A(getComputedStyle(u.current))},[u]),e.jsx(rK,{"data-orientation":"vertical",...o,ref:f,sizes:n,style:{top:0,right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":_T(n)+"px",...t.style},onThumbPointerDown:x=>t.onThumbPointerDown(x.y),onDragScroll:x=>t.onDragScroll(x.y),onWheelScroll:(x,m)=>{if(c.viewport){const y=c.viewport.scrollTop+x.deltaY;t.onWheelScroll(y),dK(y,m)&&x.preventDefault()}},onResize:()=>{u.current&&c.viewport&&l&&s({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:XL(l.paddingTop),paddingEnd:XL(l.paddingBottom)}})}})}),[w$e,sK]=YW(rr),rK=g.forwardRef((t,a)=>{const{__scopeScrollArea:n,sizes:s,hasThumb:o,onThumbChange:c,onThumbPointerUp:l,onThumbPointerDown:A,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:x,onResize:m,...y}=t,v=ns(rr,n),[O,b]=g.useState(null),C=rt(a,z=>b(z)),j=g.useRef(null),N=g.useRef(""),M=v.viewport,Q=s.content-s.viewport,L=xa(x),B=xa(u),S=LT(m,10);function I(z){if(j.current){const P=z.clientX-j.current.left,F=z.clientY-j.current.top;f({x:P,y:F})}}return g.useEffect(()=>{const z=P=>{const F=P.target;(O==null?void 0:O.contains(F))&&L(P,Q)};return document.addEventListener("wheel",z,{passive:!1}),()=>document.removeEventListener("wheel",z,{passive:!1})},[M,O,Q,L]),g.useEffect(B,[s,B]),Tu(O,S),Tu(v.content,S),e.jsx(w$e,{scope:n,scrollbar:O,hasThumb:o,onThumbChange:xa(c),onThumbPointerUp:xa(l),onThumbPositionChange:B,onThumbPointerDown:xa(A),children:e.jsx(Ve.div,{...y,ref:C,style:{position:"absolute",...y.style},onPointerDown:Se(t.onPointerDown,z=>{z.button===0&&(z.target.setPointerCapture(z.pointerId),j.current=O.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),I(z))}),onPointerMove:Se(t.onPointerMove,I),onPointerUp:Se(t.onPointerUp,z=>{const P=z.target;P.hasPointerCapture(z.pointerId)&&P.releasePointerCapture(z.pointerId),document.body.style.webkitUserSelect=N.current,v.viewport&&(v.viewport.style.scrollBehavior=""),j.current=null})})})}),VL="ScrollAreaThumb",oK=g.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=sK(VL,t.__scopeScrollArea);return e.jsx(Za,{present:n||o.hasThumb,children:e.jsx(j$e,{ref:a,...s})})}),j$e=g.forwardRef((t,a)=>{const{__scopeScrollArea:n,style:s,...o}=t,c=ns(VL,n),l=sK(VL,n),{onThumbPositionChange:A}=l,u=rt(a,m=>l.onThumbChange(m)),f=g.useRef(void 0),x=LT(()=>{f.current&&(f.current(),f.current=void 0)},100);return g.useEffect(()=>{const m=c.viewport;if(m){const y=()=>{if(x(),!f.current){const v=M$e(m,A);f.current=v,A()}};return A(),m.addEventListener("scroll",y),()=>m.removeEventListener("scroll",y)}},[c.viewport,x,A]),e.jsx(Ve.div,{"data-state":l.hasThumb?"visible":"hidden",...o,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:Se(t.onPointerDownCapture,m=>{const v=m.target.getBoundingClientRect(),O=m.clientX-v.left,b=m.clientY-v.top;l.onThumbPointerDown({x:O,y:b})}),onPointerUp:Se(t.onPointerUp,l.onThumbPointerUp)})});oK.displayName=VL;var iz="ScrollAreaCorner",iK=g.forwardRef((t,a)=>{const n=ns(iz,t.__scopeScrollArea),s=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&s?e.jsx(C$e,{...t,ref:a}):null});iK.displayName=iz;var C$e=g.forwardRef((t,a)=>{const{__scopeScrollArea:n,...s}=t,o=ns(iz,n),[c,l]=g.useState(0),[A,u]=g.useState(0),f=!!(c&&A);return Tu(o.scrollbarX,()=>{var m;const x=((m=o.scrollbarX)==null?void 0:m.offsetHeight)||0;o.onCornerHeightChange(x),u(x)}),Tu(o.scrollbarY,()=>{var m;const x=((m=o.scrollbarY)==null?void 0:m.offsetWidth)||0;o.onCornerWidthChange(x),l(x)}),f?e.jsx(Ve.div,{...s,ref:a,style:{width:c,height:A,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function XL(t){return t?parseInt(t,10):0}function cK(t,a){const n=t/a;return isNaN(n)?0:n}function _T(t){const a=cK(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=(t.scrollbar.size-n)*a;return Math.max(s,18)}function N$e(t,a,n,s="ltr"){const o=_T(n),c=o/2,l=a||c,A=o-l,u=n.scrollbar.paddingStart+l,f=n.scrollbar.size-n.scrollbar.paddingEnd-A,x=n.content-n.viewport,m=s==="ltr"?[0,x]:[x*-1,0];return lK([u,f],m)(t)}function NV(t,a,n="ltr"){const s=_T(a),o=a.scrollbar.paddingStart+a.scrollbar.paddingEnd,c=a.scrollbar.size-o,l=a.content-a.viewport,A=c-s,u=n==="ltr"?[0,l]:[l*-1,0],f=tE(t,u);return lK([0,l],[0,A])(f)}function lK(t,a){return n=>{if(t[0]===t[1]||a[0]===a[1])return a[0];const s=(a[1]-a[0])/(t[1]-t[0]);return a[0]+s*(n-t[0])}}function dK(t,a){return t>0&&t<a}var M$e=(t,a=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},s=0;return(function o(){const c={left:t.scrollLeft,top:t.scrollTop},l=n.left!==c.left,A=n.top!==c.top;(l||A)&&a(),n=c,s=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(s)};function LT(t,a){const n=xa(t),s=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(s.current),[]),g.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(n,a)},[n,a])}function Tu(t,a){const n=xa(a);Ta(()=>{let s=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(n)});return o.observe(t),()=>{window.cancelAnimationFrame(s),o.unobserve(t)}}},[t,n])}var S$e=JW,Q$e=tK,MV=aK,SV=oK,B$e=iK;function it({children:t,className:a,...n}){return e.jsxs(S$e,{className:V("overflow-hidden",a),...n,children:[e.jsx(Q$e,{className:"h-full w-full rounded-[inherit]",children:t}),e.jsx(MV,{orientation:"vertical",className:"flex touch-none select-none p-0.5 transition-colors w-2",children:e.jsx(SV,{className:"relative flex-1 rounded-full bg-surface-5 hover:bg-surface-6"})}),e.jsx(MV,{orientation:"horizontal",className:"flex touch-none select-none flex-col p-0.5 transition-colors h-2",children:e.jsx(SV,{className:"relative flex-1 rounded-full bg-surface-5 hover:bg-surface-6"})}),e.jsx(B$e,{})]})}const _$e={js:"text-text-2",jsx:"text-text-2",ts:"text-text-2",tsx:"text-text-2",css:"text-text-3",html:"text-text-3",json:"text-text-3",md:"text-text-3",py:"text-text-2",rs:"text-text-3",go:"text-text-2",sh:"text-text-3",yaml:"text-text-3",yml:"text-text-3",sql:"text-text-3",xml:"text-text-3",svg:"text-text-3"};function L$e(t){var n;const a=(n=t.split(".").pop())==null?void 0:n.toLowerCase();return _$e[a]||"text-text-3"}function QV({defaultValue:t="",placeholder:a,onSubmit:n,onCancel:s,depth:o=0}){const[c,l]=g.useState(t),A=g.useRef(null);g.useEffect(()=>{var f,x;(f=A.current)==null||f.focus(),t&&((x=A.current)==null||x.select())},[t]);function u(f){if(f.key==="Enter"){const x=c.trim();x&&n(x)}f.key==="Escape"&&s()}return e.jsx("div",{className:"flex items-center py-0.5",style:{paddingLeft:o*16+8},children:e.jsx("input",{ref:A,value:c,onChange:f=>l(f.target.value),onKeyDown:u,onBlur:s,placeholder:a,className:"w-full h-5 px-1.5 text-xs bg-surface-0 border border-accent rounded text-text-0 font-sans focus:outline-none"})})}function T$e({x:t,y:a,items:n,onClose:s}){const o=g.useRef(null);return g.useEffect(()=>{function c(l){o.current&&!o.current.contains(l.target)&&s()}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[s]),e.jsx("div",{ref:o,className:"fixed z-50 min-w-[160px] py-1 bg-surface-2 border border-border rounded-lg shadow-xl",style:{left:t,top:a},children:n.map((c,l)=>c.separator?e.jsx("div",{className:"h-px bg-border-subtle my-1"},l):e.jsxs("button",{onClick:()=>{c.action(),s()},className:V("w-full flex items-center gap-2.5 px-3 py-1.5 text-xs font-sans text-left cursor-pointer transition-colors",c.danger?"text-danger hover:bg-danger/10":"text-text-1 hover:bg-surface-5"),children:[c.icon&&e.jsx(c.icon,{size:12,className:c.danger?"text-danger":"text-text-3"}),c.label]},l))})}function AK({entry:t,depth:a,onOpen:n,expandedDirs:s,onToggleDir:o,onContextMenu:c,dragState:l,onDragStartEntry:A,onDragEndEntry:u,onSetDragOver:f,onDropOnDir:x}){var j;const m=t.type==="dir",y=s.has(t.path),v=m?"text-accent":L$e(t.name),O=(l==null?void 0:l.draggingPath)===t.path,b=m&&(l==null?void 0:l.dragOverPath)===t.path;function C(N){N.preventDefault(),N.stopPropagation(),c==null||c(N,t)}return e.jsxs(e.Fragment,{children:[e.jsxs("button",{draggable:!0,onDragStart:N=>{N.dataTransfer.setData("application/json",JSON.stringify({path:t.path,name:t.name,type:t.type})),N.dataTransfer.effectAllowed="move",A(t.path)},onDragEnd:u,onDragOver:m?N=>{N.preventDefault(),N.stopPropagation(),f(t.path)}:void 0,onDrop:m?N=>x(t.path,N):void 0,onClick:()=>m?o(t.path):n(t.path),onDoubleClick:C,onContextMenu:C,className:V("w-full flex items-center gap-1.5 py-[3px] text-xs font-sans cursor-pointer","hover:bg-surface-4/50 transition-colors text-left",O&&"opacity-50",b&&"bg-accent/15 ring-1 ring-accent/50 rounded"),style:{paddingLeft:a*14+8},children:[m?e.jsxs(e.Fragment,{children:[y?e.jsx(bt,{size:12,className:"text-text-4 flex-shrink-0"}):e.jsx(Rt,{size:12,className:"text-text-4 flex-shrink-0"}),y?e.jsx(ga,{size:13,className:V(v,"flex-shrink-0")}):e.jsx(Ko,{size:13,className:V(v,"flex-shrink-0")})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-3 flex-shrink-0"}),e.jsx(iu,{size:13,className:V(v,"flex-shrink-0")})]}),e.jsx("span",{className:"truncate text-text-1",children:t.name})]}),m&&y&&((j=t.children)==null?void 0:j.map(N=>e.jsx(AK,{entry:N,depth:a+1,onOpen:n,expandedDirs:s,onToggleDir:o,onContextMenu:c,dragState:l,onDragStartEntry:A,onDragEndEntry:u,onSetDragOver:f,onDropOnDir:x},N.path)))]})}function $$e({agentId:t,onCollapse:a}){const n=$(ee=>ee.agents),s=$(ee=>ee.openFile),o=$(ee=>ee.editorActiveFile),c=$(ee=>ee.createFile),l=$(ee=>ee.addToast);$(ee=>ee.fetchTreeDir);const A=n.find(ee=>ee.id===t),u=(A==null?void 0:A.scope)||[],f=(A==null?void 0:A.workingDir)||"",x=(A==null?void 0:A.status)==="running"||(A==null?void 0:A.status)==="starting",[m,y]=g.useState([]),[v,O]=g.useState(new Set),[b,C]=g.useState(!0),[j,N]=g.useState([]),[M,Q]=g.useState(null),[L,B]=g.useState(null),[S,I]=g.useState({draggingPath:null,dragOverPath:null}),z=g.useRef(new Set);g.useEffect(()=>{let ee=!1;async function ke(){try{const Ne=await D.get(`/agents/${encodeURIComponent(t)}/files-touched`);!ee&&Ne.files&&N(Ne.files)}catch{}}ke();const ye=x?setInterval(ke,5e3):null;return()=>{ee=!0,ye&&clearInterval(ye)}},[t,x]);const P=g.useCallback(async ee=>{if(!z.current.has(ee)){z.current.add(ee);try{return(await D.get(`/files/tree?path=${encodeURIComponent(ee)}`)).entries||[]}catch{return[]}}},[]);g.useEffect(()=>{let ee=!1;async function ke(){if(C(!0),z.current=new Set,u.length===0){const ze=await P("");ee||y(ze),C(!1);return}const ye=new Set;for(const ze of u){const He=ze.split("/");let Tt="";for(let Et=0;Et<He.length&&!He[Et].includes("*");Et++)Tt=Tt?`${Tt}/${He[Et]}`:He[Et];Tt&&ye.add(Tt)}if(ye.size===0){const ze=await P("");ee||y(ze),C(!1);return}const Ne=[];for(const ze of ye){const He=await P(ze);He.length>0&&Ne.push({name:ze.split("/").pop(),path:ze,type:"dir",children:He})}ee||y(Ne),C(!1)}return ke(),()=>{ee=!0}},[t,u.join(","),P]);async function F(ee){const ke=new Set(v);if(ke.has(ee))ke.delete(ee);else{ke.add(ee);const ye=await P(ee);y(Ne=>uK(Ne,ee,ye))}O(ke)}function K(ee){s(ee)}function G(){Q({type:"file",onSubmit:async ee=>{Q(null),await(c==null?void 0:c(ee))},onCancel:()=>Q(null)})}function H(){Q({type:"folder",onSubmit:async ee=>{Q(null);try{await D.post("/files/mkdir",{path:ee}),l("success",`Created ${ee}/`),q()}catch(ke){l("error","Create folder failed",ke.message)}},onCancel:()=>Q(null)})}function q(){z.current=new Set,O(new Set),C(!0),P("").then(ee=>{y(ee||[]),C(!1)})}function _(){O(new Set)}function R(ee){I({draggingPath:ee,dragOverPath:null})}function U(){I({draggingPath:null,dragOverPath:null})}function Z(ee){I(ke=>ke.dragOverPath===ee?ke:{...ke,dragOverPath:ee})}async function J(ee,ke){ke.preventDefault(),ke.stopPropagation(),I({draggingPath:null,dragOverPath:null});let ye;try{ye=JSON.parse(ke.dataTransfer.getData("application/json"))}catch{return}if(!(ye!=null&&ye.path))return;if(ye.type==="dir"&&(ee===ye.path||ee.startsWith(ye.path+"/"))){l("error","Cannot move a folder into itself");return}if(W(ye.path)===ee)return;const ze=ee?`${ee}/${ye.name}`:ye.name;try{await D.post("/files/rename",{oldPath:ye.path,newPath:ze}),l("success",`Moved ${ye.name} to ${ee||"/"}`),q()}catch(He){l("error","Move failed",He.message)}}function Ae(ee){return!ee||!ee.startsWith("/")?ee:f&&ee.startsWith(f+"/")?ee.slice(f.length+1):ee}function W(ee){const ke=ee.split("/");return ke.pop(),ke.join("/")}function ae(ee,ke){var ye;(ye=ee.preventDefault)==null||ye.call(ee),B({x:ee.clientX,y:ee.clientY,entry:ke})}function Oe(ee){O(ke=>new Set([...ke,ee])),Q({type:"file",parentPath:ee,onSubmit:async ke=>{const ye=ee?`${ee}/${ke}`:ke;try{await D.post("/files/create",{path:ye,content:""}),l("success",`Created ${ke}`),q(),s(ye)}catch(Ne){l("error","Create failed",Ne.message)}Q(null)},onCancel:()=>Q(null)})}function ve(ee){O(ke=>new Set([...ke,ee])),Q({type:"folder",parentPath:ee,onSubmit:async ke=>{const ye=ee?`${ee}/${ke}`:ke;try{await D.post("/files/mkdir",{path:ye}),l("success",`Created ${ke}/`),q()}catch(Ne){l("error","Create folder failed",Ne.message)}Q(null)},onCancel:()=>Q(null)})}function ce(ee){Q({type:"rename",renamePath:ee.path,defaultValue:ee.name,onSubmit:async ke=>{const ye=W(ee.path),Ne=ye?`${ye}/${ke}`:ke;try{await D.post("/files/rename",{oldPath:ee.path,newPath:Ne}),l("success",`Renamed to ${ke}`),q()}catch(ze){l("error","Rename failed",ze.message)}Q(null)},onCancel:()=>Q(null)})}async function he(ee){const ke=ee.type==="dir"?`folder "${ee.name}" and all contents`:`"${ee.name}"`;if(window.confirm(`Delete ${ke}?`))try{await D.delete(`/files/delete?path=${encodeURIComponent(ee.path)}`),l("success",`Deleted ${ee.name}`),q()}catch(ye){l("error","Delete failed",ye.message)}}function je(ee){const ke=ee.type==="dir",ye=[];return ke&&(ye.push({icon:Hr,label:"New File",action:()=>Oe(ee.path)}),ye.push({icon:qr,label:"New Folder",action:()=>ve(ee.path)}),ye.push({separator:!0})),ye.push({icon:js,label:"Rename",action:()=>ce(ee)}),ye.push({icon:At,label:"Delete",danger:!0,action:()=>he(ee)}),ye}return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-0.5 px-2 py-1.5 border-b border-border-subtle flex-shrink-0",children:[e.jsx("span",{className:"flex-1 text-2xs font-semibold text-text-3 uppercase tracking-wider px-1",children:"Files"}),e.jsx("button",{onClick:G,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"New file",children:e.jsx(Hr,{size:12})}),e.jsx("button",{onClick:H,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"New folder",children:e.jsx(qr,{size:12})}),e.jsx("button",{onClick:q,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Refresh",children:e.jsx(ra,{size:12})}),e.jsx("button",{onClick:_,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Collapse all",children:e.jsx(ru,{size:12})}),a&&e.jsx("button",{onClick:a,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Collapse sidebar",children:e.jsx(fs,{size:12})})]}),e.jsx(it,{className:"flex-1 min-h-0",children:e.jsxs("div",{className:"py-2",children:[M&&e.jsx(QV,{placeholder:M.type==="file"?"filename.ext":"folder-name",onSubmit:M.onSubmit,onCancel:M.onCancel,depth:0}),j.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 text-2xs font-semibold text-text-3 uppercase tracking-wider",children:[e.jsx(ps,{size:10}),"Agent Files"]}),j.slice(0,15).map(ee=>{const ke=Ae(ee.path),ye=ke.split("/").pop(),Ne=ee.writes>0;return e.jsxs("button",{onClick:()=>s(ke),onContextMenu:ze=>{ze.preventDefault(),ze.stopPropagation(),ae(ze,{path:ke,name:ye,type:"file"})},onDoubleClick:ze=>{ze.preventDefault(),ze.stopPropagation(),ae(ze,{path:ke,name:ye,type:"file"})},className:V("w-full flex items-center gap-1.5 px-3 py-1 text-xs font-sans cursor-pointer","hover:bg-surface-4/50 transition-colors text-left",(o===ee.path||o===ke)&&"bg-accent/8 text-accent"),children:[Ne?e.jsx(ps,{size:12,className:"text-warning flex-shrink-0"}):e.jsx(na,{size:12,className:"text-info flex-shrink-0"}),e.jsx("span",{className:"truncate text-text-1 flex-1",children:ye}),Ne&&e.jsxs("span",{className:"text-2xs text-warning/60 flex-shrink-0",children:[ee.writes,"w"]})]},ee.path)}),e.jsx("div",{className:"h-px bg-border-subtle mx-3 mt-2"})]}),b?e.jsx("div",{className:"flex items-center justify-center py-8 text-text-4 text-xs font-sans",children:"Loading..."}):m.length===0?e.jsx("div",{className:"flex items-center justify-center py-8 text-text-4 text-xs font-sans",children:"No files in scope"}):e.jsxs("div",{className:"px-1",onDragOver:ee=>{S.draggingPath&&(ee.preventDefault(),Z(null))},onDrop:ee=>J("",ee),children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 text-2xs font-semibold text-text-3 uppercase tracking-wider",children:[e.jsx(Ko,{size:10}),"Scope"]}),m.map(ee=>(M==null?void 0:M.renamePath)===ee.path?e.jsx(QV,{defaultValue:ee.name,onSubmit:M.onSubmit,onCancel:M.onCancel,depth:0},ee.path):e.jsx(AK,{entry:ee,depth:0,onOpen:K,expandedDirs:v,onToggleDir:F,onContextMenu:ae,dragState:S,onDragStartEntry:R,onDragEndEntry:U,onSetDragOver:Z,onDropOnDir:J},ee.path))]})]})}),L&&e.jsx(T$e,{x:L.x,y:L.y,items:je(L.entry),onClose:()=>B(null)})]})}function uK(t,a,n){return t.map(s=>s.path===a?{...s,children:n}:s.children?{...s,children:uK(s.children,a,n)}:s)}function I$e(t,a){const n=(t||"").split(`
8641
8641
  `),s=(a||"").split(`
8642
8642
  `),o=[],c=Math.max(n.length,s.length);let l=0,A=0;for(;l<n.length||A<s.length;)if(l>=n.length)o.push({type:"add",lineNum:A+1,text:s[A]}),A++;else if(A>=s.length)o.push({type:"del",lineNum:l+1,text:n[l]}),l++;else if(n[l]===s[A])o.push({type:"same",lineNum:A+1,origLineNum:l+1,text:s[A]}),l++,A++;else{let u=-1,f=-1;const x=Math.min(10,c);for(let m=1;m<=x;m++)if(A+m<s.length&&n[l]===s[A+m]){f=A+m;break}for(let m=1;m<=x;m++)if(l+m<n.length&&n[l+m]===s[A]){u=l+m;break}if(f>=0&&(u<0||f-A<=u-l))for(;A<f;)o.push({type:"add",lineNum:A+1,text:s[A]}),A++;else if(u>=0)for(;l<u;)o.push({type:"del",lineNum:l+1,text:n[l]}),l++;else o.push({type:"del",lineNum:l+1,text:n[l]}),o.push({type:"add",lineNum:A+1,text:s[A]}),l++,A++}return o}function hK({filePath:t}){const a=$(A=>A.editorFiles[t]),s=$(A=>A.workspaceSnapshots[t])||(a==null?void 0:a.originalContent)||"",o=(a==null?void 0:a.content)||"",c=g.useMemo(()=>I$e(s,o),[s,o]),l=g.useMemo(()=>{let A=0,u=0;for(const f of c)f.type==="add"&&A++,f.type==="del"&&u++;return{adds:A,dels:u}},[c]);return a?s===o?e.jsx("div",{className:"flex items-center justify-center h-full text-text-4 text-xs font-sans",children:"No changes detected"}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 bg-surface-1 border-b border-border-subtle text-xs font-sans flex-shrink-0",children:[e.jsx("span",{className:"text-text-2",children:t.split("/").pop()}),e.jsxs("span",{className:"text-success",children:["+",l.adds]}),e.jsxs("span",{className:"text-danger",children:["-",l.dels]})]}),e.jsx(it,{className:"flex-1",children:e.jsx("div",{className:"font-mono text-xs leading-5",children:c.map((A,u)=>e.jsxs("div",{className:V("flex",A.type==="add"&&"bg-success/8",A.type==="del"&&"bg-danger/8"),children:[e.jsx("span",{className:V("w-12 flex-shrink-0 text-right pr-3 select-none",A.type==="add"?"text-success/60":A.type==="del"?"text-danger/60":"text-text-4"),children:A.type==="add"?"":A.origLineNum||A.lineNum}),e.jsx("span",{className:V("w-12 flex-shrink-0 text-right pr-3 select-none",A.type==="add"?"text-success/60":A.type==="del"?"text-danger/60":"text-text-4"),children:A.type==="del"?"":A.lineNum}),e.jsx("span",{className:V("w-5 flex-shrink-0 text-center select-none font-bold",A.type==="add"?"text-success":A.type==="del"?"text-danger":"text-text-4"),children:A.type==="add"?"+":A.type==="del"?"-":" "}),e.jsx("span",{className:V("flex-1 whitespace-pre px-2",A.type==="add"?"text-success/90":A.type==="del"?"text-danger/90":"text-text-1"),children:A.text})]},u))})})]}):e.jsx("div",{className:"flex items-center justify-center h-full text-text-4 text-xs font-sans",children:"No file loaded"})}function U$e({agentId:t}){const a=$(Q=>Q.workspaceReviewFiles),n=$(Q=>Q.approveFile),s=$(Q=>Q.rejectFile),o=$(Q=>Q.commentFile),c=$(Q=>Q.instructAgent),l=$(Q=>Q.toggleReviewMode),A=$(Q=>Q.openFile),u=$(Q=>Q.setWorkspaceMode),[f,x]=g.useState(null),[m,y]=g.useState(null),[v,O]=g.useState(""),b=a.filter(Q=>Q.status==="approved").length,C=a.filter(Q=>Q.status==="rejected").length;function j(Q){v.trim()&&(o(Q,v.trim()),O(""),y(null))}function N(){for(const Q of a)n(Q.path)}async function M(){const Q=a.filter(L=>L.comment||L.status==="rejected").map(L=>`${L.status==="rejected"?"[REJECTED]":"[COMMENT]"} ${L.path}: ${L.comment||"Changes needed"}`);Q.length>0&&await c(t,`Code review feedback:
8643
8643
  ${Q.join(`
@@ -8660,7 +8660,7 @@ ${Q.join(`
8660
8660
  `);s=o<0?n:n.slice(0,o)}return a+s.length>this.to?s.slice(0,this.to-a):s}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(a,n,s=0){this.block=JL.create(a,s,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(a,n,s=0){this.startContext(this.parser.getNodeType(a),n,s)}addNode(a,n,s){typeof a=="number"&&(a=new ks(this.parser.nodeSet.types[a],Uu,Uu,(s??this.prevLineEnd())-n)),this.block.addChild(a,n-this.block.from)}addElement(a){this.block.addChild(a.toTree(this.parser.nodeSet),a.from-this.block.from)}addLeafElement(a,n){this.addNode(this.buffer.writeElements(dE(n.children,a.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let a=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(a.toTree(this.parser.nodeSet),a.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(a){return this.ranges.length>1?iY(this.ranges,0,a.topNode,this.ranges[0].from,this.reusePlaceholders):a}finishLeaf(a){for(let s of a.parsers)if(s.finish(this,a))return;let n=dE(this.parser.parseInline(a.content,a.start),a.marks);this.addNode(this.buffer.writeElements(n,-a.start).finish(we.Paragraph,a.content.length),a.start)}elt(a,n,s,o){return typeof a=="string"?ot(this.parser.getNodeType(a),n,s,o):new dY(a,n)}get buffer(){return new lY(this.parser.nodeSet)}}function iY(t,a,n,s,o){let c=t[a].to,l=[],A=[],u=n.from+s;function f(x,m){for(;m?x>=c:x>c;){let y=t[a+1].from-c;s+=y,x+=y,a++,c=t[a].to}}for(let x=n.firstChild;x;x=x.nextSibling){f(x.from+s,!0);let m=x.from+s,y,v=o.get(x.tree);v?y=v:x.to+s>c?(y=iY(t,a,x,s,o),f(x.to+s,!1)):y=x.toTree(),l.push(y),A.push(m-u)}return f(n.to+s,!1),new ks(n.type,l,A,n.to+s-u,n.tree?n.tree.propValues:void 0)}class TT extends KX{constructor(a,n,s,o,c,l,A,u,f){super(),this.nodeSet=a,this.blockParsers=n,this.leafBlockParsers=s,this.blockNames=o,this.endLeafBlock=c,this.skipContextMarkup=l,this.inlineParsers=A,this.inlineNames=u,this.wrappers=f,this.nodeTypes=Object.create(null);for(let x of a.types)this.nodeTypes[x.name]=x.id}createParse(a,n,s){let o=new pPe(this,a,n,s);for(let c of this.wrappers)o=c(o,a,n,s);return o}configure(a){let n=lE(a);if(!n)return this;let{nodeSet:s,skipContextMarkup:o}=this,c=this.blockParsers.slice(),l=this.leafBlockParsers.slice(),A=this.blockNames.slice(),u=this.inlineParsers.slice(),f=this.inlineNames.slice(),x=this.endLeafBlock.slice(),m=this.wrappers;if(Vh(n.defineNodes)){o=Object.assign({},o);let y=s.types.slice(),v;for(let O of n.defineNodes){let{name:b,block:C,composite:j,style:N}=typeof O=="string"?{name:O}:O;if(y.some(L=>L.name==b))continue;j&&(o[y.length]=(L,B,S)=>j(B,S,L.value));let M=y.length,Q=j?["Block","BlockContext"]:C?M>=we.ATXHeading1&&M<=we.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;y.push(c2.define({id:M,name:b,props:Q&&[[Kr.group,Q]]})),N&&(v||(v={}),Array.isArray(N)||N instanceof ene?v[b]=N:Object.assign(v,N))}s=new wE(y),v&&(s=s.extend(XA(v)))}if(Vh(n.props)&&(s=s.extend(...n.props)),Vh(n.remove))for(let y of n.remove){let v=this.blockNames.indexOf(y),O=this.inlineNames.indexOf(y);v>-1&&(c[v]=l[v]=void 0),O>-1&&(u[O]=void 0)}if(Vh(n.parseBlock))for(let y of n.parseBlock){let v=A.indexOf(y.name);if(v>-1)c[v]=y.parse,l[v]=y.leaf;else{let O=y.before?xf(A,y.before):y.after?xf(A,y.after)+1:A.length-1;c.splice(O,0,y.parse),l.splice(O,0,y.leaf),A.splice(O,0,y.name)}y.endLeaf&&x.push(y.endLeaf)}if(Vh(n.parseInline))for(let y of n.parseInline){let v=f.indexOf(y.name);if(v>-1)u[v]=y.parse;else{let O=y.before?xf(f,y.before):y.after?xf(f,y.after)+1:f.length-1;u.splice(O,0,y.parse),f.splice(O,0,y.name)}}return n.wrap&&(m=m.concat(n.wrap)),new TT(s,c,l,A,x,o,u,f,m)}getNodeType(a){let n=this.nodeTypes[a];if(n==null)throw new RangeError(`Unknown node type '${a}'`);return n}parseInline(a,n){let s=new mz(this,a,n);e:for(let o=n;o<s.end;){let c=s.char(o);for(let l of this.inlineParsers)if(l){let A=l(s,c,o);if(A>=0){o=A;continue e}}o++}return s.resolveMarkers(0)}}function Vh(t){return t!=null&&t.length>0}function lE(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let a=lE(t[0]);if(t.length==1)return a;let n=lE(t.slice(1));if(!n||!a)return a||n;let s=(l,A)=>(l||Uu).concat(A||Uu),o=a.wrap,c=n.wrap;return{props:s(a.props,n.props),defineNodes:s(a.defineNodes,n.defineNodes),parseBlock:s(a.parseBlock,n.parseBlock),parseInline:s(a.parseInline,n.parseInline),remove:s(a.remove,n.remove),wrap:o?c?(l,A,u,f)=>o(c(l,A,u,f),A,u,f):o:c}}function xf(t,a){let n=t.indexOf(a);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${a}`);return n}let cY=[c2.none];for(let t=1,a;a=we[t];t++)cY[t]=c2.define({id:t,name:a,props:t>=we.Escape?[]:[[Kr.group,t in KK?["Block","BlockContext"]:["Block","LeafBlock"]]],top:a=="Document"});const Uu=[];class lY{constructor(a){this.nodeSet=a,this.content=[],this.nodes=[]}write(a,n,s,o=0){return this.content.push(a,n,s,4+o*4),this}writeElements(a,n=0){for(let s of a)s.writeTo(this,n);return this}finish(a,n){return ks.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:a,length:n})}}let n2=class{constructor(a,n,s,o=Uu){this.type=a,this.from=n,this.to=s,this.children=o}writeTo(a,n){let s=a.content.length;a.writeElements(this.children,n),a.content.push(this.type,this.from+n,this.to+n,a.content.length+4-s)}toTree(a){return new lY(a).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class dY{constructor(a,n){this.tree=a,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Uu}writeTo(a,n){a.nodes.push(this.tree),a.content.push(a.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function ot(t,a,n,s){return new n2(t,a,n,s)}const AY={resolve:"Emphasis",mark:"EmphasisMark"},uY={resolve:"Emphasis",mark:"EmphasisMark"},bA={},eT={};class vn{constructor(a,n,s,o){this.type=a,this.from=n,this.to=s,this.side=o}}const iX="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let s2=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{s2=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const JU={Escape(t,a,n){if(a!=92||n==t.end-1)return-1;let s=t.char(n+1);for(let o=0;o<iX.length;o++)if(iX.charCodeAt(o)==s)return t.append(ot(we.Escape,n,n+2));return-1},Entity(t,a,n){if(a!=38)return-1;let s=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(n+1,n+31));return s?t.append(ot(we.Entity,n,n+1+s[0].length)):-1},InlineCode(t,a,n){if(a!=96||n&&t.char(n-1)==96)return-1;let s=n+1;for(;s<t.end&&t.char(s)==96;)s++;let o=s-n,c=0;for(;s<t.end;s++)if(t.char(s)==96){if(c++,c==o&&t.char(s+1)!=96)return t.append(ot(we.InlineCode,n,s+1,[ot(we.CodeMark,n,n+o),ot(we.CodeMark,s+1-o,s+1)]))}else c=0;return-1},HTMLTag(t,a,n){if(a!=60||n==t.end-1)return-1;let s=t.slice(n+1,t.end),o=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(s);if(o)return t.append(ot(we.Autolink,n,n+1+o[0].length,[ot(we.LinkMark,n,n+1),ot(we.URL,n+1,n+o[0].length),ot(we.LinkMark,n+o[0].length,n+1+o[0].length)]));let c=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(s);if(c)return t.append(ot(we.Comment,n,n+1+c[0].length));let l=/^\?[^]*?\?>/.exec(s);if(l)return t.append(ot(we.ProcessingInstruction,n,n+1+l[0].length));let A=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(s);return A?t.append(ot(we.HTMLTag,n,n+1+A[0].length)):-1},Emphasis(t,a,n){if(a!=95&&a!=42)return-1;let s=n+1;for(;t.char(s)==a;)s++;let o=t.slice(n-1,n),c=t.slice(s,s+1),l=s2.test(o),A=s2.test(c),u=/\s|^$/.test(o),f=/\s|^$/.test(c),x=!f&&(!A||u||l),m=!u&&(!l||f||A),y=x&&(a==42||!m||l),v=m&&(a==42||!x||A);return t.append(new vn(a==95?AY:uY,n,s,(y?1:0)|(v?2:0)))},HardBreak(t,a,n){if(a==92&&t.char(n+1)==10)return t.append(ot(we.HardBreak,n,n+2));if(a==32){let s=n+1;for(;t.char(s)==32;)s++;if(t.char(s)==10&&s>=n+2)return t.append(ot(we.HardBreak,n,s+1))}return-1},Link(t,a,n){return a==91?t.append(new vn(bA,n,n+1,1)):-1},Image(t,a,n){return a==33&&t.char(n+1)==91?t.append(new vn(eT,n,n+2,1)):-1},LinkEnd(t,a,n){if(a!=93)return-1;for(let s=t.parts.length-1;s>=0;s--){let o=t.parts[s];if(o instanceof vn&&(o.type==bA||o.type==eT)){if(!o.side||t.skipSpace(o.to)==n&&!/[(\[]/.test(t.slice(n+1,n+2)))return t.parts[s]=null,-1;let c=t.takeContent(s),l=t.parts[s]=fPe(t,c,o.type==bA?we.Link:we.Image,o.from,n+1);if(o.type==bA)for(let A=0;A<s;A++){let u=t.parts[A];u instanceof vn&&u.type==bA&&(u.side=0)}return l.to}}return-1}};function fPe(t,a,n,s,o){let{text:c}=t,l=t.char(o),A=o;if(a.unshift(ot(we.LinkMark,s,s+(n==we.Image?2:1))),a.push(ot(we.LinkMark,o-1,o)),l==40){let u=t.skipSpace(o+1),f=hY(c,u-t.offset,t.offset),x;f&&(u=t.skipSpace(f.to),u!=f.to&&(x=pY(c,u-t.offset,t.offset),x&&(u=t.skipSpace(x.to)))),t.char(u)==41&&(a.push(ot(we.LinkMark,o,o+1)),A=u+1,f&&a.push(f),x&&a.push(x),a.push(ot(we.LinkMark,u,A)))}else if(l==91){let u=fY(c,o-t.offset,t.offset,!1);u&&(a.push(u),A=u.to)}return ot(n,s,A,a)}function hY(t,a,n){if(t.charCodeAt(a)==60){for(let o=a+1;o<t.length;o++){let c=t.charCodeAt(o);if(c==62)return ot(we.URL,a+n,o+1+n);if(c==60||c==10)return!1}return null}else{let o=0,c=a;for(let l=!1;c<t.length;c++){let A=t.charCodeAt(c);if(ss(A))break;if(l)l=!1;else if(A==40)o++;else if(A==41){if(!o)break;o--}else A==92&&(l=!0)}return c>a?ot(we.URL,a+n,c+n):c==t.length?null:!1}}function pY(t,a,n){let s=t.charCodeAt(a);if(s!=39&&s!=34&&s!=40)return!1;let o=s==40?41:s;for(let c=a+1,l=!1;c<t.length;c++){let A=t.charCodeAt(c);if(l)l=!1;else{if(A==o)return ot(we.LinkTitle,a+n,c+1+n);A==92&&(l=!0)}}return null}function fY(t,a,n,s){for(let o=!1,c=a+1,l=Math.min(t.length,c+999);c<l;c++){let A=t.charCodeAt(c);if(o)o=!1;else{if(A==93)return s?!1:ot(we.LinkLabel,a+n,c+1+n);if(s&&!ss(A)&&(s=!1),A==91)return!1;A==92&&(o=!0)}}return null}class mz{constructor(a,n,s){this.parser=a,this.text=n,this.offset=s,this.parts=[]}char(a){return a>=this.end?-1:this.text.charCodeAt(a-this.offset)}get end(){return this.offset+this.text.length}slice(a,n){return this.text.slice(a-this.offset,n-this.offset)}append(a){return this.parts.push(a),a.to}addDelimiter(a,n,s,o,c){return this.append(new vn(a,n,s,(o?1:0)|(c?2:0)))}get hasOpenLink(){for(let a=this.parts.length-1;a>=0;a--){let n=this.parts[a];if(n instanceof vn&&(n.type==bA||n.type==eT))return!0}return!1}addElement(a){return this.append(a)}resolveMarkers(a){for(let s=a;s<this.parts.length;s++){let o=this.parts[s];if(!(o instanceof vn&&o.type.resolve&&o.side&2))continue;let c=o.type==AY||o.type==uY,l=o.to-o.from,A,u=s-1;for(;u>=a;u--){let b=this.parts[u];if(b instanceof vn&&b.side&1&&b.type==o.type&&!(c&&(o.side&1||b.side&2)&&(b.to-b.from+l)%3==0&&((b.to-b.from)%3||l%3))){A=b;break}}if(!A)continue;let f=o.type.resolve,x=[],m=A.from,y=o.to;if(c){let b=Math.min(2,A.to-A.from,l);m=A.to-b,y=o.from+b,f=b==1?"Emphasis":"StrongEmphasis"}A.type.mark&&x.push(this.elt(A.type.mark,m,A.to));for(let b=u+1;b<s;b++)this.parts[b]instanceof n2&&x.push(this.parts[b]),this.parts[b]=null;o.type.mark&&x.push(this.elt(o.type.mark,o.from,y));let v=this.elt(f,m,y,x);this.parts[u]=c&&A.from!=m?new vn(A.type,A.from,m,A.side):null,(this.parts[s]=c&&o.to!=y?new vn(o.type,y,o.to,o.side):null)?this.parts.splice(s,0,v):this.parts[s]=v}let n=[];for(let s=a;s<this.parts.length;s++){let o=this.parts[s];o instanceof n2&&n.push(o)}return n}findOpeningDelimiter(a){for(let n=this.parts.length-1;n>=0;n--){let s=this.parts[n];if(s instanceof vn&&s.type==a&&s.side&1)return n}return null}takeContent(a){let n=this.resolveMarkers(a);return this.parts.length=a,n}getDelimiterAt(a){let n=this.parts[a];return n instanceof vn?n:null}skipSpace(a){return X0(this.text,a-this.offset)+this.offset}elt(a,n,s,o){return typeof a=="string"?ot(this.parser.getNodeType(a),n,s,o):new dY(a,n)}}mz.linkStart=bA;mz.imageStart=eT;function dE(t,a){if(!a.length)return t;if(!t.length)return a;let n=t.slice(),s=0;for(let o of a){for(;s<n.length&&n[s].to<o.to;)s++;if(s<n.length&&n[s].from<o.from){let c=n[s];c instanceof n2&&(n[s]=new n2(c.type,c.from,c.to,dE(c.children,[o])))}else n.splice(s++,0,o)}return n}const xPe=[we.CodeBlock,we.ListItem,we.OrderedList,we.BulletList];class mPe{constructor(a,n){this.fragments=a,this.input=n,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,a.length&&(this.fragment=a[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(a,n){for(;this.fragment&&this.fragment.to<=a;)this.nextFragment();if(!this.fragment||this.fragment.from>(a?a-1:0))return!1;if(this.fragmentEnd<0){let c=this.fragment.to;for(;c>0&&this.input.read(c-1,c)!=`
8661
8661
  `;)c--;this.fragmentEnd=c?c-1:0}let s=this.cursor;s||(s=this.cursor=this.fragment.tree.cursor(),s.firstChild());let o=a+this.fragment.offset;for(;s.to<=o;)if(!s.parent())return!1;for(;;){if(s.from>=o)return this.fragment.from<=n;if(!s.childAfter(o))return!1}}matches(a){let n=this.cursor.tree;return n&&n.prop(Kr.contextHash)==a}takeNodes(a){let n=this.cursor,s=this.fragment.offset,o=this.fragmentEnd-(this.fragment.openEnd?1:0),c=a.absoluteLineStart,l=c,A=a.block.children.length,u=l,f=A;for(;;){if(n.to-s>o){if(n.type.isAnonymous&&n.firstChild())continue;break}let x=xY(n.from-s,a.ranges);if(n.to-s<=a.ranges[a.rangeI].to)a.addNode(n.tree,x);else{let m=new ks(a.parser.nodeSet.types[we.Paragraph],[],[],0,a.block.hashProp);a.reusePlaceholders.set(m,n.tree),a.addNode(m,x)}if(n.type.is("Block")&&(xPe.indexOf(n.type.id)<0?(l=n.to-s,A=a.block.children.length):(l=u,A=f),u=n.to-s,f=a.block.children.length),!n.nextSibling())break}for(;a.block.children.length>A;)a.block.children.pop(),a.block.positions.pop();return l-c}}function xY(t,a){let n=t;for(let s=1;s<a.length;s++){let o=a[s-1].to,c=a[s].from;o<t&&(n-=c-o)}return n}const gPe=XA({"Blockquote/...":X.quote,HorizontalRule:X.contentSeparator,"ATXHeading1/... SetextHeading1/...":X.heading1,"ATXHeading2/... SetextHeading2/...":X.heading2,"ATXHeading3/...":X.heading3,"ATXHeading4/...":X.heading4,"ATXHeading5/...":X.heading5,"ATXHeading6/...":X.heading6,"Comment CommentBlock":X.comment,Escape:X.escape,Entity:X.character,"Emphasis/...":X.emphasis,"StrongEmphasis/...":X.strong,"Link/... Image/...":X.link,"OrderedList/... BulletList/...":X.list,"BlockQuote/...":X.quote,"InlineCode CodeText":X.monospace,"URL Autolink":X.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":X.processingInstruction,"CodeInfo LinkLabel":X.labelName,LinkTitle:X.string,Paragraph:X.content}),yPe=new TT(new wE(cY).extend(gPe),Object.keys(ff).map(t=>ff[t]),Object.keys(ff).map(t=>oY[t]),Object.keys(ff),uPe,KK,Object.keys(JU).map(t=>JU[t]),Object.keys(JU),[]);function vPe(t,a,n){let s=[];for(let o=t.firstChild,c=a;;o=o.nextSibling){let l=o?o.from:n;if(l>c&&s.push({from:c,to:l}),!o)break;c=o.to}return s}function kPe(t){let{codeParser:a,htmlParser:n}=t;return{wrap:aZ((o,c)=>{let l=o.type.id;if(a&&(l==we.CodeBlock||l==we.FencedCode)){let A="";if(l==we.FencedCode){let f=o.node.getChild(we.CodeInfo);f&&(A=c.read(f.from,f.to))}let u=a(A);if(u)return{parser:u,overlay:f=>f.type.id==we.CodeText,bracketed:l==we.FencedCode}}else if(n&&(l==we.HTMLBlock||l==we.HTMLTag||l==we.CommentBlock))return{parser:n,overlay:vPe(o.node,o.from,o.to)};return null})}}const OPe={resolve:"Strikethrough",mark:"StrikethroughMark"},bPe={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":X.strikethrough}},{name:"StrikethroughMark",style:X.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,a,n){if(a!=126||t.char(n+1)!=126||t.char(n+2)==126)return-1;let s=t.slice(n-1,n),o=t.slice(n+2,n+3),c=/\s|^$/.test(s),l=/\s|^$/.test(o),A=s2.test(s),u=s2.test(o);return t.addDelimiter(OPe,n,n+2,!l&&(!u||c||A),!c&&(!A||l||u))},after:"Emphasis"}]};function Z0(t,a,n=0,s,o=0){let c=0,l=!0,A=-1,u=-1,f=!1,x=()=>{s.push(t.elt("TableCell",o+A,o+u,t.parser.parseInline(a.slice(A,u),o+A)))};for(let m=n;m<a.length;m++){let y=a.charCodeAt(m);y==124&&!f?((!l||A>-1)&&c++,l=!1,s&&(A>-1&&x(),s.push(t.elt("TableDelimiter",m+o,m+o+1))),A=u=-1):(f||y!=32&&y!=9)&&(A<0&&(A=m),u=m+1),f=!f&&y==92}return A>-1&&(c++,s&&x()),c}function cX(t,a){for(let n=a;n<t.length;n++){let s=t.charCodeAt(n);if(s==124)return!0;s==92&&n++}return!1}const mY=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class lX{constructor(){this.rows=null}nextLine(a,n,s){if(this.rows==null){this.rows=!1;let o;if((n.next==45||n.next==58||n.next==124)&&mY.test(o=n.text.slice(n.pos))){let c=[];Z0(a,s.content,0,c,s.start)==Z0(a,o,n.pos)&&(this.rows=[a.elt("TableHeader",s.start,s.start+s.content.length,c),a.elt("TableDelimiter",a.lineStart+n.pos,a.lineStart+n.text.length)])}}else if(this.rows){let o=[];Z0(a,n.text,n.pos,o,a.lineStart),this.rows.push(a.elt("TableRow",a.lineStart+n.pos,a.lineStart+n.text.length,o))}return!1}finish(a,n){return this.rows?(a.addLeafElement(n,a.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const wPe={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":X.heading}},"TableRow",{name:"TableCell",style:X.content},{name:"TableDelimiter",style:X.processingInstruction}],parseBlock:[{name:"Table",leaf(t,a){return cX(a.content,0)?new lX:null},endLeaf(t,a,n){if(n.parsers.some(o=>o instanceof lX)||!cX(a.text,a.basePos))return!1;let s=t.peekLine();return mY.test(s)&&Z0(t,a.text,a.basePos)==Z0(t,s,a.basePos)},before:"SetextHeading"}]};class jPe{nextLine(){return!1}finish(a,n){return a.addLeafElement(n,a.elt("Task",n.start,n.start+n.content.length,[a.elt("TaskMarker",n.start,n.start+3),...a.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const CPe={defineNodes:[{name:"Task",block:!0,style:X.list},{name:"TaskMarker",style:X.atom}],parseBlock:[{name:"TaskList",leaf(t,a){return/^\[[ xX]\][ \t]/.test(a.content)&&t.parentType().name=="ListItem"?new jPe:null},after:"SetextHeading"}]},dX=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,AX=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,NPe=/[\w-]+\.[\w-]+($|\/)/,uX=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,hX=/\/[a-zA-Z\d@.]+/gy;function pX(t,a,n,s){let o=0;for(let c=a;c<n;c++)t[c]==s&&o++;return o}function MPe(t,a){AX.lastIndex=a;let n=AX.exec(t);if(!n||NPe.exec(n[0])[0].indexOf("_")>-1)return-1;let s=a+n[0].length;for(;;){let o=t[s-1],c;if(/[?!.,:*_~]/.test(o)||o==")"&&pX(t,a,s,")")>pX(t,a,s,"("))s--;else if(o==";"&&(c=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(a,s))))s=a+c.index;else break}return s}function fX(t,a){uX.lastIndex=a;let n=uX.exec(t);if(!n)return-1;let s=n[0][n[0].length-1];return s=="_"||s=="-"?-1:a+n[0].length-(s=="."?1:0)}const SPe={parseInline:[{name:"Autolink",parse(t,a,n){let s=n-t.offset;if(s&&/\w/.test(t.text[s-1]))return-1;dX.lastIndex=s;let o=dX.exec(t.text),c=-1;if(!o)return-1;if(o[1]||o[2]){if(c=MPe(t.text,s+o[0].length),c>-1&&t.hasOpenLink){let l=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(s,c));c=s+l[0].length}}else o[3]?c=fX(t.text,s):(c=fX(t.text,s+o[0].length),c>-1&&o[0]=="xmpp:"&&(hX.lastIndex=c,o=hX.exec(t.text),o&&(c=o.index+o[0].length)));return c<0?-1:(t.addElement(t.elt("URL",n,c+t.offset)),c+t.offset)}}]},QPe=[wPe,CPe,bPe,SPe];function gY(t,a,n){return(s,o,c)=>{if(o!=t||s.char(c+1)==t)return-1;let l=[s.elt(n,c,c+1)];for(let A=c+1;A<s.end;A++){let u=s.char(A);if(u==t)return s.addElement(s.elt(a,c,A+1,l.concat(s.elt(n,A,A+1))));if(u==92&&l.push(s.elt("Escape",A,A+++2)),ss(u))break}return-1}}const BPe={defineNodes:[{name:"Superscript",style:X.special(X.content)},{name:"SuperscriptMark",style:X.processingInstruction}],parseInline:[{name:"Superscript",parse:gY(94,"Superscript","SuperscriptMark")}]},_Pe={defineNodes:[{name:"Subscript",style:X.special(X.content)},{name:"SubscriptMark",style:X.processingInstruction}],parseInline:[{name:"Subscript",parse:gY(126,"Subscript","SubscriptMark")}]},LPe={defineNodes:[{name:"Emoji",style:X.character}],parseInline:[{name:"Emoji",parse(t,a,n){let s;return a!=58||!(s=/^[a-zA-Z_0-9]+:/.exec(t.slice(n+1,t.end)))?-1:t.addElement(t.elt("Emoji",n,n+1+s[0].length))}}]},yY=tZ({commentTokens:{block:{open:"<!--",close:"-->"}}}),vY=new Kr,kY=yPe.configure({props:[ZA.add(t=>!t.is("Block")||t.is("Document")||AE(t)!=null||TPe(t)?void 0:(a,n)=>({from:n.doc.lineAt(a.from).to,to:a.to})),vY.add(AE),Eu.add({Document:()=>null}),one.add({Document:yY})]});function AE(t){let a=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return a?+a[1]:void 0}function TPe(t){return t.name=="OrderedList"||t.name=="BulletList"}function $Pe(t,a){let n=t;for(;;){let s=n.nextSibling,o;if(!s||(o=AE(s.type))!=null&&o<=a)break;n=s}return n.to}const IPe=ane.of((t,a,n)=>{for(let s=Qs(t).resolveInner(n,-1);s&&!(s.from<a);s=s.parent){let o=s.type.prop(vY);if(o==null)continue;let c=$Pe(s,o);if(c>n)return{from:n,to:c}}return null});function gz(t){return new nne(yY,t,[],"markdown")}const UPe=gz(kY),PPe=kY.configure([QPe,_Pe,BPe,LPe,{props:[ZA.add({Table:(t,a)=>({from:a.doc.lineAt(t.from).to,to:t.to})})]}]),tT=gz(PPe);function EPe(t,a){return n=>{if(n&&t){let s=null;if(n=/\S*/.exec(n)[0],typeof t=="function"?s=t(n):s=Fq.matchLanguageName(t,n,!0),s instanceof Fq)return s.support?s.support.language.parser:ine.getSkippingParser(s.load());if(s)return s.parser}return a?a.parser:null}}let eP=class{constructor(a,n,s,o,c,l,A){this.node=a,this.from=n,this.to=s,this.spaceBefore=o,this.spaceAfter=c,this.type=l,this.item=A}blank(a,n=!0){let s=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(a!=null){for(;s.length<a;)s+=" ";return s}else{for(let o=this.to-this.from-s.length-this.spaceAfter.length;o>0;o--)s+=" ";return s+(n?this.spaceAfter:"")}}marker(a,n){let s=this.node.name=="OrderedList"?String(+bY(this.item,a)[2]+n):"";return this.spaceBefore+s+this.type+this.spaceAfter}};function OY(t,a){let n=[],s=[];for(let o=t;o;o=o.parent){if(o.name=="FencedCode")return s;(o.name=="ListItem"||o.name=="Blockquote")&&n.push(o)}for(let o=n.length-1;o>=0;o--){let c=n[o],l,A=a.lineAt(c.from),u=c.from-A.from;if(c.name=="Blockquote"&&(l=/^ *>( ?)/.exec(A.text.slice(u))))s.push(new eP(c,u,u+l[0].length,"",l[1],">",null));else if(c.name=="ListItem"&&c.parent.name=="OrderedList"&&(l=/^( *)\d+([.)])( *)/.exec(A.text.slice(u)))){let f=l[3],x=l[0].length;f.length>=4&&(f=f.slice(0,f.length-4),x-=4),s.push(new eP(c.parent,u,u+x,l[1],f,l[2],c))}else if(c.name=="ListItem"&&c.parent.name=="BulletList"&&(l=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(A.text.slice(u)))){let f=l[4],x=l[0].length;f.length>4&&(f=f.slice(0,f.length-4),x-=4);let m=l[2];l[3]&&(m+=l[3].replace(/[xX]/," ")),s.push(new eP(c.parent,u,u+x,l[1],f,m,c))}}return s}function bY(t,a){return/^(\s*)(\d+)(?=[.)])/.exec(a.sliceString(t.from,t.from+10))}function tP(t,a,n,s=0){for(let o=-1,c=t;;){if(c.name=="ListItem"){let A=bY(c,a),u=+A[2];if(o>=0){if(u!=o+1)return;n.push({from:c.from+A[1].length,to:c.from+A[0].length,insert:String(o+2+s)})}o=u}let l=c.nextSibling;if(!l)break;c=l}}function yz(t,a){let n=/^[ \t]*/.exec(t)[0].length;if(!n||a.facet(sne)!=" ")return t;let s=G0(t,4,n),o="";for(let c=s;c>0;)c>=4?(o+=" ",c-=4):(o+=" ",c--);return o+t.slice(n)}const zPe=(t={})=>({state:a,dispatch:n})=>{let s=Qs(a),{doc:o}=a,c=null,l=a.changeByRange(A=>{if(!A.empty||!tT.isActiveAt(a,A.from,-1)&&!tT.isActiveAt(a,A.from,1))return c={range:A};let u=A.from,f=o.lineAt(u),x=OY(s.resolveInner(u,-1),o);for(;x.length&&x[x.length-1].from>u-f.from;)x.pop();if(!x.length)return c={range:A};let m=x[x.length-1];if(m.to-m.spaceAfter.length>u-f.from)return c={range:A};let y=u>=m.to-m.spaceAfter.length&&!/\S/.test(f.text.slice(m.to));if(m.item&&y){let j=m.node.firstChild,N=m.node.getChild("ListItem","ListItem");if(j.to>=u||N&&N.to<u||f.from>0&&!/[^\s>]/.test(o.lineAt(f.from-1).text)||t.nonTightLists===!1){let M=x.length>1?x[x.length-2]:null,Q,L="";M&&M.item?(Q=f.from+M.from,L=M.marker(o,1)):Q=f.from+(M?M.to:0);let B=[{from:Q,to:u,insert:L}];return m.node.name=="OrderedList"&&tP(m.item,o,B,-2),M&&M.node.name=="OrderedList"&&tP(M.item,o,B),{range:Zo.cursor(Q+L.length),changes:B}}else{let M=mX(x,a,f);return{range:Zo.cursor(u+M.length+1),changes:{from:f.from,insert:M+a.lineBreak}}}}if(m.node.name=="Blockquote"&&y&&f.from){let j=o.lineAt(f.from-1),N=/>\s*$/.exec(j.text);if(N&&N.index==m.from){let M=a.changes([{from:j.from+N.index,to:j.to},{from:f.from+m.from,to:f.to}]);return{range:A.map(M),changes:M}}}let v=[];m.node.name=="OrderedList"&&tP(m.item,o,v);let O=m.item&&m.item.from<f.from,b="";if(!O||/^[\s\d.)\-+*>]*/.exec(f.text)[0].length>=m.to)for(let j=0,N=x.length-1;j<=N;j++)b+=j==N&&!O?x[j].marker(o,1):x[j].blank(j<N?G0(f.text,4,x[j+1].from)-b.length:null);let C=u;for(;C>f.from&&/\s/.test(f.text.charAt(C-f.from-1));)C--;return b=yz(b,a),RPe(m.node,a.doc)&&(b=mX(x,a,f)+a.lineBreak+b),v.push({from:C,to:u,insert:a.lineBreak+b}),{range:Zo.cursor(C+b.length+1),changes:v}});return c?!1:(n(a.update(l,{scrollIntoView:!0,userEvent:"input"})),!0)},FPe=zPe();function xX(t){return t.name=="QuoteMark"||t.name=="ListMark"}function RPe(t,a){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let n=t.firstChild,s=t.getChild("ListItem","ListItem");if(!s)return!1;let o=a.lineAt(n.to),c=a.lineAt(s.from),l=/^[\s>]*$/.test(o.text);return o.number+(l?0:1)<c.number}function mX(t,a,n){let s="";for(let o=0,c=t.length-2;o<=c;o++)s+=t[o].blank(o<c?G0(n.text,4,t[o+1].from)-s.length:null,o<c);return yz(s,a)}function HPe(t,a){let n=t.resolveInner(a,-1),s=a;xX(n)&&(s=n.from,n=n.parent);for(let o;o=n.childBefore(s);)if(xX(o))s=o.from;else if(o.name=="OrderedList"||o.name=="BulletList")n=o.lastChild,s=n.to;else break;return n}const qPe=({state:t,dispatch:a})=>{let n=Qs(t),s=null,o=t.changeByRange(c=>{let l=c.from,{doc:A}=t;if(c.empty&&tT.isActiveAt(t,c.from)){let u=A.lineAt(l),f=OY(HPe(n,l),A);if(f.length){let x=f[f.length-1],m=x.to-x.spaceAfter.length+(x.spaceAfter?1:0);if(l-u.from>m&&!/\S/.test(u.text.slice(m,l-u.from)))return{range:Zo.cursor(u.from+m),changes:{from:u.from+m,to:l}};if(l-u.from==m&&(!x.item||u.from<=x.item.from||!/\S/.test(u.text.slice(0,x.to)))){let y=u.from+x.from;if(x.item&&x.node.from<x.item.from&&/\S/.test(u.text.slice(x.from,x.to))){let v=x.blank(G0(u.text,4,x.to)-G0(u.text,4,x.from));return y==u.from&&(v=yz(v,t)),{range:Zo.cursor(y+v.length),changes:{from:y,to:u.from+x.to,insert:v}}}if(y<l)return{range:Zo.cursor(y),changes:{from:y,to:l}}}}}return s={range:c}});return s?!1:(a(t.update(o,{scrollIntoView:!0,userEvent:"delete"})),!0)},DPe=[{key:"Enter",run:FPe},{key:"Backspace",run:qPe}],wY=WK({matchClosingTags:!1});function jY(t={}){let{codeLanguages:a,defaultCodeLanguage:n,addKeymap:s=!0,base:{parser:o}=UPe,completeHTMLTags:c=!0,pasteURLAsLink:l=!0,htmlTagLanguage:A=wY}=t;if(!(o instanceof TT))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let u=t.extensions?[t.extensions]:[],f=[A.support,IPe],x;l&&f.push(GPe),n instanceof FA?(f.push(n.support),x=n.language):n&&(x=n);let m=a||x?EPe(a,x):void 0;u.push(kPe({codeParser:m,htmlParser:A.language.parser})),s&&f.push(tne.high(ML.of(DPe)));let y=gz(o.configure(u));return c&&f.push(y.data.of({autocomplete:VPe})),new FA(y,f)}function VPe(t){let{state:a,pos:n}=t,s=/<[:\-\.\w\u00b7-\uffff]*$/.exec(a.sliceDoc(n-25,n));if(!s)return null;let o=Qs(a).resolveInner(n,-1);for(;o&&!o.type.isTop;){if(o.name=="CodeBlock"||o.name=="FencedCode"||o.name=="ProcessingInstructionBlock"||o.name=="CommentBlock"||o.name=="Link"||o.name=="Image")return null;o=o.parent}return{from:n-s[0].length,to:n,options:XPe(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let aP=null;function XPe(){if(aP)return aP;let t=ePe(new rne(CE.create({extensions:wY}),0,!0));return aP=t?t.options:[]}const ZPe=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,GPe=Ws.domEventHandlers({paste:(t,a)=>{var n;let{main:s}=a.state.selection;if(s.empty)return!1;let o=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!o||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(o)||(/^www\./.test(o)&&(o="https://"+o),!tT.isActiveAt(a.state,s.from,1)))return!1;let c=Qs(a.state),l=!1;return c.iterate({from:s.from,to:s.to,enter:A=>{(A.from>s.from||ZPe.test(A.name))&&(l=!0)},leave:A=>{A.to<s.to&&(l=!0)}}),l?!1:(a.dispatch({changes:[{from:s.from,insert:"["},{from:s.to,insert:`](${o})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),WPe=1,CY=194,NY=195,KPe=196,gX=197,YPe=198,JPe=199,eEe=200,tEe=2,MY=3,yX=201,aEe=24,nEe=25,sEe=49,rEe=50,oEe=55,iEe=56,cEe=57,lEe=59,dEe=60,AEe=61,uEe=62,hEe=63,pEe=65,fEe=238,xEe=71,mEe=241,gEe=242,yEe=243,vEe=244,kEe=245,OEe=246,bEe=247,wEe=248,SY=72,jEe=249,CEe=250,NEe=251,MEe=252,SEe=253,QEe=254,BEe=255,_Ee=256,LEe=73,TEe=77,$Ee=263,IEe=112,UEe=130,PEe=151,EEe=152,zEe=155,qA=10,r2=13,vz=32,$T=9,kz=35,FEe=40,REe=46,uE=123,vX=125,QY=39,BY=34,kX=92,HEe=111,qEe=120,DEe=78,VEe=117,XEe=85,ZEe=new Set([nEe,sEe,rEe,$Ee,pEe,UEe,iEe,cEe,fEe,uEe,hEe,SY,LEe,TEe,dEe,AEe,PEe,EEe,zEe,IEe]);function nP(t){return t==qA||t==r2}function sP(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const GEe=new $a((t,a)=>{let n;if(t.next<0)t.acceptToken(JPe);else if(a.context.flags&jL)nP(t.next)&&t.acceptToken(YPe,1);else if(((n=t.peek(-1))<0||nP(n))&&a.canShift(gX)){let s=0;for(;t.next==vz||t.next==$T;)t.advance(),s++;(t.next==qA||t.next==r2||t.next==kz)&&t.acceptToken(gX,-s)}else nP(t.next)&&t.acceptToken(KPe,1)},{contextual:!0}),WEe=new $a((t,a)=>{let n=a.context;if(n.flags)return;let s=t.peek(-1);if(s==qA||s==r2){let o=0,c=0;for(;;){if(t.next==vz)o++;else if(t.next==$T)o+=8-o%8;else break;t.advance(),c++}o!=n.indent&&t.next!=qA&&t.next!=r2&&t.next!=kz&&(o<n.indent?t.acceptToken(NY,-c):t.acceptToken(CY))}}),jL=1,_Y=2,Sr=4,Qr=8,Br=16,_r=32;function CL(t,a,n){this.parent=t,this.indent=a,this.flags=n,this.hash=(t?t.hash+t.hash<<8:0)+a+(a<<4)+n+(n<<6)}const KEe=new CL(null,0,0);function YEe(t){let a=0;for(let n=0;n<t.length;n++)a+=t.charCodeAt(n)==$T?8-a%8:1;return a}const OX=new Map([[mEe,0],[gEe,Sr],[yEe,Qr],[vEe,Qr|Sr],[kEe,Br],[OEe,Br|Sr],[bEe,Br|Qr],[wEe,Br|Qr|Sr],[jEe,_r],[CEe,_r|Sr],[NEe,_r|Qr],[MEe,_r|Qr|Sr],[SEe,_r|Br],[QEe,_r|Br|Sr],[BEe,_r|Br|Qr],[_Ee,_r|Br|Qr|Sr]].map(([t,a])=>[t,a|_Y])),JEe=new cz({start:KEe,reduce(t,a,n,s){return t.flags&jL&&ZEe.has(a)||(a==xEe||a==SY)&&t.flags&_Y?t.parent:t},shift(t,a,n,s){return a==CY?new CL(t,YEe(s.read(s.pos,n.pos)),0):a==NY?t.parent:a==aEe||a==oEe||a==lEe||a==MY?new CL(t,0,jL):OX.has(a)?new CL(t,0,OX.get(a)|t.flags&jL):t},hash(t){return t.hash}}),eze=new $a(t=>{for(let a=0;a<5;a++){if(t.next!="print".charCodeAt(a))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let a=0;;a++){let n=t.peek(a);if(!(n==vz||n==$T)){n!=FEe&&n!=REe&&n!=qA&&n!=r2&&n!=kz&&t.acceptToken(WPe);return}}}),tze=new $a((t,a)=>{let{flags:n}=a.context,s=n&Sr?BY:QY,o=(n&Qr)>0,c=!(n&Br),l=(n&_r)>0,A=t.pos;for(;!(t.next<0);)if(l&&t.next==uE)if(t.peek(1)==uE)t.advance(2);else{if(t.pos==A){t.acceptToken(MY,1);return}break}else if(c&&t.next==kX){if(t.pos==A){t.advance();let u=t.next;u>=0&&(t.advance(),aze(t,u)),t.acceptToken(tEe);return}break}else if(t.next==kX&&!c&&t.peek(1)>-1)t.advance(2);else if(t.next==s&&(!o||t.peek(1)==s&&t.peek(2)==s)){if(t.pos==A){t.acceptToken(yX,o?3:1);return}break}else if(t.next==qA){if(o)t.advance();else if(t.pos==A){t.acceptToken(yX);return}break}else t.advance();t.pos>A&&t.acceptToken(eEe)});function aze(t,a){if(a==HEe)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(a==qEe)for(let n=0;n<2&&sP(t.next);n++)t.advance();else if(a==VEe)for(let n=0;n<4&&sP(t.next);n++)t.advance();else if(a==XEe)for(let n=0;n<8&&sP(t.next);n++)t.advance();else if(a==DEe&&t.next==uE){for(t.advance();t.next>=0&&t.next!=vX&&t.next!=QY&&t.next!=BY&&t.next!=qA;)t.advance();t.next==vX&&t.advance()}}const nze=XA({'async "*" "**" FormatConversion FormatSpec':X.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":X.controlKeyword,"in not and or is del":X.operatorKeyword,"from def class global nonlocal lambda":X.definitionKeyword,import:X.moduleKeyword,"with as print":X.keyword,Boolean:X.bool,None:X.null,VariableName:X.variableName,"CallExpression/VariableName":X.function(X.variableName),"FunctionDefinition/VariableName":X.function(X.definition(X.variableName)),"ClassDefinition/VariableName":X.definition(X.className),PropertyName:X.propertyName,"CallExpression/MemberExpression/PropertyName":X.function(X.propertyName),Comment:X.lineComment,Number:X.number,String:X.string,FormatString:X.special(X.string),Escape:X.escape,UpdateOp:X.updateOperator,"ArithOp!":X.arithmeticOperator,BitOp:X.bitwiseOperator,CompareOp:X.compareOperator,AssignOp:X.definitionOperator,Ellipsis:X.punctuation,At:X.meta,"( )":X.paren,"[ ]":X.squareBracket,"{ }":X.brace,".":X.derefOperator,", ;":X.separator}),sze={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},rze=li.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyO<POWO,5:aOOQS,5:a,5:aO<[QdO'#HwOOOW'#Dw'#DwOOOW'#Fz'#FzO<lOWO,5:bOOQS,5:b,5:bOOQS'#F}'#F}O<zQtO,5:iO?lQtO,5=`O@VQ#xO,5=`O@vQtO,5=`OOQS,5:},5:}OA_QeO'#GWOBqQdO,5;^OOQV,5=^,5=^OB|QtO'#IPOCkQdO,5;tOOQS-E:[-E:[OOQV,5;s,5;sO4dQdO'#FQOOQV-E9o-E9oOCsQtO,59]OEzQtO,59iOFeQdO'#HVOFpQdO'#HVO1XQdO'#HVOF{QdO'#DTOGTQdO,59mOGYQdO'#HZO'vQdO'#HZO0rQdO,5=tOOQS,5=t,5=tO0rQdO'#EROOQS'#ES'#ESOGwQdO'#GPOHXQdO,58|OHXQdO,58|O*xQdO,5:oOHgQtO'#H]OOQS,5:r,5:rOOQS,5:z,5:zOHzQdO,5;OOI]QdO'#IOO1XQdO'#H}OOQS,5;Q,5;QOOQS'#GT'#GTOIqQtO,5;QOJPQdO,5;QOJUQdO'#IQOOQS,5;T,5;TOJdQdO'#H|OOQS,5;W,5;WOJuQdO,5;YO4iQdO,5;`O4iQdO,5;cOJ}QtO'#ITO'vQdO'#ITOKXQdO,5;eO4VQdO,5;eO0rQdO,5;jO1XQdO,5;lOK^QeO'#EuOLjQgO,5;fO!!kQdO'#IUO4iQdO,5;jO!!vQdO,5;lO!#OQdO,5;qO!#ZQtO,5;vO'vQdO,5;vPOOO,5=[,5=[P!#bOSO,5=[P!#jOdO,5=[O!&bQtO1G.jO!&iQtO1G.jO!)YQtO1G.jO!)dQtO1G.jO!+}QtO1G.jO!,bQtO1G.jO!,uQdO'#HcO!-TQtO'#GuO0rQdO'#HcO!-_QdO'#HbOOQS,5:Z,5:ZO!-gQdO,5:ZO!-lQdO'#HeO!-wQdO'#HeO!.[QdO,5>OOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5<jOOQS,5<j,5<jOOQS-E9|-E9|OOQS,5<r,5<rOOQS-E:U-E:UOOQV1G0x1G0xO1XQdO'#GRO!7dQtO,5>kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5<k,5<kOOQS-E9}-E9}O!9wQdO1G.hOOQS1G0Z1G0ZO!:VQdO,5=wO!:gQdO,5=wO0rQdO1G0jO0rQdO1G0jO!:xQdO,5>jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!<RQdO,5>lO!<aQdO,5>lO!<oQdO,5>hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5<m,5<mOOQS-E:P-E:POOQS7+&z7+&zOOQS1G3]1G3]OOQS,5<^,5<^OOQS-E9p-E9pOOQS7+$s7+$sO#)bQdO,5=`O#){QdO,5=`O#*^QtO,5<aO#*qQdO1G3cOOQS-E9s-E9sOOQS7+&U7+&UO#+RQdO7+&UO#+aQdO,5<nO#+uQdO1G4UOOQS-E:Q-E:QO#,WQdO1G4UOOQS1G4T1G4TOOQS7+&W7+&WO#,iQdO7+&WOOQS,5<p,5<pO#,tQdO1G4WOOQS-E:S-E:SOOQS,5<l,5<lO#-SQdO1G4SOOQS-E:O-E:OO1XQdO'#EqO#-jQdO'#EqO#-uQdO'#IRO#-}QdO,5;[OOQS7+&`7+&`O0rQdO7+&`O#.SQgO7+&fO!JmQdO'#GXO4iQdO7+&fO4iQdO7+&iO#2QQtO,5<tO'vQdO,5<tO#2[QdO1G4ZOOQS-E:W-E:WO#2fQdO1G4ZO4iQdO7+&kO0rQdO7+&kOOQV7+&p7+&pO!KrQ!fO7+&rO!KzQdO7+&rO`QeO1G0{OOQV-E:X-E:XO4iQdO7+&lO4iQdO7+&lOOQV,5<u,5<uO#2nQdO,5<uO!JmQdO,5<uOOQV7+&l7+&lO#2yQgO7+&lO#6tQdO,5<vO#7PQdO1G4[OOQS-E:Y-E:YO#7^QdO1G4[O#7fQdO'#IWO#7tQdO'#IWO1XQdO'#IWOOQS'#IW'#IWO#8PQdO'#IVOOQS,5;n,5;nO#8XQdO,5;nO0rQdO'#FUOOQV7+&r7+&rO4iQdO7+&rOOQV7+&w7+&wO4iQdO7+&wO#8^QfO,5;xOOQV7+&|7+&|POOO7+(b7+(bO#8cQdO1G3iOOQS,5<c,5<cO#8qQdO1G3hOOQS-E9u-E9uO#9UQdO,5<dO#9aQdO,5<dO#9tQdO1G3kOOQS-E9v-E9vO#:UQdO1G3kO#:^QdO1G3kO#:nQdO1G3kO#:UQdO1G3kOOQS<<H[<<H[O#:yQtO1G1zOOQS<<Hk<<HkP#;WQdO'#FtO8vQdO1G3bO#;eQdO1G3bO#;jQdO<<HkOOQS<<Hl<<HlO#;zQdO7+)QOOQS<<Hs<<HsO#<[QtO1G1yP#<{QdO'#FsO#=YQdO7+)RO#=jQdO7+)RO#=rQdO<<HwO#=wQdO7+({OOQS<<Hy<<HyO#>nQdO,5<bO'vQdO,5<bOOQS-E9t-E9tOOQS<<Hw<<HwOOQS,5<g,5<gO0rQdO,5<gO#>sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<<IpO1XQdO1G2YP1XQdO'#GSO#AOQdO7+)pO#AaQdO7+)pOOQS<<Ir<<IrP1XQdO'#GUP0rQdO'#GQOOQS,5;],5;]O#ArQdO,5>mO#BQQdO,5>mOOQS1G0v1G0vOOQS<<Iz<<IzOOQV-E:V-E:VO4iQdO<<JQOOQV,5<s,5<sO4iQdO,5<sOOQV<<JQ<<JQOOQV<<JT<<JTO#BYQtO1G2`P#BdQdO'#GYO#BkQdO7+)uO#BuQgO<<JVO4iQdO<<JVOOQV<<J^<<J^O4iQdO<<J^O!KrQ!fO<<J^O#FpQgO7+&gOOQV<<JW<<JWO#FzQgO<<JWOOQV1G2a1G2aO1XQdO1G2aO#JuQdO1G2aO4iQdO<<JWO1XQdO1G2bP0rQdO'#G[O#KQQdO7+)vO#K_QdO7+)vOOQS'#FT'#FTO0rQdO,5>rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<<Jc<<JcO#LhQdO1G1dOOQS7+)T7+)TP#LmQdO'#FwO#L}QdO1G2OO#MbQdO1G2OO#MrQdO1G2OP#M}QdO'#FxO#N[QdO7+)VO#NlQdO7+)VO#NlQdO7+)VO#NtQdO7+)VO$ UQdO7+(|O8vQdO7+(|OOQSAN>VAN>VO$ oQdO<<LmOOQSAN>cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<<MT<<MTO$#nQdO7+(fOOQSAN?[AN?[OOQS7+'t7+'tO$$XQdO<<M[OOQS,5<q,5<qO$$jQdO1G4XOOQS-E:T-E:TOOQVAN?lAN?lOOQV1G2_1G2_O4iQdOAN?qO$$xQgOAN?qOOQVAN?xAN?xO4iQdOAN?xOOQV<<JR<<JRO4iQdOAN?rO4iQdO7+'{OOQV7+'{7+'{O1XQdO7+'{OOQVAN?rAN?rOOQS7+'|7+'|O$(sQdO<<MbOOQS1G4^1G4^O0rQdO1G4^OOQS,5<w,5<wO$)QQdO1G4]OOQS-E:Z-E:ZOOQU'#G_'#G_O$)cQfO7+'OO$)nQdO'#F_O$*uQdO7+'jO$+VQdO7+'jOOQS7+'j7+'jO$+bQdO<<LqO$+rQdO<<LqO$+rQdO<<LqO$+zQdO'#H^OOQS<<Lh<<LhO$,UQdO<<LhOOQS7+'h7+'hOOQS'#D|'#D|OOOO1G4R1G4RO$,oQdO1G4RO$,wQdO1G4RP!=hQdO'#GVOOQVG25]G25]O4iQdOG25]OOQVG25dG25dOOQVG25^G25^OOQV<<Kg<<KgO4iQdO<<KgOOQS7+)x7+)xP$-SQdO'#G]OOQU-E:]-E:]OOQV<<Jj<<JjO$-vQtO'#FaOOQS'#Fc'#FcO$.WQdO'#FbO$.xQdO'#FbOOQS'#Fb'#FbO$.}QdO'#IYO$)nQdO'#FiO$)nQdO'#FiO$/fQdO'#FjO$)nQdO'#FkO$/mQdO'#IZOOQS'#IZ'#IZO$0[QdO,5;yOOQS<<KU<<KUO$0dQdO<<KUO$0tQdOANB]O$1UQdOANB]O$1^QdO'#H_OOQS'#H_'#H_O1sQdO'#DcO$1wQdO,5=xOOQSANBSANBSOOOO7+)m7+)mO$2`QdO7+)mOOQVLD*wLD*wOOQVANARANARO5uQ!fO'#GaO$2hQtO,5<SO$)nQdO'#FmOOQS,5<W,5<WOOQS'#Fd'#FdO$3YQdO,5;|O$3_QdO,5;|OOQS'#Fg'#FgO$)nQdO'#G`O$4PQdO,5<QO$4kQdO,5>tO$4{QdO,5>tO1XQdO,5<PO$5^QdO,5<TO$5cQdO,5<TO$)nQdO'#I[O$5hQdO'#I[O$5mQdO,5<UOOQS,5<V,5<VO0rQdO'#FpOOQU1G1e1G1eO4iQdO1G1eOOQSAN@pAN@pO$5rQdOG27wO$6SQdO,59}OOQS1G3d1G3dOOOO<<MX<<MXOOQS,5<{,5<{OOQS-E:_-E:_O$6XQtO'#FaO$6`QdO'#I]O$6nQdO'#I]O$6vQdO,5<XOOQS1G1h1G1hO$6{QdO1G1hO$7QQdO,5<zOOQS-E:^-E:^O$7lQdO,5=OO$8TQdO1G4`OOQS-E:b-E:bOOQS1G1k1G1kOOQS1G1o1G1oO$8eQdO,5>vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5<YO$8sQdO,5>wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5<ZP$)nQdO'#GcO$;XQdO1G2hO$)nQdO1G2hP$;gQdO'#GbO$;nQdO<<MhO$;xQdO1G1uO$<WQdO7+(SO8vQdO'#C}O8vQdO,59bO8vQdO,59bO8vQdO,59bO$<fQtO,5=`O8vQdO1G.|O0rQdO1G/XO0rQdO7+$pP$<yQdO'#GOO'vQdO'#GtO$=WQdO,59bO$=]QdO,59bO$=dQdO,59mO$=iQdO1G/UO1sQdO'#DRO8vQdO,59j",stateData:"$>S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!<S!<VP!<_!<h!=d!=g]eOn#g$j)t,P'}`OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0r{!cQ#c#p$R$d$p%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g}!dQ#c#p$R$d$p$u%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!P!eQ#c#p$R$d$p$u$v%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!R!fQ#c#p$R$d$p$u$v$w%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!T!gQ#c#p$R$d$p$u$v$w$x%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!V!hQ#c#p$R$d$p$u$v$w$x$y%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g!Z!hQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0g'}TOTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0r&eVOYZ[dnprxy}!P!Q!U!i!k!o!p!q!s!t#[#d#g#y#{#}$Q$h$j$}%S%Z%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0n0r%oXOYZ[dnrxy}!P!Q!U!i!k#[#d#g#y#{#}$Q$h$j$}%S%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/V/Z0i0j0kQ#vqQ/[.kR0o0q't`OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rh#jhz{$W$Z&l&q)S)X+f+g-RW#rq&].k0qQ$]|Q$a!OQ$n!VQ$o!WW$|!i'm*d,gS&[#s#tQ'S$iQ(s&UQ)U&nU)Y&s)Z+jW)a&w+m-T-{Q*Q']W*R'_,`-h.TQ+l)`S,_*S*TQ-Q+eQ-_,TQ-c,WQ.R-al.W-l.^._.a.z.|/R/j/o/t/y0U0Z0^Q/S.`Q/a.tQ/l/OU0P/u0S0[X0V/z0W0_0`R&Z#r!_!wYZ!P!Q!k%S%`%g'p'r's(O(W)g*g*h*k*q*t*v,h,i,k,l,o-m-p.f.g/ZR%^!vQ!{YQ%x#[Q&d#}Q&g$QR,{+YT.j-s/s!Y!jQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0gQ&X#kQ'c$oR*^'dR'l$|Q%V!mR/_.r'|_OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rS#a_#b!P.[-l.^._.`.a.t.z.|/R/j/o/t/u/y/z0S0U0W0Z0[0^0_0`'|_OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rT#a_#bT#^^#_R(o%xa(l%x(n(o+`,{-y-z.oT+[(k+]R-z,{Q$PsQ+l)aQ,^*RR-e,_X#}s$O$P&fQ&y$aQ'a$nQ'd$oR)s'SQ)b&wV-S+m-T-{ZgOn$j)t,PXkOn)t,PQ$k!TQ&z$bQ&{$cQ'^$mQ'b$oQ)q'RQ)x'WQ){'XQ)|'YQ*Z'`S*]'c'dQ+s)gQ+u)hQ+v)iQ+z)oS+|)r*[Q,Q)vQ,R)wS,S)y)zQ,d*^Q-V+rQ-W+tQ-Y+{S-Z+},OQ-`,UQ-b,VQ-|-XQ.O-[Q.P-^Q.Q-_Q.p-}Q.q.RQ/W.dR/r/XWkOn)t,PR#mjQ'`$nS)r'S'aR,O)sQ,]*RR-f,^Q*['`Q+})rR-[,OZiOjn)t,PQ'f$pR*`'gT-j,e-ku.c-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^t.c-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^Q/S.`X0V/z0W0_0`!P.Z-l.^._.`.a.t.z.|/R/j/o/t/u/y/z0S0U0W0Z0[0^0_0`Q.w.YR/f.xg.z.].{/b/i/n/|0O0Q0]0a0bu.b-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^X.u.W.b/a0PR/c.tV0R/u0S0[R/X.dQnOS#on,PR,P)tQ&^#uR(x&^S%m#R#wS(_%m(bT(b%p&`Q%a!yQ%h!}W(P%a%h(U(YQ(U%eR(Y%jQ&i$RR)O&iQ(e%qQ*{(`T+R(e*{Q'n%OR*e'nS'q%R%SY*i'q*j,m-q.hU*j'r's'tU,m*k*l*mS-q,n,oR.h-rQ#Y]R%t#YQ#_^R%y#_Q(h%vS+W(h+XR+X(iQ+](kR,|+]Q#b_R%{#bQ#ebQ%}#cW&Q#e%}({+bQ({&cR+b0gQ$OsS&e$O&fR&f$PQ&v$_R)_&vQ&V#jR(t&VQ&m$VS)T&m+hR+h)UQ$Z{R&p$ZQ&t$]R)[&tQ+n)bR-U+nQ#hfR&S#hQ)f&zR+q)fQ&}$dS)m&})nR)n'OQ'V$kR)u'VQ'[$lS*P'[,ZR,Z*QQ,a*VR-i,aWjOn)t,PR#ljQ-k,eR.U-kd.{.]/b/i/n/|0O0Q0]0a0bR/h.{U.s.W/a0PR/`.sQ/{/nS0X/{0YR0Y/|S/v/b/cR0T/vQ.}.]R/k.}R!ZPXmOn)t,PWlOn)t,PR'T$jYfOn$j)t,PR&R#g[sOn#g$j)t,PR&d#}&dQOYZ[dnprxy}!P!Q!U!i!k!o!p!q!s!t#[#d#g#y#{#}$Q$h$j$}%S%Z%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0n0rQ!nTQ#caQ#poU$Rt%c(SS$d!R$gQ$p!XQ$u!cQ$v!dQ$w!eQ$x!fQ$y!gQ$z!hQ%e!zQ%j#OQ%p#SQ%q#TQ&`#xQ'O$eQ'g$qQ(q&OU(|&h(}+cW)j&|)l+x+yQ*o'|Q*x(]Q+w)kQ,v+QR0g0lQ!yYQ!}ZQ$b!PQ$c!QQ%R!kQ't%S^'{%`%g(O(W*q*t*v^*f'p*h,k,l-p.g/ZQ*l'rQ*m'sQ+t)gQ,j*gQ,n*kQ-n,hQ-o,iQ-r,oQ.e-mR/Y.f[bOn#g$j)t,P!^!vYZ!P!Q!k%S%`%g'p'r's(O(W)g*g*h*k*q*t*v,h,i,k,l,o-m-p.f.g/ZQ#R[Q#fdS#wrxQ$UyW$_}$Q'P)pS$l!U$hW${!i'm*d,gS%v#[+Y`&P#d%|(p(r(z+a-O0kQ&a#yQ&b#{Q&c#}Q'j$}Q'z%^W([%l(^*y*}Q(`%nQ(i%wQ(v&ZS(y&_0iQ)P&jQ)Q&kU)]&u)^+kQ)d&xQ)y'WY)}'Z*O,X,Y-dQ*b'lS*n'w0jW+P(d*z,s,wW+T(g+V,y,zQ+p)eQ,U)zQ,c*YQ,x+UQ-P+dQ-e,]Q-v,uQ.S-fR/q/VhUOn#d#g$j%|&_'w(p(r)t,P%U!uYZ[drxy}!P!Q!U!i!k#[#y#{#}$Q$h$}%S%^%`%g%l%n%w&Z&j&k&u&x'P'W'Z'l'm'p'r's(O(W(^(d(g(z)^)e)g)p)z*O*Y*d*g*h*k*q*t*v*y*z*}+U+V+Y+a+d+k,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/V/Z0i0j0kQ#qpW%W!o!s0d0nQ%X!pQ%Y!qQ%[!tQ%f0cS'v%Z0hQ'x0eQ'y0fQ,p*rQ-u,qS.i-s/sR0p0rU#uq.k0qR(w&][cOn#g$j)t,PZ!xY#[#}$Q+YQ#W[Q#zrR$TxQ%b!yQ%i!}Q%o#RQ'j${Q(V%eQ(Z%jQ(c%pQ(f%qQ*|(`Q,f*bQ-t,pQ.m-uR/].lQ$StQ(R%cR*s(SQ.l-sR/}/sR#QZR#V[R%Q!iQ%O!iV*c'm*d,g!Z!lQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0gR%T!kT#]^#_Q%x#[R,{+YQ(m%xS+_(n(oQ,}+`Q-x,{S.n-y-zR/^.oT+Z(k+]Q$`}Q&g$QQ)o'PR+{)pQ$XzQ)W&qR+i)XQ$XzQ&o$WQ)W&qR+i)XQ#khW$Vz$W&q)XQ$[{Q&r$ZZ)R&l)S+f+g-RR$^|R)c&wXlOn)t,PQ$f!RR'Q$gQ$m!UR'R$hR*X'_Q*V'_V-g,`-h.TQ.d-lQ/P.^R/Q._U.]-l.^._Q/U.aQ/b.tQ/g.zU/i.|/j/yQ/n/RQ/|/oQ0O/tU0Q/u0S0[Q0]0UQ0a0ZR0b0^R/T.`R/d.t",nodeNames:"⚠ print Escape { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:JEe,nodeProps:[["isolate",-5,4,71,72,73,77,""],["group",-15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,"Pattern"],["openedBy",23,"(",54,"[",58,"{"],["closedBy",24,")",55,"]",59,"}"]],propSources:[nze],skippedNodes:[0,4],repeatNodeCount:34,tokenData:"!2|~R!`OX%TXY%oY[%T[]%o]p%Tpq%oqr'ars)Yst*xtu%Tuv,dvw-hwx.Uxy/tyz0[z{0r{|2S|}2p}!O3W!O!P4_!P!Q:Z!Q!R;k!R![>_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[eze,WEe,GEe,tze,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>sze[t]||-1}],tokenPrec:7668}),bX=new jE,LY=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function mf(t){return(a,n,s)=>{if(s)return!1;let o=a.node.getChild("VariableName");return o&&n(o,t),!0}}const oze={FunctionDefinition:mf("function"),ClassDefinition:mf("class"),ForStatement(t,a,n){if(n){for(let s=t.node.firstChild;s;s=s.nextSibling)if(s.name=="VariableName")a(s,"variable");else if(s.name=="in")break}},ImportStatement(t,a){var n,s;let{node:o}=t,c=((n=o.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let l=o.getChild("import");l;l=l.nextSibling)l.name=="VariableName"&&((s=l.nextSibling)===null||s===void 0?void 0:s.name)!="as"&&a(l,c?"variable":"namespace")},AssignStatement(t,a){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")a(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(t,a){for(let n=null,s=t.node.firstChild;s;s=s.nextSibling)s.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&a(s,"variable"),n=s},CapturePattern:mf("variable"),AsPattern:mf("variable"),__proto__:null};function TY(t,a){let n=bX.get(a);if(n)return n;let s=[],o=!0;function c(l,A){let u=t.sliceString(l.from,l.to);s.push({label:u,type:A})}return a.cursor(lT.IncludeAnonymous).iterate(l=>{if(l.name){let A=oze[l.name];if(A&&A(l,c,o)||!o&&LY.has(l.name))return!1;o=!1}else if(l.to-l.from>8192){for(let A of TY(t,l.node))s.push(A);return!1}}),bX.set(a,s),s}const wX=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,$Y=["String","FormatString","Comment","PropertyName"];function ize(t){let a=Qs(t.state).resolveInner(t.pos,-1);if($Y.indexOf(a.name)>-1)return null;let n=a.name=="VariableName"||a.to-a.from<20&&wX.test(t.state.sliceDoc(a.from,a.to));if(!n&&!t.explicit)return null;let s=[];for(let o=a;o;o=o.parent)LY.has(o.name)&&(s=s.concat(TY(t.state.doc,o)));return{options:s,from:n?a.from:t.pos,validFor:wX}}const cze=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),lze=[$t("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),$t("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),$t("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),$t("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),$t(`if \${}:
8662
8662
 
8663
- `,{label:"if",detail:"block",type:"keyword"}),$t("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),$t("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),$t("import ${module}",{label:"import",detail:"statement",type:"keyword"}),$t("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],dze=YX($Y,JX(cze.concat(lze)));function rP(t){let{node:a,pos:n}=t,s=t.lineIndent(n,-1),o=null;for(;;){let c=a.childBefore(n);if(c)if(c.name=="Comment")n=c.from;else if(c.name=="Body"||c.name=="MatchBody")t.baseIndentFor(c)+t.unit<=s&&(o=c),a=c;else if(c.name=="MatchClause")a=c;else if(c.type.is("Statement"))a=c;else break;else break}return o}function oP(t,a){let n=t.baseIndentFor(a),s=t.lineAt(t.pos,-1),o=s.from+s.text.length;return/^\s*($|#)/.test(s.text)&&t.node.to<o+100&&!/\S/.test(t.state.sliceDoc(o,t.node.to))&&t.lineIndent(t.pos,-1)<=n||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(t.textAfter)&&t.lineIndent(t.pos,-1)>n?null:n+t.unit}const iP=l2.define({name:"python",parser:rze.configure({props:[Eu.add({Body:t=>{var a;let n=/^\s*(#|$)/.test(t.textAfter)&&rP(t)||t.node;return(a=oP(t,n))!==null&&a!==void 0?a:t.continue()},MatchBody:t=>{var a;let n=rP(t);return(a=oP(t,n||t.node))!==null&&a!==void 0?a:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":Mf({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Mf({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Mf({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var a;let n=rP(t);return(a=n&&oP(t,n))!==null&&a!==void 0?a:t.continue()}}),ZA.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":dT,Body:(t,a)=>({from:t.from+1,to:t.to-(t.to==a.doc.length?0:1)}),"String FormatString":(t,a)=>({from:a.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function Aze(){return new FA(iP,[iP.data.of({autocomplete:ize}),iP.data.of({autocomplete:dze})])}const gf={javascript:()=>sE({jsx:!0,typescript:!1}),typescript:()=>sE({jsx:!0,typescript:!0}),css:()=>BK(),html:()=>WK(),json:()=>iPe(),markdown:()=>jY(),python:()=>Aze()},uze=nZ.define([{tag:X.keyword,color:"#b07fd5"},{tag:[X.name,X.deleted,X.character,X.macroName],color:"#d4d8e0"},{tag:[X.function(X.variableName),X.labelName],color:"#d9a45c"},{tag:[X.color,X.constant(X.name),X.standard(X.name)],color:"#c4956a"},{tag:[X.definition(X.name),X.separator],color:"#bcc2cd"},{tag:[X.typeName,X.className,X.number,X.changed,X.annotation,X.modifier,X.self,X.namespace],color:"#cda869"},{tag:[X.operator,X.operatorKeyword,X.url,X.escape,X.regexp,X.special(X.string)],color:"#89b4c4"},{tag:[X.meta,X.comment],color:"#6e7681",fontStyle:"italic"},{tag:X.strong,fontWeight:"bold"},{tag:X.emphasis,fontStyle:"italic"},{tag:X.strikethrough,textDecoration:"line-through"},{tag:X.link,color:"#7ab0df",textDecoration:"underline"},{tag:X.heading,fontWeight:"400",color:"#bcc2cd"},{tag:[X.atom,X.bool,X.special(X.variableName)],color:"#c4956a"},{tag:[X.processingInstruction,X.string,X.inserted],color:"#a3b18a"},{tag:X.invalid,color:"#d4736e"},{tag:X.propertyName,color:"#d9a45c"},{tag:[X.tagName],color:"#d4736e"},{tag:X.attributeName,color:"#cda869"},{tag:X.attributeValue,color:"#a3b18a"}]),hze=Ws.theme({"&":{backgroundColor:"#13161b",color:"#d4d8e0",fontFamily:"var(--font-mono)",fontSize:"12px",height:"100%",lineHeight:"1.6"},".cm-scroller":{overflow:"auto",padding:"4px 0"},".cm-content":{caretColor:"#33afbc",fontWeight:"400"},".cm-cursor":{borderLeftColor:"#33afbc",borderLeftWidth:"1.5px"},".cm-gutters":{backgroundColor:"#13161b",borderRight:"1px solid #1e2229",color:"#404852",minWidth:"40px"},".cm-activeLineGutter":{backgroundColor:"#1a1e25"},".cm-activeLine":{backgroundColor:"rgba(255, 255, 255, 0.03)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"rgba(51, 175, 188, 0.15)"},".cm-line":{fontWeight:"400"},".cm-header-1, .cm-header-2, .cm-header-3, .cm-header-4, .cm-header-5, .cm-header-6":{fontWeight:"400",fontSize:"12px"},".ͼ1 .cm-line .tok-heading":{fontWeight:"400",fontSize:"12px"},".tok-heading":{fontWeight:"400"},".tok-heading1, .tok-heading2, .tok-heading3":{fontWeight:"400",fontSize:"12px"},".cm-panels":{backgroundColor:"#13161b",borderBottom:"1px solid #1e2229"},".cm-panels.cm-panels-top":{borderBottom:"1px solid #1e2229"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid #1e2229"},".cm-search":{padding:"6px 8px",gap:"4px",fontFamily:"var(--font-sans)",fontSize:"11px",display:"flex",flexWrap:"wrap",alignItems:"center"},".cm-search label":{display:"flex",alignItems:"center",gap:"4px",color:"#6e7681",fontSize:"10px"},".cm-search input, .cm-search .cm-textfield":{backgroundColor:"#1a1e25",border:"1px solid #2c313a",borderRadius:"4px",color:"#d4d8e0",padding:"2px 6px",fontSize:"11px",fontFamily:"var(--font-mono)",outline:"none"},".cm-search input:focus, .cm-search .cm-textfield:focus":{borderColor:"#33afbc"},".cm-search .cm-button, .cm-button":{backgroundColor:"#1e2229",border:"1px solid #2c313a",borderRadius:"4px",color:"#a0a8b4",padding:"2px 8px",fontSize:"10px",fontFamily:"var(--font-sans)",cursor:"pointer",backgroundImage:"none"},".cm-search .cm-button:hover, .cm-button:hover":{backgroundColor:"#2c313a",color:"#d4d8e0"},".cm-search .cm-button:active":{backgroundColor:"#333842"},".cm-search br":{display:"none"},".cm-panel.cm-search [name=close]":{color:"#505862",cursor:"pointer",padding:"0 4px"},".cm-panel.cm-search [name=close]:hover":{color:"#d4d8e0"},".cm-searchMatch":{backgroundColor:"rgba(51, 175, 188, 0.15)",outline:"1px solid rgba(51, 175, 188, 0.3)"},".cm-searchMatch-selected":{backgroundColor:"rgba(51, 175, 188, 0.3)"}},{dark:!0});function hE({content:t,language:a,onChange:n,onSave:s,onCursorChange:o,viewRef:c}){const l=g.useRef(null),A=g.useRef(null),u=g.useRef(new cne),f=g.useRef(n),x=g.useRef(s),m=g.useRef(o);return f.current=n,x.current=s,m.current=o,g.useEffect(()=>{if(!l.current)return;const y=gf[a]||gf.javascript,v=ML.of([{key:"Mod-s",run:()=>{var C;return(C=x.current)==null||C.call(x),!0}}]),O=CE.create({doc:t||"",extensions:[sZ(),lne(),dne(),Ane(),une(),rZ(),hne(),ML.of([...oZ,...iZ,...pne]),v,cZ(uze),hze,u.current.of(y()),Ws.updateListener.of(C=>{var j,N;if(C.docChanged&&((j=f.current)==null||j.call(f,C.state.doc.toString())),C.selectionSet||C.docChanged){const M=C.state.selection.main.head,Q=C.state.doc.lineAt(M);(N=m.current)==null||N.call(m,{line:Q.number,col:M-Q.from+1})}})]}),b=new Ws({state:O,parent:l.current});return A.current=b,c&&(c.current=b),()=>{b.destroy(),A.current=null,c&&(c.current=null)}},[]),g.useEffect(()=>{const y=A.current;if(!y)return;const v=y.state.doc.toString();t!==v&&y.dispatch({changes:{from:0,to:v.length,insert:t||""}})},[t]),g.useEffect(()=>{const y=A.current;if(!y)return;const v=gf[a]||gf.javascript;y.dispatch({effects:u.current.reconfigure(v())})},[a]),e.jsx("div",{ref:l,className:"w-full h-full overflow-hidden bg-surface-0"})}const pze=["png","jpg","jpeg","gif","svg","webp","ico","bmp","avif"],IY=["mp4","webm","mov","avi","mkv","ogv"];function UY(t){var n;const a=(n=t.split(".").pop())==null?void 0:n.toLowerCase();return pze.includes(a)||IY.includes(a)}function PY({path:t}){var c;const a=(c=t.split(".").pop())==null?void 0:c.toLowerCase(),n=`/api/files/raw?path=${encodeURIComponent(t)}`,s=t.split("/").pop(),o=IY.includes(a);return e.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center bg-surface-0 p-8 gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-3 font-sans",children:[e.jsx(be,{children:a==null?void 0:a.toUpperCase()}),e.jsx("span",{className:"font-mono",children:s}),e.jsx("a",{href:n,target:"_blank",rel:"noopener",className:"text-accent hover:text-accent/80 transition-colors",children:e.jsx(ma,{size:12})})]}),o?e.jsx("video",{src:n,controls:!0,className:"max-w-full max-h-[70vh] rounded-md border border-border"}):e.jsx("img",{src:n,alt:s,className:"max-w-full max-h-[70vh] rounded-md border border-border object-contain"})]})}const jX=220,fze=140,xze=360;function mze({agents:t,activeId:a,onSelect:n}){return e.jsx("div",{className:"flex flex-col items-center gap-1 py-2 w-12 bg-surface-1 border-r border-border flex-shrink-0",children:t.map(s=>{const o=On(s.role),c=s.id===a,l=s.status==="running"||s.status==="starting",A=(s.role||"?")[0].toUpperCase();return e.jsx(Nt,{content:`${s.name} — ${s.status}`,side:"right",children:e.jsxs("button",{onClick:()=>n(s.id),className:V("relative w-9 h-9 rounded-lg flex items-center justify-center","text-xs font-bold font-sans cursor-pointer transition-all",c?"ring-1.5 ring-accent bg-accent/12":"hover:bg-surface-3"),style:{color:o.text,background:c?o.bg:void 0},children:[A,e.jsx("span",{className:V("absolute bottom-0.5 right-0.5 w-2 h-2 rounded-full border border-surface-1",l?"bg-success animate-pulse":s.status==="completed"?"bg-accent":s.status==="crashed"?"bg-danger":"bg-text-4")})]})},s.id)})})}function gze({tabs:t,activeFile:a,files:n,onSelect:s,onClose:o,diffMode:c,onToggleDiff:l,workspaceSnapshots:A,onBackToTeam:u,onToggleReview:f,reviewMode:x}){const m=a&&A[a];return e.jsxs("div",{className:"flex items-stretch h-8 bg-[#1a1e25] border-b border-[#1e2229] flex-shrink-0",children:[e.jsx("div",{className:"flex items-stretch flex-1 min-w-0 overflow-x-auto scrollbar-none",children:t.map(y=>{const v=y===a,O=n[y],b=O&&O.content!==O.originalContent,C=y.split("/").pop();return e.jsxs("div",{className:V("flex items-center gap-1.5 px-3 text-2xs font-sans cursor-pointer select-none","border-r border-white/5 transition-colors duration-75 flex-shrink-0",v?"bg-surface-0 text-text-1 border-b border-b-accent":"text-text-4 hover:text-text-2 hover:bg-surface-3 border-b border-b-transparent"),onClick:()=>s(y),children:[e.jsx("span",{className:"truncate max-w-[120px]",children:C}),b&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-warning flex-shrink-0"}),e.jsx("button",{onClick:j=>{j.stopPropagation(),o(y)},className:"p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 transition-colors cursor-pointer ml-0.5",children:e.jsx(Ge,{size:10})})]},y)})}),e.jsxs("div",{className:"flex items-center gap-0.5 px-2 border-l border-border-subtle flex-shrink-0",children:[m&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>l(!1),className:V("flex items-center gap-1 px-2 py-1 text-xs font-sans rounded cursor-pointer transition-colors",c?"text-text-3 hover:text-text-1":"bg-surface-4 text-text-0 font-medium"),children:[e.jsx(ou,{size:11})," Code"]}),e.jsxs("button",{onClick:()=>l(!0),className:V("flex items-center gap-1 px-2 py-1 text-xs font-sans rounded cursor-pointer transition-colors",c?"bg-surface-4 text-text-0 font-medium":"text-text-3 hover:text-text-1"),children:[e.jsx(g0,{size:11})," Diff"]}),e.jsx("div",{className:"w-px h-4 bg-border-subtle mx-1"})]}),e.jsx(Nt,{content:"Review Changes",side:"bottom",children:e.jsx("button",{onClick:f,className:V("flex items-center gap-1 px-2 py-1 text-xs font-sans rounded cursor-pointer transition-colors",x?"bg-accent/15 text-accent":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:e.jsx(u0,{size:12})})}),e.jsx(Nt,{content:"Back to Team View",side:"bottom",children:e.jsxs("button",{onClick:u,className:"flex items-center gap-1 px-2 py-1 text-xs font-sans rounded cursor-pointer transition-colors text-text-3 hover:text-text-1 hover:bg-surface-3",children:[e.jsx(Fa,{size:12}),e.jsx("span",{className:"text-2xs",children:"Team"})]})})]})]})}function yze(){const t=$(G=>G.agents),a=$(G=>G.activeTeamId),n=$(G=>G.workspaceAgentId),s=$(G=>G.setWorkspaceAgent),o=$(G=>G.workspaceReviewMode),c=$(G=>G.toggleReviewMode),l=$(G=>G.workspaceSnapshots),A=$(G=>G.setWorkspaceMode),u=$(G=>G.editorFiles),f=$(G=>G.editorActiveFile),x=$(G=>G.editorOpenTabs),m=$(G=>G.setActiveFile),y=$(G=>G.closeFile),v=$(G=>G.updateFileContent),O=$(G=>G.saveFile),b=t.filter(G=>G.teamId===a),C=b.find(G=>G.id===n)||b[0],[j,N]=g.useState(jX),[M,Q]=g.useState(!1),[L,B]=g.useState(!1),S=g.useRef(!1),I=g.useRef(0),z=g.useRef(0);g.useEffect(()=>{Q(!1)},[f]);const P=g.useCallback(G=>{G.preventDefault(),S.current=!0,I.current=G.clientX,z.current=j;function H(_){S.current&&N(Math.min(Math.max(z.current+_.clientX-I.current,fze),xze))}function q(){S.current=!1,document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",q)}document.addEventListener("mousemove",H),document.addEventListener("mouseup",q)},[j]);if(!C)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-4 text-xs font-sans",children:"No agents in this team"});const F=f?u[f]:null,K=f&&UY(f);return e.jsxs("div",{className:"flex h-full bg-surface-1",children:[e.jsx(mze,{agents:b,activeId:C.id,onSelect:s}),e.jsxs("div",{className:"flex flex-1 min-w-0",children:[e.jsxs("div",{className:V("relative flex-shrink-0 bg-surface-1 border-r border-border transition-all duration-200 overflow-hidden",L&&"w-0 border-r-0"),style:L?void 0:{width:j},children:[e.jsx($$e,{agentId:C.id,onCollapse:()=>B(!0)}),e.jsx("div",{className:"absolute top-0 right-0 bottom-0 w-1 cursor-col-resize hover:bg-accent/30 transition-colors z-10",onMouseDown:P,onDoubleClick:()=>N(jX)})]}),L&&e.jsx("button",{onClick:()=>B(!1),className:"flex-shrink-0 w-6 flex items-start justify-center pt-2 border-r border-border bg-surface-2 text-text-4 hover:text-text-0 hover:bg-surface-3 transition-colors cursor-pointer",title:"Show sidebar",children:e.jsx(xs,{size:14})}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-surface-1",children:o?e.jsx(U$e,{agentId:C.id}):e.jsxs(e.Fragment,{children:[e.jsx(gze,{tabs:x,activeFile:f,files:u,onSelect:m,onClose:y,diffMode:M,onToggleDiff:Q,workspaceSnapshots:l,onBackToTeam:()=>A(!1),onToggleReview:c,reviewMode:o}),e.jsxs("div",{className:"flex-1 relative min-h-0",children:[!f&&e.jsx("div",{className:"w-full h-full flex items-center justify-center text-text-4 font-sans bg-surface-1",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(Zt,{size:32,className:"mx-auto"}),e.jsx("p",{className:"text-sm",children:"Open a file from the tree"}),e.jsxs("p",{className:"text-2xs text-text-4",children:["Files scoped to ",C.name]})]})}),f&&K&&e.jsx(PY,{path:f}),f&&M&&!K&&e.jsx(hK,{filePath:f}),f&&!M&&!K&&F&&e.jsx(hE,{content:F.content,language:F.language,onChange:G=>v(f,G),onSave:()=>O(f)})]})]})})]})]})}function Oz(t){const a=t+"CollectionProvider",[n,s]=tr(a),[o,c]=n(a,{collectionRef:{current:null},itemMap:new Map}),l=b=>{const{scope:C,children:j}=b,N=Lo.useRef(null),M=Lo.useRef(new Map).current;return e.jsx(o,{scope:C,itemMap:M,collectionRef:N,children:j})};l.displayName=a;const A=t+"CollectionSlot",u=Su(A),f=Lo.forwardRef((b,C)=>{const{scope:j,children:N}=b,M=c(A,j),Q=rt(C,M.collectionRef);return e.jsx(u,{ref:Q,children:N})});f.displayName=A;const x=t+"CollectionItemSlot",m="data-radix-collection-item",y=Su(x),v=Lo.forwardRef((b,C)=>{const{scope:j,children:N,...M}=b,Q=Lo.useRef(null),L=rt(C,Q),B=c(x,j);return Lo.useEffect(()=>(B.itemMap.set(Q,{ref:Q,...M}),()=>void B.itemMap.delete(Q))),e.jsx(y,{[m]:"",ref:L,children:N})});v.displayName=x;function O(b){const C=c(t+"CollectionConsumer",b);return Lo.useCallback(()=>{const N=C.collectionRef.current;if(!N)return[];const M=Array.from(N.querySelectorAll(`[${m}]`));return Array.from(C.itemMap.values()).sort((B,S)=>M.indexOf(B.ref.current)-M.indexOf(S.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:f,ItemSlot:v},O,s]}var cP="rovingFocusGroup.onEntryFocus",vze={bubbles:!1,cancelable:!0},g2="RovingFocusGroup",[pE,EY,kze]=Oz(g2),[Oze,IT]=tr(g2,[kze]),[bze,wze]=Oze(g2),zY=g.forwardRef((t,a)=>e.jsx(pE.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(pE.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(jze,{...t,ref:a})})}));zY.displayName=g2;var jze=g.forwardRef((t,a)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:o=!1,dir:c,currentTabStopId:l,defaultCurrentTabStopId:A,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:x=!1,...m}=t,y=g.useRef(null),v=rt(a,y),O=m2(c),[b,C]=Bu({prop:l,defaultProp:A??null,onChange:u,caller:g2}),[j,N]=g.useState(!1),M=xa(f),Q=EY(n),L=g.useRef(!1),[B,S]=g.useState(0);return g.useEffect(()=>{const I=y.current;if(I)return I.addEventListener(cP,M),()=>I.removeEventListener(cP,M)},[M]),e.jsx(bze,{scope:n,orientation:s,dir:O,loop:o,currentTabStopId:b,onItemFocus:g.useCallback(I=>C(I),[C]),onItemShiftTab:g.useCallback(()=>N(!0),[]),onFocusableItemAdd:g.useCallback(()=>S(I=>I+1),[]),onFocusableItemRemove:g.useCallback(()=>S(I=>I-1),[]),children:e.jsx(Ve.div,{tabIndex:j||B===0?-1:0,"data-orientation":s,...m,ref:v,style:{outline:"none",...t.style},onMouseDown:Se(t.onMouseDown,()=>{L.current=!0}),onFocus:Se(t.onFocus,I=>{const z=!L.current;if(I.target===I.currentTarget&&z&&!j){const P=new CustomEvent(cP,vze);if(I.currentTarget.dispatchEvent(P),!P.defaultPrevented){const F=Q().filter(_=>_.focusable),K=F.find(_=>_.active),G=F.find(_=>_.id===b),q=[K,G,...F].filter(Boolean).map(_=>_.ref.current);HY(q,x)}}L.current=!1}),onBlur:Se(t.onBlur,()=>N(!1))})})}),FY="RovingFocusGroupItem",RY=g.forwardRef((t,a)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:o=!1,tabStopId:c,children:l,...A}=t,u=zr(),f=c||u,x=wze(FY,n),m=x.currentTabStopId===f,y=EY(n),{onFocusableItemAdd:v,onFocusableItemRemove:O,currentTabStopId:b}=x;return g.useEffect(()=>{if(s)return v(),()=>O()},[s,v,O]),e.jsx(pE.ItemSlot,{scope:n,id:f,focusable:s,active:o,children:e.jsx(Ve.span,{tabIndex:m?0:-1,"data-orientation":x.orientation,...A,ref:a,onMouseDown:Se(t.onMouseDown,C=>{s?x.onItemFocus(f):C.preventDefault()}),onFocus:Se(t.onFocus,()=>x.onItemFocus(f)),onKeyDown:Se(t.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){x.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const j=Mze(C,x.orientation,x.dir);if(j!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let M=y().filter(Q=>Q.focusable).map(Q=>Q.ref.current);if(j==="last")M.reverse();else if(j==="prev"||j==="next"){j==="prev"&&M.reverse();const Q=M.indexOf(C.currentTarget);M=x.loop?Sze(M,Q+1):M.slice(Q+1)}setTimeout(()=>HY(M))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:b!=null}):l})})});RY.displayName=FY;var Cze={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nze(t,a){return a!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Mze(t,a,n){const s=Nze(t.key,n);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return Cze[s]}function HY(t,a=!1){const n=document.activeElement;for(const s of t)if(s===n||(s.focus({preventScroll:a}),document.activeElement!==n))return}function Sze(t,a){return t.map((n,s)=>t[(a+s)%t.length])}var qY=zY,DY=RY,fE=["Enter"," "],Qze=["ArrowDown","PageUp","Home"],VY=["ArrowUp","PageDown","End"],Bze=[...Qze,...VY],_ze={ltr:[...fE,"ArrowRight"],rtl:[...fE,"ArrowLeft"]},Lze={ltr:["ArrowLeft"],rtl:["ArrowRight"]},y2="Menu",[o2,Tze,$ze]=Oz(y2),[KA,XY]=tr(y2,[$ze,Ru,IT]),UT=Ru(),ZY=IT(),[Ize,YA]=KA(y2),[Uze,v2]=KA(y2),GY=t=>{const{__scopeMenu:a,open:n=!1,children:s,dir:o,onOpenChange:c,modal:l=!0}=t,A=UT(a),[u,f]=g.useState(null),x=g.useRef(!1),m=xa(c),y=m2(o);return g.useEffect(()=>{const v=()=>{x.current=!0,document.addEventListener("pointerdown",O,{capture:!0,once:!0}),document.addEventListener("pointermove",O,{capture:!0,once:!0})},O=()=>x.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",O,{capture:!0}),document.removeEventListener("pointermove",O,{capture:!0})}},[]),e.jsx(PE,{...A,children:e.jsx(Ize,{scope:a,open:n,onOpenChange:m,content:u,onContentChange:f,children:e.jsx(Uze,{scope:a,onClose:g.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:x,dir:y,modal:l,children:s})})})};GY.displayName=y2;var Pze="MenuAnchor",bz=g.forwardRef((t,a)=>{const{__scopeMenu:n,...s}=t,o=UT(n);return e.jsx(EE,{...o,...s,ref:a})});bz.displayName=Pze;var wz="MenuPortal",[Eze,WY]=KA(wz,{forceMount:void 0}),KY=t=>{const{__scopeMenu:a,forceMount:n,children:s,container:o}=t,c=YA(wz,a);return e.jsx(Eze,{scope:a,forceMount:n,children:e.jsx(Za,{present:n||c.open,children:e.jsx(h2,{asChild:!0,container:o,children:s})})})};KY.displayName=wz;var ts="MenuContent",[zze,jz]=KA(ts),YY=g.forwardRef((t,a)=>{const n=WY(ts,t.__scopeMenu),{forceMount:s=n.forceMount,...o}=t,c=YA(ts,t.__scopeMenu),l=v2(ts,t.__scopeMenu);return e.jsx(o2.Provider,{scope:t.__scopeMenu,children:e.jsx(Za,{present:s||c.open,children:e.jsx(o2.Slot,{scope:t.__scopeMenu,children:l.modal?e.jsx(Fze,{...o,ref:a}):e.jsx(Rze,{...o,ref:a})})})})}),Fze=g.forwardRef((t,a)=>{const n=YA(ts,t.__scopeMenu),s=g.useRef(null),o=rt(a,s);return g.useEffect(()=>{const c=s.current;if(c)return VE(c)},[]),e.jsx(Cz,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Se(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Rze=g.forwardRef((t,a)=>{const n=YA(ts,t.__scopeMenu);return e.jsx(Cz,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Hze=Su("MenuContent.ScrollLock"),Cz=g.forwardRef((t,a)=>{const{__scopeMenu:n,loop:s=!1,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:l,disableOutsidePointerEvents:A,onEntryFocus:u,onEscapeKeyDown:f,onPointerDownOutside:x,onFocusOutside:m,onInteractOutside:y,onDismiss:v,disableOutsideScroll:O,...b}=t,C=YA(ts,n),j=v2(ts,n),N=UT(n),M=ZY(n),Q=Tze(n),[L,B]=g.useState(null),S=g.useRef(null),I=rt(a,S,C.onContentChange),z=g.useRef(0),P=g.useRef(""),F=g.useRef(0),K=g.useRef(null),G=g.useRef("right"),H=g.useRef(0),q=O?yT:g.Fragment,_=O?{as:Hze,allowPinchZoom:!0}:void 0,R=Z=>{var he,je;const J=P.current+Z,Ae=Q().filter(ee=>!ee.disabled),W=document.activeElement,ae=(he=Ae.find(ee=>ee.ref.current===W))==null?void 0:he.textValue,Oe=Ae.map(ee=>ee.textValue),ve=tFe(Oe,J,ae),ce=(je=Ae.find(ee=>ee.textValue===ve))==null?void 0:je.ref.current;(function ee(ke){P.current=ke,window.clearTimeout(z.current),ke!==""&&(z.current=window.setTimeout(()=>ee(""),1e3))})(J),ce&&setTimeout(()=>ce.focus())};g.useEffect(()=>()=>window.clearTimeout(z.current),[]),DE();const U=g.useCallback(Z=>{var Ae,W;return G.current===((Ae=K.current)==null?void 0:Ae.side)&&nFe(Z,(W=K.current)==null?void 0:W.area)},[]);return e.jsx(zze,{scope:n,searchRef:P,onItemEnter:g.useCallback(Z=>{U(Z)&&Z.preventDefault()},[U]),onItemLeave:g.useCallback(Z=>{var J;U(Z)||((J=S.current)==null||J.focus(),B(null))},[U]),onTriggerLeave:g.useCallback(Z=>{U(Z)&&Z.preventDefault()},[U]),pointerGraceTimerRef:F,onPointerGraceIntentChange:g.useCallback(Z=>{K.current=Z},[]),children:e.jsx(q,{..._,children:e.jsx(mT,{asChild:!0,trapped:o,onMountAutoFocus:Se(c,Z=>{var J;Z.preventDefault(),(J=S.current)==null||J.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:e.jsx(A2,{asChild:!0,disableOutsidePointerEvents:A,onEscapeKeyDown:f,onPointerDownOutside:x,onFocusOutside:m,onInteractOutside:y,onDismiss:v,children:e.jsx(qY,{asChild:!0,...M,dir:j.dir,orientation:"vertical",loop:s,currentTabStopId:L,onCurrentTabStopIdChange:B,onEntryFocus:Se(u,Z=>{j.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:e.jsx(zE,{role:"menu","aria-orientation":"vertical","data-state":pJ(C.open),"data-radix-menu-content":"",dir:j.dir,...N,...b,ref:I,style:{outline:"none",...b.style},onKeyDown:Se(b.onKeyDown,Z=>{const Ae=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,W=Z.ctrlKey||Z.altKey||Z.metaKey,ae=Z.key.length===1;Ae&&(Z.key==="Tab"&&Z.preventDefault(),!W&&ae&&R(Z.key));const Oe=S.current;if(Z.target!==Oe||!Bze.includes(Z.key))return;Z.preventDefault();const ce=Q().filter(he=>!he.disabled).map(he=>he.ref.current);VY.includes(Z.key)&&ce.reverse(),Jze(ce)}),onBlur:Se(t.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(z.current),P.current="")}),onPointerMove:Se(t.onPointerMove,i2(Z=>{const J=Z.target,Ae=H.current!==Z.clientX;if(Z.currentTarget.contains(J)&&Ae){const W=Z.clientX>H.current?"right":"left";G.current=W,H.current=Z.clientX}}))})})})})})})});YY.displayName=ts;var qze="MenuGroup",Nz=g.forwardRef((t,a)=>{const{__scopeMenu:n,...s}=t;return e.jsx(Ve.div,{role:"group",...s,ref:a})});Nz.displayName=qze;var Dze="MenuLabel",JY=g.forwardRef((t,a)=>{const{__scopeMenu:n,...s}=t;return e.jsx(Ve.div,{...s,ref:a})});JY.displayName=Dze;var aT="MenuItem",CX="menu.itemSelect",PT=g.forwardRef((t,a)=>{const{disabled:n=!1,onSelect:s,...o}=t,c=g.useRef(null),l=v2(aT,t.__scopeMenu),A=jz(aT,t.__scopeMenu),u=rt(a,c),f=g.useRef(!1),x=()=>{const m=c.current;if(!n&&m){const y=new CustomEvent(CX,{bubbles:!0,cancelable:!0});m.addEventListener(CX,v=>s==null?void 0:s(v),{once:!0}),MZ(m,y),y.defaultPrevented?f.current=!1:l.onClose()}};return e.jsx(eJ,{...o,ref:u,disabled:n,onClick:Se(t.onClick,x),onPointerDown:m=>{var y;(y=t.onPointerDown)==null||y.call(t,m),f.current=!0},onPointerUp:Se(t.onPointerUp,m=>{var y;f.current||(y=m.currentTarget)==null||y.click()}),onKeyDown:Se(t.onKeyDown,m=>{const y=A.searchRef.current!=="";n||y&&m.key===" "||fE.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});PT.displayName=aT;var eJ=g.forwardRef((t,a)=>{const{__scopeMenu:n,disabled:s=!1,textValue:o,...c}=t,l=jz(aT,n),A=ZY(n),u=g.useRef(null),f=rt(a,u),[x,m]=g.useState(!1),[y,v]=g.useState("");return g.useEffect(()=>{const O=u.current;O&&v((O.textContent??"").trim())},[c.children]),e.jsx(o2.ItemSlot,{scope:n,disabled:s,textValue:o??y,children:e.jsx(DY,{asChild:!0,...A,focusable:!s,children:e.jsx(Ve.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...c,ref:f,onPointerMove:Se(t.onPointerMove,i2(O=>{s?l.onItemLeave(O):(l.onItemEnter(O),O.defaultPrevented||O.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(t.onPointerLeave,i2(O=>l.onItemLeave(O))),onFocus:Se(t.onFocus,()=>m(!0)),onBlur:Se(t.onBlur,()=>m(!1))})})})}),Vze="MenuCheckboxItem",tJ=g.forwardRef((t,a)=>{const{checked:n=!1,onCheckedChange:s,...o}=t;return e.jsx(oJ,{scope:t.__scopeMenu,checked:n,children:e.jsx(PT,{role:"menuitemcheckbox","aria-checked":nT(n)?"mixed":n,...o,ref:a,"data-state":Sz(n),onSelect:Se(o.onSelect,()=>s==null?void 0:s(nT(n)?!0:!n),{checkForDefaultPrevented:!1})})})});tJ.displayName=Vze;var aJ="MenuRadioGroup",[Xze,Zze]=KA(aJ,{value:void 0,onValueChange:()=>{}}),nJ=g.forwardRef((t,a)=>{const{value:n,onValueChange:s,...o}=t,c=xa(s);return e.jsx(Xze,{scope:t.__scopeMenu,value:n,onValueChange:c,children:e.jsx(Nz,{...o,ref:a})})});nJ.displayName=aJ;var sJ="MenuRadioItem",rJ=g.forwardRef((t,a)=>{const{value:n,...s}=t,o=Zze(sJ,t.__scopeMenu),c=n===o.value;return e.jsx(oJ,{scope:t.__scopeMenu,checked:c,children:e.jsx(PT,{role:"menuitemradio","aria-checked":c,...s,ref:a,"data-state":Sz(c),onSelect:Se(s.onSelect,()=>{var l;return(l=o.onValueChange)==null?void 0:l.call(o,n)},{checkForDefaultPrevented:!1})})})});rJ.displayName=sJ;var Mz="MenuItemIndicator",[oJ,Gze]=KA(Mz,{checked:!1}),iJ=g.forwardRef((t,a)=>{const{__scopeMenu:n,forceMount:s,...o}=t,c=Gze(Mz,n);return e.jsx(Za,{present:s||nT(c.checked)||c.checked===!0,children:e.jsx(Ve.span,{...o,ref:a,"data-state":Sz(c.checked)})})});iJ.displayName=Mz;var Wze="MenuSeparator",cJ=g.forwardRef((t,a)=>{const{__scopeMenu:n,...s}=t;return e.jsx(Ve.div,{role:"separator","aria-orientation":"horizontal",...s,ref:a})});cJ.displayName=Wze;var Kze="MenuArrow",lJ=g.forwardRef((t,a)=>{const{__scopeMenu:n,...s}=t,o=UT(n);return e.jsx(FE,{...o,...s,ref:a})});lJ.displayName=Kze;var Yze="MenuSub",[wZe,dJ]=KA(Yze),n0="MenuSubTrigger",AJ=g.forwardRef((t,a)=>{const n=YA(n0,t.__scopeMenu),s=v2(n0,t.__scopeMenu),o=dJ(n0,t.__scopeMenu),c=jz(n0,t.__scopeMenu),l=g.useRef(null),{pointerGraceTimerRef:A,onPointerGraceIntentChange:u}=c,f={__scopeMenu:t.__scopeMenu},x=g.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return g.useEffect(()=>x,[x]),g.useEffect(()=>{const m=A.current;return()=>{window.clearTimeout(m),u(null)}},[A,u]),e.jsx(bz,{asChild:!0,...f,children:e.jsx(eJ,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":pJ(n.open),...t,ref:SE(a,o.onTriggerChange),onClick:m=>{var y;(y=t.onClick)==null||y.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Se(t.onPointerMove,i2(m=>{c.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!l.current&&(c.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),x()},100))})),onPointerLeave:Se(t.onPointerLeave,i2(m=>{var v,O;x();const y=(v=n.content)==null?void 0:v.getBoundingClientRect();if(y){const b=(O=n.content)==null?void 0:O.dataset.side,C=b==="right",j=C?-5:5,N=y[C?"left":"right"],M=y[C?"right":"left"];c.onPointerGraceIntentChange({area:[{x:m.clientX+j,y:m.clientY},{x:N,y:y.top},{x:M,y:y.top},{x:M,y:y.bottom},{x:N,y:y.bottom}],side:b}),window.clearTimeout(A.current),A.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(m),m.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:Se(t.onKeyDown,m=>{var v;const y=c.searchRef.current!=="";t.disabled||y&&m.key===" "||_ze[s.dir].includes(m.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),m.preventDefault())})})})});AJ.displayName=n0;var uJ="MenuSubContent",hJ=g.forwardRef((t,a)=>{const n=WY(ts,t.__scopeMenu),{forceMount:s=n.forceMount,...o}=t,c=YA(ts,t.__scopeMenu),l=v2(ts,t.__scopeMenu),A=dJ(uJ,t.__scopeMenu),u=g.useRef(null),f=rt(a,u);return e.jsx(o2.Provider,{scope:t.__scopeMenu,children:e.jsx(Za,{present:s||c.open,children:e.jsx(o2.Slot,{scope:t.__scopeMenu,children:e.jsx(Cz,{id:A.contentId,"aria-labelledby":A.triggerId,...o,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:x=>{var m;l.isUsingKeyboardRef.current&&((m=u.current)==null||m.focus()),x.preventDefault()},onCloseAutoFocus:x=>x.preventDefault(),onFocusOutside:Se(t.onFocusOutside,x=>{x.target!==A.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:Se(t.onEscapeKeyDown,x=>{l.onClose(),x.preventDefault()}),onKeyDown:Se(t.onKeyDown,x=>{var v;const m=x.currentTarget.contains(x.target),y=Lze[l.dir].includes(x.key);m&&y&&(c.onOpenChange(!1),(v=A.trigger)==null||v.focus(),x.preventDefault())})})})})})});hJ.displayName=uJ;function pJ(t){return t?"open":"closed"}function nT(t){return t==="indeterminate"}function Sz(t){return nT(t)?"indeterminate":t?"checked":"unchecked"}function Jze(t){const a=document.activeElement;for(const n of t)if(n===a||(n.focus(),document.activeElement!==a))return}function eFe(t,a){return t.map((n,s)=>t[(a+s)%t.length])}function tFe(t,a,n){const o=a.length>1&&Array.from(a).every(f=>f===a[0])?a[0]:a,c=n?t.indexOf(n):-1;let l=eFe(t,Math.max(c,0));o.length===1&&(l=l.filter(f=>f!==n));const u=l.find(f=>f.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function aFe(t,a){const{x:n,y:s}=t;let o=!1;for(let c=0,l=a.length-1;c<a.length;l=c++){const A=a[c],u=a[l],f=A.x,x=A.y,m=u.x,y=u.y;x>s!=y>s&&n<(m-f)*(s-x)/(y-x)+f&&(o=!o)}return o}function nFe(t,a){if(!a)return!1;const n={x:t.clientX,y:t.clientY};return aFe(n,a)}function i2(t){return a=>a.pointerType==="mouse"?t(a):void 0}var sFe=GY,rFe=bz,oFe=KY,iFe=YY,cFe=Nz,lFe=JY,dFe=PT,AFe=tJ,uFe=nJ,hFe=rJ,pFe=iJ,fFe=cJ,xFe=lJ,mFe=AJ,gFe=hJ,Qz="ContextMenu",[yFe]=tr(Qz,[XY]),Ga=XY(),[vFe,fJ]=yFe(Qz),xJ=t=>{const{__scopeContextMenu:a,children:n,onOpenChange:s,dir:o,modal:c=!0}=t,[l,A]=g.useState(!1),u=Ga(a),f=xa(s),x=g.useCallback(m=>{A(m),f(m)},[f]);return e.jsx(vFe,{scope:a,open:l,onOpenChange:x,modal:c,children:e.jsx(sFe,{...u,dir:o,open:l,onOpenChange:x,modal:c,children:n})})};xJ.displayName=Qz;var mJ="ContextMenuTrigger",gJ=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,disabled:s=!1,...o}=t,c=fJ(mJ,n),l=Ga(n),A=g.useRef({x:0,y:0}),u=g.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...A.current})}),f=g.useRef(0),x=g.useCallback(()=>window.clearTimeout(f.current),[]),m=y=>{A.current={x:y.clientX,y:y.clientY},c.onOpenChange(!0)};return g.useEffect(()=>x,[x]),g.useEffect(()=>void(s&&x()),[s,x]),e.jsxs(e.Fragment,{children:[e.jsx(rFe,{...l,virtualRef:u}),e.jsx(Ve.span,{"data-state":c.open?"open":"closed","data-disabled":s?"":void 0,...o,ref:a,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:s?t.onContextMenu:Se(t.onContextMenu,y=>{x(),m(y),y.preventDefault()}),onPointerDown:s?t.onPointerDown:Se(t.onPointerDown,yf(y=>{x(),f.current=window.setTimeout(()=>m(y),700)})),onPointerMove:s?t.onPointerMove:Se(t.onPointerMove,yf(x)),onPointerCancel:s?t.onPointerCancel:Se(t.onPointerCancel,yf(x)),onPointerUp:s?t.onPointerUp:Se(t.onPointerUp,yf(x))})]})});gJ.displayName=mJ;var kFe="ContextMenuPortal",yJ=t=>{const{__scopeContextMenu:a,...n}=t,s=Ga(a);return e.jsx(oFe,{...s,...n})};yJ.displayName=kFe;var vJ="ContextMenuContent",kJ=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=fJ(vJ,n),c=Ga(n),l=g.useRef(!1);return e.jsx(iFe,{...c,...s,ref:a,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:A=>{var u;(u=t.onCloseAutoFocus)==null||u.call(t,A),!A.defaultPrevented&&l.current&&A.preventDefault(),l.current=!1},onInteractOutside:A=>{var u;(u=t.onInteractOutside)==null||u.call(t,A),!A.defaultPrevented&&!o.modal&&(l.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kJ.displayName=vJ;var OFe="ContextMenuGroup",bFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(cFe,{...o,...s,ref:a})});bFe.displayName=OFe;var wFe="ContextMenuLabel",jFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(lFe,{...o,...s,ref:a})});jFe.displayName=wFe;var CFe="ContextMenuItem",OJ=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(dFe,{...o,...s,ref:a})});OJ.displayName=CFe;var NFe="ContextMenuCheckboxItem",MFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(AFe,{...o,...s,ref:a})});MFe.displayName=NFe;var SFe="ContextMenuRadioGroup",QFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(uFe,{...o,...s,ref:a})});QFe.displayName=SFe;var BFe="ContextMenuRadioItem",_Fe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(hFe,{...o,...s,ref:a})});_Fe.displayName=BFe;var LFe="ContextMenuItemIndicator",TFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(pFe,{...o,...s,ref:a})});TFe.displayName=LFe;var $Fe="ContextMenuSeparator",bJ=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(fFe,{...o,...s,ref:a})});bJ.displayName=$Fe;var IFe="ContextMenuArrow",UFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(xFe,{...o,...s,ref:a})});UFe.displayName=IFe;var PFe="ContextMenuSubTrigger",EFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(mFe,{...o,...s,ref:a})});EFe.displayName=PFe;var zFe="ContextMenuSubContent",FFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(gFe,{...o,...s,ref:a,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});FFe.displayName=zFe;function yf(t){return a=>a.pointerType!=="mouse"?t(a):void 0}var RFe=xJ,HFe=gJ,qFe=yJ,DFe=kJ,VFe=OJ,XFe=bJ;const Bz=RFe,_z=HFe;function Lz({children:t,className:a,...n}){return e.jsx(qFe,{children:e.jsx(DFe,{className:V("z-50 min-w-[160px] overflow-hidden rounded-md","bg-surface-1 border border-border shadow-xl","py-1","animate-in fade-in-0 zoom-in-95",a),...n,children:t})})}function ms({children:t,className:a,danger:n,...s}){return e.jsx(VFe,{className:V("flex items-center gap-2 px-3 py-1.5 text-sm font-sans cursor-pointer select-none outline-none",n?"text-danger focus:bg-danger/10":"text-text-1 focus:bg-surface-5 focus:text-text-0",a),...s,children:t})}function Tz({className:t}){return e.jsx(XFe,{className:V("h-px my-1 bg-border-subtle",t)})}function ZFe(t){const a=g.useRef({value:t,previous:t});return g.useMemo(()=>(a.current.value!==t&&(a.current.previous=a.current.value,a.current.value=t),a.current.previous),[t])}var GFe=[" ","Enter","ArrowUp","ArrowDown"],WFe=[" ","Enter"],DA="Select",[ET,zT,KFe]=Oz(DA),[Du]=tr(DA,[KFe,Ru]),FT=Ru(),[YFe,ui]=Du(DA),[JFe,eRe]=Du(DA),wJ=t=>{const{__scopeSelect:a,children:n,open:s,defaultOpen:o,onOpenChange:c,value:l,defaultValue:A,onValueChange:u,dir:f,name:x,autoComplete:m,disabled:y,required:v,form:O}=t,b=FT(a),[C,j]=g.useState(null),[N,M]=g.useState(null),[Q,L]=g.useState(!1),B=m2(f),[S,I]=Bu({prop:s,defaultProp:o??!1,onChange:c,caller:DA}),[z,P]=Bu({prop:l,defaultProp:A,onChange:u,caller:DA}),F=g.useRef(null),K=C?O||!!C.closest("form"):!0,[G,H]=g.useState(new Set),q=Array.from(G).map(_=>_.props.value).join(";");return e.jsx(PE,{...b,children:e.jsxs(YFe,{required:v,scope:a,trigger:C,onTriggerChange:j,valueNode:N,onValueNodeChange:M,valueNodeHasChildren:Q,onValueNodeHasChildrenChange:L,contentId:zr(),value:z,onValueChange:P,open:S,onOpenChange:I,dir:B,triggerPointerDownPosRef:F,disabled:y,children:[e.jsx(ET.Provider,{scope:a,children:e.jsx(JFe,{scope:t.__scopeSelect,onNativeOptionAdd:g.useCallback(_=>{H(R=>new Set(R).add(_))},[]),onNativeOptionRemove:g.useCallback(_=>{H(R=>{const U=new Set(R);return U.delete(_),U})},[]),children:n})}),K?e.jsxs(qJ,{"aria-hidden":!0,required:v,tabIndex:-1,name:x,autoComplete:m,value:z,onChange:_=>P(_.target.value),disabled:y,form:O,children:[z===void 0?e.jsx("option",{value:""}):null,Array.from(G)]},q):null]})})};wJ.displayName=DA;var jJ="SelectTrigger",CJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,disabled:s=!1,...o}=t,c=FT(n),l=ui(jJ,n),A=l.disabled||s,u=rt(a,l.onTriggerChange),f=zT(n),x=g.useRef("touch"),[m,y,v]=VJ(b=>{const C=f().filter(M=>!M.disabled),j=C.find(M=>M.value===l.value),N=XJ(C,b,j);N!==void 0&&l.onValueChange(N.value)}),O=b=>{A||(l.onOpenChange(!0),v()),b&&(l.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return e.jsx(EE,{asChild:!0,...c,children:e.jsx(Ve.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:A,"data-disabled":A?"":void 0,"data-placeholder":DJ(l.value)?"":void 0,...o,ref:u,onClick:Se(o.onClick,b=>{b.currentTarget.focus(),x.current!=="mouse"&&O(b)}),onPointerDown:Se(o.onPointerDown,b=>{x.current=b.pointerType;const C=b.target;C.hasPointerCapture(b.pointerId)&&C.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(O(b),b.preventDefault())}),onKeyDown:Se(o.onKeyDown,b=>{const C=m.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&y(b.key),!(C&&b.key===" ")&&GFe.includes(b.key)&&(O(),b.preventDefault())})})})});CJ.displayName=jJ;var NJ="SelectValue",MJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,className:s,style:o,children:c,placeholder:l="",...A}=t,u=ui(NJ,n),{onValueNodeHasChildrenChange:f}=u,x=c!==void 0,m=rt(a,u.onValueNodeChange);return Ta(()=>{f(x)},[f,x]),e.jsx(Ve.span,{...A,ref:m,style:{pointerEvents:"none"},children:DJ(u.value)?e.jsx(e.Fragment,{children:l}):c})});MJ.displayName=NJ;var tRe="SelectIcon",SJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,children:s,...o}=t;return e.jsx(Ve.span,{"aria-hidden":!0,...o,ref:a,children:s||"▼"})});SJ.displayName=tRe;var aRe="SelectPortal",QJ=t=>e.jsx(h2,{asChild:!0,...t});QJ.displayName=aRe;var VA="SelectContent",BJ=g.forwardRef((t,a)=>{const n=ui(VA,t.__scopeSelect),[s,o]=g.useState();if(Ta(()=>{o(new DocumentFragment)},[]),!n.open){const c=s;return c?cT.createPortal(e.jsx(_J,{scope:t.__scopeSelect,children:e.jsx(ET.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),c):null}return e.jsx(LJ,{...t,ref:a})});BJ.displayName=VA;var As=10,[_J,hi]=Du(VA),nRe="SelectContentImpl",sRe=Su("SelectContent.RemoveScroll"),LJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:c,onPointerDownOutside:l,side:A,sideOffset:u,align:f,alignOffset:x,arrowPadding:m,collisionBoundary:y,collisionPadding:v,sticky:O,hideWhenDetached:b,avoidCollisions:C,...j}=t,N=ui(VA,n),[M,Q]=g.useState(null),[L,B]=g.useState(null),S=rt(a,he=>Q(he)),[I,z]=g.useState(null),[P,F]=g.useState(null),K=zT(n),[G,H]=g.useState(!1),q=g.useRef(!1);g.useEffect(()=>{if(M)return VE(M)},[M]),DE();const _=g.useCallback(he=>{const[je,...ee]=K().map(Ne=>Ne.ref.current),[ke]=ee.slice(-1),ye=document.activeElement;for(const Ne of he)if(Ne===ye||(Ne==null||Ne.scrollIntoView({block:"nearest"}),Ne===je&&L&&(L.scrollTop=0),Ne===ke&&L&&(L.scrollTop=L.scrollHeight),Ne==null||Ne.focus(),document.activeElement!==ye))return},[K,L]),R=g.useCallback(()=>_([I,M]),[_,I,M]);g.useEffect(()=>{G&&R()},[G,R]);const{onOpenChange:U,triggerPointerDownPosRef:Z}=N;g.useEffect(()=>{if(M){let he={x:0,y:0};const je=ke=>{var ye,Ne;he={x:Math.abs(Math.round(ke.pageX)-(((ye=Z.current)==null?void 0:ye.x)??0)),y:Math.abs(Math.round(ke.pageY)-(((Ne=Z.current)==null?void 0:Ne.y)??0))}},ee=ke=>{he.x<=10&&he.y<=10?ke.preventDefault():M.contains(ke.target)||U(!1),document.removeEventListener("pointermove",je),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",je),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",je),document.removeEventListener("pointerup",ee,{capture:!0})}}},[M,U,Z]),g.useEffect(()=>{const he=()=>U(!1);return window.addEventListener("blur",he),window.addEventListener("resize",he),()=>{window.removeEventListener("blur",he),window.removeEventListener("resize",he)}},[U]);const[J,Ae]=VJ(he=>{const je=K().filter(ye=>!ye.disabled),ee=je.find(ye=>ye.ref.current===document.activeElement),ke=XJ(je,he,ee);ke&&setTimeout(()=>ke.ref.current.focus())}),W=g.useCallback((he,je,ee)=>{const ke=!q.current&&!ee;(N.value!==void 0&&N.value===je||ke)&&(z(he),ke&&(q.current=!0))},[N.value]),ae=g.useCallback(()=>M==null?void 0:M.focus(),[M]),Oe=g.useCallback((he,je,ee)=>{const ke=!q.current&&!ee;(N.value!==void 0&&N.value===je||ke)&&F(he)},[N.value]),ve=s==="popper"?xE:TJ,ce=ve===xE?{side:A,sideOffset:u,align:f,alignOffset:x,arrowPadding:m,collisionBoundary:y,collisionPadding:v,sticky:O,hideWhenDetached:b,avoidCollisions:C}:{};return e.jsx(_J,{scope:n,content:M,viewport:L,onViewportChange:B,itemRefCallback:W,selectedItem:I,onItemLeave:ae,itemTextRefCallback:Oe,focusSelectedItem:R,selectedItemText:P,position:s,isPositioned:G,searchRef:J,children:e.jsx(yT,{as:sRe,allowPinchZoom:!0,children:e.jsx(mT,{asChild:!0,trapped:N.open,onMountAutoFocus:he=>{he.preventDefault()},onUnmountAutoFocus:Se(o,he=>{var je;(je=N.trigger)==null||je.focus({preventScroll:!0}),he.preventDefault()}),children:e.jsx(A2,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:he=>he.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:e.jsx(ve,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:he=>he.preventDefault(),...j,...ce,onPlaced:()=>H(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Se(j.onKeyDown,he=>{const je=he.ctrlKey||he.altKey||he.metaKey;if(he.key==="Tab"&&he.preventDefault(),!je&&he.key.length===1&&Ae(he.key),["ArrowUp","ArrowDown","Home","End"].includes(he.key)){let ke=K().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(he.key)&&(ke=ke.slice().reverse()),["ArrowUp","ArrowDown"].includes(he.key)){const ye=he.target,Ne=ke.indexOf(ye);ke=ke.slice(Ne+1)}setTimeout(()=>_(ke)),he.preventDefault()}})})})})})})});LJ.displayName=nRe;var rRe="SelectItemAlignedPosition",TJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,onPlaced:s,...o}=t,c=ui(VA,n),l=hi(VA,n),[A,u]=g.useState(null),[f,x]=g.useState(null),m=rt(a,S=>x(S)),y=zT(n),v=g.useRef(!1),O=g.useRef(!0),{viewport:b,selectedItem:C,selectedItemText:j,focusSelectedItem:N}=l,M=g.useCallback(()=>{if(c.trigger&&c.valueNode&&A&&f&&b&&C&&j){const S=c.trigger.getBoundingClientRect(),I=f.getBoundingClientRect(),z=c.valueNode.getBoundingClientRect(),P=j.getBoundingClientRect();if(c.dir!=="rtl"){const ye=P.left-I.left,Ne=z.left-ye,ze=S.left-Ne,He=S.width+ze,Tt=Math.max(He,I.width),Et=window.innerWidth-As,ya=tE(Ne,[As,Math.max(As,Et-Tt)]);A.style.minWidth=He+"px",A.style.left=ya+"px"}else{const ye=I.right-P.right,Ne=window.innerWidth-z.right-ye,ze=window.innerWidth-S.right-Ne,He=S.width+ze,Tt=Math.max(He,I.width),Et=window.innerWidth-As,ya=tE(Ne,[As,Math.max(As,Et-Tt)]);A.style.minWidth=He+"px",A.style.right=ya+"px"}const F=y(),K=window.innerHeight-As*2,G=b.scrollHeight,H=window.getComputedStyle(f),q=parseInt(H.borderTopWidth,10),_=parseInt(H.paddingTop,10),R=parseInt(H.borderBottomWidth,10),U=parseInt(H.paddingBottom,10),Z=q+_+G+U+R,J=Math.min(C.offsetHeight*5,Z),Ae=window.getComputedStyle(b),W=parseInt(Ae.paddingTop,10),ae=parseInt(Ae.paddingBottom,10),Oe=S.top+S.height/2-As,ve=K-Oe,ce=C.offsetHeight/2,he=C.offsetTop+ce,je=q+_+he,ee=Z-je;if(je<=Oe){const ye=F.length>0&&C===F[F.length-1].ref.current;A.style.bottom="0px";const Ne=f.clientHeight-b.offsetTop-b.offsetHeight,ze=Math.max(ve,ce+(ye?ae:0)+Ne+R),He=je+ze;A.style.height=He+"px"}else{const ye=F.length>0&&C===F[0].ref.current;A.style.top="0px";const ze=Math.max(Oe,q+b.offsetTop+(ye?W:0)+ce)+ee;A.style.height=ze+"px",b.scrollTop=je-Oe+b.offsetTop}A.style.margin=`${As}px 0`,A.style.minHeight=J+"px",A.style.maxHeight=K+"px",s==null||s(),requestAnimationFrame(()=>v.current=!0)}},[y,c.trigger,c.valueNode,A,f,b,C,j,c.dir,s]);Ta(()=>M(),[M]);const[Q,L]=g.useState();Ta(()=>{f&&L(window.getComputedStyle(f).zIndex)},[f]);const B=g.useCallback(S=>{S&&O.current===!0&&(M(),N==null||N(),O.current=!1)},[M,N]);return e.jsx(iRe,{scope:n,contentWrapper:A,shouldExpandOnScrollRef:v,onScrollButtonChange:B,children:e.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:Q},children:e.jsx(Ve.div,{...o,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});TJ.displayName=rRe;var oRe="SelectPopperPosition",xE=g.forwardRef((t,a)=>{const{__scopeSelect:n,align:s="start",collisionPadding:o=As,...c}=t,l=FT(n);return e.jsx(zE,{...l,...c,ref:a,align:s,collisionPadding:o,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xE.displayName=oRe;var[iRe,$z]=Du(VA,{}),mE="SelectViewport",$J=g.forwardRef((t,a)=>{const{__scopeSelect:n,nonce:s,...o}=t,c=hi(mE,n),l=$z(mE,n),A=rt(a,c.onViewportChange),u=g.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),e.jsx(ET.Slot,{scope:n,children:e.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:A,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Se(o.onScroll,f=>{const x=f.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:y}=l;if(y!=null&&y.current&&m){const v=Math.abs(u.current-x.scrollTop);if(v>0){const O=window.innerHeight-As*2,b=parseFloat(m.style.minHeight),C=parseFloat(m.style.height),j=Math.max(b,C);if(j<O){const N=j+v,M=Math.min(O,N),Q=N-M;m.style.height=M+"px",m.style.bottom==="0px"&&(x.scrollTop=Q>0?Q:0,m.style.justifyContent="flex-end")}}}u.current=x.scrollTop})})})]})});$J.displayName=mE;var IJ="SelectGroup",[cRe,lRe]=Du(IJ),dRe=g.forwardRef((t,a)=>{const{__scopeSelect:n,...s}=t,o=zr();return e.jsx(cRe,{scope:n,id:o,children:e.jsx(Ve.div,{role:"group","aria-labelledby":o,...s,ref:a})})});dRe.displayName=IJ;var UJ="SelectLabel",ARe=g.forwardRef((t,a)=>{const{__scopeSelect:n,...s}=t,o=lRe(UJ,n);return e.jsx(Ve.div,{id:o.id,...s,ref:a})});ARe.displayName=UJ;var sT="SelectItem",[uRe,PJ]=Du(sT),EJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,value:s,disabled:o=!1,textValue:c,...l}=t,A=ui(sT,n),u=hi(sT,n),f=A.value===s,[x,m]=g.useState(c??""),[y,v]=g.useState(!1),O=rt(a,N=>{var M;return(M=u.itemRefCallback)==null?void 0:M.call(u,N,s,o)}),b=zr(),C=g.useRef("touch"),j=()=>{o||(A.onValueChange(s),A.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(uRe,{scope:n,value:s,disabled:o,textId:b,isSelected:f,onItemTextChange:g.useCallback(N=>{m(M=>M||((N==null?void 0:N.textContent)??"").trim())},[]),children:e.jsx(ET.ItemSlot,{scope:n,value:s,disabled:o,textValue:x,children:e.jsx(Ve.div,{role:"option","aria-labelledby":b,"data-highlighted":y?"":void 0,"aria-selected":f&&y,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...l,ref:O,onFocus:Se(l.onFocus,()=>v(!0)),onBlur:Se(l.onBlur,()=>v(!1)),onClick:Se(l.onClick,()=>{C.current!=="mouse"&&j()}),onPointerUp:Se(l.onPointerUp,()=>{C.current==="mouse"&&j()}),onPointerDown:Se(l.onPointerDown,N=>{C.current=N.pointerType}),onPointerMove:Se(l.onPointerMove,N=>{var M;C.current=N.pointerType,o?(M=u.onItemLeave)==null||M.call(u):C.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(l.onPointerLeave,N=>{var M;N.currentTarget===document.activeElement&&((M=u.onItemLeave)==null||M.call(u))}),onKeyDown:Se(l.onKeyDown,N=>{var Q;((Q=u.searchRef)==null?void 0:Q.current)!==""&&N.key===" "||(WFe.includes(N.key)&&j(),N.key===" "&&N.preventDefault())})})})})});EJ.displayName=sT;var s0="SelectItemText",zJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,className:s,style:o,...c}=t,l=ui(s0,n),A=hi(s0,n),u=PJ(s0,n),f=eRe(s0,n),[x,m]=g.useState(null),y=rt(a,j=>m(j),u.onItemTextChange,j=>{var N;return(N=A.itemTextRefCallback)==null?void 0:N.call(A,j,u.value,u.disabled)}),v=x==null?void 0:x.textContent,O=g.useMemo(()=>e.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:C}=f;return Ta(()=>(b(O),()=>C(O)),[b,C,O]),e.jsxs(e.Fragment,{children:[e.jsx(Ve.span,{id:u.textId,...c,ref:y}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?cT.createPortal(c.children,l.valueNode):null]})});zJ.displayName=s0;var FJ="SelectItemIndicator",RJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,...s}=t;return PJ(FJ,n).isSelected?e.jsx(Ve.span,{"aria-hidden":!0,...s,ref:a}):null});RJ.displayName=FJ;var gE="SelectScrollUpButton",hRe=g.forwardRef((t,a)=>{const n=hi(gE,t.__scopeSelect),s=$z(gE,t.__scopeSelect),[o,c]=g.useState(!1),l=rt(a,s.onScrollButtonChange);return Ta(()=>{if(n.viewport&&n.isPositioned){let A=function(){const f=u.scrollTop>0;c(f)};const u=n.viewport;return A(),u.addEventListener("scroll",A),()=>u.removeEventListener("scroll",A)}},[n.viewport,n.isPositioned]),o?e.jsx(HJ,{...t,ref:l,onAutoScroll:()=>{const{viewport:A,selectedItem:u}=n;A&&u&&(A.scrollTop=A.scrollTop-u.offsetHeight)}}):null});hRe.displayName=gE;var yE="SelectScrollDownButton",pRe=g.forwardRef((t,a)=>{const n=hi(yE,t.__scopeSelect),s=$z(yE,t.__scopeSelect),[o,c]=g.useState(!1),l=rt(a,s.onScrollButtonChange);return Ta(()=>{if(n.viewport&&n.isPositioned){let A=function(){const f=u.scrollHeight-u.clientHeight,x=Math.ceil(u.scrollTop)<f;c(x)};const u=n.viewport;return A(),u.addEventListener("scroll",A),()=>u.removeEventListener("scroll",A)}},[n.viewport,n.isPositioned]),o?e.jsx(HJ,{...t,ref:l,onAutoScroll:()=>{const{viewport:A,selectedItem:u}=n;A&&u&&(A.scrollTop=A.scrollTop+u.offsetHeight)}}):null});pRe.displayName=yE;var HJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,onAutoScroll:s,...o}=t,c=hi("SelectScrollButton",n),l=g.useRef(null),A=zT(n),u=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>u(),[u]),Ta(()=>{var x;const f=A().find(m=>m.ref.current===document.activeElement);(x=f==null?void 0:f.ref.current)==null||x.scrollIntoView({block:"nearest"})},[A]),e.jsx(Ve.div,{"aria-hidden":!0,...o,ref:a,style:{flexShrink:0,...o.style},onPointerDown:Se(o.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(s,50))}),onPointerMove:Se(o.onPointerMove,()=>{var f;(f=c.onItemLeave)==null||f.call(c),l.current===null&&(l.current=window.setInterval(s,50))}),onPointerLeave:Se(o.onPointerLeave,()=>{u()})})}),fRe="SelectSeparator",xRe=g.forwardRef((t,a)=>{const{__scopeSelect:n,...s}=t;return e.jsx(Ve.div,{"aria-hidden":!0,...s,ref:a})});xRe.displayName=fRe;var vE="SelectArrow",mRe=g.forwardRef((t,a)=>{const{__scopeSelect:n,...s}=t,o=FT(n),c=ui(vE,n),l=hi(vE,n);return c.open&&l.position==="popper"?e.jsx(FE,{...o,...s,ref:a}):null});mRe.displayName=vE;var gRe="SelectBubbleInput",qJ=g.forwardRef(({__scopeSelect:t,value:a,...n},s)=>{const o=g.useRef(null),c=rt(s,o),l=ZFe(a);return g.useEffect(()=>{const A=o.current;if(!A)return;const u=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(u,"value").set;if(l!==a&&x){const m=new Event("change",{bubbles:!0});x.call(A,a),A.dispatchEvent(m)}},[l,a]),e.jsx(Ve.select,{...n,style:{...YZ,...n.style},ref:c,defaultValue:a})});qJ.displayName=gRe;function DJ(t){return t===""||t===void 0}function VJ(t){const a=xa(t),n=g.useRef(""),s=g.useRef(0),o=g.useCallback(l=>{const A=n.current+l;a(A),(function u(f){n.current=f,window.clearTimeout(s.current),f!==""&&(s.current=window.setTimeout(()=>u(""),1e3))})(A)},[a]),c=g.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,o,c]}function XJ(t,a,n){const o=a.length>1&&Array.from(a).every(f=>f===a[0])?a[0]:a,c=n?t.indexOf(n):-1;let l=yRe(t,Math.max(c,0));o.length===1&&(l=l.filter(f=>f!==n));const u=l.find(f=>f.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function yRe(t,a){return t.map((n,s)=>t[(a+s)%t.length])}var vRe=wJ,kRe=CJ,ORe=MJ,bRe=SJ,wRe=QJ,jRe=BJ,CRe=$J,NRe=EJ,MRe=zJ,SRe=RJ;function Ur({children:t,...a}){return e.jsx(vRe,{...a,children:t})}function Pr({children:t,className:a,placeholder:n,...s}){return e.jsxs(kRe,{className:V("flex h-8 w-full items-center justify-between rounded-md px-3 text-sm","bg-surface-1 border border-border text-text-0 font-sans","focus:outline-none focus:ring-1 focus:ring-accent","disabled:opacity-40 disabled:cursor-not-allowed","cursor-pointer select-none",a),...s,children:[e.jsx(ORe,{placeholder:n}),e.jsx(bRe,{children:e.jsx(bt,{size:14,className:"text-text-3"})})]})}function Er({children:t,className:a,...n}){return e.jsx(wRe,{children:e.jsx(jRe,{position:"popper",sideOffset:4,className:V("z-50 min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md","bg-surface-1 border border-border shadow-xl","animate-in fade-in-0 zoom-in-95",a),...n,children:e.jsx(CRe,{className:"py-1",children:t})})})}function Da({children:t,className:a,...n}){return e.jsxs(NRe,{className:V("flex items-center gap-2 px-3 py-1.5 text-sm font-sans cursor-pointer select-none","text-text-1 outline-none","focus:bg-surface-5 focus:text-text-0",a),...n,children:[e.jsx(MRe,{children:t}),e.jsx(SRe,{className:"ml-auto",children:e.jsx(De,{size:14,className:"text-accent"})})]})}function ri({label:t,value:a,onChange:n,min:s=0,max:o=100,step:c=1,formatValue:l,displayValue:A,disabled:u,className:f}){const x=(a-s)/(o-s)*100,m=A||l,y=typeof m=="function"?m(a):typeof m=="string"?m:a;return e.jsxs("div",{className:V("group flex items-center gap-2 py-1.5",u&&"opacity-40 pointer-events-none",f),children:[e.jsx("span",{className:"text-2xs text-text-2 font-sans w-20 shrink-0 truncate",children:t}),e.jsxs("div",{className:"relative flex-1 flex items-center h-5",children:[e.jsx("div",{className:"absolute inset-y-0 flex items-center w-full pointer-events-none",children:e.jsx("div",{className:"w-full h-1 rounded-full bg-surface-5",children:e.jsx("div",{className:"h-full rounded-full bg-accent/70 group-hover:bg-accent transition-colors",style:{width:`${x}%`}})})}),e.jsx("input",{type:"range",min:s,max:o,step:c,value:a,disabled:u,onChange:v=>n(Number(v.target.value)),className:`relative w-full h-5 appearance-none bg-transparent cursor-pointer
8663
+ `,{label:"if",detail:"block",type:"keyword"}),$t("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),$t("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),$t("import ${module}",{label:"import",detail:"statement",type:"keyword"}),$t("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],dze=YX($Y,JX(cze.concat(lze)));function rP(t){let{node:a,pos:n}=t,s=t.lineIndent(n,-1),o=null;for(;;){let c=a.childBefore(n);if(c)if(c.name=="Comment")n=c.from;else if(c.name=="Body"||c.name=="MatchBody")t.baseIndentFor(c)+t.unit<=s&&(o=c),a=c;else if(c.name=="MatchClause")a=c;else if(c.type.is("Statement"))a=c;else break;else break}return o}function oP(t,a){let n=t.baseIndentFor(a),s=t.lineAt(t.pos,-1),o=s.from+s.text.length;return/^\s*($|#)/.test(s.text)&&t.node.to<o+100&&!/\S/.test(t.state.sliceDoc(o,t.node.to))&&t.lineIndent(t.pos,-1)<=n||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(t.textAfter)&&t.lineIndent(t.pos,-1)>n?null:n+t.unit}const iP=l2.define({name:"python",parser:rze.configure({props:[Eu.add({Body:t=>{var a;let n=/^\s*(#|$)/.test(t.textAfter)&&rP(t)||t.node;return(a=oP(t,n))!==null&&a!==void 0?a:t.continue()},MatchBody:t=>{var a;let n=rP(t);return(a=oP(t,n||t.node))!==null&&a!==void 0?a:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":Mf({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Mf({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Mf({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var a;let n=rP(t);return(a=n&&oP(t,n))!==null&&a!==void 0?a:t.continue()}}),ZA.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":dT,Body:(t,a)=>({from:t.from+1,to:t.to-(t.to==a.doc.length?0:1)}),"String FormatString":(t,a)=>({from:a.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function Aze(){return new FA(iP,[iP.data.of({autocomplete:ize}),iP.data.of({autocomplete:dze})])}const gf={javascript:()=>sE({jsx:!0,typescript:!1}),typescript:()=>sE({jsx:!0,typescript:!0}),css:()=>BK(),html:()=>WK(),json:()=>iPe(),markdown:()=>jY(),python:()=>Aze()},uze=nZ.define([{tag:X.keyword,color:"#b07fd5"},{tag:[X.name,X.deleted,X.character,X.macroName],color:"#d4d8e0"},{tag:[X.function(X.variableName),X.labelName],color:"#dcc9a0"},{tag:[X.color,X.constant(X.name),X.standard(X.name)],color:"#d4a07a"},{tag:[X.definition(X.name),X.separator],color:"#bcc2cd"},{tag:[X.typeName,X.className,X.number,X.changed,X.annotation,X.modifier,X.self,X.namespace],color:"#e0c589"},{tag:[X.operator,X.operatorKeyword,X.url,X.escape,X.regexp,X.special(X.string)],color:"#89b4c4"},{tag:[X.meta,X.comment],color:"#6e7681",fontStyle:"italic"},{tag:X.strong,fontWeight:"bold"},{tag:X.emphasis,fontStyle:"italic"},{tag:X.strikethrough,textDecoration:"line-through"},{tag:X.link,color:"#7ab0df",textDecoration:"underline"},{tag:X.heading,fontWeight:"400",color:"#bcc2cd"},{tag:[X.atom,X.bool,X.special(X.variableName)],color:"#d4a07a"},{tag:[X.processingInstruction,X.string,X.inserted],color:"#95b2b8"},{tag:X.invalid,color:"#d4736e"},{tag:X.propertyName,color:"#dcc9a0"},{tag:[X.tagName],color:"#d4736e"},{tag:X.attributeName,color:"#e0c589"},{tag:X.attributeValue,color:"#95b2b8"}]),hze=Ws.theme({"&":{backgroundColor:"#13161b",color:"#d4d8e0",fontFamily:"var(--font-mono)",fontSize:"12px",height:"100%",lineHeight:"1.6"},".cm-scroller":{overflow:"auto",padding:"4px 0"},".cm-content":{caretColor:"#33afbc",fontWeight:"400"},".cm-cursor":{borderLeftColor:"#33afbc",borderLeftWidth:"1.5px"},".cm-gutters":{backgroundColor:"#13161b",borderRight:"1px solid #1e2229",color:"#404852",minWidth:"40px"},".cm-activeLineGutter":{backgroundColor:"#1a1e25"},".cm-activeLine":{backgroundColor:"rgba(255, 255, 255, 0.03)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"rgba(51, 175, 188, 0.15)"},".cm-line":{fontWeight:"400"},".cm-header-1, .cm-header-2, .cm-header-3, .cm-header-4, .cm-header-5, .cm-header-6":{fontWeight:"400",fontSize:"12px"},".ͼ1 .cm-line .tok-heading":{fontWeight:"400",fontSize:"12px"},".tok-heading":{fontWeight:"400"},".tok-heading1, .tok-heading2, .tok-heading3":{fontWeight:"400",fontSize:"12px"},".cm-panels":{backgroundColor:"#13161b",borderBottom:"1px solid #1e2229"},".cm-panels.cm-panels-top":{borderBottom:"1px solid #1e2229"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid #1e2229"},".cm-search":{padding:"6px 8px",gap:"4px",fontFamily:"var(--font-sans)",fontSize:"11px",display:"flex",flexWrap:"wrap",alignItems:"center"},".cm-search label":{display:"flex",alignItems:"center",gap:"4px",color:"#6e7681",fontSize:"10px"},".cm-search input, .cm-search .cm-textfield":{backgroundColor:"#1a1e25",border:"1px solid #2c313a",borderRadius:"4px",color:"#d4d8e0",padding:"2px 6px",fontSize:"11px",fontFamily:"var(--font-mono)",outline:"none"},".cm-search input:focus, .cm-search .cm-textfield:focus":{borderColor:"#33afbc"},".cm-search .cm-button, .cm-button":{backgroundColor:"#1e2229",border:"1px solid #2c313a",borderRadius:"4px",color:"#a0a8b4",padding:"2px 8px",fontSize:"10px",fontFamily:"var(--font-sans)",cursor:"pointer",backgroundImage:"none"},".cm-search .cm-button:hover, .cm-button:hover":{backgroundColor:"#2c313a",color:"#d4d8e0"},".cm-search .cm-button:active":{backgroundColor:"#333842"},".cm-search br":{display:"none"},".cm-panel.cm-search [name=close]":{color:"#505862",cursor:"pointer",padding:"0 4px"},".cm-panel.cm-search [name=close]:hover":{color:"#d4d8e0"},".cm-searchMatch":{backgroundColor:"rgba(51, 175, 188, 0.15)",outline:"1px solid rgba(51, 175, 188, 0.3)"},".cm-searchMatch-selected":{backgroundColor:"rgba(51, 175, 188, 0.3)"}},{dark:!0});function hE({content:t,language:a,onChange:n,onSave:s,onCursorChange:o,viewRef:c}){const l=g.useRef(null),A=g.useRef(null),u=g.useRef(new cne),f=g.useRef(n),x=g.useRef(s),m=g.useRef(o);return f.current=n,x.current=s,m.current=o,g.useEffect(()=>{if(!l.current)return;const y=gf[a]||gf.javascript,v=ML.of([{key:"Mod-s",run:()=>{var C;return(C=x.current)==null||C.call(x),!0}}]),O=CE.create({doc:t||"",extensions:[sZ(),lne(),dne(),Ane(),une(),rZ(),hne(),ML.of([...oZ,...iZ,...pne]),v,cZ(uze),hze,u.current.of(y()),Ws.updateListener.of(C=>{var j,N;if(C.docChanged&&((j=f.current)==null||j.call(f,C.state.doc.toString())),C.selectionSet||C.docChanged){const M=C.state.selection.main.head,Q=C.state.doc.lineAt(M);(N=m.current)==null||N.call(m,{line:Q.number,col:M-Q.from+1})}})]}),b=new Ws({state:O,parent:l.current});return A.current=b,c&&(c.current=b),()=>{b.destroy(),A.current=null,c&&(c.current=null)}},[]),g.useEffect(()=>{const y=A.current;if(!y)return;const v=y.state.doc.toString();t!==v&&y.dispatch({changes:{from:0,to:v.length,insert:t||""}})},[t]),g.useEffect(()=>{const y=A.current;if(!y)return;const v=gf[a]||gf.javascript;y.dispatch({effects:u.current.reconfigure(v())})},[a]),e.jsx("div",{ref:l,className:"w-full h-full overflow-hidden bg-surface-0"})}const pze=["png","jpg","jpeg","gif","svg","webp","ico","bmp","avif"],IY=["mp4","webm","mov","avi","mkv","ogv"];function UY(t){var n;const a=(n=t.split(".").pop())==null?void 0:n.toLowerCase();return pze.includes(a)||IY.includes(a)}function PY({path:t}){var c;const a=(c=t.split(".").pop())==null?void 0:c.toLowerCase(),n=`/api/files/raw?path=${encodeURIComponent(t)}`,s=t.split("/").pop(),o=IY.includes(a);return e.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center bg-surface-0 p-8 gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-3 font-sans",children:[e.jsx(be,{children:a==null?void 0:a.toUpperCase()}),e.jsx("span",{className:"font-mono",children:s}),e.jsx("a",{href:n,target:"_blank",rel:"noopener",className:"text-accent hover:text-accent/80 transition-colors",children:e.jsx(ma,{size:12})})]}),o?e.jsx("video",{src:n,controls:!0,className:"max-w-full max-h-[70vh] rounded-md border border-border"}):e.jsx("img",{src:n,alt:s,className:"max-w-full max-h-[70vh] rounded-md border border-border object-contain"})]})}const jX=220,fze=140,xze=360;function mze({agents:t,activeId:a,onSelect:n}){return e.jsx("div",{className:"flex flex-col items-center gap-1 py-2 w-12 bg-surface-1 border-r border-border flex-shrink-0",children:t.map(s=>{const o=On(s.role),c=s.id===a,l=s.status==="running"||s.status==="starting",A=(s.role||"?")[0].toUpperCase();return e.jsx(Nt,{content:`${s.name} — ${s.status}`,side:"right",children:e.jsxs("button",{onClick:()=>n(s.id),className:V("relative w-9 h-9 rounded-lg flex items-center justify-center","text-xs font-bold font-sans cursor-pointer transition-all",c?"ring-1.5 ring-accent bg-accent/12":"hover:bg-surface-3"),style:{color:o.text,background:c?o.bg:void 0},children:[A,e.jsx("span",{className:V("absolute bottom-0.5 right-0.5 w-2 h-2 rounded-full border border-surface-1",l?"bg-success animate-pulse":s.status==="completed"?"bg-accent":s.status==="crashed"?"bg-danger":"bg-text-4")})]})},s.id)})})}function gze({tabs:t,activeFile:a,files:n,onSelect:s,onClose:o,diffMode:c,onToggleDiff:l,workspaceSnapshots:A,onBackToTeam:u,onToggleReview:f,reviewMode:x}){const m=a&&A[a];return e.jsxs("div",{className:"flex items-stretch h-8 bg-[#1a1e25] border-b border-[#1e2229] flex-shrink-0",children:[e.jsx("div",{className:"flex items-stretch flex-1 min-w-0 overflow-x-auto scrollbar-none",children:t.map(y=>{const v=y===a,O=n[y],b=O&&O.content!==O.originalContent,C=y.split("/").pop();return e.jsxs("div",{className:V("flex items-center gap-1.5 px-3 text-2xs font-sans cursor-pointer select-none","border-r border-white/5 transition-colors duration-75 flex-shrink-0",v?"bg-surface-0 text-text-1 border-b border-b-accent":"text-text-4 hover:text-text-2 hover:bg-surface-3 border-b border-b-transparent"),onClick:()=>s(y),children:[e.jsx("span",{className:"truncate max-w-[120px]",children:C}),b&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-warning flex-shrink-0"}),e.jsx("button",{onClick:j=>{j.stopPropagation(),o(y)},className:"p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 transition-colors cursor-pointer ml-0.5",children:e.jsx(Ge,{size:10})})]},y)})}),e.jsxs("div",{className:"flex items-center gap-0.5 px-2 border-l border-border-subtle flex-shrink-0",children:[m&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>l(!1),className:V("flex items-center gap-1 px-2 py-1 text-xs font-sans rounded cursor-pointer transition-colors",c?"text-text-3 hover:text-text-1":"bg-surface-4 text-text-0 font-medium"),children:[e.jsx(ou,{size:11})," Code"]}),e.jsxs("button",{onClick:()=>l(!0),className:V("flex items-center gap-1 px-2 py-1 text-xs font-sans rounded cursor-pointer transition-colors",c?"bg-surface-4 text-text-0 font-medium":"text-text-3 hover:text-text-1"),children:[e.jsx(g0,{size:11})," Diff"]}),e.jsx("div",{className:"w-px h-4 bg-border-subtle mx-1"})]}),e.jsx(Nt,{content:"Review Changes",side:"bottom",children:e.jsx("button",{onClick:f,className:V("flex items-center gap-1 px-2 py-1 text-xs font-sans rounded cursor-pointer transition-colors",x?"bg-accent/15 text-accent":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:e.jsx(u0,{size:12})})}),e.jsx(Nt,{content:"Back to Team View",side:"bottom",children:e.jsxs("button",{onClick:u,className:"flex items-center gap-1 px-2 py-1 text-xs font-sans rounded cursor-pointer transition-colors text-text-3 hover:text-text-1 hover:bg-surface-3",children:[e.jsx(Fa,{size:12}),e.jsx("span",{className:"text-2xs",children:"Team"})]})})]})]})}function yze(){const t=$(G=>G.agents),a=$(G=>G.activeTeamId),n=$(G=>G.workspaceAgentId),s=$(G=>G.setWorkspaceAgent),o=$(G=>G.workspaceReviewMode),c=$(G=>G.toggleReviewMode),l=$(G=>G.workspaceSnapshots),A=$(G=>G.setWorkspaceMode),u=$(G=>G.editorFiles),f=$(G=>G.editorActiveFile),x=$(G=>G.editorOpenTabs),m=$(G=>G.setActiveFile),y=$(G=>G.closeFile),v=$(G=>G.updateFileContent),O=$(G=>G.saveFile),b=t.filter(G=>G.teamId===a),C=b.find(G=>G.id===n)||b[0],[j,N]=g.useState(jX),[M,Q]=g.useState(!1),[L,B]=g.useState(!1),S=g.useRef(!1),I=g.useRef(0),z=g.useRef(0);g.useEffect(()=>{Q(!1)},[f]);const P=g.useCallback(G=>{G.preventDefault(),S.current=!0,I.current=G.clientX,z.current=j;function H(_){S.current&&N(Math.min(Math.max(z.current+_.clientX-I.current,fze),xze))}function q(){S.current=!1,document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",q)}document.addEventListener("mousemove",H),document.addEventListener("mouseup",q)},[j]);if(!C)return e.jsx("div",{className:"flex items-center justify-center h-full text-text-4 text-xs font-sans",children:"No agents in this team"});const F=f?u[f]:null,K=f&&UY(f);return e.jsxs("div",{className:"flex h-full bg-surface-1",children:[e.jsx(mze,{agents:b,activeId:C.id,onSelect:s}),e.jsxs("div",{className:"flex flex-1 min-w-0",children:[e.jsxs("div",{className:V("relative flex-shrink-0 bg-surface-1 border-r border-border transition-all duration-200 overflow-hidden",L&&"w-0 border-r-0"),style:L?void 0:{width:j},children:[e.jsx($$e,{agentId:C.id,onCollapse:()=>B(!0)}),e.jsx("div",{className:"absolute top-0 right-0 bottom-0 w-1 cursor-col-resize hover:bg-accent/30 transition-colors z-10",onMouseDown:P,onDoubleClick:()=>N(jX)})]}),L&&e.jsx("button",{onClick:()=>B(!1),className:"flex-shrink-0 w-6 flex items-start justify-center pt-2 border-r border-border bg-surface-2 text-text-4 hover:text-text-0 hover:bg-surface-3 transition-colors cursor-pointer",title:"Show sidebar",children:e.jsx(xs,{size:14})}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-surface-1",children:o?e.jsx(U$e,{agentId:C.id}):e.jsxs(e.Fragment,{children:[e.jsx(gze,{tabs:x,activeFile:f,files:u,onSelect:m,onClose:y,diffMode:M,onToggleDiff:Q,workspaceSnapshots:l,onBackToTeam:()=>A(!1),onToggleReview:c,reviewMode:o}),e.jsxs("div",{className:"flex-1 relative min-h-0",children:[!f&&e.jsx("div",{className:"w-full h-full flex items-center justify-center text-text-4 font-sans bg-surface-1",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(Zt,{size:32,className:"mx-auto"}),e.jsx("p",{className:"text-sm",children:"Open a file from the tree"}),e.jsxs("p",{className:"text-2xs text-text-4",children:["Files scoped to ",C.name]})]})}),f&&K&&e.jsx(PY,{path:f}),f&&M&&!K&&e.jsx(hK,{filePath:f}),f&&!M&&!K&&F&&e.jsx(hE,{content:F.content,language:F.language,onChange:G=>v(f,G),onSave:()=>O(f)})]})]})})]})]})}function Oz(t){const a=t+"CollectionProvider",[n,s]=tr(a),[o,c]=n(a,{collectionRef:{current:null},itemMap:new Map}),l=b=>{const{scope:C,children:j}=b,N=Lo.useRef(null),M=Lo.useRef(new Map).current;return e.jsx(o,{scope:C,itemMap:M,collectionRef:N,children:j})};l.displayName=a;const A=t+"CollectionSlot",u=Su(A),f=Lo.forwardRef((b,C)=>{const{scope:j,children:N}=b,M=c(A,j),Q=rt(C,M.collectionRef);return e.jsx(u,{ref:Q,children:N})});f.displayName=A;const x=t+"CollectionItemSlot",m="data-radix-collection-item",y=Su(x),v=Lo.forwardRef((b,C)=>{const{scope:j,children:N,...M}=b,Q=Lo.useRef(null),L=rt(C,Q),B=c(x,j);return Lo.useEffect(()=>(B.itemMap.set(Q,{ref:Q,...M}),()=>void B.itemMap.delete(Q))),e.jsx(y,{[m]:"",ref:L,children:N})});v.displayName=x;function O(b){const C=c(t+"CollectionConsumer",b);return Lo.useCallback(()=>{const N=C.collectionRef.current;if(!N)return[];const M=Array.from(N.querySelectorAll(`[${m}]`));return Array.from(C.itemMap.values()).sort((B,S)=>M.indexOf(B.ref.current)-M.indexOf(S.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:f,ItemSlot:v},O,s]}var cP="rovingFocusGroup.onEntryFocus",vze={bubbles:!1,cancelable:!0},g2="RovingFocusGroup",[pE,EY,kze]=Oz(g2),[Oze,IT]=tr(g2,[kze]),[bze,wze]=Oze(g2),zY=g.forwardRef((t,a)=>e.jsx(pE.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(pE.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(jze,{...t,ref:a})})}));zY.displayName=g2;var jze=g.forwardRef((t,a)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:o=!1,dir:c,currentTabStopId:l,defaultCurrentTabStopId:A,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:x=!1,...m}=t,y=g.useRef(null),v=rt(a,y),O=m2(c),[b,C]=Bu({prop:l,defaultProp:A??null,onChange:u,caller:g2}),[j,N]=g.useState(!1),M=xa(f),Q=EY(n),L=g.useRef(!1),[B,S]=g.useState(0);return g.useEffect(()=>{const I=y.current;if(I)return I.addEventListener(cP,M),()=>I.removeEventListener(cP,M)},[M]),e.jsx(bze,{scope:n,orientation:s,dir:O,loop:o,currentTabStopId:b,onItemFocus:g.useCallback(I=>C(I),[C]),onItemShiftTab:g.useCallback(()=>N(!0),[]),onFocusableItemAdd:g.useCallback(()=>S(I=>I+1),[]),onFocusableItemRemove:g.useCallback(()=>S(I=>I-1),[]),children:e.jsx(Ve.div,{tabIndex:j||B===0?-1:0,"data-orientation":s,...m,ref:v,style:{outline:"none",...t.style},onMouseDown:Se(t.onMouseDown,()=>{L.current=!0}),onFocus:Se(t.onFocus,I=>{const z=!L.current;if(I.target===I.currentTarget&&z&&!j){const P=new CustomEvent(cP,vze);if(I.currentTarget.dispatchEvent(P),!P.defaultPrevented){const F=Q().filter(_=>_.focusable),K=F.find(_=>_.active),G=F.find(_=>_.id===b),q=[K,G,...F].filter(Boolean).map(_=>_.ref.current);HY(q,x)}}L.current=!1}),onBlur:Se(t.onBlur,()=>N(!1))})})}),FY="RovingFocusGroupItem",RY=g.forwardRef((t,a)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:o=!1,tabStopId:c,children:l,...A}=t,u=zr(),f=c||u,x=wze(FY,n),m=x.currentTabStopId===f,y=EY(n),{onFocusableItemAdd:v,onFocusableItemRemove:O,currentTabStopId:b}=x;return g.useEffect(()=>{if(s)return v(),()=>O()},[s,v,O]),e.jsx(pE.ItemSlot,{scope:n,id:f,focusable:s,active:o,children:e.jsx(Ve.span,{tabIndex:m?0:-1,"data-orientation":x.orientation,...A,ref:a,onMouseDown:Se(t.onMouseDown,C=>{s?x.onItemFocus(f):C.preventDefault()}),onFocus:Se(t.onFocus,()=>x.onItemFocus(f)),onKeyDown:Se(t.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){x.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const j=Mze(C,x.orientation,x.dir);if(j!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let M=y().filter(Q=>Q.focusable).map(Q=>Q.ref.current);if(j==="last")M.reverse();else if(j==="prev"||j==="next"){j==="prev"&&M.reverse();const Q=M.indexOf(C.currentTarget);M=x.loop?Sze(M,Q+1):M.slice(Q+1)}setTimeout(()=>HY(M))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:b!=null}):l})})});RY.displayName=FY;var Cze={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nze(t,a){return a!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Mze(t,a,n){const s=Nze(t.key,n);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return Cze[s]}function HY(t,a=!1){const n=document.activeElement;for(const s of t)if(s===n||(s.focus({preventScroll:a}),document.activeElement!==n))return}function Sze(t,a){return t.map((n,s)=>t[(a+s)%t.length])}var qY=zY,DY=RY,fE=["Enter"," "],Qze=["ArrowDown","PageUp","Home"],VY=["ArrowUp","PageDown","End"],Bze=[...Qze,...VY],_ze={ltr:[...fE,"ArrowRight"],rtl:[...fE,"ArrowLeft"]},Lze={ltr:["ArrowLeft"],rtl:["ArrowRight"]},y2="Menu",[o2,Tze,$ze]=Oz(y2),[KA,XY]=tr(y2,[$ze,Ru,IT]),UT=Ru(),ZY=IT(),[Ize,YA]=KA(y2),[Uze,v2]=KA(y2),GY=t=>{const{__scopeMenu:a,open:n=!1,children:s,dir:o,onOpenChange:c,modal:l=!0}=t,A=UT(a),[u,f]=g.useState(null),x=g.useRef(!1),m=xa(c),y=m2(o);return g.useEffect(()=>{const v=()=>{x.current=!0,document.addEventListener("pointerdown",O,{capture:!0,once:!0}),document.addEventListener("pointermove",O,{capture:!0,once:!0})},O=()=>x.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",O,{capture:!0}),document.removeEventListener("pointermove",O,{capture:!0})}},[]),e.jsx(PE,{...A,children:e.jsx(Ize,{scope:a,open:n,onOpenChange:m,content:u,onContentChange:f,children:e.jsx(Uze,{scope:a,onClose:g.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:x,dir:y,modal:l,children:s})})})};GY.displayName=y2;var Pze="MenuAnchor",bz=g.forwardRef((t,a)=>{const{__scopeMenu:n,...s}=t,o=UT(n);return e.jsx(EE,{...o,...s,ref:a})});bz.displayName=Pze;var wz="MenuPortal",[Eze,WY]=KA(wz,{forceMount:void 0}),KY=t=>{const{__scopeMenu:a,forceMount:n,children:s,container:o}=t,c=YA(wz,a);return e.jsx(Eze,{scope:a,forceMount:n,children:e.jsx(Za,{present:n||c.open,children:e.jsx(h2,{asChild:!0,container:o,children:s})})})};KY.displayName=wz;var ts="MenuContent",[zze,jz]=KA(ts),YY=g.forwardRef((t,a)=>{const n=WY(ts,t.__scopeMenu),{forceMount:s=n.forceMount,...o}=t,c=YA(ts,t.__scopeMenu),l=v2(ts,t.__scopeMenu);return e.jsx(o2.Provider,{scope:t.__scopeMenu,children:e.jsx(Za,{present:s||c.open,children:e.jsx(o2.Slot,{scope:t.__scopeMenu,children:l.modal?e.jsx(Fze,{...o,ref:a}):e.jsx(Rze,{...o,ref:a})})})})}),Fze=g.forwardRef((t,a)=>{const n=YA(ts,t.__scopeMenu),s=g.useRef(null),o=rt(a,s);return g.useEffect(()=>{const c=s.current;if(c)return VE(c)},[]),e.jsx(Cz,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Se(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Rze=g.forwardRef((t,a)=>{const n=YA(ts,t.__scopeMenu);return e.jsx(Cz,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Hze=Su("MenuContent.ScrollLock"),Cz=g.forwardRef((t,a)=>{const{__scopeMenu:n,loop:s=!1,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:l,disableOutsidePointerEvents:A,onEntryFocus:u,onEscapeKeyDown:f,onPointerDownOutside:x,onFocusOutside:m,onInteractOutside:y,onDismiss:v,disableOutsideScroll:O,...b}=t,C=YA(ts,n),j=v2(ts,n),N=UT(n),M=ZY(n),Q=Tze(n),[L,B]=g.useState(null),S=g.useRef(null),I=rt(a,S,C.onContentChange),z=g.useRef(0),P=g.useRef(""),F=g.useRef(0),K=g.useRef(null),G=g.useRef("right"),H=g.useRef(0),q=O?yT:g.Fragment,_=O?{as:Hze,allowPinchZoom:!0}:void 0,R=Z=>{var he,je;const J=P.current+Z,Ae=Q().filter(ee=>!ee.disabled),W=document.activeElement,ae=(he=Ae.find(ee=>ee.ref.current===W))==null?void 0:he.textValue,Oe=Ae.map(ee=>ee.textValue),ve=tFe(Oe,J,ae),ce=(je=Ae.find(ee=>ee.textValue===ve))==null?void 0:je.ref.current;(function ee(ke){P.current=ke,window.clearTimeout(z.current),ke!==""&&(z.current=window.setTimeout(()=>ee(""),1e3))})(J),ce&&setTimeout(()=>ce.focus())};g.useEffect(()=>()=>window.clearTimeout(z.current),[]),DE();const U=g.useCallback(Z=>{var Ae,W;return G.current===((Ae=K.current)==null?void 0:Ae.side)&&nFe(Z,(W=K.current)==null?void 0:W.area)},[]);return e.jsx(zze,{scope:n,searchRef:P,onItemEnter:g.useCallback(Z=>{U(Z)&&Z.preventDefault()},[U]),onItemLeave:g.useCallback(Z=>{var J;U(Z)||((J=S.current)==null||J.focus(),B(null))},[U]),onTriggerLeave:g.useCallback(Z=>{U(Z)&&Z.preventDefault()},[U]),pointerGraceTimerRef:F,onPointerGraceIntentChange:g.useCallback(Z=>{K.current=Z},[]),children:e.jsx(q,{..._,children:e.jsx(mT,{asChild:!0,trapped:o,onMountAutoFocus:Se(c,Z=>{var J;Z.preventDefault(),(J=S.current)==null||J.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:e.jsx(A2,{asChild:!0,disableOutsidePointerEvents:A,onEscapeKeyDown:f,onPointerDownOutside:x,onFocusOutside:m,onInteractOutside:y,onDismiss:v,children:e.jsx(qY,{asChild:!0,...M,dir:j.dir,orientation:"vertical",loop:s,currentTabStopId:L,onCurrentTabStopIdChange:B,onEntryFocus:Se(u,Z=>{j.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:e.jsx(zE,{role:"menu","aria-orientation":"vertical","data-state":pJ(C.open),"data-radix-menu-content":"",dir:j.dir,...N,...b,ref:I,style:{outline:"none",...b.style},onKeyDown:Se(b.onKeyDown,Z=>{const Ae=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,W=Z.ctrlKey||Z.altKey||Z.metaKey,ae=Z.key.length===1;Ae&&(Z.key==="Tab"&&Z.preventDefault(),!W&&ae&&R(Z.key));const Oe=S.current;if(Z.target!==Oe||!Bze.includes(Z.key))return;Z.preventDefault();const ce=Q().filter(he=>!he.disabled).map(he=>he.ref.current);VY.includes(Z.key)&&ce.reverse(),Jze(ce)}),onBlur:Se(t.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(z.current),P.current="")}),onPointerMove:Se(t.onPointerMove,i2(Z=>{const J=Z.target,Ae=H.current!==Z.clientX;if(Z.currentTarget.contains(J)&&Ae){const W=Z.clientX>H.current?"right":"left";G.current=W,H.current=Z.clientX}}))})})})})})})});YY.displayName=ts;var qze="MenuGroup",Nz=g.forwardRef((t,a)=>{const{__scopeMenu:n,...s}=t;return e.jsx(Ve.div,{role:"group",...s,ref:a})});Nz.displayName=qze;var Dze="MenuLabel",JY=g.forwardRef((t,a)=>{const{__scopeMenu:n,...s}=t;return e.jsx(Ve.div,{...s,ref:a})});JY.displayName=Dze;var aT="MenuItem",CX="menu.itemSelect",PT=g.forwardRef((t,a)=>{const{disabled:n=!1,onSelect:s,...o}=t,c=g.useRef(null),l=v2(aT,t.__scopeMenu),A=jz(aT,t.__scopeMenu),u=rt(a,c),f=g.useRef(!1),x=()=>{const m=c.current;if(!n&&m){const y=new CustomEvent(CX,{bubbles:!0,cancelable:!0});m.addEventListener(CX,v=>s==null?void 0:s(v),{once:!0}),MZ(m,y),y.defaultPrevented?f.current=!1:l.onClose()}};return e.jsx(eJ,{...o,ref:u,disabled:n,onClick:Se(t.onClick,x),onPointerDown:m=>{var y;(y=t.onPointerDown)==null||y.call(t,m),f.current=!0},onPointerUp:Se(t.onPointerUp,m=>{var y;f.current||(y=m.currentTarget)==null||y.click()}),onKeyDown:Se(t.onKeyDown,m=>{const y=A.searchRef.current!=="";n||y&&m.key===" "||fE.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});PT.displayName=aT;var eJ=g.forwardRef((t,a)=>{const{__scopeMenu:n,disabled:s=!1,textValue:o,...c}=t,l=jz(aT,n),A=ZY(n),u=g.useRef(null),f=rt(a,u),[x,m]=g.useState(!1),[y,v]=g.useState("");return g.useEffect(()=>{const O=u.current;O&&v((O.textContent??"").trim())},[c.children]),e.jsx(o2.ItemSlot,{scope:n,disabled:s,textValue:o??y,children:e.jsx(DY,{asChild:!0,...A,focusable:!s,children:e.jsx(Ve.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...c,ref:f,onPointerMove:Se(t.onPointerMove,i2(O=>{s?l.onItemLeave(O):(l.onItemEnter(O),O.defaultPrevented||O.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(t.onPointerLeave,i2(O=>l.onItemLeave(O))),onFocus:Se(t.onFocus,()=>m(!0)),onBlur:Se(t.onBlur,()=>m(!1))})})})}),Vze="MenuCheckboxItem",tJ=g.forwardRef((t,a)=>{const{checked:n=!1,onCheckedChange:s,...o}=t;return e.jsx(oJ,{scope:t.__scopeMenu,checked:n,children:e.jsx(PT,{role:"menuitemcheckbox","aria-checked":nT(n)?"mixed":n,...o,ref:a,"data-state":Sz(n),onSelect:Se(o.onSelect,()=>s==null?void 0:s(nT(n)?!0:!n),{checkForDefaultPrevented:!1})})})});tJ.displayName=Vze;var aJ="MenuRadioGroup",[Xze,Zze]=KA(aJ,{value:void 0,onValueChange:()=>{}}),nJ=g.forwardRef((t,a)=>{const{value:n,onValueChange:s,...o}=t,c=xa(s);return e.jsx(Xze,{scope:t.__scopeMenu,value:n,onValueChange:c,children:e.jsx(Nz,{...o,ref:a})})});nJ.displayName=aJ;var sJ="MenuRadioItem",rJ=g.forwardRef((t,a)=>{const{value:n,...s}=t,o=Zze(sJ,t.__scopeMenu),c=n===o.value;return e.jsx(oJ,{scope:t.__scopeMenu,checked:c,children:e.jsx(PT,{role:"menuitemradio","aria-checked":c,...s,ref:a,"data-state":Sz(c),onSelect:Se(s.onSelect,()=>{var l;return(l=o.onValueChange)==null?void 0:l.call(o,n)},{checkForDefaultPrevented:!1})})})});rJ.displayName=sJ;var Mz="MenuItemIndicator",[oJ,Gze]=KA(Mz,{checked:!1}),iJ=g.forwardRef((t,a)=>{const{__scopeMenu:n,forceMount:s,...o}=t,c=Gze(Mz,n);return e.jsx(Za,{present:s||nT(c.checked)||c.checked===!0,children:e.jsx(Ve.span,{...o,ref:a,"data-state":Sz(c.checked)})})});iJ.displayName=Mz;var Wze="MenuSeparator",cJ=g.forwardRef((t,a)=>{const{__scopeMenu:n,...s}=t;return e.jsx(Ve.div,{role:"separator","aria-orientation":"horizontal",...s,ref:a})});cJ.displayName=Wze;var Kze="MenuArrow",lJ=g.forwardRef((t,a)=>{const{__scopeMenu:n,...s}=t,o=UT(n);return e.jsx(FE,{...o,...s,ref:a})});lJ.displayName=Kze;var Yze="MenuSub",[wZe,dJ]=KA(Yze),n0="MenuSubTrigger",AJ=g.forwardRef((t,a)=>{const n=YA(n0,t.__scopeMenu),s=v2(n0,t.__scopeMenu),o=dJ(n0,t.__scopeMenu),c=jz(n0,t.__scopeMenu),l=g.useRef(null),{pointerGraceTimerRef:A,onPointerGraceIntentChange:u}=c,f={__scopeMenu:t.__scopeMenu},x=g.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return g.useEffect(()=>x,[x]),g.useEffect(()=>{const m=A.current;return()=>{window.clearTimeout(m),u(null)}},[A,u]),e.jsx(bz,{asChild:!0,...f,children:e.jsx(eJ,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":pJ(n.open),...t,ref:SE(a,o.onTriggerChange),onClick:m=>{var y;(y=t.onClick)==null||y.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Se(t.onPointerMove,i2(m=>{c.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!l.current&&(c.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),x()},100))})),onPointerLeave:Se(t.onPointerLeave,i2(m=>{var v,O;x();const y=(v=n.content)==null?void 0:v.getBoundingClientRect();if(y){const b=(O=n.content)==null?void 0:O.dataset.side,C=b==="right",j=C?-5:5,N=y[C?"left":"right"],M=y[C?"right":"left"];c.onPointerGraceIntentChange({area:[{x:m.clientX+j,y:m.clientY},{x:N,y:y.top},{x:M,y:y.top},{x:M,y:y.bottom},{x:N,y:y.bottom}],side:b}),window.clearTimeout(A.current),A.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(m),m.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:Se(t.onKeyDown,m=>{var v;const y=c.searchRef.current!=="";t.disabled||y&&m.key===" "||_ze[s.dir].includes(m.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),m.preventDefault())})})})});AJ.displayName=n0;var uJ="MenuSubContent",hJ=g.forwardRef((t,a)=>{const n=WY(ts,t.__scopeMenu),{forceMount:s=n.forceMount,...o}=t,c=YA(ts,t.__scopeMenu),l=v2(ts,t.__scopeMenu),A=dJ(uJ,t.__scopeMenu),u=g.useRef(null),f=rt(a,u);return e.jsx(o2.Provider,{scope:t.__scopeMenu,children:e.jsx(Za,{present:s||c.open,children:e.jsx(o2.Slot,{scope:t.__scopeMenu,children:e.jsx(Cz,{id:A.contentId,"aria-labelledby":A.triggerId,...o,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:x=>{var m;l.isUsingKeyboardRef.current&&((m=u.current)==null||m.focus()),x.preventDefault()},onCloseAutoFocus:x=>x.preventDefault(),onFocusOutside:Se(t.onFocusOutside,x=>{x.target!==A.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:Se(t.onEscapeKeyDown,x=>{l.onClose(),x.preventDefault()}),onKeyDown:Se(t.onKeyDown,x=>{var v;const m=x.currentTarget.contains(x.target),y=Lze[l.dir].includes(x.key);m&&y&&(c.onOpenChange(!1),(v=A.trigger)==null||v.focus(),x.preventDefault())})})})})})});hJ.displayName=uJ;function pJ(t){return t?"open":"closed"}function nT(t){return t==="indeterminate"}function Sz(t){return nT(t)?"indeterminate":t?"checked":"unchecked"}function Jze(t){const a=document.activeElement;for(const n of t)if(n===a||(n.focus(),document.activeElement!==a))return}function eFe(t,a){return t.map((n,s)=>t[(a+s)%t.length])}function tFe(t,a,n){const o=a.length>1&&Array.from(a).every(f=>f===a[0])?a[0]:a,c=n?t.indexOf(n):-1;let l=eFe(t,Math.max(c,0));o.length===1&&(l=l.filter(f=>f!==n));const u=l.find(f=>f.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function aFe(t,a){const{x:n,y:s}=t;let o=!1;for(let c=0,l=a.length-1;c<a.length;l=c++){const A=a[c],u=a[l],f=A.x,x=A.y,m=u.x,y=u.y;x>s!=y>s&&n<(m-f)*(s-x)/(y-x)+f&&(o=!o)}return o}function nFe(t,a){if(!a)return!1;const n={x:t.clientX,y:t.clientY};return aFe(n,a)}function i2(t){return a=>a.pointerType==="mouse"?t(a):void 0}var sFe=GY,rFe=bz,oFe=KY,iFe=YY,cFe=Nz,lFe=JY,dFe=PT,AFe=tJ,uFe=nJ,hFe=rJ,pFe=iJ,fFe=cJ,xFe=lJ,mFe=AJ,gFe=hJ,Qz="ContextMenu",[yFe]=tr(Qz,[XY]),Ga=XY(),[vFe,fJ]=yFe(Qz),xJ=t=>{const{__scopeContextMenu:a,children:n,onOpenChange:s,dir:o,modal:c=!0}=t,[l,A]=g.useState(!1),u=Ga(a),f=xa(s),x=g.useCallback(m=>{A(m),f(m)},[f]);return e.jsx(vFe,{scope:a,open:l,onOpenChange:x,modal:c,children:e.jsx(sFe,{...u,dir:o,open:l,onOpenChange:x,modal:c,children:n})})};xJ.displayName=Qz;var mJ="ContextMenuTrigger",gJ=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,disabled:s=!1,...o}=t,c=fJ(mJ,n),l=Ga(n),A=g.useRef({x:0,y:0}),u=g.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...A.current})}),f=g.useRef(0),x=g.useCallback(()=>window.clearTimeout(f.current),[]),m=y=>{A.current={x:y.clientX,y:y.clientY},c.onOpenChange(!0)};return g.useEffect(()=>x,[x]),g.useEffect(()=>void(s&&x()),[s,x]),e.jsxs(e.Fragment,{children:[e.jsx(rFe,{...l,virtualRef:u}),e.jsx(Ve.span,{"data-state":c.open?"open":"closed","data-disabled":s?"":void 0,...o,ref:a,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:s?t.onContextMenu:Se(t.onContextMenu,y=>{x(),m(y),y.preventDefault()}),onPointerDown:s?t.onPointerDown:Se(t.onPointerDown,yf(y=>{x(),f.current=window.setTimeout(()=>m(y),700)})),onPointerMove:s?t.onPointerMove:Se(t.onPointerMove,yf(x)),onPointerCancel:s?t.onPointerCancel:Se(t.onPointerCancel,yf(x)),onPointerUp:s?t.onPointerUp:Se(t.onPointerUp,yf(x))})]})});gJ.displayName=mJ;var kFe="ContextMenuPortal",yJ=t=>{const{__scopeContextMenu:a,...n}=t,s=Ga(a);return e.jsx(oFe,{...s,...n})};yJ.displayName=kFe;var vJ="ContextMenuContent",kJ=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=fJ(vJ,n),c=Ga(n),l=g.useRef(!1);return e.jsx(iFe,{...c,...s,ref:a,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:A=>{var u;(u=t.onCloseAutoFocus)==null||u.call(t,A),!A.defaultPrevented&&l.current&&A.preventDefault(),l.current=!1},onInteractOutside:A=>{var u;(u=t.onInteractOutside)==null||u.call(t,A),!A.defaultPrevented&&!o.modal&&(l.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kJ.displayName=vJ;var OFe="ContextMenuGroup",bFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(cFe,{...o,...s,ref:a})});bFe.displayName=OFe;var wFe="ContextMenuLabel",jFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(lFe,{...o,...s,ref:a})});jFe.displayName=wFe;var CFe="ContextMenuItem",OJ=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(dFe,{...o,...s,ref:a})});OJ.displayName=CFe;var NFe="ContextMenuCheckboxItem",MFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(AFe,{...o,...s,ref:a})});MFe.displayName=NFe;var SFe="ContextMenuRadioGroup",QFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(uFe,{...o,...s,ref:a})});QFe.displayName=SFe;var BFe="ContextMenuRadioItem",_Fe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(hFe,{...o,...s,ref:a})});_Fe.displayName=BFe;var LFe="ContextMenuItemIndicator",TFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(pFe,{...o,...s,ref:a})});TFe.displayName=LFe;var $Fe="ContextMenuSeparator",bJ=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(fFe,{...o,...s,ref:a})});bJ.displayName=$Fe;var IFe="ContextMenuArrow",UFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(xFe,{...o,...s,ref:a})});UFe.displayName=IFe;var PFe="ContextMenuSubTrigger",EFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(mFe,{...o,...s,ref:a})});EFe.displayName=PFe;var zFe="ContextMenuSubContent",FFe=g.forwardRef((t,a)=>{const{__scopeContextMenu:n,...s}=t,o=Ga(n);return e.jsx(gFe,{...o,...s,ref:a,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});FFe.displayName=zFe;function yf(t){return a=>a.pointerType!=="mouse"?t(a):void 0}var RFe=xJ,HFe=gJ,qFe=yJ,DFe=kJ,VFe=OJ,XFe=bJ;const Bz=RFe,_z=HFe;function Lz({children:t,className:a,...n}){return e.jsx(qFe,{children:e.jsx(DFe,{className:V("z-50 min-w-[160px] overflow-hidden rounded-md","bg-surface-1 border border-border shadow-xl","py-1","animate-in fade-in-0 zoom-in-95",a),...n,children:t})})}function ms({children:t,className:a,danger:n,...s}){return e.jsx(VFe,{className:V("flex items-center gap-2 px-3 py-1.5 text-sm font-sans cursor-pointer select-none outline-none",n?"text-danger focus:bg-danger/10":"text-text-1 focus:bg-surface-5 focus:text-text-0",a),...s,children:t})}function Tz({className:t}){return e.jsx(XFe,{className:V("h-px my-1 bg-border-subtle",t)})}function ZFe(t){const a=g.useRef({value:t,previous:t});return g.useMemo(()=>(a.current.value!==t&&(a.current.previous=a.current.value,a.current.value=t),a.current.previous),[t])}var GFe=[" ","Enter","ArrowUp","ArrowDown"],WFe=[" ","Enter"],DA="Select",[ET,zT,KFe]=Oz(DA),[Du]=tr(DA,[KFe,Ru]),FT=Ru(),[YFe,ui]=Du(DA),[JFe,eRe]=Du(DA),wJ=t=>{const{__scopeSelect:a,children:n,open:s,defaultOpen:o,onOpenChange:c,value:l,defaultValue:A,onValueChange:u,dir:f,name:x,autoComplete:m,disabled:y,required:v,form:O}=t,b=FT(a),[C,j]=g.useState(null),[N,M]=g.useState(null),[Q,L]=g.useState(!1),B=m2(f),[S,I]=Bu({prop:s,defaultProp:o??!1,onChange:c,caller:DA}),[z,P]=Bu({prop:l,defaultProp:A,onChange:u,caller:DA}),F=g.useRef(null),K=C?O||!!C.closest("form"):!0,[G,H]=g.useState(new Set),q=Array.from(G).map(_=>_.props.value).join(";");return e.jsx(PE,{...b,children:e.jsxs(YFe,{required:v,scope:a,trigger:C,onTriggerChange:j,valueNode:N,onValueNodeChange:M,valueNodeHasChildren:Q,onValueNodeHasChildrenChange:L,contentId:zr(),value:z,onValueChange:P,open:S,onOpenChange:I,dir:B,triggerPointerDownPosRef:F,disabled:y,children:[e.jsx(ET.Provider,{scope:a,children:e.jsx(JFe,{scope:t.__scopeSelect,onNativeOptionAdd:g.useCallback(_=>{H(R=>new Set(R).add(_))},[]),onNativeOptionRemove:g.useCallback(_=>{H(R=>{const U=new Set(R);return U.delete(_),U})},[]),children:n})}),K?e.jsxs(qJ,{"aria-hidden":!0,required:v,tabIndex:-1,name:x,autoComplete:m,value:z,onChange:_=>P(_.target.value),disabled:y,form:O,children:[z===void 0?e.jsx("option",{value:""}):null,Array.from(G)]},q):null]})})};wJ.displayName=DA;var jJ="SelectTrigger",CJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,disabled:s=!1,...o}=t,c=FT(n),l=ui(jJ,n),A=l.disabled||s,u=rt(a,l.onTriggerChange),f=zT(n),x=g.useRef("touch"),[m,y,v]=VJ(b=>{const C=f().filter(M=>!M.disabled),j=C.find(M=>M.value===l.value),N=XJ(C,b,j);N!==void 0&&l.onValueChange(N.value)}),O=b=>{A||(l.onOpenChange(!0),v()),b&&(l.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return e.jsx(EE,{asChild:!0,...c,children:e.jsx(Ve.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:A,"data-disabled":A?"":void 0,"data-placeholder":DJ(l.value)?"":void 0,...o,ref:u,onClick:Se(o.onClick,b=>{b.currentTarget.focus(),x.current!=="mouse"&&O(b)}),onPointerDown:Se(o.onPointerDown,b=>{x.current=b.pointerType;const C=b.target;C.hasPointerCapture(b.pointerId)&&C.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(O(b),b.preventDefault())}),onKeyDown:Se(o.onKeyDown,b=>{const C=m.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&y(b.key),!(C&&b.key===" ")&&GFe.includes(b.key)&&(O(),b.preventDefault())})})})});CJ.displayName=jJ;var NJ="SelectValue",MJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,className:s,style:o,children:c,placeholder:l="",...A}=t,u=ui(NJ,n),{onValueNodeHasChildrenChange:f}=u,x=c!==void 0,m=rt(a,u.onValueNodeChange);return Ta(()=>{f(x)},[f,x]),e.jsx(Ve.span,{...A,ref:m,style:{pointerEvents:"none"},children:DJ(u.value)?e.jsx(e.Fragment,{children:l}):c})});MJ.displayName=NJ;var tRe="SelectIcon",SJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,children:s,...o}=t;return e.jsx(Ve.span,{"aria-hidden":!0,...o,ref:a,children:s||"▼"})});SJ.displayName=tRe;var aRe="SelectPortal",QJ=t=>e.jsx(h2,{asChild:!0,...t});QJ.displayName=aRe;var VA="SelectContent",BJ=g.forwardRef((t,a)=>{const n=ui(VA,t.__scopeSelect),[s,o]=g.useState();if(Ta(()=>{o(new DocumentFragment)},[]),!n.open){const c=s;return c?cT.createPortal(e.jsx(_J,{scope:t.__scopeSelect,children:e.jsx(ET.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),c):null}return e.jsx(LJ,{...t,ref:a})});BJ.displayName=VA;var As=10,[_J,hi]=Du(VA),nRe="SelectContentImpl",sRe=Su("SelectContent.RemoveScroll"),LJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:c,onPointerDownOutside:l,side:A,sideOffset:u,align:f,alignOffset:x,arrowPadding:m,collisionBoundary:y,collisionPadding:v,sticky:O,hideWhenDetached:b,avoidCollisions:C,...j}=t,N=ui(VA,n),[M,Q]=g.useState(null),[L,B]=g.useState(null),S=rt(a,he=>Q(he)),[I,z]=g.useState(null),[P,F]=g.useState(null),K=zT(n),[G,H]=g.useState(!1),q=g.useRef(!1);g.useEffect(()=>{if(M)return VE(M)},[M]),DE();const _=g.useCallback(he=>{const[je,...ee]=K().map(Ne=>Ne.ref.current),[ke]=ee.slice(-1),ye=document.activeElement;for(const Ne of he)if(Ne===ye||(Ne==null||Ne.scrollIntoView({block:"nearest"}),Ne===je&&L&&(L.scrollTop=0),Ne===ke&&L&&(L.scrollTop=L.scrollHeight),Ne==null||Ne.focus(),document.activeElement!==ye))return},[K,L]),R=g.useCallback(()=>_([I,M]),[_,I,M]);g.useEffect(()=>{G&&R()},[G,R]);const{onOpenChange:U,triggerPointerDownPosRef:Z}=N;g.useEffect(()=>{if(M){let he={x:0,y:0};const je=ke=>{var ye,Ne;he={x:Math.abs(Math.round(ke.pageX)-(((ye=Z.current)==null?void 0:ye.x)??0)),y:Math.abs(Math.round(ke.pageY)-(((Ne=Z.current)==null?void 0:Ne.y)??0))}},ee=ke=>{he.x<=10&&he.y<=10?ke.preventDefault():M.contains(ke.target)||U(!1),document.removeEventListener("pointermove",je),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",je),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",je),document.removeEventListener("pointerup",ee,{capture:!0})}}},[M,U,Z]),g.useEffect(()=>{const he=()=>U(!1);return window.addEventListener("blur",he),window.addEventListener("resize",he),()=>{window.removeEventListener("blur",he),window.removeEventListener("resize",he)}},[U]);const[J,Ae]=VJ(he=>{const je=K().filter(ye=>!ye.disabled),ee=je.find(ye=>ye.ref.current===document.activeElement),ke=XJ(je,he,ee);ke&&setTimeout(()=>ke.ref.current.focus())}),W=g.useCallback((he,je,ee)=>{const ke=!q.current&&!ee;(N.value!==void 0&&N.value===je||ke)&&(z(he),ke&&(q.current=!0))},[N.value]),ae=g.useCallback(()=>M==null?void 0:M.focus(),[M]),Oe=g.useCallback((he,je,ee)=>{const ke=!q.current&&!ee;(N.value!==void 0&&N.value===je||ke)&&F(he)},[N.value]),ve=s==="popper"?xE:TJ,ce=ve===xE?{side:A,sideOffset:u,align:f,alignOffset:x,arrowPadding:m,collisionBoundary:y,collisionPadding:v,sticky:O,hideWhenDetached:b,avoidCollisions:C}:{};return e.jsx(_J,{scope:n,content:M,viewport:L,onViewportChange:B,itemRefCallback:W,selectedItem:I,onItemLeave:ae,itemTextRefCallback:Oe,focusSelectedItem:R,selectedItemText:P,position:s,isPositioned:G,searchRef:J,children:e.jsx(yT,{as:sRe,allowPinchZoom:!0,children:e.jsx(mT,{asChild:!0,trapped:N.open,onMountAutoFocus:he=>{he.preventDefault()},onUnmountAutoFocus:Se(o,he=>{var je;(je=N.trigger)==null||je.focus({preventScroll:!0}),he.preventDefault()}),children:e.jsx(A2,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:he=>he.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:e.jsx(ve,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:he=>he.preventDefault(),...j,...ce,onPlaced:()=>H(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Se(j.onKeyDown,he=>{const je=he.ctrlKey||he.altKey||he.metaKey;if(he.key==="Tab"&&he.preventDefault(),!je&&he.key.length===1&&Ae(he.key),["ArrowUp","ArrowDown","Home","End"].includes(he.key)){let ke=K().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(he.key)&&(ke=ke.slice().reverse()),["ArrowUp","ArrowDown"].includes(he.key)){const ye=he.target,Ne=ke.indexOf(ye);ke=ke.slice(Ne+1)}setTimeout(()=>_(ke)),he.preventDefault()}})})})})})})});LJ.displayName=nRe;var rRe="SelectItemAlignedPosition",TJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,onPlaced:s,...o}=t,c=ui(VA,n),l=hi(VA,n),[A,u]=g.useState(null),[f,x]=g.useState(null),m=rt(a,S=>x(S)),y=zT(n),v=g.useRef(!1),O=g.useRef(!0),{viewport:b,selectedItem:C,selectedItemText:j,focusSelectedItem:N}=l,M=g.useCallback(()=>{if(c.trigger&&c.valueNode&&A&&f&&b&&C&&j){const S=c.trigger.getBoundingClientRect(),I=f.getBoundingClientRect(),z=c.valueNode.getBoundingClientRect(),P=j.getBoundingClientRect();if(c.dir!=="rtl"){const ye=P.left-I.left,Ne=z.left-ye,ze=S.left-Ne,He=S.width+ze,Tt=Math.max(He,I.width),Et=window.innerWidth-As,ya=tE(Ne,[As,Math.max(As,Et-Tt)]);A.style.minWidth=He+"px",A.style.left=ya+"px"}else{const ye=I.right-P.right,Ne=window.innerWidth-z.right-ye,ze=window.innerWidth-S.right-Ne,He=S.width+ze,Tt=Math.max(He,I.width),Et=window.innerWidth-As,ya=tE(Ne,[As,Math.max(As,Et-Tt)]);A.style.minWidth=He+"px",A.style.right=ya+"px"}const F=y(),K=window.innerHeight-As*2,G=b.scrollHeight,H=window.getComputedStyle(f),q=parseInt(H.borderTopWidth,10),_=parseInt(H.paddingTop,10),R=parseInt(H.borderBottomWidth,10),U=parseInt(H.paddingBottom,10),Z=q+_+G+U+R,J=Math.min(C.offsetHeight*5,Z),Ae=window.getComputedStyle(b),W=parseInt(Ae.paddingTop,10),ae=parseInt(Ae.paddingBottom,10),Oe=S.top+S.height/2-As,ve=K-Oe,ce=C.offsetHeight/2,he=C.offsetTop+ce,je=q+_+he,ee=Z-je;if(je<=Oe){const ye=F.length>0&&C===F[F.length-1].ref.current;A.style.bottom="0px";const Ne=f.clientHeight-b.offsetTop-b.offsetHeight,ze=Math.max(ve,ce+(ye?ae:0)+Ne+R),He=je+ze;A.style.height=He+"px"}else{const ye=F.length>0&&C===F[0].ref.current;A.style.top="0px";const ze=Math.max(Oe,q+b.offsetTop+(ye?W:0)+ce)+ee;A.style.height=ze+"px",b.scrollTop=je-Oe+b.offsetTop}A.style.margin=`${As}px 0`,A.style.minHeight=J+"px",A.style.maxHeight=K+"px",s==null||s(),requestAnimationFrame(()=>v.current=!0)}},[y,c.trigger,c.valueNode,A,f,b,C,j,c.dir,s]);Ta(()=>M(),[M]);const[Q,L]=g.useState();Ta(()=>{f&&L(window.getComputedStyle(f).zIndex)},[f]);const B=g.useCallback(S=>{S&&O.current===!0&&(M(),N==null||N(),O.current=!1)},[M,N]);return e.jsx(iRe,{scope:n,contentWrapper:A,shouldExpandOnScrollRef:v,onScrollButtonChange:B,children:e.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:Q},children:e.jsx(Ve.div,{...o,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});TJ.displayName=rRe;var oRe="SelectPopperPosition",xE=g.forwardRef((t,a)=>{const{__scopeSelect:n,align:s="start",collisionPadding:o=As,...c}=t,l=FT(n);return e.jsx(zE,{...l,...c,ref:a,align:s,collisionPadding:o,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xE.displayName=oRe;var[iRe,$z]=Du(VA,{}),mE="SelectViewport",$J=g.forwardRef((t,a)=>{const{__scopeSelect:n,nonce:s,...o}=t,c=hi(mE,n),l=$z(mE,n),A=rt(a,c.onViewportChange),u=g.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),e.jsx(ET.Slot,{scope:n,children:e.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:A,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Se(o.onScroll,f=>{const x=f.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:y}=l;if(y!=null&&y.current&&m){const v=Math.abs(u.current-x.scrollTop);if(v>0){const O=window.innerHeight-As*2,b=parseFloat(m.style.minHeight),C=parseFloat(m.style.height),j=Math.max(b,C);if(j<O){const N=j+v,M=Math.min(O,N),Q=N-M;m.style.height=M+"px",m.style.bottom==="0px"&&(x.scrollTop=Q>0?Q:0,m.style.justifyContent="flex-end")}}}u.current=x.scrollTop})})})]})});$J.displayName=mE;var IJ="SelectGroup",[cRe,lRe]=Du(IJ),dRe=g.forwardRef((t,a)=>{const{__scopeSelect:n,...s}=t,o=zr();return e.jsx(cRe,{scope:n,id:o,children:e.jsx(Ve.div,{role:"group","aria-labelledby":o,...s,ref:a})})});dRe.displayName=IJ;var UJ="SelectLabel",ARe=g.forwardRef((t,a)=>{const{__scopeSelect:n,...s}=t,o=lRe(UJ,n);return e.jsx(Ve.div,{id:o.id,...s,ref:a})});ARe.displayName=UJ;var sT="SelectItem",[uRe,PJ]=Du(sT),EJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,value:s,disabled:o=!1,textValue:c,...l}=t,A=ui(sT,n),u=hi(sT,n),f=A.value===s,[x,m]=g.useState(c??""),[y,v]=g.useState(!1),O=rt(a,N=>{var M;return(M=u.itemRefCallback)==null?void 0:M.call(u,N,s,o)}),b=zr(),C=g.useRef("touch"),j=()=>{o||(A.onValueChange(s),A.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(uRe,{scope:n,value:s,disabled:o,textId:b,isSelected:f,onItemTextChange:g.useCallback(N=>{m(M=>M||((N==null?void 0:N.textContent)??"").trim())},[]),children:e.jsx(ET.ItemSlot,{scope:n,value:s,disabled:o,textValue:x,children:e.jsx(Ve.div,{role:"option","aria-labelledby":b,"data-highlighted":y?"":void 0,"aria-selected":f&&y,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...l,ref:O,onFocus:Se(l.onFocus,()=>v(!0)),onBlur:Se(l.onBlur,()=>v(!1)),onClick:Se(l.onClick,()=>{C.current!=="mouse"&&j()}),onPointerUp:Se(l.onPointerUp,()=>{C.current==="mouse"&&j()}),onPointerDown:Se(l.onPointerDown,N=>{C.current=N.pointerType}),onPointerMove:Se(l.onPointerMove,N=>{var M;C.current=N.pointerType,o?(M=u.onItemLeave)==null||M.call(u):C.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(l.onPointerLeave,N=>{var M;N.currentTarget===document.activeElement&&((M=u.onItemLeave)==null||M.call(u))}),onKeyDown:Se(l.onKeyDown,N=>{var Q;((Q=u.searchRef)==null?void 0:Q.current)!==""&&N.key===" "||(WFe.includes(N.key)&&j(),N.key===" "&&N.preventDefault())})})})})});EJ.displayName=sT;var s0="SelectItemText",zJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,className:s,style:o,...c}=t,l=ui(s0,n),A=hi(s0,n),u=PJ(s0,n),f=eRe(s0,n),[x,m]=g.useState(null),y=rt(a,j=>m(j),u.onItemTextChange,j=>{var N;return(N=A.itemTextRefCallback)==null?void 0:N.call(A,j,u.value,u.disabled)}),v=x==null?void 0:x.textContent,O=g.useMemo(()=>e.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:C}=f;return Ta(()=>(b(O),()=>C(O)),[b,C,O]),e.jsxs(e.Fragment,{children:[e.jsx(Ve.span,{id:u.textId,...c,ref:y}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?cT.createPortal(c.children,l.valueNode):null]})});zJ.displayName=s0;var FJ="SelectItemIndicator",RJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,...s}=t;return PJ(FJ,n).isSelected?e.jsx(Ve.span,{"aria-hidden":!0,...s,ref:a}):null});RJ.displayName=FJ;var gE="SelectScrollUpButton",hRe=g.forwardRef((t,a)=>{const n=hi(gE,t.__scopeSelect),s=$z(gE,t.__scopeSelect),[o,c]=g.useState(!1),l=rt(a,s.onScrollButtonChange);return Ta(()=>{if(n.viewport&&n.isPositioned){let A=function(){const f=u.scrollTop>0;c(f)};const u=n.viewport;return A(),u.addEventListener("scroll",A),()=>u.removeEventListener("scroll",A)}},[n.viewport,n.isPositioned]),o?e.jsx(HJ,{...t,ref:l,onAutoScroll:()=>{const{viewport:A,selectedItem:u}=n;A&&u&&(A.scrollTop=A.scrollTop-u.offsetHeight)}}):null});hRe.displayName=gE;var yE="SelectScrollDownButton",pRe=g.forwardRef((t,a)=>{const n=hi(yE,t.__scopeSelect),s=$z(yE,t.__scopeSelect),[o,c]=g.useState(!1),l=rt(a,s.onScrollButtonChange);return Ta(()=>{if(n.viewport&&n.isPositioned){let A=function(){const f=u.scrollHeight-u.clientHeight,x=Math.ceil(u.scrollTop)<f;c(x)};const u=n.viewport;return A(),u.addEventListener("scroll",A),()=>u.removeEventListener("scroll",A)}},[n.viewport,n.isPositioned]),o?e.jsx(HJ,{...t,ref:l,onAutoScroll:()=>{const{viewport:A,selectedItem:u}=n;A&&u&&(A.scrollTop=A.scrollTop+u.offsetHeight)}}):null});pRe.displayName=yE;var HJ=g.forwardRef((t,a)=>{const{__scopeSelect:n,onAutoScroll:s,...o}=t,c=hi("SelectScrollButton",n),l=g.useRef(null),A=zT(n),u=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>u(),[u]),Ta(()=>{var x;const f=A().find(m=>m.ref.current===document.activeElement);(x=f==null?void 0:f.ref.current)==null||x.scrollIntoView({block:"nearest"})},[A]),e.jsx(Ve.div,{"aria-hidden":!0,...o,ref:a,style:{flexShrink:0,...o.style},onPointerDown:Se(o.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(s,50))}),onPointerMove:Se(o.onPointerMove,()=>{var f;(f=c.onItemLeave)==null||f.call(c),l.current===null&&(l.current=window.setInterval(s,50))}),onPointerLeave:Se(o.onPointerLeave,()=>{u()})})}),fRe="SelectSeparator",xRe=g.forwardRef((t,a)=>{const{__scopeSelect:n,...s}=t;return e.jsx(Ve.div,{"aria-hidden":!0,...s,ref:a})});xRe.displayName=fRe;var vE="SelectArrow",mRe=g.forwardRef((t,a)=>{const{__scopeSelect:n,...s}=t,o=FT(n),c=ui(vE,n),l=hi(vE,n);return c.open&&l.position==="popper"?e.jsx(FE,{...o,...s,ref:a}):null});mRe.displayName=vE;var gRe="SelectBubbleInput",qJ=g.forwardRef(({__scopeSelect:t,value:a,...n},s)=>{const o=g.useRef(null),c=rt(s,o),l=ZFe(a);return g.useEffect(()=>{const A=o.current;if(!A)return;const u=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(u,"value").set;if(l!==a&&x){const m=new Event("change",{bubbles:!0});x.call(A,a),A.dispatchEvent(m)}},[l,a]),e.jsx(Ve.select,{...n,style:{...YZ,...n.style},ref:c,defaultValue:a})});qJ.displayName=gRe;function DJ(t){return t===""||t===void 0}function VJ(t){const a=xa(t),n=g.useRef(""),s=g.useRef(0),o=g.useCallback(l=>{const A=n.current+l;a(A),(function u(f){n.current=f,window.clearTimeout(s.current),f!==""&&(s.current=window.setTimeout(()=>u(""),1e3))})(A)},[a]),c=g.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,o,c]}function XJ(t,a,n){const o=a.length>1&&Array.from(a).every(f=>f===a[0])?a[0]:a,c=n?t.indexOf(n):-1;let l=yRe(t,Math.max(c,0));o.length===1&&(l=l.filter(f=>f!==n));const u=l.find(f=>f.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function yRe(t,a){return t.map((n,s)=>t[(a+s)%t.length])}var vRe=wJ,kRe=CJ,ORe=MJ,bRe=SJ,wRe=QJ,jRe=BJ,CRe=$J,NRe=EJ,MRe=zJ,SRe=RJ;function Ur({children:t,...a}){return e.jsx(vRe,{...a,children:t})}function Pr({children:t,className:a,placeholder:n,...s}){return e.jsxs(kRe,{className:V("flex h-8 w-full items-center justify-between rounded-md px-3 text-sm","bg-surface-1 border border-border text-text-0 font-sans","focus:outline-none focus:ring-1 focus:ring-accent","disabled:opacity-40 disabled:cursor-not-allowed","cursor-pointer select-none",a),...s,children:[e.jsx(ORe,{placeholder:n}),e.jsx(bRe,{children:e.jsx(bt,{size:14,className:"text-text-3"})})]})}function Er({children:t,className:a,...n}){return e.jsx(wRe,{children:e.jsx(jRe,{position:"popper",sideOffset:4,className:V("z-50 min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md","bg-surface-1 border border-border shadow-xl","animate-in fade-in-0 zoom-in-95",a),...n,children:e.jsx(CRe,{className:"py-1",children:t})})})}function Da({children:t,className:a,...n}){return e.jsxs(NRe,{className:V("flex items-center gap-2 px-3 py-1.5 text-sm font-sans cursor-pointer select-none","text-text-1 outline-none","focus:bg-surface-5 focus:text-text-0",a),...n,children:[e.jsx(MRe,{children:t}),e.jsx(SRe,{className:"ml-auto",children:e.jsx(De,{size:14,className:"text-accent"})})]})}function ri({label:t,value:a,onChange:n,min:s=0,max:o=100,step:c=1,formatValue:l,displayValue:A,disabled:u,className:f}){const x=(a-s)/(o-s)*100,m=A||l,y=typeof m=="function"?m(a):typeof m=="string"?m:a;return e.jsxs("div",{className:V("group flex items-center gap-2 py-1.5",u&&"opacity-40 pointer-events-none",f),children:[e.jsx("span",{className:"text-2xs text-text-2 font-sans w-20 shrink-0 truncate",children:t}),e.jsxs("div",{className:"relative flex-1 flex items-center h-5",children:[e.jsx("div",{className:"absolute inset-y-0 flex items-center w-full pointer-events-none",children:e.jsx("div",{className:"w-full h-1 rounded-full bg-surface-5",children:e.jsx("div",{className:"h-full rounded-full bg-accent/70 group-hover:bg-accent transition-colors",style:{width:`${x}%`}})})}),e.jsx("input",{type:"range",min:s,max:o,step:c,value:a,disabled:u,onChange:v=>n(Number(v.target.value)),className:`relative w-full h-5 appearance-none bg-transparent cursor-pointer
8664
8664
  [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3
8665
8665
  [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-accent
8666
8666
  [&::-webkit-slider-thumb]:shadow-[0_0_0_2px_var(--color-surface-1)]
@@ -8671,10 +8671,10 @@ ${Q.join(`
8671
8671
  [&::-moz-range-thumb]:bg-accent [&::-moz-range-thumb]:border-none
8672
8672
  [&::-moz-range-thumb]:shadow-[0_0_0_2px_var(--color-surface-1)]
8673
8673
  [&::-moz-range-track]:bg-transparent
8674
- disabled:cursor-not-allowed`})]}),e.jsx("span",{className:"text-2xs text-accent font-mono font-medium w-10 text-right shrink-0 tabular-nums",children:y})]})}const QRe={agentNode:VG,rootNode:XG},lP=220,dP=82,vf=260,kf=130,_o=4,Ua="__groove_root__";function r0(t){if(!t)return{};try{return JSON.parse(localStorage.getItem(`groove:nodePositions:${t}`)||"{}")}catch{return{}}}function ZJ(){let t=!1;for(const a of["groove:chatHistory","groove:activityLog"])localStorage.getItem(a)!==null&&(localStorage.removeItem(a),t=!0);return t}function NX(t,a){if(!t)return;const n=`groove:nodePositions:${t}`,s=JSON.stringify(a);try{localStorage.setItem(n,s);return}catch{}if(ZJ())try{localStorage.setItem(n,s)}catch{}}function GJ(){try{return JSON.parse(localStorage.getItem("groove:roleLayout")||"{}")}catch{return{}}}function BRe(t){const a="groove:roleLayout",n=JSON.stringify(t);try{localStorage.setItem(a,n);return}catch{}if(ZJ())try{localStorage.setItem(a,n)}catch{}}function WJ(){try{return JSON.parse(localStorage.getItem("groove:teamViewports")||"{}")}catch{return{}}}function _Re(t,a){try{const n=WJ();n[t]=a,localStorage.setItem("groove:teamViewports",JSON.stringify(n))}catch{}}function LRe(t,a){const n=t.filter(l=>l.teamId===a);return n.length===0?"idle":n.some(l=>l.status==="running"||l.status==="starting")?"working":n.every(l=>l.status==="completed")?"completed":n.some(l=>l.status==="crashed")?"crashed":"idle"}function TRe(){const t=$(_=>_.teams),a=$(_=>_.activeTeamId),n=$(_=>_.agents),s=$(_=>_.switchTeam),o=$(_=>_.createTeam),c=$(_=>_.deleteTeamPermanently),l=$(_=>_.renameTeam),A=$(_=>_.cloneTeam),u=$(_=>_.reorderTeams),f=$(_=>_.addToast),[x,m]=g.useState(!1),[y,v]=g.useState(""),[O,b]=g.useState(null),[C,j]=g.useState(""),N=g.useRef(!1),[M,Q]=g.useState(null),[L,B]=g.useState(null),S=g.useRef(null),[I,z]=g.useState(!1),[P,F]=g.useState(!1),K=g.useCallback(()=>{const _=S.current;_&&(z(_.scrollLeft>0),F(_.scrollLeft+_.clientWidth<_.scrollWidth-1))},[]);g.useEffect(()=>{const _=S.current;if(!_)return;K(),_.addEventListener("scroll",K);const R=new ResizeObserver(K);return R.observe(_),()=>{_.removeEventListener("scroll",K),R.disconnect()}},[K,t.length]);function G(){const _=y.trim();!_||N.current||(N.current=!0,v(""),m(!1),o(_).finally(()=>{N.current=!1,setTimeout(()=>{S.current&&S.current.scrollTo({left:S.current.scrollWidth,behavior:"smooth"})},100)}))}function H(_){b(_.id),j(_.name)}function q(){const _=C.trim();if(!_||!O){b(null);return}l(O,_),b(null)}return e.jsxs("div",{className:"flex items-end px-0 pt-0 pb-0 bg-surface-1 border-b border-border gap-0 flex-shrink-0 overflow-hidden",children:[I&&e.jsx("button",{onClick:()=>{var _;return(_=S.current)==null?void 0:_.scrollBy({left:-300,behavior:"smooth"})},className:"w-6 h-9 flex items-center justify-center bg-accent/15 text-accent hover:bg-accent/25 transition-colors flex-shrink-0 cursor-pointer",children:e.jsx(bs,{size:14})}),e.jsxs("div",{ref:S,className:"flex items-end flex-1 min-w-0 overflow-x-auto gap-0",style:{scrollbarWidth:"none",msOverflowStyle:"none",WebkitOverflowScrolling:"touch"},children:[t.map(_=>{const R=n.filter(Ae=>Ae.teamId===_.id).length,U=_.id===a,Z=O===_.id,J=n.filter(Ae=>Ae.teamId===_.id&&(Ae.status==="running"||Ae.status==="starting")).length;return e.jsxs(Bz,{children:[e.jsx(_z,{asChild:!0,children:e.jsxs("div",{draggable:!Z,onDragStart:Ae=>{Q(_.id),Ae.dataTransfer.effectAllowed="move",Ae.dataTransfer.setData("text/plain","")},onDragEnd:()=>{Q(null),B(null)},onDragOver:Ae=>{Ae.preventDefault(),Ae.dataTransfer.dropEffect="move",M&&M!==_.id&&B(_.id)},onDragLeave:()=>{L===_.id&&B(null)},onDrop:Ae=>{if(Ae.preventDefault(),!M||M===_.id)return;const W=t.findIndex(Oe=>Oe.id===M),ae=t.findIndex(Oe=>Oe.id===_.id);W!==-1&&ae!==-1&&u(W,ae),Q(null),B(null)},onClick:()=>!Z&&s(_.id),onDoubleClick:()=>H(_),className:V("relative flex items-center gap-2 px-3 h-9 text-xs font-sans cursor-pointer select-none transition-colors flex-shrink-0",U?"text-text-0 font-semibold border-x border-x-[#242830] bg-[#242830]":"text-text-3 hover:text-text-1 hover:bg-surface-3/50",M===_.id&&"opacity-40",L===_.id&&M!==_.id&&"border-l-2 !border-l-accent"),children:[U&&e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-accent",style:{height:"0.5px"}}),(()=>{const Ae=LRe(n,_.id),W=Ae==="working"||Ae==="completed"?"text-green-400":Ae==="crashed"?"text-red-400":U?"text-accent":"text-text-4";return e.jsxs("span",{className:"relative flex-shrink-0",children:[e.jsx(Fa,{size:13,className:V(W,Ae==="working"&&"animate-pulse")}),Ae==="working"&&e.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-1.5 h-1.5 rounded-full bg-green-400 animate-pulse"})]})})(),Z?e.jsx("input",{value:C,onChange:Ae=>j(Ae.target.value),onKeyDown:Ae=>{Ae.key==="Enter"&&q(),Ae.key==="Escape"&&b(null)},onBlur:q,className:"h-5 w-24 px-1.5 text-xs bg-surface-0 border border-accent rounded text-text-0 font-sans focus:outline-none",autoFocus:!0,onClick:Ae=>Ae.stopPropagation()}):e.jsx("span",{className:"truncate max-w-[120px]",children:_.name}),R>0&&!Z&&e.jsx("span",{className:V("flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full text-2xs font-mono font-semibold",J>0?"bg-accent/15 text-accent":"bg-surface-4 text-text-3"),children:R}),U&&e.jsx("div",{className:"absolute bottom-[-1px] left-0 right-0 h-px bg-[#242830]"})]})}),e.jsxs(Lz,{children:[e.jsxs(ms,{onSelect:()=>H(_),children:[e.jsx(js,{size:12})," Rename"]}),e.jsxs(ms,{onSelect:()=>A(_.id),children:[e.jsx(wn,{size:12})," Clone"]}),e.jsx(Tz,{}),e.jsxs(ms,{danger:!0,onSelect:()=>{if(n.filter(W=>W.teamId===_.id).some(W=>W.status==="running"||W.status==="starting")){f("error","Stop running agents first");return}c(_.id)},children:[e.jsx(At,{size:12})," Delete"]})]})]},_.id)}),x?e.jsxs("div",{className:"flex items-center gap-1.5 px-3 h-9 flex-shrink-0",children:[e.jsx("input",{value:y,onChange:_=>v(_.target.value),onKeyDown:_=>{_.key==="Enter"&&G(),_.key==="Escape"&&(m(!1),v(""))},placeholder:"Team name...",className:"h-5 w-28 px-1.5 text-xs bg-surface-0 border border-border-subtle rounded text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:G,disabled:!y.trim(),className:"p-1 rounded text-accent hover:bg-accent/10 cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",children:e.jsx(De,{size:12})}),e.jsx("button",{onClick:()=>{m(!1),v("")},className:"p-1 rounded text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(Ge,{size:12})})]}):e.jsx("button",{onClick:()=>m(!0),className:"flex items-center justify-center w-6 h-6 my-auto mx-2 rounded-full bg-accent/15 text-accent hover:bg-accent/25 cursor-pointer transition-colors flex-shrink-0",title:"New team",children:e.jsx(ht,{size:12})})]}),P&&e.jsx("button",{onClick:()=>{var _;return(_=S.current)==null?void 0:_.scrollBy({left:300,behavior:"smooth"})},className:"w-6 h-9 flex items-center justify-center bg-accent/15 text-accent hover:bg-accent/25 transition-colors flex-shrink-0 cursor-pointer",children:e.jsx(Rt,{size:14})})]})}function $Re(){const t=$(H=>H.agents),a=$(H=>H.activeTeamId),n=$(H=>H.tokenTimeline),s=$(H=>H.selectAgent),o=$(H=>H.closeDetail),c=g.useRef([]),l=g.useMemo(()=>{const H=t.filter(_=>_.teamId===a).sort((_,R)=>(_.name||_.id).localeCompare(R.name||R.id)),q=c.current;return q.length===H.length&&q.every((_,R)=>_.id===H[R].id&&_.status===H[R].status&&_.name===H[R].name&&_.model===H[R].model&&_.tokensUsed===H[R].tokensUsed&&_.contextUsage===H[R].contextUsage)?q:(c.current=H,H)},[t,a]),A=g.useRef(r0(a)),u=g.useRef(a);u.current!==a&&(u.current=a,A.current=r0(a));const{fitView:f,setViewport:x}=Vae(),[m,y]=g.useState(0),v=g.useRef(a),O=g.useMemo(()=>{const H=A.current,q=GJ(),_=l.filter(ae=>ae.status==="running").length,R=H[Ua]||q[Ua]||{x:0,y:0},U=[{id:Ua,type:"rootNode",position:R,data:{agentCount:l.length,runningCount:_},draggable:!0,selectable:!1}],Z=new Set,J=(ae,Oe)=>`${Math.round(ae/100)},${Math.round(Oe/100)}`;Z.add(J(R.x,R.y));const Ae=[];l.forEach(ae=>{const Oe=ae.name||ae.id;if(H[Oe]){const ve=H[Oe];Z.add(J(ve.x,ve.y)),U.push({id:ae.id,type:"agentNode",position:ve,data:{agent:ae,timeline:n[ae.id]||[]},draggable:!0,selectable:!0})}else Ae.push(ae)});const W=new Map;return Ae.forEach((ae,Oe)=>{const ve=ae.role||"agent",ce=W.get(ve)||0;W.set(ve,ce+1);const he=ce===0?ve:`${ve}-${ce}`;let je;if(q[he])je={...q[he]};else{const ee=Math.floor(Oe/_o),ke=Oe%_o;je={x:-((Math.min(Ae.length-ee*_o,_o)-1)*vf)/2+ke*vf,y:kf+ee*kf}}for(;Z.has(J(je.x,je.y));)je={x:je.x,y:je.y+kf};Z.add(J(je.x,je.y)),ae.name||ae.id,U.push({id:ae.id,type:"agentNode",position:je,data:{agent:ae,timeline:n[ae.id]||[]},draggable:!0,selectable:!0})}),U},[l,n,a]);g.useEffect(()=>{const H={};O.forEach(q=>{var R,U;const _=q.id===Ua?Ua:((U=(R=q.data)==null?void 0:R.agent)==null?void 0:U.name)||q.id;A.current[_]||(H[_]=q.position)}),Object.keys(H).length>0&&(Object.assign(A.current,H),NX(a,A.current))},[O,a]);const b=g.useMemo(()=>{const H=r0(a),q=H[Ua]||{x:0,y:0};return l.map((_,R)=>{const U=_.name||_.id,Z=Math.floor(R/_o),J=R%_o,W=-((Math.min(l.length-Z*_o,_o)-1)*vf)/2,ae=H[U]||{x:W+J*vf,y:140+Z*kf},Oe=ae.x+lP/2-q.x,ve=ae.y+dP/2-q.y;let ce,he;return Math.abs(ve)>Math.abs(Oe)?(ce=ve>0?"bottom":"top",he=ve>0?"top":"bottom"):(ce=Oe>0?"right":"left",he=Oe>0?"left":"right"),{id:`e-${Ua}-${_.id}`,source:Ua,target:_.id,sourceHandle:ce,targetHandle:he,type:"default",animated:_.status==="running"}})},[l,a]),[C,j,N]=Xae(O),[M,Q,L]=Zae(b),B=g.useRef(new Set);g.useEffect(()=>{j(H=>{const q=new Map(H.map(_=>[_.id,_]));return O.map(_=>{const R=q.get(_.id);return R?{...R,data:_.data}:_})})},[O,j]),g.useEffect(()=>{Q(()=>{const H=C.find(_=>_.id===Ua);if(!H)return b;const q=H.position;return b.map(_=>{const R=C.find(W=>W.id===_.target);if(!R)return _;const U=R.position.x+lP/2-q.x,Z=R.position.y+dP/2-q.y;let J,Ae;return Math.abs(Z)>Math.abs(U)?(J=Z>0?"bottom":"top",Ae=Z>0?"top":"bottom"):(J=U>0?"right":"left",Ae=U>0?"left":"right"),{..._,sourceHandle:J,targetHandle:Ae}})})},[b,C,Q]);const S=l.map(H=>H.id).join(","),I=g.useRef(null);g.useEffect(()=>{if(v.current!==a){v.current=a,B.current=new Set(l.map(R=>R.id)),y(l.length);const _=WJ()[a];_?x(_,{duration:200}):l.length>0&&f({padding:.3,maxZoom:1.2,duration:200});return}const H=new Set(l.map(_=>_.id)),q=l.length>0&&[...H].some(_=>!B.current.has(_));B.current=H,m===0&&l.length>0?f({padding:.3,maxZoom:1.2,duration:0}):q&&(clearTimeout(I.current),I.current=setTimeout(()=>f({padding:.3,maxZoom:1.2,duration:300}),500)),y(l.length)},[S,m,f,a,x]);const z=g.useCallback((H,q)=>{_Re(a,q)},[a]),P=g.useCallback((H,q)=>{q.id!==Ua&&s(q.id)},[s]),F=g.useCallback(()=>{o()},[o]),K=g.useCallback((H,q)=>{const _=C.find(U=>U.id===Ua);if(!_)return;const R=_.position;Q(U=>U.map(Z=>{const J=Z.source===q.id,Ae=Z.target===q.id;if(!J&&!Ae)return Z;const W=q.position,ae=W.x+lP/2-R.x,Oe=W.y+dP/2-R.y;let ve,ce;return Math.abs(Oe)>Math.abs(ae)?(ve=Oe>0?"bottom":"top",ce=Oe>0?"top":"bottom"):(ve=ae>0?"right":"left",ce=ae>0?"left":"right"),{...Z,sourceHandle:ve,targetHandle:ce}}))},[C,Q]),G=g.useCallback((H,q)=>{var U,Z;const _=q.id===Ua?Ua:((Z=(U=q.data)==null?void 0:U.agent)==null?void 0:Z.name)||q.id;A.current[_]=q.position;const R=r0(a);R[_]=q.position,NX(a,R)},[a]);return e.jsx(Gae,{nodes:C,edges:M,nodeTypes:QRe,onNodesChange:N,onEdgesChange:L,onNodeClick:P,onPaneClick:F,onNodeDrag:K,onNodeDragStop:G,onMoveEnd:z,defaultViewport:{x:0,y:0,zoom:1.2},proOptions:{hideAttribution:!0},minZoom:.2,maxZoom:1.5,className:"bg-surface-2",children:e.jsx(Wae,{color:"rgba(97,175,239,0.03)",gap:24,size:1})})}const Iz=new Set(["codex","grok","local"]),IRe=new Set(["codex"]);function URe({open:t,onOpenChange:a,onLaunch:n}){const s=$(B=>B.fetchProviders),[o,c]=g.useState([]),[l,A]=g.useState(""),[u,f]=g.useState(""),[x,m]=g.useState(50),[y,v]=g.useState(.5),[O,b]=g.useState(50);g.useEffect(()=>{t&&s().then(B=>{var I;if(!Array.isArray(B))return;const S=B.filter(z=>z.installed);if(c(S),!l&&S.length>0){const z=S.find(F=>F.isDefault)||S[0];A(z.id);const P=((I=z.models)==null?void 0:I.filter(F=>F.type!=="image"))||[];P.length>0&&f(P[0].id)}}).catch(()=>{})},[t]);const C=o.find(B=>B.id===l),j=((C==null?void 0:C.models)||[]).filter(B=>B.type!=="image"&&!B.disabled),N=Iz.has(l),M=IRe.has(l);function Q(B){var z;A(B);const S=o.find(P=>P.id===B),I=((S==null?void 0:S.models)||[]).filter(P=>P.type!=="image"&&!P.disabled);f(((z=I[0])==null?void 0:z.id)||"")}function L(){const B={provider:l,model:u,reasoningEffort:x,...N&&{temperature:y},...M&&{verbosity:O}};$.setState({teamLaunchConfig:B}),n(B)}return e.jsx(Ut,{open:t,onOpenChange:a,children:e.jsxs(Pt,{title:"Configure Planner",description:"Set provider, model, and tuning before launching the planner",children:[e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans",children:"Provider"}),e.jsxs(Ur,{value:l,onValueChange:Q,children:[e.jsx(Pr,{placeholder:"Select provider",className:"bg-surface-3"}),e.jsx(Er,{children:o.map(B=>e.jsx(Da,{value:B.id,children:B.displayName||B.name||B.id},B.id))})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans",children:"Model"}),e.jsxs(Ur,{value:u,onValueChange:f,children:[e.jsx(Pr,{placeholder:"Select model",className:"bg-surface-3"}),e.jsxs(Er,{children:[e.jsx(Da,{value:"auto",children:"Auto"}),j.map(B=>e.jsx(Da,{value:B.id,children:B.name||B.id},B.id))]})]})]}),e.jsxs("div",{className:"space-y-1 pt-1",children:[e.jsx(ri,{label:"Reasoning Effort",value:x,onChange:m,min:0,max:100,step:1}),N&&e.jsx(ri,{label:"Temperature",value:y,onChange:v,min:0,max:1,step:.01,formatValue:B=>B.toFixed(2)}),M&&e.jsx(ri,{label:"Verbosity",value:O,onChange:b,min:0,max:100,step:1})]})]}),e.jsx("div",{className:"px-5 py-4 border-t border-border-subtle",children:e.jsxs(fe,{variant:"primary",size:"md",onClick:L,className:"w-full gap-2",children:[e.jsx(wt,{size:14}),"Launch Planner"]})})]})})}const MX={chat:Yn,planner:es,backend:aa,frontend:Dr,fullstack:Zt,testing:ti,devops:NA,docs:Va,security:La,database:MA,cmo:_A,cfo:tu,ea:Ou,support:Au,analyst:hs,creative:Lr,slides:yu,ambassador:sa},AP=[{id:"planner",label:"Planner",desc:"Analyzes tasks and designs team plans"},{id:"frontend",label:"Frontend",desc:"React, UI components, views, styling"},{id:"backend",label:"Backend",desc:"APIs, server logic, database, services"},{id:"fullstack",label:"Fullstack",desc:"Cross-stack work, QC, integration testing"},{id:"testing",label:"Testing",desc:"Test suites, coverage, quality assurance"},{id:"devops",label:"DevOps",desc:"CI/CD, deployment, infrastructure"},{id:"security",label:"Security",desc:"Security audits, vulnerability analysis"},{id:"database",label:"Database",desc:"Schema design, queries, migrations"},{id:"docs",label:"Docs",desc:"Documentation, guides, API docs"},{id:"cmo",label:"CMO",desc:"Marketing strategy, campaigns, content"},{id:"cfo",label:"CFO",desc:"Financial analysis, budgeting, forecasting"},{id:"ea",label:"EA",desc:"Executive assistance, coordination, briefings"},{id:"support",label:"Support",desc:"Customer support, issue triage"},{id:"analyst",label:"Analyst",desc:"Data analysis, research, reporting"},{id:"creative",label:"Writer",desc:"Design, copywriting, visual assets"},{id:"slides",label:"Slides",desc:"Presentations, decks, pitch materials"}],PRe=[{name:"Dev Team",icon:Zt,roles:["frontend","backend","testing"],desc:"3 agents"},{name:"Full Stack",icon:Dn,roles:["frontend","backend","fullstack","testing","devops"],desc:"5 agents"},{name:"Marketing",icon:_A,roles:["cmo","creative","analyst"],desc:"3 agents"},{name:"Business",icon:hs,roles:["cfo","analyst","ea"],desc:"3 agents"},{name:"Security Audit",icon:La,roles:["security","testing","devops"],desc:"3 agents"},{name:"Docs",icon:Va,roles:["docs","frontend","analyst"],desc:"3 agents"}];function ERe(){const t=$(W=>W.teamBuilderOpen),a=$(W=>W.teamBuilderRoles),n=$(W=>W.teamBuilderSettings),s=$(W=>W.teamBuilderTask),o=$(W=>W.teamTemplates),c=$(W=>W.closeTeamBuilder),l=$(W=>W.addTeamBuilderRole),A=$(W=>W.removeTeamBuilderRole),u=$(W=>W.updateTeamBuilderRole),f=$(W=>W.applyTemplate),x=$(W=>W.setTeamBuilderSettings),m=$(W=>W.setTeamBuilderTask),y=$(W=>W.launchTeamBuilder),v=$(W=>W.saveTeamTemplate),O=$(W=>W.fetchTeamTemplates),b=$(W=>W.fetchProviders),[C,j]=g.useState([]),[N,M]=g.useState(""),[Q,L]=g.useState(null),[B,S]=g.useState(!1),[I,z]=g.useState(null),[P,F]=g.useState(!1),[K,G]=g.useState("");if(g.useEffect(()=>{t&&(b().then(W=>{Array.isArray(W)&&j(W.filter(ae=>ae.installed))}).catch(()=>{}),O())},[t]),!t)return null;const H=N?AP.filter(W=>W.label.toLowerCase().includes(N.toLowerCase())||W.desc.toLowerCase().includes(N.toLowerCase())):AP,q=C.find(W=>W.id===n.provider),_=((q==null?void 0:q.models)||[]).filter(W=>W.type!=="image"&&!W.disabled);function R(W){var ve;x({provider:W});const ae=C.find(ce=>ce.id===W),Oe=((ae==null?void 0:ae.models)||[]).filter(ce=>ce.type!=="image"&&!ce.disabled);x({provider:W,model:((ve=Oe[0])==null?void 0:ve.id)||""})}function U(W){f(W),z(W.name)}async function Z(){S(!0);try{await y()}catch{}S(!1)}function J(){const W=K.trim();W&&(v(W),F(!1),G(""))}const Ae=[...PRe,...(o.custom||[]).map(W=>{var ae;return{...W,icon:Dn,desc:`${((ae=W.roles)==null?void 0:ae.length)||0} agents`,custom:!0}})];return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:[e.jsxs("div",{className:"w-full max-w-5xl max-h-[90vh] bg-surface-1 border border-border rounded-xl shadow-2xl flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border-subtle",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-info/15 flex items-center justify-center",children:e.jsx(Fa,{size:16,className:"text-info"})}),e.jsx("h2",{className:"text-lg font-bold text-text-0 font-sans",children:"Team Builder"})]}),e.jsx("button",{onClick:c,className:"p-2 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-3 transition-colors cursor-pointer",children:e.jsx(Ge,{size:18})})]}),e.jsx("div",{className:"px-6 py-3 border-b border-border-subtle",children:e.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-1",style:{scrollbarWidth:"none"},children:[Ae.map(W=>{const ae=W.icon||Dn,Oe=I===W.name;return e.jsxs("button",{onClick:()=>U(W),className:V("flex flex-col items-center gap-1.5 px-4 py-2.5 rounded-lg border text-center transition-all cursor-pointer flex-shrink-0 min-w-[100px]",Oe?"border-accent bg-accent/5":"border-border-subtle bg-surface-3 hover:border-accent/30 hover:bg-surface-4"),children:[e.jsx(ae,{size:16,className:Oe?"text-accent":"text-text-2"}),e.jsx("span",{className:"text-2xs font-semibold text-text-0 font-sans",children:W.name}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:W.desc})]},W.name)}),e.jsx(Nt,{content:"Save current roster as template",children:e.jsxs("button",{onClick:()=>{F(!0),G("")},disabled:a.length===0,className:"flex flex-col items-center gap-1.5 px-4 py-2.5 rounded-lg border border-dashed border-border-subtle bg-surface-2 hover:border-accent/30 transition-all cursor-pointer flex-shrink-0 min-w-[100px] disabled:opacity-30 disabled:cursor-not-allowed",children:[e.jsx(Xr,{size:16,className:"text-text-3"}),e.jsx("span",{className:"text-2xs font-semibold text-text-2 font-sans",children:"Save"}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Template"})]})})]})}),e.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"w-[40%] border-r border-border-subtle flex flex-col",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border-subtle",children:e.jsxs("div",{className:"relative",children:[e.jsx(oa,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{type:"text",value:N,onChange:W=>M(W.target.value),placeholder:"Filter roles...",className:"w-full h-8 pl-8 pr-3 text-xs bg-surface-3 border border-border-subtle rounded-md text-text-0 placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent font-sans"})]})}),e.jsx(it,{className:"flex-1",children:e.jsx("div",{className:"p-3 grid grid-cols-2 gap-2",children:H.map(W=>{const ae=MX[W.id]||Zt;return e.jsxs("button",{onClick:()=>l(W.id),className:"flex items-start gap-2.5 p-2.5 rounded-lg border border-border-subtle bg-surface-2 hover:border-accent/30 hover:bg-surface-3 transition-all cursor-pointer text-left group",children:[e.jsx("div",{className:"w-7 h-7 rounded-md bg-surface-4 flex items-center justify-center flex-shrink-0 group-hover:bg-accent/15 transition-colors",children:e.jsx(ae,{size:14,className:"text-text-2 group-hover:text-accent transition-colors"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:W.label}),e.jsx(ht,{size:12,className:"text-text-4 group-hover:text-accent transition-colors flex-shrink-0"})]}),e.jsx("p",{className:"text-2xs text-text-3 font-sans leading-tight mt-0.5",children:W.desc})]})]},W.id)})})})]}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border-subtle flex items-center justify-between",children:e.jsxs("span",{className:"text-xs font-semibold text-text-1 font-sans uppercase tracking-wider",children:["Your Team (",a.length,")"]})}),e.jsx(it,{className:"flex-1",children:e.jsx("div",{className:"p-3 space-y-1.5",children:a.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx(Fa,{size:32,className:"text-text-4 mb-3"}),e.jsx("p",{className:"text-sm text-text-2 font-sans",children:"Add roles from the left or pick a template above"})]}):a.map((W,ae)=>{var je;const Oe=MX[W.role]||Zt,ve=Q===ae,ce=W.provider?C.find(ee=>ee.id===W.provider):null,he=((ce==null?void 0:ce.models)||[]).filter(ee=>ee.type!=="image"&&!ee.disabled);return e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-2 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[e.jsx(y0,{size:12,className:"text-text-4 flex-shrink-0 cursor-grab"}),e.jsx("div",{className:"w-6 h-6 rounded-md bg-surface-4 flex items-center justify-center flex-shrink-0",children:e.jsx(Oe,{size:12,className:"text-text-1"})}),e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans flex-1",children:((je=AP.find(ee=>ee.id===W.role))==null?void 0:je.label)||W.role}),e.jsx("button",{onClick:()=>L(ve?null:ae),className:"p-1 rounded text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(bt,{size:12,className:V("transition-transform duration-200",ve&&"rotate-180")})}),e.jsx("button",{onClick:()=>{A(ae),Q===ae?L(null):Q>ae&&L(Q-1)},className:"p-1 rounded text-text-4 hover:text-danger cursor-pointer",children:e.jsx(Ge,{size:12})})]}),ve&&e.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-3 border-t border-border-subtle bg-surface-1",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Name Override"}),e.jsx("input",{type:"text",value:W.name,onChange:ee=>u(ae,{name:KJ(ee.target.value)}),placeholder:W.role,className:"w-full h-7 px-2.5 text-xs bg-surface-3 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",maxLength:64,spellCheck:!1})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Provider"}),e.jsxs(Ur,{value:W.provider||"__default__",onValueChange:ee=>{var ze;const ke=ee==="__default__"?null:ee,ye=C.find(He=>He.id===ke),Ne=((ye==null?void 0:ye.models)||[]).filter(He=>He.type!=="image"&&!He.disabled);u(ae,{provider:ke,model:((ze=Ne[0])==null?void 0:ze.id)||null})},children:[e.jsx(Pr,{placeholder:"Team Default",className:"bg-surface-3 h-7 text-xs"}),e.jsxs(Er,{children:[e.jsx(Da,{value:"__default__",children:"Team Default"}),C.map(ee=>e.jsx(Da,{value:ee.id,children:ee.displayName||ee.name||ee.id},ee.id))]})]})]}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Model"}),e.jsxs(Ur,{value:W.model||"__default__",onValueChange:ee=>u(ae,{model:ee==="__default__"?null:ee}),children:[e.jsx(Pr,{placeholder:"Default",className:"bg-surface-3 h-7 text-xs"}),e.jsxs(Er,{children:[e.jsx(Da,{value:"__default__",children:"Default"}),he.map(ee=>e.jsx(Da,{value:ee.id,children:ee.name||ee.id},ee.id))]})]})]})]}),e.jsx(ri,{label:"Reasoning",value:W.reasoningEffort??n.reasoningEffort,onChange:ee=>u(ae,{reasoningEffort:ee}),min:0,max:100,step:1}),Iz.has(W.provider||n.provider)&&e.jsx(ri,{label:"Temperature",value:W.temperature??n.temperature,onChange:ee=>u(ae,{temperature:ee}),min:0,max:1,step:.01,formatValue:ee=>ee.toFixed(2)})]})]},ae)})})})]})]}),e.jsx("div",{className:"border-t border-border-subtle px-6 py-4",children:e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("textarea",{value:s,onChange:W=>m(W.target.value),placeholder:"Describe what you want to build... (optional)",rows:3,className:"w-full px-3 py-2 text-sm bg-surface-3 border border-border-subtle rounded-md text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent resize-none"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans italic",children:"Leave empty to spawn agents awaiting instructions"})]}),e.jsxs("div",{className:"w-64 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 space-y-0.5",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Provider"}),e.jsxs(Ur,{value:n.provider||"__default__",onValueChange:W=>R(W==="__default__"?"":W),children:[e.jsx(Pr,{placeholder:"Default",className:"bg-surface-3 h-7 text-xs"}),e.jsxs(Er,{children:[e.jsx(Da,{value:"__default__",children:"Default"}),C.map(W=>e.jsx(Da,{value:W.id,children:W.displayName||W.name||W.id},W.id))]})]})]}),e.jsxs("div",{className:"flex-1 space-y-0.5",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Model"}),e.jsxs(Ur,{value:n.model||"__default__",onValueChange:W=>x({model:W==="__default__"?"":W}),children:[e.jsx(Pr,{placeholder:"Auto",className:"bg-surface-3 h-7 text-xs"}),e.jsxs(Er,{children:[e.jsx(Da,{value:"__default__",children:"Auto"}),_.map(W=>e.jsx(Da,{value:W.id,children:W.name||W.id},W.id))]})]})]})]}),e.jsxs(fe,{variant:"primary",size:"md",onClick:Z,disabled:B||a.length===0,className:"w-full gap-2 mt-1",children:[e.jsx(wt,{size:14}),B?"Launching...":`Plan & Launch (${a.length})`]})]})]})})]}),P&&e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/40",children:e.jsxs("div",{className:"w-full max-w-sm bg-surface-2 border border-border rounded-lg shadow-2xl p-5 space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans",children:"Save as Template"}),e.jsx("input",{type:"text",value:K,onChange:W=>G(W.target.value),placeholder:"Template name...",className:"w-full h-8 px-3 text-sm bg-surface-3 border border-border-subtle rounded-md text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0,onKeyDown:W=>{W.key==="Enter"&&J(),W.key==="Escape"&&F(!1)}}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>F(!1),children:"Cancel"}),e.jsx(fe,{variant:"primary",size:"sm",onClick:J,disabled:!K.trim(),children:"Save"})]})]})})]})}function zRe({onPlanner:t,onSpawn:a,onTeamBuilder:n}){var s;return e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsxs("div",{className:"max-w-2xl w-full text-center space-y-10 px-8",children:[e.jsxs("div",{className:"relative mx-auto w-20 h-20",children:[e.jsx("div",{className:"absolute inset-0 rounded-full bg-accent/8 animate-pulse"}),e.jsx("div",{className:"absolute inset-1 rounded-full bg-surface-3 border border-border-subtle flex items-center justify-center shadow-lg shadow-accent/5",children:e.jsx("img",{src:"/favicon.png",alt:"Groove",className:"h-10 w-10 rounded-full"})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-3xl font-bold text-text-0 font-sans tracking-tight",children:"Welcome to Groove"}),e.jsx("p",{className:"text-base text-text-2 font-sans max-w-md mx-auto leading-relaxed",children:"Your mission control for AI agents. Spawn, orchestrate, and ship faster than ever."})]}),e.jsxs("div",{className:"space-y-3 max-w-xl mx-auto",children:[e.jsxs("button",{onClick:t,className:"w-full flex items-center gap-4 p-5 rounded-lg border border-accent/25 bg-gradient-to-r from-accent/8 to-accent/3 hover:from-accent/14 hover:to-accent/6 hover:border-accent/40 transition-all cursor-pointer group text-left",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg bg-accent/20 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:e.jsx(wt,{size:24,className:"text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-base font-semibold text-text-0 font-sans",children:"Start with a Planner"}),e.jsx("div",{className:"text-sm text-text-2 font-sans mt-0.5",children:"Describe what you want to build and let AI plan the perfect team"})]}),e.jsx("div",{className:"text-accent text-xs font-semibold font-sans flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity",children:"Recommended"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("button",{onClick:n,className:"flex items-center gap-3 p-4 rounded-lg border border-info/25 bg-gradient-to-r from-info/6 to-info/2 hover:from-info/12 hover:to-info/5 hover:border-info/35 transition-all cursor-pointer group text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-info/15 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:e.jsx(bu,{size:20,className:"text-info"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-semibold text-text-0 font-sans",children:"Build a Team"}),e.jsx("div",{className:"text-xs text-text-3 font-sans mt-0.5",children:"Pick roles and configure"})]})]}),e.jsxs("button",{onClick:a,className:"flex items-center gap-3 p-4 rounded-lg border border-border bg-surface-1 hover:bg-surface-2 hover:border-border transition-all cursor-pointer group text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-surface-4 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:e.jsx(ht,{size:20,className:"text-text-1"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-semibold text-text-0 font-sans",children:"Spawn Agent"}),e.jsx("div",{className:"text-xs text-text-3 font-sans mt-0.5",children:"Choose a role and configure"})]})]})]})]}),((s=window.groove)==null?void 0:s.openFolder)&&e.jsxs("div",{className:"max-w-sm mx-auto",children:[e.jsx("p",{className:"text-xs text-text-3 mb-2",children:"Or open a different project"}),e.jsxs("button",{onClick:()=>window.groove.openFolder(),className:"w-full h-10 rounded-lg border border-border-subtle bg-surface-2 hover:bg-surface-3 text-sm text-text-1 font-medium flex items-center justify-center gap-2 cursor-pointer transition-colors",children:[e.jsx(ga,{size:16,className:"text-accent"}),"Open Folder"]})]}),e.jsxs("p",{className:"text-xs text-text-4 font-sans",children:[e.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+K"}),e.jsx("span",{className:"mx-1.5",children:"command palette"}),e.jsx("span",{className:"text-text-4 mx-1",children:"·"}),e.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+N"}),e.jsx("span",{className:"mx-1.5",children:"spawn"}),e.jsx("span",{className:"text-text-4 mx-1",children:"·"}),e.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+J"}),e.jsx("span",{className:"mx-1.5",children:"terminal"})]})]})})}const FRe={backend:aa,frontend:Dr,fullstack:Zt,testing:ti,security:La},RRe=/^[a-zA-Z0-9_-]{1,64}$/;function KJ(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").slice(0,64)}function HRe(){var R;const t=$(U=>U.recommendedTeam),a=$(U=>U.launchRecommendedTeam),n=$(U=>U.teamLaunchConfig),s=$(U=>U.fetchProviders),[o,c]=g.useState(!1),[l,A]=g.useState(null),[u,f]=g.useState(!1),[x,m]=g.useState([]),[y,v]=g.useState((n==null?void 0:n.provider)||""),[O,b]=g.useState((n==null?void 0:n.model)||""),[C,j]=g.useState((n==null?void 0:n.reasoningEffort)??50),[N,M]=g.useState((n==null?void 0:n.temperature)??.5),[Q,L]=g.useState((n==null?void 0:n.mode)||"sandbox");if(g.useEffect(()=>{s().then(U=>{Array.isArray(U)&&m(U.filter(Z=>Z.installed))}).catch(()=>{})},[]),!((R=t==null?void 0:t.agents)!=null&&R.length))return null;const B=t.agents,S=B.filter(U=>!U.phase||U.phase===1),I=B.filter(U=>U.phase===2),z=l??S.map(U=>({...U,name:U.name||""})),P=x.find(U=>U.id===y),F=((P==null?void 0:P.models)||[]).filter(U=>U.type!=="image"&&!U.disabled),K=Iz.has(y);function G(U,Z){const J=z.map((Ae,W)=>W===U?{...Ae,name:KJ(Z)}:Ae);A(J)}function H(U){var Ae;v(U);const Z=x.find(W=>W.id===U),J=((Z==null?void 0:Z.models)||[]).filter(W=>W.type!=="image"&&!W.disabled);b(((Ae=J[0])==null?void 0:Ae.id)||"")}async function q(){c(!0),$.setState({teamLaunchConfig:{...y&&{provider:y,model:O},reasoningEffort:C,...K&&{temperature:N},mode:Q}});try{const U=[...z,...I];await a(U)}catch{}c(!1)}function _(){$.setState({recommendedTeam:null})}return e.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-50 w-full max-w-lg",children:e.jsxs("div",{className:"mx-4 rounded-lg border border-accent/30 bg-surface-2/95 backdrop-blur-md shadow-xl shadow-accent/5 overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border-subtle flex items-center gap-2",children:[e.jsx(es,{size:16,className:"text-accent"}),e.jsx("span",{className:"text-sm font-semibold text-text-0 font-sans flex-1",children:"Planner Recommends a Team"}),e.jsx("button",{onClick:_,className:"text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(Ge,{size:14})})]}),e.jsxs("div",{className:"border-b border-border-subtle",children:[e.jsxs("button",{onClick:()=>f(!u),className:"w-full flex items-center gap-2 px-4 py-2 text-left cursor-pointer hover:bg-surface-3/50 transition-colors",children:[e.jsx(bt,{size:12,className:V("text-text-4 transition-transform duration-200",!u&&"-rotate-90")}),e.jsx(T0,{size:12,className:"text-text-3"}),e.jsx("span",{className:"text-2xs font-semibold text-text-2 font-sans uppercase tracking-wider",children:"Team Settings"}),y&&e.jsxs("span",{className:"ml-auto text-2xs text-accent font-mono",children:[y,O?` / ${O}`:""]})]}),u&&e.jsxs("div",{className:"px-4 pb-3 space-y-3",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Provider"}),e.jsxs(Ur,{value:y,onValueChange:H,children:[e.jsx(Pr,{placeholder:"Default",className:"bg-surface-4 h-7 text-xs"}),e.jsx(Er,{children:x.map(U=>e.jsx(Da,{value:U.id,children:U.displayName||U.name||U.id},U.id))})]})]}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Model"}),e.jsxs(Ur,{value:O,onValueChange:b,children:[e.jsx(Pr,{placeholder:"Auto",className:"bg-surface-4 h-7 text-xs"}),e.jsxs(Er,{children:[e.jsx(Da,{value:"auto",children:"Auto"}),F.map(U=>e.jsx(Da,{value:U.id,children:U.name||U.id},U.id))]})]})]})]}),e.jsx(ri,{label:"Reasoning",value:C,onChange:j,min:0,max:100,step:1}),K&&e.jsx(ri,{label:"Temperature",value:N,onChange:M,min:0,max:1,step:.01,formatValue:U=>U.toFixed(2)}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Build Mode"}),e.jsxs("div",{className:"flex rounded-md bg-surface-4 border border-border-subtle p-0.5",children:[e.jsxs("button",{onClick:()=>L("sandbox"),className:V("flex-1 flex items-center justify-center gap-1.5 rounded px-2 py-1.5 text-xs font-sans transition-all cursor-pointer",Q==="sandbox"?"bg-surface-2 text-text-0 font-semibold shadow-sm":"text-text-3 hover:text-text-1"),children:[e.jsx(on,{size:11}),"Sandbox"]}),e.jsxs("button",{onClick:()=>L("production"),className:V("flex-1 flex items-center justify-center gap-1.5 rounded px-2 py-1.5 text-xs font-sans transition-all cursor-pointer",Q==="production"?"bg-surface-2 text-text-0 font-semibold shadow-sm":"text-text-3 hover:text-text-1"),children:[e.jsx(Kn,{size:11}),"Production"]})]}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:Q==="sandbox"?"Files live in a team directory, removable with the team":"Files live in the project directory, persist forever"})]})]})]}),e.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[z.map((U,Z)=>{var W;const J=FRe[U.role]||Zt,Ae=!U.name||RRe.test(U.name);return e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 rounded-md bg-surface-4 border border-border-subtle",children:[e.jsx(J,{size:12,className:"text-text-2 shrink-0"}),e.jsx("input",{type:"text",value:U.name,onChange:ae=>G(Z,ae.target.value),placeholder:U.role,className:V("flex-1 min-w-0 bg-transparent text-xs font-mono text-text-0 outline-none placeholder:text-text-4",!Ae&&"text-red-400"),maxLength:64,spellCheck:!1}),((W=U.scope)==null?void 0:W.length)>0&&e.jsxs("span",{className:"text-2xs text-text-4 font-mono shrink-0 truncate max-w-[120px]",children:[U.scope[0],U.scope.length>1?` +${U.scope.length-1}`:""]})]},Z)}),t.projectDir&&Q==="sandbox"&&e.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-2 font-mono pt-0.5",children:[e.jsx("span",{className:"text-text-4",children:"Project:"}),e.jsxs("span",{className:"text-accent",children:[t.projectDir,"/"]})]}),I.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-3 font-sans",children:[e.jsx(La,{size:10}),e.jsxs("span",{children:[I.length," QC agent",I.length>1?"s":""," will auto-spawn after builders complete"]})]})]}),e.jsx("div",{className:"px-4 py-3 border-t border-border-subtle",children:e.jsxs(fe,{variant:"primary",size:"md",onClick:q,disabled:o,className:"w-full gap-2",children:[e.jsx(wt,{size:14}),o?"Launching...":`Launch ${S.length} Agent${S.length>1?"s":""}`]})})]})})}function uP(){var z;const t=$(P=>P.agents),a=$(P=>P.activeTeamId),n=$(P=>P.openDetail),s=$(P=>P.spawnAgent),o=$(P=>P.selectAgent);$(P=>P.recommendedTeam);const c=$(P=>P.checkRecommendedTeam),l=$(P=>P.addToast),A=$(P=>P.showPreviewInAgents),u=$(P=>P.previewState),f=$(P=>P.togglePreviewInAgents),x=$(P=>P.teamPreviews),m=$(P=>P.relaunchPreview),y=$(P=>P.openPreview),v=$(P=>P.workspaceMode),O=$(P=>P.setWorkspaceMode),b=$(P=>P.openTeamBuilder),[C,j]=g.useState(!1);g.useEffect(()=>{if(!t.some(K=>K.role==="planner"&&(K.status==="running"||K.status==="starting")))return;const F=setInterval(()=>c(),5e3);return()=>clearInterval(F)},[t,c]);function N(){j(!0)}async function M(P){j(!1);try{const F=await s({role:"planner",provider:P.provider,model:P.model,reasoningEffort:P.reasoningEffort,temperature:P.temperature,verbosity:P.verbosity});F!=null&&F.id&&o(F.id)}catch{}}const Q=t.filter(P=>P.teamId===a),L=$(P=>P.hydrated),[B,S]=g.useState(!0);g.useEffect(()=>{const P=setTimeout(()=>S(!1),1200);return()=>clearTimeout(P)},[]);const I=B||!L;return e.jsxs("div",{className:"flex flex-col h-full relative",children:[e.jsx("div",{className:"flex-1 min-h-0",children:I?e.jsxs("div",{className:V("flex flex-col items-center justify-center h-full transition-opacity duration-500",!B&&L?"opacity-0":"opacity-100"),children:[e.jsxs("div",{className:"relative w-12 h-12 mb-5",children:[e.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-accent/20 animate-ping",style:{animationDuration:"2s"}}),e.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-accent animate-spin",style:{animationDuration:"1s"}}),e.jsx("span",{className:"absolute inset-[6px] rounded-full bg-accent/8 flex items-center justify-center",children:e.jsx(wt,{size:16,className:"text-accent animate-pulse"})})]}),e.jsx("p",{className:"text-sm font-medium text-text-1 font-sans animate-pulse",children:"Connecting to agents"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Syncing with daemon..."})]}):Q.length===0?e.jsx(zRe,{onPlanner:N,onSpawn:()=>n({type:"spawn"}),onTeamBuilder:b}):v?e.jsx(yze,{}):A&&u.url&&u.teamId===a&&((z=x[a])!=null&&z.active)?e.jsx(KW,{embedded:!0}):e.jsx(Dae,{children:e.jsx($Re,{})},a)}),!v&&e.jsx(HRe,{}),!I&&Q.length>0&&!v&&e.jsxs("div",{className:"absolute bottom-3 left-3 z-40 flex items-center gap-1",children:[e.jsx(Nt,{content:"Spawn agent",side:"top",children:e.jsx("button",{onClick:()=>n({type:"spawn"}),className:"flex items-center justify-center w-7 h-7 rounded-md text-text-3 hover:text-accent hover:bg-accent/10 transition-colors cursor-pointer",children:e.jsx(ht,{size:15})})}),e.jsx(Nt,{content:Object.keys(GJ()).length>0?"Update layout":"Save layout",side:"top",children:e.jsx("button",{onClick:()=>{const P=r0(a),F={},K=new Map;[...Q].sort((G,H)=>(G.name||G.id).localeCompare(H.name||H.id)).forEach(G=>{const H=G.name||G.id,q=P[H];if(!q)return;const _=G.role||"agent",R=K.get(_)||0;K.set(_,R+1);const U=R===0?_:`${_}-${R}`;F[U]=q}),P[Ua]&&(F[Ua]=P[Ua]),BRe(F),l("success","Layout saved","Future spawns will use these positions")},className:"flex items-center justify-center w-7 h-7 rounded-md text-text-3 hover:text-accent hover:bg-accent/10 transition-colors cursor-pointer",children:e.jsx(O0,{size:15})})}),e.jsx(Nt,{content:"Workspace",side:"top",children:e.jsx("button",{onClick:()=>O(!0),className:"flex items-center justify-center w-7 h-7 rounded-md text-text-3 hover:text-accent hover:bg-accent/10 transition-colors cursor-pointer",children:e.jsx(Zt,{size:15})})}),(()=>{const P=x[a];if(!P)return null;const F=P.active&&u.url&&u.teamId===a,K=F&&A,G=K?"Show team":F?"Show preview":"Relaunch preview";return e.jsx(Nt,{content:G,side:"top",children:e.jsx("button",{onClick:()=>{F?A?f():y(P.url,a,P.kind):m(a)},className:V("flex items-center justify-center w-7 h-7 rounded-md transition-colors cursor-pointer",F?"text-text-3 hover:text-info hover:bg-info/10":"text-text-4 hover:text-warning hover:bg-warning/10"),children:K?e.jsx(Fa,{size:15}):e.jsx(na,{size:15})})})})()]}),e.jsx(URe,{open:C,onOpenChange:j,onLaunch:M}),e.jsx(ERe,{})]})}function qRe({children:t,detailContent:a,terminalContent:n}){const s=$(B=>B.activeView),o=$(B=>B.detailPanel),c=$(B=>B.connected),l=$(B=>B.tunneled),A=$(B=>B.daemonHost),u=$(B=>B.agents),f=$(B=>B.editorActiveFile),x=$(B=>B.detailPanelWidth),m=$(B=>B.terminalVisible),y=$(B=>B.terminalFullHeight),v=$(B=>B.setActiveView),O=$(B=>B.openDetail),b=$(B=>B.closeDetail),C=$(B=>B.setDetailPanelWidth),j=$(B=>B.setTerminalVisible),N=$(B=>B.toggleCommandPalette),M=g.useMemo(()=>u.filter(B=>B.status==="running").length,[u]),Q=g.useMemo(()=>[{key:"k",meta:!0,handler:()=>$.getState().toggleCommandPalette()},{key:"p",meta:!0,shift:!0,handler:()=>$.getState().toggleCommandPalette()},{key:"j",meta:!0,handler:()=>{const B=$.getState();B.setTerminalVisible(!B.terminalVisible)}},{key:"n",meta:!0,handler:()=>$.getState().openDetail({type:"spawn"})},{key:"1",meta:!0,handler:()=>$.getState().setActiveView("agents")},{key:"2",meta:!0,handler:()=>$.getState().setActiveView("editor")},{key:"3",meta:!0,handler:()=>$.getState().setActiveView("dashboard")},{key:"4",meta:!0,handler:()=>$.getState().setActiveView("marketplace")},{key:"5",meta:!0,handler:()=>$.getState().setActiveView("teams")},{key:"Escape",handler:()=>{const B=$.getState();B.commandPaletteOpen?B.toggleCommandPalette():B.detailPanel&&B.closeDetail()}}],[]);lZ(Q);const L=o&&o.type!=="spawn";return e.jsx(joe,{children:e.jsxs("div",{className:V("w-full h-full flex flex-col bg-surface-2 text-text-1 font-sans",d2()&&"electron-app"),children:[e.jsx(pSe,{activeView:s,connected:c,tunneled:l,daemonHost:A,editorActiveFile:f,onOpenCommandPalette:N}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsx(dSe,{activeView:s,detailPanel:o,onNavigate:v,onTogglePanel:B=>{(o==null?void 0:o.type)===B?b():O({type:B})}}),e.jsxs("div",{className:"flex-1 flex flex-col min-w-0 min-h-0",children:[s==="agents"&&e.jsx(TRe,{}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-w-0 min-h-0",children:[!(m&&y)&&e.jsx("main",{className:"flex-1 min-h-0 overflow-hidden relative",children:t}),n]}),L&&e.jsx(wQe,{width:x,onWidthChange:C,onClose:b,children:a})]})]})]}),e.jsx(bQe,{connected:c,agentCount:u.length,runningCount:M,terminalVisible:m,onToggleTerminal:()=>j(!m)}),e.jsx(CQe,{}),e.jsx(DG,{}),e.jsx(NQe,{}),e.jsx(hG,{})]})})}function DRe({id:t,name:a,subtitle:n,models:s,authType:o,recommended:c,installed:l,installing:A,failed:u,selected:f,onInstall:x,gradientFrom:m,letter:y,statusChecking:v}){return e.jsxs(as.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25},className:V("relative flex flex-col rounded-md border p-6 transition-all duration-200","bg-surface-2 hover:bg-surface-3 hover:shadow-lg hover:shadow-black/20",f?"border-accent ring-1 ring-accent/30 shadow-md shadow-accent/10":"border-border-subtle",A&&"pointer-events-none opacity-70"),children:[f&&e.jsx("div",{className:"absolute top-3 left-3 w-5 h-5 rounded-full bg-accent flex items-center justify-center",children:e.jsx(De,{className:"w-3 h-3 text-surface-0",strokeWidth:3})}),e.jsxs("div",{className:"flex items-start gap-4 mb-5",children:[e.jsx("div",{className:V("w-14 h-14 rounded-md flex items-center justify-center text-lg font-bold font-mono shrink-0",m),children:y}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-sm font-semibold text-text-0",children:a}),c&&e.jsx(be,{variant:"purple",className:"text-2xs",children:"Recommended"})]}),e.jsx("p",{className:"text-xs text-text-2 mt-0.5",children:n})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-4",children:s.map(O=>e.jsx("span",{className:"text-xs text-text-2 bg-surface-4 px-2 py-0.5 rounded font-mono",children:O},O))}),e.jsx("p",{className:"text-2xs text-text-3 mb-4",children:o}),e.jsx("div",{className:"mt-auto pt-4 border-t border-border-subtle",children:A?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{className:"w-4 h-4 text-accent animate-spin"}),e.jsx("span",{className:"text-xs text-accent font-medium",children:"Installing..."})]}),e.jsx("div",{className:"h-1 bg-surface-4 rounded-full overflow-hidden",children:e.jsx(as.div,{className:"h-full bg-accent rounded-full",initial:{width:"0%"},animate:{width:"90%"},transition:{duration:15,ease:"easeOut"}})})]}):l?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Hn,{className:"w-4 h-4 text-success"}),e.jsx("span",{className:"text-xs text-success font-medium",children:"Ready"})]}):u?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xt,{className:"w-4 h-4 text-danger"}),e.jsx("span",{className:"text-xs text-danger font-medium",children:"Failed"})]}),e.jsxs("button",{type:"button",className:"h-8 px-5 rounded-full text-xs font-medium bg-danger/15 text-danger hover:bg-danger/25 transition-colors duration-100 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-danger flex items-center gap-1.5",onClick:O=>{O.stopPropagation(),x==null||x(t)},children:[e.jsx(Cs,{className:"w-3 h-3"}),"Retry"]})]}):v?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{className:"w-3.5 h-3.5 text-text-4 animate-spin"}),e.jsx("span",{className:"text-xs text-text-4",children:"Checking..."})]}):e.jsx("div",{className:"flex items-center justify-end",children:e.jsxs("button",{type:"button",className:"h-8 px-5 rounded-full text-xs font-medium bg-accent text-surface-0 hover:bg-accent/80 transition-colors duration-100 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent flex items-center gap-1.5",onClick:O=>{O.stopPropagation(),x==null||x(t)},children:[e.jsx(_a,{className:"w-3.5 h-3.5"}),"Install"]})})})]})}const gs=[{id:"claude-code",name:"Claude Code",subtitle:"by Anthropic",models:["Opus 4.6","Sonnet 4.6","Haiku 4.5"],authType:"Subscription or API key",authModes:["subscription","apikey"],recommended:!0,letter:"C",gradientFrom:"bg-purple/20 text-purple",keyPlaceholder:"sk-ant-...",keyLabel:"Anthropic API Key"},{id:"codex",name:"Codex",subtitle:"by OpenAI",models:["GPT-5.4 Pro","Standard","Mini","Nano"],authType:"API key or ChatGPT Plus",authModes:["apikey","chatgpt-plus"],recommended:!1,letter:"X",gradientFrom:"bg-success/20 text-success",keyPlaceholder:"sk-...",keyLabel:"OpenAI API Key"},{id:"gemini",name:"Gemini CLI",subtitle:"by Google",models:["Gemini 3.1 Pro","3 Flash"],authType:"API key",authModes:["apikey"],recommended:!1,letter:"G",gradientFrom:"bg-info/20 text-info",keyPlaceholder:"AIza...",keyLabel:"Gemini API Key"}],VRe={enter:t=>({x:t>0?80:-80,opacity:0}),center:{x:0,opacity:1},exit:t=>({x:t<0?80:-80,opacity:0})},XRe={duration:.25,ease:[.4,0,.2,1]};function ZRe({current:t,total:a}){return e.jsx("div",{className:"flex items-center gap-2.5",children:Array.from({length:a},(n,s)=>e.jsx("div",{className:V("h-2 rounded-full transition-all duration-300",s===t?"w-7 bg-accent":s<t?"w-2 bg-accent/50":"w-2 bg-surface-5")},s))})}function GRe({onNext:t,onSkip:a}){return e.jsxs("div",{className:"flex flex-col items-center justify-center text-center gap-6 max-w-lg mx-auto",children:[e.jsx(as.img,{src:"/favicon.png",alt:"Groove",className:"w-20 h-20",initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.4,ease:"easeOut"}}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold text-text-0 font-sans",children:"Welcome to Groove"}),e.jsx("p",{className:"text-sm text-text-2",children:"Your AI coding team, ready in minutes"})]}),e.jsx("p",{className:"text-xs text-text-3 leading-relaxed max-w-sm",children:"Let's set up your AI providers so you can start spawning agents. This only takes a moment."}),e.jsxs("button",{type:"button",onClick:t,className:"mt-4 h-11 px-8 rounded-full bg-accent text-surface-0 font-semibold text-sm hover:bg-accent/80 transition-colors duration-100 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 flex items-center gap-2",autoFocus:!0,children:["Get Started",e.jsx(Fr,{className:"w-4 h-4"})]}),e.jsx("button",{type:"button",onClick:a,className:"text-xs text-text-4 hover:text-text-2 transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent rounded px-2 py-1",children:"Skip setup"})]})}function WRe({selectedDir:t,onSelectDir:a}){const n=$(A=>A.remoteHomedir),[s,o]=g.useState(!1),c=new URLSearchParams(window.location.search).has("instance");async function l(){var u,f;if(c){o(!0);return}const A=await Nne({title:"Choose your project folder",defaultPath:t||void 0});A?a(A):(f=(u=window.groove)==null?void 0:u.folders)!=null&&f.select||o(!0)}return e.jsxs("div",{className:"flex flex-col items-center max-w-lg mx-auto w-full text-center",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-text-0 mb-2",children:"Choose your project folder"}),e.jsx("p",{className:"text-sm text-text-2",children:"Pick the root directory where your code lives. Groove will manage agents from here."})]}),e.jsx("div",{className:"w-full bg-surface-2 border border-border-subtle rounded-lg p-5 mb-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg bg-accent/10 flex items-center justify-center",children:e.jsx(ga,{className:"w-6 h-6 text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsx("p",{className:"text-xs text-text-3 mb-0.5",children:"Working directory"}),e.jsx("p",{className:"text-sm font-mono text-text-0 truncate",children:t||"No folder selected"})]})]})}),e.jsxs("button",{type:"button",onClick:l,className:"h-10 px-6 rounded-lg bg-accent text-surface-0 font-medium text-sm hover:bg-accent/80 transition-colors cursor-pointer flex items-center gap-2",children:[e.jsx(ga,{className:"w-4 h-4"}),t?"Change Folder":"Select Folder"]}),e.jsx("p",{className:"mt-4 text-2xs text-text-4",children:"You can change this anytime in Settings."}),s&&e.jsx(Hu,{open:s,onOpenChange:o,currentPath:t||n||"/",homePath:n,onSelect:A=>{a(A),o(!1)}})]})}function KRe({providerStatus:t,selected:a,onInstall:n,installing:s,statusChecking:o}){const c=gs.filter(A=>{var u;return(u=t[A.id])==null?void 0:u.installed}).length,l=c===gs.length;return e.jsxs("div",{className:"flex flex-col items-center max-w-4xl mx-auto w-full",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h2",{className:"text-2xl font-bold text-text-0 mb-2",children:"Choose your AI providers"}),e.jsx("p",{className:"text-sm text-text-2",children:"Install the coding tools you want to use. You can always add more later."})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-5 w-full mb-8",children:gs.map(A=>{var u,f;return e.jsx(DRe,{...A,installed:(u=t[A.id])==null?void 0:u.installed,installing:s[A.id],failed:(f=t[A.id])==null?void 0:f.failed,selected:a.includes(A.id),onInstall:n,statusChecking:o},A.id)})}),e.jsx("p",{className:V("text-xs text-center",l?"text-success":c>0?"text-text-2":"text-text-4"),children:l?"All providers installed — you're ready to go!":c>0?`${c} of ${gs.length} providers installed`:"Click Install to set up a provider"})]})}function YRe({provider:t,providerStatus:a,onSaveKey:n}){const[s,o]=g.useState(t.authModes.includes("subscription")?"subscription":"apikey"),[c,l]=g.useState(""),[A,u]=g.useState(!1),[f,x]=g.useState(!1),[m,y]=g.useState((a==null?void 0:a.authenticated)||!1),v=async()=>{if(c.trim()){x(!0);try{await n(t.id,c.trim()),y(!0)}catch{}finally{x(!1)}}},O=(a==null?void 0:a.maskedKey)||(m&&c?`${c.slice(0,6)}${"•".repeat(20)}`:null);return e.jsxs(as.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2},className:"bg-surface-2 border border-border-subtle rounded-md p-5",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:V("w-10 h-10 rounded-md flex items-center justify-center text-sm font-bold font-mono",t.gradientFrom),children:t.letter}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-text-0",children:t.name}),e.jsx("p",{className:"text-2xs text-text-3",children:t.subtitle})]}),(m||(a==null?void 0:a.authenticated))&&e.jsx(be,{variant:"success",className:"ml-auto",children:"Connected"})]}),t.authModes.length>1&&e.jsx("div",{className:"flex gap-1 mb-4 bg-surface-3 p-0.5 rounded-md",children:t.authModes.map(b=>e.jsx("button",{type:"button",onClick:()=>o(b),className:V("flex-1 h-7 rounded text-xs font-medium transition-colors duration-100 cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",s===b?"bg-surface-5 text-text-0":"text-text-3 hover:text-text-1"),children:b==="subscription"?"Subscription":b==="chatgpt-plus"?"ChatGPT Plus":"API Key"},b))}),s==="subscription"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-text-2",children:"Sign in via the terminal with your Claude subscription."}),e.jsx("div",{className:"space-y-1.5",children:e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Open a terminal and run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"claude"})," — then follow the prompts to sign in."]})}),(a==null?void 0:a.authenticated)&&e.jsxs("p",{className:"text-xs text-success flex items-center gap-1.5",children:[e.jsx(De,{className:"w-3.5 h-3.5"})," Connected"]})]}),s==="chatgpt-plus"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-xs text-text-2",children:["Run ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"codex login"})," in your terminal to authenticate with ChatGPT Plus."]}),(a==null?void 0:a.authenticated)&&e.jsxs("p",{className:"text-xs text-success flex items-center gap-1.5",children:[e.jsx(De,{className:"w-3.5 h-3.5"})," Connected"]})]}),s==="apikey"&&e.jsx("div",{className:"space-y-3",children:m||a!=null&&a.authenticated?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-8 rounded-md bg-surface-1 border border-border px-3 flex items-center",children:e.jsx("span",{className:"text-xs text-text-3 font-mono truncate",children:O||"••••••••••••••"})}),e.jsx("button",{type:"button",onClick:()=>{y(!1),l("")},className:"h-8 px-3 rounded-md text-xs text-text-3 hover:text-text-1 bg-surface-4 hover:bg-surface-5 transition-colors duration-100 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",children:"Change"})]}):e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx("input",{type:A?"text":"password",value:c,onChange:b=>l(b.target.value),placeholder:t.keyPlaceholder,className:"h-8 w-full rounded-md px-3 pr-8 text-sm bg-surface-1 border border-border text-text-0 placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent transition-colors duration-100 font-mono",onKeyDown:b=>b.key==="Enter"&&v(),"aria-label":t.keyLabel}),e.jsx("button",{type:"button",onClick:()=>u(!A),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer","aria-label":A?"Hide key":"Show key",children:A?e.jsx(jn,{className:"w-3.5 h-3.5"}):e.jsx(na,{className:"w-3.5 h-3.5"})})]}),e.jsx("button",{type:"button",onClick:v,disabled:!c.trim()||f,className:"h-8 px-4 rounded-md bg-accent text-surface-0 text-xs font-medium hover:bg-accent/80 transition-colors duration-100 cursor-pointer disabled:opacity-40 disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",children:f?"Saving...":"Save"})]})})]})}function JRe({providerStatus:t,installedIds:a,onSaveKey:n}){const s=gs.filter(o=>{var c;return a.includes(o.id)||((c=t[o.id])==null?void 0:c.installed)});return s.some(o=>{var c;return(c=t[o.id])==null?void 0:c.authenticated}),e.jsxs("div",{className:"flex flex-col items-center max-w-2xl mx-auto w-full",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-text-0 mb-2",children:"Connect your accounts"}),e.jsx("p",{className:"text-sm text-text-2",children:"Add credentials for your installed providers."})]}),e.jsx("div",{className:"flex flex-col gap-4 w-full mb-6",children:s.map(o=>e.jsx(YRe,{provider:o,providerStatus:t[o.id]||{},onSaveKey:n},o.id))}),s.length===0&&e.jsx("p",{className:"text-sm text-text-3 text-center",children:"No providers installed yet. Go back to install one."})]})}function eHe({providerStatus:t,installedIds:a,defaultProvider:n,defaultModel:s,onSetDefault:o}){var l;const c=gs.filter(A=>{var u,f;return(a.includes(A.id)||((u=t[A.id])==null?void 0:u.installed))&&((f=t[A.id])==null?void 0:f.authenticated)});return e.jsxs("div",{className:"flex flex-col items-center max-w-2xl mx-auto w-full",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-text-0 mb-2",children:"Set your default"}),e.jsx("p",{className:"text-sm text-text-2",children:"Choose which provider and model to use by default. You can switch per-agent anytime."})]}),e.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-md mb-6",children:[c.map(A=>e.jsxs("button",{type:"button",onClick:()=>o(A.id,A.models[0]),className:V("flex items-center gap-4 p-4 rounded-md border transition-all duration-200 text-left cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",n===A.id?"bg-accent/8 border-accent ring-1 ring-accent/30":"bg-surface-2 border-border-subtle hover:bg-surface-3"),children:[e.jsx("div",{className:V("w-10 h-10 rounded-md flex items-center justify-center text-sm font-bold font-mono shrink-0",A.gradientFrom),children:A.letter}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-text-0",children:A.name}),e.jsx("p",{className:"text-2xs text-text-3",children:A.subtitle})]}),e.jsx("div",{className:V("w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors",n===A.id?"border-accent bg-accent":"border-border"),children:n===A.id&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-surface-0"})})]},A.id)),c.length===0&&e.jsx("p",{className:"text-sm text-text-3 text-center",children:"No authenticated providers. Go back to connect one."})]}),n&&e.jsxs("div",{className:"w-full max-w-md",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 mb-2 block",children:"Model"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:(l=gs.find(A=>A.id===n))==null?void 0:l.models.map(A=>e.jsx("button",{type:"button",onClick:()=>o(n,A),className:V("h-7 px-3 rounded-full text-xs font-medium transition-colors duration-100 cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",s===A?"bg-accent text-surface-0":"bg-surface-4 text-text-2 hover:bg-surface-5 hover:text-text-0"),children:A},A))})]})]})}function tHe({providerStatus:t,defaultProvider:a,defaultModel:n,onFinish:s}){var l;const o=gs.filter(A=>{var u;return(u=t[A.id])==null?void 0:u.installed}).length,c=(l=gs.find(A=>A.id===a))==null?void 0:l.name;return e.jsxs("div",{className:"flex flex-col items-center justify-center text-center gap-6 max-w-lg mx-auto",children:[e.jsx(as.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:300,damping:20},className:"w-20 h-20 rounded-full bg-success/15 flex items-center justify-center",children:e.jsx(De,{className:"w-10 h-10 text-success",strokeWidth:2.5})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold text-text-0 font-sans",children:"You're all set!"}),e.jsxs("p",{className:"text-sm text-text-2",children:[o," provider",o!==1?"s":""," installed",c?`, default: ${c}`:"",n?` (${n})`:""]})]}),e.jsx(as.div,{className:"flex gap-3 mt-4",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.3},children:e.jsxs("button",{type:"button",onClick:s,className:"h-11 px-8 rounded-full bg-accent text-surface-0 font-semibold text-sm hover:bg-accent/80 transition-colors duration-100 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 flex items-center gap-2",autoFocus:!0,children:[e.jsx(It,{className:"w-4 h-4"}),"Start Building"]})})]})}const Xh=6;function aHe(){const t=$(U=>U.dismissOnboarding),a=$(U=>U.installProvider),n=$(U=>U.setDefaultProvider),s=$(U=>U.addToast),[o,c]=g.useState(0),[l,A]=g.useState(1),[u,f]=g.useState(["claude-code"]),[x,m]=g.useState({}),[y,v]=g.useState({}),[O,b]=g.useState(null),[C,j]=g.useState(null),[N,M]=g.useState(!0),[Q,L]=g.useState(null),B=g.useRef(null);g.useEffect(()=>{let U=!1;async function Z(){var Ae;try{const W=await fetch("/api/onboarding/status").then(ae=>ae.ok?ae.json():null);if(W!=null&&W.providers){const ae={},Oe=[];for(const ve of W.providers){const ce=ve.authStatus==="authenticated"||ve.authStatus==="key-set";ae[ve.id]={installed:ve.installed,authenticated:ce},ve.installed&&Oe.push(ve.id)}return{status:ae,installedIds:Oe,workingDir:((Ae=W.config)==null?void 0:Ae.defaultWorkingDir)||null}}}catch{}try{const W=await fetch("/api/providers").then(ae=>ae.ok?ae.json():null);if(W){const ae={},Oe=[],ve=Array.isArray(W)?W:W.providers||[];for(const ce of ve){const he=ce.installed||ce.authStatus==="authenticated"||ce.authStatus==="key-set"||!1;ae[ce.id]={installed:he,authenticated:ce.authenticated||!1},he&&Oe.push(ce.id)}return{status:ae,installedIds:Oe}}}catch{}return null}async function J(){M(!0);let Ae=await Z();if(!U&&Ae&&Ae.installedIds.length===0)for(let W=0;W<2;W++){if(await new Promise(ae=>setTimeout(ae,2e3)),U)return;if(Ae=await Z(),Ae&&Ae.installedIds.length>0)break}!U&&Ae&&(v(Ae.status),Ae.installedIds.length>0&&f(W=>[...new Set([...W,...Ae.installedIds])]),Ae.workingDir&&!Q&&L(Ae.workingDir)),U||M(!1)}return J(),()=>{U=!0}},[o]);const S=g.useCallback(()=>{o<Xh-1&&(A(1),c(U=>U+1))},[o]),I=g.useCallback(()=>{o>0&&(A(-1),c(U=>U-1))},[o]),z=g.useCallback(()=>{t()},[t]),P=g.useCallback(async()=>{if(Q)try{await L(Q)}catch{s("error","Failed to set project directory")}t()},[t,Q,s]),F=g.useCallback(async U=>{m(Z=>({...Z,[U]:!0}));try{await a(U),v(Z=>({...Z,[U]:{...Z[U],installed:!0}})),f(Z=>Z.includes(U)?Z:[...Z,U])}catch{v(Z=>({...Z,[U]:{...Z[U],failed:!0}}))}finally{m(Z=>({...Z,[U]:!1}))}},[a]),K=g.useCallback(async(U,Z)=>{try{if(!(await fetch(`/api/credentials/${encodeURIComponent(U)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:Z})})).ok)throw new Error("Failed to save key");v(Ae=>({...Ae,[U]:{...Ae[U],authenticated:!0,maskedKey:`${Z.slice(0,6)}${"•".repeat(20)}`}})),s("success","API key saved")}catch(J){throw s("error","Failed to save key",J.message),J}},[s]),G=g.useCallback(async(U,Z)=>{b(U),j(Z);try{await n(U,Z)}catch{}},[n]),H=gs.some(U=>{var Z;return(Z=y[U.id])==null?void 0:Z.installed}),q=gs.some(U=>{var Z;return(Z=y[U.id])==null?void 0:Z.authenticated}),_=o===0||o===1?!0:o===2?H:o===3?q:o===4?!!O:!1;g.useEffect(()=>{const U=Z=>{Z.key==="Enter"&&o<Xh-1&&_&&S(),Z.key==="Escape"&&z()};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[o,_,S,z]);const R=[e.jsx(GRe,{onNext:S,onSkip:z},"welcome"),e.jsx(WRe,{selectedDir:Q,onSelectDir:L},"folder"),e.jsx(KRe,{providerStatus:y,selected:u,onInstall:F,installing:x,statusChecking:N},"install"),e.jsx(JRe,{providerStatus:y,installedIds:u,onSaveKey:K},"auth"),e.jsx(eHe,{providerStatus:y,installedIds:u,defaultProvider:O,defaultModel:C,onSetDefault:G},"default"),e.jsx(tHe,{providerStatus:y,defaultProvider:O,defaultModel:C,onFinish:P},"done")];return e.jsxs("div",{ref:B,className:"fixed inset-0 z-50 bg-gradient-to-b from-surface-0 to-surface-1 flex flex-col font-sans overflow-hidden",children:[d2()&&e.jsx("div",{className:"h-8 w-full electron-drag shrink-0"}),e.jsxs("div",{className:"flex items-center justify-between px-8 py-4 shrink-0",children:[e.jsx(ZRe,{current:o,total:Xh}),o>0&&o<Xh-1&&e.jsx("button",{type:"button",onClick:z,className:"text-xs text-text-4 hover:text-text-2 transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent rounded px-2 py-1",children:"Skip setup"})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center px-8 py-4 overflow-y-auto",children:e.jsx(Pu,{mode:"wait",custom:l,children:e.jsx(as.div,{custom:l,variants:VRe,initial:"enter",animate:"center",exit:"exit",transition:XRe,className:"w-full",children:R[o]},o)})}),o>0&&o<Xh-1&&e.jsxs("div",{className:"flex items-center justify-between px-8 py-8 shrink-0",children:[e.jsxs("button",{type:"button",onClick:I,className:"h-10 px-6 rounded-md text-sm text-text-2 hover:text-text-0 bg-surface-3 hover:bg-surface-4 transition-colors duration-100 cursor-pointer flex items-center gap-1.5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",children:[e.jsx(bs,{className:"w-4 h-4"}),"Back"]}),e.jsxs("button",{type:"button",onClick:S,disabled:!_,className:"h-10 px-8 rounded-md text-sm font-medium bg-accent text-surface-0 hover:bg-accent/80 transition-colors duration-100 cursor-pointer disabled:opacity-40 disabled:pointer-events-none flex items-center gap-1.5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",children:[o===4?"Finish Setup":"Continue",e.jsx(Rt,{className:"w-4 h-4"})]})]})]})}const nHe=[{icon:aa,label:"Federation",desc:"Multi-machine daemon pairing"},{icon:NA,label:"Cloud Teams",desc:"Coming soon"}];function SX(){var b;const t=$(C=>C.upgradeModalOpen),a=$(C=>C.setUpgradeModalOpen),n=$(C=>C.marketplaceAuthenticated),s=$(C=>C.marketplaceLogin),o=$(C=>C.startCheckout),c=$(C=>C.addToast),[l,A]=g.useState(null),[u,f]=g.useState("monthly"),[x,m]=g.useState(!1);g.useEffect(()=>{t&&!l&&$.getState().fetchSubscriptionPlans().then(C=>A(C)).catch(()=>{})},[t,l]);const y=(b=l==null?void 0:l.pro)==null?void 0:b[u],v=u==="annual"?`$${Math.round(((y==null?void 0:y.price)||96)/12)}/mo`:`$${(y==null?void 0:y.price)||10}/mo`;async function O(){var C;if(!n){s();return}if(!(y!=null&&y.priceId)){bP("https://groovedev.ai/pro"),a(!1);return}m(!0);try{await o(y.priceId),a(!1)}catch(j){j.status===401||(C=j.message)!=null&&C.includes("Not authenticated")?(c("info","Please sign in first"),s()):j.status===409&&(c("info","You already have a subscription"),a(!1))}finally{m(!1)}}return e.jsx(Ut,{open:t,onOpenChange:a,children:e.jsx(Pt,{title:"Upgrade to Pro",className:"max-w-[440px]",children:e.jsxs("div",{className:"px-6 py-5",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("div",{className:"mx-auto mb-3 w-12 h-12 rounded-full bg-accent/10 flex items-center justify-center",children:e.jsx(It,{size:22,className:"text-accent"})}),e.jsx("h2",{className:"text-lg font-bold text-text-0",children:"Upgrade to Groove Pro"}),e.jsx("p",{className:"text-sm text-text-2 mt-1",children:"Unlock powerful features for your AI workflow"})]}),e.jsx("div",{className:"space-y-3 mb-6",children:nHe.map(C=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-surface-4 flex items-center justify-center flex-shrink-0",children:e.jsx(C.icon,{size:15,className:"text-accent"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text-0",children:C.label}),e.jsx("p",{className:"text-2xs text-text-3",children:C.desc})]}),e.jsx(De,{size:14,className:"text-success ml-auto flex-shrink-0"})]},C.label))}),e.jsxs("div",{className:"flex gap-1 mb-5 bg-surface-3 p-0.5 rounded-md",children:[e.jsx("button",{type:"button",onClick:()=>f("monthly"),className:V("flex-1 h-8 rounded text-xs font-medium transition-colors cursor-pointer",u==="monthly"?"bg-surface-5 text-text-0":"text-text-3 hover:text-text-1"),children:"Monthly"}),e.jsxs("button",{type:"button",onClick:()=>f("annual"),className:V("flex-1 h-8 rounded text-xs font-medium transition-colors cursor-pointer",u==="annual"?"bg-surface-5 text-text-0":"text-text-3 hover:text-text-1"),children:["Annual",e.jsx("span",{className:"ml-1 text-success text-2xs",children:"Save 20%"})]})]}),e.jsxs("div",{className:"text-center mb-5",children:[e.jsx("span",{className:"text-3xl font-bold text-text-0",children:v}),u==="annual"&&e.jsxs("p",{className:"text-2xs text-text-3 mt-1",children:["Billed $",(y==null?void 0:y.price)||96,"/year"]})]}),e.jsx("button",{type:"button",onClick:O,disabled:x,className:"w-full h-10 rounded-lg bg-accent text-white font-semibold text-sm hover:bg-accent/90 transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center gap-2",children:x?"Processing...":n?e.jsxs(e.Fragment,{children:[e.jsx(It,{size:15})," Subscribe — ",v]}):e.jsxs(e.Fragment,{children:[e.jsx(pu,{size:15})," Sign in to subscribe"]})}),e.jsx("button",{type:"button",onClick:()=>a(!1),className:"w-full mt-2 text-xs text-text-4 hover:text-text-2 transition-colors cursor-pointer py-1",children:"Maybe later"})]})})})}function sHe(){const t=$(c=>c.dataSharingModalOpen),a=$(c=>c.setTrainingOptIn),n=$(c=>c.dismissDataSharingModal),[s,o]=g.useState(!1);return e.jsx(Ut,{open:t,children:e.jsxs(Pt,{className:"max-w-md",description:"Help improve Groove by sharing usage data",onInteractOutside:c=>c.preventDefault(),onEscapeKeyDown:c=>c.preventDefault(),children:[e.jsxs("div",{className:"relative bg-gradient-to-br from-accent/5 to-transparent px-6 pt-8 pb-6 text-center",children:[e.jsx("div",{className:"flex justify-center mb-3",children:e.jsx("div",{className:"w-14 h-14 rounded-xl bg-accent/10 flex items-center justify-center",children:e.jsx(It,{size:32,className:"text-accent"})})}),e.jsx(kT,{className:"text-xl font-bold text-text-0 font-sans",children:"Help Build a Better Groove"}),e.jsx("p",{className:"text-sm text-text-2 font-sans mt-2 max-w-md mx-auto",children:"We collect errors and usage reports to improve the quality of Groove for everyone."})]}),e.jsx("div",{className:"px-6 pt-4",children:e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-2/30 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[e.jsx(La,{size:14,className:"text-text-2"}),e.jsx("span",{className:"text-xs font-semibold uppercase text-text-3 tracking-wider font-sans",children:"What We Never Collect"})]}),e.jsx("div",{className:"space-y-1.5",children:["Your source code or file contents","API keys, passwords, or credentials","Personal information — emails, names, file paths","Anything that could identify you, your IP or projects"].map(c=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{size:12,className:"text-danger flex-shrink-0"}),e.jsx("span",{className:"text-xs text-text-1 font-sans",children:c})]},c))}),e.jsx("p",{className:"text-xs text-text-0 font-sans font-medium mt-3",children:"PII is automatically scrubbed before any data leaves your machine."})]})}),e.jsxs("div",{className:"border-t border-border-subtle mt-5 pt-4 pb-1 px-6",children:[e.jsxs("button",{type:"button",onClick:()=>a(!0),className:"w-full h-10 rounded-lg bg-accent text-white font-semibold text-sm hover:bg-accent/90 transition-colors cursor-pointer flex items-center justify-center gap-2",children:[e.jsx(It,{size:15}),"Turn On Sharing"]}),e.jsx("div",{className:"text-center mt-2.5",children:e.jsx("button",{type:"button",onClick:()=>n(s),className:"text-xs text-text-3 hover:text-text-1 transition-colors font-sans cursor-pointer",children:"Maybe Later"})}),e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-3",children:[e.jsx("input",{type:"checkbox",id:"data-sharing-dismiss",checked:s,onChange:c=>o(c.target.checked),className:"w-3.5 h-3.5 rounded border-border accent-accent cursor-pointer"}),e.jsx("label",{htmlFor:"data-sharing-dismiss",className:"text-2xs text-text-3 font-sans cursor-pointer select-none",children:"Don't show this again"})]}),e.jsx("p",{className:"text-center text-2xs text-text-4 font-sans mt-2 mb-1",children:"You can always enable this later in Settings"})]})]})})}function qe(t,a){const n=parseInt(t.slice(1,3),16),s=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16);return`rgba(${n},${s},${o},${a})`}const te={surface0:"#1a1e25",surface3:"#282c34",surface4:"#2c313a",surface5:"#333842",text0:"#e6e6e6",text1:"#bcc2cd",text2:"#8b929e",text3:"#6e7681",text4:"#505862",accent:"#33afbc",success:"#4ae168",warning:"#e5c07b",danger:"#e06c75",info:"#61afef",purple:"#c678dd",orange:"#d19a66"};function rHe(){const t=$(Q=>Q.recentProjects),a=$(Q=>Q.setProjectDir),n=$(Q=>Q.removeRecentProject),s=$(Q=>Q.remoteHomedir),o=$(Q=>Q.savedTunnels),c=$(Q=>Q.fetchTunnels),l=$(Q=>Q.deleteTunnel),A=$(Q=>Q.connectTunnel),u=$(Q=>Q.disconnectTunnel),f=$(Q=>Q.toggleQuickConnect),x=$(Q=>Q.addToast),[m,y]=g.useState(!1),[v,O]=g.useState(null);g.useEffect(()=>{c()},[c]);const b=(t||[]).slice(0,8),C=b.length>0,j=o.length>0,N=C||j;async function M(Q){var L,B;if(Q.active){(B=(L=window.groove)==null?void 0:L.remote)!=null&&B.openWindow?window.groove.remote.openWindow(Q.localPort,Q.name):window.open(`http://localhost:${Q.localPort}?instance=${encodeURIComponent(Q.name)}`,"_blank");return}O(Q.id);try{await A(Q.id)}catch(S){x("error","Connection failed",(S==null?void 0:S.message)||"Unknown error")}O(null)}return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:`radial-gradient(ellipse at 50% 40%, ${qe(te.accent,.06)} 0%, transparent 70%) ${te.surface0}`},children:[e.jsxs("div",{className:V("w-full max-w-4xl px-8 flex gap-12",N?"items-start":"items-center justify-center","max-md:flex-col max-md:items-center max-md:gap-8 max-md:overflow-y-auto max-md:max-h-[100vh] max-md:py-12"),children:[e.jsxs("div",{className:V("flex flex-col",N?"w-[55%] max-md:w-full":"w-full max-w-lg",N?"pt-[10vh]":"items-center text-center"),children:[e.jsxs("div",{className:V("flex items-center gap-4 mb-6",!N&&"flex-col"),children:[e.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center flex-shrink-0",style:{background:qe(te.accent,.08),border:`1px solid ${qe(te.accent,.15)}`,boxShadow:`0 0 40px ${qe(te.accent,.1)}`},children:e.jsx("img",{src:"/favicon.png",className:"w-9 h-9 rounded-full",alt:"Groove"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-text-0 font-sans tracking-tight",children:"Welcome to Groove"}),e.jsx("p",{className:"text-sm text-text-2 font-sans mt-0.5",children:"Your AI coding team, ready in minutes"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 mt-4 w-full",children:[e.jsxs("button",{onClick:()=>y(!0),className:"w-full flex items-center gap-4 p-5 rounded-lg border border-accent/25 bg-gradient-to-r from-accent/8 to-accent/3 hover:from-accent/14 hover:to-accent/6 hover:border-accent/40 transition-all cursor-pointer group text-left",children:[e.jsx("div",{className:"w-11 h-11 rounded-lg bg-accent/20 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:e.jsx(ga,{size:22,className:"text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-base font-semibold text-text-0 font-sans",children:"Open Project"}),e.jsx("div",{className:"text-sm text-text-2 font-sans mt-0.5",children:"Browse the filesystem to pick a project"})]})]}),e.jsxs("button",{onClick:f,className:"w-full flex items-center gap-4 p-5 rounded-lg border border-border bg-surface-1 hover:bg-surface-2 hover:border-border transition-all cursor-pointer group text-left",children:[e.jsx("div",{className:"w-11 h-11 rounded-lg bg-surface-4 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:e.jsx(Jn,{size:22,className:"text-text-1"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-base font-semibold text-text-0 font-sans",children:"Connect to Remote"}),e.jsx("div",{className:"text-sm text-text-2 font-sans mt-0.5",children:"SSH tunnel to a server"})]})]})]}),e.jsxs("p",{className:"text-xs text-text-4 font-sans mt-8",children:[e.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+K"}),e.jsx("span",{className:"mx-1.5",children:"command palette"}),e.jsx("span",{className:"text-text-4 mx-1",children:"·"}),e.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+N"}),e.jsx("span",{className:"mx-1.5",children:"spawn"}),e.jsx("span",{className:"text-text-4 mx-1",children:"·"}),e.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+J"}),e.jsx("span",{className:"mx-1.5",children:"terminal"})]})]}),N&&e.jsxs("div",{className:"w-[45%] max-md:w-full pt-[10vh] max-md:pt-0 min-w-0 max-h-[80vh] overflow-y-auto",children:[C&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest mb-2",children:"Recent"}),e.jsx("div",{className:"flex flex-col",children:b.map(Q=>e.jsxs("div",{className:"group flex items-center gap-2 px-2 py-1.5 rounded-sm hover:bg-surface-1 transition-colors",children:[e.jsxs("button",{onClick:()=>a(Q.path),className:"flex-1 min-w-0 text-left cursor-pointer",children:[e.jsx("div",{className:"text-sm font-medium text-text-1 hover:text-accent truncate transition-colors",children:Q.name}),e.jsx("div",{className:"text-2xs font-mono text-text-4 truncate",children:Q.path})]}),e.jsx("button",{onClick:L=>{L.stopPropagation(),n(Q.path)},className:"opacity-0 group-hover:opacity-100 p-0.5 text-text-4 hover:text-danger cursor-pointer transition-all flex-shrink-0",title:"Remove from recent",children:e.jsx(Ge,{size:14})})]},Q.path))})]}),C&&j&&e.jsx("div",{className:"border-t border-border-subtle my-4"}),j&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest mb-2",children:"SSH Connections"}),e.jsx("div",{className:"flex flex-col",children:o.map(Q=>e.jsxs("div",{className:V("group flex items-center gap-2 px-2 py-1.5 rounded-sm hover:bg-surface-1 transition-colors",v===Q.id&&"opacity-60 pointer-events-none"),children:[e.jsxs("button",{onClick:()=>M(Q),disabled:v===Q.id,className:"flex-1 min-w-0 text-left cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-text-1 hover:text-accent truncate transition-colors",children:Q.name}),Q.active&&e.jsx(ia,{status:"running",size:"sm"})]}),e.jsxs("div",{className:"text-2xs font-mono text-text-4 truncate",children:[Q.user,"@",Q.host]})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[v===Q.id?e.jsx($e,{size:14,className:"text-text-3 animate-spin"}):Q.active?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>M(Q),className:"opacity-0 group-hover:opacity-100 flex items-center gap-0.5 text-2xs text-success hover:text-success/80 cursor-pointer transition-all",children:[e.jsx(ma,{size:11})," Open"]}),e.jsx("button",{onClick:async()=>{await u(Q.id),x("info","Disconnected",Q.name)},className:"opacity-0 group-hover:opacity-100 p-0.5 text-text-4 hover:text-danger cursor-pointer transition-all",title:"Disconnect",children:e.jsx(ai,{size:12})})]}):null,e.jsx("button",{onClick:L=>{L.stopPropagation(),l(Q.id)},className:"opacity-0 group-hover:opacity-100 p-0.5 text-text-4 hover:text-danger cursor-pointer transition-all flex-shrink-0",title:"Remove connection",children:e.jsx(Ge,{size:14})})]})]},Q.id))}),e.jsxs("button",{onClick:f,className:"flex items-center gap-1 text-xs text-accent hover:underline font-sans cursor-pointer mt-2 px-2",children:[e.jsx(ht,{size:12})," Add Connection"]})]}),!C&&!j&&e.jsx("p",{className:"text-sm text-text-4 italic px-2",children:"No recent activity"})]})]}),e.jsx(Hu,{open:m,onOpenChange:y,currentPath:s||"/home",homePath:s,onSelect:Q=>{y(!1),a(Q)}}),e.jsx(DG,{}),e.jsx(hG,{})]})}const oHe={js:"text-text-2",jsx:"text-text-2",ts:"text-text-2",tsx:"text-text-2",css:"text-text-3",html:"text-text-3",json:"text-text-3",md:"text-text-3",py:"text-text-2",rs:"text-text-3",go:"text-text-2",sh:"text-text-3",yaml:"text-text-3",yml:"text-text-3",sql:"text-text-3",xml:"text-text-3",svg:"text-text-3"};function iHe(t){var n;const a=(n=t.split(".").pop())==null?void 0:n.toLowerCase();return oHe[a]||"text-text-3"}function cHe({x:t,y:a,items:n,onClose:s}){const o=g.useRef(null);return g.useEffect(()=>{function c(l){o.current&&!o.current.contains(l.target)&&s()}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[s]),e.jsx("div",{ref:o,className:"fixed z-50 min-w-[160px] py-1 bg-surface-2 border border-border rounded-lg shadow-xl",style:{left:t,top:a},children:n.map((c,l)=>c.separator?e.jsx("div",{className:"h-px bg-border-subtle my-1"},l):e.jsxs("button",{onClick:()=>{c.action(),s()},className:V("w-full flex items-center gap-2.5 px-3 py-1.5 text-xs font-sans text-left cursor-pointer transition-colors",c.danger?"text-danger hover:bg-danger/10":"text-text-1 hover:bg-surface-5"),children:[c.icon&&e.jsx(c.icon,{size:12,className:c.danger?"text-danger":"text-text-3"}),c.label]},l))})}function rT({defaultValue:t="",placeholder:a,onSubmit:n,onCancel:s,depth:o=0}){const[c,l]=g.useState(t),A=g.useRef(null);g.useEffect(()=>{var f,x;(f=A.current)==null||f.focus(),t&&((x=A.current)==null||x.select())},[t]);function u(f){if(f.key==="Enter"){const x=c.trim();x&&n(x)}f.key==="Escape"&&s()}return e.jsx("div",{className:"flex items-center py-0.5",style:{paddingLeft:o*16+8},children:e.jsx("input",{ref:A,value:c,onChange:f=>l(f.target.value),onKeyDown:u,onBlur:s,placeholder:a,className:"w-full h-5 px-1.5 text-xs bg-surface-0 border border-accent rounded text-text-0 font-sans focus:outline-none"})})}function YJ({entry:t,depth:a=0,activePath:n,onFileClick:s,onDirToggle:o,expanded:c,onContextMenu:l,dragState:A,onDragStartEntry:u,onDragEndEntry:f,onSetDragOver:x,onDropOnDir:m}){const y=t.type==="dir",v=n===t.path,O=c.has(t.path),b=a*16+8,C=(A==null?void 0:A.draggingPath)===t.path,j=y&&(A==null?void 0:A.dragOverPath)===t.path;function N(M){M.preventDefault(),M.stopPropagation(),l(M,t)}return e.jsxs("button",{draggable:!0,onDragStart:M=>{M.dataTransfer.setData("application/json",JSON.stringify({path:t.path,name:t.name,type:t.type})),M.dataTransfer.effectAllowed="move",u(t.path)},onDragEnd:f,onDragOver:y?M=>{M.preventDefault(),M.stopPropagation(),x(t.path)}:void 0,onDrop:y?M=>m(t.path,M):void 0,onClick:()=>y?o(t.path):s(t.path),onDoubleClick:N,onContextMenu:N,className:V("w-full flex items-center gap-1.5 py-[3px] text-[13px] font-sans cursor-pointer","hover:bg-surface-5 transition-colors text-left select-none",v&&"bg-accent/10 text-text-0",!v&&"text-text-1",C&&"opacity-50",j&&"bg-accent/15 ring-1 ring-accent/50 rounded"),style:{paddingLeft:b},children:[y?e.jsxs(e.Fragment,{children:[O?e.jsx(bt,{size:12,className:"text-text-4 flex-shrink-0"}):e.jsx(Rt,{size:12,className:"text-text-4 flex-shrink-0"}),O?e.jsx(ga,{size:14,className:"text-accent flex-shrink-0"}):e.jsx(Ko,{size:14,className:"text-text-3 flex-shrink-0"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-3"}),e.jsx(iu,{size:14,className:V("flex-shrink-0",iHe(t.name))})]}),e.jsx("span",{className:"truncate",children:t.name})]})}function JJ({dirPath:t,depth:a,activePath:n,onFileClick:s,expanded:o,onDirToggle:c,treeCache:l,fetchTreeDir:A,onContextMenu:u,inlineInput:f,dragState:x,onDragStartEntry:m,onDragEndEntry:y,onSetDragOver:v,onDropOnDir:O}){const b=l[t]||[];return g.useEffect(()=>{o.has(t)&&!l[t]&&A(t)},[o,t,l,A]),o.has(t)?e.jsxs(e.Fragment,{children:[(f==null?void 0:f.parentPath)===t&&e.jsx(rT,{placeholder:f.type==="file"?"filename.ext":"folder-name",onSubmit:f.onSubmit,onCancel:f.onCancel,depth:a}),b.map(C=>e.jsxs("div",{children:[(f==null?void 0:f.renamePath)===C.path?e.jsx(rT,{defaultValue:C.name,onSubmit:f.onSubmit,onCancel:f.onCancel,depth:a}):e.jsx(YJ,{entry:C,depth:a,activePath:n,onFileClick:s,onDirToggle:c,expanded:o,onContextMenu:u,dragState:x,onDragStartEntry:m,onDragEndEntry:y,onSetDragOver:v,onDropOnDir:O}),C.type==="dir"&&e.jsx(JJ,{dirPath:C.path,depth:a+1,activePath:n,onFileClick:s,expanded:o,onDirToggle:c,treeCache:l,fetchTreeDir:A,onContextMenu:u,inlineInput:f,dragState:x,onDragStartEntry:m,onDragEndEntry:y,onSetDragOver:v,onDropOnDir:O})]},C.path))]}):null}function lHe({rootDir:t,onCollapse:a}){const n=$(_=>_.editorTreeCache),s=$(_=>_.editorActiveFile),o=$(_=>_.openFile),c=$(_=>_.fetchTreeDir),l=$(_=>_.addToast),[A,u]=g.useState(new Set([""])),[f,x]=g.useState(""),[m,y]=g.useState(null),[v,O]=g.useState(null),[b,C]=g.useState({draggingPath:null,dragOverPath:null});g.useEffect(()=>{c("")},[c,t]);function j(_){u(R=>{const U=new Set(R);return U.has(_)?U.delete(_):U.add(_),U})}function N(){u(new Set([""]))}function M(_){C({draggingPath:_,dragOverPath:null})}function Q(){C({draggingPath:null,dragOverPath:null})}function L(_){C(R=>R.dragOverPath===_?R:{...R,dragOverPath:_})}async function B(_,R){R.preventDefault(),R.stopPropagation(),C({draggingPath:null,dragOverPath:null});let U;try{U=JSON.parse(R.dataTransfer.getData("application/json"))}catch{return}if(!(U!=null&&U.path))return;if(U.type==="dir"&&(_===U.path||_.startsWith(U.path+"/"))){l("error","Cannot move a folder into itself");return}const Z=z(U.path);if(Z===_)return;const J=_?`${_}/${U.name}`:U.name;try{await D.post("/files/rename",{oldPath:U.path,newPath:J}),c(Z),c(_),l("success",`Moved ${U.name} to ${_||"/"}`)}catch(Ae){l("error","Move failed",Ae.message)}}function S(_,R){y({x:_.clientX,y:_.clientY,entry:R})}function I(_){_.preventDefault(),y({x:_.clientX,y:_.clientY,entry:{type:"dir",path:"",name:"root"}})}function z(_){const R=_.split("/");return R.pop(),R.join("/")}async function P(_){u(R=>new Set([...R,_])),O({type:"file",parentPath:_,onSubmit:async R=>{const U=_?`${_}/${R}`:R;try{await D.post("/files/create",{path:U,content:""}),c(_),o(U),l("success",`Created ${R}`)}catch(Z){l("error","Create failed",Z.message)}O(null)},onCancel:()=>O(null)})}async function F(_){u(R=>new Set([...R,_])),O({type:"folder",parentPath:_,onSubmit:async R=>{const U=_?`${_}/${R}`:R;try{await D.post("/files/mkdir",{path:U}),c(_),u(Z=>new Set([...Z,U])),l("success",`Created ${R}/`)}catch(Z){l("error","Create folder failed",Z.message)}O(null)},onCancel:()=>O(null)})}async function K(_){O({type:"rename",renamePath:_.path,onSubmit:async R=>{const U=z(_.path),Z=U?`${U}/${R}`:R;try{await D.post("/files/rename",{oldPath:_.path,newPath:Z}),c(U),l("success",`Renamed to ${R}`)}catch(J){l("error","Rename failed",J.message)}O(null)},onCancel:()=>O(null)})}async function G(_){const R=_.type==="dir"?`folder "${_.name}" and all contents`:`"${_.name}"`;if(window.confirm(`Delete ${R}?`))try{await D.delete(`/files/delete?path=${encodeURIComponent(_.path)}`),c(z(_.path)),l("success",`Deleted ${_.name}`)}catch(U){l("error","Delete failed",U.message)}}function H(_){const R=_.type==="dir",U=[];return R&&(U.push({icon:Hr,label:"New File",action:()=>P(_.path)}),U.push({icon:qr,label:"New Folder",action:()=>F(_.path)})),_.name!=="root"?(U.length>0&&U.push({separator:!0}),U.push({icon:js,label:"Rename",action:()=>K(_)}),U.push({icon:At,label:"Delete",danger:!0,action:()=>G(_)})):(U.length=0,U.push({icon:Hr,label:"New File",action:()=>P("")}),U.push({icon:qr,label:"New Folder",action:()=>F("")})),U}const q=n[""]||[];return e.jsxs("div",{className:"flex flex-col h-full bg-surface-1",onContextMenu:I,children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border-subtle",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(oa,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{value:f,onChange:_=>x(_.target.value),placeholder:"Filter...",className:"w-full h-6 pl-6 pr-2 text-xs bg-surface-0 border border-border-subtle rounded text-text-1 placeholder:text-text-4 focus:outline-none focus:border-accent font-sans"})]}),e.jsx("button",{onClick:()=>P(""),className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"New file",children:e.jsx(Hr,{size:12})}),e.jsx("button",{onClick:()=>F(""),className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"New folder",children:e.jsx(qr,{size:12})}),e.jsx("button",{onClick:()=>c(""),className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Refresh",children:e.jsx(ra,{size:12})}),e.jsx("button",{onClick:N,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Collapse all",children:e.jsx(ru,{size:12})}),a&&e.jsx("button",{onClick:a,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Collapse sidebar",children:e.jsx(fs,{size:12})})]}),e.jsx(it,{className:"flex-1",children:e.jsxs("div",{className:"py-1",onDragOver:_=>{b.draggingPath&&(_.preventDefault(),L(null))},onDrop:_=>B("",_),children:[(v==null?void 0:v.parentPath)===""&&e.jsx(rT,{placeholder:v.type==="file"?"filename.ext":"folder-name",onSubmit:v.onSubmit,onCancel:v.onCancel,depth:0}),q.filter(_=>!f||_.name.toLowerCase().includes(f.toLowerCase())).map(_=>e.jsxs("div",{children:[(v==null?void 0:v.renamePath)===_.path?e.jsx(rT,{defaultValue:_.name,onSubmit:v.onSubmit,onCancel:v.onCancel,depth:0}):e.jsx(YJ,{entry:_,depth:0,activePath:s,onFileClick:o,onDirToggle:j,expanded:A,onContextMenu:S,dragState:b,onDragStartEntry:M,onDragEndEntry:Q,onSetDragOver:L,onDropOnDir:B}),_.type==="dir"&&e.jsx(JJ,{dirPath:_.path,depth:1,activePath:s,onFileClick:o,expanded:A,onDirToggle:j,treeCache:n,fetchTreeDir:c,onContextMenu:S,inlineInput:v,dragState:b,onDragStartEntry:M,onDragEndEntry:Q,onSetDragOver:L,onDropOnDir:B})]},_.path)),q.length===0&&!f&&e.jsxs("div",{className:"px-3 py-6 text-center",children:[e.jsx("p",{className:"text-xs text-text-4",children:"No files found"}),e.jsx("button",{onClick:()=>c(""),className:"mt-2 text-xs text-accent hover:underline cursor-pointer",children:"Retry"})]})]})}),m&&e.jsx(cHe,{x:m.x,y:m.y,items:H(m.entry),onClose:()=>y(null)})]})}function dHe(){const t=$(b=>b.editorOpenTabs),a=$(b=>b.editorActiveFile),n=$(b=>b.editorFiles),s=$(b=>b.setActiveFile),o=$(b=>b.closeFile),c=g.useRef(null),[l,A]=g.useState(!1),u=g.useCallback(()=>{const b=c.current;b&&A(b.scrollWidth>b.clientWidth)},[]);g.useEffect(()=>{u();const b=c.current;if(!b)return;const C=new ResizeObserver(u);return C.observe(b),()=>C.disconnect()},[u,t.length]);function f(){var b;(b=c.current)==null||b.scrollBy({left:-120,behavior:"smooth"})}function x(){var b;(b=c.current)==null||b.scrollBy({left:120,behavior:"smooth"})}function m(b){t.filter(C=>C!==b).forEach(C=>o(C))}function y(){[...t].forEach(b=>o(b))}function v(b){const C=t.indexOf(b);t.slice(C+1).forEach(j=>o(j))}function O(b){var C;(C=navigator.clipboard)==null||C.writeText(b)}return t.length===0?null:e.jsxs("div",{className:"flex items-stretch h-9 bg-surface-3 border-b border-border-subtle flex-shrink-0",children:[l&&e.jsx("button",{onClick:f,className:"flex-shrink-0 px-1 h-full text-text-4 hover:text-text-1 hover:bg-surface-4 transition-colors cursor-pointer",children:e.jsx(bs,{size:14})}),e.jsx("div",{ref:c,className:"flex items-stretch flex-1 min-w-0 overflow-x-auto scrollbar-none scroll-smooth",style:{scrollSnapType:"x mandatory"},children:t.map(b=>{const C=b===a,j=n[b],N=j&&j.content!==j.originalContent,M=b.split("/").pop();return e.jsxs(Bz,{children:[e.jsx(_z,{asChild:!0,children:e.jsxs("div",{className:V("flex items-center gap-1.5 px-3 text-xs font-sans cursor-pointer select-none","border-r border-white/5","transition-colors duration-75 flex-shrink-0",C?"bg-surface-0 text-text-0 border-b border-b-accent":"bg-surface-3 text-text-4 hover:text-text-1 hover:bg-surface-4 border-b border-b-transparent"),style:{scrollSnapAlign:"start"},onClick:()=>s(b),onAuxClick:Q=>{Q.button===1&&(Q.preventDefault(),o(b))},children:[e.jsx("span",{className:"truncate max-w-[120px]",children:M}),N&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-warning flex-shrink-0"}),e.jsx("button",{onClick:Q=>{Q.stopPropagation(),o(b)},className:"p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 transition-colors cursor-pointer ml-0.5",children:e.jsx(Ge,{size:12})})]})}),e.jsxs(Lz,{children:[e.jsxs(ms,{onSelect:()=>o(b),children:[e.jsx(Ge,{size:12,className:"text-text-3"})," Close"]}),e.jsxs(ms,{onSelect:()=>m(b),children:[e.jsx(qn,{size:12,className:"text-text-3"})," Close Others"]}),e.jsxs(ms,{onSelect:()=>y(),children:[e.jsx(qn,{size:12,className:"text-text-3"})," Close All"]}),e.jsxs(ms,{onSelect:()=>v(b),children:[e.jsx(Rt,{size:12,className:"text-text-3"})," Close to the Right"]}),e.jsx(Tz,{}),e.jsxs(ms,{onSelect:()=>O(b),children:[e.jsx(wn,{size:12,className:"text-text-3"})," Copy Path"]})]})]},b)})}),l&&e.jsx("button",{onClick:x,className:"flex-shrink-0 px-1 h-full text-text-4 hover:text-text-1 hover:bg-surface-4 transition-colors cursor-pointer",children:e.jsx(Rt,{size:14})})]})}const AHe={javascript:"JavaScript",typescript:"TypeScript",css:"CSS",html:"HTML",json:"JSON",markdown:"Markdown",python:"Python"};function uHe({cursorPos:t,language:a}){return e.jsxs("div",{className:"flex items-center justify-between h-6 px-3 bg-surface-1 border-t border-border-subtle text-2xs font-sans text-text-3 flex-shrink-0 select-none",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("span",{children:["Ln ",t.line,", Col ",t.col]})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"cursor-default",children:AHe[a]||a||"Plain Text"}),e.jsx("span",{children:"Spaces: 2"}),e.jsx("span",{children:"UTF-8"})]})]})}function hHe({currentLine:t,onGoto:a,onClose:n}){const[s,o]=g.useState(""),c=g.useRef(null);g.useEffect(()=>{var A;(A=c.current)==null||A.focus()},[]);function l(A){if(A.key==="Enter"){const u=parseInt(s,10);u>0&&a(u),n()}A.key==="Escape"&&n()}return e.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-2 bg-surface-2 border border-border rounded-lg shadow-xl p-2",children:[e.jsx("label",{className:"text-2xs font-sans text-text-3 whitespace-nowrap",children:"Go to Line:"}),e.jsx("input",{ref:c,value:s,onChange:A=>o(A.target.value),onKeyDown:l,onBlur:n,placeholder:String(t),className:"w-20 h-6 px-2 text-xs bg-surface-0 border border-border-subtle rounded text-text-0 font-mono focus:outline-none focus:border-accent"})]})}function pHe({path:t}){if(!t)return null;const a=t.split("/").filter(Boolean);return e.jsx("div",{className:"flex items-center h-7 px-3 bg-surface-2 border-b border-border-subtle text-2xs font-sans text-text-3 overflow-hidden flex-shrink-0 select-none",children:a.map((n,s)=>{const o=s===a.length-1;return e.jsxs("span",{className:"flex items-center min-w-0",children:[s>0&&e.jsx(Rt,{size:10,className:"mx-0.5 flex-shrink-0 text-text-4"}),e.jsx("span",{className:o?"text-text-1 font-medium truncate":"hover:text-text-1 cursor-pointer truncate transition-colors",children:n})]},s)})})}function fHe(t){var n;const a=(n=t==null?void 0:t.split(".").pop())==null?void 0:n.toLowerCase();return a==="html"||a==="htm"}const xHe=240,mHe=160,gHe=400;function yHe(){const t=$(K=>K.editorActiveFile),a=$(K=>K.editorFiles),n=$(K=>K.updateFileContent),s=$(K=>K.saveFile),o=$(K=>K.editorSidebarWidth),c=$(K=>K.setEditorSidebarWidth),l=$(K=>K.projectDir),[A,u]=g.useState(""),[f,x]=g.useState(!1),[m,y]=g.useState(0),[v,O]=g.useState({line:1,col:1}),[b,C]=g.useState(!1),[j,N]=g.useState(!1),M=g.useRef(null),Q=g.useRef(!1),L=g.useRef(0),B=g.useRef(0);g.useEffect(()=>{D.get("/files/root").then(K=>u(K.root||"")).catch(()=>{})},[l]),g.useEffect(()=>{x(!1)},[t]),g.useEffect(()=>{function K(G){(G.metaKey||G.ctrlKey)&&G.key==="g"&&(G.preventDefault(),C(!0))}return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[]);const S=g.useCallback(K=>{K.preventDefault(),Q.current=!0,L.current=K.clientX,B.current=o;function G(q){if(!Q.current)return;const _=q.clientX-L.current,R=Math.min(Math.max(B.current+_,mHe),gHe);c(R)}function H(){Q.current=!1,document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",H)}document.addEventListener("mousemove",G),document.addEventListener("mouseup",H)},[o,c]);function I(K){const G=M.current;if(!G)return;const H=G.state.doc.line(Math.min(K,G.state.doc.lines));G.dispatch({selection:{anchor:H.from},scrollIntoView:!0}),G.focus()}const z=t?a[t]:null,P=t&&UY(t),F=t&&fHe(t);return e.jsxs("div",{className:"flex h-full",children:[e.jsxs("div",{className:V("relative flex-shrink-0 border-r border-border transition-all duration-200 overflow-hidden",j&&"w-0 border-r-0"),style:j?void 0:{width:o},children:[e.jsx(lHe,{rootDir:A,onCollapse:()=>N(!0)}),e.jsx("div",{className:"absolute top-0 right-0 bottom-0 w-1 cursor-col-resize hover:bg-accent/30 transition-colors z-10",onMouseDown:S,onDoubleClick:()=>c(xHe)})]}),j&&e.jsx("button",{onClick:()=>N(!1),className:"flex-shrink-0 w-6 flex items-start justify-center pt-2 border-r border-border bg-surface-2 text-text-4 hover:text-text-0 hover:bg-surface-3 transition-colors cursor-pointer",title:"Show sidebar",children:e.jsx(xs,{size:14})}),e.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-surface-1",children:[e.jsx(dHe,{}),t&&!P&&e.jsx(pHe,{path:t}),e.jsxs("div",{className:"flex-1 relative min-h-0",children:[b&&e.jsx(hHe,{currentLine:v.line,onGoto:I,onClose:()=>C(!1)}),!t&&e.jsx("div",{className:"w-full h-full flex items-center justify-center text-text-4 font-sans",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(Zt,{size:32,className:"mx-auto"}),e.jsx("p",{className:"text-sm",children:"Open a file from the tree"})]})}),t&&P&&e.jsx(PY,{path:t}),t&&!P&&F&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"absolute top-0 right-4 z-10 flex items-center gap-0.5 mt-2 bg-surface-2 border border-border-subtle rounded-md p-0.5",children:[e.jsxs("button",{onClick:()=>x(!1),className:V("flex items-center gap-1.5 px-2.5 py-1 text-xs font-sans rounded cursor-pointer transition-colors",f?"text-text-3 hover:text-text-1":"bg-surface-4 text-text-0 font-medium"),children:[e.jsx(ou,{size:12})," Code"]}),e.jsxs("button",{onClick:()=>{x(!0),y(K=>K+1)},className:V("flex items-center gap-1.5 px-2.5 py-1 text-xs font-sans rounded cursor-pointer transition-colors",f?"bg-surface-4 text-text-0 font-medium":"text-text-3 hover:text-text-1"),children:[e.jsx(na,{size:12})," Preview"]})]}),f?e.jsx("iframe",{src:`/api/files/raw?path=${encodeURIComponent(t)}`,className:"w-full h-full border-0",sandbox:"allow-scripts allow-same-origin",title:"HTML Preview"},m):z&&e.jsx(hE,{content:z.content,language:z.language,onChange:K=>n(t,K),onSave:()=>s(t),onCursorChange:O,viewRef:M})]}),t&&!P&&!F&&z&&e.jsx(hE,{content:z.content,language:z.language,onChange:K=>n(t,K),onSave:()=>s(t),onCursorChange:O,viewRef:M})]}),t&&!P&&e.jsx(uHe,{cursorPos:v,language:z==null?void 0:z.language})]})]})}function vHe(){var M;const t=$(Q=>Q.connected),a=$(Q=>Q.agents),[n,s]=g.useState(null),[o,c]=g.useState([]),[l,A]=g.useState({constraints:[],discoveries:[],roles:[],specializations:null}),[u,f]=g.useState(!0),[x,m]=g.useState({tokens:[],cost:[],saved:[],efficiency:[],cache:[],inputOutput:[],agents:[],turns:[]}),y=g.useRef(0);g.useEffect(()=>{if(!t)return;let Q=!0;async function L(){try{const[S,I,z,P,F,K]=await Promise.all([D.get("/dashboard"),D.get("/tokens/by-team").catch(()=>({teams:[]})),D.get("/memory/constraints").catch(()=>({constraints:[]})),D.get("/memory/discoveries?limit=20").catch(()=>({discoveries:[]})),D.get("/memory/handoff-chain").catch(()=>({roles:[]})),D.get("/memory/specializations").catch(()=>({perAgent:{},perProjectRole:{}}))]);if(!Q)return;s(S),c((I==null?void 0:I.teams)||[]),A({constraints:(z==null?void 0:z.constraints)||[],discoveries:(P==null?void 0:P.discoveries)||[],roles:(F==null?void 0:F.roles)||[],specializations:K||{perAgent:{},perProjectRole:{}}}),f(!1),y.current=Date.now(),m(G=>{var W,ae,Oe,ve,ce,he,je,ee,ke;const H=Date.now(),q=(ye,Ne)=>[...ye.slice(-59),{t:H,v:Ne||0}],_=((W=S.tokens)==null?void 0:W.totalTokens)||0,R=((ae=S.tokens)==null?void 0:ae.totalInputTokens)||0,U=((Oe=S.tokens)==null?void 0:Oe.totalOutputTokens)||0,J=(((ve=S.agents)==null?void 0:ve.breakdown)||[]).filter(ye=>{var Ne;return((Ne=ye.quality)==null?void 0:Ne.score)!=null}),Ae=J.length>0?J.reduce((ye,Ne)=>ye+Ne.quality.score,0)/J.length:0;return{tokens:q(G.tokens,_),cost:q(G.cost,(ce=S.tokens)==null?void 0:ce.totalCostUsd),saved:q(G.saved,Ae),efficiency:q(G.efficiency,((he=S.rotation)==null?void 0:he.totalRotations)||0),cache:q(G.cache,(je=S.tokens)==null?void 0:je.cacheHitRate),inputOutput:q(G.inputOutput,U>0?R/U:0),agents:q(G.agents,((ee=S.agents)==null?void 0:ee.running)||0),turns:q(G.turns,(ke=S.tokens)==null?void 0:ke.totalTurns)}})}catch{Q&&f(!1)}}L();const B=setInterval(L,4e3);return()=>{Q=!1,clearInterval(B)}},[t]);const v=((M=n==null?void 0:n.agents)==null?void 0:M.breakdown)||[],O=(n==null?void 0:n.routing)||null,b=(n==null?void 0:n.rotation)||null,C=(n==null?void 0:n.adaptive)||[],j=(n==null?void 0:n.journalist)||null,N=(b==null?void 0:b.rotating)||[];return{data:n,loading:u,agents:a,connected:t,kpiHistory:x,lastFetch:y.current,agentBreakdown:v,routing:O,rotation:b,adaptive:C,journalist:j,rotating:N,teamBurn:o,memory:l}}const QX=g.memo(function({connected:a,runningCount:n,totalCount:s,uptime:o,lastFetch:c,activeTeam:l}){return e.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-surface-1 border-b border-border",children:[e.jsx("h2",{className:"text-xs font-semibold text-text-0 font-sans tracking-wide uppercase",children:"Command Center"}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-4",children:"/"}),e.jsx("span",{className:"text-xs font-mono text-text-2",children:l.name})]}),e.jsx("div",{className:"flex-1"}),a&&e.jsxs("div",{className:"flex items-center gap-3.5 text-xs font-mono text-text-2",children:[e.jsxs("span",{children:[e.jsx("span",{className:"text-text-1",children:n}),e.jsxs("span",{className:"text-text-3",children:["/",s]}),e.jsx("span",{className:"ml-1 text-text-3",children:"agents"})]}),o>0&&e.jsxs("span",{className:"text-text-3",children:["Up ",WA(o)]}),c>0&&e.jsxs("span",{className:"flex items-center gap-1 text-text-4",children:[e.jsx(ra,{size:9}),e.jsx("span",{children:Mt(c)})]})]}),e.jsx(ia,{status:a?"running":"crashed",size:"sm"})]})});function kHe({data:t,color:a=te.accent,width:n=72,height:s=22}){if(!t||t.length<2)return e.jsx("div",{style:{width:n,height:s}});const o=t.map(x=>x.v),c=Math.min(...o),A=Math.max(...o)-c||1,u=t.map((x,m)=>{const y=m/(t.length-1)*n,v=s-(x.v-c)/A*(s-2)-1;return`${y},${v}`}).join(" "),f=`kpi-${a.replace("#","")}`;return e.jsxs("svg",{width:n,height:s,className:"flex-shrink-0",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:f,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:"0.2"}),e.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:"0"})]})}),e.jsx("polygon",{points:`0,${s} ${u} ${n},${s}`,fill:`url(#${f})`}),e.jsx("polyline",{points:u,fill:"none",stroke:a,strokeWidth:"1.5",strokeLinejoin:"round",strokeOpacity:"0.8"})]})}const OHe=g.memo(function({label:a,value:n,sparkData:s,color:o=te.accent,hint:c,className:l}){return e.jsxs("div",{className:V("flex items-center gap-2.5 px-3 py-2.5 min-w-0","bg-surface-1",l),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5 truncate flex items-center gap-1",children:[a,c&&e.jsx(Nt,{content:e.jsx("span",{className:"max-w-[220px] block leading-relaxed",children:c}),side:"bottom",children:e.jsx(Na,{size:10,className:"text-text-4 hover:text-text-2 cursor-help flex-shrink-0 transition-colors"})})]}),e.jsx("div",{className:"text-base font-semibold font-mono text-text-0 tabular-nums leading-none",children:n})]}),e.jsx(kHe,{data:s,color:o})]})});function bHe({kpis:t}){return e.jsx("div",{className:"flex flex-wrap border-b border-border",style:{background:"var(--color-surface-0)"},children:t.map(a=>e.jsx(OHe,{label:a.label,value:a.value,sparkData:a.sparkData,color:a.color,hint:a.hint,className:V("flex-1 basis-[12.5%] min-w-[140px]","border-b border-r border-border")},a.label))})}const wHe={actual:"ACT",estimated:"EST",local:"LOC"};function jHe(t){if(!t||t==="auto"||t==="default")return"default";const a=t.match(/^claude-(opus|sonnet|haiku)-(\d+)-(\d+)/);return a?`${a[1][0].toUpperCase()}${a[1].slice(1)} ${a[2]}.${a[3]}`:t.startsWith("gemini-")?t.replace("gemini-","Gem ").replace("-preview",""):t.length>12?t.slice(0,12)+"...":t}const CHe=g.memo(function({agent:a,isRotating:n}){const s=a.status==="running"||a.status==="starting",o=Math.round((a.contextUsage||0)*100),c=n?"#c678dd":qE(a.status),l=a.quality,A=(l==null?void 0:l.toolSuccessRate)!=null?Math.round(l.toolSuccessRate*100):null,u=a.rotationThreshold?Math.round(a.rotationThreshold*100):null,f=On(a.role),x=o>80?te.danger:o>60?te.warning:te.accent;return e.jsxs("div",{className:"px-3 pl-6 py-2 hover:bg-[rgba(51,175,188,0.06)] transition-colors space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[e.jsx("span",{className:"absolute inset-0 rounded-sm",style:{background:c}}),s&&e.jsx("span",{className:"absolute inset-[-2px] rounded-sm",style:{background:c,opacity:.15,animation:"node-pulse-bar 2s ease-in-out infinite"}})]}),e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate leading-none flex-shrink-0 max-w-[80px]",children:a.name}),e.jsx("span",{className:"text-2xs font-mono font-semibold px-1.5 py-px rounded-sm flex-shrink-0 capitalize",style:{background:f.bg,color:f.text},children:(a.role||"").toLowerCase()}),e.jsx("span",{className:"text-2xs font-mono text-text-4 bg-surface-4 px-1 py-px rounded-sm flex-shrink-0 truncate max-w-[72px]",children:jHe(a.model)}),e.jsx("div",{className:"flex-1"}),A!=null&&e.jsxs("span",{className:"text-2xs font-mono font-bold px-1 py-px rounded-sm flex-shrink-0",style:{color:A>=90?"#4ae168":A>=70?"#e5c07b":"#e06c75",background:A>=90?"rgba(74,225,104,0.1)":A>=70?"rgba(229,192,123,0.1)":"rgba(224,108,117,0.1)"},children:[A,"%"]}),a.costSource&&a.costSource!=="actual"&&e.jsx("span",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider flex-shrink-0",children:wHe[a.costSource]||""}),e.jsxs("div",{className:"text-right flex-shrink-0",children:[e.jsx("div",{className:"text-xs font-mono text-text-1 tabular-nums leading-none",children:pt(a.tokens||0)}),(a.costUsd||0)>0&&e.jsx("div",{className:"text-2xs font-mono text-text-3 mt-0.5",children:Ai(a.costUsd)})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 h-0.5 rounded-sm overflow-visible",style:{background:qe(te.accent,.12)},children:[e.jsx("div",{className:"absolute inset-y-0 left-0 rounded-sm transition-all duration-700",style:{width:`${Math.max(o,1)}%`,background:x}}),u&&e.jsx("div",{className:"absolute top-[-1px] w-px h-[4px]",style:{left:`${u}%`,background:te.purple},title:`Rotation at ${u}%`})]}),e.jsxs("span",{className:"text-2xs font-mono text-text-2 tabular-nums flex-shrink-0 w-7 text-right",children:[o,"%"]})]})]})});function NHe({team:t,members:a,rotatingSet:n}){const[s,o]=g.useState(!0),c=a.filter(f=>f.status==="running"||f.status==="starting").length,l=c>0,A=a.reduce((f,x)=>f+(x.tokens||0),0),u=a.reduce((f,x)=>f+(x.costUsd||0),0);return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>o(f=>!f),className:"w-full flex items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-[rgba(51,175,188,0.08)] bg-[rgba(51,175,188,0.05)]",style:{borderLeft:l?`2px solid ${te.accent}`:"2px solid transparent"},children:[s?e.jsx(bt,{size:10,className:"text-text-4 flex-shrink-0"}):e.jsx(Rt,{size:10,className:"text-text-4 flex-shrink-0"}),e.jsx("span",{className:"text-2xs font-mono font-semibold text-text-2 uppercase tracking-widest flex-1 truncate",children:t}),e.jsx("span",{className:"text-2xs font-mono text-text-3 tabular-nums",children:pt(A)}),u>0&&e.jsx("span",{className:"text-2xs font-mono text-text-4 tabular-nums ml-1",children:Ai(u)}),e.jsxs("span",{className:"text-2xs font-mono tabular-nums flex-shrink-0 ml-1.5",style:{color:l?te.accent:void 0},children:[c,"/",a.length]})]}),s&&a.map(f=>e.jsx(CHe,{agent:f,isRotating:n.has(f.id)},f.id))]})}const MHe=g.memo(function({agentBreakdown:a,rotating:n=[],teams:s=[]}){if(!(a!=null&&a.length))return e.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono p-4",children:"No agents"});const o={};for(const A of s)o[A.id]=A.name;const c={};for(const A of a){const u=A.teamId||"ungrouped";c[u]||(c[u]=[]),c[u].push(A)}const l=new Set(n);return e.jsx(it,{className:"flex-1",children:e.jsx("div",{className:"py-1",children:Object.entries(c).map(([A,u])=>e.jsx(NHe,{team:o[A]||(A==="ungrouped"?"Ungrouped":A),members:u,rotatingSet:l},A))})})}),SHe=g.memo(function({data:a}){const n=g.useRef(null),s=g.useRef(null),[o,c]=g.useState({width:0,height:0}),[l,A]=g.useState(null),{width:u,height:f}=o,x={top:28,right:12,bottom:8,left:12},m=Math.max(u-x.left-x.right,0),y=Math.max(f-x.top-x.bottom,0),v=g.useMemo(()=>!a||a.length<2?[]:a.slice(1).map((C,j)=>{const N=a[j],M=(C.t-N.t)/6e4,Q=Math.max((C.tokens||0)-(N.tokens||0),0);return{burnRate:M>0?Math.round(Q/M):0,cacheHitRate:C.cacheHitRate||0,running:C.running||0,agents:C.agents||0,t:C.t}}),[a]);g.useEffect(()=>{const C=n.current;if(!C)return;const j=new ResizeObserver(N=>{const{width:M,height:Q}=N[0].contentRect;M>0&&Q>0&&c({width:Math.floor(M),height:Math.floor(Q)})});return j.observe(C),()=>j.disconnect()},[]);const O=g.useCallback(C=>{const j=s.current;if(!j||!v.length||m<=0)return;const N=j.getBoundingClientRect(),M=C.clientX-N.left-x.left;if(M<0||M>m){A(null);return}const Q=Math.round(M/m*(v.length-1));A({x:x.left+Q/Math.max(v.length-1,1)*m,index:Q})},[v,m,x.left]),b=g.useCallback(()=>A(null),[]);return g.useEffect(()=>{const C=s.current;if(!C||!v.length||u<=0||f<=0||m<=0||y<=0)return;const j=C.getContext("2d"),N=window.devicePixelRatio||1;C.width=u*N,C.height=f*N,j.scale(N,N),j.clearRect(0,0,u,f);const M=v.map(_=>_.burnRate),Q=v.map(_=>_.cacheHitRate),L=v.map(_=>_.running),B=Math.max(...M,100),S=Math.max(...L,1),I=_=>x.left+_/Math.max(v.length-1,1)*m,z=_=>x.top+y-_/B*y,P=_=>x.top+y-_*y,F=Math.max(m/v.length-1,2);for(let _=0;_<v.length;_++){const R=L[_];if(R<=0)continue;const U=R/S*y*.3,Z=I(_)-F/2,J=x.top+y-U;j.fillStyle=qe(te.surface5,.5),j.fillRect(Z,J,F,U)}j.setLineDash([2,4]),j.strokeStyle=qe(te.text4,.2),j.lineWidth=1;for(let _=1;_<=3;_++){const R=x.top+y/4*_;j.beginPath(),j.moveTo(x.left,R),j.lineTo(x.left+m,R),j.stroke()}j.setLineDash([]),j.font="9px 'JetBrains Mono Variable', monospace",j.textAlign="left",j.fillStyle=qe(te.text3,.5),j.fillText(`${pt(B)}/m`,x.left+4,x.top+10),j.fillText(`${pt(Math.round(B/2))}/m`,x.left+4,x.top+y/2+4),j.beginPath(),j.moveTo(x.left,x.top+y);for(let _=0;_<v.length;_++)j.lineTo(I(_),z(M[_]));j.lineTo(I(v.length-1),x.top+y),j.closePath();const K=j.createLinearGradient(0,x.top,0,x.top+y);K.addColorStop(0,qe(te.accent,.2)),K.addColorStop(.7,qe(te.accent,.04)),K.addColorStop(1,qe(te.accent,0)),j.fillStyle=K,j.fill(),j.beginPath(),j.strokeStyle=te.accent,j.lineWidth=1.5,j.lineJoin="round";for(let _=0;_<v.length;_++){const R=I(_),U=z(M[_]);_===0?j.moveTo(R,U):j.lineTo(R,U)}j.stroke();const G=Q.some(_=>_>0);if(G){j.beginPath(),j.strokeStyle=qe(te.info,.45),j.lineWidth=1,j.lineJoin="round",j.setLineDash([2,3]);for(let _=0;_<v.length;_++){const R=I(_),U=P(Q[_]);_===0?j.moveTo(R,U):j.lineTo(R,U)}j.stroke(),j.setLineDash([])}j.font="9px 'Inter Variable', sans-serif",j.textAlign="right";let H=u-x.right-4;const q=14;if(G&&(j.fillStyle=qe(te.info,.5),j.fillText("Cache %",H,q),H-=j.measureText("Cache %").width+4,j.beginPath(),j.arc(H,q-3,2.5,0,Math.PI*2),j.fill(),H-=14),j.fillStyle=qe(te.surface5,.7),j.fillText("Agents",H,q),H-=j.measureText("Agents").width+4,j.beginPath(),j.arc(H,q-3,2.5,0,Math.PI*2),j.fill(),H-=14,j.fillStyle=te.accent,j.fillText("Burn Rate",H,q),H-=j.measureText("Burn Rate").width+4,j.beginPath(),j.arc(H,q-3,2.5,0,Math.PI*2),j.fill(),l&&l.index>=0&&l.index<v.length){const _=l.x,R=v[l.index];j.beginPath(),j.moveTo(_,x.top),j.lineTo(_,x.top+y),j.strokeStyle=qe(te.text1,.15),j.lineWidth=1,j.stroke();const U=z(R.burnRate);j.beginPath(),j.arc(_,U,3,0,Math.PI*2),j.fillStyle=te.accent,j.fill();const Z=[{label:"Burn",value:`${pt(R.burnRate)}/m`,color:te.accent},{label:"Cache",value:us(R.cacheHitRate*100),color:te.info},{label:"Agents",value:`${R.running}/${R.agents}`,color:te.text2}],J=104,Ae=Z.length*16+12;let W=_+12;W+J>u-8&&(W=_-J-12);const ae=Math.max(x.top,U-Ae/2);j.fillStyle=qe(te.surface0,.92),j.beginPath(),j.roundRect(W,ae,J,Ae,4),j.fill(),j.strokeStyle=qe(te.text4,.2),j.lineWidth=1,j.stroke(),j.textAlign="left",Z.forEach((Oe,ve)=>{const ce=ae+14+ve*16;j.beginPath(),j.arc(W+8,ce-3,2,0,Math.PI*2),j.fillStyle=Oe.color,j.fill(),j.font="8px 'Inter Variable', sans-serif",j.fillStyle=te.text3,j.fillText(Oe.label,W+14,ce),j.font="9px 'JetBrains Mono Variable', monospace",j.fillStyle=te.text0,j.textAlign="right",j.fillText(Oe.value,W+J-8,ce),j.textAlign="left"})}},[v,u,f,l,m,y,x]),e.jsx("div",{ref:n,className:"absolute inset-0",children:u>0&&f>0&&e.jsx("canvas",{ref:s,style:{width:u,height:f},className:"block cursor-crosshair",onMouseMove:O,onMouseLeave:b})})}),QHe=g.memo(function({cacheRead:a=0,cacheCreation:n=0,totalInput:s=0,size:o=140}){const c=g.useRef(null),l=a+n,A=l,u=l>0?a/l*100:0;return g.useEffect(()=>{const f=c.current;if(!f)return;const x=window.devicePixelRatio||1;f.width=o*x,f.height=o*x;const m=f.getContext("2d");m.scale(x,x),m.clearRect(0,0,o,o);const y=o/2,v=o/2,O=(o-12)/2,b=5,C=135*Math.PI/180,j=405*Math.PI/180,N=j-C;if(m.beginPath(),m.arc(y,v,O,C,j),m.strokeStyle=te.surface4,m.lineWidth=b,m.lineCap="round",m.stroke(),A>0){const M=a/A,Q=n/A;if(M>0){const L=C+N*M;m.beginPath(),m.arc(y,v,O,C,L),m.strokeStyle=te.accent,m.lineWidth=b,m.lineCap="round",m.stroke()}if(Q>0){const L=C+N*M,B=L+N*Q;m.beginPath(),m.arc(y,v,O,L,B),m.strokeStyle=te.purple,m.lineWidth=b,m.lineCap="butt",m.stroke()}}m.textAlign="center",m.textBaseline="middle",m.font=`600 ${o*.2}px 'JetBrains Mono Variable', monospace`,m.fillStyle=te.text0,m.fillText(`${Math.round(u)}%`,y,v-3),m.font=`500 ${o*.08}px 'JetBrains Mono Variable', monospace`,m.fillStyle=te.text3,m.fillText("CACHE",y,v+o*.13)},[a,n,s,o,A,u]),e.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-3 py-3",children:[e.jsx("canvas",{ref:c,className:"flex-shrink-0",style:{width:o,height:o}}),e.jsxs("div",{className:"w-full mt-3 space-y-1.5 max-w-[160px]",children:[e.jsx(hP,{color:te.accent,label:"Read",value:pt(a)}),e.jsx(hP,{color:te.purple,label:"Create",value:pt(n)}),e.jsx(hP,{color:te.surface5,label:"Miss",value:pt(Math.max(s-a-n,0))})]})]})});function hP({color:t,label:a,value:n}){return e.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:t}}),e.jsx("span",{className:"text-text-3 uppercase tracking-wider flex-1",children:a}),e.jsx("span",{className:"text-text-1 tabular-nums",children:n})]})}const BX={heavy:te.danger,medium:te.warning,light:te.success},_X={heavy:"Heavy",medium:"Medium",light:"Light"},BHe=g.memo(function({routing:a,agentBreakdown:n}){if(!a)return null;const{byTier:s={},totalDecisions:o=0,autoRoutedCount:c=0}=a,l=["heavy","medium","light"],A=l.reduce((m,y)=>m+(s[y]||0),0),u={};for(const m of n||[]){const y=m.model||"default";u[y]||(u[y]={tokens:0,agents:0}),u[y].tokens+=m.tokens||0,u[y].agents+=1}const f=Object.entries(u).sort((m,y)=>y[1].tokens-m[1].tokens),x=f.length>0?f[0][1].tokens:0;return e.jsxs("div",{className:"flex flex-col h-full px-3 py-3 overflow-y-auto",children:[A>0&&e.jsxs("div",{className:"space-y-1.5 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:"Tier Distribution"}),e.jsxs("span",{className:"text-2xs font-mono text-text-4 ml-auto tabular-nums",children:[pt(A)," decisions"]})]}),e.jsx("div",{className:"h-0.5 bg-surface-2 rounded-sm overflow-hidden flex",children:l.map(m=>{const y=s[m]||0;if(y===0)return null;const v=y/A*100;return e.jsx("div",{className:"h-full transition-all duration-500",style:{width:`${v}%`,background:BX[m]},title:`${_X[m]}: ${y} (${Math.round(v)}%)`},m)})}),e.jsx("div",{className:"flex items-center gap-3",children:l.map(m=>{const y=s[m]||0;if(y===0)return null;const v=A>0?y/A*100:0;return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:BX[m]}}),e.jsx("span",{className:"text-2xs font-mono text-text-2",children:_X[m]}),e.jsx("span",{className:"text-2xs font-mono text-text-4 tabular-nums",children:us(v)})]},m)})})]}),f.length>0&&e.jsxs("div",{className:"space-y-1.5 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:"Models in Use"}),c>0&&e.jsxs("span",{className:"text-2xs font-mono text-text-4 ml-auto",children:[c," auto"]})]}),e.jsx("div",{className:"space-y-1.5",children:f.map(([m,y])=>{const v=x>0?y.tokens/x*100:0;return e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-mono text-text-1 flex-1 truncate",children:_He(m)}),e.jsxs("span",{className:"text-2xs font-mono text-text-3 tabular-nums",children:[y.agents," agent",y.agents!==1?"s":""]}),e.jsx("span",{className:"text-xs font-mono text-text-1 tabular-nums",children:pt(y.tokens)})]}),e.jsx("div",{className:"h-0.5 bg-surface-4 rounded-sm overflow-hidden",children:e.jsx("div",{className:"h-full rounded-sm transition-all duration-500",style:{width:`${Math.max(v,2)}%`,background:te.accent}})})]},m)})})]}),A===0&&f.length===0&&e.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono",children:"No routing data"})]})});function _He(t){if(!t||t==="auto"||t==="default")return"Default";const a=t.match(/^claude-(opus|sonnet|haiku)-(\d+)-(\d+)/);return a?`${a[1][0].toUpperCase()}${a[1].slice(1)} ${a[2]}.${a[3]}`:t.startsWith("gemini-")?t.replace("gemini-","Gemini ").replace("-preview",""):t}var RT="Tabs",[LHe]=tr(RT,[IT]),eee=IT(),[THe,Uz]=LHe(RT),tee=g.forwardRef((t,a)=>{const{__scopeTabs:n,value:s,onValueChange:o,defaultValue:c,orientation:l="horizontal",dir:A,activationMode:u="automatic",...f}=t,x=m2(A),[m,y]=Bu({prop:s,onChange:o,defaultProp:c??"",caller:RT});return e.jsx(THe,{scope:n,baseId:zr(),value:m,onValueChange:y,orientation:l,dir:x,activationMode:u,children:e.jsx(Ve.div,{dir:x,"data-orientation":l,...f,ref:a})})});tee.displayName=RT;var aee="TabsList",nee=g.forwardRef((t,a)=>{const{__scopeTabs:n,loop:s=!0,...o}=t,c=Uz(aee,n),l=eee(n);return e.jsx(qY,{asChild:!0,...l,orientation:c.orientation,dir:c.dir,loop:s,children:e.jsx(Ve.div,{role:"tablist","aria-orientation":c.orientation,...o,ref:a})})});nee.displayName=aee;var see="TabsTrigger",ree=g.forwardRef((t,a)=>{const{__scopeTabs:n,value:s,disabled:o=!1,...c}=t,l=Uz(see,n),A=eee(n),u=cee(l.baseId,s),f=lee(l.baseId,s),x=s===l.value;return e.jsx(DY,{asChild:!0,...A,focusable:!o,active:x,children:e.jsx(Ve.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":f,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...c,ref:a,onMouseDown:Se(t.onMouseDown,m=>{!o&&m.button===0&&m.ctrlKey===!1?l.onValueChange(s):m.preventDefault()}),onKeyDown:Se(t.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&l.onValueChange(s)}),onFocus:Se(t.onFocus,()=>{const m=l.activationMode!=="manual";!x&&!o&&m&&l.onValueChange(s)})})})});ree.displayName=see;var oee="TabsContent",iee=g.forwardRef((t,a)=>{const{__scopeTabs:n,value:s,forceMount:o,children:c,...l}=t,A=Uz(oee,n),u=cee(A.baseId,s),f=lee(A.baseId,s),x=s===A.value,m=g.useRef(x);return g.useEffect(()=>{const y=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(y)},[]),e.jsx(Za,{present:o||x,children:({present:y})=>e.jsx(Ve.div,{"data-state":x?"active":"inactive","data-orientation":A.orientation,role:"tabpanel","aria-labelledby":u,hidden:!y,id:f,tabIndex:0,...l,ref:a,style:{...t.style,animationDuration:m.current?"0s":void 0},children:y&&c})})});iee.displayName=oee;function cee(t,a){return`${t}-trigger-${a}`}function lee(t,a){return`${t}-content-${a}`}var $He=tee,IHe=nee,UHe=ree,PHe=iee;function Pz({children:t,...a}){return e.jsx($He,{...a,children:t})}function Ez({children:t,className:a,...n}){return e.jsx(IHe,{className:V("flex items-center gap-0 border-b border-border-subtle",a),...n,children:t})}function ys({children:t,className:a,...n}){return e.jsx(UHe,{className:V("px-3 py-2 text-sm font-medium font-sans text-text-2","border-b-2 border-transparent","hover:text-text-0 hover:bg-surface-5/50","data-[state=active]:text-text-0 data-[state=active]:border-accent","transition-colors duration-100 cursor-pointer select-none","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",a),...n,children:t})}function vs({children:t,className:a,...n}){return e.jsx(PHe,{className:V("flex-1 min-h-0",a),...n,children:t})}function LX({data:t,color:a=te.accent,width:n=60,height:s=16}){if(!t||t.length<2)return e.jsx("div",{style:{width:n,height:s}});const o=Array.isArray(t[0])?t:t.map(f=>typeof f=="number"?f:f.v),c=Math.min(...o),A=Math.max(...o)-c||1,u=o.map((f,x)=>{const m=x/(o.length-1)*n,y=s-(f-c)/A*(s-2)-1;return`${m},${y}`}).join(" ");return e.jsx("svg",{width:n,height:s,className:"flex-shrink-0",children:e.jsx("polyline",{points:u,fill:"none",stroke:a,strokeWidth:"1",strokeLinejoin:"round",strokeOpacity:"0.7"})})}function Xs({text:t,side:a="bottom"}){return e.jsx(Nt,{content:e.jsx("span",{className:"max-w-[220px] block leading-relaxed",children:t}),side:a,children:e.jsx(Na,{size:10,className:"text-text-4 hover:text-text-2 cursor-help flex-shrink-0 transition-colors inline-block ml-1"})})}function zz(t){return t==null?te.text3:t>=70?"#4ae168":t>=40?"#e5c07b":"#e06c75"}function Ro({label:t,value:a,danger:n}){return a==null||a===0?null:e.jsxs("span",{className:"text-2xs font-mono px-1.5 py-px rounded-sm bg-surface-4 text-text-3",children:[t,": ",e.jsx("span",{style:{color:n?"#e06c75":te.text1},children:a})]})}function EHe({score:t}){const a=Math.max(0,Math.min(100,t||0)),n=zz(t);return e.jsx("div",{className:"h-0.5 rounded-sm overflow-hidden flex-1",style:{background:"rgba(51,175,188,0.08)"},children:e.jsx("div",{className:"h-full rounded-sm transition-all duration-700",style:{width:`${a}%`,background:n}})})}function pP({label:t,value:a,total:n,color:s}){const o=n>0?a/n*100:0;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-mono text-text-2",children:t}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs font-mono font-semibold tabular-nums",style:{color:s},children:[o>=1?Math.round(o):o>0?o.toFixed(1):0,"%"]}),e.jsx("span",{className:"text-2xs font-mono text-text-3 tabular-nums w-10 text-right",children:pt(a)})]})]}),e.jsx("div",{className:"h-0.5 rounded-sm overflow-hidden",style:{background:"rgba(51,175,188,0.08)"},children:e.jsx("div",{className:"h-full rounded-sm transition-all duration-500",style:{width:`${Math.min(o,100)}%`,background:s}})})]})}function zHe({tokens:t,rotation:a,agentBreakdown:n}){var y,v,O;const s=((a==null?void 0:a.history)||[]).slice(-10).reverse(),o=(a==null?void 0:a.liveScores)||{},c=(n||[]).filter(b=>b.status==="running"),l=n||[],A=l.filter(b=>{var C;return((C=b.quality)==null?void 0:C.score)!=null}),u=A.length>0?Math.round(A.reduce((b,C)=>b+C.quality.score,0)/A.length):null,f=l.filter(b=>b.status==="completed"||b.status==="stopped").length,x=l.filter(b=>b.status==="crashed").length,m=f+x>0?Math.round(f/(f+x)*100):100;return e.jsxs("div",{className:"p-3 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Quality",e.jsx(Xs,{text:"Average session quality score (0-100). Based on error rate, tool failures, repetitions, and file churn. Below 40 triggers auto-rotation to prevent wasted tokens."})]}),e.jsx("div",{className:"text-base font-mono font-bold text-text-1 tabular-nums leading-none",children:u??"—"})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Rotations",e.jsx(Xs,{text:"Context rotations: quality-based (q), context threshold (c), and natural compactions (n) from provider-managed context resets. Each rotation preserves progress via a journalist handoff brief."})]}),e.jsx("div",{className:"text-base font-mono font-bold text-text-1 tabular-nums leading-none",children:(a==null?void 0:a.totalRotations)||0}),((a==null?void 0:a.qualityRotations)>0||(a==null?void 0:a.contextRotations)>0||(a==null?void 0:a.naturalCompactions)>0)&&e.jsxs("div",{className:"text-2xs font-mono text-text-4 mt-0.5",children:[a.qualityRotations||0,"q / ",a.contextRotations||0,"c / ",a.naturalCompactions||0,"n"]})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Cache",e.jsx(Xs,{text:"Prompt cache hit rate. Cache reads are ~90% cheaper than regular input tokens. Managed by your AI provider — GROOVE tracks it, doesn't control it."})]}),e.jsx("div",{className:"text-base font-mono font-bold text-text-1 tabular-nums leading-none",children:us(((t==null?void 0:t.cacheHitRate)||0)*100)})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Success",e.jsx(Xs,{text:"Agent completion rate. Completed agents vs. crashed agents. High success rate means agents are finishing tasks without errors."})]}),e.jsxs("div",{className:"text-base font-mono font-bold text-text-1 tabular-nums leading-none",children:[m,"%"]})]})]}),c.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-2",children:"Live Agent Quality"}),e.jsx("div",{className:"space-y-2",children:c.map(b=>{const C=b.quality||{},j=o[b.id],N=(j==null?void 0:j.score)??C.score,M=On(b.role);return e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("span",{className:"text-2xs font-mono font-semibold capitalize px-1.5 py-px rounded-sm",style:{background:M.bg,color:M.text},children:b.role}),e.jsx("span",{className:"text-xs font-mono text-text-1 truncate flex-1",children:b.name}),e.jsx("span",{className:"text-sm font-mono font-bold tabular-nums",style:{color:zz(N)},children:N??"—"})]}),e.jsx(EHe,{score:N}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:[e.jsx(Ro,{label:"Errors",value:C.errorCount,danger:!0}),e.jsx(Ro,{label:"Reps",value:C.repetitions,danger:!0}),e.jsx(Ro,{label:"Churn",value:C.fileChurn,danger:!0}),e.jsx(Ro,{label:"Tools",value:C.toolCalls}),e.jsx(Ro,{label:"Files",value:C.filesWritten}),C.toolCalls>0&&e.jsxs("span",{className:"text-2xs font-mono px-1.5 py-px rounded-sm bg-surface-4 text-text-3",children:["Success: ",e.jsxs("span",{style:{color:C.toolSuccessRate>=.8?"#4ae168":"#e5c07b"},children:[Math.round(C.toolSuccessRate*100),"%"]})]}),C.eventCount>0&&e.jsxs("span",{className:"text-2xs font-mono px-1.5 py-px rounded-sm bg-surface-4 text-text-3",children:["Events: ",e.jsx("span",{className:"text-text-2",children:C.eventCount})]})]})]},b.id)})})]}),((y=t==null?void 0:t.internalOverhead)==null?void 0:y.tokens)>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider flex items-center",children:["GROOVE Overhead",e.jsx(Xs,{text:"Tokens consumed by GROOVE's own coordination: the Journalist (synthesis), PM (approval gates), Planner, Task Negotiator, Gateway, and user Q&A. Previously invisible — now tracked for honest ROI."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-2xs font-mono text-text-2 tabular-nums",children:[pt(t.internalOverhead.tokens)," tokens"]}),e.jsx("span",{className:"text-2xs font-mono text-text-3 tabular-nums",children:Ai(t.internalOverhead.costUsd||0)}),t.totalTokens>0&&e.jsxs("span",{className:"text-2xs font-mono font-semibold tabular-nums",style:{color:te.purple},children:[Math.round(t.internalOverhead.tokens/t.totalTokens*100),"%"]})]})]}),e.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:Object.entries(t.internalOverhead.components||{}).sort((b,C)=>(C[1].tokens||0)-(b[1].tokens||0)).slice(0,6).map(([b,C])=>{const j=b.replace(/^__|__$/g,"").replace(/_/g," ");return e.jsxs("div",{className:"bg-surface-0 rounded px-2 py-1.5",children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider truncate",children:j}),e.jsx("div",{className:"text-xs font-mono text-text-1 tabular-nums font-semibold",children:pt(C.tokens||0)})]},b)})})]}),(((v=t==null?void 0:t.savings)==null?void 0:v.total)||0)>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider flex items-center",children:["Coordination Savings",e.jsx(Xs,{text:"Tokens saved vs. uncoordinated agents. Rotation savings are estimated from context degradation (pre/post velocity measurement underway). Conflict prevention and cold-start skip use fixed-overhead models. Compare against GROOVE Overhead above for honest ROI."})]}),e.jsxs("span",{className:"text-2xs font-mono text-text-2 tabular-nums",children:[pt(t.savings.total)," tokens"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(pP,{label:"Cold-start skip",value:t.savings.fromColdStartSkip||0,total:t.savings.total||1,color:te.info}),e.jsxs("div",{className:"text-2xs font-mono text-text-4 pl-2",children:["estimated · ",(((O=t==null?void 0:t.savings)==null?void 0:O.fromColdStartSkip)||0)>0?"fixed overhead per skip":""]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(pP,{label:"Rotation",value:t.savings.fromRotation||0,total:t.savings.total||1,color:te.accent}),e.jsx("div",{className:"text-2xs font-mono text-text-4 pl-2",children:"estimated · velocity measurement accumulating"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(pP,{label:"Conflict prevention",value:t.savings.fromConflictPrevention||0,total:t.savings.total||1,color:"#4ec9d4"}),e.jsx("div",{className:"text-2xs font-mono text-text-4 pl-2",children:"estimated · fixed overhead per conflict"})]})]})]}),s.length>0?e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-2.5",children:"Recent Rotations"}),e.jsx("div",{className:"space-y-0",children:s.map((b,C)=>{var B,S;const j=b.reason==="quality_degradation",N=b.reason==="natural_compaction",M=b.reason==="token_limit_exceeded",Q=b.reason==="runaway_velocity",L=M?"#e06c75":Q?"#ff8c42":j?"#e5c07b":N?"#c678dd":"#33afbc";return e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[e.jsx("div",{className:"h-1.5"}),e.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:C===0?L:`${L}25`,border:`1px solid ${L}80`,boxShadow:C===0?`0 0 6px ${L}60`:"none"}}),C<s.length-1&&e.jsx("div",{className:"w-px flex-1 mt-1",style:{background:"rgba(51,175,188,0.15)",minHeight:"12px"}})]}),e.jsx("div",{className:V("flex-1 bg-surface-0 rounded px-2 py-1.5",C<s.length-1&&"mb-2"),children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-mono text-text-1 font-medium capitalize truncate flex-1",children:b.agentName||b.role}),M?e.jsxs("span",{className:"text-2xs font-mono font-semibold tabular-nums flex-shrink-0",style:{color:"#e06c75"},title:`Auto-rotated: agent burned ${(B=b.instanceTokens)==null?void 0:B.toLocaleString()} tokens in one session`,children:["T:",us((b.instanceTokens||0)/1e6*100).replace("%","M")]}):Q?e.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsxs("span",{className:"text-2xs font-mono font-semibold tabular-nums",style:{color:"#ff8c42"},title:`Auto-rotated: runaway velocity (${(S=b.velocity)==null?void 0:S.toLocaleString()} tokens in recent window)`,children:["V:",us((b.velocity||0)/1e6*100).replace("%","M")]}),b.velocityDelta!=null&&b.velocityDelta>0&&e.jsxs("span",{className:"text-2xs font-mono tabular-nums",style:{color:"#4ae168"},title:`Post-rotation velocity dropped by ${b.velocityDelta.toLocaleString()} tokens — rotation worked`,children:["↓",us(b.velocityDelta/1e6*100).replace("%","M")]})]}):j?e.jsxs("span",{className:"text-2xs font-mono font-semibold tabular-nums flex-shrink-0",style:{color:"#e5c07b"},children:["Q:",b.qualityScore]}):N?e.jsxs("span",{className:"text-2xs font-mono font-semibold tabular-nums flex-shrink-0",style:{color:"#c678dd"},children:[us((b.contextUsage||0)*100)," → ",us((b.contextAfter||0)*100)]}):e.jsx("span",{className:"text-2xs font-mono font-semibold tabular-nums flex-shrink-0",style:{color:(b.contextUsage||0)>.8?"#e06c75":"#33afbc"},children:us((b.contextUsage||0)*100)}),e.jsx("span",{className:"text-2xs font-mono text-text-4 flex-shrink-0",children:Mt(b.timestamp)})]})})]},C)})})]}):e.jsxs("div",{className:"bg-surface-0 rounded p-3 text-center space-y-1.5",children:[e.jsx("div",{className:"text-xs font-mono text-text-2 font-semibold",children:"Monitoring for degradation"}),e.jsx("div",{className:"text-2xs font-mono text-text-3 leading-relaxed",children:"Auto-rotation triggers when session quality drops below 40 (errors, repetitions, file churn) or context exceeds the adaptive threshold."})]})]})}function FHe({adaptive:t}){if(!(t!=null&&t.length))return e.jsx("div",{className:"p-3",children:e.jsxs("div",{className:"bg-surface-0 rounded p-4 text-center space-y-2",children:[e.jsx("div",{className:"text-xs font-mono text-text-2 font-semibold",children:"No adaptive profiles yet"}),e.jsx("div",{className:"text-2xs font-mono text-text-3 leading-relaxed",children:"Adaptive thresholds learn when each agent role benefits from rotation. GROOVE tracks quality scores and adjusts rotation triggers automatically — converging to the optimal threshold per role and provider."})]})});function a(n){const s=n.split(":");return{provider:s[0]||n,role:s[1]||""}}return e.jsx("div",{className:"p-3 space-y-3",children:t.map(n=>{var x,m;const{provider:s,role:o}=a(n.key),c=o||s,l=((x=n.thresholdHistory)==null?void 0:x.length)>1,A=((m=n.recentScores)==null?void 0:m.length)>1,u=On(c),f=n.lastSignals;return e.jsxs("div",{className:"rounded overflow-hidden",style:{background:"rgba(51,175,188,0.04)",borderLeft:n.converged?"2px solid #33afbc":"2px solid rgba(229,192,123,0.35)"},children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 pt-2.5 pb-1.5",children:[e.jsx("span",{className:"text-xs font-mono font-semibold capitalize px-1.5 py-px rounded-sm",style:{background:u.bg,color:u.text},children:c}),o&&e.jsx("span",{className:"text-2xs font-mono text-text-4 bg-surface-4 px-1.5 py-px rounded-sm",children:s}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"flex items-center gap-1 text-2xs font-mono font-bold px-2 py-px rounded-full",style:{background:n.converged?"rgba(74,225,104,0.12)":"rgba(229,192,123,0.12)",color:n.converged?"#4ae168":"#e5c07b"},children:[!n.converged&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:"#e5c07b",animation:"node-pulse-bar 1.5s ease-in-out infinite"}}),n.converged?"Converged":"Learning"]})]}),e.jsxs("div",{className:"flex items-end gap-5 px-3 pb-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider mb-0.5",children:"Threshold"}),e.jsx("div",{className:"text-3xl font-mono font-bold tabular-nums leading-none",style:{color:n.converged?"#33afbc":"#e5c07b"},children:us(n.threshold*100)})]}),e.jsxs("div",{className:"pb-0.5",children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider mb-0.5",children:"Adj."}),e.jsx("div",{className:"text-lg font-mono font-semibold text-text-1 tabular-nums",children:n.adjustments})]})]}),(l||A)&&e.jsxs("div",{className:"px-3 pb-2 space-y-2 overflow-hidden",children:[l&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 mb-0.5",children:"Threshold history"}),e.jsx(LX,{data:n.thresholdHistory.map(y=>y.v),color:n.converged?te.accent:te.warning,width:240,height:32})]}),A&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 mb-0.5",children:"Quality score"}),e.jsx(LX,{data:n.recentScores,color:te.warning,width:240,height:24})]})]}),f&&e.jsxs("div",{className:"flex flex-wrap gap-1.5 px-3 pb-2.5",children:[e.jsx(Ro,{label:"Errors",value:f.errorCount,danger:!0}),e.jsx(Ro,{label:"Reps",value:f.repetitions,danger:!0}),e.jsx(Ro,{label:"Churn",value:f.fileChurn,danger:!0}),f.toolSuccessRate!=null&&e.jsxs("span",{className:"text-2xs font-mono px-1.5 py-px rounded-sm bg-surface-4 text-text-3",children:["Tools: ",e.jsxs("span",{className:"text-text-1",children:[Math.round(f.toolSuccessRate*100),"%"]})]})]})]},n.key)})})}function RHe({journalist:t}){var a;return t?e.jsxs("div",{className:"p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5",children:"Cycles"}),e.jsx("div",{className:"text-lg font-mono font-semibold text-text-0 tabular-nums leading-none",children:t.cycleCount||0})]}),t.lastCycleAt&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5",children:"Last"}),e.jsx("div",{className:"text-xs font-mono text-text-2",children:Mt(t.lastCycleAt)})]}),t.synthesizing&&e.jsx("span",{className:"text-2xs font-mono font-bold text-accent uppercase tracking-wider animate-pulse",children:"Synthesizing"})]}),t.lastSummary&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1",children:"Summary"}),e.jsx("div",{className:"text-xs font-sans text-text-2 leading-relaxed",children:t.lastSummary})]}),t.projectMap&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1",children:"Project Map"}),e.jsx("div",{className:"text-xs font-mono text-text-2 leading-relaxed whitespace-pre-wrap",children:t.projectMap})]}),t.decisions&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1",children:"Decisions"}),e.jsx("div",{className:"text-xs font-mono text-text-2 leading-relaxed whitespace-pre-wrap",children:t.decisions})]}),((a=t.recentHistory)==null?void 0:a.length)>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1.5",children:"History"}),e.jsx("div",{className:"space-y-1",children:t.recentHistory.slice().reverse().map((n,s)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono px-2 py-1 bg-surface-0 rounded",children:[e.jsxs("span",{className:"text-text-3",children:["#",n.cycle]}),e.jsxs("span",{className:"text-text-2 flex-1 truncate",children:[n.agentCount," agents"]}),e.jsx("span",{className:"text-text-4",children:Mt(n.timestamp)})]},s))})]})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono p-4",children:"Journalist inactive"})}function HHe({memory:t}){var f,x;const a=(t==null?void 0:t.constraints)||[],n=(t==null?void 0:t.discoveries)||[],s=(t==null?void 0:t.roles)||[],o=((f=t==null?void 0:t.specializations)==null?void 0:f.perAgent)||{},c=((x=t==null?void 0:t.specializations)==null?void 0:x.perProjectRole)||{},l=Object.keys(o).length,A=Object.keys(c).length;return a.length+n.length+s.length===0&&l===0?e.jsxs("div",{className:"p-6 text-center text-xs font-mono text-text-3",children:[e.jsx(Go,{size:24,className:"mx-auto mb-2 text-text-4"}),e.jsx("div",{children:"No memory accumulated yet"}),e.jsx("div",{className:"text-2xs text-text-4 mt-1",children:"Constraints, handoff chains, and discoveries populate as agents work"})]}):e.jsxs("div",{className:"p-3 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Constraints",e.jsx(Xs,{text:"Project rules discovered by agents or set by the user. Every new agent reads these on spawn to avoid rediscovering them."})]}),e.jsx("div",{className:"text-2xl font-mono font-bold tabular-nums leading-none",style:{color:te.accent},children:a.length})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Discoveries",e.jsx(Xs,{text:"Error→fix pairs successful agents have recorded. Injected into future agent context so they don't rediscover known solutions."})]}),e.jsx("div",{className:"text-2xl font-mono font-bold tabular-nums leading-none",style:{color:te.success},children:n.length})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Handoff Chains",e.jsx(Xs,{text:"Cumulative rotation briefs per role. Agent #50 knows what agent #1 struggled with. Each role keeps its last 10 rotation briefs."})]}),e.jsx("div",{className:"text-2xl font-mono font-bold tabular-nums leading-none",style:{color:te.purple},children:s.length})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Specializations",e.jsx(Xs,{text:"Per-agent quality profiles: session counts, average quality, file touches, preferred thresholds."})]}),e.jsx("div",{className:"text-2xl font-mono font-bold tabular-nums leading-none",style:{color:te.info},children:l}),A>0&&e.jsxs("div",{className:"text-2xs font-mono text-text-4 mt-0.5",children:["across ",A," roles"]})]})]}),a.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-2",children:"Project Constraints"}),e.jsxs("div",{className:"space-y-1",children:[a.slice(0,10).map(m=>e.jsxs("div",{className:"flex items-start gap-2 bg-surface-0 rounded px-2 py-1.5",children:[e.jsx("span",{className:"text-2xs font-mono px-1.5 py-px rounded-sm bg-surface-4 text-text-3 uppercase tracking-wider flex-shrink-0 mt-0.5",children:m.category}),e.jsx("span",{className:"text-xs font-mono text-text-2 leading-relaxed flex-1",children:m.text})]},m.hash)),a.length>10&&e.jsxs("div",{className:"text-2xs font-mono text-text-4 px-2",children:["+",a.length-10," more"]})]})]}),n.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-2",children:"Recent Discoveries"}),e.jsx("div",{className:"space-y-1.5",children:n.slice(0,8).map((m,y)=>{const v=On(m.role);return e.jsxs("div",{className:"bg-surface-0 rounded px-2 py-1.5 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-2xs font-mono font-semibold capitalize px-1.5 py-px rounded-sm",style:{background:v.bg,color:v.text},children:m.role}),e.jsx("span",{className:"text-2xs font-mono text-text-4 flex-1",children:Mt(m.ts)})]}),e.jsxs("div",{className:"text-xs font-mono text-text-2 leading-relaxed",children:[e.jsx("span",{className:"text-text-4",children:"When:"})," ",e.jsx("span",{className:"text-text-1",children:m.trigger})]}),e.jsxs("div",{className:"text-xs font-mono text-text-2 leading-relaxed",children:[e.jsx("span",{className:"text-text-4",children:"Fix:"})," ",e.jsx("span",{style:{color:te.success},children:m.fix})]})]},y)})})]}),s.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-2",children:"Active Role Chains"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(m=>{const y=On(m);return e.jsx("span",{className:"text-2xs font-mono font-semibold capitalize px-2 py-1 rounded",style:{background:y.bg,color:y.text},children:m},m)})})]}),A>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-2",children:"Role Quality Profiles"}),e.jsx("div",{className:"space-y-1",children:Object.entries(c).map(([m,y])=>{const v=On(m);return e.jsxs("div",{className:"flex items-center gap-2 bg-surface-0 rounded px-2 py-1.5",children:[e.jsx("span",{className:"text-2xs font-mono font-semibold capitalize px-1.5 py-px rounded-sm",style:{background:v.bg,color:v.text},children:m}),e.jsxs("span",{className:"text-xs font-mono text-text-3 flex-1",children:[y.sessionCount," sessions"]}),e.jsxs("span",{className:"text-xs font-mono font-semibold tabular-nums",style:{color:zz(y.avgQualityScore)},children:["Q:",y.avgQualityScore]})]},m)})})]})]})}const qHe=g.memo(function({tokens:a,rotation:n,adaptive:s,journalist:o,agentBreakdown:c,memory:l}){return e.jsxs(Pz,{defaultValue:"health",className:"flex flex-col h-full",children:[e.jsxs(Ez,{className:"flex-shrink-0 px-1",children:[e.jsxs(ys,{value:"health",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[e.jsx(Ys,{size:11}),"Health"]}),e.jsxs(ys,{value:"memory",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[e.jsx(Go,{size:11}),"Memory"]}),e.jsxs(ys,{value:"adaptive",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[e.jsx(A0,{size:11}),"Adaptive"]}),e.jsxs(ys,{value:"journalist",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[e.jsx(Jn,{size:11}),"Journalist"]})]}),e.jsx(vs,{value:"health",className:"flex-1 min-h-0 relative",children:e.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:e.jsx(zHe,{tokens:a,rotation:n,agentBreakdown:c})})}),e.jsx(vs,{value:"memory",className:"flex-1 min-h-0 relative",children:e.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:e.jsx(HHe,{memory:l})})}),e.jsx(vs,{value:"adaptive",className:"flex-1 min-h-0 relative",children:e.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:e.jsx(FHe,{adaptive:s})})}),e.jsx(vs,{value:"journalist",className:"flex-1 min-h-0 relative",children:e.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:e.jsx(RHe,{journalist:o})})})]})}),DHe=g.memo(function({teams:a=[]}){const n=a.reduce((o,c)=>o+(c.totalTokens||0),0),s=a.reduce((o,c)=>Math.max(o,c.totalTokens||0),0);return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0 flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Team Burn"}),e.jsxs("span",{className:"text-2xs font-mono text-text-3",children:[pt(n)," total"]})]}),e.jsx(it,{className:"flex-1 min-h-0",children:a.length===0?e.jsx("div",{className:"px-3 py-6 text-center text-xs text-text-3 font-mono",children:"No team activity yet"}):e.jsx("div",{className:"px-3 py-3 space-y-3",children:a.map(o=>{const c=s>0?o.totalTokens/s*100:0;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:o.teamName}),o.isDefault&&e.jsx("span",{className:"text-[9px] font-mono text-text-3 uppercase tracking-wider",children:"default"}),e.jsxs("span",{className:"text-2xs font-mono text-text-3 flex-shrink-0",children:[o.agentCount," ",o.agentCount===1?"agent":"agents"]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 font-mono text-2xs",children:[e.jsx("span",{className:"text-text-1",children:pt(o.totalTokens)}),e.jsx("span",{className:"text-text-3",children:Ai(o.totalCostUsd)})]})]}),e.jsx("div",{className:"h-0.5 bg-surface-2 rounded-sm overflow-hidden",children:e.jsx("div",{className:"h-full rounded-sm transition-all",style:{width:`${c}%`,background:te.accent}})})]},o.teamId)})})})]})}),VHe={spawn:bu,complete:Sa,crash:Gt,kill:qn,rotate:Vr,error:$A},XHe={spawn:"text-accent",complete:"text-success",crash:"text-danger",kill:"text-text-3",rotate:"text-purple",error:"text-danger"};function ZHe(t){const a=t.agentName||t.role||"";switch(t.type){case"spawn":return`${a} spawned`;case"complete":return`${a} completed`;case"crash":return`${a} crashed`;case"kill":return`${a} killed`;case"rotate":return`${a} rotated`;default:return t.text||t.type||"event"}}const GHe=g.memo(function({events:a=[]}){return a.length?e.jsx("div",{className:"flex items-center gap-3 overflow-x-auto py-2 px-3",children:a.slice(-15).reverse().map((n,s)=>{const o=VHe[n.type]||wt,c=XHe[n.type]||"text-text-3",l=ZHe(n);return e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx(o,{size:11,className:c}),e.jsx("span",{className:"text-xs font-sans text-text-2 whitespace-nowrap",children:l}),e.jsx("span",{className:"text-2xs font-mono text-text-4",children:Mt(n.t||n.timestamp)})]},s)})}):e.jsx("div",{className:"text-xs text-text-3 font-mono py-2.5 text-center",children:"No recent activity"})});function Xn({className:t,...a}){return e.jsx("div",{className:V("rounded-md bg-surface-4","bg-gradient-to-r from-surface-4 via-surface-5 to-surface-4","bg-[length:200%_100%] animate-[shimmer_1.5s_ease-in-out_infinite]",t),...a})}function WHe(){return e.jsxs("div",{className:"flex-1 grid gap-px p-0",style:{gridTemplateRows:"auto minmax(0, 1fr) minmax(0, 1fr)",gridTemplateColumns:"2fr 2.5fr 1.5fr",background:"#282c34"},children:[e.jsx("div",{className:"col-span-3",children:e.jsx(Xn,{className:"h-[72px] rounded-none"})}),e.jsx(Xn,{className:"rounded-none"}),e.jsx(Xn,{className:"rounded-none"}),e.jsx(Xn,{className:"rounded-none"}),e.jsx(Xn,{className:"rounded-none"}),e.jsx("div",{className:"col-span-2",children:e.jsx(Xn,{className:"h-full rounded-none"})})]})}function KHe(){const{data:t,loading:a,agents:n,connected:s,kpiHistory:o,lastFetch:c,agentBreakdown:l,routing:A,rotation:u,adaptive:f,journalist:x,rotating:m,teamBurn:y,memory:v}=vHe(),O=$(P=>P.teams),b=n.filter(P=>P.status==="running").length;if(!s)return e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-2 text-text-3 font-mono",children:[e.jsx(hs,{size:28,className:"mx-auto"}),e.jsx("p",{className:"text-xs",children:"Connecting to daemon..."})]})});if(a||!t)return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(QX,{connected:s,runningCount:0,totalCount:0,uptime:0,lastFetch:0}),e.jsx(WHe,{})]});const C=t.tokens||{},j={totalTokens:C.totalTokens||0,totalCostUsd:C.totalCostUsd||0,totalInputTokens:C.totalInputTokens||0,totalOutputTokens:C.totalOutputTokens||0,cacheReadTokens:C.cacheReadTokens||0,cacheCreationTokens:C.cacheCreationTokens||0,cacheHitRate:C.cacheHitRate||0,totalTurns:C.totalTurns||0,agentCount:C.agentCount||0,savings:C.savings||{},internalOverhead:C.internalOverhead||{tokens:0,costUsd:0,components:{}}},N=j.totalOutputTokens>0?(j.totalInputTokens/j.totalOutputTokens).toFixed(1):"—",M=(u==null?void 0:u.totalRotations)||0,Q=(l||[]).filter(P=>{var F;return((F=P.quality)==null?void 0:F.score)!=null}),L=Q.length>0?Math.round(Q.reduce((P,F)=>P+F.quality.score,0)/Q.length):null,B=t.timeline||{},S=B.snapshots||[],I=B.events||t.events||[],z=[{label:"Tokens Used",value:pt(j.totalTokens),sparkData:o.tokens,color:te.accent,hint:"Total tokens consumed across all agents — input, output, and cache tokens combined."},{label:"Total Cost",value:Ai(j.totalCostUsd),sparkData:o.cost,color:te.warning,hint:"Actual cost reported by providers. Claude Code reports real billing; other providers use estimated rates."},{label:"Quality",value:L!=null?`${L}`:"—",sparkData:o.saved,color:L>=70?te.success:L>=40?te.warning:te.danger,hint:"Average session quality score (0-100) across running agents. Based on error rate, repetitions, file churn, and tool success. Below 40 triggers auto-rotation."},{label:"Cache Rate",value:us(j.cacheHitRate*100),sparkData:o.cache,color:te.info,hint:"Percentage of input tokens served from prompt cache. Higher = faster responses and lower cost. Managed by your AI provider."},{label:"Rotations",value:`${M}`,sparkData:o.efficiency,color:te.purple,hint:"Total context rotations — includes quality-based (auto), context threshold, natural compaction (provider-managed), and manual rotations."},{label:"I/O Ratio",value:`${N}:1`,sparkData:o.inputOutput,color:te.orange,hint:"Ratio of input to output tokens. High ratios mean agents are reading more than writing — common for analysis tasks."},{label:"Agents",value:`${b}/${n.length}`,sparkData:o.agents,color:te.accent,hint:"Running agents out of total spawned this session (including completed and crashed)."},{label:"Turns",value:pt(j.totalTurns),sparkData:o.turns,color:te.text2,hint:"Total conversation turns across all agents. Each turn is one request-response cycle with the AI provider."}];return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(QX,{connected:s,runningCount:b,totalCount:n.length,uptime:t.uptime||0,lastFetch:c,activeTeam:t.activeTeam}),e.jsx(bHe,{kpis:z}),e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",style:{background:"#282c34",gap:"1px"},children:[e.jsxs("div",{className:"min-h-0 flex-1 grid",style:{gridTemplateColumns:"3fr 1.5fr 1.5fr",gap:"0 1px"},children:[e.jsx("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 relative",children:e.jsx(SHe,{data:S})}),e.jsxs("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-l border-border",children:[e.jsx("div",{className:"px-3 pt-2.5 pb-1",children:e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Cache Performance"})}),e.jsx(QHe,{cacheRead:j.cacheReadTokens,cacheCreation:j.cacheCreationTokens,totalInput:j.totalInputTokens})]}),e.jsxs("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-l border-border",children:[e.jsx("div",{className:"px-3 pt-2.5 pb-1",children:e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Model Routing"})}),e.jsx(BHe,{routing:A,agentBreakdown:l})]})]}),e.jsxs("div",{className:"min-h-0 flex-1 grid",style:{gridTemplateColumns:"2fr 2.5fr 1.5fr",gap:"0 1px"},children:[e.jsxs("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-t border-border",children:[e.jsx("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0",children:e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Agent Fleet"})}),e.jsx(MHe,{agentBreakdown:l,rotating:m,teams:O})]}),e.jsx("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-t border-l border-border",children:e.jsx(qHe,{tokens:j,rotation:u,adaptive:f,journalist:x,agentBreakdown:l,memory:v})}),e.jsx("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-t border-l border-border",children:e.jsx(DHe,{teams:y})})]})]}),e.jsx("div",{className:"flex-shrink-0 bg-surface-1 border-t border-border",children:e.jsx(GHe,{events:I})})]})}const TX={sm:12,md:16,lg:20};function YHe({fill:t="full",size:a,color:n="#fbbf24",emptyColor:s="rgba(255,255,255,0.4)"}){const o=`star-${Math.random().toString(36).slice(2,8)}`;return e.jsxs("svg",{width:a,height:a,viewBox:"0 0 20 20",fill:"none",children:[t==="half"&&e.jsx("defs",{children:e.jsxs("linearGradient",{id:o,children:[e.jsx("stop",{offset:"50%",stopColor:n}),e.jsx("stop",{offset:"50%",stopColor:s})]})}),e.jsx("path",{d:"M10 1.5l2.47 5.01 5.53.8-4 3.9.94 5.49L10 14.27 5.06 16.7 6 11.21l-4-3.9 5.53-.8L10 1.5z",fill:t==="full"?n:t==="half"?`url(#${o})`:s})]})}function dee({rating:t=0,count:a,size:n="sm"}){const s=TX[n]||TX.sm,o=[];for(let c=1;c<=5;c++)t>=c?o.push("full"):t>=c-.5?o.push("half"):o.push("empty");return e.jsxs("span",{className:"inline-flex items-center",style:{gap:1},children:[o.map((c,l)=>e.jsx(YHe,{fill:c,size:s},l)),a!=null&&e.jsxs("span",{className:"ml-1 text-[11px] text-[var(--text-dim,#6b7f95)] font-sans",children:["(",a,")"]})]})}const $X={design:{color:"#c678dd",bg:"rgba(198,120,221,0.12)"},quality:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},devtools:{color:"#33afbc",bg:"rgba(51,175,188,0.14)"},workflow:{color:"#fbbf24",bg:"rgba(251,191,36,0.12)"},security:{color:"#f87171",bg:"rgba(248,113,113,0.12)"},specialized:{color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},verified:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},anthropic:{color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},published:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},draft:{color:"#6b7f95",bg:"rgba(255,255,255,0.06)"},review:{color:"#c678dd",bg:"rgba(198,120,221,0.12)"},rejected:{color:"#f87171",bg:"rgba(248,113,113,0.12)"},free:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"}};function Aee({label:t,variant:a,className:n}){const s=$X[a]||$X.draft;return e.jsx("span",{className:V("inline-flex items-center whitespace-nowrap font-sans select-none",n),style:{padding:"3px 8px",borderRadius:4,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",lineHeight:1.4,color:s.color,background:s.bg},children:t})}function uee({price:t=0,size:a="sm"}){const n=!t||t===0,s={sm:"text-2xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-xs px-3 py-1"};return e.jsx("span",{className:`inline-flex items-center font-mono font-semibold rounded whitespace-nowrap ${s[a]||s.sm} ${n?"bg-success/12 text-success":"bg-white/8 text-text-1"}`,children:n?"Free":`$${t.toFixed(2)}`})}function hee({type:t="verified",size:a=12}){const n=t==="claude-official"||t==="anthropic"?"#f59e0b":"#4ade80";return e.jsxs("svg",{width:a,height:a,viewBox:"0 0 20 20",fill:"none",className:"inline-block flex-shrink-0",children:[e.jsx("path",{d:"M10 0l2.36 3.15L16.18 2l.68 3.93L20.8 7.1l-1.87 3.52L20.8 14.14l-3.94 1.17-.68 3.93-3.82-1.15L10 21.24l-2.36-3.15-3.82 1.15-.68-3.93-3.94-1.17 1.87-3.52L-.8 7.1l3.94-1.17.68-3.93 3.82 1.15L10 0z",fill:n}),e.jsx("path",{d:"M7 10.5l2 2 4-4.5",fill:"none",stroke:"#24282f",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}const pee="groove_favorites";function Fz(){try{return JSON.parse(localStorage.getItem(pee)||"[]")}catch{return[]}}function JHe(t){return Fz().includes(t)}function eqe(t){const a=Fz(),n=a.indexOf(t);return n>=0?a.splice(n,1):a.push(t),localStorage.setItem(pee,JSON.stringify(a)),n<0}function tqe(t){const a=new Set(Fz());return t.map(n=>({...n,favorited:a.has(n.id)}))}function aqe({filled:t,size:a=16}){return e.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:t?"#f87171":"none",stroke:t?"#f87171":"rgba(255,255,255,0.3)",strokeWidth:"2",children:e.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})})}function nqe(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"7 10 12 15 17 10"}),e.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function sqe({skill:t,onClick:a}){var c,l;const[n,s]=g.useState(()=>JHe(t.id));function o(A){A.stopPropagation(),s(eqe(t.id))}return e.jsxs("div",{onClick:()=>a==null?void 0:a(t),className:V("flex flex-col cursor-pointer group","bg-surface-1 border border-border-subtle rounded-md","hover:border-accent/30 hover:bg-surface-2","transition-all duration-150"),style:{padding:20,minHeight:280},children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 bg-accent/12 text-[20px]",children:t.icon||((l=(c=t.name)==null?void 0:c[0])==null?void 0:l.toUpperCase())||"?"}),e.jsx("button",{onClick:o,className:"opacity-40 group-hover:opacity-80 hover:!opacity-100 transition-opacity cursor-pointer bg-transparent border-0 p-0",children:e.jsx(aqe,{filled:n})})]}),e.jsx("div",{className:"mt-3 text-[15px] font-semibold text-text-0 font-sans line-clamp-2 leading-snug",children:t.name}),e.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-text-3 font-sans",children:[e.jsxs("span",{children:["by ",t.author||"Community"]}),(t.source==="claude-official"||t.verified)&&e.jsx(hee,{type:t.source,size:12})]}),e.jsx("div",{className:"mt-2.5 text-xs text-text-2 font-sans line-clamp-3 flex-1 leading-relaxed",children:t.description}),e.jsx("div",{className:"mt-3",children:e.jsx(Aee,{label:t.category||"general",variant:t.category||"draft"})}),e.jsx("div",{className:"h-px bg-border-subtle my-3"}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(dee,{rating:t.rating||0,count:t.rating_count||t.ratingCount||0,size:"sm"}),e.jsxs("span",{className:"flex items-center gap-1 text-xs text-text-3 font-mono",children:[e.jsx(nqe,{}),pt(t.downloads||0)]}),e.jsx(uee,{price:t.price||0,size:"sm"})]})]})}function fee(){return e.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md animate-pulse",style:{padding:20,minHeight:280},children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-surface-4"}),e.jsx("div",{className:"mt-3 h-4 w-[70%] rounded bg-surface-4"}),e.jsx("div",{className:"mt-2 h-3 w-[40%] rounded bg-surface-4"}),e.jsx("div",{className:"mt-3.5 h-3 w-full rounded bg-surface-4"}),e.jsx("div",{className:"mt-1.5 h-3 w-[90%] rounded bg-surface-4"}),e.jsx("div",{className:"mt-1.5 h-3 w-[60%] rounded bg-surface-4"}),e.jsx("div",{className:"mt-3.5 h-5 w-[50px] rounded bg-surface-4"}),e.jsx("div",{className:"h-px bg-surface-4 my-3"}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("div",{className:"h-3 w-16 rounded bg-surface-4"}),e.jsx("div",{className:"h-3 w-12 rounded bg-surface-4"}),e.jsx("div",{className:"h-3 w-10 rounded bg-surface-4"})]})]})}const zA={"google-workspace":"https://cdn.simpleicons.org/google/white",slack:"https://cdn.simpleicons.org/slack/E01E5A",discord:"https://cdn.simpleicons.org/discord/5865F2",github:"https://cdn.simpleicons.org/github/white",stripe:"https://cdn.simpleicons.org/stripe/635BFF",gmail:"https://cdn.simpleicons.org/gmail/EA4335","google-calendar":"https://cdn.simpleicons.org/googlecalendar/4285F4","google-drive":"https://cdn.simpleicons.org/googledrive/4285F4","google-docs":"https://cdn.simpleicons.org/googledocs/4285F4","google-sheets":"https://cdn.simpleicons.org/googlesheets/34A853","google-slides":"https://cdn.simpleicons.org/googleslides/FBBC04","google-maps":"https://cdn.simpleicons.org/googlemaps/4285F4",postgres:"https://cdn.simpleicons.org/postgresql/4169E1",notion:"https://cdn.simpleicons.org/notion/white",linear:"https://cdn.simpleicons.org/linear/5E6AD2","brave-search":"https://cdn.simpleicons.org/brave/FB542B","home-assistant":"https://cdn.simpleicons.org/homeassistant/18BCF2",sentry:"https://cdn.simpleicons.org/sentry/362D59",elevenlabs:"https://cdn.simpleicons.org/elevenlabs/white",hubspot:"https://cdn.simpleicons.org/hubspot/FF7A59",jira:"https://cdn.simpleicons.org/jira/0052CC",sendgrid:"https://cdn.simpleicons.org/sendgrid/1A82E2",resend:"https://cdn.simpleicons.org/resend/white",replicate:"https://cdn.simpleicons.org/replicate/white",vercel:"https://cdn.simpleicons.org/vercel/white",supabase:"https://cdn.simpleicons.org/supabase/3FCF8E",mixpanel:"https://cdn.simpleicons.org/mixpanel/7856FF",datadog:"https://cdn.simpleicons.org/datadog/632CA6",airtable:"https://cdn.simpleicons.org/airtable/18BFFF",zendesk:"https://cdn.simpleicons.org/zendesk/03363D",intercom:"https://cdn.simpleicons.org/intercom/6AFDEF",twilio:"https://cdn.simpleicons.org/twilio/F22F46",telnyx:"https://cdn.simpleicons.org/telnyx/00C08B",aws:"https://cdn.simpleicons.org/amazonaws/FF9900",plaid:"https://cdn.simpleicons.org/plaid/white"};function rqe({item:t,size:a=40}){const n=zA[t.id];if(n)return e.jsxs("div",{className:"rounded-md bg-surface-4 flex items-center justify-center flex-shrink-0 overflow-hidden",style:{width:a,height:a},children:[e.jsx("img",{src:n,alt:t.name,className:"w-5 h-5",onError:c=>{c.target.style.display="none",c.target.nextSibling.style.display="flex"}}),e.jsx("div",{className:"hidden items-center justify-center w-full h-full text-lg font-bold font-sans text-text-1",children:(t.name||"?")[0]})]});const s=(t.name||"?")[0].toUpperCase(),o=t.name?t.name.charCodeAt(0)*37%360:200;return e.jsx("div",{className:"rounded-md flex items-center justify-center flex-shrink-0 text-lg font-bold font-sans",style:{width:a,height:a,background:`hsl(${o}, 40%, 18%)`,color:`hsl(${o}, 60%, 65%)`},children:s})}function oT({item:t,onClick:a,className:n,statusBadge:s}){var c;const o=t.installed;return e.jsxs("button",{onClick:()=>a(t),className:V("flex flex-col p-5 rounded-md border border-border-subtle bg-surface-1 text-left","hover:border-accent/30 hover:bg-surface-2","transition-all duration-150 cursor-pointer group",n),style:{minHeight:200},children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx(rqe,{item:t,size:36}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[14px] font-semibold text-text-0 font-sans truncate",children:t.name}),(t.verified||t.verified==="mcp-official")&&e.jsx(Sa,{size:11,className:"text-accent flex-shrink-0"})]}),e.jsx("span",{className:"text-2xs text-text-3 font-sans",children:t.author||"Community"})]})]}),e.jsx("p",{className:"text-xs text-text-2 font-sans line-clamp-3 mb-3 flex-1 leading-relaxed",children:t.description}),e.jsx("div",{className:"h-px bg-border-subtle my-2"}),e.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(_a,{size:10}),pt(t.downloads||0)]}),(t.rating||0)>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(IA,{size:10,className:"text-warning",fill:"currentColor"}),(c=t.rating)==null?void 0:c.toFixed(1)]}),e.jsx("span",{className:"flex-1"}),s||o&&e.jsx(be,{variant:"accent",className:"text-2xs",children:t._installedCount?`${t._installedCount} active`:"Installed"})]})]})}function Rz({value:t,onChange:a,placeholder:n="Search skills, tags, authors...",large:s}){const[o,c]=g.useState(t||""),l=g.useRef(null);g.useEffect(()=>{c(t||"")},[t]);function A(u){const f=u.target.value;c(f),clearTimeout(l.current),l.current=setTimeout(()=>a(f),300)}return e.jsxs("div",{className:"relative w-full",children:[e.jsx(oa,{size:16,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"}),e.jsx("input",{value:o,onChange:A,placeholder:n,className:V("w-full font-sans outline-none","bg-surface-0 border border-border text-text-0 placeholder:text-text-4","focus:border-accent/40 transition-colors",s?"py-3 pl-11 pr-12 text-[15px] rounded-lg":"py-2.5 pl-10 pr-3 text-sm rounded-md")}),s&&e.jsx("kbd",{className:"absolute right-3.5 top-1/2 -translate-y-1/2 bg-surface-4 text-text-4 px-2 py-0.5 rounded text-xs font-mono",children:"/"})]})}const oqe=[{id:"",label:"All"},{id:"design",label:"Design"},{id:"quality",label:"Quality"},{id:"devtools",label:"Dev Tools"},{id:"workflow",label:"Workflow"},{id:"security",label:"Security"},{id:"specialized",label:"Specialized"}];function iqe({selected:t="",categories:a=oqe,onSelect:n}){return e.jsx("div",{className:"flex gap-2 overflow-x-auto",style:{scrollbarWidth:"none"},children:a.map(s=>{const o=t===s.id;return e.jsx("button",{onClick:()=>n(s.id),className:V("whitespace-nowrap font-sans cursor-pointer select-none transition-all text-[13px] rounded-full border",o?"bg-accent text-surface-0 border-accent font-semibold":"bg-surface-1 text-text-3 border-border-subtle hover:text-text-1 hover:border-border font-medium"),style:{padding:"7px 16px"},children:s.label},s.id)})})}function ln(){const t=$(a=>a.addToast);return{success:(a,n)=>t("success",a,n),error:(a,n)=>t("error",a,n),info:(a,n)=>t("info",a,n),warning:(a,n)=>t("warning",a,n)}}const cn=g.forwardRef(({className:t,label:a,error:n,mono:s,...o},c)=>e.jsxs("div",{className:"flex flex-col gap-1",children:[a&&e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:a}),e.jsx("input",{ref:c,className:V("h-8 w-full rounded-md px-3 text-sm","bg-surface-1 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","disabled:opacity-40 disabled:cursor-not-allowed","transition-colors duration-100",s?"font-mono":"font-sans",n&&"border-danger focus:ring-danger",t),...o}),n&&e.jsx("span",{className:"text-2xs text-danger font-sans",children:n})]}));cn.displayName="Input";const cqe=g.forwardRef(({className:t,label:a,error:n,mono:s,...o},c)=>e.jsxs("div",{className:"flex flex-col gap-1",children:[a&&e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:a}),e.jsx("textarea",{ref:c,className:V("w-full rounded-md px-3 py-2 text-sm resize-none","bg-surface-1 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","disabled:opacity-40 disabled:cursor-not-allowed","transition-colors duration-100",s?"font-mono":"font-sans",n&&"border-danger focus:ring-danger",t),...o}),n&&e.jsx("span",{className:"text-2xs text-danger font-sans",children:n})]}));cqe.displayName="Textarea";function Hz({item:t,size:a=48}){const n=zA[t.id];if(n)return e.jsx("div",{className:"rounded-lg bg-surface-4 flex items-center justify-center flex-shrink-0 overflow-hidden",style:{width:a,height:a},children:e.jsx("img",{src:n,alt:t.name,className:"w-6 h-6",onError:c=>{c.target.style.display="none"}})});const s=(t.name||"?")[0].toUpperCase(),o=t.name?t.name.charCodeAt(0)*37%360:200;return e.jsx("div",{className:"rounded-lg flex items-center justify-center flex-shrink-0 text-xl font-bold font-sans",style:{width:a,height:a,background:`hsl(${o}, 40%, 18%)`,color:`hsl(${o}, 60%, 65%)`},children:s})}function kE({value:t,onChange:a,placeholder:n,disabled:s}){const[o,c]=g.useState(!1);return e.jsxs("div",{className:"relative",children:[e.jsx(cn,{type:o?"text":"password",value:t,onChange:l=>a(l.target.value),placeholder:n,disabled:s,mono:!0,className:"pr-9"}),e.jsx("button",{type:"button",onClick:()=>c(l=>!l),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded text-text-4 hover:text-text-1 transition-colors cursor-pointer",tabIndex:-1,children:o?e.jsx(jn,{size:14}):e.jsx(na,{size:14})})]})}function lqe({integrationId:t,envKey:a,onSaved:n}){const s=ln(),[o,c]=g.useState(""),[l,A]=g.useState(!1),[u,f]=g.useState(a.set),[x,m]=g.useState(!1);async function y(){if(o.trim()){A(!0);try{await D.post(`/integrations/${t}/credentials`,{key:a.key,value:o.trim()}),f(!0),c(""),s.success(`${a.label} saved`),n==null||n()}catch(O){s.error("Failed to save",O.message)}A(!1)}}async function v(){m(!0);try{await D.delete(`/integrations/${t}/credentials/${a.key}`),f(!1),s.success(`${a.label} removed`),n==null||n()}catch(O){s.error("Failed to remove",O.message)}m(!1)}return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("label",{className:"text-xs font-medium text-text-2 font-sans flex items-center gap-1.5",children:[e.jsx(ws,{size:11,className:"text-text-4"}),a.label,a.required&&e.jsx("span",{className:"text-danger",children:"*"})]}),u&&e.jsxs("span",{className:"flex items-center gap-1 text-2xs text-success font-sans",children:[e.jsx(De,{size:10})," Set"]})]}),u?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-8 rounded-md px-3 bg-surface-2 border border-border-subtle flex items-center",children:e.jsx("span",{className:"text-xs text-text-4 font-mono tracking-widest",children:"*".repeat(16)})}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:v,disabled:x,className:"text-text-3 hover:text-danger",children:x?e.jsx($e,{size:12,className:"animate-spin"}):e.jsx(At,{size:12})})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(kE,{value:o,onChange:c,placeholder:a.placeholder||`Enter ${a.label.toLowerCase()}...`,disabled:l})}),e.jsx(fe,{variant:"primary",size:"sm",onClick:y,disabled:l||!o.trim(),children:l?e.jsx($e,{size:12,className:"animate-spin"}):"Save"})]})]})}function dqe({item:t,status:a,installing:n,onInstall:s,onUninstall:o,onNext:c}){var A;const l=a==null?void 0:a.installed;return e.jsxs("div",{className:"px-5 py-5 space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx(Hz,{item:t,size:52}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-bold text-text-0 font-sans",children:t.name}),(t.verified==="mcp-official"||t.verified==="verified")&&e.jsxs(be,{variant:"accent",className:"text-2xs gap-1",children:[e.jsx(La,{size:9})," Verified"]})]}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-0.5",children:t.author||"Community"}),t.category&&e.jsx(be,{variant:"default",className:"text-2xs mt-2",children:t.category})]})]}),e.jsx("p",{className:"text-sm text-text-2 font-sans leading-relaxed",children:t.description}),((A=t.tags)==null?void 0:A.length)>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.tags.map(u=>e.jsx("span",{className:"text-2xs text-text-3 font-sans px-2 py-0.5 rounded bg-surface-4",children:u},u))}),e.jsx("div",{className:"h-px bg-border-subtle"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[e.jsx(Sa,{size:16,className:"text-success"}),e.jsx("span",{className:"text-sm font-medium text-success font-sans",children:"Installed"})]}),e.jsxs(fe,{variant:"ghost",size:"sm",onClick:o,className:"text-text-3 hover:text-danger gap-1.5",children:[e.jsx(At,{size:12})," Uninstall"]}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:c,className:"gap-1",children:["Configure ",e.jsx(Rt,{size:12})]})]}):e.jsx(fe,{variant:"primary",size:"lg",onClick:s,disabled:n,className:"w-full gap-2",children:n?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:14,className:"animate-spin"}),"Installing..."]}):"Install"}),n&&e.jsx("p",{className:"text-2xs text-text-4 font-sans text-center",children:"This may take up to 30 seconds..."})]})}const Aqe={gmail:"Gmail API","google-calendar":"Google Calendar API","google-drive":"Google Drive API","google-docs":"Google Docs API","google-sheets":"Google Sheets API","google-slides":"Google Slides API"};function xee({integrationId:t,onConfigured:a}){const n=ln(),[s,o]=g.useState(""),[c,l]=g.useState(""),[A,u]=g.useState(!1),f=Aqe[t]||"the relevant Google API";async function x(){if(!(!s.trim()||!c.trim())){u(!0);try{await D.post("/integrations/google-oauth/setup",{clientId:s.trim(),clientSecret:c.trim()}),n.success("Google OAuth credentials saved"),a()}catch(y){n.error("Failed to save",y.message)}u(!1)}}const m=[{text:"Go to the Google Cloud Console and sign in with your Google account",link:{url:"https://console.cloud.google.com",label:"Open Google Cloud Console"}},{text:"Create a new project (or select an existing one). Any name is fine — this is just a container for your credentials."},{text:e.jsxs(e.Fragment,{children:["Enable the ",e.jsx("strong",{children:f})," — search for it in the API Library and click ",e.jsx("strong",{children:"Enable"})]}),link:{url:"https://console.cloud.google.com/apis/library",label:"Open API Library"}},{text:e.jsxs(e.Fragment,{children:["Go to ",e.jsx("strong",{children:"Credentials"})," and click ",e.jsx("strong",{children:"Create Credentials"})," → ",e.jsx("strong",{children:"OAuth client ID"})]}),link:{url:"https://console.cloud.google.com/apis/credentials",label:"Open Credentials page"}},{text:e.jsxs(e.Fragment,{children:["If prompted to configure the consent screen, choose ",e.jsx("strong",{children:"External"}),', fill in an app name (e.g. "Groove"), your email, and save. You can skip optional fields.']})},{text:e.jsxs(e.Fragment,{children:["Go to ",e.jsx("strong",{children:"Audience"})," and click ",e.jsx("strong",{children:"Publish App"}),". Then scroll down to ",e.jsx("strong",{children:"Test users"}),", click ",e.jsx("strong",{children:"Add Users"}),", enter your Google email address, and save."]})},{text:e.jsxs(e.Fragment,{children:["For Application type, choose ",e.jsx("strong",{children:"Desktop app"})," (not Web application). Give it any name."]})},{text:e.jsxs(e.Fragment,{children:["Click ",e.jsx("strong",{children:"Create"}),", then copy the ",e.jsx("strong",{children:"Client ID"})," and ",e.jsx("strong",{children:"Client Secret"})," and paste them below."]})}];return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-surface-2 rounded-md px-4 py-3 space-y-3",children:[e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"How to get your Google credentials"}),e.jsx("ol",{className:"space-y-2.5",children:m.map((y,v)=>e.jsxs("li",{className:"flex gap-2.5 text-xs text-text-2 font-sans leading-relaxed",children:[e.jsxs("span",{className:"text-accent font-mono font-bold flex-shrink-0 w-4 text-right",children:[v+1,"."]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{children:y.text}),y.link&&e.jsxs("a",{href:y.link.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-2xs text-accent font-sans hover:underline mt-0.5",children:[e.jsx(ma,{size:9}),y.link.label]}),y.copyable&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[e.jsx("code",{className:"flex-1 min-w-0 text-2xs font-mono text-accent bg-surface-4 px-2.5 py-1.5 rounded select-all break-all",children:y.copyable}),e.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(y.copyable)},className:"flex-shrink-0 p-1.5 rounded text-text-3 hover:text-accent hover:bg-accent/10 transition-colors cursor-pointer",title:"Copy to clipboard",children:e.jsx(wn,{size:12})})]})]})]},v))})]}),e.jsx("div",{className:"bg-accent/8 border border-accent/15 rounded-md px-4 py-2.5",children:e.jsxs("p",{className:"text-2xs text-text-2 font-sans leading-relaxed",children:[e.jsx("strong",{className:"text-text-1",children:"One-time setup"})," — these same credentials work for Gmail, Calendar, Drive, Docs, Sheets, and Slides. You only need to do this once. For each integration, just enable the matching API in your Google Cloud project."]})}),e.jsx("div",{className:"bg-warning/8 border border-warning/15 rounded-md px-4 py-2.5",children:e.jsxs("p",{className:"text-2xs text-text-2 font-sans leading-relaxed",children:[e.jsx("strong",{className:"text-text-1",children:'Google "unverified app" warning'})," — when signing in, Google may show a warning that the app isn't verified. This is normal for personal OAuth apps. Click ",e.jsx("strong",{children:"Advanced"}),", then ",e.jsx("strong",{children:"Go to [your app name] (unsafe)"})," to continue. Your credentials stay local and are never sent to Groove servers."]})}),e.jsx("div",{className:"h-px bg-border-subtle"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("label",{className:"text-xs font-medium text-text-2 font-sans flex items-center gap-1.5",children:[e.jsx(ws,{size:11,className:"text-text-4"}),"Client ID ",e.jsx("span",{className:"text-danger",children:"*"})]}),e.jsx(kE,{value:s,onChange:o,placeholder:"123456789.apps.googleusercontent.com",disabled:A})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("label",{className:"text-xs font-medium text-text-2 font-sans flex items-center gap-1.5",children:[e.jsx(ws,{size:11,className:"text-text-4"}),"Client Secret ",e.jsx("span",{className:"text-danger",children:"*"})]}),e.jsx(kE,{value:c,onChange:l,placeholder:"GOCSPX-...",disabled:A})]})]}),e.jsx(fe,{variant:"primary",size:"lg",onClick:x,disabled:A||!s.trim()||!c.trim(),className:"w-full gap-2",children:A?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:14,className:"animate-spin"})," Saving..."]}):"Save Credentials"})]})}function uqe({item:t,status:a,onDone:n,onRefreshStatus:s}){var C;const o=ln(),[c,l]=g.useState(!1),[A,u]=g.useState(null),f=t.authType,x=f==="google-autoauth"||f==="oauth-google";g.useEffect(()=>{x&&D.get("/integrations/google-oauth/status").then(j=>u(j.configured)).catch(()=>u(!1))},[x]);const m=g.useRef(null);g.useEffect(()=>()=>{m.current&&clearInterval(m.current)},[]);async function y(){l(!0);try{const j=await D.post(`/integrations/${t.id}/oauth/start`);if(j.url){const N=await AZ(j.url);if(N!=null&&N.error){o.error("Sign-in failed",N.error),l(!1);return}o.success("Browser opened — complete sign-in there");let M=0;m.current&&clearInterval(m.current),m.current=setInterval(async()=>{if(M+=2e3,M>6e4){clearInterval(m.current),m.current=null,l(!1);return}try{const Q=await D.get(`/integrations/${t.id}/status`);((Q==null?void 0:Q.envKeys)||[]).some(S=>S.key==="GOOGLE_REFRESH_TOKEN"&&S.set)&&(clearInterval(m.current),m.current=null,o.success("Connected!",`${t.name} is now authenticated`),s(),l(!1))}catch{}},2e3)}}catch(j){o.error("Sign-in failed",j.message),l(!1)}}const v=(a==null?void 0:a.envKeys)||[],O=v.filter(j=>j.required&&!j.hidden),b=O.length===0||O.every(j=>j.set);return e.jsxs("div",{className:"px-5 py-5 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Hz,{item:t,size:36}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-sm font-bold text-text-0 font-sans",children:["Configure ",t.name]}),e.jsx("p",{className:"text-2xs text-text-3 font-sans",children:"Set up credentials to connect"})]})]}),((C=t.setupSteps)==null?void 0:C.length)>0&&!(x&&A===!1)&&e.jsxs("div",{className:"bg-surface-2 rounded-md px-4 py-3 space-y-2",children:[e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"Setup guide"}),e.jsx("ol",{className:"space-y-1.5",children:t.setupSteps.map((j,N)=>e.jsxs("li",{className:"flex gap-2 text-xs text-text-2 font-sans leading-relaxed",children:[e.jsxs("span",{className:"text-text-4 font-mono flex-shrink-0 w-4 text-right",children:[N+1,"."]}),e.jsx("span",{children:j})]},N))}),t.setupUrl&&e.jsxs("a",{href:t.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent font-sans hover:underline mt-1",children:[e.jsx(ma,{size:11}),new URL(t.setupUrl).hostname]})]}),!(x&&A===!1)&&e.jsx("div",{className:"h-px bg-border-subtle"}),f==="api-key"&&e.jsx("div",{className:"space-y-4",children:v.filter(j=>!j.hidden).map(j=>e.jsx(lqe,{integrationId:t.id,envKey:j,onSaved:s},j.key))}),x&&A===!1&&e.jsx(xee,{integrationId:t.id,onConfigured:()=>u(!0)}),x&&A&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(fe,{variant:"primary",size:"lg",onClick:y,disabled:c,className:"w-full gap-2",children:c?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:14,className:"animate-spin"}),"Opening browser..."]}):e.jsxs(e.Fragment,{children:[e.jsx("img",{src:"https://cdn.simpleicons.org/google/white",alt:"",className:"w-4 h-4"}),"Sign in with Google"]})}),e.jsxs("p",{className:"text-2xs text-text-4 font-sans text-center",children:["A browser window will open — sign in and allow access to your ",t.name]}),e.jsx("button",{type:"button",onClick:()=>u(!1),className:"w-full text-2xs text-text-4 font-sans hover:text-text-2 transition-colors cursor-pointer py-1",children:"Reconfigure Google OAuth credentials"})]}),x&&A===null&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsx($e,{size:16,className:"animate-spin text-text-4"})}),e.jsx(fe,{variant:b?"primary":"secondary",size:"lg",onClick:n,className:"w-full gap-1.5",children:b?e.jsxs(e.Fragment,{children:[e.jsx(De,{size:14}),"Done"]}):"Skip for now"})]})}function hqe({item:t,onClose:a}){return e.jsxs("div",{className:"px-5 py-10 flex flex-col items-center text-center space-y-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-success/15 flex items-center justify-center",children:e.jsx(Sa,{size:28,className:"text-success"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-text-0 font-sans",children:"Integration ready"}),e.jsxs("p",{className:"text-sm text-text-3 font-sans mt-1",children:[t.name," is installed and configured. Agents can now use it."]})]}),e.jsx(fe,{variant:"primary",size:"lg",onClick:a,className:"mt-2",children:"Close"})]})}function mee({integration:t,open:a,onClose:n}){const s=ln(),[o,c]=g.useState("overview"),[l,A]=g.useState(null),[u,f]=g.useState(!1),[x,m]=g.useState(!0),y=t==null?void 0:t.id,v=g.useCallback(async()=>{if(y){try{const N=await D.get(`/integrations/${y}/status`);A(N)}catch{A(null)}m(!1)}},[y]);g.useEffect(()=>{a&&t&&(c("overview"),m(!0),v())},[a,t,v]);async function O(){f(!0);try{await D.post(`/integrations/${t.id}/install`),s.success(`${t.name} installed`),await v(),c("configure")}catch(N){s.error("Install failed",N.message)}f(!1)}async function b(){try{await D.delete(`/integrations/${t.id}`),s.success(`${t.name} uninstalled`),await v()}catch(N){s.error("Uninstall failed",N.message)}}function C(){c("configure")}function j(){c("done")}return t?e.jsx(Ut,{open:a,onOpenChange:N=>{N||n()},children:e.jsx(Pt,{title:o==="overview"?t.name:o==="configure"?"Configure":"Complete",description:`Setup wizard for ${t.name}`,className:"max-w-md",children:x?e.jsx("div",{className:"px-5 py-10 flex items-center justify-center",children:e.jsx($e,{size:20,className:"animate-spin text-text-4"})}):o==="overview"?e.jsx(dqe,{item:t,status:l,installing:u,onInstall:O,onUninstall:b,onNext:C}):o==="configure"?e.jsx(uqe,{item:t,status:l,onDone:j,onRefreshStatus:v}):e.jsx(hqe,{item:t,onClose:n})})}):null}const pqe=["gmail","google-calendar","google-drive","google-docs","google-sheets","google-slides"];function fqe({item:t,status:a,onInstall:n,onUninstall:s,busy:o}){const c=a==null?void 0:a.installed,l=a==null?void 0:a.authenticated;return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-2 border border-border-subtle",children:[e.jsx(Hz,{item:t,size:32}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans",children:t.name}),e.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:t.description})]}),c&&l&&!(a!=null&&a.needsReauth)&&e.jsxs(be,{variant:"success",className:"text-2xs flex-shrink-0 gap-1",children:[e.jsx(De,{size:8})," Ready"]}),c&&l&&(a==null?void 0:a.needsReauth)&&e.jsxs(be,{variant:"warning",className:"text-2xs flex-shrink-0 gap-1",children:[e.jsx(ra,{size:8})," Update"]}),c&&!l&&e.jsx(be,{variant:"warning",className:"text-2xs flex-shrink-0",children:"Needs sign-in"}),e.jsx(fe,{variant:c?"ghost":"primary",size:"sm",onClick:()=>c?s(t.id):n(t.id),disabled:o===t.id,className:c?"text-text-3 hover:text-danger":"",children:o===t.id?e.jsx($e,{size:12,className:"animate-spin"}):c?e.jsx(At,{size:12}):"Install"})]})}function xqe({integrations:t,open:a,onClose:n}){const s=ln(),[o,c]=g.useState(null),[l,A]=g.useState({}),[u,f]=g.useState(null),[x,m]=g.useState(!1),[y,v]=g.useState(!0),O=g.useRef(null),b=t.filter(S=>pqe.includes(S.id)),C=g.useCallback(async()=>{const S={};await Promise.all(b.map(async I=>{try{S[I.id]=await D.get(`/integrations/${I.id}/status`)}catch{S[I.id]=null}})),A(S),v(!1)},[b.map(S=>S.id).join(",")]);g.useEffect(()=>(a&&(v(!0),D.get("/integrations/google-oauth/status").then(S=>c(S.configured)).catch(()=>c(!1)),C()),()=>{O.current&&clearInterval(O.current)}),[a]);const j=Object.entries(l).filter(([,S])=>S==null?void 0:S.installed).map(([S])=>S),N=j.length>0&&j.every(S=>{var I;return(I=l[S])==null?void 0:I.authenticated});j.some(S=>{var I;return!((I=l[S])!=null&&I.authenticated)});const M=N&&j.some(S=>{var I;return(I=l[S])==null?void 0:I.needsReauth});async function Q(S){var I;f(S);try{await D.post(`/integrations/${S}/install`),s.success(`${(I=b.find(z=>z.id===S))==null?void 0:I.name} installed`),await C()}catch(z){s.error("Install failed",z.message)}f(null)}async function L(S){var I;f(S);try{await D.delete(`/integrations/${S}`),s.success(`${(I=b.find(z=>z.id===S))==null?void 0:I.name} removed`),await C()}catch(z){s.error("Uninstall failed",z.message)}f(null)}async function B(){if(!j.length){s.error("Install at least one service first");return}m(!0);try{const S=await D.post("/integrations/google-workspace/oauth/start",{integrationIds:j});if(S.url){const I=await AZ(S.url);if(I!=null&&I.error){s.error("Sign-in failed",I.error),m(!1);return}s.success("Browser opened — complete sign-in there"),O.current&&clearInterval(O.current),O.current=setInterval(async()=>{await C()},3e3),setTimeout(()=>{O.current&&clearInterval(O.current)},18e4)}}catch(S){s.error("Sign-in failed",S.message)}m(!1)}return g.useEffect(()=>{N&&O.current&&(clearInterval(O.current),O.current=null)},[N]),a?e.jsx(Ut,{open:a,onOpenChange:S=>{S||n()},children:e.jsx(Pt,{title:"Google Workspace",description:"Connect your Google services",className:"max-w-md",children:e.jsxs("div",{className:"px-5 py-5 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-11 h-11 rounded-lg bg-surface-4 flex items-center justify-center flex-shrink-0",children:e.jsx("img",{src:"https://cdn.simpleicons.org/google/white",alt:"Google",className:"w-6 h-6"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold text-text-0 font-sans",children:"Google Workspace"}),e.jsx("p",{className:"text-2xs text-text-3 font-sans",children:"One set of credentials for all Google services"})]})]}),o===!1&&e.jsx(xee,{integrationId:"gmail",onConfigured:()=>c(!0)}),o===null&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsx($e,{size:16,className:"animate-spin text-text-4"})}),o&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-text-2 font-sans",children:"Services"}),e.jsx("div",{className:"space-y-1.5",children:y?Array.from({length:4}).map((S,I)=>e.jsx("div",{className:"h-14 rounded-md bg-surface-2 animate-pulse"},I)):b.map(S=>e.jsx(fqe,{item:S,status:l[S.id],onInstall:Q,onUninstall:L,busy:u},S.id))})]}),e.jsx("div",{className:"h-px bg-border-subtle"}),j.length>0&&!N&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(fe,{variant:"primary",size:"lg",onClick:B,disabled:x,className:"w-full gap-2",children:x?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:14,className:"animate-spin"})," Opening browser..."]}):e.jsxs(e.Fragment,{children:[e.jsx("img",{src:"https://cdn.simpleicons.org/google/white",alt:"",className:"w-4 h-4"}),"Sign in with Google"]})}),e.jsxs("p",{className:"text-2xs text-text-4 font-sans text-center",children:["Connects ",j.length," service",j.length!==1?"s":""," with one sign-in"]})]}),N&&j.length>0&&e.jsxs("div",{className:"flex flex-col items-center text-center gap-2 py-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-success/15 flex items-center justify-center",children:e.jsx(Sa,{size:20,className:"text-success"})}),e.jsx("p",{className:"text-sm font-medium text-success font-sans",children:"All services connected"}),e.jsx("p",{className:"text-2xs text-text-3 font-sans",children:"Your agents can now use these Google integrations."}),M?e.jsxs("div",{className:"w-full space-y-2 pt-2",children:[e.jsx("p",{className:"text-2xs text-warning font-sans",children:"New permissions available — re-authenticate to enable all features."}),e.jsx(fe,{variant:"secondary",size:"sm",onClick:B,disabled:x,className:"w-full gap-2",children:x?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:12,className:"animate-spin"})," Opening browser..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ra,{size:12})," Re-authenticate"]})})]}):e.jsx("button",{onClick:B,disabled:x,className:"text-2xs text-text-4 hover:text-text-2 font-sans underline underline-offset-2 transition-colors mt-1",children:x?"Opening browser...":"Re-authenticate"})]}),j.length===0&&!y&&e.jsx("p",{className:"text-xs text-text-4 font-sans text-center py-2",children:"Install at least one service above, then connect with Google."})]}),e.jsx(fe,{variant:"secondary",size:"lg",onClick:n,className:"w-full",children:N&&j.length>0?"Done":"Close"})]})})}):null}const fP=/github\.com\/([^/]+)\/([^/\s#?]+)/;function mqe(){const[t,a]=g.useState("input"),[n,s]=g.useState(""),[o,c]=g.useState(!1),[l,A]=g.useState(null),[u,f]=g.useState("standalone"),[x,m]=g.useState(""),[y,v]=g.useState(!0),[O,b]=g.useState(""),C=$(S=>S.previewRepo),j=$(S=>S.importRepo),N=$(S=>S.importInProgress),M=ln(),Q=g.useCallback(async S=>{const I=S.match(fP);if(I){c(!0);try{const z=await C(S);A(z),b(z.name||I[2]),a("preview")}catch(z){M.error("Preview failed",z.message)}finally{c(!1)}}},[C,M]),L=g.useCallback(S=>{const I=S.target.value;s(I),fP.test(I)&&t==="input"&&Q(I)},[t,Q]),B=g.useCallback(async()=>{if(!l)return;let S;u==="standalone"?S=`~/Projects/${l.name}`:u==="subdirectory"?S=`./packages/${l.name}`:S=x;try{await j(n,S,y,O),M.success(`Importing ${l.name}`,"Setup agent will handle the rest"),a("input"),s(""),A(null)}catch(I){M.error("Import failed",I.message)}},[l,u,x,n,y,O,j,M]);if(t==="input")return e.jsxs("div",{className:"relative",children:[e.jsx(oa,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"}),e.jsx("input",{type:"text",value:n,onChange:L,placeholder:"Paste a GitHub URL...",className:V("w-full h-9 rounded-lg pl-9 pr-20 text-sm font-sans","bg-surface-1 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","transition-colors duration-100")}),e.jsx(fe,{variant:"primary",size:"sm",className:"absolute right-1.5 top-1/2 -translate-y-1/2",onClick:()=>Q(n),disabled:!fP.test(n)||o,children:o?e.jsx($e,{size:12,className:"animate-spin"}):"Preview"})]});if(t==="preview"&&l)return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-lg border border-border-subtle bg-surface-2 p-5",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-accent/8 flex items-center justify-center flex-shrink-0",children:e.jsx(Js,{size:22,className:"text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-1",children:[e.jsx("span",{className:"text-lg font-bold text-text-0 font-sans",children:l.name}),e.jsx("span",{className:"text-xs text-text-4 font-sans",children:l.owner})]}),e.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[l.language&&e.jsx(be,{variant:"outline",className:"text-2xs",children:l.language}),l.stars!=null&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(IA,{size:10,className:"text-warning",fill:"currentColor"}),pt(l.stars)]}),l.license&&e.jsx("span",{children:l.license})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>a("configure"),className:"h-8 text-xs gap-1.5 px-4",children:[e.jsx(ga,{size:13}),"Clone & Setup"]}),e.jsxs(fe,{variant:"ghost",size:"sm",onClick:()=>{try{const S=n.startsWith("http")?n:`https://${n}`,I=new URL(S);(I.protocol==="https:"||I.protocol==="http:")&&window.open(S,"_blank")}catch{}},className:"h-8 text-xs gap-1.5",children:[e.jsx(ma,{size:12}),"GitHub"]}),e.jsx("button",{onClick:()=>{a("input"),A(null)},className:"text-2xs text-text-4 font-sans hover:text-text-2 cursor-pointer bg-transparent border-0 ml-1",children:"Cancel"})]})]})}),l.description&&e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-5 py-4",children:[e.jsx("h4",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-2",children:"About"}),e.jsx("p",{className:"text-sm text-text-1 font-sans leading-relaxed",children:l.description})]}),l.readmePreview&&e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-5 py-4",children:[e.jsx("h4",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-3",children:"README"}),e.jsx("div",{className:"text-sm text-text-2 font-sans leading-relaxed whitespace-pre-wrap",children:l.readmePreview})]})]});if(t==="configure"&&l){const S=[{id:"standalone",icon:Kn,title:"Standalone project",description:"Clone to its own directory, separate from this workspace",path:`~/Projects/${l.name}`},{id:"subdirectory",icon:xu,title:"Workspace package",description:"Add as a package inside this project's monorepo",path:`./packages/${l.name}`},{id:"custom",icon:Eo,title:"Custom location",description:"Choose your own path",path:null}];return e.jsxs("div",{className:"rounded-xl border border-border-subtle bg-surface-2 overflow-hidden",children:[e.jsx("div",{className:"px-5 py-4 border-b border-border-subtle bg-surface-3/50",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-accent/10 flex items-center justify-center flex-shrink-0",children:e.jsx(_a,{size:16,className:"text-accent"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-semibold text-text-0 font-sans",children:["Clone ",l.name]}),e.jsxs("p",{className:"text-2xs text-text-4 font-sans mt-0.5",children:[l.owner,"/",l.name," — configure where to install"]})]})]})}),e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-2.5 block",children:"Install location"}),e.jsx("div",{className:"space-y-2",children:S.map(I=>{const z=I.icon,P=u===I.id;return e.jsx("button",{onClick:()=>f(I.id),className:V("w-full text-left rounded-lg border p-3.5 transition-all duration-150 cursor-pointer",P?"border-accent bg-accent/5 ring-1 ring-accent/30":"border-border-subtle bg-surface-1 hover:border-border hover:bg-surface-1/80"),children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:V("w-8 h-8 rounded-md flex items-center justify-center flex-shrink-0 mt-0.5",P?"bg-accent/15 text-accent":"bg-surface-3 text-text-4"),children:e.jsx(z,{size:15})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:V("text-xs font-semibold font-sans",P?"text-text-0":"text-text-2"),children:I.title}),P&&e.jsx("div",{className:"w-4 h-4 rounded-full bg-accent flex items-center justify-center",children:e.jsx(De,{size:10,className:"text-white"})})]}),e.jsx("p",{className:"text-2xs text-text-4 font-sans mt-0.5 leading-relaxed",children:I.description}),I.path&&P&&e.jsx("code",{className:"text-2xs text-accent/80 font-mono mt-1.5 block truncate",children:I.path})]})]})},I.id)})}),u==="custom"&&e.jsx("div",{className:"mt-2.5 ml-11",children:e.jsx("input",{value:x,onChange:I=>m(I.target.value),placeholder:"/path/to/clone",autoFocus:!0,className:V("w-full h-9 px-3 text-xs font-mono rounded-md","bg-surface-0 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","transition-colors")})})]}),e.jsxs("div",{className:"border-t border-border-subtle pt-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-surface-3 flex items-center justify-center",children:e.jsx(Fa,{size:14,className:"text-text-4"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-semibold text-text-2 font-sans block",children:"Create a team"}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Organize agents working on this repo into their own team"})]})]}),e.jsx("button",{onClick:()=>v(!y),className:V("w-9 h-5 rounded-full p-0.5 transition-colors cursor-pointer flex-shrink-0",y?"bg-accent":"bg-surface-5"),children:e.jsx("div",{className:V("w-4 h-4 rounded-full bg-white shadow-sm transition-transform",y?"translate-x-4":"translate-x-0")})})]}),y&&e.jsx("div",{className:"mt-2.5 ml-11",children:e.jsx("input",{value:O,onChange:I=>b(I.target.value),placeholder:"Team name",className:V("w-full h-9 px-3 text-xs font-sans rounded-md","bg-surface-0 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","transition-colors")})})]})]}),e.jsxs("div",{className:"px-5 py-3.5 border-t border-border-subtle bg-surface-3/30 flex items-center justify-between",children:[e.jsxs("button",{onClick:()=>a("preview"),className:"flex items-center gap-1.5 text-2xs text-text-4 font-sans hover:text-text-2 cursor-pointer bg-transparent border-0 transition-colors",children:[e.jsx(J1,{size:11}),"Back"]}),e.jsx(fe,{variant:"primary",size:"sm",onClick:B,disabled:N||u==="custom"&&!x.trim(),className:"h-8 text-xs gap-1.5 px-5",children:N?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:12,className:"animate-spin"})," Importing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_a,{size:12})," Clone & Setup"]})})]})]})}return null}function gqe({repo:t,onRemove:a,onNuke:n,onOpen:s}){return e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-2 p-3 flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:t.repoName||t.name}),e.jsx("span",{className:"text-2xs text-text-3 font-sans",children:t.repoOwner||t.owner})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[t.language&&e.jsx(be,{variant:"outline",className:"text-2xs",children:t.language}),e.jsx("span",{className:"text-2xs text-text-4 font-mono truncate max-w-[180px]",children:t.clonedTo||t.path})]}),e.jsx("span",{className:"text-2xs text-text-4 font-sans mt-0.5 block",children:t.clonedAt?`Imported ${Mt(t.clonedAt)}`:t.status||""})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s&&e.jsxs("button",{onClick:()=>s(t),className:V("flex items-center gap-1 px-2 py-1 rounded text-2xs font-sans cursor-pointer","text-accent bg-accent/10 hover:bg-accent/20 border-0 transition-colors"),children:[e.jsx(ga,{size:11}),"Open"]}),a&&e.jsxs("button",{onClick:()=>a(t),className:V("flex items-center gap-1 px-2 py-1 rounded text-2xs font-sans cursor-pointer","text-text-3 hover:text-text-1 hover:bg-surface-4 bg-transparent border-0 transition-colors"),children:[e.jsx(At,{size:11}),"Remove"]}),n&&e.jsxs("button",{onClick:()=>n(t),className:V("flex items-center gap-1 px-2 py-1 rounded text-2xs font-sans cursor-pointer","text-danger bg-danger/10 hover:bg-danger/20 border-0 transition-colors"),children:[e.jsx(l0,{size:11}),"Nuke"]})]})]})}function yqe({repo:t,open:a,onClose:n,onConfirm:s}){var x,m,y;const[o,c]=g.useState(!0);if(!t)return null;const l=((x=t.agents)==null?void 0:x.length)||0,A=((m=t.processes)==null?void 0:m.length)||0,u=((y=t.credentialKeys)==null?void 0:y.length)||0,f=t.fileCount||0;return e.jsx(Ut,{open:a,onOpenChange:v=>{v||n()},children:e.jsx(Pt,{title:`Nuke ${t.repoName||t.name}?`,description:"Confirm destructive removal of imported repo",children:e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Gt,{size:16,className:"text-danger flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-sm text-text-1 font-sans",children:"This cannot be undone."})]}),e.jsxs("div",{className:"space-y-1.5 text-xs text-text-2 font-sans",children:[l>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"})," Kill ",l," agent",l!==1?"s":""]}),A>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"})," Stop ",A," process",A!==1?"es":""]}),u>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"})," Remove ",u," credential",u!==1?"s":""]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"}),' Delete team "',t.teamId||t.repoName||t.name,'"']}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"})," Clean all .groove state"]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:v=>c(v.target.checked),className:"accent-[var(--color-danger)]"}),e.jsxs("span",{className:"text-xs text-text-1 font-sans",children:["Delete repo files",f>0?` (${f} files)`:""]})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(fe,{variant:"danger",size:"sm",onClick:()=>s(o),children:"Nuke Everything"}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"})]})]})})})}function gee({skill:t,onBack:a}){var L,B,S;const n=ln(),[s,o]=g.useState(""),[c,l]=g.useState(!1),[A,u]=g.useState(!1),[f,x]=g.useState(!1),[m,y]=g.useState(!1),[v,O]=g.useState(t.installed),[b,C]=g.useState(!0);g.useEffect(()=>{C(!0),D.get(`/skills/${t.id}/content`).then(I=>{o(I.content||""),l(I.requiresPurchase||!1)}).catch(()=>{}).finally(()=>C(!1))},[t.id]);async function j(){u(!0);try{await D.post(`/skills/${t.id}/install`),O(!0),n.success(`${t.name} installed`)}catch(I){n.error("Install failed",I.message)}u(!1)}async function N(){x(!0);try{await D.post(`/skills/${t.id}/update`),n.success(`${t.name} updated to latest`);const I=await D.get(`/skills/${t.id}/content`);I.content&&o(I.content)}catch(I){n.error("Update failed",I.message)}x(!1)}async function M(){y(!0);try{await D.delete(`/skills/${t.id}`),O(!1),n.success(`${t.name} uninstalled`)}catch(I){n.error("Uninstall failed",I.message)}y(!1)}async function Q(){const{marketplaceAuthenticated:I,marketplaceLogin:z,marketplaceCheckout:P}=$.getState();if(!I){z();return}try{await P(t.id)}catch{}}return e.jsx(it,{className:"h-full",children:e.jsxs("div",{className:"px-6 py-5",children:[e.jsxs("button",{onClick:a,className:"flex items-center gap-1 text-xs text-text-3 font-sans hover:text-text-0 cursor-pointer bg-transparent border-0 mb-4",children:[e.jsx(bs,{size:14})," Back"]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-11 h-11 rounded-lg flex items-center justify-center flex-shrink-0 bg-accent/10 border border-accent/20 text-[22px]",children:t.icon||((B=(L=t.name)==null?void 0:L[0])==null?void 0:B.toUpperCase())}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h1",{className:"text-lg font-bold text-text-0 font-sans",children:t.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-xs text-text-3 font-sans",children:[e.jsx("span",{children:t.author||"Community"}),(t.source==="claude-official"||t.verified)&&e.jsx(hee,{type:t.source,size:13})]})]})]}),e.jsx("p",{className:"mt-3 text-sm text-text-2 font-sans leading-relaxed",children:t.description}),((S=t.tags)==null?void 0:S.length)>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:t.tags.map(I=>e.jsx("span",{className:"text-2xs text-text-3 font-sans px-2 py-0.5 rounded bg-surface-4",children:I},I))}),e.jsx("div",{className:"h-px bg-border-subtle my-5"}),b?e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-3 w-48 bg-surface-4 rounded animate-pulse"}),e.jsx("div",{className:"h-3 w-full bg-surface-4 rounded animate-pulse"}),e.jsx("div",{className:"h-3 w-3/4 bg-surface-4 rounded animate-pulse"})]}):s?e.jsxs("div",{className:"text-sm text-text-2 font-sans leading-relaxed",children:[e.jsx("h2",{className:"text-sm font-semibold text-text-0 mb-2",children:"About"}),e.jsx("pre",{className:"whitespace-pre-wrap font-sans",children:s})]}):c?e.jsxs("div",{className:"bg-warning/5 border border-warning/15 rounded-lg px-4 py-3",children:[e.jsx("p",{className:"text-sm text-text-1 font-sans font-medium",children:"Paid skill — purchase to view content"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Sign in and purchase this skill to access its full instructions."})]}):e.jsx("p",{className:"text-xs text-text-4 font-sans",children:"Content loading failed — check your connection."})]}),e.jsx("div",{className:"w-[240px] flex-shrink-0",children:e.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-lg p-4 sticky top-4",children:[e.jsx(uee,{price:t.price||0,size:"md"}),c&&!v?e.jsxs("button",{onClick:Q,className:"w-full mt-3 py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 flex items-center justify-center gap-2 border bg-warning/15 text-warning border-warning/20 hover:bg-warning/25",children:["Buy $",(t.price||0).toFixed(2)]}):v?e.jsxs("div",{className:"mt-3 flex flex-col gap-1.5",children:[e.jsxs("button",{onClick:N,disabled:f,className:"w-full py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border bg-accent/15 text-accent border-accent/20 hover:bg-accent/25",children:[e.jsx(ra,{size:12,className:f?"animate-spin":""}),f?"Updating...":"Pull Latest"]}),e.jsxs("button",{onClick:M,disabled:m,className:"w-full py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border bg-error/10 text-error border-error/20 hover:bg-error/15",children:[e.jsx(At,{size:12}),m?"Removing...":"Uninstall"]})]}):e.jsx("button",{onClick:j,disabled:A,className:"w-full mt-3 py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border bg-accent/15 text-accent border-accent/20 hover:bg-accent/25",children:A?"Installing...":"Install"}),e.jsx("div",{className:"mt-4 flex flex-col gap-2.5",children:[["Downloads",e.jsx("span",{className:"font-mono text-text-0",children:pt(t.downloads||0)},"d")],["Rating",e.jsx(dee,{rating:t.rating||0,count:t.rating_count||t.ratingCount,size:"sm"},"r")],["Version",e.jsx("span",{className:"font-mono text-text-0",children:t.version||"1.0.0"},"v")],["Category",e.jsx(Aee,{label:t.category||"general",variant:t.category||"draft"},"c")],["Source",e.jsx("span",{className:"text-text-0",children:t.source==="claude-official"?"Anthropic":"Community"},"s")]].map(([I,z])=>e.jsxs("div",{className:"flex justify-between items-center text-xs font-sans",children:[e.jsx("span",{className:"text-text-3",children:I}),z]},I))})]})})]})]})})}function vqe(){const[t,a]=g.useState([]),[n,s]=g.useState(!0),[o,c]=g.useState(""),[l,A]=g.useState(""),[u,f]=g.useState("popular"),[x,m]=g.useState(null);return g.useEffect(()=>{s(!0);const y=new URLSearchParams;o&&y.set("search",o),l&&y.set("category",l),u&&y.set("sort",u),D.get(`/skills/registry?${y}`).then(v=>a(tqe(v.skills||v.items||(Array.isArray(v)?v:[])))).catch(()=>a([])).finally(()=>s(!1))},[o,l,u]),x?e.jsx(gee,{skill:x,onBack:()=>m(null)}):e.jsx(it,{className:"h-full",children:e.jsxs("div",{className:"px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-72",children:e.jsx(Rz,{value:o,onChange:c})}),e.jsx(iqe,{selected:l,onSelect:A}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsxs("select",{value:u,onChange:y=>f(y.target.value),className:"appearance-none font-sans cursor-pointer pr-7 py-2 pl-3 text-xs bg-surface-0 border border-border-subtle rounded text-text-1 focus:outline-none",children:[e.jsx("option",{value:"popular",children:"Popular"}),e.jsx("option",{value:"rating",children:"Top Rated"}),e.jsx("option",{value:"newest",children:"Newest"}),e.jsx("option",{value:"name",children:"A-Z"})]}),e.jsx(bt,{size:12,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"})]}),e.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:t.length})]}),e.jsx("div",{className:"mt-4 grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:n?Array.from({length:8}).map((y,v)=>e.jsx(fee,{},v)):t.map(y=>e.jsx(sqe,{skill:y,onClick:m},y.id))}),!n&&t.length===0&&e.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No skills found."})]})})}const IX=new Set(["gmail","google-calendar","google-drive","google-docs","google-sheets","google-slides"]);function kqe(){const[t,a]=g.useState([]),[n,s]=g.useState(!0),[o,c]=g.useState(""),[l,A]=g.useState(null),[u,f]=g.useState(!1),[x,m]=g.useState(!1),y=()=>{s(!0),D.get(`/integrations/registry?search=${encodeURIComponent(o)}`).then(M=>a(M.integrations||M.items||(Array.isArray(M)?M:[]))).catch(()=>a([])).finally(()=>s(!1))};g.useEffect(()=>{y()},[o]);const v=t.filter(M=>IX.has(M.id)),O=t.filter(M=>!IX.has(M.id)),b=v.filter(M=>M.installed).length;function C(M){A(M),f(!0)}function j(){f(!1),A(null),y()}const N=!o||"google workspace gmail calendar drive docs sheets slides".includes(o.toLowerCase());return e.jsxs(it,{className:"h-full",children:[e.jsxs("div",{className:"px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-72",children:e.jsx(Rz,{value:o,onChange:c,placeholder:"Search integrations..."})}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:O.length+(v.length>0?1:0)})]}),e.jsx("div",{className:"mt-4 grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:n?Array.from({length:6}).map((M,Q)=>e.jsx(fee,{},Q)):e.jsxs(e.Fragment,{children:[v.length>0&&N&&e.jsx(oT,{item:{id:"google-workspace",name:"Google Workspace",description:"Gmail, Calendar, Drive, Docs, Sheets, Slides — one sign-in for all",category:"productivity",tags:["google","email","calendar","drive","docs"],verified:"mcp-official",installed:b>0,_installedCount:b},onClick:()=>m(!0)},"google-workspace"),O.map(M=>e.jsx(oT,{item:M,onClick:()=>C(M)},M.id))]})}),!n&&O.length===0&&v.length===0&&e.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No integrations found."})]}),e.jsx(mee,{integration:l,open:u,onClose:j}),e.jsx(xqe,{integrations:t,open:x,onClose:()=>{m(!1),y()}})]})}function Oqe(){const t=$(H=>H.marketplaceAuthenticated),a=$(H=>H.marketplaceLogin),[n,s]=g.useState([]),[o,c]=g.useState([]),[l,A]=g.useState([]),[u,f]=g.useState(!0),[x,m]=g.useState("all"),[y,v]=g.useState(""),[O,b]=g.useState(null),[C,j]=g.useState(null),[N,M]=g.useState(!1),Q=ln(),L=g.useRef(null),B=async()=>{const[H,q]=await Promise.all([D.get("/skills/installed").catch(()=>[]),D.get("/integrations/installed").catch(()=>[])]);c(Array.isArray(H)?H:H.skills||[]),A(Array.isArray(q)?q:q.integrations||[])};g.useEffect(()=>{f(!0),Promise.all([t?D.get("/auth/purchases").then(H=>H.purchases||[]).catch(()=>[]):Promise.resolve([]),D.get("/skills/installed").then(H=>Array.isArray(H)?H:H.skills||[]).catch(()=>[]),D.get("/integrations/installed").then(H=>Array.isArray(H)?H:H.integrations||[]).catch(()=>[])]).then(([H,q,_])=>{s(H),c(q),A(_)}).finally(()=>f(!1))},[t]);async function S(H){var _;const q=(_=H.target.files)==null?void 0:_[0];if(q){try{const R=await q.text(),U=q.name.replace(/\.md$/i,"");await D.post("/skills/import",{name:U,content:R}),Q.success(`Imported "${U}"`),await B()}catch(R){Q.error("Import failed",R.message)}H.target.value=""}}if(O)return e.jsx(gee,{skill:O,onBack:()=>b(null)});const I=y.toLowerCase(),z=x==="all"||x==="skills"?o.filter(H=>!I||(H.name||H.id||"").toLowerCase().includes(I)||(H.description||"").toLowerCase().includes(I)):[],P=x==="all"||x==="integrations"?l.filter(H=>!I||(H.name||H.id||"").toLowerCase().includes(I)||(H.description||"").toLowerCase().includes(I)):[],F=[...z.map(H=>({...H,_type:"skill"})),...P.map(H=>({...H,_type:"integration"}))],K=[{id:"all",label:"All"},{id:"skills",label:"Skills"},{id:"integrations",label:"Integrations"}],G={all:"No skills or integrations installed yet. Visit the Marketplace to get started.",skills:"No skills installed.",integrations:"No integrations installed."};return u?e.jsx("div",{className:"p-5 space-y-3",children:[...Array(4)].map((H,q)=>e.jsx(Xn,{className:"h-14 rounded-md"},q))}):e.jsxs(it,{className:"h-full",children:[e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("div",{className:"w-72",children:e.jsx(Rz,{value:y,onChange:v,placeholder:"Search library..."})}),e.jsx("div",{className:"flex items-center gap-1",children:K.map(H=>e.jsx("button",{onClick:()=>m(H.id),className:`px-3 py-1.5 text-xs font-semibold font-sans rounded-full cursor-pointer select-none transition-colors ${x===H.id?"bg-accent/15 text-accent border border-accent/25":"text-text-3 hover:text-text-1 border border-transparent hover:border-border-subtle"}`,children:H.label},H.id))}),e.jsx("div",{className:"flex-1"}),e.jsx("input",{ref:L,type:"file",accept:".md",onChange:S,className:"hidden"}),e.jsxs(fe,{variant:"secondary",size:"md",onClick:()=>{var H;return(H=L.current)==null?void 0:H.click()},className:"gap-1.5",children:[e.jsx(E0,{size:13}),"Import .md"]}),e.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:F.length})]}),t&&n.length>0&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[e.jsx(TA,{size:12}),"Purchases (",n.length,")"]}),e.jsx("div",{className:"space-y-1.5",children:n.map(H=>{var q,_;return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-1 border border-border-subtle",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center text-sm flex-shrink-0",children:H.skill_icon||((_=(q=H.skill_name)==null?void 0:q[0])==null?void 0:_.toUpperCase())||"?"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:H.skill_name||H.skill_id}),e.jsxs("div",{className:"text-2xs text-text-4 font-sans",children:["$",(H.amount||0).toFixed(2)," · ",Mt(H.created_at)]})]}),e.jsx(be,{variant:"success",className:"text-2xs flex-shrink-0",children:"Owned"})]},H.id||H.skill_id)})})]}),t&&n.length===0&&e.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[e.jsx(TA,{size:20,className:"mx-auto text-text-4 mb-2"}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No purchases yet"})]}),!t&&e.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[e.jsx(TA,{size:20,className:"mx-auto text-text-4 mb-2"}),e.jsx("p",{className:"text-xs text-text-2 font-sans mb-3",children:"Sign in to see your purchases"}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:a,className:"gap-1.5 mx-auto",children:[e.jsx(pu,{size:12})," Sign in"]})]}),F.length>0?e.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:F.map(H=>H._type==="skill"?e.jsx(oT,{item:{...H,installed:!0},onClick:()=>b(H)},`skill-${H.id}`):e.jsx(oT,{item:{...H,installed:!0},onClick:()=>{j(H),M(!0)},statusBadge:e.jsx(be,{variant:H.configured?"success":"warning",className:"text-2xs",children:H.configured?"Active":"Not configured"})},`int-${H.id}`))}):e.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:G[x]})]}),e.jsx(mee,{integration:C,open:N,onClose:()=>{M(!1),j(null),B()}})]})}function bqe(){const t=$(f=>f.importedRepos),a=$(f=>f.fetchImportedRepos),n=$(f=>f.softRemoveRepo),s=$(f=>f.hardNukeRepo),o=ln(),[c,l]=g.useState(null);g.useEffect(()=>{a()},[]);async function A(f){try{await n(f.id),o.success(`Removed ${f.repoName||f.name}`)}catch(x){o.error("Remove failed",x.message)}}async function u(f){if(c){try{f?await s(c.id):await n(c.id),o.success(`${f?"Nuked":"Removed"} ${c.name||c.repo}`)}catch(x){o.error("Nuke failed",x.message)}l(null)}}return e.jsxs(it,{className:"h-full",children:[e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[e.jsx(mqe,{}),t.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3",children:"Recently Imported"}),e.jsx("div",{className:"space-y-2",children:(Array.isArray(t)?t:[]).map(f=>e.jsx(gqe,{repo:f,onRemove:()=>A(f),onNuke:()=>l(f)},f.id))})]}),t.length===0&&e.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No repos imported yet. Paste a GitHub URL above to get started."})]}),e.jsx(yqe,{repo:c,open:!!c,onClose:()=>l(null),onConfirm:u})]})}function wqe(){const[t,a]=g.useState("skills"),n=[{id:"skills",label:"Skills",icon:It},{id:"integrations",label:"Integrations",icon:da},{id:"github",label:"GitHub",icon:Js},{id:"library",label:"My Library",icon:xu}];return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("div",{className:"flex-shrink-0 bg-surface-1 border-b border-border-subtle",children:e.jsxs("div",{className:"flex items-center px-5 h-11",children:[e.jsx("div",{className:"flex items-center",children:n.map(s=>{const o=s.icon;return e.jsxs("button",{onClick:()=>a(s.id),className:`flex items-center gap-1.5 px-3 py-2.5 text-xs font-semibold font-sans cursor-pointer select-none border-b-2 -mb-px transition-colors ${t===s.id?"border-accent text-text-0":"border-transparent text-text-3 hover:text-text-1"}`,children:[e.jsx(o,{size:12}),s.label]},s.id)})}),e.jsx("div",{className:"flex-1"})]})}),e.jsxs("div",{className:"flex-1 min-h-0",children:[t==="skills"&&e.jsx(vqe,{}),t==="integrations"&&e.jsx(kqe,{}),t==="github"&&e.jsx(bqe,{}),t==="library"&&e.jsx(Oqe,{})]})]})}function jqe({team:t,open:a,onOpenChange:n,onArchive:s,onDeletePermanently:o,onPromote:c,mode:l}){const[A,u]=g.useState(""),[f,x]=g.useState(!1),[m,y]=g.useState(!1);g.useEffect(()=>{a||(u(""),x(!1),y(!1))},[a]);const v=A===((t==null?void 0:t.name)||""),O=l!=="production";async function b(){y(!0);try{await c(t==null?void 0:t.id),n(!1)}catch{y(!1)}}return e.jsx(Ut,{open:a,onOpenChange:n,children:e.jsxs(Pt,{title:`Remove Team: ${(t==null?void 0:t.name)||""}`,description:"Choose how to remove this team",children:[e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e.jsx("p",{className:"text-sm text-text-1 font-sans",children:"What would you like to do with this team and its files?"}),O&&c&&e.jsxs("button",{onClick:b,disabled:m,className:"w-full flex items-start gap-3 p-3.5 rounded-lg border border-success/20 bg-success/5 hover:border-success/40 hover:bg-success/10 transition-all cursor-pointer text-left group disabled:opacity-50",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-success/10 flex items-center justify-center flex-shrink-0 group-hover:bg-success/20 transition-colors",children:e.jsx(za,{size:16,className:"text-success"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-semibold text-text-0 font-sans",children:m?"Promoting...":"Promote to Project"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-0.5",children:"Move files to the project directory. The team will be removed but your work stays in the project permanently."})]})]}),e.jsxs("button",{onClick:()=>{s(t==null?void 0:t.id),n(!1)},className:"w-full flex items-start gap-3 p-3.5 rounded-lg border border-border-subtle bg-surface-0 hover:border-accent/30 hover:bg-surface-2 transition-all cursor-pointer text-left group",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center flex-shrink-0 group-hover:bg-accent/20 transition-colors",children:e.jsx(CA,{size:16,className:"text-accent"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-semibold text-text-0 font-sans",children:"Archive"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-0.5",children:l==="production"?"Team metadata will be archived. Your files remain in the project directory.":"Files are preserved. You can restore the team later."})]})]}),e.jsxs("div",{className:"rounded-lg border border-danger/20 bg-danger/5 overflow-hidden",children:[e.jsxs("button",{onClick:()=>x(!0),className:"w-full flex items-start gap-3 p-3.5 cursor-pointer text-left group",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-danger/10 flex items-center justify-center flex-shrink-0 group-hover:bg-danger/20 transition-colors",children:e.jsx(At,{size:16,className:"text-danger"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-semibold text-danger font-sans",children:"Delete Permanently"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-0.5",children:l==="production"?"Team will be removed. Your files remain in the project directory.":"All files in this team will be permanently deleted."})]})]}),f&&e.jsxs("div",{className:"px-3.5 pb-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-warning font-sans",children:[e.jsx(Gt,{size:11}),e.jsxs("span",{children:["Type ",e.jsx("span",{className:"font-mono font-semibold text-text-0",children:t==null?void 0:t.name})," to confirm"]})]}),e.jsx("input",{type:"text",value:A,onChange:C=>u(C.target.value),placeholder:t==null?void 0:t.name,className:"w-full h-8 px-3 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-danger",autoFocus:!0,spellCheck:!1,onKeyDown:C=>{C.key==="Enter"&&v&&(o(t==null?void 0:t.id),n(!1)),C.key==="Escape"&&x(!1)}}),e.jsxs(fe,{variant:"danger",size:"sm",disabled:!v,onClick:()=>{o(t==null?void 0:t.id),n(!1)},className:"w-full",children:[e.jsx(At,{size:12})," Delete Forever"]})]})]})]}),e.jsx("div",{className:"px-5 py-3 border-t border-border-subtle flex justify-end",children:e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>n(!1),children:"Cancel"})})]})})}function Cqe({team:t,open:a,onOpenChange:n,onPurge:s}){const[o,c]=g.useState("");g.useEffect(()=>{a||c("")},[a]);const l=(t==null?void 0:t.originalName)||(t==null?void 0:t.name)||"",A=o===l;return e.jsx(Ut,{open:a,onOpenChange:n,children:e.jsxs(Pt,{title:"Permanently Delete",description:"Confirm permanent deletion",children:[e.jsxs("div",{className:"px-5 py-4 space-y-3",children:[e.jsxs("p",{className:"text-sm text-text-1 font-sans",children:["Permanently delete ",e.jsx("span",{className:"font-semibold text-text-0",children:l}),"?"]}),e.jsx("p",{className:"text-xs text-danger font-sans",children:"This cannot be undone. All team files will be permanently removed."}),e.jsxs("div",{className:"space-y-2 pt-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-warning font-sans",children:[e.jsx(Gt,{size:11}),e.jsxs("span",{children:["Type ",e.jsx("span",{className:"font-mono font-semibold text-text-0",children:l})," to confirm"]})]}),e.jsx("input",{type:"text",value:o,onChange:u=>c(u.target.value),placeholder:l,className:"w-full h-8 px-3 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-danger",autoFocus:!0,spellCheck:!1,onKeyDown:u=>{u.key==="Enter"&&A&&(s(t==null?void 0:t.id),n(!1))}})]})]}),e.jsxs("div",{className:"px-5 py-4 border-t border-border-subtle flex justify-end gap-2",children:[e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>n(!1),children:"Cancel"}),e.jsxs(fe,{variant:"danger",size:"sm",disabled:!A,onClick:()=>{s(t==null?void 0:t.id),n(!1)},children:[e.jsx(At,{size:12})," Delete Forever"]})]})]})})}function Nqe(){const t=$(M=>M.teams),a=$(M=>M.agents),n=$(M=>M.activeTeamId),s=$(M=>M.archiveTeam),o=$(M=>M.deleteTeamPermanently),c=$(M=>M.addToast),l=$(M=>M.archivedTeams),A=$(M=>M.fetchArchivedTeams),u=$(M=>M.restoreTeam),f=$(M=>M.purgeTeam),x=$(M=>M.promoteTeam),[m,y]=g.useState(null),[v,O]=g.useState(null),[b,C]=g.useState(null),[j,N]=g.useState(!1);return g.useEffect(()=>{A()},[]),t.length===0&&l.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(Fa,{size:28,className:"mx-auto text-text-4"}),e.jsx("p",{className:"text-xs font-sans text-text-3",children:"No teams yet"}),e.jsx("p",{className:"text-2xs font-sans text-text-4",children:"Teams are created when you spawn agents or launch a planner"})]})}):e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsx("div",{className:"p-4 space-y-3",children:t.map(M=>{const Q=a.filter(F=>F.teamId===M.id),L=Q.filter(F=>F.status==="running"||F.status==="starting"),B=Q.filter(F=>F.status==="completed"),S=Q.filter(F=>F.status==="crashed"),I=Q.reduce((F,K)=>F+(K.tokensUsed||0),0),z=Q.reduce((F,K)=>F+(K.costUsd||0),0),P=M.id===n;return e.jsxs("div",{className:V("rounded-md border bg-surface-1 overflow-hidden transition-colors",P?"border-accent/30":"border-border-subtle"),children:[e.jsxs("div",{className:"px-4 py-3 flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-text-0 font-sans",children:M.name}),P&&e.jsx(be,{variant:"accent",className:"text-2xs",children:"Active"}),e.jsx(be,{variant:M.mode==="production"?"success":"default",className:"text-2xs",children:M.mode==="production"?"Production":"Sandbox"})]}),M.workingDir&&e.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[e.jsx(Ko,{size:10,className:"text-text-4"}),e.jsx("span",{className:"text-2xs font-mono text-text-3 truncate",children:M.workingDir})]})]}),M.mode!=="production"&&e.jsx("button",{onClick:()=>C(M),className:"p-1.5 text-text-4 hover:text-success rounded transition-colors cursor-pointer",title:"Promote to production",children:e.jsx(za,{size:13})}),e.jsx("button",{onClick:()=>{if(Q.some(F=>F.status==="running"||F.status==="starting")){c("error","Stop running agents first");return}y(M)},className:"p-1.5 text-text-4 hover:text-danger rounded transition-colors cursor-pointer",title:"Archive team",children:e.jsx(At,{size:13})})]}),e.jsxs("div",{className:"px-4 py-2.5 border-t border-border-subtle bg-surface-0 flex items-center gap-4",children:[e.jsx(V1,{label:"Agents",value:Q.length}),e.jsx(V1,{label:"Running",value:L.length,color:L.length>0?"text-success":void 0}),e.jsx(V1,{label:"Done",value:B.length}),e.jsx(V1,{label:"Crashed",value:S.length,color:S.length>0?"text-danger":void 0}),e.jsx("div",{className:"flex-1"}),e.jsx(V1,{label:"Tokens",value:pt(I)}),z>0&&e.jsx(V1,{label:"Cost",value:Ai(z)})]}),Q.length>0&&e.jsx("div",{className:"border-t border-border-subtle",children:Q.map(F=>e.jsxs("div",{className:"flex items-center gap-2 px-4 py-1.5 border-b border-border-subtle last:border-b-0",children:[e.jsx(ia,{status:F.status,size:"sm"}),e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:F.name}),e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase",children:F.role}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"text-2xs font-mono text-text-2 tabular-nums",children:pt(F.tokensUsed||0)})]},F.id))})]},M.id)})}),l.length>0&&e.jsxs("div",{className:"border-t border-border-subtle",children:[e.jsxs("button",{onClick:()=>N(!j),className:"w-full flex items-center gap-2 px-5 py-3 text-left cursor-pointer hover:bg-surface-5/30 transition-colors",children:[e.jsx(Rt,{size:12,className:V("text-text-4 transition-transform duration-200",j&&"rotate-90")}),e.jsx(CA,{size:13,className:"text-text-3"}),e.jsx("span",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider flex-1",children:"Archived Teams"}),e.jsx("span",{className:"text-2xs font-mono text-text-4 bg-surface-4 px-1.5 py-0.5 rounded",children:l.length})]}),j&&e.jsx("div",{className:"px-4 pb-4 space-y-2",children:l.map(M=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-0 border border-border-subtle",children:[e.jsx(CA,{size:13,className:"text-text-4 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:M.originalName||M.name}),(M.deletedAt||M.archivedAt)&&e.jsxs("div",{className:"text-2xs text-text-4 font-mono mt-0.5",children:["Archived ",Mt(M.deletedAt||M.archivedAt)]})]}),e.jsx("button",{onClick:()=>u(M.id),className:"p-1.5 text-text-3 hover:text-accent rounded transition-colors cursor-pointer",title:"Restore team",children:e.jsx(Cs,{size:13})}),e.jsx("button",{onClick:()=>O(M),className:"p-1.5 text-text-4 hover:text-danger rounded transition-colors cursor-pointer",title:"Permanently delete",children:e.jsx(At,{size:13})})]},M.id))})]}),e.jsx(jqe,{team:m,open:!!m,onOpenChange:M=>!M&&y(null),onArchive:s,onDeletePermanently:o,onPromote:x,mode:(m==null?void 0:m.mode)||"sandbox"}),e.jsx(Cqe,{team:v,open:!!v,onOpenChange:M=>!M&&O(null),onPurge:f}),e.jsx(Mqe,{team:b,open:!!b,onOpenChange:M=>!M&&C(null),onPromote:x})]})}function Mqe({team:t,open:a,onOpenChange:n,onPromote:s}){const[o,c]=g.useState(!1);g.useEffect(()=>{a||c(!1)},[a]);async function l(){c(!0);try{await s(t==null?void 0:t.id),n(!1)}catch{c(!1)}}return e.jsx(Ut,{open:a,onOpenChange:n,children:e.jsxs(Pt,{title:"Promote to Production",description:"Promote this team to production mode",children:[e.jsxs("div",{className:"px-5 py-4 space-y-3",children:[e.jsxs("p",{className:"text-sm text-text-1 font-sans",children:["Promote ",e.jsx("span",{className:"font-semibold text-text-0",children:t==null?void 0:t.name})," to production?"]}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"This will move files from the team directory into the project directory. The team will be removed but your work stays in the project permanently."})]}),e.jsxs("div",{className:"px-5 py-3 border-t border-border-subtle flex justify-end gap-2",children:[e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>n(!1),children:"Cancel"}),e.jsxs(fe,{variant:"primary",size:"sm",disabled:o,onClick:l,className:"gap-1.5",children:[e.jsx(za,{size:12}),o?"Promoting...":"Promote"]})]})]})})}function V1({label:t,value:a,color:n}){return e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:V("text-xs font-mono tabular-nums",n||"text-text-1"),children:a}),e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider",children:t})]})}function Sqe(){const t=$(s=>s.pendingApprovals),a=$(s=>s.approveRequest),n=$(s=>s.rejectRequest);return t.length===0?null:e.jsxs("div",{className:"px-4 pt-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Gt,{size:12,className:"text-warning"}),e.jsxs("span",{className:"text-2xs font-mono text-warning uppercase tracking-wider",children:["Pending (",t.length,")"]})]}),t.map(s=>{var o,c,l;return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md bg-warning/5 border border-warning/20",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-xs text-text-0 font-sans font-medium truncate",children:[s.agentName,": ",((o=s.action)==null?void 0:o.description)||((c=s.action)==null?void 0:c.type)||"action"]}),((l=s.action)==null?void 0:l.filePath)&&e.jsx("div",{className:"text-2xs font-mono text-text-3 truncate mt-0.5",children:s.action.filePath}),e.jsx("div",{className:"text-2xs text-text-4 font-mono mt-0.5",children:Mt(s.requestedAt)})]}),e.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>a(s.id),className:"h-7 px-2.5 gap-1 text-2xs",children:[e.jsx(ku,{size:10})," Approve"]}),e.jsxs(fe,{variant:"danger",size:"sm",onClick:()=>n(s.id),className:"h-7 px-2.5 gap-1 text-2xs",children:[e.jsx($r,{size:10})," Reject"]})]})]},s.id)})]})}function Qqe(){const t=$(u=>u.resolvedApprovals),[a,n]=g.useState([]),[s,o]=g.useState(!0);g.useEffect(()=>{const u=setInterval(c,4e3);return c(),()=>clearInterval(u)},[]);async function c(){try{const u=await D.get("/pm/history");n(u.history||u||[])}catch{}o(!1)}const l=new Set,A=[...t,...a].filter(u=>{const f=u.id||`${u.agentName}-${u.timestamp}`;return l.has(f)?!1:(l.add(f),!0)});return e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsx(Sqe,{}),e.jsxs("div",{className:"p-4 space-y-1.5",children:[s&&A.length===0&&e.jsx("div",{className:"text-center py-12 text-text-4 font-mono text-xs",children:"Loading..."}),!s&&A.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Sa,{size:24,className:"mx-auto mb-2 text-text-4"}),e.jsx("p",{className:"text-xs font-sans text-text-3",children:"No approval history"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans mt-1",children:"Approvals appear when agents use Auto permission mode"})]}),A.map((u,f)=>{var m;const x=u.status==="approved"||u.verdict==="approved";return e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 rounded-md bg-surface-0 border border-border-subtle",children:[x?e.jsx(Sa,{size:12,className:"text-success flex-shrink-0"}):e.jsx(qn,{size:12,className:"text-danger flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-xs text-text-1 font-sans truncate",children:[e.jsx("span",{className:"font-medium text-text-0",children:u.agentName}),e.jsx("span",{className:"text-text-3 mx-1",children:"·"}),e.jsx("span",{children:((m=u.action)==null?void 0:m.description)||u.action||"action"})]}),u.reason&&e.jsx("div",{className:"text-2xs text-text-3 font-sans truncate mt-0.5",children:u.reason})]}),e.jsx("span",{className:"text-2xs font-mono text-text-4 flex-shrink-0",children:Mt(u.resolvedAt||u.timestamp)})]},u.id||f)})]})]})}function Bqe(){const[t,a]=g.useState([]),[n,s]=g.useState(!0),o=ln();g.useEffect(()=>{const A=setInterval(c,1e4);return c(),()=>clearInterval(A)},[]);async function c(){try{const A=await D.get("/schedules");a(A.schedules||A||[])}catch{}s(!1)}async function l(A,u){try{await D.post(`/schedules/${A}/${u?"disable":"enable"}`),c()}catch(f){o.error("Failed to toggle schedule",f.message)}}return e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"p-4 space-y-2",children:[n&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-4 font-mono text-xs",children:"Loading..."}),!n&&t.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Wo,{size:24,className:"mx-auto mb-2 text-text-4"}),e.jsx("p",{className:"text-xs font-sans text-text-3",children:"No schedules configured"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans mt-1",children:"Use the CLI to create agent schedules"})]}),t.map(A=>e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:A.name}),e.jsx(be,{variant:A.enabled?"success":"default",className:"text-2xs",children:A.enabled?"Active":"Paused"})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("span",{className:"text-2xs font-mono text-text-2",children:A.cron}),e.jsx("span",{className:"text-2xs text-text-4",children:"·"}),e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase",children:A.role}),A.teamId&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-text-4",children:"·"}),e.jsx("span",{className:"text-2xs font-sans text-text-3",children:A.teamName||A.teamId})]})]}),A.prompt&&e.jsx("div",{className:"text-2xs font-sans text-text-4 mt-1 truncate",children:A.prompt})]}),e.jsx(fe,{variant:"secondary",size:"sm",onClick:()=>l(A.id,A.enabled),className:"h-7 px-2.5 gap-1 text-2xs",children:A.enabled?e.jsxs(e.Fragment,{children:[e.jsx(L0,{size:10})," Pause"]}):e.jsxs(e.Fragment,{children:[e.jsx(ei,{size:10})," Enable"]})})]}),A.lastRunAt&&e.jsxs("div",{className:"px-4 py-1.5 border-t border-border-subtle bg-surface-1 text-2xs font-mono text-text-4",children:["Last run: ",Mt(A.lastRunAt),A.nextRunAt&&e.jsxs("span",{className:"ml-3",children:["Next: ",Mt(A.nextRunAt)]})]})]},A.id))]})})}function _qe(){return e.jsxs(Pz,{defaultValue:"dashboard",className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-4 pt-3 bg-surface-1 border-b border-border",children:[e.jsx("div",{className:"flex items-center gap-4 mb-0",children:e.jsx("h2",{className:"text-xs font-semibold text-text-0 font-sans tracking-wide uppercase",children:"Management"})}),e.jsxs(Ez,{className:"border-b-0",children:[e.jsxs(ys,{value:"dashboard",className:"inline-flex items-center gap-1.5",children:[e.jsx(k0,{size:12}),"Teams"]}),e.jsxs(ys,{value:"approvals",className:"inline-flex items-center gap-1.5",children:[e.jsx(w0,{size:12}),"Approvals"]}),e.jsxs(ys,{value:"schedules",className:"inline-flex items-center gap-1.5",children:[e.jsx(Wo,{size:12}),"Schedules"]})]})]}),e.jsx(vs,{value:"dashboard",className:"flex flex-col min-h-0",children:e.jsx(Nqe,{})}),e.jsx(vs,{value:"approvals",className:"flex flex-col min-h-0",children:e.jsx(Qqe,{})}),e.jsx(vs,{value:"schedules",className:"flex flex-col min-h-0",children:e.jsx(Bqe,{})})]})}const Lqe={code:"Code",general:"General"},Tqe={light:"text-success",medium:"text-accent",heavy:"text-warning"};function $qe(t){return t<1?`${Math.round(t*1024)} MB`:`${t} GB`}function yee({hardware:t}){if(!t)return null;const{totalRamGb:a,gpu:n,isAppleSilicon:s}=t;return e.jsxs("div",{className:"flex items-center gap-3 bg-surface-0 rounded-lg border border-border-subtle px-3 py-2.5",children:[e.jsx(Dr,{size:14,className:"text-text-3 flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center gap-2 text-xs font-sans",children:[e.jsxs("span",{className:"text-text-0 font-semibold",children:[a," GB RAM"]}),n&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-4",children:"·"}),e.jsx("span",{className:"text-text-2",children:n.name})]}),s&&e.jsx(be,{variant:"accent",className:"text-2xs",children:"Unified Memory"})]})})]})}function Iqe({onRecheck:t}){const[a,n]=g.useState(null),[s,o]=g.useState(!1),[c,l]=g.useState(!1),[A,u]=g.useState(!1),f=$(Q=>Q.addToast);g.useEffect(()=>{D.post("/providers/ollama/check").then(n).catch(()=>{})},[]);async function x(){o(!0);try{const Q=await D.post("/providers/ollama/check");n(Q),Q.installed&&Q.serverRunning?(f("success","Ollama is ready!"),t()):Q.installed?f("info","Ollama installed — server needs to start"):f("info","Ollama not found — install and try again")}catch{}o(!1)}async function m(){l(!0);try{if((await D.post("/providers/ollama/serve")).ok){f("success","Ollama server started!");let L=!1;for(let B=0;B<5;B++){await new Promise(I=>setTimeout(I,2e3));const S=await D.post("/providers/ollama/check");if(n(S),S.serverRunning){L=!0;break}}L&&t()}}catch(Q){f("error","Could not start server",Q.message)}l(!1)}function y(Q){navigator.clipboard.writeText(Q),u(!0),setTimeout(()=>u(!1),2e3)}if(!a)return e.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Loading..."});const{hardware:v,install:O,requirements:b,installed:C,serverRunning:j}=a,N=v.totalRamGb>=b.minRAM,M=v.recommended;return e.jsxs("div",{className:"space-y-3 p-3",children:[e.jsx(yee,{hardware:v}),N?e.jsxs("div",{className:"flex items-start gap-2 bg-success/8 border border-success/20 rounded-lg px-3 py-2.5",children:[e.jsx(De,{size:14,className:"text-success flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-xs font-sans",children:[e.jsx("span",{className:"text-success font-semibold",children:"Your system is ready."}),e.jsx("span",{className:"text-text-2 ml-1",children:M.code?`Recommended: ${M.code}`:`${v.totalRamGb} GB RAM available`})]})]}):e.jsxs("div",{className:"flex items-start gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[e.jsx(Xt,{size:14,className:"text-warning flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-xs font-sans text-text-2",children:[e.jsxs("span",{className:"text-warning font-semibold",children:[v.totalRamGb," GB RAM detected."]})," ","Minimum ",b.minRAM," GB needed. Smallest models may still work."]})]}),C&&!j&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[e.jsx(Xt,{size:14,className:"text-warning flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-xs font-sans text-text-2",children:[e.jsx("span",{className:"text-warning font-semibold",children:"Ollama installed but server not running."})," ","The server needs to be running to pull and use models."]})]}),e.jsxs(fe,{variant:"primary",size:"md",onClick:m,disabled:c,className:"w-full gap-1.5",children:[e.jsx(wt,{size:12}),c?"Starting...":"Start Ollama Server"]})]}),!C&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-semibold text-text-1 font-sans",children:"Install Ollama"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 bg-surface-0 border border-border-subtle rounded-md px-3 py-2 text-xs font-mono text-text-1 truncate",children:O.command}),e.jsxs(fe,{variant:"secondary",size:"sm",onClick:()=>y(O.command),className:"h-8 px-2.5 gap-1 flex-shrink-0",children:[A?e.jsx(De,{size:12}):e.jsx(wn,{size:12}),A?"Copied":"Copy"]})]}),O.alt&&e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:O.alt})]}),e.jsxs(fe,{variant:"secondary",size:"md",onClick:x,disabled:s,className:"w-full gap-1.5",children:[e.jsx(ra,{size:12,className:s?"animate-spin":""}),s?"Checking...":C?"Check again":"I installed it — check again"]})]})}function Uqe({model:t,isInstalled:a,isRecommended:n,canRun:s,onPull:o,onDelete:c,pulling:l}){const A=l===t.id;return e.jsxs("div",{className:V("flex items-center gap-2 px-3 py-2 border-t border-border-subtle transition-colors",!s&&"opacity-40"),children:[a?e.jsx(De,{size:12,className:"text-success flex-shrink-0"}):e.jsx("div",{className:"w-3"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-mono text-text-1 truncate",children:t.name}),n&&e.jsx(IA,{size:10,className:"text-warning flex-shrink-0"})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsx("span",{className:V("text-2xs font-semibold font-sans",Tqe[t.tier]),children:t.tier}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:$qe(t.sizeGb)}),e.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:["· ",t.ramGb," GB RAM"]})]})]}),a?e.jsx("button",{onClick:()=>c(t.id),className:"p-1.5 text-text-4 hover:text-danger rounded transition-colors cursor-pointer",title:"Remove model",children:e.jsx(At,{size:12})}):s?e.jsx(fe,{variant:"secondary",size:"sm",onClick:()=>o(t.id),disabled:!!l,className:"h-7 px-2 text-2xs gap-1",children:A?e.jsxs(e.Fragment,{children:[e.jsx(ra,{size:10,className:"animate-spin"})," Pulling..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_a,{size:10})," Pull"]})}):e.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:["Needs ",t.ramGb," GB"]})]})}function Pqe({onStopped:t}){const[a,n]=g.useState(null),s=$(l=>l.addToast);async function o(){n("stopping");try{(await D.post("/providers/ollama/stop")).ok?(s("info","Ollama server stopped"),t&&t()):s("error","Could not stop server")}catch(l){s("error","Stop failed",l.message)}n(null)}async function c(){n("restarting");try{(await D.post("/providers/ollama/restart")).ok?s("success","Ollama server restarted"):s("error","Restart failed")}catch(l){s("error","Restart failed",l.message)}n(null)}return e.jsxs("div",{className:"flex items-center gap-2 bg-success/8 border border-success/20 rounded-lg px-3 py-2",children:[e.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[e.jsx("span",{className:"absolute inset-0 rounded-full bg-success"}),e.jsx("span",{className:"absolute inset-[-2px] rounded-full bg-success opacity-20 animate-pulse"})]}),e.jsx("span",{className:"text-xs font-sans text-success font-semibold",children:"Server Running"}),e.jsx("span",{className:"text-2xs font-mono text-text-4",children:":11434"}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{onClick:c,disabled:!!a,className:"flex items-center gap-1 text-2xs font-sans text-text-3 hover:text-accent cursor-pointer transition-colors disabled:opacity-40",children:[e.jsx(ra,{size:10,className:a==="restarting"?"animate-spin":""}),a==="restarting"?"Restarting...":"Restart"]}),e.jsxs("button",{onClick:o,disabled:!!a,className:"flex items-center gap-1 text-2xs font-sans text-text-3 hover:text-danger cursor-pointer transition-colors disabled:opacity-40",children:[e.jsx(Xt,{size:10}),a==="stopping"?"Stopping...":"Stop"]})]})}function Eqe({onModelChange:t}){var I,z;const[a,n]=g.useState(null),[s,o]=g.useState(null),[c,l]=g.useState("code"),[A,u]=g.useState(!1),[f,x]=g.useState(!1),m=$(P=>P.addToast),y=g.useRef(!1);function v(){D.get("/providers/ollama/models").then(P=>{var F;n(P),!y.current&&((F=P.installed)==null?void 0:F.length)===0&&(y.current=!0,setTimeout(v,2e3))}).catch(()=>{})}g.useEffect(()=>{v()},[]);async function O(P){o(P);try{await D.post("/providers/ollama/pull",{model:P}),m("success",`Pulled ${P}`),v(),t&&t()}catch(F){m("error",`Pull failed: ${F.message}`)}o(null)}async function b(P){try{await D.delete(`/providers/ollama/models/${encodeURIComponent(P)}`),m("info",`Removed ${P}`),v(),t&&t()}catch(F){m("error",`Delete failed: ${F.message}`)}}if(!a)return e.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Loading..."});const{installed:C,catalog:j,hardware:N}=a,M=new Set(C.map(P=>P.id)),Q=N.totalRamGb,L=[(I=N.recommended)==null?void 0:I.code,(z=N.recommended)==null?void 0:z.general].filter(Boolean),B=j.filter(P=>P.category===c),S=A?B:B.filter(P=>P.ramGb<=Q);return f?e.jsxs("div",{className:"space-y-3 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[e.jsx(Xt,{size:14,className:"text-warning flex-shrink-0"}),e.jsxs("span",{className:"text-xs font-sans text-text-2",children:[e.jsx("span",{className:"text-warning font-semibold",children:"Ollama server stopped."})," ","Start it again to pull and use models."]})]}),e.jsxs(fe,{variant:"primary",size:"md",onClick:async()=>{try{(await D.post("/providers/ollama/serve")).ok&&(m("success","Ollama server started!"),x(!1),y.current=!1,setTimeout(v,2e3))}catch(P){m("error","Could not start server",P.message)}},className:"w-full gap-1.5",children:[e.jsx(wt,{size:12}),"Start Ollama Server"]})]}):e.jsxs("div",{className:"space-y-2 p-3",children:[e.jsx(Pqe,{onStopped:()=>x(!0)}),e.jsx(yee,{hardware:N}),C.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-sans text-text-2",children:[e.jsx(Kn,{size:12,className:"text-text-3"}),e.jsx("span",{className:"font-semibold",children:C.length})," model",C.length!==1?"s":""," installed"]}),e.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:Object.entries(Lqe).map(([P,F])=>e.jsx("button",{onClick:()=>l(P),className:V("flex-1 px-3 py-1.5 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",c===P?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:F},P))}),e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-0 overflow-hidden",children:[S.map(P=>e.jsx(Uqe,{model:P,isInstalled:M.has(P.id),isRecommended:L.includes(P.id),canRun:P.ramGb<=Q,onPull:O,onDelete:b,pulling:s},P.id)),S.length===0&&e.jsxs("div",{className:"px-3 py-4 text-center text-xs text-text-4 font-sans",children:["No ",c," models available for your hardware"]})]}),!A&&B.length>S.length&&e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1 text-2xs text-text-3 hover:text-accent font-sans cursor-pointer transition-colors",children:[e.jsx(bt,{size:10}),"Show ",B.length-S.length," more (exceed your RAM)"]})]})}function vee({isInstalled:t,onModelChange:a}){const[n,s]=g.useState(!1),[o,c]=g.useState(!1);return g.useEffect(()=>{t?D.post("/providers/ollama/check").then(l=>{s(l.installed&&l.serverRunning),c(!0)}).catch(()=>c(!0)):c(!0)},[t]),o?n?e.jsx(Eqe,{onModelChange:a}):e.jsx(Iqe,{onRecheck:()=>{s(!0),a&&a()}}):e.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Checking Ollama..."})}const UX={"claude-code":{name:"Claude Code",letter:"C",color:"bg-purple/20 text-purple",installLabel:"We are downloading Claude Code for you",authLabel:"Sign in with your Anthropic account",keyPlaceholder:"sk-ant-...",keyHint:"Paste from console.anthropic.com",loginLabel:"Sign In with Anthropic",authType:"subscription"},codex:{name:"Codex",letter:"X",color:"bg-success/20 text-success",installLabel:"We are downloading Codex for you",authLabel:"Connect your OpenAI account",keyPlaceholder:"sk-...",keyHint:"Paste from platform.openai.com",loginLabel:"Sign in with ChatGPT Plus",authType:"apikey"},gemini:{name:"Gemini CLI",letter:"G",color:"bg-info/20 text-info",installLabel:"We are downloading Gemini CLI for you",authLabel:"Add your Gemini API key",keyPlaceholder:"AIza...",keyHint:"Paste from aistudio.google.com",authType:"apikey"}},PX=["Install","Authenticate","Verify","Done"];function zqe({current:t}){return e.jsx("div",{className:"flex items-center gap-1 mb-6",children:PX.map((a,n)=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:V("w-6 h-6 rounded-full flex items-center justify-center text-2xs font-bold font-mono transition-colors",n<t?"bg-success/15 text-success":n===t?"bg-accent/15 text-accent ring-1 ring-accent/30":"bg-surface-4 text-text-4"),children:n<t?e.jsx(De,{size:10,strokeWidth:3}):n+1}),e.jsx("span",{className:V("text-2xs font-sans font-medium hidden sm:inline",n===t?"text-text-0":"text-text-4"),children:a}),n<PX.length-1&&e.jsx("div",{className:V("w-6 h-px mx-1",n<t?"bg-success/40":"bg-border-subtle")})]},a))})}function Fqe({providerId:t,meta:a}){const n=$(y=>y.installProvider),s=$(y=>y.providerInstallProgress[t]),[o,c]=g.useState(!1),[l,A]=g.useState(!1),u=s==null?void 0:s.installing,f=s==null?void 0:s.done,x=s==null?void 0:s.error,m=(s==null?void 0:s.percent)||0;return g.useEffect(()=>{l||(A(!0),n(t).catch(()=>{}))},[]),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:V("w-10 h-10 rounded-lg flex items-center justify-center text-sm font-bold font-mono",a.color),children:a.letter}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text-0 font-sans",children:a.installLabel}),e.jsx("p",{className:"text-2xs text-text-3 font-sans",children:"This may take a minute"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-2 bg-surface-4 rounded-full overflow-hidden",children:u?e.jsx("div",{className:"h-full bg-gradient-to-r from-accent to-accent/60 rounded-full transition-all duration-500 ease-out",style:{width:`${Math.max(m,5)}%`}}):f?e.jsx("div",{className:"h-full bg-success rounded-full w-full"}):x?e.jsx("div",{className:"h-full bg-danger rounded-full",style:{width:"100%"}}):null}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:V("text-2xs font-sans",x?"text-danger":f?"text-success":"text-text-3"),children:x?typeof x=="string"?x:"Something went wrong":f?"Installed successfully":(s==null?void 0:s.message)||"Preparing..."}),u&&e.jsxs("button",{onClick:()=>c(!o),className:"flex items-center gap-1 text-2xs text-text-4 hover:text-text-2 cursor-pointer font-sans",children:[o?"Hide":"Show"," details",o?e.jsx(su,{size:10}):e.jsx(bt,{size:10})]})]})]}),o&&(s==null?void 0:s.message)&&e.jsx("div",{className:"p-3 bg-surface-0 border border-border-subtle rounded-md max-h-24 overflow-y-auto",children:e.jsx("p",{className:"text-2xs font-mono text-text-3 whitespace-pre-wrap",children:s.message})}),x&&e.jsxs("div",{className:"space-y-3",children:[typeof x=="string"&&e.jsx("div",{className:"p-3 bg-danger/5 border border-danger/20 rounded-md max-h-32 overflow-y-auto",children:e.jsx("p",{className:"text-2xs font-mono text-danger whitespace-pre-wrap break-all",children:x})}),e.jsx("p",{className:"text-xs text-text-2 font-sans",children:"Check that npm is in your PATH and try again."}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>n(t).catch(()=>{}),className:"gap-1.5",children:[e.jsx(Cs,{size:11})," Try Again"]})]})]})}function Rqe({providerId:t,meta:a,onSaveKey:n}){const s=$(v=>v.addToast),[o,c]=g.useState(""),[l,A]=g.useState(!1),[u,f]=g.useState(!1),[x,m]=g.useState(t==="claude-code"||t==="codex"?"terminal":"apikey");async function y(){if(o.trim()){f(!0);try{await D.post(`/credentials/${encodeURIComponent(t)}`,{key:o.trim()}),s("success",`API key saved for ${a.name}`),n()}catch(v){s("error","Failed to save key",v.message)}finally{f(!1)}}}return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm font-medium text-text-0 font-sans",children:a.authLabel}),t==="claude-code"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-text-2 font-sans",children:"Sign in via the terminal with your Claude subscription."}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"1"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Open the Groove terminal below"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"2"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"claude"})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"3"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Follow the prompts to sign in with your Anthropic account"})]})]}),e.jsx("button",{onClick:()=>m(x==="apikey"?"terminal":"apikey"),className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans",children:x==="apikey"?"Use terminal login instead":"I have an API key instead"})]}),t==="codex"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-text-2 font-sans",children:"Sign in via the terminal with your OpenAI account."}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"1"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Open the Groove terminal below"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"2"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"npm i -g @openai/codex"})," (if not installed)"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"3"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"codex login"})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"4"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Follow the prompts to authenticate"})]})]}),e.jsx("button",{onClick:()=>m(x==="apikey"?"terminal":"apikey"),className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans",children:x==="apikey"?"Use terminal login instead":"I have an API key instead"})]}),x==="apikey"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"text-2xs font-semibold text-text-2 font-sans block",children:[a.name," API Key"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx("input",{type:l?"text":"password",value:o,onChange:v=>c(v.target.value),onKeyDown:v=>v.key==="Enter"&&y(),placeholder:a.keyPlaceholder,className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:()=>A(!l),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:l?e.jsx(jn,{size:12}):e.jsx(na,{size:12})})]}),e.jsx(fe,{variant:"primary",size:"lg",onClick:y,disabled:!o.trim()||u,children:u?"Saving...":"Save"})]}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:a.keyHint})]})]})}function Hqe({providerId:t,meta:a,onVerified:n}){const s=$(f=>f.verifyProvider),[o,c]=g.useState("verifying"),[l,A]=g.useState(null);async function u(){c("verifying"),A(null);try{const f=await s(t);f!=null&&f.installed&&!(f!=null&&f.error)?(c("success"),n()):(c("failed"),A((f==null?void 0:f.error)||"Could not verify the provider. Please check your credentials."))}catch(f){c("failed"),A(f.message||"Verification failed. Please try again.")}}return g.useEffect(()=>{u()},[]),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:V("w-10 h-10 rounded-lg flex items-center justify-center text-sm font-bold font-mono",a.color),children:a.letter}),e.jsx("p",{className:"text-sm font-medium text-text-0 font-sans",children:o==="verifying"?"Checking your connection...":o==="success"?"Everything looks good!":"We could not verify the connection"})]}),o==="verifying"&&e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-accent/5 border border-accent/15 rounded-md",children:[e.jsx($e,{size:14,className:"text-accent animate-spin"}),e.jsxs("span",{className:"text-xs text-accent font-sans",children:["Verifying ",a.name,"..."]})]}),o==="success"&&e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-success/8 border border-success/20 rounded-md",children:[e.jsx(De,{size:14,className:"text-success"}),e.jsxs("span",{className:"text-xs text-success font-sans",children:[a.name," is connected and ready to use"]})]}),o==="failed"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center gap-2 p-3 bg-danger/8 border border-danger/20 rounded-md",children:e.jsx("span",{className:"text-xs text-danger font-sans",children:l})}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:u,className:"gap-1.5",children:[e.jsx(Cs,{size:11})," Try Again"]})]})]})}function qqe({meta:t}){return e.jsxs("div",{className:"flex flex-col items-center text-center gap-4 py-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-success/15 flex items-center justify-center",children:e.jsx(De,{size:24,className:"text-success",strokeWidth:2.5})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-base font-semibold text-text-0 font-sans",children:[t.name," is ready!"]}),e.jsxs("p",{className:"text-xs text-text-3 font-sans mt-1",children:["You can now spawn agents using ",t.name,"."]})]})]})}function Dqe({open:t,onOpenChange:a,providerId:n,initialStep:s=0,onComplete:o}){const c=UX[n]||UX["claude-code"],[l,A]=g.useState(s),[u,f]=g.useState(!1),x=$(b=>{var C;return(C=b.providerInstallProgress[n])==null?void 0:C.done});g.useEffect(()=>{t&&(A(s),f(!1))},[t,n]);function m(){A(2)}function y(){f(!0)}function v(){a(!1),o&&o()}const O=l===0?!!x:l===1?!0:l===2?u:!0;return e.jsx(Ut,{open:t,onOpenChange:a,children:e.jsx(Pt,{title:`Set up ${c.name}`,description:`Install and configure ${c.name}`,className:"max-w-md",children:e.jsxs("div",{className:"px-5 py-4",children:[e.jsx(zqe,{current:l}),l===0&&e.jsx(Fqe,{providerId:n,meta:c}),l===1&&e.jsx(Rqe,{providerId:n,meta:c,onSaveKey:m}),l===2&&e.jsx(Hqe,{providerId:n,meta:c,onVerified:y}),l===3&&e.jsx(qqe,{meta:c}),e.jsxs("div",{className:"flex justify-between mt-6 pt-4 border-t border-border-subtle",children:[l>0&&l<3?e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>A(l-1),children:"Back"}):e.jsx("div",{}),l<3?e.jsx(fe,{variant:"primary",size:"sm",disabled:!O,onClick:()=>A(l+1),className:"gap-1.5",children:l===0?"Next":l===1?"Skip verification":"Continue"}):e.jsxs(fe,{variant:"primary",size:"sm",onClick:v,className:"gap-1.5",children:[e.jsx(It,{size:11})," Done"]})]})]})})})}function HT({children:t,...a}){return e.jsx(EG,{...a,children:t})}function qT({children:t,className:a,title:n,side:s="right",width:o=400,...c}){return e.jsxs(zG,{children:[e.jsx(FG,{className:"fixed inset-0 z-40 bg-black/30"}),e.jsxs(RG,{className:V("fixed top-0 z-50 h-full overflow-y-auto","bg-surface-1 border-l border-border shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out",s==="right"&&"right-0 data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",s==="left"&&"left-0 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",a),style:{width:o},...c,children:[n&&e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border-subtle sticky top-0 bg-surface-1 z-10",children:[e.jsx(kT,{className:"text-base font-semibold text-text-0 font-sans",children:n}),e.jsx(WE,{className:"p-1 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer",children:e.jsx(Ge,{size:16})})]}),e.jsx(HG,{className:"sr-only",children:"Panel"}),t]})]})}function kee({value:t,onChange:a}){return e.jsx("button",{onClick:()=>a(!t),className:V("w-9 h-5 rounded-full p-0.5 transition-colors cursor-pointer",t?"bg-accent":"bg-surface-5"),children:e.jsx("div",{className:V("w-4 h-4 rounded-full bg-white shadow-sm transition-transform",t?"translate-x-4":"translate-x-0")})})}const Vqe={"claude-code":"sk-ant-...",codex:"Paste from platform.openai.com",gemini:"Paste from aistudio.google.com",grok:"xai-..."};function Xqe({provider:t,onKeyChange:a}){var Z,J,Ae,W;const[n,s]=g.useState(!1),[o,c]=g.useState(""),[l,A]=g.useState(!1),[u,f]=g.useState(!1),[x,m]=g.useState(!1),[y,v]=g.useState(0),[O,b]=g.useState(!1),[C,j]=g.useState(""),[N,M]=g.useState(!1),Q=$(ae=>ae.addToast),L=$(ae=>ae.providerInstallProgress[t.id]),B=$(ae=>ae.setProviderPath),S=$(ae=>ae.verifyProvider),I=$(ae=>ae.installProvider),[z,P]=g.useState(!1),F=t.authType==="local",K=t.authType==="subscription",G=F?t.installed:K?t.installed&&((Z=t.authStatus)==null?void 0:Z.authenticated):t.installed&&t.hasKey;async function H(){if(o.trim())try{await D.post(`/credentials/${encodeURIComponent(t.id)}`,{key:o.trim()}),Q("success",`API key set for ${t.name}`),c(""),s(!1),a&&a()}catch(ae){Q("error","Failed to set key",ae.message)}}async function q(){try{await D.delete(`/credentials/${encodeURIComponent(t.id)}`),Q("info",`Removed ${t.name} key`),a&&a()}catch(ae){Q("error","Remove failed",ae.message)}}async function _(){if(C.trim()){M(!0);try{await B(t.id,C.trim()),b(!1),a&&a()}catch{}M(!1)}}if(F){const ae=((Ae=(J=t.models)==null?void 0:J.filter(ve=>!ve.disabled))==null?void 0:Ae.length)||0,Oe=()=>$.getState().setActiveView("models");return e.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[e.jsx(ia,{status:G&&ae>0?"running":"crashed",size:"sm"}),e.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:t.name}),e.jsx("div",{className:"flex-1"}),G&&ae>0?e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(De,{size:8})," ",ae," models"]}):G?e.jsx(be,{variant:"warning",className:"text-2xs",children:"No models pulled"}):e.jsx(be,{variant:"default",className:"text-2xs",children:"Not set up"})]}),e.jsx("div",{className:"flex-1",children:u?e.jsxs(e.Fragment,{children:[e.jsx(vee,{isInstalled:G,onModelChange:a}),e.jsxs("div",{className:"px-4 py-2 border-t border-border-subtle flex gap-2",children:[e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>f(!1),className:"flex-1 h-7 text-2xs",children:"Back"}),e.jsx(fe,{variant:"secondary",size:"sm",onClick:()=>{f(!1),Oe()},className:"flex-1 h-7 text-2xs gap-1",children:"Models Tab"})]})]}):e.jsxs("div",{className:"px-4 py-3 flex flex-col h-full",children:[e.jsx("div",{className:"text-xs text-text-3 font-sans flex-1",children:G&&ae>0?"Full agentic runtime — tool calling, context rotation, zero cloud cost":G?"Ollama is running. Pull a model to start using local agents.":"Run any open-source model locally — free, private, fully offline. Requires Ollama."}),e.jsxs("div",{className:"flex gap-2 mt-3",children:[G?e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>f(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[e.jsx(Ba,{size:11})," ",ae>0?"Manage":"Pull Models"]}):e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>f(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[e.jsx(Ba,{size:11})," Set Up Ollama"]}),e.jsx(fe,{variant:"secondary",size:"sm",onClick:Oe,className:"flex-1 h-7 text-2xs gap-1.5",children:"Models Tab"})]})]})})]})}const R=L==null?void 0:L.installing,U=t.installed||(L==null?void 0:L.done);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[e.jsx(ia,{status:G?"running":R?"idle":"crashed",size:"sm"}),e.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:t.name}),e.jsx("div",{className:"flex-1"}),G?e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(De,{size:8})," Ready"]}):R?e.jsxs(be,{variant:"default",className:"text-2xs gap-1",children:[e.jsx($e,{size:8,className:"animate-spin"})," Installing"]}):e.jsx(be,{variant:"default",className:"text-2xs",children:U?K?"Not signed in":"No key":"Not installed"})]}),e.jsxs("div",{className:"flex-1 flex flex-col px-4 py-3 min-h-[120px]",children:[((W=t.models)==null?void 0:W.length)>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:t.models.map(ae=>e.jsx("span",{className:"px-1.5 py-0.5 rounded bg-surface-4 text-2xs font-mono text-text-3",children:ae.name||ae.id},ae.id))}),R&&e.jsxs("div",{className:"space-y-2 mb-3",children:[e.jsx("div",{className:"h-1.5 bg-surface-4 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-accent to-accent/60 rounded-full transition-all duration-500 ease-out",style:{width:`${Math.max((L==null?void 0:L.percent)||0,5)}%`}})}),e.jsx("p",{className:"text-2xs text-text-3 font-sans",children:(L==null?void 0:L.message)||"Installing..."})]}),!U&&!R&&!n&&e.jsxs("div",{className:"flex flex-col gap-2.5 flex-1",children:[(L==null?void 0:L.error)&&e.jsx("div",{className:"p-2.5 bg-danger/5 border border-danger/15 rounded-md",children:e.jsx("p",{className:"text-2xs text-danger font-sans break-all",children:L.error})}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>I(t.id).catch(()=>{}),className:"w-full h-8 text-2xs gap-1.5",children:[e.jsx(_a,{size:11})," Install ",t.name]}),t.installCommand&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"Or install manually in your terminal:"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("code",{className:"flex-1 px-2 py-1.5 bg-surface-0 border border-border-subtle rounded text-2xs font-mono text-text-2 select-all",children:t.installCommand}),e.jsx("button",{onClick:()=>{navigator.clipboard.writeText(t.installCommand),Q("success","Copied")},className:"p-1.5 text-text-4 hover:text-text-2 cursor-pointer",children:e.jsx(wn,{size:10})})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsxs(fe,{variant:"ghost",size:"sm",onClick:async()=>{P(!0);try{await S(t.id),a&&a()}catch{}P(!1)},disabled:z,className:"h-7 text-2xs gap-1 px-2",children:[e.jsx(ra,{size:10,className:z?"animate-spin":""})," Re-check"]}),e.jsx("button",{onClick:()=>b(!O),className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans",children:"Set custom path"})]}),O&&e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:C,onChange:ae=>j(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&_(),placeholder:`/path/to/${t.id}`,className:"flex-1 h-7 px-2 text-2xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsx(fe,{variant:"primary",size:"sm",onClick:_,disabled:!C.trim()||N,className:"h-7 text-2xs px-2.5",children:N?"...":"Save"})]})})]}),U&&!G&&!n&&!R&&e.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[t.id==="claude-code"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-text-1 font-sans font-medium",children:"Sign in via terminal"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"1"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans flex items-center gap-1",children:[e.jsx(Ns,{size:10,className:"text-text-3 flex-shrink-0"}),"Open the Groove terminal below"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"2"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"claude"})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"3"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Follow the prompts to sign in with your Anthropic account"})]})]})]}),e.jsx("button",{onClick:()=>{s(!0),A(!1),c("")},className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans text-center",children:"I have an API key instead"})]}),t.id==="codex"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-text-1 font-sans font-medium",children:"Sign in via terminal"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"1"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans flex items-center gap-1",children:[e.jsx(Ns,{size:10,className:"text-text-3 flex-shrink-0"}),"Open the Groove terminal below"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"2"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"npm i -g @openai/codex"})," (if not installed)"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"3"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"codex login"})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"4"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Follow the prompts to authenticate"})]})]})]}),e.jsx("button",{onClick:()=>{s(!0),A(!1),c("")},className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans text-center",children:"I have an API key instead"})]}),t.id==="gemini"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-text-1 font-sans font-medium",children:"Add your Gemini API key"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"1"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Go to ",e.jsx("button",{onClick:()=>window.open("https://aistudio.google.com/apikey","_blank"),className:"text-accent hover:underline cursor-pointer font-sans",children:"aistudio.google.com"})," and sign in with Google"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"2"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:'Click "Create API Key" and copy it'})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"3"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Paste it below"})]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{value:o,onChange:ae=>c(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&H(),type:l?"text":"password",placeholder:"AIza...",className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:()=>A(!l),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:l?e.jsx(jn,{size:12}):e.jsx(na,{size:12})})]}),e.jsx(fe,{variant:"primary",size:"sm",onClick:H,disabled:!o.trim(),className:"w-full h-8 text-xs",children:"Save Key"})]}),t.id==="grok"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-text-1 font-sans font-medium",children:"Add your xAI API key"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"1"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Go to ",e.jsx("button",{onClick:()=>window.open("https://console.x.ai","_blank"),className:"text-accent hover:underline cursor-pointer font-sans",children:"console.x.ai"})," and sign in"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"2"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Create an API key and copy it"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"3"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Paste it below"})]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{value:o,onChange:ae=>c(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&H(),type:l?"text":"password",placeholder:"xai-...",className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:()=>A(!l),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:l?e.jsx(jn,{size:12}):e.jsx(na,{size:12})})]}),e.jsx(fe,{variant:"primary",size:"sm",onClick:H,disabled:!o.trim(),className:"w-full h-8 text-xs",children:"Save Key"})]})]}),K&&G&&!t.hasKey&&!n&&e.jsxs("div",{className:"flex items-center gap-1.5 h-8 px-2.5 bg-accent/8 border border-accent/20 rounded-md text-2xs font-sans text-accent mb-3",children:[e.jsx(De,{size:10})," Subscription active"]}),t.hasKey&&!n&&e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-1.5 h-8 px-2.5 bg-success/8 border border-success/20 rounded-md text-2xs font-sans text-success",children:[e.jsx(De,{size:10})," API Connected"]}),e.jsx("button",{onClick:()=>{s(!0),A(!1),c("")},className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans",children:"Edit"}),e.jsx("button",{onClick:q,className:"text-2xs text-text-4 hover:text-danger cursor-pointer font-sans",children:"Remove"})]}),e.jsx("div",{className:"flex-1"}),n&&e.jsxs("div",{className:"space-y-2.5 pt-1",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:t.hasKey?"Update API Key":`${t.name} API Key`}),!t.hasKey&&t.id==="claude-code"&&e.jsxs("p",{className:"text-2xs text-text-3 font-sans mb-1.5",children:["Get yours at ",e.jsx("button",{onClick:()=>window.open("https://console.anthropic.com/settings/keys","_blank"),className:"text-accent hover:underline cursor-pointer font-sans",children:"console.anthropic.com"})]}),!t.hasKey&&t.id==="codex"&&e.jsxs("p",{className:"text-2xs text-text-3 font-sans mb-1.5",children:["Get yours at ",e.jsx("button",{onClick:()=>window.open("https://platform.openai.com/api-keys","_blank"),className:"text-accent hover:underline cursor-pointer font-sans",children:"platform.openai.com"})]}),!t.hasKey&&t.id==="gemini"&&e.jsxs("p",{className:"text-2xs text-text-3 font-sans mb-1.5",children:["Get yours at ",e.jsx("button",{onClick:()=>window.open("https://aistudio.google.com/apikey","_blank"),className:"text-accent hover:underline cursor-pointer font-sans",children:"aistudio.google.com"})]}),!t.hasKey&&t.id==="grok"&&e.jsxs("p",{className:"text-2xs text-text-3 font-sans mb-1.5",children:["Get yours at ",e.jsx("button",{onClick:()=>window.open("https://console.x.ai","_blank"),className:"text-accent hover:underline cursor-pointer font-sans",children:"console.x.ai"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{value:o,onChange:ae=>c(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&H(),type:l?"text":"password",placeholder:Vqe[t.id]||"sk-...",className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:()=>A(!l),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:l?e.jsx(jn,{size:12}):e.jsx(na,{size:12})})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(fe,{variant:"primary",size:"sm",onClick:H,disabled:!o.trim(),className:"flex-1 h-8 text-xs",children:"Save Key"}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{s(!1),c("")},className:"h-8 text-xs px-3",children:"Cancel"})]})]}),G&&!n&&!t.hasKey&&K&&e.jsxs(fe,{variant:"secondary",size:"sm",onClick:()=>{s(!0),A(!1),c("")},className:"w-full h-8 text-2xs gap-1.5 mt-2",children:[e.jsx(ws,{size:11}),"Add API key for headless mode"]})]}),t.installed&&e.jsxs("div",{className:"border-t border-border-subtle",children:[e.jsxs("button",{onClick:()=>b(!O),className:"w-full flex items-center gap-2 px-4 py-2 text-left cursor-pointer hover:bg-surface-5/30 transition-colors",children:[e.jsx(Rt,{size:10,className:V("text-text-4 transition-transform duration-200",O&&"rotate-90")}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Set custom path"})]}),O&&e.jsxs("div",{className:"px-4 pb-3 space-y-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:C,onChange:ae=>j(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&_(),placeholder:`/path/to/${t.id}`,className:"flex-1 h-7 px-2 text-2xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsx(fe,{variant:"primary",size:"sm",onClick:_,disabled:!C.trim()||N,className:"h-7 text-2xs px-2.5",children:N?"...":"Save"})]}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"For non-standard install locations"})]})]})]}),e.jsx(Dqe,{open:x,onOpenChange:m,providerId:t.id,initialStep:y,onComplete:a})]})}function Of({icon:t,label:a,description:n,children:s}){return e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded bg-accent/8 flex items-center justify-center flex-shrink-0",children:e.jsx(t,{size:12,className:"text-accent"})}),e.jsx("div",{className:"text-[13px] font-medium text-text-0 font-sans leading-tight",children:a})]}),e.jsx("div",{className:"text-2xs text-text-4 font-sans leading-relaxed",children:n}),e.jsx("div",{className:"mt-auto pt-1",children:s})]})}const Oee={telegram:Xa,discord:Cn,slack:Yn},wA={telegram:"Telegram",discord:"Discord",slack:"Slack"},Zqe={telegram:"Bot token from @BotFather",discord:"Bot token from Developer Portal",slack:"Bot token (xoxb-...)"},Gqe=["critical","lifecycle","all"];function Wqe({type:t,open:a,onOpenChange:n}){if(!t)return null;const o={telegram:{title:"Set Up Telegram",icon:Xa,intro:"Create a Telegram bot and connect it to Groove in under 2 minutes. No dependencies required.",sections:[{title:"Create Your Bot",steps:[{text:"Open Telegram on any device and search for",link:"https://t.me/BotFather",linkText:"@BotFather"},{text:"Send /newbot to start the setup"},{text:"Choose a display name — we suggest GroovePilot"},{text:'Choose a username (must end in "bot") — e.g. GroovePilot_bot'},{text:"BotFather will reply with your bot token — copy it"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Telegram card"},{text:"Paste your bot token and click Save"},{text:"The gateway will connect automatically"}]},{title:"Link a Chat",steps:[{text:"Open a chat with your new bot in Telegram"},{text:'Send any message (e.g. "hello") — Groove captures the chat ID automatically'},{text:"Click Test in the gateway card to verify"}]},{title:"Commands",note:"All commands use / prefix in Telegram:",commands:["/instruct <team> <msg>","/query <team> <question>","/plan <description>","/log <team>","/brief","/tokens","/status","/agents","/help"]}]},discord:{title:"Set Up Discord",icon:Cn,intro:"Create a Discord bot and add it to your server. Requires discord.js (installed automatically with Groove).",sections:[{title:"Create the Application",steps:[{text:"Go to the",link:"https://discord.com/developers/applications",linkText:"Discord Developer Portal"},{text:"Click New Application and name it GroovePilot"},{text:"Go to the Bot tab in the left sidebar"},{text:"Click Reset Token and copy the bot token"}]},{title:"Set Permissions & Invite",steps:[{text:"Go to OAuth2 > URL Generator"},{text:"Under Scopes, check bot"},{text:"Under Bot Permissions, check:"}],scopes:["Send Messages","Read Message History","Embed Links","Use External Emojis"],after:[{text:"Copy the generated URL at the bottom and open it in your browser"},{text:"Select your server and click Authorize"}]},{title:"Enable Message Content Intent",steps:[{text:"Go back to the Bot tab in the Developer Portal"},{text:"Scroll to Privileged Gateway Intents"},{text:"Enable Message Content Intent — required for the bot to read commands"},{text:"Click Save Changes"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Discord card"},{text:"Paste your bot token and click Save"},{text:"Send a message in any channel where the bot is — Groove captures the channel automatically"}]},{title:"Commands",note:"All commands use / prefix in Discord:",commands:["/instruct <team> <msg>","/query <team> <question>","/plan <description>","/log <team>","/brief","/tokens","/status","/agents","/help"]}]},slack:{title:"Set Up Slack",icon:Yn,intro:"Create a Slack app with Socket Mode — no public URL needed. Requires @slack/bolt (installed automatically with Groove).",sections:[{title:"Create the App",steps:[{text:"Go to",link:"https://api.slack.com/apps",linkText:"api.slack.com/apps"},{text:"Click Create New App > From scratch"},{text:"Name it GroovePilot and select your workspace"}]},{title:"Enable Socket Mode",steps:[{text:"In the left sidebar, go to Settings > Socket Mode"},{text:"Toggle Enable Socket Mode to on"},{text:"It will ask you to create an App-Level Token"},{text:'Name it "groove", add the connections:write scope'},{text:"Click Generate — copy the xapp-... token (this is your App Token)"}],important:"Save this token now — you can't view it again after closing the dialog."},{title:"Set Bot Token Scopes",steps:[{text:"Go to Features > OAuth & Permissions"},{text:"Scroll to Bot Token Scopes and add all of these:"}],scopes:["chat:write","channels:read","channels:history","groups:read","groups:history","im:history","app_mentions:read"],after:[{text:"Scroll up and click Install to Workspace"},{text:"Click Allow to grant permissions"},{text:"Copy the Bot User OAuth Token (xoxb-...) — this is your Bot Token"}]},{title:"Enable Events",steps:[{text:"Go to Features > Event Subscriptions"},{text:"Toggle Enable Events to on"},{text:"Under Subscribe to bot events, add:"}],scopes:["message.channels","message.im","app_mention"],after:[{text:"Click Save Changes at the bottom"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Slack card"},{text:"Paste your Bot Token (xoxb-...) in the first field"},{text:"Paste your App Token (xapp-...) in the second field"},{text:"Click Save — Groove will auto-connect"}]},{title:"Link a Channel",steps:[{text:"Invite the bot to a channel: /invite @GroovePilot"},{text:"Select the channel from the dropdown in the gateway card"},{text:"Or @mention the bot — it will auto-capture the channel"},{text:"Click Test to verify"}],important:"For private channels, make sure you added the groups:read scope."},{title:"Commands",note:"In Slack, use plain text commands (no / prefix) or @mention the bot:",commands:["instruct <team> <msg>","query <team> <question>","plan <description>","log <team>","brief","tokens","status","agents","help","@GroovePilot status"]}]}}[t];if(!o)return null;const c=o.icon;return e.jsx(HT,{open:a,onOpenChange:n,children:e.jsx(qT,{title:o.title,width:480,children:e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-accent/5 border border-accent/15 rounded-lg",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-accent/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx(c,{size:16,className:"text-accent"})}),e.jsx("p",{className:"text-xs text-text-2 font-sans leading-relaxed",children:o.intro})]}),o.sections.map((l,A)=>{var u;return e.jsxs("div",{children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-0 font-sans mb-2.5 flex items-center gap-2",children:[e.jsx("span",{className:"w-5 h-5 rounded-full bg-accent/10 flex items-center justify-center text-2xs font-bold text-accent",children:A+1}),l.title]}),l.note&&e.jsx("p",{className:"text-2xs text-text-3 font-sans mb-2",children:l.note}),l.steps&&e.jsx("ol",{className:"space-y-2 mb-2",children:l.steps.map((f,x)=>e.jsxs("li",{className:"flex gap-2 text-2xs text-text-2 font-sans leading-relaxed",children:[e.jsxs("span",{className:"text-text-4 font-mono w-4 flex-shrink-0 pt-px",children:[x+1,"."]}),e.jsxs("span",{children:[f.text,f.link&&e.jsxs(e.Fragment,{children:[" ",e.jsxs("a",{href:f.link,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-0.5 font-medium",children:[f.linkText,e.jsx(ma,{size:9})]})]})]})]},x))}),l.scopes&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2 ml-6",children:l.scopes.map(f=>e.jsx("code",{className:"px-2 py-0.5 rounded bg-surface-4 text-2xs font-mono text-accent",children:f},f))}),l.after&&e.jsx("ol",{className:"space-y-2 mb-2",start:(((u=l.steps)==null?void 0:u.length)||0)+1,children:l.after.map((f,x)=>{var m;return e.jsxs("li",{className:"flex gap-2 text-2xs text-text-2 font-sans leading-relaxed",children:[e.jsxs("span",{className:"text-text-4 font-mono w-4 flex-shrink-0 pt-px",children:[(((m=l.steps)==null?void 0:m.length)||0)+x+1,"."]}),e.jsx("span",{children:f.text})]},x)})}),l.important&&e.jsx("div",{className:"ml-6 p-2 bg-warning/8 border border-warning/20 rounded-md text-2xs text-warning font-sans",children:l.important}),l.commands&&e.jsx("div",{className:"ml-6 p-2.5 bg-surface-0 border border-border-subtle rounded-md space-y-1",children:l.commands.map(f=>e.jsx("code",{className:"block text-2xs font-mono text-text-1",children:f},f))})]},A)}),e.jsxs("a",{href:"https://docs.groovedev.ai/guide/gateways",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium mt-2",children:[e.jsx(ma,{size:10}),"Full documentation at docs.groovedev.ai"]})]})})})}function Kqe({gateway:t,onRefresh:a}){var G,H;const[n,s]=g.useState(!1),[o,c]=g.useState(""),[l,A]=g.useState(""),[u,f]=g.useState(!1),[x,m]=g.useState(!1),[y,v]=g.useState(!1),[O,b]=g.useState([]),[C,j]=g.useState(!1),N=$(q=>q.addToast);g.useEffect(()=>{t.connected&&!t.chatId&&t.type==="slack"&&D.get(`/gateways/${encodeURIComponent(t.id)}/channels`).then(q=>b(Array.isArray(q)?q:[])).catch(()=>{})},[t.connected,t.chatId,t.id,t.type]);const M=Oee[t.type]||Jn,Q=t.type==="slack";async function L(){if(o.trim())try{await D.post(`/gateways/${encodeURIComponent(t.id)}/credentials`,{key:"bot_token",value:o.trim()}),Q&&l.trim()&&await D.post(`/gateways/${encodeURIComponent(t.id)}/credentials`,{key:"app_token",value:l.trim()}),N("success","Token saved — connecting..."),c(""),A(""),s(!1);try{await D.post(`/gateways/${encodeURIComponent(t.id)}/connect`),N("success",`${wA[t.type]} connected!`)}catch(q){N("error","Token saved but connect failed",q.message)}a()}catch(q){N("error","Failed to save token",q.message)}}async function B(){m(!0);try{await D.post(`/gateways/${encodeURIComponent(t.id)}/test`),N("success","Test message sent!")}catch(q){N("error","Test failed",q.message)}m(!1)}async function S(){v(!0);try{t.connected?(await D.post(`/gateways/${encodeURIComponent(t.id)}/disconnect`),N("info",`${wA[t.type]} disconnected`)):(await D.post(`/gateways/${encodeURIComponent(t.id)}/connect`),N("success",`${wA[t.type]} connected!`)),a()}catch(q){N("error",t.connected?"Disconnect failed":"Connect failed",q.message)}v(!1)}async function I(q){try{await D.patch(`/gateways/${encodeURIComponent(t.id)}`,{enabled:q}),a()}catch(_){N("error","Update failed",_.message)}}async function z(q){try{await D.patch(`/gateways/${encodeURIComponent(t.id)}`,{notifications:{preset:q}}),a()}catch(_){N("error","Update failed",_.message)}}async function P(q){try{await D.patch(`/gateways/${encodeURIComponent(t.id)}`,{commandPermission:q}),a()}catch(_){N("error","Update failed",_.message)}}async function F(){try{await D.delete(`/gateways/${encodeURIComponent(t.id)}`),N("info",`${wA[t.type]} gateway removed`),a()}catch(q){N("error","Delete failed",q.message)}}const K=((G=t.notifications)==null?void 0:G.preset)||"critical";return e.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[e.jsx(ia,{status:t.connected?"running":"crashed",size:"sm"}),e.jsx(M,{size:13,className:"text-text-2"}),e.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:wA[t.type]}),e.jsx("div",{className:"flex-1"}),t.connected?e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(Tr,{size:8})," Connected"]}):t.enabled?e.jsx(be,{variant:"warning",className:"text-2xs",children:"Disconnected"}):e.jsx(be,{variant:"default",className:"text-2xs",children:"Disabled"})]}),e.jsxs("div",{className:"flex-1 flex flex-col px-4 py-3 min-h-[140px]",children:[t.connected&&!n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-1.5 h-8 px-2.5 bg-success/8 border border-success/20 rounded-md text-2xs font-sans text-success mb-3",children:[e.jsx(De,{size:10})," Gateway active",t.botUsername&&e.jsxs("span",{className:"text-text-4 ml-1",children:["@",t.botUsername]}),t.botTag&&e.jsx("span",{className:"text-text-4 ml-1",children:t.botTag})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:t.type==="slack"?"Channel":"Chat ID"}),t.chatId?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 flex items-center h-7 px-2 bg-surface-0 border border-border-subtle rounded-md text-2xs font-mono text-text-2",children:t.type==="slack"&&O.length>0?`#${((H=O.find(q=>q.id===t.chatId))==null?void 0:H.name)||t.chatId}`:t.chatId}),e.jsx("button",{onClick:async()=>{try{await D.patch(`/gateways/${encodeURIComponent(t.id)}`,{chatId:null}),a()}catch(q){N("error","Failed",q.message)}},className:"text-2xs text-text-4 hover:text-text-1 cursor-pointer font-sans",children:"Change"})]}):t.type==="slack"&&O.length>0?e.jsxs("select",{onChange:async q=>{if(q.target.value)try{await D.patch(`/gateways/${encodeURIComponent(t.id)}`,{chatId:q.target.value}),a()}catch(_){N("error","Failed to set channel",_.message)}},className:"w-full h-7 px-2 text-2xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Select a channel..."}),O.map(q=>e.jsxs("option",{value:q.id,children:["#",q.name]},q.id))]}):e.jsxs("div",{className:"text-2xs text-warning font-sans",children:[t.type==="slack"?"No channels found — invite the bot to a channel first.":"Send a message to the bot to auto-capture, or enter manually:",e.jsx("input",{placeholder:t.type==="slack"?"C0123456789":"Chat ID",className:"mt-1 w-full h-7 px-2 text-2xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",onKeyDown:async q=>{if(q.key==="Enter"&&q.target.value.trim())try{await D.patch(`/gateways/${encodeURIComponent(t.id)}`,{chatId:q.target.value.trim()}),a()}catch(_){N("error","Failed to set channel",_.message)}}})]})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:"Notifications"}),e.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:Gqe.map(q=>e.jsx("button",{onClick:()=>z(q),className:V("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer capitalize",K===q?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:q},q))})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:"Commands"}),e.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:["full","read-only"].map(q=>e.jsx("button",{onClick:()=>P(q),className:V("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer capitalize",(t.commandPermission||"full")===q?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:q==="full"?"Full Access":"Read Only"},q))})]})]}),!t.connected&&!n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-xs text-text-3 font-sans mb-2",children:t.enabled?t.hasCredentials?"Tokens saved — click Connect.":"Configure bot token to connect.":"Gateway is disabled."}),!t.hasCredentials&&e.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium cursor-pointer mb-2",children:[e.jsx(Na,{size:11}),"How to set up",e.jsx(ma,{size:9})]})]}),e.jsx(Wqe,{type:t.type,open:C,onOpenChange:j}),e.jsx("div",{className:"flex-1"}),n&&e.jsxs("div",{className:"space-y-2.5 pt-1",children:[e.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium cursor-pointer",children:[e.jsx(Na,{size:11}),"Where do I get these?"]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:"Bot Token"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{value:o,onChange:q=>c(q.target.value),onKeyDown:q=>q.key==="Enter"&&!Q&&L(),type:u?"text":"password",placeholder:Zqe[t.type],className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:()=>f(!u),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:u?e.jsx(jn,{size:12}):e.jsx(na,{size:12})})]})]}),Q&&e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:"App Token (Socket Mode)"}),e.jsx("input",{value:l,onChange:q=>A(q.target.value),onKeyDown:q=>q.key==="Enter"&&L(),type:u?"text":"password",placeholder:"xapp-...",className:"w-full h-9 px-3 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(fe,{variant:"primary",size:"sm",onClick:L,disabled:!o.trim(),className:"flex-1 h-8 text-xs",children:"Save Token"}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{s(!1),c(""),A("")},className:"h-8 text-xs px-3",children:"Cancel"})]})]}),!n&&e.jsxs("div",{className:"flex gap-2 mt-2",children:[!t.connected&&e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>s(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[e.jsx(ws,{size:11}),t.enabled?"Set Token":"Configure"]}),t.connected&&e.jsxs(e.Fragment,{children:[e.jsxs(fe,{variant:"secondary",size:"sm",onClick:B,disabled:x,className:"flex-1 h-7 text-2xs gap-1.5",children:[e.jsx(ti,{size:11}),x?"Sending...":"Test"]}),e.jsx(fe,{variant:"secondary",size:"sm",onClick:()=>s(!0),className:"h-7 text-2xs px-2.5",children:e.jsx(ws,{size:11})})]}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:S,disabled:y,className:"h-7 text-2xs px-2.5",title:t.connected?"Disconnect":"Connect",children:t.connected?e.jsx(da,{size:11}):e.jsx(Tr,{size:11})}),e.jsx(kee,{value:t.enabled,onChange:I}),e.jsx("button",{onClick:F,className:"text-text-4 hover:text-danger cursor-pointer p-1",title:"Remove gateway",children:e.jsx(At,{size:11})})]})]})]})}function Yqe({existingTypes:t,onAdd:a}){const[n,s]=g.useState(!1),o=["telegram","discord","slack"].filter(c=>!t.includes(c));return o.length===0?null:n?e.jsxs("div",{className:"flex flex-col rounded-lg border border-accent/30 bg-surface-1 overflow-hidden min-w-[220px]",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[e.jsx(Jn,{size:13,className:"text-accent"}),e.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:"Add Gateway"}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:()=>s(!1),className:"text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(Ge,{size:12})})]}),e.jsx("div",{className:"p-3 space-y-2",children:o.map(c=>{const l=Oee[c];return e.jsxs("button",{onClick:()=>{a(c),s(!1)},className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-0 hover:bg-accent/8 border border-border-subtle hover:border-accent/20 cursor-pointer transition-all group",children:[e.jsx(l,{size:14,className:"text-text-3 group-hover:text-accent"}),e.jsx("span",{className:"text-xs font-medium text-text-1 group-hover:text-accent font-sans",children:wA[c]})]},c)})})]}):e.jsxs("button",{onClick:()=>s(!0),className:"flex flex-col items-center justify-center rounded-lg border border-dashed border-border-subtle bg-surface-1/50 hover:bg-surface-1 hover:border-accent/30 min-h-[140px] min-w-[220px] cursor-pointer transition-all group",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-accent/8 group-hover:bg-accent/15 flex items-center justify-center mb-2 transition-colors",children:e.jsx(ht,{size:14,className:"text-accent"})}),e.jsx("span",{className:"text-2xs font-semibold text-text-3 group-hover:text-text-1 font-sans transition-colors",children:"Add Gateway"})]})}function Jqe(){const t=$(j=>j.trainingOptIn),a=$(j=>j.trainingStats),n=$(j=>j.setTrainingOptIn),s=$(j=>j.fetchTrainingStatus),o=$(j=>j.addToast),[c,l]=g.useState(!1),[A,u]=g.useState(!1),[f,x]=g.useState(!1);g.useEffect(()=>{s()},[]);function m(j){j?l(!0):n(!1)}async function y(){await n(!0),l(!1)}async function v(){x(!0);try{await D.post("/training/opt-in/delete"),$.setState({trainingOptIn:!1,trainingStats:null}),o("info","Training data deleted"),u(!1)}catch(j){o("error","Failed to delete data",j.message)}finally{x(!1)}}const O=(a==null?void 0:a.sessionsCaptured)??0,b=(a==null?void 0:a.envelopesSent)??0,C=(a==null?void 0:a.captureActive)??!1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Training Data"}),e.jsx("div",{className:"flex-1 h-px bg-border-subtle"})]}),e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5 max-w-md space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-6 h-6 rounded bg-accent/8 flex items-center justify-center flex-shrink-0",children:e.jsx(MA,{size:12,className:"text-accent"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-[13px] font-medium text-text-0 font-sans leading-tight",children:"Share Usage Data"}),e.jsx("div",{className:"text-2xs text-text-4 font-sans leading-relaxed mt-0.5",children:"Contribute anonymized session data to train Groove's MoE models. All data is PII-scrubbed before leaving your machine."})]}),e.jsx(kee,{value:t,onChange:m})]}),t&&e.jsxs("div",{className:"border-t border-border-subtle pt-3 space-y-2.5",children:[O===0&&b===0?e.jsx("div",{className:"text-2xs text-text-3 font-sans",children:"No data captured yet — stats will appear after your first agent session."}):e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs text-text-2 font-sans",children:"Sessions"}),e.jsx("div",{className:"text-sm font-semibold text-text-0 font-mono",children:O})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs text-text-2 font-sans",children:"Envelopes"}),e.jsx("div",{className:"text-sm font-semibold text-text-0 font-mono",children:b})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ia,{status:C?"running":"crashed",size:"sm"}),e.jsx("span",{className:"text-2xs text-text-2 font-sans",children:C?"Capturing":"Idle"})]})]}),e.jsx("div",{children:e.jsxs(fe,{variant:"ghost",size:"sm",onClick:()=>u(!0),className:"h-7 text-2xs text-danger hover:text-danger gap-1.5",children:[e.jsx(At,{size:10}),"Delete My Data"]})})]})]}),e.jsx(Ut,{open:c,onOpenChange:l,children:e.jsxs(Pt,{className:"max-w-2xl",description:"Review how your data helps build open source AI",children:[e.jsxs("div",{className:"relative bg-gradient-to-br from-accent/5 to-transparent px-6 pt-8 pb-6 text-center",children:[e.jsx(WE,{className:"absolute top-3 right-3 p-1.5 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-5 transition-colors",children:e.jsx(Ge,{size:16})}),e.jsx("div",{className:"flex justify-center mb-3",children:e.jsx("div",{className:"w-14 h-14 rounded-xl bg-accent/10 flex items-center justify-center",children:e.jsx(It,{size:32,className:"text-accent"})})}),e.jsx(kT,{className:"text-xl font-bold text-text-0 font-sans",children:"Help Build Open Source Intelligence"}),e.jsx("p",{className:"text-sm text-text-2 font-sans mt-2 max-w-md mx-auto",children:"Your usage data trains a free, local MoE model that every Groove user gets to use — including you."})]}),e.jsx("div",{className:"px-6 pt-5 pb-1",children:e.jsx("div",{className:"grid grid-cols-3 gap-3",children:[{icon:$0,title:"You Share",desc:"Anonymized agent session data: tool calls, error patterns, task flows"},{icon:Ba,title:"We Train",desc:"A Groove-specific Mixture of Experts model built on real multi-agent workflows"},{icon:m0,title:"Everyone Wins",desc:"Free, local, open source model for all Groove users. More data = smarter agents"}].map(({icon:j,title:N,desc:M})=>e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-2/50 p-3 text-center",children:[e.jsx("div",{className:"flex justify-center mb-2",children:e.jsx(j,{size:18,className:"text-accent"})}),e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans mb-1",children:N}),e.jsx("div",{className:"text-2xs text-text-2 font-sans leading-relaxed",children:M})]},N))})}),e.jsxs("div",{className:"px-6 pt-4",children:[e.jsx("div",{className:"text-xs font-semibold uppercase text-text-3 tracking-wider font-sans mb-2.5",children:"What We Collect"}),e.jsx("div",{className:"space-y-1.5",children:["Agent tool calling patterns","Error and recovery sequences","Task complexity and coordination events","Model and provider usage metadata","Session duration and outcomes"].map(j=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(De,{size:12,className:"text-accent flex-shrink-0"}),e.jsx("span",{className:"text-xs text-text-1 font-sans",children:j})]},j))}),e.jsx("p",{className:"text-xs text-text-0 font-sans font-medium mt-3",children:"That's it. Groove orchestration data only."})]}),e.jsx("div",{className:"px-6 pt-4",children:e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-2/30 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[e.jsx(La,{size:14,className:"text-text-2"}),e.jsx("span",{className:"text-xs font-semibold uppercase text-text-3 tracking-wider font-sans",children:"What We Never Collect"})]}),e.jsx("div",{className:"space-y-1.5",children:["Your source code or file contents","API keys, passwords, or credentials","Personal information — emails, names, file paths","Anything that could identify your IP or projects"].map(j=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{size:12,className:"text-danger flex-shrink-0"}),e.jsx("span",{className:"text-xs text-text-1 font-sans",children:j})]},j))}),e.jsx("p",{className:"text-xs text-text-0 font-sans font-medium mt-3",children:"13 categories of PII are automatically scrubbed before any data leaves your machine."})]})}),e.jsx("div",{className:"px-6 pt-4",children:e.jsx("div",{className:"border-l-2 border-accent/30 pl-3",children:e.jsx("p",{className:"text-xs text-text-3 italic leading-relaxed font-sans",children:"We believe in open source, decentralized intelligence. Not walled gardens. Not data hoarding. Every contribution makes the model better for everyone. We need your help to get there."})})}),e.jsxs("div",{className:"border-t border-border-subtle mt-5 pt-4 pb-1 px-6",children:[e.jsx(fe,{variant:"primary",size:"sm",onClick:y,className:"w-full h-10 text-sm font-semibold",children:"Join the Movement — Start Contributing"}),e.jsx("div",{className:"text-center mt-2.5",children:e.jsx("button",{onClick:()=>l(!1),className:"text-xs text-text-3 hover:text-text-1 transition-colors font-sans cursor-pointer",children:"Not now"})}),e.jsx("p",{className:"text-center text-2xs text-text-4 font-sans mt-2 mb-1",children:"You can opt out and delete your data anytime in Settings"})]})]})}),e.jsx(Ut,{open:A,onOpenChange:u,children:e.jsxs(Pt,{title:"Delete Training Data",description:"Confirm permanent deletion of all collected training data.",children:[e.jsx("div",{className:"px-5 py-4",children:e.jsx("p",{className:"text-xs text-text-1 font-sans leading-relaxed",children:"This will permanently delete all your collected training data and opt you out. This cannot be undone."})}),e.jsxs("div",{className:"flex items-center gap-2 px-5 py-4 border-t border-border-subtle",children:[e.jsx(fe,{variant:"danger",size:"sm",onClick:v,disabled:f,className:"flex-1 h-8 text-xs",children:f?"Deleting...":"Delete All Data"}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"h-8 text-xs px-3",children:"Cancel"})]})]})})]})}function eDe(){const t=$(m=>m.networkUnlocked),a=$(m=>m.activateBeta),n=$(m=>m.deactivateBeta),[s,o]=g.useState(""),[c,l]=g.useState(!1),[A,u]=g.useState("");g.useEffect(()=>{if(!A)return;const m=setTimeout(()=>u(""),3e3);return()=>clearTimeout(m)},[A]);async function f(){const m=s.trim();if(!(!m||c)){l(!0),u("");try{await a(m),o("")}catch(y){u(y.message||"Invalid code")}finally{l(!1)}}}async function x(){try{await n()}catch{}}return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Early Access"}),e.jsx("div",{className:"flex-1 h-px bg-border-subtle"})]}),e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5 max-w-md",children:[t?e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-success/10 flex items-center justify-center flex-shrink-0",children:e.jsx(De,{size:12,className:"text-success"})}),e.jsx("div",{className:"flex-1 text-xs font-sans text-text-1",children:"Early access enabled"}),e.jsx("button",{onClick:x,className:"text-2xs text-text-4 hover:text-danger cursor-pointer font-sans",children:"Deactivate"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j0,{size:12,className:"text-text-4 flex-shrink-0"}),e.jsx("input",{value:s,onChange:m=>o(m.target.value),onKeyDown:m=>m.key==="Enter"&&f(),type:"text",placeholder:"Enter invite code",className:"flex-1 h-8 px-2.5 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsx(fe,{variant:"primary",size:"sm",onClick:f,disabled:!s.trim()||c,className:"h-8 text-xs px-3",children:c?"...":"Submit"})]}),A&&!t&&e.jsx("div",{className:"mt-2 text-2xs text-danger font-sans",children:A})]})]})}function tDe(){var L,B;const[t,a]=g.useState([]),[n,s]=g.useState(null),[o,c]=g.useState(null),[l,A]=g.useState([]),[u,f]=g.useState(!0),[x,m]=g.useState(!1),y=$(S=>S.addToast),v=$(S=>S.remoteHomedir),O=$(S=>S._providerRefreshTick);function b(){D.get("/providers").then(S=>a(Array.isArray(S)?S:[])).catch(()=>{})}function C(){D.get("/gateways").then(S=>A(Array.isArray(S)?S:[])).catch(()=>{})}g.useEffect(()=>{Promise.all([D.get("/providers"),D.get("/config"),D.get("/status"),D.get("/gateways")]).then(([S,I,z,P])=>{a(Array.isArray(S)?S:[]),s(I),c(z),A(Array.isArray(P)?P:[]),f(!1)}).catch(()=>f(!1))},[]),g.useEffect(()=>{O&&b()},[O]);async function j(S){try{await D.post("/gateways",{type:S}),y("success",`${wA[S]} gateway added`),C()}catch(I){y("error","Failed to add gateway",I.message)}}async function N(S,I){try{const z=await D.patch("/config",{[S]:I});s(z)}catch(z){y("error","Update failed",z.message)}}if(u)return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("div",{className:"h-12 bg-surface-1 border-b border-border"}),e.jsxs("div",{className:"flex-1 p-4 space-y-4",children:[e.jsx("div",{className:"grid grid-cols-4 gap-3",children:[...Array(4)].map((S,I)=>e.jsx(Xn,{className:"h-40 rounded-lg"},I))}),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:[...Array(6)].map((S,I)=>e.jsx(Xn,{className:"h-28 rounded-lg"},I))})]})]});const M=t.filter(S=>S.id!=="groove-network"),Q=M.filter(S=>{var I;return S.authType==="local"?S.installed:S.authType==="subscription"?S.installed&&((I=S.authStatus)==null?void 0:I.authenticated):S.installed&&S.hasKey}).length;return n!=null&&n.rotationThreshold,e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 bg-surface-1 border-b border-border flex-shrink-0",children:[e.jsx("h2",{className:"text-sm font-semibold text-text-0 font-sans",children:"Settings"}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-4 text-2xs text-text-3 font-sans",children:[(o==null?void 0:o.version)&&e.jsxs("span",{children:["v",o.version]}),(o==null?void 0:o.port)&&e.jsxs("span",{children:[":",o.port]}),(o==null?void 0:o.uptime)>0&&e.jsxs("span",{children:["Up ",WA(o.uptime)]})]}),e.jsx(ia,{status:"running",size:"sm"})]}),e.jsx(it,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Providers"}),e.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),e.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:[Q,"/",M.length," connected"]})]}),e.jsx("div",{className:"grid grid-cols-4 gap-3",children:M.map(S=>e.jsx(Xqe,{provider:S,onKeyChange:b},S.id))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Gateways"}),e.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),e.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:[l.filter(S=>S.connected).length,"/",l.length," connected"]})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[l.map(S=>e.jsx(Kqe,{gateway:S,onRefresh:C},S.id)),e.jsx(Yqe,{existingTypes:l.map(S=>S.type),onAdd:j})]})]}),n&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Configuration"}),e.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Auto-saves"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsx(Of,{icon:Ba,label:"Default Provider",description:"Provider used when spawning new agents.",children:e.jsx("select",{value:n.defaultProvider||"claude-code",onChange:S=>N("defaultProvider",S.target.value),className:"w-full h-8 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",children:M.filter(S=>{var I;return S.installed&&(S.authType==="local"||S.authType==="subscription"&&((I=S.authStatus)==null?void 0:I.authenticated)||S.hasKey)}).map(S=>e.jsx("option",{value:S.id,children:S.name},S.id))})}),e.jsx(Of,{icon:Ba,label:"Default Model",description:"Model used for new agents. Auto routes by role.",children:e.jsxs("select",{value:n.defaultModel||"",onChange:S=>N("defaultModel",S.target.value||null),className:"w-full h-8 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",children:[e.jsx("option",{value:"",children:"Auto (route by role)"}),(((L=t.find(S=>S.id===(n.defaultProvider||"claude-code")))==null?void 0:L.models)||[]).map(S=>e.jsx("option",{value:S.id,children:S.name},S.id))]})}),e.jsx(Of,{icon:ga,label:"Working Directory",description:"Default root directory for new agents.",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("code",{className:"flex-1 h-8 px-2 flex items-center bg-surface-0 border border-border-subtle rounded-md text-2xs font-mono text-text-2 truncate min-w-0",children:n.defaultWorkingDir||"Project root"}),e.jsx(fe,{variant:"secondary",size:"sm",onClick:async()=>{var S,I;if((I=(S=window.groove)==null?void 0:S.folders)!=null&&I.select){const z=await window.groove.folders.select({title:"Select Working Directory",defaultPath:(n==null?void 0:n.defaultWorkingDir)||void 0});z&&N("defaultWorkingDir",z)}else m(!0)},className:"h-8 px-2 flex-shrink-0",children:e.jsx(SA,{size:12})})]})}),e.jsx(Of,{icon:Cn,label:"Default Chat Model",description:"Provider and model for new chat conversations.",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("select",{value:n.defaultChatProvider||n.defaultProvider||"claude-code",onChange:S=>{N("defaultChatProvider",S.target.value);const I=t.find(P=>P.id===S.target.value),z=((I==null?void 0:I.models)||[]).filter(P=>{const F=(typeof P=="string"?P:P.id||"").toLowerCase();return!F.includes("dall-e")&&!F.includes("imagen")&&!F.includes("image")});if(z.length>0){const P=typeof z[0]=="string"?z[0]:z[0].id;N("defaultChatModel",P)}},className:"w-full h-8 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",children:M.filter(S=>{var I;return S.installed&&(S.authType==="local"||S.authType==="subscription"&&((I=S.authStatus)==null?void 0:I.authenticated)||S.hasKey)}).map(S=>e.jsx("option",{value:S.id,children:S.name},S.id))}),e.jsxs("select",{value:n.defaultChatModel||"",onChange:S=>N("defaultChatModel",S.target.value||null),className:"w-full h-8 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",children:[e.jsx("option",{value:"",children:"Auto (Sonnet)"}),(((B=t.find(S=>S.id===(n.defaultChatProvider||n.defaultProvider||"claude-code")))==null?void 0:B.models)||[]).filter(S=>{const I=(typeof S=="string"?S:S.id||"").toLowerCase();return!I.includes("dall-e")&&!I.includes("imagen")&&!I.includes("image")}).map(S=>{const I=typeof S=="string"?S:S.id,z=typeof S=="string"?S:S.name||S.id;return e.jsx("option",{value:I,children:z},I)})]})]})})]})]}),e.jsx(eDe,{}),e.jsx(Jqe,{})]})}),e.jsx(Hu,{open:x,onOpenChange:m,currentPath:(n==null?void 0:n.defaultWorkingDir)||v||"/",homePath:v,onSelect:S=>N("defaultWorkingDir",S)})]})}const bee={light:"text-green-400",medium:"text-blue-400",heavy:"text-orange-400"};function iT(t){return t?t<1024*1024?`${(t/1024).toFixed(0)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`:"—"}function aDe(t){return t?t<1024*1024?`${(t/1024).toFixed(0)} KB/s`:`${(t/(1024*1024)).toFixed(1)} MB/s`:""}function nDe({serverRunning:t,installed:a,onStart:n,onStop:s,onRestart:o,actionInProgress:c}){return a?t?e.jsxs("div",{className:"flex items-center gap-2 bg-success/8 border border-success/20 rounded-lg px-3 py-2",children:[e.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[e.jsx("span",{className:"absolute inset-0 rounded-full bg-success"}),e.jsx("span",{className:"absolute inset-[-2px] rounded-full bg-success opacity-20 animate-pulse"})]}),e.jsx("span",{className:"text-xs font-sans text-success font-semibold",children:"Server Running"}),e.jsx("span",{className:"text-2xs font-mono text-text-4",children:":11434"}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{onClick:o,disabled:!!c,className:"flex items-center gap-1 text-2xs font-sans text-text-3 hover:text-accent cursor-pointer transition-colors disabled:opacity-40",children:[e.jsx(ra,{size:10,className:c==="restarting"?"animate-spin":""}),c==="restarting"?"Restarting...":"Restart"]}),e.jsxs("button",{onClick:s,disabled:!!c,className:"flex items-center gap-1 text-2xs font-sans text-text-3 hover:text-danger cursor-pointer transition-colors disabled:opacity-40",children:[e.jsx(Gr,{size:10}),c==="stopping"?"Stopping...":"Stop"]})]}):e.jsxs("div",{className:"flex items-center gap-2 bg-danger/8 border border-danger/20 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full bg-danger flex-shrink-0"}),e.jsx("span",{className:"text-xs font-sans text-danger font-semibold",children:"Server Stopped"}),e.jsx("span",{className:"text-2xs font-mono text-text-4",children:":11434"}),e.jsx("div",{className:"flex-1"}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:n,disabled:!!c,className:"h-6 px-2.5 text-2xs gap-1",children:[e.jsx(ei,{size:10}),c==="starting"?"Starting...":"Start Server"]})]}):e.jsxs("div",{className:"flex items-center gap-2 bg-surface-1 border border-border-subtle rounded-lg px-3 py-2",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full bg-text-4 flex-shrink-0"}),e.jsx("span",{className:"text-xs font-sans text-text-3 font-medium",children:"Ollama Not Installed"}),e.jsx("div",{className:"flex-1"}),e.jsx("a",{href:"https://ollama.ai/download",target:"_blank",rel:"noopener noreferrer",className:"text-2xs font-sans text-accent hover:underline",children:"Install Ollama"})]})}function sDe({hardware:t}){return t?e.jsxs("div",{className:"flex items-center gap-4 px-3 py-2 bg-surface-1 border border-border-subtle rounded-lg text-xs font-sans text-text-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(M0,{size:14,className:"text-text-3"}),e.jsxs("span",{children:[t.totalRamGb," GB RAM"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Ba,{size:14,className:"text-text-3"}),e.jsxs("span",{children:[t.cores," cores"]})]}),t.gpu&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Kn,{size:14,className:"text-text-3"}),e.jsxs("span",{children:[t.gpu.name,t.gpu.vram?` (${t.gpu.vram} GB)`:""]})]}),t.isAppleSilicon&&e.jsx(be,{variant:"accent",className:"text-2xs ml-auto",children:"Unified Memory"})]}):null}function rDe({model:t,onUnload:a,onSpawn:n,unloading:s}){const o=t.size?(t.size/1073741824).toFixed(1):"?",c=t.vram?(t.vram/1024**3).toFixed(1):o;return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-success/5 border border-success/20 rounded-lg",children:[e.jsxs("span",{className:"relative flex-shrink-0 w-2 h-2",children:[e.jsx("span",{className:"absolute inset-0 rounded-full bg-success"}),e.jsx("span",{className:"absolute inset-[-2px] rounded-full bg-success opacity-20 animate-pulse"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate",children:t.name}),e.jsx(be,{variant:"success",className:"text-2xs",children:"Running"})]}),e.jsxs("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:[c," GB VRAM · loaded in memory"]})]}),e.jsxs("button",{onClick:()=>n(t.name),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-2xs font-sans font-medium bg-accent/10 text-accent hover:bg-accent/20 transition-colors cursor-pointer",children:[e.jsx(es,{size:11}),"Spawn Agent"]}),e.jsx("button",{onClick:()=>a(t.name),disabled:s===t.name,className:"p-1.5 rounded-md text-text-4 hover:text-warning hover:bg-warning/10 transition-colors cursor-pointer disabled:opacity-40",title:"Unload from memory",children:s===t.name?e.jsx($e,{size:14,className:"animate-spin"}):e.jsx(Gr,{size:14})})]})}function oDe({model:t,catalogEntry:a,isRunning:n,onStart:s,onSpawn:o,onDelete:c,loading:l,deleting:A,serverRunning:u}){return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-surface-1 border border-border-subtle rounded-lg",children:[e.jsx(on,{size:18,className:V("flex-shrink-0",n?"text-success":"text-accent")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate",children:t.id}),t.tier&&e.jsx("span",{className:V("text-2xs font-semibold capitalize",bee[t.tier]||"text-text-3"),children:t.tier}),t.category&&t.category!=="other"&&e.jsx(be,{variant:"subtle",className:"text-2xs",children:t.category}),n&&e.jsx(be,{variant:"success",className:"text-2xs",children:"Running"})]}),e.jsxs("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:[t.size||"—",(a==null?void 0:a.ramGb)&&e.jsxs(e.Fragment,{children:[" · ~",a.ramGb," GB RAM needed"]}),(a==null?void 0:a.description)&&e.jsxs(e.Fragment,{children:[" · ",a.description]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[!n&&u&&e.jsxs("button",{onClick:()=>s(t.id),disabled:!!l,className:"flex items-center gap-1 px-2 py-1.5 rounded-md text-2xs font-sans font-medium text-text-2 hover:text-success hover:bg-success/10 transition-colors cursor-pointer disabled:opacity-40",title:"Load into memory",children:[l===t.id?e.jsx($e,{size:11,className:"animate-spin"}):e.jsx(ei,{size:11}),"Start"]}),e.jsxs("button",{onClick:()=>o(t.id),className:"flex items-center gap-1 px-2 py-1.5 rounded-md text-2xs font-sans font-medium text-accent hover:bg-accent/10 transition-colors cursor-pointer",title:"Spawn an agent with this model",children:[e.jsx(es,{size:11}),"Spawn"]}),e.jsx("button",{onClick:()=>c(t.id),disabled:A===t.id,className:"p-1.5 rounded-md text-text-4 hover:text-red-400 hover:bg-red-400/10 transition-colors cursor-pointer disabled:opacity-40",title:"Delete model",children:A===t.id?e.jsx($e,{size:13,className:"animate-spin"}):e.jsx(At,{size:13})})]})]})}function iDe({model:t,onImport:a,onDelete:n,importing:s,deleting:o}){return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-surface-1 border border-border-subtle rounded-lg",children:[e.jsx(on,{size:18,className:"flex-shrink-0 text-purple-400"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate",children:t.id}),t.quantization&&e.jsx(be,{variant:"subtle",className:"text-2xs",children:t.quantization}),t.parameters&&e.jsx("span",{className:"text-2xs font-semibold text-blue-400",children:t.parameters}),e.jsx(be,{variant:"accent",className:"text-2xs",children:"GGUF"})]}),e.jsxs("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:[t.sizeBytes?iT(t.sizeBytes):"—",t.repoId&&e.jsxs(e.Fragment,{children:[" · ",t.repoId]}),t.contextWindow&&e.jsxs(e.Fragment,{children:[" · ",(t.contextWindow/1024).toFixed(0),"K context"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("button",{onClick:()=>a(t.id),disabled:s===t.id||o===t.id,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-2xs font-sans font-medium bg-accent/10 text-accent hover:bg-accent/20 transition-colors cursor-pointer disabled:opacity-40",title:"Import into Ollama so you can use it to spawn agents",children:[s===t.id?e.jsx($e,{size:11,className:"animate-spin"}):e.jsx(es,{size:11}),s===t.id?"Importing...":"Import to Ollama"]}),e.jsx("button",{onClick:()=>n(t.id),disabled:o===t.id||s===t.id,className:"p-1.5 rounded-md text-text-4 hover:text-red-400 hover:bg-red-400/10 transition-colors cursor-pointer disabled:opacity-40",title:"Delete model file",children:o===t.id?e.jsx($e,{size:13,className:"animate-spin"}):e.jsx(At,{size:13})})]})]})}function cDe({download:t}){const a=Math.round((t.percent||0)*100);return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-2xs font-sans text-text-3",children:[e.jsx("span",{children:t.filename}),e.jsxs("span",{children:[a,"% ",aDe(t.speed)]})]}),e.jsx("div",{className:"h-1.5 bg-surface-3 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-accent rounded-full transition-all",style:{width:`${a}%`}})}),e.jsxs("div",{className:"text-2xs text-text-4",children:[iT(t.downloaded)," / ",iT(t.totalBytes)]})]})}function lDe({modelId:t,progress:a}){return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-accent/5 border border-accent/20 rounded-lg",children:[e.jsx($e,{size:14,className:"animate-spin text-accent flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs font-mono text-text-0",children:t}),e.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:a.progress||"Pulling..."})]})]})}function dDe({model:t,systemRamGb:a,onPull:n,pulling:s,isInstalled:o}){const c={code:"{}",general:"AI"},l=a?Math.round((1-t.ramGb/a)*100):null;return e.jsxs("div",{className:V("flex items-center gap-3 px-4 py-3 border rounded-lg transition-colors",o?"bg-success/5 border-success/20":"bg-surface-1 border-border-subtle hover:border-accent/20"),children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-surface-3 flex items-center justify-center text-xs font-mono text-text-2 flex-shrink-0",children:c[t.category]||"AI"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate",children:t.name}),e.jsx("span",{className:V("text-2xs font-semibold capitalize",bee[t.tier]),children:t.tier}),o&&e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(De,{size:8})," Installed"]})]}),e.jsx("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:t.description}),e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-2xs font-sans",children:[e.jsxs("span",{className:"text-text-2",children:[t.sizeGb," GB download"]}),e.jsxs("span",{className:"text-green-400 font-medium",children:[t.ramGb," GB RAM"]}),l!==null&&e.jsxs("span",{className:"text-text-4",children:[l,"% headroom"]})]})]}),o?e.jsx("span",{className:"text-xs text-success font-sans font-medium px-3 py-1.5",children:"Ready"}):e.jsxs("button",{onClick:()=>n(t.id),disabled:s===t.id,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-sans font-medium bg-accent/10 text-accent hover:bg-accent/20 transition-colors cursor-pointer disabled:opacity-40",children:[s===t.id?e.jsx($e,{size:12,className:"animate-spin"}):e.jsx(_a,{size:12}),"Pull"]})]})}function ADe({result:t,onExpand:a,expanded:n}){var s;return e.jsxs("button",{onClick:()=>a(n?null:t.id),className:"w-full text-left px-4 py-3 bg-surface-1 border border-border-subtle rounded-lg hover:border-accent/30 transition-colors cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate flex-1",children:t.name}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:t.author}),n?e.jsx(bt,{size:14,className:"text-text-3"}):e.jsx(Rt,{size:14,className:"text-text-3"})]}),e.jsxs("div",{className:"text-2xs text-text-3 font-sans mt-0.5 flex gap-3",children:[e.jsxs("span",{children:[(s=t.downloads)==null?void 0:s.toLocaleString()," downloads"]}),e.jsxs("span",{children:[t.likes," likes"]})]})]})}function uDe({repoId:t,onDownload:a,systemRamGb:n}){const[s,o]=g.useState(null),[c,l]=g.useState(!0),[A,u]=g.useState(null),f=ln();g.useEffect(()=>{l(!0),D.get(`/models/${t}/files`).then(m=>o(m.files||[])).catch(()=>f.error("Failed to load model files")).finally(()=>l(!1))},[t]);async function x(m){u(m.filename);try{await D.post("/models/download",{repoId:t,filename:m.filename}),f.success(`Downloading ${m.filename}`),a==null||a(m.filename)}catch(y){f.error(y.message)}u(null)}return c?e.jsx("div",{className:"py-3 px-4 text-2xs text-text-4 font-sans",children:"Loading quantization variants..."}):s!=null&&s.length?e.jsx("div",{className:"pl-6 pr-4 pb-2 space-y-1.5",children:s.map(m=>{const y=!m.estimatedRamGb||!n||m.estimatedRamGb<=n,v=m.estimatedRamGb&&n&&m.estimatedRamGb>n*.8&&y;return e.jsxs("div",{className:V("flex items-center gap-2 py-1.5 px-3 rounded-md text-xs font-sans",y?"bg-surface-2":"bg-red-500/5 border border-red-500/15"),children:[e.jsx("span",{className:"font-mono text-text-1 truncate flex-1",children:m.filename}),m.quantization&&e.jsx(be,{variant:"subtle",className:"text-2xs",children:m.quantization}),e.jsx("span",{className:"text-text-2 text-2xs w-16 text-right",children:iT(m.size)}),m.estimatedRamGb&&e.jsxs("span",{className:V("text-2xs w-20 text-right font-medium",y?v?"text-yellow-400":"text-green-400":"text-red-400"),children:["~",m.estimatedRamGb," GB RAM"]}),!y&&e.jsx("span",{className:"text-2xs text-red-400 font-medium",children:"too large"}),e.jsx("button",{onClick:()=>x(m),disabled:A===m.filename||!y,className:V("p-1 rounded transition-colors",y?"text-accent hover:bg-accent/10":"text-text-4 cursor-not-allowed","disabled:opacity-40"),children:A===m.filename?e.jsx($e,{size:13,className:"animate-spin"}):e.jsx(_a,{size:13})})]},m.filename)})}):e.jsx("div",{className:"py-3 px-4 text-2xs text-text-4 font-sans",children:"No GGUF files found in this repo."})}function xP({title:t,count:a,icon:n}){return e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n&&e.jsx(n,{size:14,className:"text-text-3"}),e.jsx("span",{className:"text-xs font-semibold font-sans text-text-2 uppercase tracking-wider",children:t}),a!==void 0&&e.jsx(be,{variant:"subtle",className:"text-2xs",children:a})]})}function hDe(){var Me;const[t,a]=g.useState("recommended"),[n,s]=g.useState(""),[o,c]=g.useState([]),[l,A]=g.useState(!1),[u,f]=g.useState([]),[x,m]=g.useState([]),[y,v]=g.useState(null),[O,b]=g.useState(null),[C,j]=g.useState(null),[N,M]=g.useState(null),[Q,L]=g.useState(null),[B,S]=g.useState([]),[I,z]=g.useState(null),[P,F]=g.useState(null),K=ln(),G=$(ie=>ie.ollamaStatus),H=$(ie=>ie.ollamaInstalledModels),q=$(ie=>ie.ollamaRunningModels),_=$(ie=>ie.ollamaCatalog),R=$(ie=>ie.ollamaPullProgress),U=$(ie=>ie.fetchOllamaStatus),Z=$(ie=>ie.startOllamaServer),J=$(ie=>ie.stopOllamaServer),Ae=$(ie=>ie.restartOllamaServer),W=$(ie=>ie.pullOllamaModel),ae=$(ie=>ie.deleteOllamaModel),Oe=$(ie=>ie.loadOllamaModel),ve=$(ie=>ie.unloadOllamaModel),ce=$(ie=>ie.spawnFromModel),he=g.useRef(null);g.useEffect(()=>(U(),he.current=setInterval(U,1e4),()=>clearInterval(he.current)),[U]),g.useEffect(()=>{D.get("/models/recommended").then(ie=>{f(ie.models||[])}).catch(()=>{}),D.get("/models/installed").then(ie=>{S((ie.models||[]).filter(Re=>Re.exists))}).catch(()=>{})},[]),g.useEffect(()=>{const ie=setInterval(()=>{D.get("/models/downloads").then(m).catch(()=>{})},2e3);return()=>clearInterval(ie)},[]),g.useEffect(()=>{function ie(xt){try{const St=JSON.parse(xt.data);St.type==="model:download:progress"&&m(at=>{const va=at.findIndex(Mn=>Mn.filename===St.data.filename);if(va>=0){const Mn=[...at];return Mn[va]=St.data,Mn}return[...at,St.data]}),St.type==="model:download:complete"&&(m(at=>at.filter(va=>va.filename!==St.data.filename)),K.success(`${St.data.filename} downloaded`),D.get("/models/installed").then(at=>{S((at.models||[]).filter(va=>va.exists))}).catch(()=>{})),St.type==="model:download:error"&&(m(at=>at.filter(va=>va.filename!==St.data.filename)),K.error(`Download failed: ${St.data.error}`))}catch{}}const Re=$.getState().ws;return Re&&Re.addEventListener("message",ie),()=>{Re&&Re.removeEventListener("message",ie)}},[K]);async function je(){b("starting");try{await Z()}catch{}b(null)}async function ee(){b("stopping");try{await J()}catch{}b(null)}async function ke(){b("restarting");try{await Ae()}catch{}b(null)}async function ye(ie){j(ie);try{await Oe(ie)}catch{}j(null)}async function Ne(ie){M(ie);try{await ve(ie)}catch{}M(null)}async function ze(ie){L(ie);try{await ae(ie)}catch{}L(null)}async function He(ie){F(ie);try{const Re=await D.post(`/models/${encodeURIComponent(ie)}/import-to-ollama`);K.success(`Imported as "${Re.ollamaName}" — now available in Ollama`),U(),S(xt=>xt.filter(St=>St.id!==ie))}catch(Re){K.error(`Import failed: ${Re.message}`)}F(null)}async function Tt(ie){z(ie);try{await D.delete(`/models/${encodeURIComponent(ie)}`),S(Re=>Re.filter(xt=>xt.id!==ie)),K.success(`Removed ${ie}`)}catch(Re){K.error(`Delete failed: ${Re.message}`)}z(null)}async function Et(ie){W(ie)}async function ya(){if(n.trim()){A(!0),a("search");try{const ie=await D.get(`/models/search?q=${encodeURIComponent(n.trim())}`);c(ie)}catch(ie){K.error(ie.message)}A(!1)}}new Set(H.map(ie=>ie.id));const Nn=new Set(q.map(ie=>ie.name)),Wt={};for(const ie of _){const Re=ie.id.split(":")[0];Wt[Re]=ie,Wt[ie.id]=ie}function se(ie){if(Wt[ie])return Wt[ie];const Re=ie.split(":")[0];return Wt[Re]||null}return e.jsxs("div",{className:"h-full flex flex-col bg-surface-0",children:[e.jsxs("div",{className:"flex-shrink-0 px-5 pt-4 pb-3 border-b border-border space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-base font-bold font-sans text-text-0",children:"Local Models"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(be,{variant:"subtle",className:"text-2xs",children:[H.length+B.length," installed"]}),q.length>0&&e.jsxs(be,{variant:"success",className:"text-2xs",children:[q.length," running"]})]})]}),e.jsx(nDe,{serverRunning:G.serverRunning,installed:G.installed,onStart:je,onStop:ee,onRestart:ke,actionInProgress:O}),e.jsx(sDe,{hardware:G.hardware})]}),x.length>0&&e.jsxs("div",{className:"px-5 py-3 border-b border-border space-y-2",children:[e.jsx("div",{className:"text-xs font-sans font-semibold text-text-2",children:"Downloading"}),x.map(ie=>e.jsx(cDe,{download:ie},ie.filename))]}),Object.keys(R).length>0&&e.jsxs("div",{className:"px-5 py-3 border-b border-border space-y-2",children:[e.jsx("div",{className:"text-xs font-sans font-semibold text-text-2",children:"Pulling Models"}),Object.entries(R).map(([ie,Re])=>e.jsx(lDe,{modelId:ie,progress:Re},ie))]}),e.jsx(it,{className:"flex-1",children:e.jsxs("div",{className:"px-5 py-4 space-y-6",children:[e.jsxs("div",{children:[e.jsx(xP,{title:"Running Models",count:q.length,icon:wt}),q.length===0?e.jsx("div",{className:"px-4 py-4 bg-surface-1 border border-border-subtle rounded-lg text-center",children:e.jsx("p",{className:"text-xs text-text-3 font-sans",children:G.serverRunning?"No models loaded — start one below":"Start the server to load models"})}):e.jsx("div",{className:"space-y-2",children:q.map(ie=>e.jsx(rDe,{model:ie,onUnload:Ne,onSpawn:ce,unloading:N},ie.name))})]}),e.jsxs("div",{children:[e.jsx(xP,{title:"Installed Models",count:H.length,icon:Kn}),H.length===0?e.jsxs("div",{className:"px-4 py-6 bg-surface-1 border border-border-subtle rounded-lg text-center",children:[e.jsx(on,{size:32,className:"mx-auto text-text-4 mb-2"}),e.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"No models installed"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Pull a model from the Recommended section below, or search HuggingFace."})]}):e.jsx("div",{className:"space-y-2",children:H.map(ie=>e.jsx(oDe,{model:ie,catalogEntry:se(ie.id),isRunning:Nn.has(ie.id),onStart:ye,onSpawn:ce,onDelete:ze,loading:C,deleting:Q,serverRunning:G.serverRunning},ie.id))})]}),B.length>0&&e.jsxs("div",{children:[e.jsx(xP,{title:"Downloaded Models (GGUF)",count:B.length,icon:_a}),e.jsx("div",{className:"space-y-2",children:B.map(ie=>e.jsx(iDe,{model:ie,onImport:He,onDelete:Tt,importing:P,deleting:I},ie.id))})]}),e.jsx("div",{className:"border-t border-border-subtle"}),e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center justify-between mb-3",children:e.jsx("span",{className:"text-xs font-semibold font-sans text-text-2 uppercase tracking-wider",children:"Discover Models"})}),e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(oa,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{value:n,onChange:ie=>s(ie.target.value),onKeyDown:ie=>ie.key==="Enter"&&ya(),placeholder:"Search HuggingFace for GGUF models...",className:"w-full h-8 pl-9 pr-3 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsx(fe,{onClick:ya,disabled:l,size:"sm",variant:"accent",children:l?e.jsx($e,{size:14,className:"animate-spin"}):"Search"})]}),e.jsx("div",{className:"flex gap-1 mb-3",children:[{id:"recommended",label:`Recommended (${u.length})`},{id:"search",label:`Search (${o.length})`}].map(ie=>e.jsx("button",{onClick:()=>a(ie.id),className:V("px-3 py-1 rounded-md text-xs font-sans font-medium transition-colors cursor-pointer",t===ie.id?"bg-accent/12 text-accent":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:ie.label},ie.id))}),e.jsxs("div",{className:"space-y-2",children:[t==="recommended"&&e.jsx(e.Fragment,{children:u.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Ba,{size:32,className:"mx-auto text-text-4 mb-2"}),e.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"Detecting hardware..."}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Make sure Ollama is installed so we can check your system."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-xs text-text-3 font-sans mb-2",children:["Top models for your system (",((Me=G.hardware)==null?void 0:Me.totalRamGb)||"?"," GB RAM). Click Pull to download via Ollama."]}),u.map(ie=>{var St;const Re=ie.id.split(":")[0],xt=H.some(at=>at.id===ie.id||at.id.startsWith(Re+":")||at.id===Re);return e.jsx(dDe,{model:ie,systemRamGb:(St=G.hardware)==null?void 0:St.totalRamGb,onPull:Et,pulling:R[ie.id]?ie.id:null,isInstalled:xt},ie.id)})]})}),t==="search"&&e.jsx(e.Fragment,{children:l?e.jsxs("div",{className:"text-center py-8",children:[e.jsx($e,{size:24,className:"mx-auto text-accent animate-spin mb-2"}),e.jsx("p",{className:"text-sm text-text-3 font-sans",children:"Searching HuggingFace..."})]}):o.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(oa,{size:32,className:"mx-auto text-text-4 mb-2"}),e.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"Search for GGUF models"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:'Try "qwen coder", "deepseek", "codestral", "llama"'})]}):o.map(ie=>{var Re;return e.jsxs("div",{className:"space-y-1",children:[e.jsx(ADe,{result:ie,expanded:y===ie.id,onExpand:v}),y===ie.id&&e.jsx(uDe,{repoId:ie.id,systemRamGb:(Re=G.hardware)==null?void 0:Re.totalRamGb})]},ie.id)})})]})]})]})})]})}function pDe(t){switch(t){case"established":return e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(ia,{status:"running",size:"sm"})," Connected"]});case"connecting":return e.jsx(be,{variant:"warning",className:"text-2xs",dot:"pulse",children:"Connecting"});case"error":return e.jsx(be,{variant:"danger",className:"text-2xs",children:"Error"});default:return e.jsx(be,{variant:"default",className:"text-2xs",children:"Unknown"})}}function fDe({onOpenWizard:t}){const a=$(x=>x.federation.connections),n=$(x=>x.federation.peers),s=$(x=>x.sendPouch),o=$(x=>x.disconnectPeer),c=$(x=>x.addToast),[l,A]=g.useState(null),u=n.length>0?n:a;async function f(x){A(x);try{await s(x,{type:"ping"})}catch{}A(null)}return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(aa,{size:12,className:"text-accent"}),e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"Connected Peers"}),u.length>0&&e.jsx(be,{variant:"success",className:"text-2xs",children:u.length})]}),e.jsxs(fe,{size:"sm",variant:"primary",onClick:t,className:"h-7 text-2xs gap-1.5",children:[e.jsx(ht,{size:11}),"Pair New Peer"]})]}),u.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border-subtle bg-surface-1/50 px-4 py-8 text-center",children:[e.jsx(Yo,{size:20,className:"text-text-4 mx-auto mb-2"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mb-1",children:"No peers connected"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans mb-3",children:"Pair with a remote Groove daemon to share agents and coordinate work."}),e.jsxs(fe,{size:"sm",variant:"outline",onClick:t,className:"h-7 text-2xs gap-1.5",children:[e.jsx(ht,{size:11}),"Pair Your First Peer"]})]}):e.jsx("div",{className:"grid gap-2",children:u.map(x=>{const m=x.peerId||x.ip||x.id,y=x.name||x.peerId||"Unknown Peer",v=x.state||x.status||"unknown",O=x.ip||x.address||"",b=x.latency;return e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-1 p-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-accent/10 flex-shrink-0 mt-0.5",children:e.jsx(aa,{size:14,className:"text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:y}),pDe(v)]}),e.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3",children:[O&&e.jsxs("span",{className:"font-mono truncate",children:[O,x.port?`:${x.port}`:""]}),b!=null&&e.jsxs("span",{className:"flex items-center gap-1 font-sans",children:[e.jsx(UA,{size:9,className:V(b<100?"text-success":b<300?"text-warning":"text-danger")}),b,"ms"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-3 pt-2.5 border-t border-border-subtle",children:[e.jsxs(fe,{size:"sm",variant:"ghost",className:"h-6 text-2xs gap-1 text-text-2",onClick:()=>c("info",y,`ID: ${m}
8674
+ disabled:cursor-not-allowed`})]}),e.jsx("span",{className:"text-2xs text-accent font-mono font-medium w-10 text-right shrink-0 tabular-nums",children:y})]})}const QRe={agentNode:VG,rootNode:XG},lP=220,dP=82,vf=260,kf=130,_o=4,Ua="__groove_root__";function r0(t){if(!t)return{};try{return JSON.parse(localStorage.getItem(`groove:nodePositions:${t}`)||"{}")}catch{return{}}}function ZJ(){let t=!1;for(const a of["groove:chatHistory","groove:activityLog"])localStorage.getItem(a)!==null&&(localStorage.removeItem(a),t=!0);return t}function NX(t,a){if(!t)return;const n=`groove:nodePositions:${t}`,s=JSON.stringify(a);try{localStorage.setItem(n,s);return}catch{}if(ZJ())try{localStorage.setItem(n,s)}catch{}}function GJ(){try{return JSON.parse(localStorage.getItem("groove:roleLayout")||"{}")}catch{return{}}}function BRe(t){const a="groove:roleLayout",n=JSON.stringify(t);try{localStorage.setItem(a,n);return}catch{}if(ZJ())try{localStorage.setItem(a,n)}catch{}}function WJ(){try{return JSON.parse(localStorage.getItem("groove:teamViewports")||"{}")}catch{return{}}}function _Re(t,a){try{const n=WJ();n[t]=a,localStorage.setItem("groove:teamViewports",JSON.stringify(n))}catch{}}function LRe(t,a){const n=t.filter(l=>l.teamId===a);return n.length===0?"idle":n.some(l=>l.status==="running"||l.status==="starting")?"working":n.every(l=>l.status==="completed")?"completed":n.some(l=>l.status==="crashed")?"crashed":"idle"}function TRe(){const t=$(_=>_.teams),a=$(_=>_.activeTeamId),n=$(_=>_.agents),s=$(_=>_.switchTeam),o=$(_=>_.createTeam),c=$(_=>_.deleteTeamPermanently),l=$(_=>_.renameTeam),A=$(_=>_.cloneTeam),u=$(_=>_.reorderTeams),f=$(_=>_.addToast),[x,m]=g.useState(!1),[y,v]=g.useState(""),[O,b]=g.useState(null),[C,j]=g.useState(""),N=g.useRef(!1),[M,Q]=g.useState(null),[L,B]=g.useState(null),S=g.useRef(null),[I,z]=g.useState(!1),[P,F]=g.useState(!1),K=g.useCallback(()=>{const _=S.current;_&&(z(_.scrollLeft>0),F(_.scrollLeft+_.clientWidth<_.scrollWidth-1))},[]);g.useEffect(()=>{const _=S.current;if(!_)return;K(),_.addEventListener("scroll",K);const R=new ResizeObserver(K);return R.observe(_),()=>{_.removeEventListener("scroll",K),R.disconnect()}},[K,t.length]);function G(){const _=y.trim();!_||N.current||(N.current=!0,v(""),m(!1),o(_).finally(()=>{N.current=!1,setTimeout(()=>{S.current&&S.current.scrollTo({left:S.current.scrollWidth,behavior:"smooth"})},100)}))}function H(_){b(_.id),j(_.name)}function q(){const _=C.trim();if(!_||!O){b(null);return}l(O,_),b(null)}return e.jsxs("div",{className:"flex items-end px-0 pt-0 pb-0 bg-surface-1 border-b border-border gap-0 flex-shrink-0 overflow-hidden",children:[I&&e.jsx("button",{onClick:()=>{var _;return(_=S.current)==null?void 0:_.scrollBy({left:-300,behavior:"smooth"})},className:"w-6 h-9 flex items-center justify-center bg-accent/15 text-accent hover:bg-accent/25 transition-colors flex-shrink-0 cursor-pointer",children:e.jsx(bs,{size:14})}),e.jsxs("div",{ref:S,className:"flex items-end flex-1 min-w-0 overflow-x-auto gap-0",style:{scrollbarWidth:"none",msOverflowStyle:"none",WebkitOverflowScrolling:"touch"},children:[t.map(_=>{const R=n.filter(Ae=>Ae.teamId===_.id).length,U=_.id===a,Z=O===_.id,J=n.filter(Ae=>Ae.teamId===_.id&&(Ae.status==="running"||Ae.status==="starting")).length;return e.jsxs(Bz,{children:[e.jsx(_z,{asChild:!0,children:e.jsxs("div",{draggable:!Z,onDragStart:Ae=>{Q(_.id),Ae.dataTransfer.effectAllowed="move",Ae.dataTransfer.setData("text/plain","")},onDragEnd:()=>{Q(null),B(null)},onDragOver:Ae=>{Ae.preventDefault(),Ae.dataTransfer.dropEffect="move",M&&M!==_.id&&B(_.id)},onDragLeave:()=>{L===_.id&&B(null)},onDrop:Ae=>{if(Ae.preventDefault(),!M||M===_.id)return;const W=t.findIndex(Oe=>Oe.id===M),ae=t.findIndex(Oe=>Oe.id===_.id);W!==-1&&ae!==-1&&u(W,ae),Q(null),B(null)},onClick:()=>!Z&&s(_.id),onDoubleClick:()=>H(_),className:V("relative flex items-center gap-2 px-3 h-9 text-xs font-sans cursor-pointer select-none transition-colors flex-shrink-0",U?"text-text-0 font-semibold border-x border-x-[#242830] bg-[#242830]":"text-text-3 hover:text-text-1 hover:bg-surface-3/50",M===_.id&&"opacity-40",L===_.id&&M!==_.id&&"border-l-2 !border-l-accent"),children:[U&&e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-accent",style:{height:"0.5px"}}),(()=>{const Ae=LRe(n,_.id),W=Ae==="working"||Ae==="completed"?"text-green-400":Ae==="crashed"?"text-red-400":U?"text-accent":"text-text-4";return e.jsxs("span",{className:"relative flex-shrink-0",children:[e.jsx(Fa,{size:13,className:V(W,Ae==="working"&&"animate-pulse")}),Ae==="working"&&e.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-1.5 h-1.5 rounded-full bg-green-400 animate-pulse"})]})})(),Z?e.jsx("input",{value:C,onChange:Ae=>j(Ae.target.value),onKeyDown:Ae=>{Ae.key==="Enter"&&q(),Ae.key==="Escape"&&b(null)},onBlur:q,className:"h-5 w-24 px-1.5 text-xs bg-surface-0 border border-accent rounded text-text-0 font-sans focus:outline-none",autoFocus:!0,onClick:Ae=>Ae.stopPropagation()}):e.jsx("span",{className:"truncate max-w-[120px]",children:_.name}),R>0&&!Z&&e.jsx("span",{className:V("flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full text-2xs font-mono font-semibold",J>0?"bg-accent/15 text-accent":"bg-surface-4 text-text-3"),children:R}),U&&e.jsx("div",{className:"absolute bottom-[-1px] left-0 right-0 h-px bg-[#242830]"})]})}),e.jsxs(Lz,{children:[e.jsxs(ms,{onSelect:()=>H(_),children:[e.jsx(js,{size:12})," Rename"]}),e.jsxs(ms,{onSelect:()=>A(_.id),children:[e.jsx(wn,{size:12})," Clone"]}),e.jsx(Tz,{}),e.jsxs(ms,{danger:!0,onSelect:()=>{if(n.filter(W=>W.teamId===_.id).some(W=>W.status==="running"||W.status==="starting")){f("error","Stop running agents first");return}c(_.id)},children:[e.jsx(At,{size:12})," Delete"]})]})]},_.id)}),x?e.jsxs("div",{className:"flex items-center gap-1.5 px-3 h-9 flex-shrink-0",children:[e.jsx("input",{value:y,onChange:_=>v(_.target.value),onKeyDown:_=>{_.key==="Enter"&&G(),_.key==="Escape"&&(m(!1),v(""))},placeholder:"Team name...",className:"h-5 w-28 px-1.5 text-xs bg-surface-0 border border-border-subtle rounded text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:G,disabled:!y.trim(),className:"p-1 rounded text-accent hover:bg-accent/10 cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",children:e.jsx(De,{size:12})}),e.jsx("button",{onClick:()=>{m(!1),v("")},className:"p-1 rounded text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(Ge,{size:12})})]}):e.jsx("button",{onClick:()=>m(!0),className:"flex items-center justify-center w-6 h-6 my-auto mx-2 rounded-full bg-accent/15 text-accent hover:bg-accent/25 cursor-pointer transition-colors flex-shrink-0",title:"New team",children:e.jsx(ht,{size:12})})]}),P&&e.jsx("button",{onClick:()=>{var _;return(_=S.current)==null?void 0:_.scrollBy({left:300,behavior:"smooth"})},className:"w-6 h-9 flex items-center justify-center bg-accent/15 text-accent hover:bg-accent/25 transition-colors flex-shrink-0 cursor-pointer",children:e.jsx(Rt,{size:14})})]})}function $Re(){const t=$(H=>H.agents),a=$(H=>H.activeTeamId),n=$(H=>H.tokenTimeline),s=$(H=>H.selectAgent),o=$(H=>H.closeDetail),c=g.useRef([]),l=g.useMemo(()=>{const H=t.filter(_=>_.teamId===a).sort((_,R)=>(_.name||_.id).localeCompare(R.name||R.id)),q=c.current;return q.length===H.length&&q.every((_,R)=>_.id===H[R].id&&_.status===H[R].status&&_.name===H[R].name&&_.model===H[R].model&&_.tokensUsed===H[R].tokensUsed&&_.contextUsage===H[R].contextUsage)?q:(c.current=H,H)},[t,a]),A=g.useRef(r0(a)),u=g.useRef(a);u.current!==a&&(u.current=a,A.current=r0(a));const{fitView:f,setViewport:x}=Vae(),[m,y]=g.useState(0),v=g.useRef(a),O=g.useMemo(()=>{const H=A.current,q=GJ(),_=l.filter(ae=>ae.status==="running").length,R=H[Ua]||q[Ua]||{x:0,y:0},U=[{id:Ua,type:"rootNode",position:R,data:{agentCount:l.length,runningCount:_},draggable:!0,selectable:!1}],Z=new Set,J=(ae,Oe)=>`${Math.round(ae/100)},${Math.round(Oe/100)}`;Z.add(J(R.x,R.y));const Ae=[];l.forEach(ae=>{const Oe=ae.name||ae.id;if(H[Oe]){const ve=H[Oe];Z.add(J(ve.x,ve.y)),U.push({id:ae.id,type:"agentNode",position:ve,data:{agent:ae,timeline:n[ae.id]||[]},draggable:!0,selectable:!0})}else Ae.push(ae)});const W=new Map;return Ae.forEach((ae,Oe)=>{const ve=ae.role||"agent",ce=W.get(ve)||0;W.set(ve,ce+1);const he=ce===0?ve:`${ve}-${ce}`;let je;if(q[he])je={...q[he]};else{const ee=Math.floor(Oe/_o),ke=Oe%_o;je={x:-((Math.min(Ae.length-ee*_o,_o)-1)*vf)/2+ke*vf,y:kf+ee*kf}}for(;Z.has(J(je.x,je.y));)je={x:je.x,y:je.y+kf};Z.add(J(je.x,je.y)),ae.name||ae.id,U.push({id:ae.id,type:"agentNode",position:je,data:{agent:ae,timeline:n[ae.id]||[]},draggable:!0,selectable:!0})}),U},[l,n,a]);g.useEffect(()=>{const H={};O.forEach(q=>{var R,U;const _=q.id===Ua?Ua:((U=(R=q.data)==null?void 0:R.agent)==null?void 0:U.name)||q.id;A.current[_]||(H[_]=q.position)}),Object.keys(H).length>0&&(Object.assign(A.current,H),NX(a,A.current))},[O,a]);const b=g.useMemo(()=>{const H=r0(a),q=H[Ua]||{x:0,y:0};return l.map((_,R)=>{const U=_.name||_.id,Z=Math.floor(R/_o),J=R%_o,W=-((Math.min(l.length-Z*_o,_o)-1)*vf)/2,ae=H[U]||{x:W+J*vf,y:140+Z*kf},Oe=ae.x+lP/2-q.x,ve=ae.y+dP/2-q.y;let ce,he;return Math.abs(ve)>Math.abs(Oe)?(ce=ve>0?"bottom":"top",he=ve>0?"top":"bottom"):(ce=Oe>0?"right":"left",he=Oe>0?"left":"right"),{id:`e-${Ua}-${_.id}`,source:Ua,target:_.id,sourceHandle:ce,targetHandle:he,type:"default",animated:_.status==="running"}})},[l,a]),[C,j,N]=Xae(O),[M,Q,L]=Zae(b),B=g.useRef(new Set);g.useEffect(()=>{j(H=>{const q=new Map(H.map(_=>[_.id,_]));return O.map(_=>{const R=q.get(_.id);return R?{...R,data:_.data}:_})})},[O,j]),g.useEffect(()=>{Q(()=>{const H=C.find(_=>_.id===Ua);if(!H)return b;const q=H.position;return b.map(_=>{const R=C.find(W=>W.id===_.target);if(!R)return _;const U=R.position.x+lP/2-q.x,Z=R.position.y+dP/2-q.y;let J,Ae;return Math.abs(Z)>Math.abs(U)?(J=Z>0?"bottom":"top",Ae=Z>0?"top":"bottom"):(J=U>0?"right":"left",Ae=U>0?"left":"right"),{..._,sourceHandle:J,targetHandle:Ae}})})},[b,C,Q]);const S=l.map(H=>H.id).join(","),I=g.useRef(null);g.useEffect(()=>{if(v.current!==a){v.current=a,B.current=new Set(l.map(R=>R.id)),y(l.length);const _=WJ()[a];_?x(_,{duration:200}):l.length>0&&f({padding:.3,maxZoom:1.2,duration:200});return}const H=new Set(l.map(_=>_.id)),q=l.length>0&&[...H].some(_=>!B.current.has(_));B.current=H,m===0&&l.length>0?f({padding:.3,maxZoom:1.2,duration:0}):q&&(clearTimeout(I.current),I.current=setTimeout(()=>f({padding:.3,maxZoom:1.2,duration:300}),500)),y(l.length)},[S,m,f,a,x]);const z=g.useCallback((H,q)=>{_Re(a,q)},[a]),P=g.useCallback((H,q)=>{q.id!==Ua&&s(q.id)},[s]),F=g.useCallback(()=>{o()},[o]),K=g.useCallback((H,q)=>{const _=C.find(U=>U.id===Ua);if(!_)return;const R=_.position;Q(U=>U.map(Z=>{const J=Z.source===q.id,Ae=Z.target===q.id;if(!J&&!Ae)return Z;const W=q.position,ae=W.x+lP/2-R.x,Oe=W.y+dP/2-R.y;let ve,ce;return Math.abs(Oe)>Math.abs(ae)?(ve=Oe>0?"bottom":"top",ce=Oe>0?"top":"bottom"):(ve=ae>0?"right":"left",ce=ae>0?"left":"right"),{...Z,sourceHandle:ve,targetHandle:ce}}))},[C,Q]),G=g.useCallback((H,q)=>{var U,Z;const _=q.id===Ua?Ua:((Z=(U=q.data)==null?void 0:U.agent)==null?void 0:Z.name)||q.id;A.current[_]=q.position;const R=r0(a);R[_]=q.position,NX(a,R)},[a]);return e.jsx(Gae,{nodes:C,edges:M,nodeTypes:QRe,onNodesChange:N,onEdgesChange:L,onNodeClick:P,onPaneClick:F,onNodeDrag:K,onNodeDragStop:G,onMoveEnd:z,defaultViewport:{x:0,y:0,zoom:1.2},proOptions:{hideAttribution:!0},minZoom:.2,maxZoom:1.5,className:"bg-surface-2",children:e.jsx(Wae,{color:"rgba(97,175,239,0.03)",gap:24,size:1})})}const Iz=new Set(["codex","grok","local"]),IRe=new Set(["codex"]);function URe({open:t,onOpenChange:a,onLaunch:n}){const s=$(B=>B.fetchProviders),[o,c]=g.useState([]),[l,A]=g.useState(""),[u,f]=g.useState(""),[x,m]=g.useState(50),[y,v]=g.useState(.5),[O,b]=g.useState(50);g.useEffect(()=>{t&&s().then(B=>{var I;if(!Array.isArray(B))return;const S=B.filter(z=>z.installed);if(c(S),!l&&S.length>0){const z=S.find(F=>F.isDefault)||S[0];A(z.id);const P=((I=z.models)==null?void 0:I.filter(F=>F.type!=="image"))||[];P.length>0&&f(P[0].id)}}).catch(()=>{})},[t]);const C=o.find(B=>B.id===l),j=((C==null?void 0:C.models)||[]).filter(B=>B.type!=="image"&&!B.disabled),N=Iz.has(l),M=IRe.has(l);function Q(B){var z;A(B);const S=o.find(P=>P.id===B),I=((S==null?void 0:S.models)||[]).filter(P=>P.type!=="image"&&!P.disabled);f(((z=I[0])==null?void 0:z.id)||"")}function L(){const B={provider:l,model:u,reasoningEffort:x,...N&&{temperature:y},...M&&{verbosity:O}};$.setState({teamLaunchConfig:B}),n(B)}return e.jsx(Ut,{open:t,onOpenChange:a,children:e.jsxs(Pt,{title:"Configure Planner",description:"Set provider, model, and tuning before launching the planner",children:[e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans",children:"Provider"}),e.jsxs(Ur,{value:l,onValueChange:Q,children:[e.jsx(Pr,{placeholder:"Select provider",className:"bg-surface-3"}),e.jsx(Er,{children:o.map(B=>e.jsx(Da,{value:B.id,children:B.displayName||B.name||B.id},B.id))})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans",children:"Model"}),e.jsxs(Ur,{value:u,onValueChange:f,children:[e.jsx(Pr,{placeholder:"Select model",className:"bg-surface-3"}),e.jsxs(Er,{children:[e.jsx(Da,{value:"auto",children:"Auto"}),j.map(B=>e.jsx(Da,{value:B.id,children:B.name||B.id},B.id))]})]})]}),e.jsxs("div",{className:"space-y-1 pt-1",children:[e.jsx(ri,{label:"Reasoning Effort",value:x,onChange:m,min:0,max:100,step:1}),N&&e.jsx(ri,{label:"Temperature",value:y,onChange:v,min:0,max:1,step:.01,formatValue:B=>B.toFixed(2)}),M&&e.jsx(ri,{label:"Verbosity",value:O,onChange:b,min:0,max:100,step:1})]})]}),e.jsx("div",{className:"px-5 py-4 border-t border-border-subtle",children:e.jsxs(fe,{variant:"primary",size:"md",onClick:L,className:"w-full gap-2",children:[e.jsx(wt,{size:14}),"Launch Planner"]})})]})})}const MX={chat:Yn,planner:es,backend:aa,frontend:Dr,fullstack:Zt,testing:ti,devops:NA,docs:Va,security:La,database:MA,cmo:_A,cfo:tu,ea:Ou,support:Au,analyst:hs,creative:Lr,slides:yu,ambassador:sa},AP=[{id:"planner",label:"Planner",desc:"Analyzes tasks and designs team plans"},{id:"frontend",label:"Frontend",desc:"React, UI components, views, styling"},{id:"backend",label:"Backend",desc:"APIs, server logic, database, services"},{id:"fullstack",label:"Fullstack",desc:"Cross-stack work, QC, integration testing"},{id:"testing",label:"Testing",desc:"Test suites, coverage, quality assurance"},{id:"devops",label:"DevOps",desc:"CI/CD, deployment, infrastructure"},{id:"security",label:"Security",desc:"Security audits, vulnerability analysis"},{id:"database",label:"Database",desc:"Schema design, queries, migrations"},{id:"docs",label:"Docs",desc:"Documentation, guides, API docs"},{id:"cmo",label:"CMO",desc:"Marketing strategy, campaigns, content"},{id:"cfo",label:"CFO",desc:"Financial analysis, budgeting, forecasting"},{id:"ea",label:"EA",desc:"Executive assistance, coordination, briefings"},{id:"support",label:"Support",desc:"Customer support, issue triage"},{id:"analyst",label:"Analyst",desc:"Data analysis, research, reporting"},{id:"creative",label:"Writer",desc:"Design, copywriting, visual assets"},{id:"slides",label:"Slides",desc:"Presentations, decks, pitch materials"}],PRe=[{name:"Dev Team",icon:Zt,roles:["frontend","backend","testing"],desc:"3 agents"},{name:"Full Stack",icon:Dn,roles:["frontend","backend","fullstack","testing","devops"],desc:"5 agents"},{name:"Marketing",icon:_A,roles:["cmo","creative","analyst"],desc:"3 agents"},{name:"Business",icon:hs,roles:["cfo","analyst","ea"],desc:"3 agents"},{name:"Security Audit",icon:La,roles:["security","testing","devops"],desc:"3 agents"},{name:"Docs",icon:Va,roles:["docs","frontend","analyst"],desc:"3 agents"}];function ERe(){const t=$(W=>W.teamBuilderOpen),a=$(W=>W.teamBuilderRoles),n=$(W=>W.teamBuilderSettings),s=$(W=>W.teamBuilderTask),o=$(W=>W.teamTemplates),c=$(W=>W.closeTeamBuilder),l=$(W=>W.addTeamBuilderRole),A=$(W=>W.removeTeamBuilderRole),u=$(W=>W.updateTeamBuilderRole),f=$(W=>W.applyTemplate),x=$(W=>W.setTeamBuilderSettings),m=$(W=>W.setTeamBuilderTask),y=$(W=>W.launchTeamBuilder),v=$(W=>W.saveTeamTemplate),O=$(W=>W.fetchTeamTemplates),b=$(W=>W.fetchProviders),[C,j]=g.useState([]),[N,M]=g.useState(""),[Q,L]=g.useState(null),[B,S]=g.useState(!1),[I,z]=g.useState(null),[P,F]=g.useState(!1),[K,G]=g.useState("");if(g.useEffect(()=>{t&&(b().then(W=>{Array.isArray(W)&&j(W.filter(ae=>ae.installed))}).catch(()=>{}),O())},[t]),!t)return null;const H=N?AP.filter(W=>W.label.toLowerCase().includes(N.toLowerCase())||W.desc.toLowerCase().includes(N.toLowerCase())):AP,q=C.find(W=>W.id===n.provider),_=((q==null?void 0:q.models)||[]).filter(W=>W.type!=="image"&&!W.disabled);function R(W){var ve;x({provider:W});const ae=C.find(ce=>ce.id===W),Oe=((ae==null?void 0:ae.models)||[]).filter(ce=>ce.type!=="image"&&!ce.disabled);x({provider:W,model:((ve=Oe[0])==null?void 0:ve.id)||""})}function U(W){f(W),z(W.name)}async function Z(){S(!0);try{await y()}catch{}S(!1)}function J(){const W=K.trim();W&&(v(W),F(!1),G(""))}const Ae=[...PRe,...(o.custom||[]).map(W=>{var ae;return{...W,icon:Dn,desc:`${((ae=W.roles)==null?void 0:ae.length)||0} agents`,custom:!0}})];return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:[e.jsxs("div",{className:"w-full max-w-5xl max-h-[90vh] bg-surface-1 border border-border rounded-xl shadow-2xl flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border-subtle",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-info/15 flex items-center justify-center",children:e.jsx(Fa,{size:16,className:"text-info"})}),e.jsx("h2",{className:"text-lg font-bold text-text-0 font-sans",children:"Team Builder"})]}),e.jsx("button",{onClick:c,className:"p-2 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-3 transition-colors cursor-pointer",children:e.jsx(Ge,{size:18})})]}),e.jsx("div",{className:"px-6 py-3 border-b border-border-subtle",children:e.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-1",style:{scrollbarWidth:"none"},children:[Ae.map(W=>{const ae=W.icon||Dn,Oe=I===W.name;return e.jsxs("button",{onClick:()=>U(W),className:V("flex flex-col items-center gap-1.5 px-4 py-2.5 rounded-lg border text-center transition-all cursor-pointer flex-shrink-0 min-w-[100px]",Oe?"border-accent bg-accent/5":"border-border-subtle bg-surface-3 hover:border-accent/30 hover:bg-surface-4"),children:[e.jsx(ae,{size:16,className:Oe?"text-accent":"text-text-2"}),e.jsx("span",{className:"text-2xs font-semibold text-text-0 font-sans",children:W.name}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:W.desc})]},W.name)}),e.jsx(Nt,{content:"Save current roster as template",children:e.jsxs("button",{onClick:()=>{F(!0),G("")},disabled:a.length===0,className:"flex flex-col items-center gap-1.5 px-4 py-2.5 rounded-lg border border-dashed border-border-subtle bg-surface-2 hover:border-accent/30 transition-all cursor-pointer flex-shrink-0 min-w-[100px] disabled:opacity-30 disabled:cursor-not-allowed",children:[e.jsx(Xr,{size:16,className:"text-text-3"}),e.jsx("span",{className:"text-2xs font-semibold text-text-2 font-sans",children:"Save"}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Template"})]})})]})}),e.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"w-[40%] border-r border-border-subtle flex flex-col",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border-subtle",children:e.jsxs("div",{className:"relative",children:[e.jsx(oa,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{type:"text",value:N,onChange:W=>M(W.target.value),placeholder:"Filter roles...",className:"w-full h-8 pl-8 pr-3 text-xs bg-surface-3 border border-border-subtle rounded-md text-text-0 placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent font-sans"})]})}),e.jsx(it,{className:"flex-1",children:e.jsx("div",{className:"p-3 grid grid-cols-2 gap-2",children:H.map(W=>{const ae=MX[W.id]||Zt;return e.jsxs("button",{onClick:()=>l(W.id),className:"flex items-start gap-2.5 p-2.5 rounded-lg border border-border-subtle bg-surface-2 hover:border-accent/30 hover:bg-surface-3 transition-all cursor-pointer text-left group",children:[e.jsx("div",{className:"w-7 h-7 rounded-md bg-surface-4 flex items-center justify-center flex-shrink-0 group-hover:bg-accent/15 transition-colors",children:e.jsx(ae,{size:14,className:"text-text-2 group-hover:text-accent transition-colors"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:W.label}),e.jsx(ht,{size:12,className:"text-text-4 group-hover:text-accent transition-colors flex-shrink-0"})]}),e.jsx("p",{className:"text-2xs text-text-3 font-sans leading-tight mt-0.5",children:W.desc})]})]},W.id)})})})]}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border-subtle flex items-center justify-between",children:e.jsxs("span",{className:"text-xs font-semibold text-text-1 font-sans uppercase tracking-wider",children:["Your Team (",a.length,")"]})}),e.jsx(it,{className:"flex-1",children:e.jsx("div",{className:"p-3 space-y-1.5",children:a.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx(Fa,{size:32,className:"text-text-4 mb-3"}),e.jsx("p",{className:"text-sm text-text-2 font-sans",children:"Add roles from the left or pick a template above"})]}):a.map((W,ae)=>{var je;const Oe=MX[W.role]||Zt,ve=Q===ae,ce=W.provider?C.find(ee=>ee.id===W.provider):null,he=((ce==null?void 0:ce.models)||[]).filter(ee=>ee.type!=="image"&&!ee.disabled);return e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-2 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[e.jsx(y0,{size:12,className:"text-text-4 flex-shrink-0 cursor-grab"}),e.jsx("div",{className:"w-6 h-6 rounded-md bg-surface-4 flex items-center justify-center flex-shrink-0",children:e.jsx(Oe,{size:12,className:"text-text-1"})}),e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans flex-1",children:((je=AP.find(ee=>ee.id===W.role))==null?void 0:je.label)||W.role}),e.jsx("button",{onClick:()=>L(ve?null:ae),className:"p-1 rounded text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(bt,{size:12,className:V("transition-transform duration-200",ve&&"rotate-180")})}),e.jsx("button",{onClick:()=>{A(ae),Q===ae?L(null):Q>ae&&L(Q-1)},className:"p-1 rounded text-text-4 hover:text-danger cursor-pointer",children:e.jsx(Ge,{size:12})})]}),ve&&e.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-3 border-t border-border-subtle bg-surface-1",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Name Override"}),e.jsx("input",{type:"text",value:W.name,onChange:ee=>u(ae,{name:KJ(ee.target.value)}),placeholder:W.role,className:"w-full h-7 px-2.5 text-xs bg-surface-3 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",maxLength:64,spellCheck:!1})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Provider"}),e.jsxs(Ur,{value:W.provider||"__default__",onValueChange:ee=>{var ze;const ke=ee==="__default__"?null:ee,ye=C.find(He=>He.id===ke),Ne=((ye==null?void 0:ye.models)||[]).filter(He=>He.type!=="image"&&!He.disabled);u(ae,{provider:ke,model:((ze=Ne[0])==null?void 0:ze.id)||null})},children:[e.jsx(Pr,{placeholder:"Team Default",className:"bg-surface-3 h-7 text-xs"}),e.jsxs(Er,{children:[e.jsx(Da,{value:"__default__",children:"Team Default"}),C.map(ee=>e.jsx(Da,{value:ee.id,children:ee.displayName||ee.name||ee.id},ee.id))]})]})]}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Model"}),e.jsxs(Ur,{value:W.model||"__default__",onValueChange:ee=>u(ae,{model:ee==="__default__"?null:ee}),children:[e.jsx(Pr,{placeholder:"Default",className:"bg-surface-3 h-7 text-xs"}),e.jsxs(Er,{children:[e.jsx(Da,{value:"__default__",children:"Default"}),he.map(ee=>e.jsx(Da,{value:ee.id,children:ee.name||ee.id},ee.id))]})]})]})]}),e.jsx(ri,{label:"Reasoning",value:W.reasoningEffort??n.reasoningEffort,onChange:ee=>u(ae,{reasoningEffort:ee}),min:0,max:100,step:1}),Iz.has(W.provider||n.provider)&&e.jsx(ri,{label:"Temperature",value:W.temperature??n.temperature,onChange:ee=>u(ae,{temperature:ee}),min:0,max:1,step:.01,formatValue:ee=>ee.toFixed(2)})]})]},ae)})})})]})]}),e.jsx("div",{className:"border-t border-border-subtle px-6 py-4",children:e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx("textarea",{value:s,onChange:W=>m(W.target.value),placeholder:"Describe what you want to build... (optional)",rows:3,className:"w-full px-3 py-2 text-sm bg-surface-3 border border-border-subtle rounded-md text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent resize-none"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans italic",children:"Leave empty to spawn agents awaiting instructions"})]}),e.jsxs("div",{className:"w-64 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 space-y-0.5",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Provider"}),e.jsxs(Ur,{value:n.provider||"__default__",onValueChange:W=>R(W==="__default__"?"":W),children:[e.jsx(Pr,{placeholder:"Default",className:"bg-surface-3 h-7 text-xs"}),e.jsxs(Er,{children:[e.jsx(Da,{value:"__default__",children:"Default"}),C.map(W=>e.jsx(Da,{value:W.id,children:W.displayName||W.name||W.id},W.id))]})]})]}),e.jsxs("div",{className:"flex-1 space-y-0.5",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Model"}),e.jsxs(Ur,{value:n.model||"__default__",onValueChange:W=>x({model:W==="__default__"?"":W}),children:[e.jsx(Pr,{placeholder:"Auto",className:"bg-surface-3 h-7 text-xs"}),e.jsxs(Er,{children:[e.jsx(Da,{value:"__default__",children:"Auto"}),_.map(W=>e.jsx(Da,{value:W.id,children:W.name||W.id},W.id))]})]})]})]}),e.jsxs(fe,{variant:"primary",size:"md",onClick:Z,disabled:B||a.length===0,className:"w-full gap-2 mt-1",children:[e.jsx(wt,{size:14}),B?"Launching...":`Plan & Launch (${a.length})`]})]})]})})]}),P&&e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/40",children:e.jsxs("div",{className:"w-full max-w-sm bg-surface-2 border border-border rounded-lg shadow-2xl p-5 space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans",children:"Save as Template"}),e.jsx("input",{type:"text",value:K,onChange:W=>G(W.target.value),placeholder:"Template name...",className:"w-full h-8 px-3 text-sm bg-surface-3 border border-border-subtle rounded-md text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0,onKeyDown:W=>{W.key==="Enter"&&J(),W.key==="Escape"&&F(!1)}}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>F(!1),children:"Cancel"}),e.jsx(fe,{variant:"primary",size:"sm",onClick:J,disabled:!K.trim(),children:"Save"})]})]})})]})}function zRe({onPlanner:t,onSpawn:a,onTeamBuilder:n}){var s;return e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsxs("div",{className:"max-w-2xl w-full text-center space-y-10 px-8",children:[e.jsxs("div",{className:"relative mx-auto w-20 h-20",children:[e.jsx("div",{className:"absolute inset-0 rounded-full bg-accent/8 animate-pulse"}),e.jsx("div",{className:"absolute inset-1 rounded-full bg-surface-3 border border-border-subtle flex items-center justify-center shadow-lg shadow-accent/5",children:e.jsx("img",{src:"/favicon.png",alt:"Groove",className:"h-10 w-10 rounded-full"})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-3xl font-bold text-text-0 font-sans tracking-tight",children:"Welcome to Groove"}),e.jsx("p",{className:"text-base text-text-2 font-sans max-w-md mx-auto leading-relaxed",children:"Your mission control for AI agents. Spawn, orchestrate, and ship faster than ever."})]}),e.jsxs("div",{className:"space-y-3 max-w-xl mx-auto",children:[e.jsxs("button",{onClick:t,className:"w-full flex items-center gap-4 p-5 rounded-lg border border-accent/25 bg-gradient-to-r from-accent/8 to-accent/3 hover:from-accent/14 hover:to-accent/6 hover:border-accent/40 transition-all cursor-pointer group text-left",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg bg-accent/20 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:e.jsx(wt,{size:24,className:"text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-base font-semibold text-text-0 font-sans",children:"Start with a Planner"}),e.jsx("div",{className:"text-sm text-text-2 font-sans mt-0.5",children:"Describe what you want to build and let AI plan the perfect team"})]}),e.jsx("div",{className:"text-accent text-xs font-semibold font-sans flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity",children:"Recommended"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("button",{onClick:n,className:"flex items-center gap-3 p-4 rounded-lg border border-info/25 bg-gradient-to-r from-info/6 to-info/2 hover:from-info/12 hover:to-info/5 hover:border-info/35 transition-all cursor-pointer group text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-info/15 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:e.jsx(bu,{size:20,className:"text-info"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-semibold text-text-0 font-sans",children:"Build a Team"}),e.jsx("div",{className:"text-xs text-text-3 font-sans mt-0.5",children:"Pick roles and configure"})]})]}),e.jsxs("button",{onClick:a,className:"flex items-center gap-3 p-4 rounded-lg border border-border bg-surface-1 hover:bg-surface-2 hover:border-border transition-all cursor-pointer group text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-surface-4 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:e.jsx(ht,{size:20,className:"text-text-1"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-semibold text-text-0 font-sans",children:"Spawn Agent"}),e.jsx("div",{className:"text-xs text-text-3 font-sans mt-0.5",children:"Choose a role and configure"})]})]})]})]}),((s=window.groove)==null?void 0:s.openFolder)&&e.jsxs("div",{className:"max-w-sm mx-auto",children:[e.jsx("p",{className:"text-xs text-text-3 mb-2",children:"Or open a different project"}),e.jsxs("button",{onClick:()=>window.groove.openFolder(),className:"w-full h-10 rounded-lg border border-border-subtle bg-surface-2 hover:bg-surface-3 text-sm text-text-1 font-medium flex items-center justify-center gap-2 cursor-pointer transition-colors",children:[e.jsx(ga,{size:16,className:"text-accent"}),"Open Folder"]})]}),e.jsxs("p",{className:"text-xs text-text-4 font-sans",children:[e.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+K"}),e.jsx("span",{className:"mx-1.5",children:"command palette"}),e.jsx("span",{className:"text-text-4 mx-1",children:"·"}),e.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+N"}),e.jsx("span",{className:"mx-1.5",children:"spawn"}),e.jsx("span",{className:"text-text-4 mx-1",children:"·"}),e.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+J"}),e.jsx("span",{className:"mx-1.5",children:"terminal"})]})]})})}const FRe={backend:aa,frontend:Dr,fullstack:Zt,testing:ti,security:La},RRe=/^[a-zA-Z0-9_-]{1,64}$/;function KJ(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").slice(0,64)}function HRe(){var R;const t=$(U=>U.recommendedTeam),a=$(U=>U.launchRecommendedTeam),n=$(U=>U.teamLaunchConfig),s=$(U=>U.fetchProviders),[o,c]=g.useState(!1),[l,A]=g.useState(null),[u,f]=g.useState(!1),[x,m]=g.useState([]),[y,v]=g.useState((n==null?void 0:n.provider)||""),[O,b]=g.useState((n==null?void 0:n.model)||""),[C,j]=g.useState((n==null?void 0:n.reasoningEffort)??50),[N,M]=g.useState((n==null?void 0:n.temperature)??.5),[Q,L]=g.useState((n==null?void 0:n.mode)||"sandbox");if(g.useEffect(()=>{s().then(U=>{Array.isArray(U)&&m(U.filter(Z=>Z.installed))}).catch(()=>{})},[]),!((R=t==null?void 0:t.agents)!=null&&R.length))return null;const B=t.agents,S=B.filter(U=>!U.phase||U.phase===1),I=B.filter(U=>U.phase===2),z=l??S.map(U=>({...U,name:U.name||""})),P=x.find(U=>U.id===y),F=((P==null?void 0:P.models)||[]).filter(U=>U.type!=="image"&&!U.disabled),K=Iz.has(y);function G(U,Z){const J=z.map((Ae,W)=>W===U?{...Ae,name:KJ(Z)}:Ae);A(J)}function H(U){var Ae;v(U);const Z=x.find(W=>W.id===U),J=((Z==null?void 0:Z.models)||[]).filter(W=>W.type!=="image"&&!W.disabled);b(((Ae=J[0])==null?void 0:Ae.id)||"")}async function q(){c(!0),$.setState({teamLaunchConfig:{...y&&{provider:y,model:O},reasoningEffort:C,...K&&{temperature:N},mode:Q}});try{const U=[...z,...I];await a(U)}catch{}c(!1)}function _(){$.setState({recommendedTeam:null})}return e.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-50 w-full max-w-lg",children:e.jsxs("div",{className:"mx-4 rounded-lg border border-accent/30 bg-surface-2/95 backdrop-blur-md shadow-xl shadow-accent/5 overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border-subtle flex items-center gap-2",children:[e.jsx(es,{size:16,className:"text-accent"}),e.jsx("span",{className:"text-sm font-semibold text-text-0 font-sans flex-1",children:"Planner Recommends a Team"}),e.jsx("button",{onClick:_,className:"text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(Ge,{size:14})})]}),e.jsxs("div",{className:"border-b border-border-subtle",children:[e.jsxs("button",{onClick:()=>f(!u),className:"w-full flex items-center gap-2 px-4 py-2 text-left cursor-pointer hover:bg-surface-3/50 transition-colors",children:[e.jsx(bt,{size:12,className:V("text-text-4 transition-transform duration-200",!u&&"-rotate-90")}),e.jsx(T0,{size:12,className:"text-text-3"}),e.jsx("span",{className:"text-2xs font-semibold text-text-2 font-sans uppercase tracking-wider",children:"Team Settings"}),y&&e.jsxs("span",{className:"ml-auto text-2xs text-accent font-mono",children:[y,O?` / ${O}`:""]})]}),u&&e.jsxs("div",{className:"px-4 pb-3 space-y-3",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Provider"}),e.jsxs(Ur,{value:y,onValueChange:H,children:[e.jsx(Pr,{placeholder:"Default",className:"bg-surface-4 h-7 text-xs"}),e.jsx(Er,{children:x.map(U=>e.jsx(Da,{value:U.id,children:U.displayName||U.name||U.id},U.id))})]})]}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Model"}),e.jsxs(Ur,{value:O,onValueChange:b,children:[e.jsx(Pr,{placeholder:"Auto",className:"bg-surface-4 h-7 text-xs"}),e.jsxs(Er,{children:[e.jsx(Da,{value:"auto",children:"Auto"}),F.map(U=>e.jsx(Da,{value:U.id,children:U.name||U.id},U.id))]})]})]})]}),e.jsx(ri,{label:"Reasoning",value:C,onChange:j,min:0,max:100,step:1}),K&&e.jsx(ri,{label:"Temperature",value:N,onChange:M,min:0,max:1,step:.01,formatValue:U=>U.toFixed(2)}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-2xs text-text-3 font-sans",children:"Build Mode"}),e.jsxs("div",{className:"flex rounded-md bg-surface-4 border border-border-subtle p-0.5",children:[e.jsxs("button",{onClick:()=>L("sandbox"),className:V("flex-1 flex items-center justify-center gap-1.5 rounded px-2 py-1.5 text-xs font-sans transition-all cursor-pointer",Q==="sandbox"?"bg-surface-2 text-text-0 font-semibold shadow-sm":"text-text-3 hover:text-text-1"),children:[e.jsx(on,{size:11}),"Sandbox"]}),e.jsxs("button",{onClick:()=>L("production"),className:V("flex-1 flex items-center justify-center gap-1.5 rounded px-2 py-1.5 text-xs font-sans transition-all cursor-pointer",Q==="production"?"bg-surface-2 text-text-0 font-semibold shadow-sm":"text-text-3 hover:text-text-1"),children:[e.jsx(Kn,{size:11}),"Production"]})]}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:Q==="sandbox"?"Files live in a team directory, removable with the team":"Files live in the project directory, persist forever"})]})]})]}),e.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[z.map((U,Z)=>{var W;const J=FRe[U.role]||Zt,Ae=!U.name||RRe.test(U.name);return e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 rounded-md bg-surface-4 border border-border-subtle",children:[e.jsx(J,{size:12,className:"text-text-2 shrink-0"}),e.jsx("input",{type:"text",value:U.name,onChange:ae=>G(Z,ae.target.value),placeholder:U.role,className:V("flex-1 min-w-0 bg-transparent text-xs font-mono text-text-0 outline-none placeholder:text-text-4",!Ae&&"text-red-400"),maxLength:64,spellCheck:!1}),((W=U.scope)==null?void 0:W.length)>0&&e.jsxs("span",{className:"text-2xs text-text-4 font-mono shrink-0 truncate max-w-[120px]",children:[U.scope[0],U.scope.length>1?` +${U.scope.length-1}`:""]})]},Z)}),t.projectDir&&Q==="sandbox"&&e.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-2 font-mono pt-0.5",children:[e.jsx("span",{className:"text-text-4",children:"Project:"}),e.jsxs("span",{className:"text-accent",children:[t.projectDir,"/"]})]}),I.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-3 font-sans",children:[e.jsx(La,{size:10}),e.jsxs("span",{children:[I.length," QC agent",I.length>1?"s":""," will auto-spawn after builders complete"]})]})]}),e.jsx("div",{className:"px-4 py-3 border-t border-border-subtle",children:e.jsxs(fe,{variant:"primary",size:"md",onClick:q,disabled:o,className:"w-full gap-2",children:[e.jsx(wt,{size:14}),o?"Launching...":`Launch ${S.length} Agent${S.length>1?"s":""}`]})})]})})}function uP(){var z;const t=$(P=>P.agents),a=$(P=>P.activeTeamId),n=$(P=>P.openDetail),s=$(P=>P.spawnAgent),o=$(P=>P.selectAgent);$(P=>P.recommendedTeam);const c=$(P=>P.checkRecommendedTeam),l=$(P=>P.addToast),A=$(P=>P.showPreviewInAgents),u=$(P=>P.previewState),f=$(P=>P.togglePreviewInAgents),x=$(P=>P.teamPreviews),m=$(P=>P.relaunchPreview),y=$(P=>P.openPreview),v=$(P=>P.workspaceMode),O=$(P=>P.setWorkspaceMode),b=$(P=>P.openTeamBuilder),[C,j]=g.useState(!1);g.useEffect(()=>{if(!t.some(K=>K.role==="planner"&&(K.status==="running"||K.status==="starting")))return;const F=setInterval(()=>c(),5e3);return()=>clearInterval(F)},[t,c]);function N(){j(!0)}async function M(P){j(!1);try{const F=await s({role:"planner",provider:P.provider,model:P.model,reasoningEffort:P.reasoningEffort,temperature:P.temperature,verbosity:P.verbosity});F!=null&&F.id&&o(F.id)}catch{}}const Q=t.filter(P=>P.teamId===a),L=$(P=>P.hydrated),[B,S]=g.useState(!0);g.useEffect(()=>{const P=setTimeout(()=>S(!1),1200);return()=>clearTimeout(P)},[]);const I=B||!L;return e.jsxs("div",{className:"flex flex-col h-full relative",children:[e.jsx("div",{className:"flex-1 min-h-0",children:I?e.jsxs("div",{className:V("flex flex-col items-center justify-center h-full transition-opacity duration-500",!B&&L?"opacity-0":"opacity-100"),children:[e.jsxs("div",{className:"relative w-12 h-12 mb-5",children:[e.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-accent/20 animate-ping",style:{animationDuration:"2s"}}),e.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-accent animate-spin",style:{animationDuration:"1s"}}),e.jsx("span",{className:"absolute inset-[6px] rounded-full bg-accent/8 flex items-center justify-center",children:e.jsx(wt,{size:16,className:"text-accent animate-pulse"})})]}),e.jsx("p",{className:"text-sm font-medium text-text-1 font-sans animate-pulse",children:"Connecting to agents"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Syncing with daemon..."})]}):Q.length===0?e.jsx(zRe,{onPlanner:N,onSpawn:()=>n({type:"spawn"}),onTeamBuilder:b}):v?e.jsx(yze,{}):A&&u.url&&u.teamId===a&&((z=x[a])!=null&&z.active)?e.jsx(KW,{embedded:!0}):e.jsx(Dae,{children:e.jsx($Re,{})},a)}),!v&&e.jsx(HRe,{}),!I&&Q.length>0&&!v&&e.jsxs("div",{className:"absolute bottom-3 left-3 z-40 flex items-center gap-1",children:[e.jsx(Nt,{content:"Spawn agent",side:"top",children:e.jsx("button",{onClick:()=>n({type:"spawn"}),className:"flex items-center justify-center w-7 h-7 rounded-md text-text-3 hover:text-accent hover:bg-accent/10 transition-colors cursor-pointer",children:e.jsx(ht,{size:15})})}),e.jsx(Nt,{content:Object.keys(GJ()).length>0?"Update layout":"Save layout",side:"top",children:e.jsx("button",{onClick:()=>{const P=r0(a),F={},K=new Map;[...Q].sort((G,H)=>(G.name||G.id).localeCompare(H.name||H.id)).forEach(G=>{const H=G.name||G.id,q=P[H];if(!q)return;const _=G.role||"agent",R=K.get(_)||0;K.set(_,R+1);const U=R===0?_:`${_}-${R}`;F[U]=q}),P[Ua]&&(F[Ua]=P[Ua]),BRe(F),l("success","Layout saved","Future spawns will use these positions")},className:"flex items-center justify-center w-7 h-7 rounded-md text-text-3 hover:text-accent hover:bg-accent/10 transition-colors cursor-pointer",children:e.jsx(O0,{size:15})})}),e.jsx(Nt,{content:"Workspace",side:"top",children:e.jsx("button",{onClick:()=>O(!0),className:"flex items-center justify-center w-7 h-7 rounded-md text-text-3 hover:text-accent hover:bg-accent/10 transition-colors cursor-pointer",children:e.jsx(Zt,{size:15})})}),(()=>{const P=x[a];if(!P)return null;const F=P.active&&u.url&&u.teamId===a,K=F&&A,G=K?"Show team":F?"Show preview":"Relaunch preview";return e.jsx(Nt,{content:G,side:"top",children:e.jsx("button",{onClick:()=>{F?A?f():y(P.url,a,P.kind):m(a)},className:V("flex items-center justify-center w-7 h-7 rounded-md transition-colors cursor-pointer",F?"text-text-3 hover:text-info hover:bg-info/10":"text-text-4 hover:text-warning hover:bg-warning/10"),children:K?e.jsx(Fa,{size:15}):e.jsx(na,{size:15})})})})()]}),e.jsx(URe,{open:C,onOpenChange:j,onLaunch:M}),e.jsx(ERe,{})]})}function qRe({children:t,detailContent:a,terminalContent:n}){const s=$(B=>B.activeView),o=$(B=>B.detailPanel),c=$(B=>B.connected),l=$(B=>B.tunneled),A=$(B=>B.daemonHost),u=$(B=>B.agents),f=$(B=>B.editorActiveFile),x=$(B=>B.detailPanelWidth),m=$(B=>B.terminalVisible),y=$(B=>B.terminalFullHeight),v=$(B=>B.setActiveView),O=$(B=>B.openDetail),b=$(B=>B.closeDetail),C=$(B=>B.setDetailPanelWidth),j=$(B=>B.setTerminalVisible),N=$(B=>B.toggleCommandPalette),M=g.useMemo(()=>u.filter(B=>B.status==="running").length,[u]),Q=g.useMemo(()=>[{key:"k",meta:!0,handler:()=>$.getState().toggleCommandPalette()},{key:"p",meta:!0,shift:!0,handler:()=>$.getState().toggleCommandPalette()},{key:"j",meta:!0,handler:()=>{const B=$.getState();B.setTerminalVisible(!B.terminalVisible)}},{key:"n",meta:!0,handler:()=>$.getState().openDetail({type:"spawn"})},{key:"1",meta:!0,handler:()=>$.getState().setActiveView("agents")},{key:"2",meta:!0,handler:()=>$.getState().setActiveView("editor")},{key:"3",meta:!0,handler:()=>$.getState().setActiveView("dashboard")},{key:"4",meta:!0,handler:()=>$.getState().setActiveView("marketplace")},{key:"5",meta:!0,handler:()=>$.getState().setActiveView("teams")},{key:"Escape",handler:()=>{const B=$.getState();B.commandPaletteOpen?B.toggleCommandPalette():B.detailPanel&&B.closeDetail()}}],[]);lZ(Q);const L=o&&o.type!=="spawn";return e.jsx(joe,{children:e.jsxs("div",{className:V("w-full h-full flex flex-col bg-surface-2 text-text-1 font-sans",d2()&&"electron-app"),children:[e.jsx(pSe,{activeView:s,connected:c,tunneled:l,daemonHost:A,editorActiveFile:f,onOpenCommandPalette:N}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsx(dSe,{activeView:s,detailPanel:o,onNavigate:v,onTogglePanel:B=>{(o==null?void 0:o.type)===B?b():O({type:B})}}),e.jsxs("div",{className:"flex-1 flex flex-col min-w-0 min-h-0",children:[s==="agents"&&e.jsx(TRe,{}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-w-0 min-h-0",children:[!(m&&y)&&e.jsx("main",{className:"flex-1 min-h-0 overflow-hidden relative",children:t}),n]}),L&&e.jsx(wQe,{width:x,onWidthChange:C,onClose:b,children:a})]})]})]}),e.jsx(bQe,{connected:c,agentCount:u.length,runningCount:M,terminalVisible:m,onToggleTerminal:()=>j(!m)}),e.jsx(CQe,{}),e.jsx(DG,{}),e.jsx(NQe,{}),e.jsx(hG,{})]})})}function DRe({id:t,name:a,subtitle:n,models:s,authType:o,recommended:c,installed:l,installing:A,failed:u,selected:f,onInstall:x,gradientFrom:m,letter:y,statusChecking:v}){return e.jsxs(as.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25},className:V("relative flex flex-col rounded-md border p-6 transition-all duration-200","bg-surface-2 hover:bg-surface-3 hover:shadow-lg hover:shadow-black/20",f?"border-accent ring-1 ring-accent/30 shadow-md shadow-accent/10":"border-border-subtle",A&&"pointer-events-none opacity-70"),children:[f&&e.jsx("div",{className:"absolute top-3 left-3 w-5 h-5 rounded-full bg-accent flex items-center justify-center",children:e.jsx(De,{className:"w-3 h-3 text-surface-0",strokeWidth:3})}),e.jsxs("div",{className:"flex items-start gap-4 mb-5",children:[e.jsx("div",{className:V("w-14 h-14 rounded-md flex items-center justify-center text-lg font-bold font-mono shrink-0",m),children:y}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-sm font-semibold text-text-0",children:a}),c&&e.jsx(be,{variant:"purple",className:"text-2xs",children:"Recommended"})]}),e.jsx("p",{className:"text-xs text-text-2 mt-0.5",children:n})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-4",children:s.map(O=>e.jsx("span",{className:"text-xs text-text-2 bg-surface-4 px-2 py-0.5 rounded font-mono",children:O},O))}),e.jsx("p",{className:"text-2xs text-text-3 mb-4",children:o}),e.jsx("div",{className:"mt-auto pt-4 border-t border-border-subtle",children:A?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{className:"w-4 h-4 text-accent animate-spin"}),e.jsx("span",{className:"text-xs text-accent font-medium",children:"Installing..."})]}),e.jsx("div",{className:"h-1 bg-surface-4 rounded-full overflow-hidden",children:e.jsx(as.div,{className:"h-full bg-accent rounded-full",initial:{width:"0%"},animate:{width:"90%"},transition:{duration:15,ease:"easeOut"}})})]}):l?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Hn,{className:"w-4 h-4 text-success"}),e.jsx("span",{className:"text-xs text-success font-medium",children:"Ready"})]}):u?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xt,{className:"w-4 h-4 text-danger"}),e.jsx("span",{className:"text-xs text-danger font-medium",children:"Failed"})]}),e.jsxs("button",{type:"button",className:"h-8 px-5 rounded-full text-xs font-medium bg-danger/15 text-danger hover:bg-danger/25 transition-colors duration-100 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-danger flex items-center gap-1.5",onClick:O=>{O.stopPropagation(),x==null||x(t)},children:[e.jsx(Cs,{className:"w-3 h-3"}),"Retry"]})]}):v?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{className:"w-3.5 h-3.5 text-text-4 animate-spin"}),e.jsx("span",{className:"text-xs text-text-4",children:"Checking..."})]}):e.jsx("div",{className:"flex items-center justify-end",children:e.jsxs("button",{type:"button",className:"h-8 px-5 rounded-full text-xs font-medium bg-accent text-surface-0 hover:bg-accent/80 transition-colors duration-100 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent flex items-center gap-1.5",onClick:O=>{O.stopPropagation(),x==null||x(t)},children:[e.jsx(_a,{className:"w-3.5 h-3.5"}),"Install"]})})})]})}const gs=[{id:"claude-code",name:"Claude Code",subtitle:"by Anthropic",models:["Opus 4.6","Sonnet 4.6","Haiku 4.5"],authType:"Subscription or API key",authModes:["subscription","apikey"],recommended:!0,letter:"C",gradientFrom:"bg-purple/20 text-purple",keyPlaceholder:"sk-ant-...",keyLabel:"Anthropic API Key"},{id:"codex",name:"Codex",subtitle:"by OpenAI",models:["GPT-5.4 Pro","Standard","Mini","Nano"],authType:"API key or ChatGPT Plus",authModes:["apikey","chatgpt-plus"],recommended:!1,letter:"X",gradientFrom:"bg-success/20 text-success",keyPlaceholder:"sk-...",keyLabel:"OpenAI API Key"},{id:"gemini",name:"Gemini CLI",subtitle:"by Google",models:["Gemini 3.1 Pro","3 Flash"],authType:"API key",authModes:["apikey"],recommended:!1,letter:"G",gradientFrom:"bg-info/20 text-info",keyPlaceholder:"AIza...",keyLabel:"Gemini API Key"}],VRe={enter:t=>({x:t>0?80:-80,opacity:0}),center:{x:0,opacity:1},exit:t=>({x:t<0?80:-80,opacity:0})},XRe={duration:.25,ease:[.4,0,.2,1]};function ZRe({current:t,total:a}){return e.jsx("div",{className:"flex items-center gap-2.5",children:Array.from({length:a},(n,s)=>e.jsx("div",{className:V("h-2 rounded-full transition-all duration-300",s===t?"w-7 bg-accent":s<t?"w-2 bg-accent/50":"w-2 bg-surface-5")},s))})}function GRe({onNext:t,onSkip:a}){return e.jsxs("div",{className:"flex flex-col items-center justify-center text-center gap-6 max-w-lg mx-auto",children:[e.jsx(as.img,{src:"/favicon.png",alt:"Groove",className:"w-20 h-20",initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.4,ease:"easeOut"}}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold text-text-0 font-sans",children:"Welcome to Groove"}),e.jsx("p",{className:"text-sm text-text-2",children:"Your AI coding team, ready in minutes"})]}),e.jsx("p",{className:"text-xs text-text-3 leading-relaxed max-w-sm",children:"Let's set up your AI providers so you can start spawning agents. This only takes a moment."}),e.jsxs("button",{type:"button",onClick:t,className:"mt-4 h-11 px-8 rounded-full bg-accent text-surface-0 font-semibold text-sm hover:bg-accent/80 transition-colors duration-100 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 flex items-center gap-2",autoFocus:!0,children:["Get Started",e.jsx(Fr,{className:"w-4 h-4"})]}),e.jsx("button",{type:"button",onClick:a,className:"text-xs text-text-4 hover:text-text-2 transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent rounded px-2 py-1",children:"Skip setup"})]})}function WRe({selectedDir:t,onSelectDir:a}){const n=$(A=>A.remoteHomedir),[s,o]=g.useState(!1),c=new URLSearchParams(window.location.search).has("instance");async function l(){var u,f;if(c){o(!0);return}const A=await Nne({title:"Choose your project folder",defaultPath:t||void 0});A?a(A):(f=(u=window.groove)==null?void 0:u.folders)!=null&&f.select||o(!0)}return e.jsxs("div",{className:"flex flex-col items-center max-w-lg mx-auto w-full text-center",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-text-0 mb-2",children:"Choose your project folder"}),e.jsx("p",{className:"text-sm text-text-2",children:"Pick the root directory where your code lives. Groove will manage agents from here."})]}),e.jsx("div",{className:"w-full bg-surface-2 border border-border-subtle rounded-lg p-5 mb-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg bg-accent/10 flex items-center justify-center",children:e.jsx(ga,{className:"w-6 h-6 text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsx("p",{className:"text-xs text-text-3 mb-0.5",children:"Working directory"}),e.jsx("p",{className:"text-sm font-mono text-text-0 truncate",children:t||"No folder selected"})]})]})}),e.jsxs("button",{type:"button",onClick:l,className:"h-10 px-6 rounded-lg bg-accent text-surface-0 font-medium text-sm hover:bg-accent/80 transition-colors cursor-pointer flex items-center gap-2",children:[e.jsx(ga,{className:"w-4 h-4"}),t?"Change Folder":"Select Folder"]}),e.jsx("p",{className:"mt-4 text-2xs text-text-4",children:"You can change this anytime in Settings."}),s&&e.jsx(Hu,{open:s,onOpenChange:o,currentPath:t||n||"/",homePath:n,onSelect:A=>{a(A),o(!1)}})]})}function KRe({providerStatus:t,selected:a,onInstall:n,installing:s,statusChecking:o}){const c=gs.filter(A=>{var u;return(u=t[A.id])==null?void 0:u.installed}).length,l=c===gs.length;return e.jsxs("div",{className:"flex flex-col items-center max-w-4xl mx-auto w-full",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h2",{className:"text-2xl font-bold text-text-0 mb-2",children:"Choose your AI providers"}),e.jsx("p",{className:"text-sm text-text-2",children:"Install the coding tools you want to use. You can always add more later."})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-5 w-full mb-8",children:gs.map(A=>{var u,f;return e.jsx(DRe,{...A,installed:(u=t[A.id])==null?void 0:u.installed,installing:s[A.id],failed:(f=t[A.id])==null?void 0:f.failed,selected:a.includes(A.id),onInstall:n,statusChecking:o},A.id)})}),e.jsx("p",{className:V("text-xs text-center",l?"text-success":c>0?"text-text-2":"text-text-4"),children:l?"All providers installed — you're ready to go!":c>0?`${c} of ${gs.length} providers installed`:"Click Install to set up a provider"})]})}function YRe({provider:t,providerStatus:a,onSaveKey:n}){const[s,o]=g.useState(t.authModes.includes("subscription")?"subscription":"apikey"),[c,l]=g.useState(""),[A,u]=g.useState(!1),[f,x]=g.useState(!1),[m,y]=g.useState((a==null?void 0:a.authenticated)||!1),v=async()=>{if(c.trim()){x(!0);try{await n(t.id,c.trim()),y(!0)}catch{}finally{x(!1)}}},O=(a==null?void 0:a.maskedKey)||(m&&c?`${c.slice(0,6)}${"•".repeat(20)}`:null);return e.jsxs(as.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2},className:"bg-surface-2 border border-border-subtle rounded-md p-5",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:V("w-10 h-10 rounded-md flex items-center justify-center text-sm font-bold font-mono",t.gradientFrom),children:t.letter}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-text-0",children:t.name}),e.jsx("p",{className:"text-2xs text-text-3",children:t.subtitle})]}),(m||(a==null?void 0:a.authenticated))&&e.jsx(be,{variant:"success",className:"ml-auto",children:"Connected"})]}),t.authModes.length>1&&e.jsx("div",{className:"flex gap-1 mb-4 bg-surface-3 p-0.5 rounded-md",children:t.authModes.map(b=>e.jsx("button",{type:"button",onClick:()=>o(b),className:V("flex-1 h-7 rounded text-xs font-medium transition-colors duration-100 cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",s===b?"bg-surface-5 text-text-0":"text-text-3 hover:text-text-1"),children:b==="subscription"?"Subscription":b==="chatgpt-plus"?"ChatGPT Plus":"API Key"},b))}),s==="subscription"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-text-2",children:"Sign in via the terminal with your Claude subscription."}),e.jsx("div",{className:"space-y-1.5",children:e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Open a terminal and run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"claude"})," — then follow the prompts to sign in."]})}),(a==null?void 0:a.authenticated)&&e.jsxs("p",{className:"text-xs text-success flex items-center gap-1.5",children:[e.jsx(De,{className:"w-3.5 h-3.5"})," Connected"]})]}),s==="chatgpt-plus"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-xs text-text-2",children:["Run ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"codex login"})," in your terminal to authenticate with ChatGPT Plus."]}),(a==null?void 0:a.authenticated)&&e.jsxs("p",{className:"text-xs text-success flex items-center gap-1.5",children:[e.jsx(De,{className:"w-3.5 h-3.5"})," Connected"]})]}),s==="apikey"&&e.jsx("div",{className:"space-y-3",children:m||a!=null&&a.authenticated?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-8 rounded-md bg-surface-1 border border-border px-3 flex items-center",children:e.jsx("span",{className:"text-xs text-text-3 font-mono truncate",children:O||"••••••••••••••"})}),e.jsx("button",{type:"button",onClick:()=>{y(!1),l("")},className:"h-8 px-3 rounded-md text-xs text-text-3 hover:text-text-1 bg-surface-4 hover:bg-surface-5 transition-colors duration-100 cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",children:"Change"})]}):e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx("input",{type:A?"text":"password",value:c,onChange:b=>l(b.target.value),placeholder:t.keyPlaceholder,className:"h-8 w-full rounded-md px-3 pr-8 text-sm bg-surface-1 border border-border text-text-0 placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent transition-colors duration-100 font-mono",onKeyDown:b=>b.key==="Enter"&&v(),"aria-label":t.keyLabel}),e.jsx("button",{type:"button",onClick:()=>u(!A),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer","aria-label":A?"Hide key":"Show key",children:A?e.jsx(jn,{className:"w-3.5 h-3.5"}):e.jsx(na,{className:"w-3.5 h-3.5"})})]}),e.jsx("button",{type:"button",onClick:v,disabled:!c.trim()||f,className:"h-8 px-4 rounded-md bg-accent text-surface-0 text-xs font-medium hover:bg-accent/80 transition-colors duration-100 cursor-pointer disabled:opacity-40 disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",children:f?"Saving...":"Save"})]})})]})}function JRe({providerStatus:t,installedIds:a,onSaveKey:n}){const s=gs.filter(o=>{var c;return a.includes(o.id)||((c=t[o.id])==null?void 0:c.installed)});return s.some(o=>{var c;return(c=t[o.id])==null?void 0:c.authenticated}),e.jsxs("div",{className:"flex flex-col items-center max-w-2xl mx-auto w-full",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-text-0 mb-2",children:"Connect your accounts"}),e.jsx("p",{className:"text-sm text-text-2",children:"Add credentials for your installed providers."})]}),e.jsx("div",{className:"flex flex-col gap-4 w-full mb-6",children:s.map(o=>e.jsx(YRe,{provider:o,providerStatus:t[o.id]||{},onSaveKey:n},o.id))}),s.length===0&&e.jsx("p",{className:"text-sm text-text-3 text-center",children:"No providers installed yet. Go back to install one."})]})}function eHe({providerStatus:t,installedIds:a,defaultProvider:n,defaultModel:s,onSetDefault:o}){var l;const c=gs.filter(A=>{var u,f;return(a.includes(A.id)||((u=t[A.id])==null?void 0:u.installed))&&((f=t[A.id])==null?void 0:f.authenticated)});return e.jsxs("div",{className:"flex flex-col items-center max-w-2xl mx-auto w-full",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-text-0 mb-2",children:"Set your default"}),e.jsx("p",{className:"text-sm text-text-2",children:"Choose which provider and model to use by default. You can switch per-agent anytime."})]}),e.jsxs("div",{className:"flex flex-col gap-3 w-full max-w-md mb-6",children:[c.map(A=>e.jsxs("button",{type:"button",onClick:()=>o(A.id,A.models[0]),className:V("flex items-center gap-4 p-4 rounded-md border transition-all duration-200 text-left cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",n===A.id?"bg-accent/8 border-accent ring-1 ring-accent/30":"bg-surface-2 border-border-subtle hover:bg-surface-3"),children:[e.jsx("div",{className:V("w-10 h-10 rounded-md flex items-center justify-center text-sm font-bold font-mono shrink-0",A.gradientFrom),children:A.letter}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-text-0",children:A.name}),e.jsx("p",{className:"text-2xs text-text-3",children:A.subtitle})]}),e.jsx("div",{className:V("w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors",n===A.id?"border-accent bg-accent":"border-border"),children:n===A.id&&e.jsx("div",{className:"w-2 h-2 rounded-full bg-surface-0"})})]},A.id)),c.length===0&&e.jsx("p",{className:"text-sm text-text-3 text-center",children:"No authenticated providers. Go back to connect one."})]}),n&&e.jsxs("div",{className:"w-full max-w-md",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 mb-2 block",children:"Model"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:(l=gs.find(A=>A.id===n))==null?void 0:l.models.map(A=>e.jsx("button",{type:"button",onClick:()=>o(n,A),className:V("h-7 px-3 rounded-full text-xs font-medium transition-colors duration-100 cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",s===A?"bg-accent text-surface-0":"bg-surface-4 text-text-2 hover:bg-surface-5 hover:text-text-0"),children:A},A))})]})]})}function tHe({providerStatus:t,defaultProvider:a,defaultModel:n,onFinish:s}){var l;const o=gs.filter(A=>{var u;return(u=t[A.id])==null?void 0:u.installed}).length,c=(l=gs.find(A=>A.id===a))==null?void 0:l.name;return e.jsxs("div",{className:"flex flex-col items-center justify-center text-center gap-6 max-w-lg mx-auto",children:[e.jsx(as.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:300,damping:20},className:"w-20 h-20 rounded-full bg-success/15 flex items-center justify-center",children:e.jsx(De,{className:"w-10 h-10 text-success",strokeWidth:2.5})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold text-text-0 font-sans",children:"You're all set!"}),e.jsxs("p",{className:"text-sm text-text-2",children:[o," provider",o!==1?"s":""," installed",c?`, default: ${c}`:"",n?` (${n})`:""]})]}),e.jsx(as.div,{className:"flex gap-3 mt-4",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.3},children:e.jsxs("button",{type:"button",onClick:s,className:"h-11 px-8 rounded-full bg-accent text-surface-0 font-semibold text-sm hover:bg-accent/80 transition-colors duration-100 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 flex items-center gap-2",autoFocus:!0,children:[e.jsx(It,{className:"w-4 h-4"}),"Start Building"]})})]})}const Xh=6;function aHe(){const t=$(U=>U.dismissOnboarding),a=$(U=>U.installProvider),n=$(U=>U.setDefaultProvider),s=$(U=>U.addToast),[o,c]=g.useState(0),[l,A]=g.useState(1),[u,f]=g.useState(["claude-code"]),[x,m]=g.useState({}),[y,v]=g.useState({}),[O,b]=g.useState(null),[C,j]=g.useState(null),[N,M]=g.useState(!0),[Q,L]=g.useState(null),B=g.useRef(null);g.useEffect(()=>{let U=!1;async function Z(){var Ae;try{const W=await fetch("/api/onboarding/status").then(ae=>ae.ok?ae.json():null);if(W!=null&&W.providers){const ae={},Oe=[];for(const ve of W.providers){const ce=ve.authStatus==="authenticated"||ve.authStatus==="key-set";ae[ve.id]={installed:ve.installed,authenticated:ce},ve.installed&&Oe.push(ve.id)}return{status:ae,installedIds:Oe,workingDir:((Ae=W.config)==null?void 0:Ae.defaultWorkingDir)||null}}}catch{}try{const W=await fetch("/api/providers").then(ae=>ae.ok?ae.json():null);if(W){const ae={},Oe=[],ve=Array.isArray(W)?W:W.providers||[];for(const ce of ve){const he=ce.installed||ce.authStatus==="authenticated"||ce.authStatus==="key-set"||!1;ae[ce.id]={installed:he,authenticated:ce.authenticated||!1},he&&Oe.push(ce.id)}return{status:ae,installedIds:Oe}}}catch{}return null}async function J(){M(!0);let Ae=await Z();if(!U&&Ae&&Ae.installedIds.length===0)for(let W=0;W<2;W++){if(await new Promise(ae=>setTimeout(ae,2e3)),U)return;if(Ae=await Z(),Ae&&Ae.installedIds.length>0)break}!U&&Ae&&(v(Ae.status),Ae.installedIds.length>0&&f(W=>[...new Set([...W,...Ae.installedIds])]),Ae.workingDir&&!Q&&L(Ae.workingDir)),U||M(!1)}return J(),()=>{U=!0}},[o]);const S=g.useCallback(()=>{o<Xh-1&&(A(1),c(U=>U+1))},[o]),I=g.useCallback(()=>{o>0&&(A(-1),c(U=>U-1))},[o]),z=g.useCallback(()=>{t()},[t]),P=g.useCallback(async()=>{if(Q)try{await L(Q)}catch{s("error","Failed to set project directory")}t()},[t,Q,s]),F=g.useCallback(async U=>{m(Z=>({...Z,[U]:!0}));try{await a(U),v(Z=>({...Z,[U]:{...Z[U],installed:!0}})),f(Z=>Z.includes(U)?Z:[...Z,U])}catch{v(Z=>({...Z,[U]:{...Z[U],failed:!0}}))}finally{m(Z=>({...Z,[U]:!1}))}},[a]),K=g.useCallback(async(U,Z)=>{try{if(!(await fetch(`/api/credentials/${encodeURIComponent(U)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:Z})})).ok)throw new Error("Failed to save key");v(Ae=>({...Ae,[U]:{...Ae[U],authenticated:!0,maskedKey:`${Z.slice(0,6)}${"•".repeat(20)}`}})),s("success","API key saved")}catch(J){throw s("error","Failed to save key",J.message),J}},[s]),G=g.useCallback(async(U,Z)=>{b(U),j(Z);try{await n(U,Z)}catch{}},[n]),H=gs.some(U=>{var Z;return(Z=y[U.id])==null?void 0:Z.installed}),q=gs.some(U=>{var Z;return(Z=y[U.id])==null?void 0:Z.authenticated}),_=o===0||o===1?!0:o===2?H:o===3?q:o===4?!!O:!1;g.useEffect(()=>{const U=Z=>{Z.key==="Enter"&&o<Xh-1&&_&&S(),Z.key==="Escape"&&z()};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[o,_,S,z]);const R=[e.jsx(GRe,{onNext:S,onSkip:z},"welcome"),e.jsx(WRe,{selectedDir:Q,onSelectDir:L},"folder"),e.jsx(KRe,{providerStatus:y,selected:u,onInstall:F,installing:x,statusChecking:N},"install"),e.jsx(JRe,{providerStatus:y,installedIds:u,onSaveKey:K},"auth"),e.jsx(eHe,{providerStatus:y,installedIds:u,defaultProvider:O,defaultModel:C,onSetDefault:G},"default"),e.jsx(tHe,{providerStatus:y,defaultProvider:O,defaultModel:C,onFinish:P},"done")];return e.jsxs("div",{ref:B,className:"fixed inset-0 z-50 bg-gradient-to-b from-surface-0 to-surface-1 flex flex-col font-sans overflow-hidden",children:[d2()&&e.jsx("div",{className:"h-8 w-full electron-drag shrink-0"}),e.jsxs("div",{className:"flex items-center justify-between px-8 py-4 shrink-0",children:[e.jsx(ZRe,{current:o,total:Xh}),o>0&&o<Xh-1&&e.jsx("button",{type:"button",onClick:z,className:"text-xs text-text-4 hover:text-text-2 transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent rounded px-2 py-1",children:"Skip setup"})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center px-8 py-4 overflow-y-auto",children:e.jsx(Pu,{mode:"wait",custom:l,children:e.jsx(as.div,{custom:l,variants:VRe,initial:"enter",animate:"center",exit:"exit",transition:XRe,className:"w-full",children:R[o]},o)})}),o>0&&o<Xh-1&&e.jsxs("div",{className:"flex items-center justify-between px-8 py-8 shrink-0",children:[e.jsxs("button",{type:"button",onClick:I,className:"h-10 px-6 rounded-md text-sm text-text-2 hover:text-text-0 bg-surface-3 hover:bg-surface-4 transition-colors duration-100 cursor-pointer flex items-center gap-1.5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",children:[e.jsx(bs,{className:"w-4 h-4"}),"Back"]}),e.jsxs("button",{type:"button",onClick:S,disabled:!_,className:"h-10 px-8 rounded-md text-sm font-medium bg-accent text-surface-0 hover:bg-accent/80 transition-colors duration-100 cursor-pointer disabled:opacity-40 disabled:pointer-events-none flex items-center gap-1.5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",children:[o===4?"Finish Setup":"Continue",e.jsx(Rt,{className:"w-4 h-4"})]})]})]})}const nHe=[{icon:aa,label:"Federation",desc:"Multi-machine daemon pairing"},{icon:NA,label:"Cloud Teams",desc:"Coming soon"}];function SX(){var b;const t=$(C=>C.upgradeModalOpen),a=$(C=>C.setUpgradeModalOpen),n=$(C=>C.marketplaceAuthenticated),s=$(C=>C.marketplaceLogin),o=$(C=>C.startCheckout),c=$(C=>C.addToast),[l,A]=g.useState(null),[u,f]=g.useState("monthly"),[x,m]=g.useState(!1);g.useEffect(()=>{t&&!l&&$.getState().fetchSubscriptionPlans().then(C=>A(C)).catch(()=>{})},[t,l]);const y=(b=l==null?void 0:l.pro)==null?void 0:b[u],v=u==="annual"?`$${Math.round(((y==null?void 0:y.price)||96)/12)}/mo`:`$${(y==null?void 0:y.price)||10}/mo`;async function O(){var C;if(!n){s();return}if(!(y!=null&&y.priceId)){bP("https://groovedev.ai/pro"),a(!1);return}m(!0);try{await o(y.priceId),a(!1)}catch(j){j.status===401||(C=j.message)!=null&&C.includes("Not authenticated")?(c("info","Please sign in first"),s()):j.status===409&&(c("info","You already have a subscription"),a(!1))}finally{m(!1)}}return e.jsx(Ut,{open:t,onOpenChange:a,children:e.jsx(Pt,{title:"Upgrade to Pro",className:"max-w-[440px]",children:e.jsxs("div",{className:"px-6 py-5",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("div",{className:"mx-auto mb-3 w-12 h-12 rounded-full bg-accent/10 flex items-center justify-center",children:e.jsx(It,{size:22,className:"text-accent"})}),e.jsx("h2",{className:"text-lg font-bold text-text-0",children:"Upgrade to Groove Pro"}),e.jsx("p",{className:"text-sm text-text-2 mt-1",children:"Unlock powerful features for your AI workflow"})]}),e.jsx("div",{className:"space-y-3 mb-6",children:nHe.map(C=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-surface-4 flex items-center justify-center flex-shrink-0",children:e.jsx(C.icon,{size:15,className:"text-accent"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text-0",children:C.label}),e.jsx("p",{className:"text-2xs text-text-3",children:C.desc})]}),e.jsx(De,{size:14,className:"text-success ml-auto flex-shrink-0"})]},C.label))}),e.jsxs("div",{className:"flex gap-1 mb-5 bg-surface-3 p-0.5 rounded-md",children:[e.jsx("button",{type:"button",onClick:()=>f("monthly"),className:V("flex-1 h-8 rounded text-xs font-medium transition-colors cursor-pointer",u==="monthly"?"bg-surface-5 text-text-0":"text-text-3 hover:text-text-1"),children:"Monthly"}),e.jsxs("button",{type:"button",onClick:()=>f("annual"),className:V("flex-1 h-8 rounded text-xs font-medium transition-colors cursor-pointer",u==="annual"?"bg-surface-5 text-text-0":"text-text-3 hover:text-text-1"),children:["Annual",e.jsx("span",{className:"ml-1 text-success text-2xs",children:"Save 20%"})]})]}),e.jsxs("div",{className:"text-center mb-5",children:[e.jsx("span",{className:"text-3xl font-bold text-text-0",children:v}),u==="annual"&&e.jsxs("p",{className:"text-2xs text-text-3 mt-1",children:["Billed $",(y==null?void 0:y.price)||96,"/year"]})]}),e.jsx("button",{type:"button",onClick:O,disabled:x,className:"w-full h-10 rounded-lg bg-accent text-white font-semibold text-sm hover:bg-accent/90 transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center gap-2",children:x?"Processing...":n?e.jsxs(e.Fragment,{children:[e.jsx(It,{size:15})," Subscribe — ",v]}):e.jsxs(e.Fragment,{children:[e.jsx(pu,{size:15})," Sign in to subscribe"]})}),e.jsx("button",{type:"button",onClick:()=>a(!1),className:"w-full mt-2 text-xs text-text-4 hover:text-text-2 transition-colors cursor-pointer py-1",children:"Maybe later"})]})})})}function sHe(){const t=$(c=>c.dataSharingModalOpen),a=$(c=>c.setTrainingOptIn),n=$(c=>c.dismissDataSharingModal),[s,o]=g.useState(!1);return e.jsx(Ut,{open:t,children:e.jsxs(Pt,{className:"max-w-md",description:"Help improve Groove by sharing usage data",onInteractOutside:c=>c.preventDefault(),onEscapeKeyDown:c=>c.preventDefault(),children:[e.jsxs("div",{className:"relative bg-gradient-to-br from-accent/5 to-transparent px-6 pt-8 pb-6 text-center",children:[e.jsx("div",{className:"flex justify-center mb-3",children:e.jsx("div",{className:"w-14 h-14 rounded-xl bg-accent/10 flex items-center justify-center",children:e.jsx(It,{size:32,className:"text-accent"})})}),e.jsx(kT,{className:"text-xl font-bold text-text-0 font-sans",children:"Help Build a Better Groove"}),e.jsx("p",{className:"text-sm text-text-2 font-sans mt-2 max-w-md mx-auto",children:"We collect errors and usage reports to improve the quality of Groove for everyone."})]}),e.jsx("div",{className:"px-6 pt-4",children:e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-2/30 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[e.jsx(La,{size:14,className:"text-text-2"}),e.jsx("span",{className:"text-xs font-semibold uppercase text-text-3 tracking-wider font-sans",children:"What We Never Collect"})]}),e.jsx("div",{className:"space-y-1.5",children:["Your source code or file contents","API keys, passwords, or credentials","Personal information — emails, names, file paths","Anything that could identify you, your IP or projects"].map(c=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{size:12,className:"text-danger flex-shrink-0"}),e.jsx("span",{className:"text-xs text-text-1 font-sans",children:c})]},c))}),e.jsx("p",{className:"text-xs text-text-0 font-sans font-medium mt-3",children:"PII is automatically scrubbed before any data leaves your machine."})]})}),e.jsxs("div",{className:"border-t border-border-subtle mt-5 pt-4 pb-1 px-6",children:[e.jsxs("button",{type:"button",onClick:()=>a(!0),className:"w-full h-10 rounded-lg bg-accent text-white font-semibold text-sm hover:bg-accent/90 transition-colors cursor-pointer flex items-center justify-center gap-2",children:[e.jsx(It,{size:15}),"Turn On Sharing"]}),e.jsx("div",{className:"text-center mt-2.5",children:e.jsx("button",{type:"button",onClick:()=>n(s),className:"text-xs text-text-3 hover:text-text-1 transition-colors font-sans cursor-pointer",children:"Maybe Later"})}),e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-3",children:[e.jsx("input",{type:"checkbox",id:"data-sharing-dismiss",checked:s,onChange:c=>o(c.target.checked),className:"w-3.5 h-3.5 rounded border-border accent-accent cursor-pointer"}),e.jsx("label",{htmlFor:"data-sharing-dismiss",className:"text-2xs text-text-3 font-sans cursor-pointer select-none",children:"Don't show this again"})]}),e.jsx("p",{className:"text-center text-2xs text-text-4 font-sans mt-2 mb-1",children:"You can always enable this later in Settings"})]})]})})}function qe(t,a){const n=parseInt(t.slice(1,3),16),s=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16);return`rgba(${n},${s},${o},${a})`}const te={surface0:"#1a1e25",surface3:"#282c34",surface4:"#2c313a",surface5:"#333842",text0:"#e6e6e6",text1:"#bcc2cd",text2:"#8b929e",text3:"#6e7681",text4:"#505862",accent:"#33afbc",success:"#4ae168",warning:"#e5c07b",danger:"#e06c75",info:"#61afef",purple:"#c678dd",orange:"#d19a66"};function rHe(){const t=$(Q=>Q.recentProjects),a=$(Q=>Q.setProjectDir),n=$(Q=>Q.removeRecentProject),s=$(Q=>Q.remoteHomedir),o=$(Q=>Q.savedTunnels),c=$(Q=>Q.fetchTunnels),l=$(Q=>Q.deleteTunnel),A=$(Q=>Q.connectTunnel),u=$(Q=>Q.disconnectTunnel),f=$(Q=>Q.toggleQuickConnect),x=$(Q=>Q.addToast),[m,y]=g.useState(!1),[v,O]=g.useState(null);g.useEffect(()=>{c()},[c]);const b=(t||[]).slice(0,8),C=b.length>0,j=o.length>0,N=C||j;async function M(Q){var L,B;if(Q.active){(B=(L=window.groove)==null?void 0:L.remote)!=null&&B.openWindow?window.groove.remote.openWindow(Q.localPort,Q.name):window.open(`http://localhost:${Q.localPort}?instance=${encodeURIComponent(Q.name)}`,"_blank");return}O(Q.id);try{await A(Q.id)}catch(S){x("error","Connection failed",(S==null?void 0:S.message)||"Unknown error")}O(null)}return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:`radial-gradient(ellipse at 50% 40%, ${qe(te.accent,.06)} 0%, transparent 70%) ${te.surface0}`},children:[e.jsxs("div",{className:V("w-full max-w-4xl px-8 flex gap-12",N?"items-start":"items-center justify-center","max-md:flex-col max-md:items-center max-md:gap-8 max-md:overflow-y-auto max-md:max-h-[100vh] max-md:py-12"),children:[e.jsxs("div",{className:V("flex flex-col",N?"w-[55%] max-md:w-full":"w-full max-w-lg",N?"pt-[10vh]":"items-center text-center"),children:[e.jsxs("div",{className:V("flex items-center gap-4 mb-6",!N&&"flex-col"),children:[e.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center flex-shrink-0",style:{background:qe(te.accent,.08),border:`1px solid ${qe(te.accent,.15)}`,boxShadow:`0 0 40px ${qe(te.accent,.1)}`},children:e.jsx("img",{src:"/favicon.png",className:"w-9 h-9 rounded-full",alt:"Groove"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-text-0 font-sans tracking-tight",children:"Welcome to Groove"}),e.jsx("p",{className:"text-sm text-text-2 font-sans mt-0.5",children:"Your AI coding team, ready in minutes"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 mt-4 w-full",children:[e.jsxs("button",{onClick:()=>y(!0),className:"w-full flex items-center gap-4 p-5 rounded-lg border border-accent/25 bg-gradient-to-r from-accent/8 to-accent/3 hover:from-accent/14 hover:to-accent/6 hover:border-accent/40 transition-all cursor-pointer group text-left",children:[e.jsx("div",{className:"w-11 h-11 rounded-lg bg-accent/20 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:e.jsx(ga,{size:22,className:"text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-base font-semibold text-text-0 font-sans",children:"Open Project"}),e.jsx("div",{className:"text-sm text-text-2 font-sans mt-0.5",children:"Browse the filesystem to pick a project"})]})]}),e.jsxs("button",{onClick:f,className:"w-full flex items-center gap-4 p-5 rounded-lg border border-border bg-surface-1 hover:bg-surface-2 hover:border-border transition-all cursor-pointer group text-left",children:[e.jsx("div",{className:"w-11 h-11 rounded-lg bg-surface-4 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:e.jsx(Jn,{size:22,className:"text-text-1"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-base font-semibold text-text-0 font-sans",children:"Connect to Remote"}),e.jsx("div",{className:"text-sm text-text-2 font-sans mt-0.5",children:"SSH tunnel to a server"})]})]})]}),e.jsxs("p",{className:"text-xs text-text-4 font-sans mt-8",children:[e.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+K"}),e.jsx("span",{className:"mx-1.5",children:"command palette"}),e.jsx("span",{className:"text-text-4 mx-1",children:"·"}),e.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+N"}),e.jsx("span",{className:"mx-1.5",children:"spawn"}),e.jsx("span",{className:"text-text-4 mx-1",children:"·"}),e.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+J"}),e.jsx("span",{className:"mx-1.5",children:"terminal"})]})]}),N&&e.jsxs("div",{className:"w-[45%] max-md:w-full pt-[10vh] max-md:pt-0 min-w-0 max-h-[80vh] overflow-y-auto",children:[C&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest mb-2",children:"Recent"}),e.jsx("div",{className:"flex flex-col",children:b.map(Q=>e.jsxs("div",{className:"group flex items-center gap-2 px-2 py-1.5 rounded-sm hover:bg-surface-1 transition-colors",children:[e.jsxs("button",{onClick:()=>a(Q.path),className:"flex-1 min-w-0 text-left cursor-pointer",children:[e.jsx("div",{className:"text-sm font-medium text-text-1 hover:text-accent truncate transition-colors",children:Q.name}),e.jsx("div",{className:"text-2xs font-mono text-text-4 truncate",children:Q.path})]}),e.jsx("button",{onClick:L=>{L.stopPropagation(),n(Q.path)},className:"opacity-0 group-hover:opacity-100 p-0.5 text-text-4 hover:text-danger cursor-pointer transition-all flex-shrink-0",title:"Remove from recent",children:e.jsx(Ge,{size:14})})]},Q.path))})]}),C&&j&&e.jsx("div",{className:"border-t border-border-subtle my-4"}),j&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest mb-2",children:"SSH Connections"}),e.jsx("div",{className:"flex flex-col",children:o.map(Q=>e.jsxs("div",{className:V("group flex items-center gap-2 px-2 py-1.5 rounded-sm hover:bg-surface-1 transition-colors",v===Q.id&&"opacity-60 pointer-events-none"),children:[e.jsxs("button",{onClick:()=>M(Q),disabled:v===Q.id,className:"flex-1 min-w-0 text-left cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-text-1 hover:text-accent truncate transition-colors",children:Q.name}),Q.active&&e.jsx(ia,{status:"running",size:"sm"})]}),e.jsxs("div",{className:"text-2xs font-mono text-text-4 truncate",children:[Q.user,"@",Q.host]})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[v===Q.id?e.jsx($e,{size:14,className:"text-text-3 animate-spin"}):Q.active?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>M(Q),className:"opacity-0 group-hover:opacity-100 flex items-center gap-0.5 text-2xs text-success hover:text-success/80 cursor-pointer transition-all",children:[e.jsx(ma,{size:11})," Open"]}),e.jsx("button",{onClick:async()=>{await u(Q.id),x("info","Disconnected",Q.name)},className:"opacity-0 group-hover:opacity-100 p-0.5 text-text-4 hover:text-danger cursor-pointer transition-all",title:"Disconnect",children:e.jsx(ai,{size:12})})]}):null,e.jsx("button",{onClick:L=>{L.stopPropagation(),l(Q.id)},className:"opacity-0 group-hover:opacity-100 p-0.5 text-text-4 hover:text-danger cursor-pointer transition-all flex-shrink-0",title:"Remove connection",children:e.jsx(Ge,{size:14})})]})]},Q.id))}),e.jsxs("button",{onClick:f,className:"flex items-center gap-1 text-xs text-accent hover:underline font-sans cursor-pointer mt-2 px-2",children:[e.jsx(ht,{size:12})," Add Connection"]})]}),!C&&!j&&e.jsx("p",{className:"text-sm text-text-4 italic px-2",children:"No recent activity"})]})]}),e.jsx(Hu,{open:m,onOpenChange:y,currentPath:s||"/home",homePath:s,onSelect:Q=>{y(!1),a(Q)}}),e.jsx(DG,{}),e.jsx(hG,{})]})}const oHe={js:"text-text-2",jsx:"text-text-2",ts:"text-text-2",tsx:"text-text-2",css:"text-text-3",html:"text-text-3",json:"text-text-3",md:"text-text-3",py:"text-text-2",rs:"text-text-3",go:"text-text-2",sh:"text-text-3",yaml:"text-text-3",yml:"text-text-3",sql:"text-text-3",xml:"text-text-3",svg:"text-text-3"};function iHe(t){var n;const a=(n=t.split(".").pop())==null?void 0:n.toLowerCase();return oHe[a]||"text-text-3"}function cHe({x:t,y:a,items:n,onClose:s}){const o=g.useRef(null);return g.useEffect(()=>{function c(l){o.current&&!o.current.contains(l.target)&&s()}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[s]),e.jsx("div",{ref:o,className:"fixed z-50 min-w-[160px] py-1 bg-surface-2 border border-border rounded-lg shadow-xl",style:{left:t,top:a},children:n.map((c,l)=>c.separator?e.jsx("div",{className:"h-px bg-border-subtle my-1"},l):e.jsxs("button",{onClick:()=>{c.action(),s()},className:V("w-full flex items-center gap-2.5 px-3 py-1.5 text-xs font-sans text-left cursor-pointer transition-colors",c.danger?"text-danger hover:bg-danger/10":"text-text-1 hover:bg-surface-5"),children:[c.icon&&e.jsx(c.icon,{size:12,className:c.danger?"text-danger":"text-text-3"}),c.label]},l))})}function rT({defaultValue:t="",placeholder:a,onSubmit:n,onCancel:s,depth:o=0}){const[c,l]=g.useState(t),A=g.useRef(null);g.useEffect(()=>{var f,x;(f=A.current)==null||f.focus(),t&&((x=A.current)==null||x.select())},[t]);function u(f){if(f.key==="Enter"){const x=c.trim();x&&n(x)}f.key==="Escape"&&s()}return e.jsx("div",{className:"flex items-center py-0.5",style:{paddingLeft:o*16+8},children:e.jsx("input",{ref:A,value:c,onChange:f=>l(f.target.value),onKeyDown:u,onBlur:s,placeholder:a,className:"w-full h-5 px-1.5 text-xs bg-surface-0 border border-accent rounded text-text-0 font-sans focus:outline-none"})})}function YJ({entry:t,depth:a=0,activePath:n,onFileClick:s,onDirToggle:o,expanded:c,onContextMenu:l,dragState:A,onDragStartEntry:u,onDragEndEntry:f,onSetDragOver:x,onDropOnDir:m}){const y=t.type==="dir",v=n===t.path,O=c.has(t.path),b=a*16+8,C=(A==null?void 0:A.draggingPath)===t.path,j=y&&(A==null?void 0:A.dragOverPath)===t.path;function N(M){M.preventDefault(),M.stopPropagation(),l(M,t)}return e.jsxs("button",{draggable:!0,onDragStart:M=>{M.dataTransfer.setData("application/json",JSON.stringify({path:t.path,name:t.name,type:t.type})),M.dataTransfer.effectAllowed="move",u(t.path)},onDragEnd:f,onDragOver:y?M=>{M.preventDefault(),M.stopPropagation(),x(t.path)}:void 0,onDrop:y?M=>m(t.path,M):void 0,onClick:()=>y?o(t.path):s(t.path),onDoubleClick:N,onContextMenu:N,className:V("w-full flex items-center gap-1.5 py-[3px] text-xs font-sans cursor-pointer","hover:bg-surface-5 transition-colors text-left select-none",v&&"bg-accent/10 text-text-0",!v&&"text-text-1",C&&"opacity-50",j&&"bg-accent/15 ring-1 ring-accent/50 rounded"),style:{paddingLeft:b},children:[y?e.jsxs(e.Fragment,{children:[O?e.jsx(bt,{size:12,className:"text-text-4 flex-shrink-0"}):e.jsx(Rt,{size:12,className:"text-text-4 flex-shrink-0"}),O?e.jsx(ga,{size:14,className:"text-accent flex-shrink-0"}):e.jsx(Ko,{size:14,className:"text-text-3 flex-shrink-0"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-3"}),e.jsx(iu,{size:14,className:V("flex-shrink-0",iHe(t.name))})]}),e.jsx("span",{className:"truncate",children:t.name})]})}function JJ({dirPath:t,depth:a,activePath:n,onFileClick:s,expanded:o,onDirToggle:c,treeCache:l,fetchTreeDir:A,onContextMenu:u,inlineInput:f,dragState:x,onDragStartEntry:m,onDragEndEntry:y,onSetDragOver:v,onDropOnDir:O}){const b=l[t]||[];return g.useEffect(()=>{o.has(t)&&!l[t]&&A(t)},[o,t,l,A]),o.has(t)?e.jsxs(e.Fragment,{children:[(f==null?void 0:f.parentPath)===t&&e.jsx(rT,{placeholder:f.type==="file"?"filename.ext":"folder-name",onSubmit:f.onSubmit,onCancel:f.onCancel,depth:a}),b.map(C=>e.jsxs("div",{children:[(f==null?void 0:f.renamePath)===C.path?e.jsx(rT,{defaultValue:C.name,onSubmit:f.onSubmit,onCancel:f.onCancel,depth:a}):e.jsx(YJ,{entry:C,depth:a,activePath:n,onFileClick:s,onDirToggle:c,expanded:o,onContextMenu:u,dragState:x,onDragStartEntry:m,onDragEndEntry:y,onSetDragOver:v,onDropOnDir:O}),C.type==="dir"&&e.jsx(JJ,{dirPath:C.path,depth:a+1,activePath:n,onFileClick:s,expanded:o,onDirToggle:c,treeCache:l,fetchTreeDir:A,onContextMenu:u,inlineInput:f,dragState:x,onDragStartEntry:m,onDragEndEntry:y,onSetDragOver:v,onDropOnDir:O})]},C.path))]}):null}function lHe({rootDir:t,onCollapse:a}){const n=$(_=>_.editorTreeCache),s=$(_=>_.editorActiveFile),o=$(_=>_.openFile),c=$(_=>_.fetchTreeDir),l=$(_=>_.addToast),[A,u]=g.useState(new Set([""])),[f,x]=g.useState(""),[m,y]=g.useState(null),[v,O]=g.useState(null),[b,C]=g.useState({draggingPath:null,dragOverPath:null});g.useEffect(()=>{c("")},[c,t]);function j(_){u(R=>{const U=new Set(R);return U.has(_)?U.delete(_):U.add(_),U})}function N(){u(new Set([""]))}function M(_){C({draggingPath:_,dragOverPath:null})}function Q(){C({draggingPath:null,dragOverPath:null})}function L(_){C(R=>R.dragOverPath===_?R:{...R,dragOverPath:_})}async function B(_,R){R.preventDefault(),R.stopPropagation(),C({draggingPath:null,dragOverPath:null});let U;try{U=JSON.parse(R.dataTransfer.getData("application/json"))}catch{return}if(!(U!=null&&U.path))return;if(U.type==="dir"&&(_===U.path||_.startsWith(U.path+"/"))){l("error","Cannot move a folder into itself");return}const Z=z(U.path);if(Z===_)return;const J=_?`${_}/${U.name}`:U.name;try{await D.post("/files/rename",{oldPath:U.path,newPath:J}),c(Z),c(_),l("success",`Moved ${U.name} to ${_||"/"}`)}catch(Ae){l("error","Move failed",Ae.message)}}function S(_,R){y({x:_.clientX,y:_.clientY,entry:R})}function I(_){_.preventDefault(),y({x:_.clientX,y:_.clientY,entry:{type:"dir",path:"",name:"root"}})}function z(_){const R=_.split("/");return R.pop(),R.join("/")}async function P(_){u(R=>new Set([...R,_])),O({type:"file",parentPath:_,onSubmit:async R=>{const U=_?`${_}/${R}`:R;try{await D.post("/files/create",{path:U,content:""}),c(_),o(U),l("success",`Created ${R}`)}catch(Z){l("error","Create failed",Z.message)}O(null)},onCancel:()=>O(null)})}async function F(_){u(R=>new Set([...R,_])),O({type:"folder",parentPath:_,onSubmit:async R=>{const U=_?`${_}/${R}`:R;try{await D.post("/files/mkdir",{path:U}),c(_),u(Z=>new Set([...Z,U])),l("success",`Created ${R}/`)}catch(Z){l("error","Create folder failed",Z.message)}O(null)},onCancel:()=>O(null)})}async function K(_){O({type:"rename",renamePath:_.path,onSubmit:async R=>{const U=z(_.path),Z=U?`${U}/${R}`:R;try{await D.post("/files/rename",{oldPath:_.path,newPath:Z}),c(U),l("success",`Renamed to ${R}`)}catch(J){l("error","Rename failed",J.message)}O(null)},onCancel:()=>O(null)})}async function G(_){const R=_.type==="dir"?`folder "${_.name}" and all contents`:`"${_.name}"`;if(window.confirm(`Delete ${R}?`))try{await D.delete(`/files/delete?path=${encodeURIComponent(_.path)}`),c(z(_.path)),l("success",`Deleted ${_.name}`)}catch(U){l("error","Delete failed",U.message)}}function H(_){const R=_.type==="dir",U=[];return R&&(U.push({icon:Hr,label:"New File",action:()=>P(_.path)}),U.push({icon:qr,label:"New Folder",action:()=>F(_.path)})),_.name!=="root"?(U.length>0&&U.push({separator:!0}),U.push({icon:js,label:"Rename",action:()=>K(_)}),U.push({icon:At,label:"Delete",danger:!0,action:()=>G(_)})):(U.length=0,U.push({icon:Hr,label:"New File",action:()=>P("")}),U.push({icon:qr,label:"New Folder",action:()=>F("")})),U}const q=n[""]||[];return e.jsxs("div",{className:"flex flex-col h-full bg-surface-1",onContextMenu:I,children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border-subtle",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(oa,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{value:f,onChange:_=>x(_.target.value),placeholder:"Filter...",className:"w-full h-6 pl-6 pr-2 text-xs bg-surface-0 border border-border-subtle rounded text-text-1 placeholder:text-text-4 focus:outline-none focus:border-accent font-sans"})]}),e.jsx("button",{onClick:()=>P(""),className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"New file",children:e.jsx(Hr,{size:12})}),e.jsx("button",{onClick:()=>F(""),className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"New folder",children:e.jsx(qr,{size:12})}),e.jsx("button",{onClick:()=>c(""),className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Refresh",children:e.jsx(ra,{size:12})}),e.jsx("button",{onClick:N,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Collapse all",children:e.jsx(ru,{size:12})}),a&&e.jsx("button",{onClick:a,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Collapse sidebar",children:e.jsx(fs,{size:12})})]}),e.jsx(it,{className:"flex-1",children:e.jsxs("div",{className:"py-1",onDragOver:_=>{b.draggingPath&&(_.preventDefault(),L(null))},onDrop:_=>B("",_),children:[(v==null?void 0:v.parentPath)===""&&e.jsx(rT,{placeholder:v.type==="file"?"filename.ext":"folder-name",onSubmit:v.onSubmit,onCancel:v.onCancel,depth:0}),q.filter(_=>!f||_.name.toLowerCase().includes(f.toLowerCase())).map(_=>e.jsxs("div",{children:[(v==null?void 0:v.renamePath)===_.path?e.jsx(rT,{defaultValue:_.name,onSubmit:v.onSubmit,onCancel:v.onCancel,depth:0}):e.jsx(YJ,{entry:_,depth:0,activePath:s,onFileClick:o,onDirToggle:j,expanded:A,onContextMenu:S,dragState:b,onDragStartEntry:M,onDragEndEntry:Q,onSetDragOver:L,onDropOnDir:B}),_.type==="dir"&&e.jsx(JJ,{dirPath:_.path,depth:1,activePath:s,onFileClick:o,expanded:A,onDirToggle:j,treeCache:n,fetchTreeDir:c,onContextMenu:S,inlineInput:v,dragState:b,onDragStartEntry:M,onDragEndEntry:Q,onSetDragOver:L,onDropOnDir:B})]},_.path)),q.length===0&&!f&&e.jsxs("div",{className:"px-3 py-6 text-center",children:[e.jsx("p",{className:"text-xs text-text-4",children:"No files found"}),e.jsx("button",{onClick:()=>c(""),className:"mt-2 text-xs text-accent hover:underline cursor-pointer",children:"Retry"})]})]})}),m&&e.jsx(cHe,{x:m.x,y:m.y,items:H(m.entry),onClose:()=>y(null)})]})}function dHe(){const t=$(b=>b.editorOpenTabs),a=$(b=>b.editorActiveFile),n=$(b=>b.editorFiles),s=$(b=>b.setActiveFile),o=$(b=>b.closeFile),c=g.useRef(null),[l,A]=g.useState(!1),u=g.useCallback(()=>{const b=c.current;b&&A(b.scrollWidth>b.clientWidth)},[]);g.useEffect(()=>{u();const b=c.current;if(!b)return;const C=new ResizeObserver(u);return C.observe(b),()=>C.disconnect()},[u,t.length]);function f(){var b;(b=c.current)==null||b.scrollBy({left:-120,behavior:"smooth"})}function x(){var b;(b=c.current)==null||b.scrollBy({left:120,behavior:"smooth"})}function m(b){t.filter(C=>C!==b).forEach(C=>o(C))}function y(){[...t].forEach(b=>o(b))}function v(b){const C=t.indexOf(b);t.slice(C+1).forEach(j=>o(j))}function O(b){var C;(C=navigator.clipboard)==null||C.writeText(b)}return t.length===0?null:e.jsxs("div",{className:"flex items-stretch h-9 bg-surface-3 border-b border-border-subtle flex-shrink-0",children:[l&&e.jsx("button",{onClick:f,className:"flex-shrink-0 px-1 h-full text-text-4 hover:text-text-1 hover:bg-surface-4 transition-colors cursor-pointer",children:e.jsx(bs,{size:14})}),e.jsx("div",{ref:c,className:"flex items-stretch flex-1 min-w-0 overflow-x-auto scrollbar-none scroll-smooth",style:{scrollSnapType:"x mandatory"},children:t.map(b=>{const C=b===a,j=n[b],N=j&&j.content!==j.originalContent,M=b.split("/").pop();return e.jsxs(Bz,{children:[e.jsx(_z,{asChild:!0,children:e.jsxs("div",{className:V("flex items-center gap-1.5 px-3 text-xs font-sans cursor-pointer select-none","border-r border-white/5","transition-colors duration-75 flex-shrink-0",C?"bg-surface-0 text-text-0 border-b border-b-accent":"bg-surface-3 text-text-4 hover:text-text-1 hover:bg-surface-4 border-b border-b-transparent"),style:{scrollSnapAlign:"start"},onClick:()=>s(b),onAuxClick:Q=>{Q.button===1&&(Q.preventDefault(),o(b))},children:[e.jsx("span",{className:"truncate max-w-[120px]",children:M}),N&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-warning flex-shrink-0"}),e.jsx("button",{onClick:Q=>{Q.stopPropagation(),o(b)},className:"p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 transition-colors cursor-pointer ml-0.5",children:e.jsx(Ge,{size:12})})]})}),e.jsxs(Lz,{children:[e.jsxs(ms,{onSelect:()=>o(b),children:[e.jsx(Ge,{size:12,className:"text-text-3"})," Close"]}),e.jsxs(ms,{onSelect:()=>m(b),children:[e.jsx(qn,{size:12,className:"text-text-3"})," Close Others"]}),e.jsxs(ms,{onSelect:()=>y(),children:[e.jsx(qn,{size:12,className:"text-text-3"})," Close All"]}),e.jsxs(ms,{onSelect:()=>v(b),children:[e.jsx(Rt,{size:12,className:"text-text-3"})," Close to the Right"]}),e.jsx(Tz,{}),e.jsxs(ms,{onSelect:()=>O(b),children:[e.jsx(wn,{size:12,className:"text-text-3"})," Copy Path"]})]})]},b)})}),l&&e.jsx("button",{onClick:x,className:"flex-shrink-0 px-1 h-full text-text-4 hover:text-text-1 hover:bg-surface-4 transition-colors cursor-pointer",children:e.jsx(Rt,{size:14})})]})}const AHe={javascript:"JavaScript",typescript:"TypeScript",css:"CSS",html:"HTML",json:"JSON",markdown:"Markdown",python:"Python"};function uHe({cursorPos:t,language:a}){return e.jsxs("div",{className:"flex items-center justify-between h-6 px-3 bg-surface-1 border-t border-border-subtle text-2xs font-sans text-text-3 flex-shrink-0 select-none",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("span",{children:["Ln ",t.line,", Col ",t.col]})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"cursor-default",children:AHe[a]||a||"Plain Text"}),e.jsx("span",{children:"Spaces: 2"}),e.jsx("span",{children:"UTF-8"})]})]})}function hHe({currentLine:t,onGoto:a,onClose:n}){const[s,o]=g.useState(""),c=g.useRef(null);g.useEffect(()=>{var A;(A=c.current)==null||A.focus()},[]);function l(A){if(A.key==="Enter"){const u=parseInt(s,10);u>0&&a(u),n()}A.key==="Escape"&&n()}return e.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-2 bg-surface-2 border border-border rounded-lg shadow-xl p-2",children:[e.jsx("label",{className:"text-2xs font-sans text-text-3 whitespace-nowrap",children:"Go to Line:"}),e.jsx("input",{ref:c,value:s,onChange:A=>o(A.target.value),onKeyDown:l,onBlur:n,placeholder:String(t),className:"w-20 h-6 px-2 text-xs bg-surface-0 border border-border-subtle rounded text-text-0 font-mono focus:outline-none focus:border-accent"})]})}function pHe({path:t}){if(!t)return null;const a=t.split("/").filter(Boolean);return e.jsx("div",{className:"flex items-center h-7 px-3 bg-surface-2 border-b border-border-subtle text-2xs font-sans text-text-3 overflow-hidden flex-shrink-0 select-none",children:a.map((n,s)=>{const o=s===a.length-1;return e.jsxs("span",{className:"flex items-center min-w-0",children:[s>0&&e.jsx(Rt,{size:10,className:"mx-0.5 flex-shrink-0 text-text-4"}),e.jsx("span",{className:o?"text-text-1 font-medium truncate":"hover:text-text-1 cursor-pointer truncate transition-colors",children:n})]},s)})})}function fHe(t){var n;const a=(n=t==null?void 0:t.split(".").pop())==null?void 0:n.toLowerCase();return a==="html"||a==="htm"}const xHe=240,mHe=160,gHe=400;function yHe(){const t=$(K=>K.editorActiveFile),a=$(K=>K.editorFiles),n=$(K=>K.updateFileContent),s=$(K=>K.saveFile),o=$(K=>K.editorSidebarWidth),c=$(K=>K.setEditorSidebarWidth),l=$(K=>K.projectDir),[A,u]=g.useState(""),[f,x]=g.useState(!1),[m,y]=g.useState(0),[v,O]=g.useState({line:1,col:1}),[b,C]=g.useState(!1),[j,N]=g.useState(!1),M=g.useRef(null),Q=g.useRef(!1),L=g.useRef(0),B=g.useRef(0);g.useEffect(()=>{D.get("/files/root").then(K=>u(K.root||"")).catch(()=>{})},[l]),g.useEffect(()=>{x(!1)},[t]),g.useEffect(()=>{function K(G){(G.metaKey||G.ctrlKey)&&G.key==="g"&&(G.preventDefault(),C(!0))}return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[]);const S=g.useCallback(K=>{K.preventDefault(),Q.current=!0,L.current=K.clientX,B.current=o;function G(q){if(!Q.current)return;const _=q.clientX-L.current,R=Math.min(Math.max(B.current+_,mHe),gHe);c(R)}function H(){Q.current=!1,document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",H)}document.addEventListener("mousemove",G),document.addEventListener("mouseup",H)},[o,c]);function I(K){const G=M.current;if(!G)return;const H=G.state.doc.line(Math.min(K,G.state.doc.lines));G.dispatch({selection:{anchor:H.from},scrollIntoView:!0}),G.focus()}const z=t?a[t]:null,P=t&&UY(t),F=t&&fHe(t);return e.jsxs("div",{className:"flex h-full",children:[e.jsxs("div",{className:V("relative flex-shrink-0 border-r border-border transition-all duration-200 overflow-hidden",j&&"w-0 border-r-0"),style:j?void 0:{width:o},children:[e.jsx(lHe,{rootDir:A,onCollapse:()=>N(!0)}),e.jsx("div",{className:"absolute top-0 right-0 bottom-0 w-1 cursor-col-resize hover:bg-accent/30 transition-colors z-10",onMouseDown:S,onDoubleClick:()=>c(xHe)})]}),j&&e.jsx("button",{onClick:()=>N(!1),className:"flex-shrink-0 w-6 flex items-start justify-center pt-2 border-r border-border bg-surface-2 text-text-4 hover:text-text-0 hover:bg-surface-3 transition-colors cursor-pointer",title:"Show sidebar",children:e.jsx(xs,{size:14})}),e.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-surface-1",children:[e.jsx(dHe,{}),t&&!P&&e.jsx(pHe,{path:t}),e.jsxs("div",{className:"flex-1 relative min-h-0",children:[b&&e.jsx(hHe,{currentLine:v.line,onGoto:I,onClose:()=>C(!1)}),!t&&e.jsx("div",{className:"w-full h-full flex items-center justify-center text-text-4 font-sans",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(Zt,{size:32,className:"mx-auto"}),e.jsx("p",{className:"text-sm",children:"Open a file from the tree"})]})}),t&&P&&e.jsx(PY,{path:t}),t&&!P&&F&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"absolute top-0 right-4 z-10 flex items-center gap-0.5 mt-2 bg-surface-2 border border-border-subtle rounded-md p-0.5",children:[e.jsxs("button",{onClick:()=>x(!1),className:V("flex items-center gap-1.5 px-2.5 py-1 text-xs font-sans rounded cursor-pointer transition-colors",f?"text-text-3 hover:text-text-1":"bg-surface-4 text-text-0 font-medium"),children:[e.jsx(ou,{size:12})," Code"]}),e.jsxs("button",{onClick:()=>{x(!0),y(K=>K+1)},className:V("flex items-center gap-1.5 px-2.5 py-1 text-xs font-sans rounded cursor-pointer transition-colors",f?"bg-surface-4 text-text-0 font-medium":"text-text-3 hover:text-text-1"),children:[e.jsx(na,{size:12})," Preview"]})]}),f?e.jsx("iframe",{src:`/api/files/raw?path=${encodeURIComponent(t)}`,className:"w-full h-full border-0",sandbox:"allow-scripts allow-same-origin",title:"HTML Preview"},m):z&&e.jsx(hE,{content:z.content,language:z.language,onChange:K=>n(t,K),onSave:()=>s(t),onCursorChange:O,viewRef:M})]}),t&&!P&&!F&&z&&e.jsx(hE,{content:z.content,language:z.language,onChange:K=>n(t,K),onSave:()=>s(t),onCursorChange:O,viewRef:M})]}),t&&!P&&e.jsx(uHe,{cursorPos:v,language:z==null?void 0:z.language})]})]})}function vHe(){var M;const t=$(Q=>Q.connected),a=$(Q=>Q.agents),[n,s]=g.useState(null),[o,c]=g.useState([]),[l,A]=g.useState({constraints:[],discoveries:[],roles:[],specializations:null}),[u,f]=g.useState(!0),[x,m]=g.useState({tokens:[],cost:[],saved:[],efficiency:[],cache:[],inputOutput:[],agents:[],turns:[]}),y=g.useRef(0);g.useEffect(()=>{if(!t)return;let Q=!0;async function L(){try{const[S,I,z,P,F,K]=await Promise.all([D.get("/dashboard"),D.get("/tokens/by-team").catch(()=>({teams:[]})),D.get("/memory/constraints").catch(()=>({constraints:[]})),D.get("/memory/discoveries?limit=20").catch(()=>({discoveries:[]})),D.get("/memory/handoff-chain").catch(()=>({roles:[]})),D.get("/memory/specializations").catch(()=>({perAgent:{},perProjectRole:{}}))]);if(!Q)return;s(S),c((I==null?void 0:I.teams)||[]),A({constraints:(z==null?void 0:z.constraints)||[],discoveries:(P==null?void 0:P.discoveries)||[],roles:(F==null?void 0:F.roles)||[],specializations:K||{perAgent:{},perProjectRole:{}}}),f(!1),y.current=Date.now(),m(G=>{var W,ae,Oe,ve,ce,he,je,ee,ke;const H=Date.now(),q=(ye,Ne)=>[...ye.slice(-59),{t:H,v:Ne||0}],_=((W=S.tokens)==null?void 0:W.totalTokens)||0,R=((ae=S.tokens)==null?void 0:ae.totalInputTokens)||0,U=((Oe=S.tokens)==null?void 0:Oe.totalOutputTokens)||0,J=(((ve=S.agents)==null?void 0:ve.breakdown)||[]).filter(ye=>{var Ne;return((Ne=ye.quality)==null?void 0:Ne.score)!=null}),Ae=J.length>0?J.reduce((ye,Ne)=>ye+Ne.quality.score,0)/J.length:0;return{tokens:q(G.tokens,_),cost:q(G.cost,(ce=S.tokens)==null?void 0:ce.totalCostUsd),saved:q(G.saved,Ae),efficiency:q(G.efficiency,((he=S.rotation)==null?void 0:he.totalRotations)||0),cache:q(G.cache,(je=S.tokens)==null?void 0:je.cacheHitRate),inputOutput:q(G.inputOutput,U>0?R/U:0),agents:q(G.agents,((ee=S.agents)==null?void 0:ee.running)||0),turns:q(G.turns,(ke=S.tokens)==null?void 0:ke.totalTurns)}})}catch{Q&&f(!1)}}L();const B=setInterval(L,4e3);return()=>{Q=!1,clearInterval(B)}},[t]);const v=((M=n==null?void 0:n.agents)==null?void 0:M.breakdown)||[],O=(n==null?void 0:n.routing)||null,b=(n==null?void 0:n.rotation)||null,C=(n==null?void 0:n.adaptive)||[],j=(n==null?void 0:n.journalist)||null,N=(b==null?void 0:b.rotating)||[];return{data:n,loading:u,agents:a,connected:t,kpiHistory:x,lastFetch:y.current,agentBreakdown:v,routing:O,rotation:b,adaptive:C,journalist:j,rotating:N,teamBurn:o,memory:l}}const QX=g.memo(function({connected:a,runningCount:n,totalCount:s,uptime:o,lastFetch:c,activeTeam:l}){return e.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-surface-1 border-b border-border",children:[e.jsx("h2",{className:"text-xs font-semibold text-text-0 font-sans tracking-wide uppercase",children:"Command Center"}),l&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-4",children:"/"}),e.jsx("span",{className:"text-xs font-mono text-text-2",children:l.name})]}),e.jsx("div",{className:"flex-1"}),a&&e.jsxs("div",{className:"flex items-center gap-3.5 text-xs font-mono text-text-2",children:[e.jsxs("span",{children:[e.jsx("span",{className:"text-text-1",children:n}),e.jsxs("span",{className:"text-text-3",children:["/",s]}),e.jsx("span",{className:"ml-1 text-text-3",children:"agents"})]}),o>0&&e.jsxs("span",{className:"text-text-3",children:["Up ",WA(o)]}),c>0&&e.jsxs("span",{className:"flex items-center gap-1 text-text-4",children:[e.jsx(ra,{size:9}),e.jsx("span",{children:Mt(c)})]})]}),e.jsx(ia,{status:a?"running":"crashed",size:"sm"})]})});function kHe({data:t,color:a=te.accent,width:n=72,height:s=22}){if(!t||t.length<2)return e.jsx("div",{style:{width:n,height:s}});const o=t.map(x=>x.v),c=Math.min(...o),A=Math.max(...o)-c||1,u=t.map((x,m)=>{const y=m/(t.length-1)*n,v=s-(x.v-c)/A*(s-2)-1;return`${y},${v}`}).join(" "),f=`kpi-${a.replace("#","")}`;return e.jsxs("svg",{width:n,height:s,className:"flex-shrink-0",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:f,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:"0.2"}),e.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:"0"})]})}),e.jsx("polygon",{points:`0,${s} ${u} ${n},${s}`,fill:`url(#${f})`}),e.jsx("polyline",{points:u,fill:"none",stroke:a,strokeWidth:"1.5",strokeLinejoin:"round",strokeOpacity:"0.8"})]})}const OHe=g.memo(function({label:a,value:n,sparkData:s,color:o=te.accent,hint:c,className:l}){return e.jsxs("div",{className:V("flex items-center gap-2.5 px-3 py-2.5 min-w-0","bg-surface-1",l),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5 truncate flex items-center gap-1",children:[a,c&&e.jsx(Nt,{content:e.jsx("span",{className:"max-w-[220px] block leading-relaxed",children:c}),side:"bottom",children:e.jsx(Na,{size:10,className:"text-text-4 hover:text-text-2 cursor-help flex-shrink-0 transition-colors"})})]}),e.jsx("div",{className:"text-base font-semibold font-mono text-text-0 tabular-nums leading-none",children:n})]}),e.jsx(kHe,{data:s,color:o})]})});function bHe({kpis:t}){return e.jsx("div",{className:"flex flex-wrap border-b border-border",style:{background:"var(--color-surface-0)"},children:t.map(a=>e.jsx(OHe,{label:a.label,value:a.value,sparkData:a.sparkData,color:a.color,hint:a.hint,className:V("flex-1 basis-[12.5%] min-w-[140px]","border-b border-r border-border")},a.label))})}const wHe={actual:"ACT",estimated:"EST",local:"LOC"};function jHe(t){if(!t||t==="auto"||t==="default")return"default";const a=t.match(/^claude-(opus|sonnet|haiku)-(\d+)-(\d+)/);return a?`${a[1][0].toUpperCase()}${a[1].slice(1)} ${a[2]}.${a[3]}`:t.startsWith("gemini-")?t.replace("gemini-","Gem ").replace("-preview",""):t.length>12?t.slice(0,12)+"...":t}const CHe=g.memo(function({agent:a,isRotating:n}){const s=a.status==="running"||a.status==="starting",o=Math.round((a.contextUsage||0)*100),c=n?"#c678dd":qE(a.status),l=a.quality,A=(l==null?void 0:l.toolSuccessRate)!=null?Math.round(l.toolSuccessRate*100):null,u=a.rotationThreshold?Math.round(a.rotationThreshold*100):null,f=On(a.role),x=o>80?te.danger:o>60?te.warning:te.accent;return e.jsxs("div",{className:"px-3 pl-6 py-2 hover:bg-[rgba(51,175,188,0.06)] transition-colors space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[e.jsx("span",{className:"absolute inset-0 rounded-sm",style:{background:c}}),s&&e.jsx("span",{className:"absolute inset-[-2px] rounded-sm",style:{background:c,opacity:.15,animation:"node-pulse-bar 2s ease-in-out infinite"}})]}),e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate leading-none flex-shrink-0 max-w-[80px]",children:a.name}),e.jsx("span",{className:"text-2xs font-mono font-semibold px-1.5 py-px rounded-sm flex-shrink-0 capitalize",style:{background:f.bg,color:f.text},children:(a.role||"").toLowerCase()}),e.jsx("span",{className:"text-2xs font-mono text-text-4 bg-surface-4 px-1 py-px rounded-sm flex-shrink-0 truncate max-w-[72px]",children:jHe(a.model)}),e.jsx("div",{className:"flex-1"}),A!=null&&e.jsxs("span",{className:"text-2xs font-mono font-bold px-1 py-px rounded-sm flex-shrink-0",style:{color:A>=90?"#4ae168":A>=70?"#e5c07b":"#e06c75",background:A>=90?"rgba(74,225,104,0.1)":A>=70?"rgba(229,192,123,0.1)":"rgba(224,108,117,0.1)"},children:[A,"%"]}),a.costSource&&a.costSource!=="actual"&&e.jsx("span",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider flex-shrink-0",children:wHe[a.costSource]||""}),e.jsxs("div",{className:"text-right flex-shrink-0",children:[e.jsx("div",{className:"text-xs font-mono text-text-1 tabular-nums leading-none",children:pt(a.tokens||0)}),(a.costUsd||0)>0&&e.jsx("div",{className:"text-2xs font-mono text-text-3 mt-0.5",children:Ai(a.costUsd)})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1 h-0.5 rounded-sm overflow-visible",style:{background:qe(te.accent,.12)},children:[e.jsx("div",{className:"absolute inset-y-0 left-0 rounded-sm transition-all duration-700",style:{width:`${Math.max(o,1)}%`,background:x}}),u&&e.jsx("div",{className:"absolute top-[-1px] w-px h-[4px]",style:{left:`${u}%`,background:te.purple},title:`Rotation at ${u}%`})]}),e.jsxs("span",{className:"text-2xs font-mono text-text-2 tabular-nums flex-shrink-0 w-7 text-right",children:[o,"%"]})]})]})});function NHe({team:t,members:a,rotatingSet:n}){const[s,o]=g.useState(!0),c=a.filter(f=>f.status==="running"||f.status==="starting").length,l=c>0,A=a.reduce((f,x)=>f+(x.tokens||0),0),u=a.reduce((f,x)=>f+(x.costUsd||0),0);return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>o(f=>!f),className:"w-full flex items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-[rgba(51,175,188,0.08)] bg-[rgba(51,175,188,0.05)]",style:{borderLeft:l?`2px solid ${te.accent}`:"2px solid transparent"},children:[s?e.jsx(bt,{size:10,className:"text-text-4 flex-shrink-0"}):e.jsx(Rt,{size:10,className:"text-text-4 flex-shrink-0"}),e.jsx("span",{className:"text-2xs font-mono font-semibold text-text-2 uppercase tracking-widest flex-1 truncate",children:t}),e.jsx("span",{className:"text-2xs font-mono text-text-3 tabular-nums",children:pt(A)}),u>0&&e.jsx("span",{className:"text-2xs font-mono text-text-4 tabular-nums ml-1",children:Ai(u)}),e.jsxs("span",{className:"text-2xs font-mono tabular-nums flex-shrink-0 ml-1.5",style:{color:l?te.accent:void 0},children:[c,"/",a.length]})]}),s&&a.map(f=>e.jsx(CHe,{agent:f,isRotating:n.has(f.id)},f.id))]})}const MHe=g.memo(function({agentBreakdown:a,rotating:n=[],teams:s=[]}){if(!(a!=null&&a.length))return e.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono p-4",children:"No agents"});const o={};for(const A of s)o[A.id]=A.name;const c={};for(const A of a){const u=A.teamId||"ungrouped";c[u]||(c[u]=[]),c[u].push(A)}const l=new Set(n);return e.jsx(it,{className:"flex-1",children:e.jsx("div",{className:"py-1",children:Object.entries(c).map(([A,u])=>e.jsx(NHe,{team:o[A]||(A==="ungrouped"?"Ungrouped":A),members:u,rotatingSet:l},A))})})}),SHe=g.memo(function({data:a}){const n=g.useRef(null),s=g.useRef(null),[o,c]=g.useState({width:0,height:0}),[l,A]=g.useState(null),{width:u,height:f}=o,x={top:28,right:12,bottom:8,left:12},m=Math.max(u-x.left-x.right,0),y=Math.max(f-x.top-x.bottom,0),v=g.useMemo(()=>!a||a.length<2?[]:a.slice(1).map((C,j)=>{const N=a[j],M=(C.t-N.t)/6e4,Q=Math.max((C.tokens||0)-(N.tokens||0),0);return{burnRate:M>0?Math.round(Q/M):0,cacheHitRate:C.cacheHitRate||0,running:C.running||0,agents:C.agents||0,t:C.t}}),[a]);g.useEffect(()=>{const C=n.current;if(!C)return;const j=new ResizeObserver(N=>{const{width:M,height:Q}=N[0].contentRect;M>0&&Q>0&&c({width:Math.floor(M),height:Math.floor(Q)})});return j.observe(C),()=>j.disconnect()},[]);const O=g.useCallback(C=>{const j=s.current;if(!j||!v.length||m<=0)return;const N=j.getBoundingClientRect(),M=C.clientX-N.left-x.left;if(M<0||M>m){A(null);return}const Q=Math.round(M/m*(v.length-1));A({x:x.left+Q/Math.max(v.length-1,1)*m,index:Q})},[v,m,x.left]),b=g.useCallback(()=>A(null),[]);return g.useEffect(()=>{const C=s.current;if(!C||!v.length||u<=0||f<=0||m<=0||y<=0)return;const j=C.getContext("2d"),N=window.devicePixelRatio||1;C.width=u*N,C.height=f*N,j.scale(N,N),j.clearRect(0,0,u,f);const M=v.map(_=>_.burnRate),Q=v.map(_=>_.cacheHitRate),L=v.map(_=>_.running),B=Math.max(...M,100),S=Math.max(...L,1),I=_=>x.left+_/Math.max(v.length-1,1)*m,z=_=>x.top+y-_/B*y,P=_=>x.top+y-_*y,F=Math.max(m/v.length-1,2);for(let _=0;_<v.length;_++){const R=L[_];if(R<=0)continue;const U=R/S*y*.3,Z=I(_)-F/2,J=x.top+y-U;j.fillStyle=qe(te.surface5,.5),j.fillRect(Z,J,F,U)}j.setLineDash([2,4]),j.strokeStyle=qe(te.text4,.2),j.lineWidth=1;for(let _=1;_<=3;_++){const R=x.top+y/4*_;j.beginPath(),j.moveTo(x.left,R),j.lineTo(x.left+m,R),j.stroke()}j.setLineDash([]),j.font="9px 'JetBrains Mono Variable', monospace",j.textAlign="left",j.fillStyle=qe(te.text3,.5),j.fillText(`${pt(B)}/m`,x.left+4,x.top+10),j.fillText(`${pt(Math.round(B/2))}/m`,x.left+4,x.top+y/2+4),j.beginPath(),j.moveTo(x.left,x.top+y);for(let _=0;_<v.length;_++)j.lineTo(I(_),z(M[_]));j.lineTo(I(v.length-1),x.top+y),j.closePath();const K=j.createLinearGradient(0,x.top,0,x.top+y);K.addColorStop(0,qe(te.accent,.2)),K.addColorStop(.7,qe(te.accent,.04)),K.addColorStop(1,qe(te.accent,0)),j.fillStyle=K,j.fill(),j.beginPath(),j.strokeStyle=te.accent,j.lineWidth=1.5,j.lineJoin="round";for(let _=0;_<v.length;_++){const R=I(_),U=z(M[_]);_===0?j.moveTo(R,U):j.lineTo(R,U)}j.stroke();const G=Q.some(_=>_>0);if(G){j.beginPath(),j.strokeStyle=qe(te.info,.45),j.lineWidth=1,j.lineJoin="round",j.setLineDash([2,3]);for(let _=0;_<v.length;_++){const R=I(_),U=P(Q[_]);_===0?j.moveTo(R,U):j.lineTo(R,U)}j.stroke(),j.setLineDash([])}j.font="9px 'Inter Variable', sans-serif",j.textAlign="right";let H=u-x.right-4;const q=14;if(G&&(j.fillStyle=qe(te.info,.5),j.fillText("Cache %",H,q),H-=j.measureText("Cache %").width+4,j.beginPath(),j.arc(H,q-3,2.5,0,Math.PI*2),j.fill(),H-=14),j.fillStyle=qe(te.surface5,.7),j.fillText("Agents",H,q),H-=j.measureText("Agents").width+4,j.beginPath(),j.arc(H,q-3,2.5,0,Math.PI*2),j.fill(),H-=14,j.fillStyle=te.accent,j.fillText("Burn Rate",H,q),H-=j.measureText("Burn Rate").width+4,j.beginPath(),j.arc(H,q-3,2.5,0,Math.PI*2),j.fill(),l&&l.index>=0&&l.index<v.length){const _=l.x,R=v[l.index];j.beginPath(),j.moveTo(_,x.top),j.lineTo(_,x.top+y),j.strokeStyle=qe(te.text1,.15),j.lineWidth=1,j.stroke();const U=z(R.burnRate);j.beginPath(),j.arc(_,U,3,0,Math.PI*2),j.fillStyle=te.accent,j.fill();const Z=[{label:"Burn",value:`${pt(R.burnRate)}/m`,color:te.accent},{label:"Cache",value:us(R.cacheHitRate*100),color:te.info},{label:"Agents",value:`${R.running}/${R.agents}`,color:te.text2}],J=104,Ae=Z.length*16+12;let W=_+12;W+J>u-8&&(W=_-J-12);const ae=Math.max(x.top,U-Ae/2);j.fillStyle=qe(te.surface0,.92),j.beginPath(),j.roundRect(W,ae,J,Ae,4),j.fill(),j.strokeStyle=qe(te.text4,.2),j.lineWidth=1,j.stroke(),j.textAlign="left",Z.forEach((Oe,ve)=>{const ce=ae+14+ve*16;j.beginPath(),j.arc(W+8,ce-3,2,0,Math.PI*2),j.fillStyle=Oe.color,j.fill(),j.font="8px 'Inter Variable', sans-serif",j.fillStyle=te.text3,j.fillText(Oe.label,W+14,ce),j.font="9px 'JetBrains Mono Variable', monospace",j.fillStyle=te.text0,j.textAlign="right",j.fillText(Oe.value,W+J-8,ce),j.textAlign="left"})}},[v,u,f,l,m,y,x]),e.jsx("div",{ref:n,className:"absolute inset-0",children:u>0&&f>0&&e.jsx("canvas",{ref:s,style:{width:u,height:f},className:"block cursor-crosshair",onMouseMove:O,onMouseLeave:b})})}),QHe=g.memo(function({cacheRead:a=0,cacheCreation:n=0,totalInput:s=0,size:o=140}){const c=g.useRef(null),l=a+n,A=l,u=l>0?a/l*100:0;return g.useEffect(()=>{const f=c.current;if(!f)return;const x=window.devicePixelRatio||1;f.width=o*x,f.height=o*x;const m=f.getContext("2d");m.scale(x,x),m.clearRect(0,0,o,o);const y=o/2,v=o/2,O=(o-12)/2,b=5,C=135*Math.PI/180,j=405*Math.PI/180,N=j-C;if(m.beginPath(),m.arc(y,v,O,C,j),m.strokeStyle=te.surface4,m.lineWidth=b,m.lineCap="round",m.stroke(),A>0){const M=a/A,Q=n/A;if(M>0){const L=C+N*M;m.beginPath(),m.arc(y,v,O,C,L),m.strokeStyle=te.accent,m.lineWidth=b,m.lineCap="round",m.stroke()}if(Q>0){const L=C+N*M,B=L+N*Q;m.beginPath(),m.arc(y,v,O,L,B),m.strokeStyle=te.purple,m.lineWidth=b,m.lineCap="butt",m.stroke()}}m.textAlign="center",m.textBaseline="middle",m.font=`600 ${o*.2}px 'JetBrains Mono Variable', monospace`,m.fillStyle=te.text0,m.fillText(`${Math.round(u)}%`,y,v-3),m.font=`500 ${o*.08}px 'JetBrains Mono Variable', monospace`,m.fillStyle=te.text3,m.fillText("CACHE",y,v+o*.13)},[a,n,s,o,A,u]),e.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-3 py-3",children:[e.jsx("canvas",{ref:c,className:"flex-shrink-0",style:{width:o,height:o}}),e.jsxs("div",{className:"w-full mt-3 space-y-1.5 max-w-[160px]",children:[e.jsx(hP,{color:te.accent,label:"Read",value:pt(a)}),e.jsx(hP,{color:te.purple,label:"Create",value:pt(n)}),e.jsx(hP,{color:te.surface5,label:"Miss",value:pt(Math.max(s-a-n,0))})]})]})});function hP({color:t,label:a,value:n}){return e.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:t}}),e.jsx("span",{className:"text-text-3 uppercase tracking-wider flex-1",children:a}),e.jsx("span",{className:"text-text-1 tabular-nums",children:n})]})}const BX={heavy:te.danger,medium:te.warning,light:te.success},_X={heavy:"Heavy",medium:"Medium",light:"Light"},BHe=g.memo(function({routing:a,agentBreakdown:n}){if(!a)return null;const{byTier:s={},totalDecisions:o=0,autoRoutedCount:c=0}=a,l=["heavy","medium","light"],A=l.reduce((m,y)=>m+(s[y]||0),0),u={};for(const m of n||[]){const y=m.model||"default";u[y]||(u[y]={tokens:0,agents:0}),u[y].tokens+=m.tokens||0,u[y].agents+=1}const f=Object.entries(u).sort((m,y)=>y[1].tokens-m[1].tokens),x=f.length>0?f[0][1].tokens:0;return e.jsxs("div",{className:"flex flex-col h-full px-3 py-3 overflow-y-auto",children:[A>0&&e.jsxs("div",{className:"space-y-1.5 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:"Tier Distribution"}),e.jsxs("span",{className:"text-2xs font-mono text-text-4 ml-auto tabular-nums",children:[pt(A)," decisions"]})]}),e.jsx("div",{className:"h-0.5 bg-surface-2 rounded-sm overflow-hidden flex",children:l.map(m=>{const y=s[m]||0;if(y===0)return null;const v=y/A*100;return e.jsx("div",{className:"h-full transition-all duration-500",style:{width:`${v}%`,background:BX[m]},title:`${_X[m]}: ${y} (${Math.round(v)}%)`},m)})}),e.jsx("div",{className:"flex items-center gap-3",children:l.map(m=>{const y=s[m]||0;if(y===0)return null;const v=A>0?y/A*100:0;return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:BX[m]}}),e.jsx("span",{className:"text-2xs font-mono text-text-2",children:_X[m]}),e.jsx("span",{className:"text-2xs font-mono text-text-4 tabular-nums",children:us(v)})]},m)})})]}),f.length>0&&e.jsxs("div",{className:"space-y-1.5 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:"Models in Use"}),c>0&&e.jsxs("span",{className:"text-2xs font-mono text-text-4 ml-auto",children:[c," auto"]})]}),e.jsx("div",{className:"space-y-1.5",children:f.map(([m,y])=>{const v=x>0?y.tokens/x*100:0;return e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-mono text-text-1 flex-1 truncate",children:_He(m)}),e.jsxs("span",{className:"text-2xs font-mono text-text-3 tabular-nums",children:[y.agents," agent",y.agents!==1?"s":""]}),e.jsx("span",{className:"text-xs font-mono text-text-1 tabular-nums",children:pt(y.tokens)})]}),e.jsx("div",{className:"h-0.5 bg-surface-4 rounded-sm overflow-hidden",children:e.jsx("div",{className:"h-full rounded-sm transition-all duration-500",style:{width:`${Math.max(v,2)}%`,background:te.accent}})})]},m)})})]}),A===0&&f.length===0&&e.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono",children:"No routing data"})]})});function _He(t){if(!t||t==="auto"||t==="default")return"Default";const a=t.match(/^claude-(opus|sonnet|haiku)-(\d+)-(\d+)/);return a?`${a[1][0].toUpperCase()}${a[1].slice(1)} ${a[2]}.${a[3]}`:t.startsWith("gemini-")?t.replace("gemini-","Gemini ").replace("-preview",""):t}var RT="Tabs",[LHe]=tr(RT,[IT]),eee=IT(),[THe,Uz]=LHe(RT),tee=g.forwardRef((t,a)=>{const{__scopeTabs:n,value:s,onValueChange:o,defaultValue:c,orientation:l="horizontal",dir:A,activationMode:u="automatic",...f}=t,x=m2(A),[m,y]=Bu({prop:s,onChange:o,defaultProp:c??"",caller:RT});return e.jsx(THe,{scope:n,baseId:zr(),value:m,onValueChange:y,orientation:l,dir:x,activationMode:u,children:e.jsx(Ve.div,{dir:x,"data-orientation":l,...f,ref:a})})});tee.displayName=RT;var aee="TabsList",nee=g.forwardRef((t,a)=>{const{__scopeTabs:n,loop:s=!0,...o}=t,c=Uz(aee,n),l=eee(n);return e.jsx(qY,{asChild:!0,...l,orientation:c.orientation,dir:c.dir,loop:s,children:e.jsx(Ve.div,{role:"tablist","aria-orientation":c.orientation,...o,ref:a})})});nee.displayName=aee;var see="TabsTrigger",ree=g.forwardRef((t,a)=>{const{__scopeTabs:n,value:s,disabled:o=!1,...c}=t,l=Uz(see,n),A=eee(n),u=cee(l.baseId,s),f=lee(l.baseId,s),x=s===l.value;return e.jsx(DY,{asChild:!0,...A,focusable:!o,active:x,children:e.jsx(Ve.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":f,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...c,ref:a,onMouseDown:Se(t.onMouseDown,m=>{!o&&m.button===0&&m.ctrlKey===!1?l.onValueChange(s):m.preventDefault()}),onKeyDown:Se(t.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&l.onValueChange(s)}),onFocus:Se(t.onFocus,()=>{const m=l.activationMode!=="manual";!x&&!o&&m&&l.onValueChange(s)})})})});ree.displayName=see;var oee="TabsContent",iee=g.forwardRef((t,a)=>{const{__scopeTabs:n,value:s,forceMount:o,children:c,...l}=t,A=Uz(oee,n),u=cee(A.baseId,s),f=lee(A.baseId,s),x=s===A.value,m=g.useRef(x);return g.useEffect(()=>{const y=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(y)},[]),e.jsx(Za,{present:o||x,children:({present:y})=>e.jsx(Ve.div,{"data-state":x?"active":"inactive","data-orientation":A.orientation,role:"tabpanel","aria-labelledby":u,hidden:!y,id:f,tabIndex:0,...l,ref:a,style:{...t.style,animationDuration:m.current?"0s":void 0},children:y&&c})})});iee.displayName=oee;function cee(t,a){return`${t}-trigger-${a}`}function lee(t,a){return`${t}-content-${a}`}var $He=tee,IHe=nee,UHe=ree,PHe=iee;function Pz({children:t,...a}){return e.jsx($He,{...a,children:t})}function Ez({children:t,className:a,...n}){return e.jsx(IHe,{className:V("flex items-center gap-0 border-b border-border-subtle",a),...n,children:t})}function ys({children:t,className:a,...n}){return e.jsx(UHe,{className:V("px-3 py-2 text-sm font-medium font-sans text-text-2","border-b-2 border-transparent","hover:text-text-0 hover:bg-surface-5/50","data-[state=active]:text-text-0 data-[state=active]:border-accent","transition-colors duration-100 cursor-pointer select-none","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",a),...n,children:t})}function vs({children:t,className:a,...n}){return e.jsx(PHe,{className:V("flex-1 min-h-0",a),...n,children:t})}function LX({data:t,color:a=te.accent,width:n=60,height:s=16}){if(!t||t.length<2)return e.jsx("div",{style:{width:n,height:s}});const o=Array.isArray(t[0])?t:t.map(f=>typeof f=="number"?f:f.v),c=Math.min(...o),A=Math.max(...o)-c||1,u=o.map((f,x)=>{const m=x/(o.length-1)*n,y=s-(f-c)/A*(s-2)-1;return`${m},${y}`}).join(" ");return e.jsx("svg",{width:n,height:s,className:"flex-shrink-0",children:e.jsx("polyline",{points:u,fill:"none",stroke:a,strokeWidth:"1",strokeLinejoin:"round",strokeOpacity:"0.7"})})}function Xs({text:t,side:a="bottom"}){return e.jsx(Nt,{content:e.jsx("span",{className:"max-w-[220px] block leading-relaxed",children:t}),side:a,children:e.jsx(Na,{size:10,className:"text-text-4 hover:text-text-2 cursor-help flex-shrink-0 transition-colors inline-block ml-1"})})}function zz(t){return t==null?te.text3:t>=70?"#4ae168":t>=40?"#e5c07b":"#e06c75"}function Ro({label:t,value:a,danger:n}){return a==null||a===0?null:e.jsxs("span",{className:"text-2xs font-mono px-1.5 py-px rounded-sm bg-surface-4 text-text-3",children:[t,": ",e.jsx("span",{style:{color:n?"#e06c75":te.text1},children:a})]})}function EHe({score:t}){const a=Math.max(0,Math.min(100,t||0)),n=zz(t);return e.jsx("div",{className:"h-0.5 rounded-sm overflow-hidden flex-1",style:{background:"rgba(51,175,188,0.08)"},children:e.jsx("div",{className:"h-full rounded-sm transition-all duration-700",style:{width:`${a}%`,background:n}})})}function pP({label:t,value:a,total:n,color:s}){const o=n>0?a/n*100:0;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-mono text-text-2",children:t}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs font-mono font-semibold tabular-nums",style:{color:s},children:[o>=1?Math.round(o):o>0?o.toFixed(1):0,"%"]}),e.jsx("span",{className:"text-2xs font-mono text-text-3 tabular-nums w-10 text-right",children:pt(a)})]})]}),e.jsx("div",{className:"h-0.5 rounded-sm overflow-hidden",style:{background:"rgba(51,175,188,0.08)"},children:e.jsx("div",{className:"h-full rounded-sm transition-all duration-500",style:{width:`${Math.min(o,100)}%`,background:s}})})]})}function zHe({tokens:t,rotation:a,agentBreakdown:n}){var y,v,O;const s=((a==null?void 0:a.history)||[]).slice(-10).reverse(),o=(a==null?void 0:a.liveScores)||{},c=(n||[]).filter(b=>b.status==="running"),l=n||[],A=l.filter(b=>{var C;return((C=b.quality)==null?void 0:C.score)!=null}),u=A.length>0?Math.round(A.reduce((b,C)=>b+C.quality.score,0)/A.length):null,f=l.filter(b=>b.status==="completed"||b.status==="stopped").length,x=l.filter(b=>b.status==="crashed").length,m=f+x>0?Math.round(f/(f+x)*100):100;return e.jsxs("div",{className:"p-3 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Quality",e.jsx(Xs,{text:"Average session quality score (0-100). Based on error rate, tool failures, repetitions, and file churn. Below 40 triggers auto-rotation to prevent wasted tokens."})]}),e.jsx("div",{className:"text-base font-mono font-bold text-text-1 tabular-nums leading-none",children:u??"—"})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Rotations",e.jsx(Xs,{text:"Context rotations: quality-based (q), context threshold (c), and natural compactions (n) from provider-managed context resets. Each rotation preserves progress via a journalist handoff brief."})]}),e.jsx("div",{className:"text-base font-mono font-bold text-text-1 tabular-nums leading-none",children:(a==null?void 0:a.totalRotations)||0}),((a==null?void 0:a.qualityRotations)>0||(a==null?void 0:a.contextRotations)>0||(a==null?void 0:a.naturalCompactions)>0)&&e.jsxs("div",{className:"text-2xs font-mono text-text-4 mt-0.5",children:[a.qualityRotations||0,"q / ",a.contextRotations||0,"c / ",a.naturalCompactions||0,"n"]})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Cache",e.jsx(Xs,{text:"Prompt cache hit rate. Cache reads are ~90% cheaper than regular input tokens. Managed by your AI provider — GROOVE tracks it, doesn't control it."})]}),e.jsx("div",{className:"text-base font-mono font-bold text-text-1 tabular-nums leading-none",children:us(((t==null?void 0:t.cacheHitRate)||0)*100)})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Success",e.jsx(Xs,{text:"Agent completion rate. Completed agents vs. crashed agents. High success rate means agents are finishing tasks without errors."})]}),e.jsxs("div",{className:"text-base font-mono font-bold text-text-1 tabular-nums leading-none",children:[m,"%"]})]})]}),c.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-2",children:"Live Agent Quality"}),e.jsx("div",{className:"space-y-2",children:c.map(b=>{const C=b.quality||{},j=o[b.id],N=(j==null?void 0:j.score)??C.score,M=On(b.role);return e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("span",{className:"text-2xs font-mono font-semibold capitalize px-1.5 py-px rounded-sm",style:{background:M.bg,color:M.text},children:b.role}),e.jsx("span",{className:"text-xs font-mono text-text-1 truncate flex-1",children:b.name}),e.jsx("span",{className:"text-sm font-mono font-bold tabular-nums",style:{color:zz(N)},children:N??"—"})]}),e.jsx(EHe,{score:N}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:[e.jsx(Ro,{label:"Errors",value:C.errorCount,danger:!0}),e.jsx(Ro,{label:"Reps",value:C.repetitions,danger:!0}),e.jsx(Ro,{label:"Churn",value:C.fileChurn,danger:!0}),e.jsx(Ro,{label:"Tools",value:C.toolCalls}),e.jsx(Ro,{label:"Files",value:C.filesWritten}),C.toolCalls>0&&e.jsxs("span",{className:"text-2xs font-mono px-1.5 py-px rounded-sm bg-surface-4 text-text-3",children:["Success: ",e.jsxs("span",{style:{color:C.toolSuccessRate>=.8?"#4ae168":"#e5c07b"},children:[Math.round(C.toolSuccessRate*100),"%"]})]}),C.eventCount>0&&e.jsxs("span",{className:"text-2xs font-mono px-1.5 py-px rounded-sm bg-surface-4 text-text-3",children:["Events: ",e.jsx("span",{className:"text-text-2",children:C.eventCount})]})]})]},b.id)})})]}),((y=t==null?void 0:t.internalOverhead)==null?void 0:y.tokens)>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider flex items-center",children:["GROOVE Overhead",e.jsx(Xs,{text:"Tokens consumed by GROOVE's own coordination: the Journalist (synthesis), PM (approval gates), Planner, Task Negotiator, Gateway, and user Q&A. Previously invisible — now tracked for honest ROI."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-2xs font-mono text-text-2 tabular-nums",children:[pt(t.internalOverhead.tokens)," tokens"]}),e.jsx("span",{className:"text-2xs font-mono text-text-3 tabular-nums",children:Ai(t.internalOverhead.costUsd||0)}),t.totalTokens>0&&e.jsxs("span",{className:"text-2xs font-mono font-semibold tabular-nums",style:{color:te.purple},children:[Math.round(t.internalOverhead.tokens/t.totalTokens*100),"%"]})]})]}),e.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:Object.entries(t.internalOverhead.components||{}).sort((b,C)=>(C[1].tokens||0)-(b[1].tokens||0)).slice(0,6).map(([b,C])=>{const j=b.replace(/^__|__$/g,"").replace(/_/g," ");return e.jsxs("div",{className:"bg-surface-0 rounded px-2 py-1.5",children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider truncate",children:j}),e.jsx("div",{className:"text-xs font-mono text-text-1 tabular-nums font-semibold",children:pt(C.tokens||0)})]},b)})})]}),(((v=t==null?void 0:t.savings)==null?void 0:v.total)||0)>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider flex items-center",children:["Coordination Savings",e.jsx(Xs,{text:"Tokens saved vs. uncoordinated agents. Rotation savings are estimated from context degradation (pre/post velocity measurement underway). Conflict prevention and cold-start skip use fixed-overhead models. Compare against GROOVE Overhead above for honest ROI."})]}),e.jsxs("span",{className:"text-2xs font-mono text-text-2 tabular-nums",children:[pt(t.savings.total)," tokens"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(pP,{label:"Cold-start skip",value:t.savings.fromColdStartSkip||0,total:t.savings.total||1,color:te.info}),e.jsxs("div",{className:"text-2xs font-mono text-text-4 pl-2",children:["estimated · ",(((O=t==null?void 0:t.savings)==null?void 0:O.fromColdStartSkip)||0)>0?"fixed overhead per skip":""]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(pP,{label:"Rotation",value:t.savings.fromRotation||0,total:t.savings.total||1,color:te.accent}),e.jsx("div",{className:"text-2xs font-mono text-text-4 pl-2",children:"estimated · velocity measurement accumulating"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(pP,{label:"Conflict prevention",value:t.savings.fromConflictPrevention||0,total:t.savings.total||1,color:"#4ec9d4"}),e.jsx("div",{className:"text-2xs font-mono text-text-4 pl-2",children:"estimated · fixed overhead per conflict"})]})]})]}),s.length>0?e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-2.5",children:"Recent Rotations"}),e.jsx("div",{className:"space-y-0",children:s.map((b,C)=>{var B,S;const j=b.reason==="quality_degradation",N=b.reason==="natural_compaction",M=b.reason==="token_limit_exceeded",Q=b.reason==="runaway_velocity",L=M?"#e06c75":Q?"#ff8c42":j?"#e5c07b":N?"#c678dd":"#33afbc";return e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[e.jsx("div",{className:"h-1.5"}),e.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:C===0?L:`${L}25`,border:`1px solid ${L}80`,boxShadow:C===0?`0 0 6px ${L}60`:"none"}}),C<s.length-1&&e.jsx("div",{className:"w-px flex-1 mt-1",style:{background:"rgba(51,175,188,0.15)",minHeight:"12px"}})]}),e.jsx("div",{className:V("flex-1 bg-surface-0 rounded px-2 py-1.5",C<s.length-1&&"mb-2"),children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-mono text-text-1 font-medium capitalize truncate flex-1",children:b.agentName||b.role}),M?e.jsxs("span",{className:"text-2xs font-mono font-semibold tabular-nums flex-shrink-0",style:{color:"#e06c75"},title:`Auto-rotated: agent burned ${(B=b.instanceTokens)==null?void 0:B.toLocaleString()} tokens in one session`,children:["T:",us((b.instanceTokens||0)/1e6*100).replace("%","M")]}):Q?e.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsxs("span",{className:"text-2xs font-mono font-semibold tabular-nums",style:{color:"#ff8c42"},title:`Auto-rotated: runaway velocity (${(S=b.velocity)==null?void 0:S.toLocaleString()} tokens in recent window)`,children:["V:",us((b.velocity||0)/1e6*100).replace("%","M")]}),b.velocityDelta!=null&&b.velocityDelta>0&&e.jsxs("span",{className:"text-2xs font-mono tabular-nums",style:{color:"#4ae168"},title:`Post-rotation velocity dropped by ${b.velocityDelta.toLocaleString()} tokens — rotation worked`,children:["↓",us(b.velocityDelta/1e6*100).replace("%","M")]})]}):j?e.jsxs("span",{className:"text-2xs font-mono font-semibold tabular-nums flex-shrink-0",style:{color:"#e5c07b"},children:["Q:",b.qualityScore]}):N?e.jsxs("span",{className:"text-2xs font-mono font-semibold tabular-nums flex-shrink-0",style:{color:"#c678dd"},children:[us((b.contextUsage||0)*100)," → ",us((b.contextAfter||0)*100)]}):e.jsx("span",{className:"text-2xs font-mono font-semibold tabular-nums flex-shrink-0",style:{color:(b.contextUsage||0)>.8?"#e06c75":"#33afbc"},children:us((b.contextUsage||0)*100)}),e.jsx("span",{className:"text-2xs font-mono text-text-4 flex-shrink-0",children:Mt(b.timestamp)})]})})]},C)})})]}):e.jsxs("div",{className:"bg-surface-0 rounded p-3 text-center space-y-1.5",children:[e.jsx("div",{className:"text-xs font-mono text-text-2 font-semibold",children:"Monitoring for degradation"}),e.jsx("div",{className:"text-2xs font-mono text-text-3 leading-relaxed",children:"Auto-rotation triggers when session quality drops below 40 (errors, repetitions, file churn) or context exceeds the adaptive threshold."})]})]})}function FHe({adaptive:t}){if(!(t!=null&&t.length))return e.jsx("div",{className:"p-3",children:e.jsxs("div",{className:"bg-surface-0 rounded p-4 text-center space-y-2",children:[e.jsx("div",{className:"text-xs font-mono text-text-2 font-semibold",children:"No adaptive profiles yet"}),e.jsx("div",{className:"text-2xs font-mono text-text-3 leading-relaxed",children:"Adaptive thresholds learn when each agent role benefits from rotation. GROOVE tracks quality scores and adjusts rotation triggers automatically — converging to the optimal threshold per role and provider."})]})});function a(n){const s=n.split(":");return{provider:s[0]||n,role:s[1]||""}}return e.jsx("div",{className:"p-3 space-y-3",children:t.map(n=>{var x,m;const{provider:s,role:o}=a(n.key),c=o||s,l=((x=n.thresholdHistory)==null?void 0:x.length)>1,A=((m=n.recentScores)==null?void 0:m.length)>1,u=On(c),f=n.lastSignals;return e.jsxs("div",{className:"rounded overflow-hidden",style:{background:"rgba(51,175,188,0.04)",borderLeft:n.converged?"2px solid #33afbc":"2px solid rgba(229,192,123,0.35)"},children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 pt-2.5 pb-1.5",children:[e.jsx("span",{className:"text-xs font-mono font-semibold capitalize px-1.5 py-px rounded-sm",style:{background:u.bg,color:u.text},children:c}),o&&e.jsx("span",{className:"text-2xs font-mono text-text-4 bg-surface-4 px-1.5 py-px rounded-sm",children:s}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"flex items-center gap-1 text-2xs font-mono font-bold px-2 py-px rounded-full",style:{background:n.converged?"rgba(74,225,104,0.12)":"rgba(229,192,123,0.12)",color:n.converged?"#4ae168":"#e5c07b"},children:[!n.converged&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:"#e5c07b",animation:"node-pulse-bar 1.5s ease-in-out infinite"}}),n.converged?"Converged":"Learning"]})]}),e.jsxs("div",{className:"flex items-end gap-5 px-3 pb-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider mb-0.5",children:"Threshold"}),e.jsx("div",{className:"text-3xl font-mono font-bold tabular-nums leading-none",style:{color:n.converged?"#33afbc":"#e5c07b"},children:us(n.threshold*100)})]}),e.jsxs("div",{className:"pb-0.5",children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider mb-0.5",children:"Adj."}),e.jsx("div",{className:"text-lg font-mono font-semibold text-text-1 tabular-nums",children:n.adjustments})]})]}),(l||A)&&e.jsxs("div",{className:"px-3 pb-2 space-y-2 overflow-hidden",children:[l&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 mb-0.5",children:"Threshold history"}),e.jsx(LX,{data:n.thresholdHistory.map(y=>y.v),color:n.converged?te.accent:te.warning,width:240,height:32})]}),A&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 mb-0.5",children:"Quality score"}),e.jsx(LX,{data:n.recentScores,color:te.warning,width:240,height:24})]})]}),f&&e.jsxs("div",{className:"flex flex-wrap gap-1.5 px-3 pb-2.5",children:[e.jsx(Ro,{label:"Errors",value:f.errorCount,danger:!0}),e.jsx(Ro,{label:"Reps",value:f.repetitions,danger:!0}),e.jsx(Ro,{label:"Churn",value:f.fileChurn,danger:!0}),f.toolSuccessRate!=null&&e.jsxs("span",{className:"text-2xs font-mono px-1.5 py-px rounded-sm bg-surface-4 text-text-3",children:["Tools: ",e.jsxs("span",{className:"text-text-1",children:[Math.round(f.toolSuccessRate*100),"%"]})]})]})]},n.key)})})}function RHe({journalist:t}){var a;return t?e.jsxs("div",{className:"p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5",children:"Cycles"}),e.jsx("div",{className:"text-lg font-mono font-semibold text-text-0 tabular-nums leading-none",children:t.cycleCount||0})]}),t.lastCycleAt&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5",children:"Last"}),e.jsx("div",{className:"text-xs font-mono text-text-2",children:Mt(t.lastCycleAt)})]}),t.synthesizing&&e.jsx("span",{className:"text-2xs font-mono font-bold text-accent uppercase tracking-wider animate-pulse",children:"Synthesizing"})]}),t.lastSummary&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1",children:"Summary"}),e.jsx("div",{className:"text-xs font-sans text-text-2 leading-relaxed",children:t.lastSummary})]}),t.projectMap&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1",children:"Project Map"}),e.jsx("div",{className:"text-xs font-mono text-text-2 leading-relaxed whitespace-pre-wrap",children:t.projectMap})]}),t.decisions&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1",children:"Decisions"}),e.jsx("div",{className:"text-xs font-mono text-text-2 leading-relaxed whitespace-pre-wrap",children:t.decisions})]}),((a=t.recentHistory)==null?void 0:a.length)>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1.5",children:"History"}),e.jsx("div",{className:"space-y-1",children:t.recentHistory.slice().reverse().map((n,s)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono px-2 py-1 bg-surface-0 rounded",children:[e.jsxs("span",{className:"text-text-3",children:["#",n.cycle]}),e.jsxs("span",{className:"text-text-2 flex-1 truncate",children:[n.agentCount," agents"]}),e.jsx("span",{className:"text-text-4",children:Mt(n.timestamp)})]},s))})]})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono p-4",children:"Journalist inactive"})}function HHe({memory:t}){var f,x;const a=(t==null?void 0:t.constraints)||[],n=(t==null?void 0:t.discoveries)||[],s=(t==null?void 0:t.roles)||[],o=((f=t==null?void 0:t.specializations)==null?void 0:f.perAgent)||{},c=((x=t==null?void 0:t.specializations)==null?void 0:x.perProjectRole)||{},l=Object.keys(o).length,A=Object.keys(c).length;return a.length+n.length+s.length===0&&l===0?e.jsxs("div",{className:"p-6 text-center text-xs font-mono text-text-3",children:[e.jsx(Go,{size:24,className:"mx-auto mb-2 text-text-4"}),e.jsx("div",{children:"No memory accumulated yet"}),e.jsx("div",{className:"text-2xs text-text-4 mt-1",children:"Constraints, handoff chains, and discoveries populate as agents work"})]}):e.jsxs("div",{className:"p-3 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Constraints",e.jsx(Xs,{text:"Project rules discovered by agents or set by the user. Every new agent reads these on spawn to avoid rediscovering them."})]}),e.jsx("div",{className:"text-2xl font-mono font-bold tabular-nums leading-none",style:{color:te.accent},children:a.length})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Discoveries",e.jsx(Xs,{text:"Error→fix pairs successful agents have recorded. Injected into future agent context so they don't rediscover known solutions."})]}),e.jsx("div",{className:"text-2xl font-mono font-bold tabular-nums leading-none",style:{color:te.success},children:n.length})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Handoff Chains",e.jsx(Xs,{text:"Cumulative rotation briefs per role. Agent #50 knows what agent #1 struggled with. Each role keeps its last 10 rotation briefs."})]}),e.jsx("div",{className:"text-2xl font-mono font-bold tabular-nums leading-none",style:{color:te.purple},children:s.length})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1 flex items-center",children:["Specializations",e.jsx(Xs,{text:"Per-agent quality profiles: session counts, average quality, file touches, preferred thresholds."})]}),e.jsx("div",{className:"text-2xl font-mono font-bold tabular-nums leading-none",style:{color:te.info},children:l}),A>0&&e.jsxs("div",{className:"text-2xs font-mono text-text-4 mt-0.5",children:["across ",A," roles"]})]})]}),a.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-2",children:"Project Constraints"}),e.jsxs("div",{className:"space-y-1",children:[a.slice(0,10).map(m=>e.jsxs("div",{className:"flex items-start gap-2 bg-surface-0 rounded px-2 py-1.5",children:[e.jsx("span",{className:"text-2xs font-mono px-1.5 py-px rounded-sm bg-surface-4 text-text-3 uppercase tracking-wider flex-shrink-0 mt-0.5",children:m.category}),e.jsx("span",{className:"text-xs font-mono text-text-2 leading-relaxed flex-1",children:m.text})]},m.hash)),a.length>10&&e.jsxs("div",{className:"text-2xs font-mono text-text-4 px-2",children:["+",a.length-10," more"]})]})]}),n.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-2",children:"Recent Discoveries"}),e.jsx("div",{className:"space-y-1.5",children:n.slice(0,8).map((m,y)=>{const v=On(m.role);return e.jsxs("div",{className:"bg-surface-0 rounded px-2 py-1.5 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-2xs font-mono font-semibold capitalize px-1.5 py-px rounded-sm",style:{background:v.bg,color:v.text},children:m.role}),e.jsx("span",{className:"text-2xs font-mono text-text-4 flex-1",children:Mt(m.ts)})]}),e.jsxs("div",{className:"text-xs font-mono text-text-2 leading-relaxed",children:[e.jsx("span",{className:"text-text-4",children:"When:"})," ",e.jsx("span",{className:"text-text-1",children:m.trigger})]}),e.jsxs("div",{className:"text-xs font-mono text-text-2 leading-relaxed",children:[e.jsx("span",{className:"text-text-4",children:"Fix:"})," ",e.jsx("span",{style:{color:te.success},children:m.fix})]})]},y)})})]}),s.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-2",children:"Active Role Chains"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(m=>{const y=On(m);return e.jsx("span",{className:"text-2xs font-mono font-semibold capitalize px-2 py-1 rounded",style:{background:y.bg,color:y.text},children:m},m)})})]}),A>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-2",children:"Role Quality Profiles"}),e.jsx("div",{className:"space-y-1",children:Object.entries(c).map(([m,y])=>{const v=On(m);return e.jsxs("div",{className:"flex items-center gap-2 bg-surface-0 rounded px-2 py-1.5",children:[e.jsx("span",{className:"text-2xs font-mono font-semibold capitalize px-1.5 py-px rounded-sm",style:{background:v.bg,color:v.text},children:m}),e.jsxs("span",{className:"text-xs font-mono text-text-3 flex-1",children:[y.sessionCount," sessions"]}),e.jsxs("span",{className:"text-xs font-mono font-semibold tabular-nums",style:{color:zz(y.avgQualityScore)},children:["Q:",y.avgQualityScore]})]},m)})})]})]})}const qHe=g.memo(function({tokens:a,rotation:n,adaptive:s,journalist:o,agentBreakdown:c,memory:l}){return e.jsxs(Pz,{defaultValue:"health",className:"flex flex-col h-full",children:[e.jsxs(Ez,{className:"flex-shrink-0 px-1",children:[e.jsxs(ys,{value:"health",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[e.jsx(Ys,{size:11}),"Health"]}),e.jsxs(ys,{value:"memory",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[e.jsx(Go,{size:11}),"Memory"]}),e.jsxs(ys,{value:"adaptive",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[e.jsx(A0,{size:11}),"Adaptive"]}),e.jsxs(ys,{value:"journalist",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[e.jsx(Jn,{size:11}),"Journalist"]})]}),e.jsx(vs,{value:"health",className:"flex-1 min-h-0 relative",children:e.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:e.jsx(zHe,{tokens:a,rotation:n,agentBreakdown:c})})}),e.jsx(vs,{value:"memory",className:"flex-1 min-h-0 relative",children:e.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:e.jsx(HHe,{memory:l})})}),e.jsx(vs,{value:"adaptive",className:"flex-1 min-h-0 relative",children:e.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:e.jsx(FHe,{adaptive:s})})}),e.jsx(vs,{value:"journalist",className:"flex-1 min-h-0 relative",children:e.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:e.jsx(RHe,{journalist:o})})})]})}),DHe=g.memo(function({teams:a=[]}){const n=a.reduce((o,c)=>o+(c.totalTokens||0),0),s=a.reduce((o,c)=>Math.max(o,c.totalTokens||0),0);return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0 flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Team Burn"}),e.jsxs("span",{className:"text-2xs font-mono text-text-3",children:[pt(n)," total"]})]}),e.jsx(it,{className:"flex-1 min-h-0",children:a.length===0?e.jsx("div",{className:"px-3 py-6 text-center text-xs text-text-3 font-mono",children:"No team activity yet"}):e.jsx("div",{className:"px-3 py-3 space-y-3",children:a.map(o=>{const c=s>0?o.totalTokens/s*100:0;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:o.teamName}),o.isDefault&&e.jsx("span",{className:"text-[9px] font-mono text-text-3 uppercase tracking-wider",children:"default"}),e.jsxs("span",{className:"text-2xs font-mono text-text-3 flex-shrink-0",children:[o.agentCount," ",o.agentCount===1?"agent":"agents"]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 font-mono text-2xs",children:[e.jsx("span",{className:"text-text-1",children:pt(o.totalTokens)}),e.jsx("span",{className:"text-text-3",children:Ai(o.totalCostUsd)})]})]}),e.jsx("div",{className:"h-0.5 bg-surface-2 rounded-sm overflow-hidden",children:e.jsx("div",{className:"h-full rounded-sm transition-all",style:{width:`${c}%`,background:te.accent}})})]},o.teamId)})})})]})}),VHe={spawn:bu,complete:Sa,crash:Gt,kill:qn,rotate:Vr,error:$A},XHe={spawn:"text-accent",complete:"text-success",crash:"text-danger",kill:"text-text-3",rotate:"text-purple",error:"text-danger"};function ZHe(t){const a=t.agentName||t.role||"";switch(t.type){case"spawn":return`${a} spawned`;case"complete":return`${a} completed`;case"crash":return`${a} crashed`;case"kill":return`${a} killed`;case"rotate":return`${a} rotated`;default:return t.text||t.type||"event"}}const GHe=g.memo(function({events:a=[]}){return a.length?e.jsx("div",{className:"flex items-center gap-3 overflow-x-auto py-2 px-3",children:a.slice(-15).reverse().map((n,s)=>{const o=VHe[n.type]||wt,c=XHe[n.type]||"text-text-3",l=ZHe(n);return e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx(o,{size:11,className:c}),e.jsx("span",{className:"text-xs font-sans text-text-2 whitespace-nowrap",children:l}),e.jsx("span",{className:"text-2xs font-mono text-text-4",children:Mt(n.t||n.timestamp)})]},s)})}):e.jsx("div",{className:"text-xs text-text-3 font-mono py-2.5 text-center",children:"No recent activity"})});function Xn({className:t,...a}){return e.jsx("div",{className:V("rounded-md bg-surface-4","bg-gradient-to-r from-surface-4 via-surface-5 to-surface-4","bg-[length:200%_100%] animate-[shimmer_1.5s_ease-in-out_infinite]",t),...a})}function WHe(){return e.jsxs("div",{className:"flex-1 grid gap-px p-0",style:{gridTemplateRows:"auto minmax(0, 1fr) minmax(0, 1fr)",gridTemplateColumns:"2fr 2.5fr 1.5fr",background:"#282c34"},children:[e.jsx("div",{className:"col-span-3",children:e.jsx(Xn,{className:"h-[72px] rounded-none"})}),e.jsx(Xn,{className:"rounded-none"}),e.jsx(Xn,{className:"rounded-none"}),e.jsx(Xn,{className:"rounded-none"}),e.jsx(Xn,{className:"rounded-none"}),e.jsx("div",{className:"col-span-2",children:e.jsx(Xn,{className:"h-full rounded-none"})})]})}function KHe(){const{data:t,loading:a,agents:n,connected:s,kpiHistory:o,lastFetch:c,agentBreakdown:l,routing:A,rotation:u,adaptive:f,journalist:x,rotating:m,teamBurn:y,memory:v}=vHe(),O=$(P=>P.teams),b=n.filter(P=>P.status==="running").length;if(!s)return e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-2 text-text-3 font-mono",children:[e.jsx(hs,{size:28,className:"mx-auto"}),e.jsx("p",{className:"text-xs",children:"Connecting to daemon..."})]})});if(a||!t)return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(QX,{connected:s,runningCount:0,totalCount:0,uptime:0,lastFetch:0}),e.jsx(WHe,{})]});const C=t.tokens||{},j={totalTokens:C.totalTokens||0,totalCostUsd:C.totalCostUsd||0,totalInputTokens:C.totalInputTokens||0,totalOutputTokens:C.totalOutputTokens||0,cacheReadTokens:C.cacheReadTokens||0,cacheCreationTokens:C.cacheCreationTokens||0,cacheHitRate:C.cacheHitRate||0,totalTurns:C.totalTurns||0,agentCount:C.agentCount||0,savings:C.savings||{},internalOverhead:C.internalOverhead||{tokens:0,costUsd:0,components:{}}},N=j.totalOutputTokens>0?(j.totalInputTokens/j.totalOutputTokens).toFixed(1):"—",M=(u==null?void 0:u.totalRotations)||0,Q=(l||[]).filter(P=>{var F;return((F=P.quality)==null?void 0:F.score)!=null}),L=Q.length>0?Math.round(Q.reduce((P,F)=>P+F.quality.score,0)/Q.length):null,B=t.timeline||{},S=B.snapshots||[],I=B.events||t.events||[],z=[{label:"Tokens Used",value:pt(j.totalTokens),sparkData:o.tokens,color:te.accent,hint:"Total tokens consumed across all agents — input, output, and cache tokens combined."},{label:"Total Cost",value:Ai(j.totalCostUsd),sparkData:o.cost,color:te.warning,hint:"Actual cost reported by providers. Claude Code reports real billing; other providers use estimated rates."},{label:"Quality",value:L!=null?`${L}`:"—",sparkData:o.saved,color:L>=70?te.success:L>=40?te.warning:te.danger,hint:"Average session quality score (0-100) across running agents. Based on error rate, repetitions, file churn, and tool success. Below 40 triggers auto-rotation."},{label:"Cache Rate",value:us(j.cacheHitRate*100),sparkData:o.cache,color:te.info,hint:"Percentage of input tokens served from prompt cache. Higher = faster responses and lower cost. Managed by your AI provider."},{label:"Rotations",value:`${M}`,sparkData:o.efficiency,color:te.purple,hint:"Total context rotations — includes quality-based (auto), context threshold, natural compaction (provider-managed), and manual rotations."},{label:"I/O Ratio",value:`${N}:1`,sparkData:o.inputOutput,color:te.orange,hint:"Ratio of input to output tokens. High ratios mean agents are reading more than writing — common for analysis tasks."},{label:"Agents",value:`${b}/${n.length}`,sparkData:o.agents,color:te.accent,hint:"Running agents out of total spawned this session (including completed and crashed)."},{label:"Turns",value:pt(j.totalTurns),sparkData:o.turns,color:te.text2,hint:"Total conversation turns across all agents. Each turn is one request-response cycle with the AI provider."}];return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(QX,{connected:s,runningCount:b,totalCount:n.length,uptime:t.uptime||0,lastFetch:c,activeTeam:t.activeTeam}),e.jsx(bHe,{kpis:z}),e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",style:{background:"#282c34",gap:"1px"},children:[e.jsxs("div",{className:"min-h-0 flex-1 grid",style:{gridTemplateColumns:"3fr 1.5fr 1.5fr",gap:"0 1px"},children:[e.jsx("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 relative",children:e.jsx(SHe,{data:S})}),e.jsxs("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-l border-border",children:[e.jsx("div",{className:"px-3 pt-2.5 pb-1",children:e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Cache Performance"})}),e.jsx(QHe,{cacheRead:j.cacheReadTokens,cacheCreation:j.cacheCreationTokens,totalInput:j.totalInputTokens})]}),e.jsxs("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-l border-border",children:[e.jsx("div",{className:"px-3 pt-2.5 pb-1",children:e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Model Routing"})}),e.jsx(BHe,{routing:A,agentBreakdown:l})]})]}),e.jsxs("div",{className:"min-h-0 flex-1 grid",style:{gridTemplateColumns:"2fr 2.5fr 1.5fr",gap:"0 1px"},children:[e.jsxs("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-t border-border",children:[e.jsx("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0",children:e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Agent Fleet"})}),e.jsx(MHe,{agentBreakdown:l,rotating:m,teams:O})]}),e.jsx("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-t border-l border-border",children:e.jsx(qHe,{tokens:j,rotation:u,adaptive:f,journalist:x,agentBreakdown:l,memory:v})}),e.jsx("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-t border-l border-border",children:e.jsx(DHe,{teams:y})})]})]}),e.jsx("div",{className:"flex-shrink-0 bg-surface-1 border-t border-border",children:e.jsx(GHe,{events:I})})]})}const TX={sm:12,md:16,lg:20};function YHe({fill:t="full",size:a,color:n="#fbbf24",emptyColor:s="rgba(255,255,255,0.4)"}){const o=`star-${Math.random().toString(36).slice(2,8)}`;return e.jsxs("svg",{width:a,height:a,viewBox:"0 0 20 20",fill:"none",children:[t==="half"&&e.jsx("defs",{children:e.jsxs("linearGradient",{id:o,children:[e.jsx("stop",{offset:"50%",stopColor:n}),e.jsx("stop",{offset:"50%",stopColor:s})]})}),e.jsx("path",{d:"M10 1.5l2.47 5.01 5.53.8-4 3.9.94 5.49L10 14.27 5.06 16.7 6 11.21l-4-3.9 5.53-.8L10 1.5z",fill:t==="full"?n:t==="half"?`url(#${o})`:s})]})}function dee({rating:t=0,count:a,size:n="sm"}){const s=TX[n]||TX.sm,o=[];for(let c=1;c<=5;c++)t>=c?o.push("full"):t>=c-.5?o.push("half"):o.push("empty");return e.jsxs("span",{className:"inline-flex items-center",style:{gap:1},children:[o.map((c,l)=>e.jsx(YHe,{fill:c,size:s},l)),a!=null&&e.jsxs("span",{className:"ml-1 text-[11px] text-[var(--text-dim,#6b7f95)] font-sans",children:["(",a,")"]})]})}const $X={design:{color:"#c678dd",bg:"rgba(198,120,221,0.12)"},quality:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},devtools:{color:"#33afbc",bg:"rgba(51,175,188,0.14)"},workflow:{color:"#fbbf24",bg:"rgba(251,191,36,0.12)"},security:{color:"#f87171",bg:"rgba(248,113,113,0.12)"},specialized:{color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},verified:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},anthropic:{color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},published:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},draft:{color:"#6b7f95",bg:"rgba(255,255,255,0.06)"},review:{color:"#c678dd",bg:"rgba(198,120,221,0.12)"},rejected:{color:"#f87171",bg:"rgba(248,113,113,0.12)"},free:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"}};function Aee({label:t,variant:a,className:n}){const s=$X[a]||$X.draft;return e.jsx("span",{className:V("inline-flex items-center whitespace-nowrap font-sans select-none",n),style:{padding:"3px 8px",borderRadius:4,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",lineHeight:1.4,color:s.color,background:s.bg},children:t})}function uee({price:t=0,size:a="sm"}){const n=!t||t===0,s={sm:"text-2xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-xs px-3 py-1"};return e.jsx("span",{className:`inline-flex items-center font-mono font-semibold rounded whitespace-nowrap ${s[a]||s.sm} ${n?"bg-success/12 text-success":"bg-white/8 text-text-1"}`,children:n?"Free":`$${t.toFixed(2)}`})}function hee({type:t="verified",size:a=12}){const n=t==="claude-official"||t==="anthropic"?"#f59e0b":"#4ade80";return e.jsxs("svg",{width:a,height:a,viewBox:"0 0 20 20",fill:"none",className:"inline-block flex-shrink-0",children:[e.jsx("path",{d:"M10 0l2.36 3.15L16.18 2l.68 3.93L20.8 7.1l-1.87 3.52L20.8 14.14l-3.94 1.17-.68 3.93-3.82-1.15L10 21.24l-2.36-3.15-3.82 1.15-.68-3.93-3.94-1.17 1.87-3.52L-.8 7.1l3.94-1.17.68-3.93 3.82 1.15L10 0z",fill:n}),e.jsx("path",{d:"M7 10.5l2 2 4-4.5",fill:"none",stroke:"#24282f",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}const pee="groove_favorites";function Fz(){try{return JSON.parse(localStorage.getItem(pee)||"[]")}catch{return[]}}function JHe(t){return Fz().includes(t)}function eqe(t){const a=Fz(),n=a.indexOf(t);return n>=0?a.splice(n,1):a.push(t),localStorage.setItem(pee,JSON.stringify(a)),n<0}function tqe(t){const a=new Set(Fz());return t.map(n=>({...n,favorited:a.has(n.id)}))}function aqe({filled:t,size:a=16}){return e.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:t?"#f87171":"none",stroke:t?"#f87171":"rgba(255,255,255,0.3)",strokeWidth:"2",children:e.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})})}function nqe(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"7 10 12 15 17 10"}),e.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function sqe({skill:t,onClick:a}){var c,l;const[n,s]=g.useState(()=>JHe(t.id));function o(A){A.stopPropagation(),s(eqe(t.id))}return e.jsxs("div",{onClick:()=>a==null?void 0:a(t),className:V("flex flex-col cursor-pointer group","bg-surface-1 border border-border-subtle rounded-md","hover:border-accent/30 hover:bg-surface-2","transition-all duration-150"),style:{padding:20,minHeight:280},children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 bg-accent/12 text-[20px]",children:t.icon||((l=(c=t.name)==null?void 0:c[0])==null?void 0:l.toUpperCase())||"?"}),e.jsx("button",{onClick:o,className:"opacity-40 group-hover:opacity-80 hover:!opacity-100 transition-opacity cursor-pointer bg-transparent border-0 p-0",children:e.jsx(aqe,{filled:n})})]}),e.jsx("div",{className:"mt-3 text-[15px] font-semibold text-text-0 font-sans line-clamp-2 leading-snug",children:t.name}),e.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-text-3 font-sans",children:[e.jsxs("span",{children:["by ",t.author||"Community"]}),(t.source==="claude-official"||t.verified)&&e.jsx(hee,{type:t.source,size:12})]}),e.jsx("div",{className:"mt-2.5 text-xs text-text-2 font-sans line-clamp-3 flex-1 leading-relaxed",children:t.description}),e.jsx("div",{className:"mt-3",children:e.jsx(Aee,{label:t.category||"general",variant:t.category||"draft"})}),e.jsx("div",{className:"h-px bg-border-subtle my-3"}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(dee,{rating:t.rating||0,count:t.rating_count||t.ratingCount||0,size:"sm"}),e.jsxs("span",{className:"flex items-center gap-1 text-xs text-text-3 font-mono",children:[e.jsx(nqe,{}),pt(t.downloads||0)]}),e.jsx(uee,{price:t.price||0,size:"sm"})]})]})}function fee(){return e.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md animate-pulse",style:{padding:20,minHeight:280},children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-surface-4"}),e.jsx("div",{className:"mt-3 h-4 w-[70%] rounded bg-surface-4"}),e.jsx("div",{className:"mt-2 h-3 w-[40%] rounded bg-surface-4"}),e.jsx("div",{className:"mt-3.5 h-3 w-full rounded bg-surface-4"}),e.jsx("div",{className:"mt-1.5 h-3 w-[90%] rounded bg-surface-4"}),e.jsx("div",{className:"mt-1.5 h-3 w-[60%] rounded bg-surface-4"}),e.jsx("div",{className:"mt-3.5 h-5 w-[50px] rounded bg-surface-4"}),e.jsx("div",{className:"h-px bg-surface-4 my-3"}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("div",{className:"h-3 w-16 rounded bg-surface-4"}),e.jsx("div",{className:"h-3 w-12 rounded bg-surface-4"}),e.jsx("div",{className:"h-3 w-10 rounded bg-surface-4"})]})]})}const zA={"google-workspace":"https://cdn.simpleicons.org/google/white",slack:"https://cdn.simpleicons.org/slack/E01E5A",discord:"https://cdn.simpleicons.org/discord/5865F2",github:"https://cdn.simpleicons.org/github/white",stripe:"https://cdn.simpleicons.org/stripe/635BFF",gmail:"https://cdn.simpleicons.org/gmail/EA4335","google-calendar":"https://cdn.simpleicons.org/googlecalendar/4285F4","google-drive":"https://cdn.simpleicons.org/googledrive/4285F4","google-docs":"https://cdn.simpleicons.org/googledocs/4285F4","google-sheets":"https://cdn.simpleicons.org/googlesheets/34A853","google-slides":"https://cdn.simpleicons.org/googleslides/FBBC04","google-maps":"https://cdn.simpleicons.org/googlemaps/4285F4",postgres:"https://cdn.simpleicons.org/postgresql/4169E1",notion:"https://cdn.simpleicons.org/notion/white",linear:"https://cdn.simpleicons.org/linear/5E6AD2","brave-search":"https://cdn.simpleicons.org/brave/FB542B","home-assistant":"https://cdn.simpleicons.org/homeassistant/18BCF2",sentry:"https://cdn.simpleicons.org/sentry/362D59",elevenlabs:"https://cdn.simpleicons.org/elevenlabs/white",hubspot:"https://cdn.simpleicons.org/hubspot/FF7A59",jira:"https://cdn.simpleicons.org/jira/0052CC",sendgrid:"https://cdn.simpleicons.org/sendgrid/1A82E2",resend:"https://cdn.simpleicons.org/resend/white",replicate:"https://cdn.simpleicons.org/replicate/white",vercel:"https://cdn.simpleicons.org/vercel/white",supabase:"https://cdn.simpleicons.org/supabase/3FCF8E",mixpanel:"https://cdn.simpleicons.org/mixpanel/7856FF",datadog:"https://cdn.simpleicons.org/datadog/632CA6",airtable:"https://cdn.simpleicons.org/airtable/18BFFF",zendesk:"https://cdn.simpleicons.org/zendesk/03363D",intercom:"https://cdn.simpleicons.org/intercom/6AFDEF",twilio:"https://cdn.simpleicons.org/twilio/F22F46",telnyx:"https://cdn.simpleicons.org/telnyx/00C08B",aws:"https://cdn.simpleicons.org/amazonaws/FF9900",plaid:"https://cdn.simpleicons.org/plaid/white"};function rqe({item:t,size:a=40}){const n=zA[t.id];if(n)return e.jsxs("div",{className:"rounded-md bg-surface-4 flex items-center justify-center flex-shrink-0 overflow-hidden",style:{width:a,height:a},children:[e.jsx("img",{src:n,alt:t.name,className:"w-5 h-5",onError:c=>{c.target.style.display="none",c.target.nextSibling.style.display="flex"}}),e.jsx("div",{className:"hidden items-center justify-center w-full h-full text-lg font-bold font-sans text-text-1",children:(t.name||"?")[0]})]});const s=(t.name||"?")[0].toUpperCase(),o=t.name?t.name.charCodeAt(0)*37%360:200;return e.jsx("div",{className:"rounded-md flex items-center justify-center flex-shrink-0 text-lg font-bold font-sans",style:{width:a,height:a,background:`hsl(${o}, 40%, 18%)`,color:`hsl(${o}, 60%, 65%)`},children:s})}function oT({item:t,onClick:a,className:n,statusBadge:s}){var c;const o=t.installed;return e.jsxs("button",{onClick:()=>a(t),className:V("flex flex-col p-5 rounded-md border border-border-subtle bg-surface-1 text-left","hover:border-accent/30 hover:bg-surface-2","transition-all duration-150 cursor-pointer group",n),style:{minHeight:200},children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx(rqe,{item:t,size:36}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[14px] font-semibold text-text-0 font-sans truncate",children:t.name}),(t.verified||t.verified==="mcp-official")&&e.jsx(Sa,{size:11,className:"text-accent flex-shrink-0"})]}),e.jsx("span",{className:"text-2xs text-text-3 font-sans",children:t.author||"Community"})]})]}),e.jsx("p",{className:"text-xs text-text-2 font-sans line-clamp-3 mb-3 flex-1 leading-relaxed",children:t.description}),e.jsx("div",{className:"h-px bg-border-subtle my-2"}),e.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(_a,{size:10}),pt(t.downloads||0)]}),(t.rating||0)>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(IA,{size:10,className:"text-warning",fill:"currentColor"}),(c=t.rating)==null?void 0:c.toFixed(1)]}),e.jsx("span",{className:"flex-1"}),s||o&&e.jsx(be,{variant:"accent",className:"text-2xs",children:t._installedCount?`${t._installedCount} active`:"Installed"})]})]})}function Rz({value:t,onChange:a,placeholder:n="Search skills, tags, authors...",large:s}){const[o,c]=g.useState(t||""),l=g.useRef(null);g.useEffect(()=>{c(t||"")},[t]);function A(u){const f=u.target.value;c(f),clearTimeout(l.current),l.current=setTimeout(()=>a(f),300)}return e.jsxs("div",{className:"relative w-full",children:[e.jsx(oa,{size:16,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"}),e.jsx("input",{value:o,onChange:A,placeholder:n,className:V("w-full font-sans outline-none","bg-surface-0 border border-border text-text-0 placeholder:text-text-4","focus:border-accent/40 transition-colors",s?"py-3 pl-11 pr-12 text-[15px] rounded-lg":"py-2.5 pl-10 pr-3 text-sm rounded-md")}),s&&e.jsx("kbd",{className:"absolute right-3.5 top-1/2 -translate-y-1/2 bg-surface-4 text-text-4 px-2 py-0.5 rounded text-xs font-mono",children:"/"})]})}const oqe=[{id:"",label:"All"},{id:"design",label:"Design"},{id:"quality",label:"Quality"},{id:"devtools",label:"Dev Tools"},{id:"workflow",label:"Workflow"},{id:"security",label:"Security"},{id:"specialized",label:"Specialized"}];function iqe({selected:t="",categories:a=oqe,onSelect:n}){return e.jsx("div",{className:"flex gap-2 overflow-x-auto",style:{scrollbarWidth:"none"},children:a.map(s=>{const o=t===s.id;return e.jsx("button",{onClick:()=>n(s.id),className:V("whitespace-nowrap font-sans cursor-pointer select-none transition-all text-[13px] rounded-full border",o?"bg-accent text-surface-0 border-accent font-semibold":"bg-surface-1 text-text-3 border-border-subtle hover:text-text-1 hover:border-border font-medium"),style:{padding:"7px 16px"},children:s.label},s.id)})})}function ln(){const t=$(a=>a.addToast);return{success:(a,n)=>t("success",a,n),error:(a,n)=>t("error",a,n),info:(a,n)=>t("info",a,n),warning:(a,n)=>t("warning",a,n)}}const cn=g.forwardRef(({className:t,label:a,error:n,mono:s,...o},c)=>e.jsxs("div",{className:"flex flex-col gap-1",children:[a&&e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:a}),e.jsx("input",{ref:c,className:V("h-8 w-full rounded-md px-3 text-sm","bg-surface-1 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","disabled:opacity-40 disabled:cursor-not-allowed","transition-colors duration-100",s?"font-mono":"font-sans",n&&"border-danger focus:ring-danger",t),...o}),n&&e.jsx("span",{className:"text-2xs text-danger font-sans",children:n})]}));cn.displayName="Input";const cqe=g.forwardRef(({className:t,label:a,error:n,mono:s,...o},c)=>e.jsxs("div",{className:"flex flex-col gap-1",children:[a&&e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:a}),e.jsx("textarea",{ref:c,className:V("w-full rounded-md px-3 py-2 text-sm resize-none","bg-surface-1 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","disabled:opacity-40 disabled:cursor-not-allowed","transition-colors duration-100",s?"font-mono":"font-sans",n&&"border-danger focus:ring-danger",t),...o}),n&&e.jsx("span",{className:"text-2xs text-danger font-sans",children:n})]}));cqe.displayName="Textarea";function Hz({item:t,size:a=48}){const n=zA[t.id];if(n)return e.jsx("div",{className:"rounded-lg bg-surface-4 flex items-center justify-center flex-shrink-0 overflow-hidden",style:{width:a,height:a},children:e.jsx("img",{src:n,alt:t.name,className:"w-6 h-6",onError:c=>{c.target.style.display="none"}})});const s=(t.name||"?")[0].toUpperCase(),o=t.name?t.name.charCodeAt(0)*37%360:200;return e.jsx("div",{className:"rounded-lg flex items-center justify-center flex-shrink-0 text-xl font-bold font-sans",style:{width:a,height:a,background:`hsl(${o}, 40%, 18%)`,color:`hsl(${o}, 60%, 65%)`},children:s})}function kE({value:t,onChange:a,placeholder:n,disabled:s}){const[o,c]=g.useState(!1);return e.jsxs("div",{className:"relative",children:[e.jsx(cn,{type:o?"text":"password",value:t,onChange:l=>a(l.target.value),placeholder:n,disabled:s,mono:!0,className:"pr-9"}),e.jsx("button",{type:"button",onClick:()=>c(l=>!l),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded text-text-4 hover:text-text-1 transition-colors cursor-pointer",tabIndex:-1,children:o?e.jsx(jn,{size:14}):e.jsx(na,{size:14})})]})}function lqe({integrationId:t,envKey:a,onSaved:n}){const s=ln(),[o,c]=g.useState(""),[l,A]=g.useState(!1),[u,f]=g.useState(a.set),[x,m]=g.useState(!1);async function y(){if(o.trim()){A(!0);try{await D.post(`/integrations/${t}/credentials`,{key:a.key,value:o.trim()}),f(!0),c(""),s.success(`${a.label} saved`),n==null||n()}catch(O){s.error("Failed to save",O.message)}A(!1)}}async function v(){m(!0);try{await D.delete(`/integrations/${t}/credentials/${a.key}`),f(!1),s.success(`${a.label} removed`),n==null||n()}catch(O){s.error("Failed to remove",O.message)}m(!1)}return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("label",{className:"text-xs font-medium text-text-2 font-sans flex items-center gap-1.5",children:[e.jsx(ws,{size:11,className:"text-text-4"}),a.label,a.required&&e.jsx("span",{className:"text-danger",children:"*"})]}),u&&e.jsxs("span",{className:"flex items-center gap-1 text-2xs text-success font-sans",children:[e.jsx(De,{size:10})," Set"]})]}),u?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-8 rounded-md px-3 bg-surface-2 border border-border-subtle flex items-center",children:e.jsx("span",{className:"text-xs text-text-4 font-mono tracking-widest",children:"*".repeat(16)})}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:v,disabled:x,className:"text-text-3 hover:text-danger",children:x?e.jsx($e,{size:12,className:"animate-spin"}):e.jsx(At,{size:12})})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(kE,{value:o,onChange:c,placeholder:a.placeholder||`Enter ${a.label.toLowerCase()}...`,disabled:l})}),e.jsx(fe,{variant:"primary",size:"sm",onClick:y,disabled:l||!o.trim(),children:l?e.jsx($e,{size:12,className:"animate-spin"}):"Save"})]})]})}function dqe({item:t,status:a,installing:n,onInstall:s,onUninstall:o,onNext:c}){var A;const l=a==null?void 0:a.installed;return e.jsxs("div",{className:"px-5 py-5 space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx(Hz,{item:t,size:52}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-bold text-text-0 font-sans",children:t.name}),(t.verified==="mcp-official"||t.verified==="verified")&&e.jsxs(be,{variant:"accent",className:"text-2xs gap-1",children:[e.jsx(La,{size:9})," Verified"]})]}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-0.5",children:t.author||"Community"}),t.category&&e.jsx(be,{variant:"default",className:"text-2xs mt-2",children:t.category})]})]}),e.jsx("p",{className:"text-sm text-text-2 font-sans leading-relaxed",children:t.description}),((A=t.tags)==null?void 0:A.length)>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.tags.map(u=>e.jsx("span",{className:"text-2xs text-text-3 font-sans px-2 py-0.5 rounded bg-surface-4",children:u},u))}),e.jsx("div",{className:"h-px bg-border-subtle"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[e.jsx(Sa,{size:16,className:"text-success"}),e.jsx("span",{className:"text-sm font-medium text-success font-sans",children:"Installed"})]}),e.jsxs(fe,{variant:"ghost",size:"sm",onClick:o,className:"text-text-3 hover:text-danger gap-1.5",children:[e.jsx(At,{size:12})," Uninstall"]}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:c,className:"gap-1",children:["Configure ",e.jsx(Rt,{size:12})]})]}):e.jsx(fe,{variant:"primary",size:"lg",onClick:s,disabled:n,className:"w-full gap-2",children:n?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:14,className:"animate-spin"}),"Installing..."]}):"Install"}),n&&e.jsx("p",{className:"text-2xs text-text-4 font-sans text-center",children:"This may take up to 30 seconds..."})]})}const Aqe={gmail:"Gmail API","google-calendar":"Google Calendar API","google-drive":"Google Drive API","google-docs":"Google Docs API","google-sheets":"Google Sheets API","google-slides":"Google Slides API"};function xee({integrationId:t,onConfigured:a}){const n=ln(),[s,o]=g.useState(""),[c,l]=g.useState(""),[A,u]=g.useState(!1),f=Aqe[t]||"the relevant Google API";async function x(){if(!(!s.trim()||!c.trim())){u(!0);try{await D.post("/integrations/google-oauth/setup",{clientId:s.trim(),clientSecret:c.trim()}),n.success("Google OAuth credentials saved"),a()}catch(y){n.error("Failed to save",y.message)}u(!1)}}const m=[{text:"Go to the Google Cloud Console and sign in with your Google account",link:{url:"https://console.cloud.google.com",label:"Open Google Cloud Console"}},{text:"Create a new project (or select an existing one). Any name is fine — this is just a container for your credentials."},{text:e.jsxs(e.Fragment,{children:["Enable the ",e.jsx("strong",{children:f})," — search for it in the API Library and click ",e.jsx("strong",{children:"Enable"})]}),link:{url:"https://console.cloud.google.com/apis/library",label:"Open API Library"}},{text:e.jsxs(e.Fragment,{children:["Go to ",e.jsx("strong",{children:"Credentials"})," and click ",e.jsx("strong",{children:"Create Credentials"})," → ",e.jsx("strong",{children:"OAuth client ID"})]}),link:{url:"https://console.cloud.google.com/apis/credentials",label:"Open Credentials page"}},{text:e.jsxs(e.Fragment,{children:["If prompted to configure the consent screen, choose ",e.jsx("strong",{children:"External"}),', fill in an app name (e.g. "Groove"), your email, and save. You can skip optional fields.']})},{text:e.jsxs(e.Fragment,{children:["Go to ",e.jsx("strong",{children:"Audience"})," and click ",e.jsx("strong",{children:"Publish App"}),". Then scroll down to ",e.jsx("strong",{children:"Test users"}),", click ",e.jsx("strong",{children:"Add Users"}),", enter your Google email address, and save."]})},{text:e.jsxs(e.Fragment,{children:["For Application type, choose ",e.jsx("strong",{children:"Desktop app"})," (not Web application). Give it any name."]})},{text:e.jsxs(e.Fragment,{children:["Click ",e.jsx("strong",{children:"Create"}),", then copy the ",e.jsx("strong",{children:"Client ID"})," and ",e.jsx("strong",{children:"Client Secret"})," and paste them below."]})}];return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-surface-2 rounded-md px-4 py-3 space-y-3",children:[e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"How to get your Google credentials"}),e.jsx("ol",{className:"space-y-2.5",children:m.map((y,v)=>e.jsxs("li",{className:"flex gap-2.5 text-xs text-text-2 font-sans leading-relaxed",children:[e.jsxs("span",{className:"text-accent font-mono font-bold flex-shrink-0 w-4 text-right",children:[v+1,"."]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{children:y.text}),y.link&&e.jsxs("a",{href:y.link.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-2xs text-accent font-sans hover:underline mt-0.5",children:[e.jsx(ma,{size:9}),y.link.label]}),y.copyable&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[e.jsx("code",{className:"flex-1 min-w-0 text-2xs font-mono text-accent bg-surface-4 px-2.5 py-1.5 rounded select-all break-all",children:y.copyable}),e.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(y.copyable)},className:"flex-shrink-0 p-1.5 rounded text-text-3 hover:text-accent hover:bg-accent/10 transition-colors cursor-pointer",title:"Copy to clipboard",children:e.jsx(wn,{size:12})})]})]})]},v))})]}),e.jsx("div",{className:"bg-accent/8 border border-accent/15 rounded-md px-4 py-2.5",children:e.jsxs("p",{className:"text-2xs text-text-2 font-sans leading-relaxed",children:[e.jsx("strong",{className:"text-text-1",children:"One-time setup"})," — these same credentials work for Gmail, Calendar, Drive, Docs, Sheets, and Slides. You only need to do this once. For each integration, just enable the matching API in your Google Cloud project."]})}),e.jsx("div",{className:"bg-warning/8 border border-warning/15 rounded-md px-4 py-2.5",children:e.jsxs("p",{className:"text-2xs text-text-2 font-sans leading-relaxed",children:[e.jsx("strong",{className:"text-text-1",children:'Google "unverified app" warning'})," — when signing in, Google may show a warning that the app isn't verified. This is normal for personal OAuth apps. Click ",e.jsx("strong",{children:"Advanced"}),", then ",e.jsx("strong",{children:"Go to [your app name] (unsafe)"})," to continue. Your credentials stay local and are never sent to Groove servers."]})}),e.jsx("div",{className:"h-px bg-border-subtle"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("label",{className:"text-xs font-medium text-text-2 font-sans flex items-center gap-1.5",children:[e.jsx(ws,{size:11,className:"text-text-4"}),"Client ID ",e.jsx("span",{className:"text-danger",children:"*"})]}),e.jsx(kE,{value:s,onChange:o,placeholder:"123456789.apps.googleusercontent.com",disabled:A})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("label",{className:"text-xs font-medium text-text-2 font-sans flex items-center gap-1.5",children:[e.jsx(ws,{size:11,className:"text-text-4"}),"Client Secret ",e.jsx("span",{className:"text-danger",children:"*"})]}),e.jsx(kE,{value:c,onChange:l,placeholder:"GOCSPX-...",disabled:A})]})]}),e.jsx(fe,{variant:"primary",size:"lg",onClick:x,disabled:A||!s.trim()||!c.trim(),className:"w-full gap-2",children:A?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:14,className:"animate-spin"})," Saving..."]}):"Save Credentials"})]})}function uqe({item:t,status:a,onDone:n,onRefreshStatus:s}){var C;const o=ln(),[c,l]=g.useState(!1),[A,u]=g.useState(null),f=t.authType,x=f==="google-autoauth"||f==="oauth-google";g.useEffect(()=>{x&&D.get("/integrations/google-oauth/status").then(j=>u(j.configured)).catch(()=>u(!1))},[x]);const m=g.useRef(null);g.useEffect(()=>()=>{m.current&&clearInterval(m.current)},[]);async function y(){l(!0);try{const j=await D.post(`/integrations/${t.id}/oauth/start`);if(j.url){const N=await AZ(j.url);if(N!=null&&N.error){o.error("Sign-in failed",N.error),l(!1);return}o.success("Browser opened — complete sign-in there");let M=0;m.current&&clearInterval(m.current),m.current=setInterval(async()=>{if(M+=2e3,M>6e4){clearInterval(m.current),m.current=null,l(!1);return}try{const Q=await D.get(`/integrations/${t.id}/status`);((Q==null?void 0:Q.envKeys)||[]).some(S=>S.key==="GOOGLE_REFRESH_TOKEN"&&S.set)&&(clearInterval(m.current),m.current=null,o.success("Connected!",`${t.name} is now authenticated`),s(),l(!1))}catch{}},2e3)}}catch(j){o.error("Sign-in failed",j.message),l(!1)}}const v=(a==null?void 0:a.envKeys)||[],O=v.filter(j=>j.required&&!j.hidden),b=O.length===0||O.every(j=>j.set);return e.jsxs("div",{className:"px-5 py-5 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Hz,{item:t,size:36}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-sm font-bold text-text-0 font-sans",children:["Configure ",t.name]}),e.jsx("p",{className:"text-2xs text-text-3 font-sans",children:"Set up credentials to connect"})]})]}),((C=t.setupSteps)==null?void 0:C.length)>0&&!(x&&A===!1)&&e.jsxs("div",{className:"bg-surface-2 rounded-md px-4 py-3 space-y-2",children:[e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"Setup guide"}),e.jsx("ol",{className:"space-y-1.5",children:t.setupSteps.map((j,N)=>e.jsxs("li",{className:"flex gap-2 text-xs text-text-2 font-sans leading-relaxed",children:[e.jsxs("span",{className:"text-text-4 font-mono flex-shrink-0 w-4 text-right",children:[N+1,"."]}),e.jsx("span",{children:j})]},N))}),t.setupUrl&&e.jsxs("a",{href:t.setupUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent font-sans hover:underline mt-1",children:[e.jsx(ma,{size:11}),new URL(t.setupUrl).hostname]})]}),!(x&&A===!1)&&e.jsx("div",{className:"h-px bg-border-subtle"}),f==="api-key"&&e.jsx("div",{className:"space-y-4",children:v.filter(j=>!j.hidden).map(j=>e.jsx(lqe,{integrationId:t.id,envKey:j,onSaved:s},j.key))}),x&&A===!1&&e.jsx(xee,{integrationId:t.id,onConfigured:()=>u(!0)}),x&&A&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(fe,{variant:"primary",size:"lg",onClick:y,disabled:c,className:"w-full gap-2",children:c?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:14,className:"animate-spin"}),"Opening browser..."]}):e.jsxs(e.Fragment,{children:[e.jsx("img",{src:"https://cdn.simpleicons.org/google/white",alt:"",className:"w-4 h-4"}),"Sign in with Google"]})}),e.jsxs("p",{className:"text-2xs text-text-4 font-sans text-center",children:["A browser window will open — sign in and allow access to your ",t.name]}),e.jsx("button",{type:"button",onClick:()=>u(!1),className:"w-full text-2xs text-text-4 font-sans hover:text-text-2 transition-colors cursor-pointer py-1",children:"Reconfigure Google OAuth credentials"})]}),x&&A===null&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsx($e,{size:16,className:"animate-spin text-text-4"})}),e.jsx(fe,{variant:b?"primary":"secondary",size:"lg",onClick:n,className:"w-full gap-1.5",children:b?e.jsxs(e.Fragment,{children:[e.jsx(De,{size:14}),"Done"]}):"Skip for now"})]})}function hqe({item:t,onClose:a}){return e.jsxs("div",{className:"px-5 py-10 flex flex-col items-center text-center space-y-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-success/15 flex items-center justify-center",children:e.jsx(Sa,{size:28,className:"text-success"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-text-0 font-sans",children:"Integration ready"}),e.jsxs("p",{className:"text-sm text-text-3 font-sans mt-1",children:[t.name," is installed and configured. Agents can now use it."]})]}),e.jsx(fe,{variant:"primary",size:"lg",onClick:a,className:"mt-2",children:"Close"})]})}function mee({integration:t,open:a,onClose:n}){const s=ln(),[o,c]=g.useState("overview"),[l,A]=g.useState(null),[u,f]=g.useState(!1),[x,m]=g.useState(!0),y=t==null?void 0:t.id,v=g.useCallback(async()=>{if(y){try{const N=await D.get(`/integrations/${y}/status`);A(N)}catch{A(null)}m(!1)}},[y]);g.useEffect(()=>{a&&t&&(c("overview"),m(!0),v())},[a,t,v]);async function O(){f(!0);try{await D.post(`/integrations/${t.id}/install`),s.success(`${t.name} installed`),await v(),c("configure")}catch(N){s.error("Install failed",N.message)}f(!1)}async function b(){try{await D.delete(`/integrations/${t.id}`),s.success(`${t.name} uninstalled`),await v()}catch(N){s.error("Uninstall failed",N.message)}}function C(){c("configure")}function j(){c("done")}return t?e.jsx(Ut,{open:a,onOpenChange:N=>{N||n()},children:e.jsx(Pt,{title:o==="overview"?t.name:o==="configure"?"Configure":"Complete",description:`Setup wizard for ${t.name}`,className:"max-w-md",children:x?e.jsx("div",{className:"px-5 py-10 flex items-center justify-center",children:e.jsx($e,{size:20,className:"animate-spin text-text-4"})}):o==="overview"?e.jsx(dqe,{item:t,status:l,installing:u,onInstall:O,onUninstall:b,onNext:C}):o==="configure"?e.jsx(uqe,{item:t,status:l,onDone:j,onRefreshStatus:v}):e.jsx(hqe,{item:t,onClose:n})})}):null}const pqe=["gmail","google-calendar","google-drive","google-docs","google-sheets","google-slides"];function fqe({item:t,status:a,onInstall:n,onUninstall:s,busy:o}){const c=a==null?void 0:a.installed,l=a==null?void 0:a.authenticated;return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-2 border border-border-subtle",children:[e.jsx(Hz,{item:t,size:32}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans",children:t.name}),e.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:t.description})]}),c&&l&&!(a!=null&&a.needsReauth)&&e.jsxs(be,{variant:"success",className:"text-2xs flex-shrink-0 gap-1",children:[e.jsx(De,{size:8})," Ready"]}),c&&l&&(a==null?void 0:a.needsReauth)&&e.jsxs(be,{variant:"warning",className:"text-2xs flex-shrink-0 gap-1",children:[e.jsx(ra,{size:8})," Update"]}),c&&!l&&e.jsx(be,{variant:"warning",className:"text-2xs flex-shrink-0",children:"Needs sign-in"}),e.jsx(fe,{variant:c?"ghost":"primary",size:"sm",onClick:()=>c?s(t.id):n(t.id),disabled:o===t.id,className:c?"text-text-3 hover:text-danger":"",children:o===t.id?e.jsx($e,{size:12,className:"animate-spin"}):c?e.jsx(At,{size:12}):"Install"})]})}function xqe({integrations:t,open:a,onClose:n}){const s=ln(),[o,c]=g.useState(null),[l,A]=g.useState({}),[u,f]=g.useState(null),[x,m]=g.useState(!1),[y,v]=g.useState(!0),O=g.useRef(null),b=t.filter(S=>pqe.includes(S.id)),C=g.useCallback(async()=>{const S={};await Promise.all(b.map(async I=>{try{S[I.id]=await D.get(`/integrations/${I.id}/status`)}catch{S[I.id]=null}})),A(S),v(!1)},[b.map(S=>S.id).join(",")]);g.useEffect(()=>(a&&(v(!0),D.get("/integrations/google-oauth/status").then(S=>c(S.configured)).catch(()=>c(!1)),C()),()=>{O.current&&clearInterval(O.current)}),[a]);const j=Object.entries(l).filter(([,S])=>S==null?void 0:S.installed).map(([S])=>S),N=j.length>0&&j.every(S=>{var I;return(I=l[S])==null?void 0:I.authenticated});j.some(S=>{var I;return!((I=l[S])!=null&&I.authenticated)});const M=N&&j.some(S=>{var I;return(I=l[S])==null?void 0:I.needsReauth});async function Q(S){var I;f(S);try{await D.post(`/integrations/${S}/install`),s.success(`${(I=b.find(z=>z.id===S))==null?void 0:I.name} installed`),await C()}catch(z){s.error("Install failed",z.message)}f(null)}async function L(S){var I;f(S);try{await D.delete(`/integrations/${S}`),s.success(`${(I=b.find(z=>z.id===S))==null?void 0:I.name} removed`),await C()}catch(z){s.error("Uninstall failed",z.message)}f(null)}async function B(){if(!j.length){s.error("Install at least one service first");return}m(!0);try{const S=await D.post("/integrations/google-workspace/oauth/start",{integrationIds:j});if(S.url){const I=await AZ(S.url);if(I!=null&&I.error){s.error("Sign-in failed",I.error),m(!1);return}s.success("Browser opened — complete sign-in there"),O.current&&clearInterval(O.current),O.current=setInterval(async()=>{await C()},3e3),setTimeout(()=>{O.current&&clearInterval(O.current)},18e4)}}catch(S){s.error("Sign-in failed",S.message)}m(!1)}return g.useEffect(()=>{N&&O.current&&(clearInterval(O.current),O.current=null)},[N]),a?e.jsx(Ut,{open:a,onOpenChange:S=>{S||n()},children:e.jsx(Pt,{title:"Google Workspace",description:"Connect your Google services",className:"max-w-md",children:e.jsxs("div",{className:"px-5 py-5 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-11 h-11 rounded-lg bg-surface-4 flex items-center justify-center flex-shrink-0",children:e.jsx("img",{src:"https://cdn.simpleicons.org/google/white",alt:"Google",className:"w-6 h-6"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold text-text-0 font-sans",children:"Google Workspace"}),e.jsx("p",{className:"text-2xs text-text-3 font-sans",children:"One set of credentials for all Google services"})]})]}),o===!1&&e.jsx(xee,{integrationId:"gmail",onConfigured:()=>c(!0)}),o===null&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsx($e,{size:16,className:"animate-spin text-text-4"})}),o&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-text-2 font-sans",children:"Services"}),e.jsx("div",{className:"space-y-1.5",children:y?Array.from({length:4}).map((S,I)=>e.jsx("div",{className:"h-14 rounded-md bg-surface-2 animate-pulse"},I)):b.map(S=>e.jsx(fqe,{item:S,status:l[S.id],onInstall:Q,onUninstall:L,busy:u},S.id))})]}),e.jsx("div",{className:"h-px bg-border-subtle"}),j.length>0&&!N&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(fe,{variant:"primary",size:"lg",onClick:B,disabled:x,className:"w-full gap-2",children:x?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:14,className:"animate-spin"})," Opening browser..."]}):e.jsxs(e.Fragment,{children:[e.jsx("img",{src:"https://cdn.simpleicons.org/google/white",alt:"",className:"w-4 h-4"}),"Sign in with Google"]})}),e.jsxs("p",{className:"text-2xs text-text-4 font-sans text-center",children:["Connects ",j.length," service",j.length!==1?"s":""," with one sign-in"]})]}),N&&j.length>0&&e.jsxs("div",{className:"flex flex-col items-center text-center gap-2 py-2",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-success/15 flex items-center justify-center",children:e.jsx(Sa,{size:20,className:"text-success"})}),e.jsx("p",{className:"text-sm font-medium text-success font-sans",children:"All services connected"}),e.jsx("p",{className:"text-2xs text-text-3 font-sans",children:"Your agents can now use these Google integrations."}),M?e.jsxs("div",{className:"w-full space-y-2 pt-2",children:[e.jsx("p",{className:"text-2xs text-warning font-sans",children:"New permissions available — re-authenticate to enable all features."}),e.jsx(fe,{variant:"secondary",size:"sm",onClick:B,disabled:x,className:"w-full gap-2",children:x?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:12,className:"animate-spin"})," Opening browser..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ra,{size:12})," Re-authenticate"]})})]}):e.jsx("button",{onClick:B,disabled:x,className:"text-2xs text-text-4 hover:text-text-2 font-sans underline underline-offset-2 transition-colors mt-1",children:x?"Opening browser...":"Re-authenticate"})]}),j.length===0&&!y&&e.jsx("p",{className:"text-xs text-text-4 font-sans text-center py-2",children:"Install at least one service above, then connect with Google."})]}),e.jsx(fe,{variant:"secondary",size:"lg",onClick:n,className:"w-full",children:N&&j.length>0?"Done":"Close"})]})})}):null}const fP=/github\.com\/([^/]+)\/([^/\s#?]+)/;function mqe(){const[t,a]=g.useState("input"),[n,s]=g.useState(""),[o,c]=g.useState(!1),[l,A]=g.useState(null),[u,f]=g.useState("standalone"),[x,m]=g.useState(""),[y,v]=g.useState(!0),[O,b]=g.useState(""),C=$(S=>S.previewRepo),j=$(S=>S.importRepo),N=$(S=>S.importInProgress),M=ln(),Q=g.useCallback(async S=>{const I=S.match(fP);if(I){c(!0);try{const z=await C(S);A(z),b(z.name||I[2]),a("preview")}catch(z){M.error("Preview failed",z.message)}finally{c(!1)}}},[C,M]),L=g.useCallback(S=>{const I=S.target.value;s(I),fP.test(I)&&t==="input"&&Q(I)},[t,Q]),B=g.useCallback(async()=>{if(!l)return;let S;u==="standalone"?S=`~/Projects/${l.name}`:u==="subdirectory"?S=`./packages/${l.name}`:S=x;try{await j(n,S,y,O),M.success(`Importing ${l.name}`,"Setup agent will handle the rest"),a("input"),s(""),A(null)}catch(I){M.error("Import failed",I.message)}},[l,u,x,n,y,O,j,M]);if(t==="input")return e.jsxs("div",{className:"relative",children:[e.jsx(oa,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"}),e.jsx("input",{type:"text",value:n,onChange:L,placeholder:"Paste a GitHub URL...",className:V("w-full h-9 rounded-lg pl-9 pr-20 text-sm font-sans","bg-surface-1 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","transition-colors duration-100")}),e.jsx(fe,{variant:"primary",size:"sm",className:"absolute right-1.5 top-1/2 -translate-y-1/2",onClick:()=>Q(n),disabled:!fP.test(n)||o,children:o?e.jsx($e,{size:12,className:"animate-spin"}):"Preview"})]});if(t==="preview"&&l)return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-lg border border-border-subtle bg-surface-2 p-5",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-accent/8 flex items-center justify-center flex-shrink-0",children:e.jsx(Js,{size:22,className:"text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-1",children:[e.jsx("span",{className:"text-lg font-bold text-text-0 font-sans",children:l.name}),e.jsx("span",{className:"text-xs text-text-4 font-sans",children:l.owner})]}),e.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[l.language&&e.jsx(be,{variant:"outline",className:"text-2xs",children:l.language}),l.stars!=null&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(IA,{size:10,className:"text-warning",fill:"currentColor"}),pt(l.stars)]}),l.license&&e.jsx("span",{children:l.license})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>a("configure"),className:"h-8 text-xs gap-1.5 px-4",children:[e.jsx(ga,{size:13}),"Clone & Setup"]}),e.jsxs(fe,{variant:"ghost",size:"sm",onClick:()=>{try{const S=n.startsWith("http")?n:`https://${n}`,I=new URL(S);(I.protocol==="https:"||I.protocol==="http:")&&window.open(S,"_blank")}catch{}},className:"h-8 text-xs gap-1.5",children:[e.jsx(ma,{size:12}),"GitHub"]}),e.jsx("button",{onClick:()=>{a("input"),A(null)},className:"text-2xs text-text-4 font-sans hover:text-text-2 cursor-pointer bg-transparent border-0 ml-1",children:"Cancel"})]})]})}),l.description&&e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-5 py-4",children:[e.jsx("h4",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-2",children:"About"}),e.jsx("p",{className:"text-sm text-text-1 font-sans leading-relaxed",children:l.description})]}),l.readmePreview&&e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-5 py-4",children:[e.jsx("h4",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-3",children:"README"}),e.jsx("div",{className:"text-sm text-text-2 font-sans leading-relaxed whitespace-pre-wrap",children:l.readmePreview})]})]});if(t==="configure"&&l){const S=[{id:"standalone",icon:Kn,title:"Standalone project",description:"Clone to its own directory, separate from this workspace",path:`~/Projects/${l.name}`},{id:"subdirectory",icon:xu,title:"Workspace package",description:"Add as a package inside this project's monorepo",path:`./packages/${l.name}`},{id:"custom",icon:Eo,title:"Custom location",description:"Choose your own path",path:null}];return e.jsxs("div",{className:"rounded-xl border border-border-subtle bg-surface-2 overflow-hidden",children:[e.jsx("div",{className:"px-5 py-4 border-b border-border-subtle bg-surface-3/50",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-accent/10 flex items-center justify-center flex-shrink-0",children:e.jsx(_a,{size:16,className:"text-accent"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-semibold text-text-0 font-sans",children:["Clone ",l.name]}),e.jsxs("p",{className:"text-2xs text-text-4 font-sans mt-0.5",children:[l.owner,"/",l.name," — configure where to install"]})]})]})}),e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-2.5 block",children:"Install location"}),e.jsx("div",{className:"space-y-2",children:S.map(I=>{const z=I.icon,P=u===I.id;return e.jsx("button",{onClick:()=>f(I.id),className:V("w-full text-left rounded-lg border p-3.5 transition-all duration-150 cursor-pointer",P?"border-accent bg-accent/5 ring-1 ring-accent/30":"border-border-subtle bg-surface-1 hover:border-border hover:bg-surface-1/80"),children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:V("w-8 h-8 rounded-md flex items-center justify-center flex-shrink-0 mt-0.5",P?"bg-accent/15 text-accent":"bg-surface-3 text-text-4"),children:e.jsx(z,{size:15})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:V("text-xs font-semibold font-sans",P?"text-text-0":"text-text-2"),children:I.title}),P&&e.jsx("div",{className:"w-4 h-4 rounded-full bg-accent flex items-center justify-center",children:e.jsx(De,{size:10,className:"text-white"})})]}),e.jsx("p",{className:"text-2xs text-text-4 font-sans mt-0.5 leading-relaxed",children:I.description}),I.path&&P&&e.jsx("code",{className:"text-2xs text-accent/80 font-mono mt-1.5 block truncate",children:I.path})]})]})},I.id)})}),u==="custom"&&e.jsx("div",{className:"mt-2.5 ml-11",children:e.jsx("input",{value:x,onChange:I=>m(I.target.value),placeholder:"/path/to/clone",autoFocus:!0,className:V("w-full h-9 px-3 text-xs font-mono rounded-md","bg-surface-0 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","transition-colors")})})]}),e.jsxs("div",{className:"border-t border-border-subtle pt-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-surface-3 flex items-center justify-center",children:e.jsx(Fa,{size:14,className:"text-text-4"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-semibold text-text-2 font-sans block",children:"Create a team"}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Organize agents working on this repo into their own team"})]})]}),e.jsx("button",{onClick:()=>v(!y),className:V("w-9 h-5 rounded-full p-0.5 transition-colors cursor-pointer flex-shrink-0",y?"bg-accent":"bg-surface-5"),children:e.jsx("div",{className:V("w-4 h-4 rounded-full bg-white shadow-sm transition-transform",y?"translate-x-4":"translate-x-0")})})]}),y&&e.jsx("div",{className:"mt-2.5 ml-11",children:e.jsx("input",{value:O,onChange:I=>b(I.target.value),placeholder:"Team name",className:V("w-full h-9 px-3 text-xs font-sans rounded-md","bg-surface-0 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","transition-colors")})})]})]}),e.jsxs("div",{className:"px-5 py-3.5 border-t border-border-subtle bg-surface-3/30 flex items-center justify-between",children:[e.jsxs("button",{onClick:()=>a("preview"),className:"flex items-center gap-1.5 text-2xs text-text-4 font-sans hover:text-text-2 cursor-pointer bg-transparent border-0 transition-colors",children:[e.jsx(J1,{size:11}),"Back"]}),e.jsx(fe,{variant:"primary",size:"sm",onClick:B,disabled:N||u==="custom"&&!x.trim(),className:"h-8 text-xs gap-1.5 px-5",children:N?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:12,className:"animate-spin"})," Importing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_a,{size:12})," Clone & Setup"]})})]})]})}return null}function gqe({repo:t,onRemove:a,onNuke:n,onOpen:s}){return e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-2 p-3 flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:t.repoName||t.name}),e.jsx("span",{className:"text-2xs text-text-3 font-sans",children:t.repoOwner||t.owner})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[t.language&&e.jsx(be,{variant:"outline",className:"text-2xs",children:t.language}),e.jsx("span",{className:"text-2xs text-text-4 font-mono truncate max-w-[180px]",children:t.clonedTo||t.path})]}),e.jsx("span",{className:"text-2xs text-text-4 font-sans mt-0.5 block",children:t.clonedAt?`Imported ${Mt(t.clonedAt)}`:t.status||""})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s&&e.jsxs("button",{onClick:()=>s(t),className:V("flex items-center gap-1 px-2 py-1 rounded text-2xs font-sans cursor-pointer","text-accent bg-accent/10 hover:bg-accent/20 border-0 transition-colors"),children:[e.jsx(ga,{size:11}),"Open"]}),a&&e.jsxs("button",{onClick:()=>a(t),className:V("flex items-center gap-1 px-2 py-1 rounded text-2xs font-sans cursor-pointer","text-text-3 hover:text-text-1 hover:bg-surface-4 bg-transparent border-0 transition-colors"),children:[e.jsx(At,{size:11}),"Remove"]}),n&&e.jsxs("button",{onClick:()=>n(t),className:V("flex items-center gap-1 px-2 py-1 rounded text-2xs font-sans cursor-pointer","text-danger bg-danger/10 hover:bg-danger/20 border-0 transition-colors"),children:[e.jsx(l0,{size:11}),"Nuke"]})]})]})}function yqe({repo:t,open:a,onClose:n,onConfirm:s}){var x,m,y;const[o,c]=g.useState(!0);if(!t)return null;const l=((x=t.agents)==null?void 0:x.length)||0,A=((m=t.processes)==null?void 0:m.length)||0,u=((y=t.credentialKeys)==null?void 0:y.length)||0,f=t.fileCount||0;return e.jsx(Ut,{open:a,onOpenChange:v=>{v||n()},children:e.jsx(Pt,{title:`Nuke ${t.repoName||t.name}?`,description:"Confirm destructive removal of imported repo",children:e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Gt,{size:16,className:"text-danger flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-sm text-text-1 font-sans",children:"This cannot be undone."})]}),e.jsxs("div",{className:"space-y-1.5 text-xs text-text-2 font-sans",children:[l>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"})," Kill ",l," agent",l!==1?"s":""]}),A>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"})," Stop ",A," process",A!==1?"es":""]}),u>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"})," Remove ",u," credential",u!==1?"s":""]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"}),' Delete team "',t.teamId||t.repoName||t.name,'"']}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"})," Clean all .groove state"]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:v=>c(v.target.checked),className:"accent-[var(--color-danger)]"}),e.jsxs("span",{className:"text-xs text-text-1 font-sans",children:["Delete repo files",f>0?` (${f} files)`:""]})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(fe,{variant:"danger",size:"sm",onClick:()=>s(o),children:"Nuke Everything"}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"})]})]})})})}function gee({skill:t,onBack:a}){var L,B,S;const n=ln(),[s,o]=g.useState(""),[c,l]=g.useState(!1),[A,u]=g.useState(!1),[f,x]=g.useState(!1),[m,y]=g.useState(!1),[v,O]=g.useState(t.installed),[b,C]=g.useState(!0);g.useEffect(()=>{C(!0),D.get(`/skills/${t.id}/content`).then(I=>{o(I.content||""),l(I.requiresPurchase||!1)}).catch(()=>{}).finally(()=>C(!1))},[t.id]);async function j(){u(!0);try{await D.post(`/skills/${t.id}/install`),O(!0),n.success(`${t.name} installed`)}catch(I){n.error("Install failed",I.message)}u(!1)}async function N(){x(!0);try{await D.post(`/skills/${t.id}/update`),n.success(`${t.name} updated to latest`);const I=await D.get(`/skills/${t.id}/content`);I.content&&o(I.content)}catch(I){n.error("Update failed",I.message)}x(!1)}async function M(){y(!0);try{await D.delete(`/skills/${t.id}`),O(!1),n.success(`${t.name} uninstalled`)}catch(I){n.error("Uninstall failed",I.message)}y(!1)}async function Q(){const{marketplaceAuthenticated:I,marketplaceLogin:z,marketplaceCheckout:P}=$.getState();if(!I){z();return}try{await P(t.id)}catch{}}return e.jsx(it,{className:"h-full",children:e.jsxs("div",{className:"px-6 py-5",children:[e.jsxs("button",{onClick:a,className:"flex items-center gap-1 text-xs text-text-3 font-sans hover:text-text-0 cursor-pointer bg-transparent border-0 mb-4",children:[e.jsx(bs,{size:14})," Back"]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-11 h-11 rounded-lg flex items-center justify-center flex-shrink-0 bg-accent/10 border border-accent/20 text-[22px]",children:t.icon||((B=(L=t.name)==null?void 0:L[0])==null?void 0:B.toUpperCase())}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h1",{className:"text-lg font-bold text-text-0 font-sans",children:t.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-xs text-text-3 font-sans",children:[e.jsx("span",{children:t.author||"Community"}),(t.source==="claude-official"||t.verified)&&e.jsx(hee,{type:t.source,size:13})]})]})]}),e.jsx("p",{className:"mt-3 text-sm text-text-2 font-sans leading-relaxed",children:t.description}),((S=t.tags)==null?void 0:S.length)>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:t.tags.map(I=>e.jsx("span",{className:"text-2xs text-text-3 font-sans px-2 py-0.5 rounded bg-surface-4",children:I},I))}),e.jsx("div",{className:"h-px bg-border-subtle my-5"}),b?e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-3 w-48 bg-surface-4 rounded animate-pulse"}),e.jsx("div",{className:"h-3 w-full bg-surface-4 rounded animate-pulse"}),e.jsx("div",{className:"h-3 w-3/4 bg-surface-4 rounded animate-pulse"})]}):s?e.jsxs("div",{className:"text-sm text-text-2 font-sans leading-relaxed",children:[e.jsx("h2",{className:"text-sm font-semibold text-text-0 mb-2",children:"About"}),e.jsx("pre",{className:"whitespace-pre-wrap font-sans",children:s})]}):c?e.jsxs("div",{className:"bg-warning/5 border border-warning/15 rounded-lg px-4 py-3",children:[e.jsx("p",{className:"text-sm text-text-1 font-sans font-medium",children:"Paid skill — purchase to view content"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Sign in and purchase this skill to access its full instructions."})]}):e.jsx("p",{className:"text-xs text-text-4 font-sans",children:"Content loading failed — check your connection."})]}),e.jsx("div",{className:"w-[240px] flex-shrink-0",children:e.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-lg p-4 sticky top-4",children:[e.jsx(uee,{price:t.price||0,size:"md"}),c&&!v?e.jsxs("button",{onClick:Q,className:"w-full mt-3 py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 flex items-center justify-center gap-2 border bg-warning/15 text-warning border-warning/20 hover:bg-warning/25",children:["Buy $",(t.price||0).toFixed(2)]}):v?e.jsxs("div",{className:"mt-3 flex flex-col gap-1.5",children:[e.jsxs("button",{onClick:N,disabled:f,className:"w-full py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border bg-accent/15 text-accent border-accent/20 hover:bg-accent/25",children:[e.jsx(ra,{size:12,className:f?"animate-spin":""}),f?"Updating...":"Pull Latest"]}),e.jsxs("button",{onClick:M,disabled:m,className:"w-full py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border bg-error/10 text-error border-error/20 hover:bg-error/15",children:[e.jsx(At,{size:12}),m?"Removing...":"Uninstall"]})]}):e.jsx("button",{onClick:j,disabled:A,className:"w-full mt-3 py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border bg-accent/15 text-accent border-accent/20 hover:bg-accent/25",children:A?"Installing...":"Install"}),e.jsx("div",{className:"mt-4 flex flex-col gap-2.5",children:[["Downloads",e.jsx("span",{className:"font-mono text-text-0",children:pt(t.downloads||0)},"d")],["Rating",e.jsx(dee,{rating:t.rating||0,count:t.rating_count||t.ratingCount,size:"sm"},"r")],["Version",e.jsx("span",{className:"font-mono text-text-0",children:t.version||"1.0.0"},"v")],["Category",e.jsx(Aee,{label:t.category||"general",variant:t.category||"draft"},"c")],["Source",e.jsx("span",{className:"text-text-0",children:t.source==="claude-official"?"Anthropic":"Community"},"s")]].map(([I,z])=>e.jsxs("div",{className:"flex justify-between items-center text-xs font-sans",children:[e.jsx("span",{className:"text-text-3",children:I}),z]},I))})]})})]})]})})}function vqe(){const[t,a]=g.useState([]),[n,s]=g.useState(!0),[o,c]=g.useState(""),[l,A]=g.useState(""),[u,f]=g.useState("popular"),[x,m]=g.useState(null);return g.useEffect(()=>{s(!0);const y=new URLSearchParams;o&&y.set("search",o),l&&y.set("category",l),u&&y.set("sort",u),D.get(`/skills/registry?${y}`).then(v=>a(tqe(v.skills||v.items||(Array.isArray(v)?v:[])))).catch(()=>a([])).finally(()=>s(!1))},[o,l,u]),x?e.jsx(gee,{skill:x,onBack:()=>m(null)}):e.jsx(it,{className:"h-full",children:e.jsxs("div",{className:"px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-72",children:e.jsx(Rz,{value:o,onChange:c})}),e.jsx(iqe,{selected:l,onSelect:A}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsxs("select",{value:u,onChange:y=>f(y.target.value),className:"appearance-none font-sans cursor-pointer pr-7 py-2 pl-3 text-xs bg-surface-0 border border-border-subtle rounded text-text-1 focus:outline-none",children:[e.jsx("option",{value:"popular",children:"Popular"}),e.jsx("option",{value:"rating",children:"Top Rated"}),e.jsx("option",{value:"newest",children:"Newest"}),e.jsx("option",{value:"name",children:"A-Z"})]}),e.jsx(bt,{size:12,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"})]}),e.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:t.length})]}),e.jsx("div",{className:"mt-4 grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:n?Array.from({length:8}).map((y,v)=>e.jsx(fee,{},v)):t.map(y=>e.jsx(sqe,{skill:y,onClick:m},y.id))}),!n&&t.length===0&&e.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No skills found."})]})})}const IX=new Set(["gmail","google-calendar","google-drive","google-docs","google-sheets","google-slides"]);function kqe(){const[t,a]=g.useState([]),[n,s]=g.useState(!0),[o,c]=g.useState(""),[l,A]=g.useState(null),[u,f]=g.useState(!1),[x,m]=g.useState(!1),y=()=>{s(!0),D.get(`/integrations/registry?search=${encodeURIComponent(o)}`).then(M=>a(M.integrations||M.items||(Array.isArray(M)?M:[]))).catch(()=>a([])).finally(()=>s(!1))};g.useEffect(()=>{y()},[o]);const v=t.filter(M=>IX.has(M.id)),O=t.filter(M=>!IX.has(M.id)),b=v.filter(M=>M.installed).length;function C(M){A(M),f(!0)}function j(){f(!1),A(null),y()}const N=!o||"google workspace gmail calendar drive docs sheets slides".includes(o.toLowerCase());return e.jsxs(it,{className:"h-full",children:[e.jsxs("div",{className:"px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-72",children:e.jsx(Rz,{value:o,onChange:c,placeholder:"Search integrations..."})}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:O.length+(v.length>0?1:0)})]}),e.jsx("div",{className:"mt-4 grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:n?Array.from({length:6}).map((M,Q)=>e.jsx(fee,{},Q)):e.jsxs(e.Fragment,{children:[v.length>0&&N&&e.jsx(oT,{item:{id:"google-workspace",name:"Google Workspace",description:"Gmail, Calendar, Drive, Docs, Sheets, Slides — one sign-in for all",category:"productivity",tags:["google","email","calendar","drive","docs"],verified:"mcp-official",installed:b>0,_installedCount:b},onClick:()=>m(!0)},"google-workspace"),O.map(M=>e.jsx(oT,{item:M,onClick:()=>C(M)},M.id))]})}),!n&&O.length===0&&v.length===0&&e.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No integrations found."})]}),e.jsx(mee,{integration:l,open:u,onClose:j}),e.jsx(xqe,{integrations:t,open:x,onClose:()=>{m(!1),y()}})]})}function Oqe(){const t=$(H=>H.marketplaceAuthenticated),a=$(H=>H.marketplaceLogin),[n,s]=g.useState([]),[o,c]=g.useState([]),[l,A]=g.useState([]),[u,f]=g.useState(!0),[x,m]=g.useState("all"),[y,v]=g.useState(""),[O,b]=g.useState(null),[C,j]=g.useState(null),[N,M]=g.useState(!1),Q=ln(),L=g.useRef(null),B=async()=>{const[H,q]=await Promise.all([D.get("/skills/installed").catch(()=>[]),D.get("/integrations/installed").catch(()=>[])]);c(Array.isArray(H)?H:H.skills||[]),A(Array.isArray(q)?q:q.integrations||[])};g.useEffect(()=>{f(!0),Promise.all([t?D.get("/auth/purchases").then(H=>H.purchases||[]).catch(()=>[]):Promise.resolve([]),D.get("/skills/installed").then(H=>Array.isArray(H)?H:H.skills||[]).catch(()=>[]),D.get("/integrations/installed").then(H=>Array.isArray(H)?H:H.integrations||[]).catch(()=>[])]).then(([H,q,_])=>{s(H),c(q),A(_)}).finally(()=>f(!1))},[t]);async function S(H){var _;const q=(_=H.target.files)==null?void 0:_[0];if(q){try{const R=await q.text(),U=q.name.replace(/\.md$/i,"");await D.post("/skills/import",{name:U,content:R}),Q.success(`Imported "${U}"`),await B()}catch(R){Q.error("Import failed",R.message)}H.target.value=""}}if(O)return e.jsx(gee,{skill:O,onBack:()=>b(null)});const I=y.toLowerCase(),z=x==="all"||x==="skills"?o.filter(H=>!I||(H.name||H.id||"").toLowerCase().includes(I)||(H.description||"").toLowerCase().includes(I)):[],P=x==="all"||x==="integrations"?l.filter(H=>!I||(H.name||H.id||"").toLowerCase().includes(I)||(H.description||"").toLowerCase().includes(I)):[],F=[...z.map(H=>({...H,_type:"skill"})),...P.map(H=>({...H,_type:"integration"}))],K=[{id:"all",label:"All"},{id:"skills",label:"Skills"},{id:"integrations",label:"Integrations"}],G={all:"No skills or integrations installed yet. Visit the Marketplace to get started.",skills:"No skills installed.",integrations:"No integrations installed."};return u?e.jsx("div",{className:"p-5 space-y-3",children:[...Array(4)].map((H,q)=>e.jsx(Xn,{className:"h-14 rounded-md"},q))}):e.jsxs(it,{className:"h-full",children:[e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("div",{className:"w-72",children:e.jsx(Rz,{value:y,onChange:v,placeholder:"Search library..."})}),e.jsx("div",{className:"flex items-center gap-1",children:K.map(H=>e.jsx("button",{onClick:()=>m(H.id),className:`px-3 py-1.5 text-xs font-semibold font-sans rounded-full cursor-pointer select-none transition-colors ${x===H.id?"bg-accent/15 text-accent border border-accent/25":"text-text-3 hover:text-text-1 border border-transparent hover:border-border-subtle"}`,children:H.label},H.id))}),e.jsx("div",{className:"flex-1"}),e.jsx("input",{ref:L,type:"file",accept:".md",onChange:S,className:"hidden"}),e.jsxs(fe,{variant:"secondary",size:"md",onClick:()=>{var H;return(H=L.current)==null?void 0:H.click()},className:"gap-1.5",children:[e.jsx(E0,{size:13}),"Import .md"]}),e.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:F.length})]}),t&&n.length>0&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[e.jsx(TA,{size:12}),"Purchases (",n.length,")"]}),e.jsx("div",{className:"space-y-1.5",children:n.map(H=>{var q,_;return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-1 border border-border-subtle",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center text-sm flex-shrink-0",children:H.skill_icon||((_=(q=H.skill_name)==null?void 0:q[0])==null?void 0:_.toUpperCase())||"?"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:H.skill_name||H.skill_id}),e.jsxs("div",{className:"text-2xs text-text-4 font-sans",children:["$",(H.amount||0).toFixed(2)," · ",Mt(H.created_at)]})]}),e.jsx(be,{variant:"success",className:"text-2xs flex-shrink-0",children:"Owned"})]},H.id||H.skill_id)})})]}),t&&n.length===0&&e.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[e.jsx(TA,{size:20,className:"mx-auto text-text-4 mb-2"}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No purchases yet"})]}),!t&&e.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[e.jsx(TA,{size:20,className:"mx-auto text-text-4 mb-2"}),e.jsx("p",{className:"text-xs text-text-2 font-sans mb-3",children:"Sign in to see your purchases"}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:a,className:"gap-1.5 mx-auto",children:[e.jsx(pu,{size:12})," Sign in"]})]}),F.length>0?e.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:F.map(H=>H._type==="skill"?e.jsx(oT,{item:{...H,installed:!0},onClick:()=>b(H)},`skill-${H.id}`):e.jsx(oT,{item:{...H,installed:!0},onClick:()=>{j(H),M(!0)},statusBadge:e.jsx(be,{variant:H.configured?"success":"warning",className:"text-2xs",children:H.configured?"Active":"Not configured"})},`int-${H.id}`))}):e.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:G[x]})]}),e.jsx(mee,{integration:C,open:N,onClose:()=>{M(!1),j(null),B()}})]})}function bqe(){const t=$(f=>f.importedRepos),a=$(f=>f.fetchImportedRepos),n=$(f=>f.softRemoveRepo),s=$(f=>f.hardNukeRepo),o=ln(),[c,l]=g.useState(null);g.useEffect(()=>{a()},[]);async function A(f){try{await n(f.id),o.success(`Removed ${f.repoName||f.name}`)}catch(x){o.error("Remove failed",x.message)}}async function u(f){if(c){try{f?await s(c.id):await n(c.id),o.success(`${f?"Nuked":"Removed"} ${c.name||c.repo}`)}catch(x){o.error("Nuke failed",x.message)}l(null)}}return e.jsxs(it,{className:"h-full",children:[e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[e.jsx(mqe,{}),t.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3",children:"Recently Imported"}),e.jsx("div",{className:"space-y-2",children:(Array.isArray(t)?t:[]).map(f=>e.jsx(gqe,{repo:f,onRemove:()=>A(f),onNuke:()=>l(f)},f.id))})]}),t.length===0&&e.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No repos imported yet. Paste a GitHub URL above to get started."})]}),e.jsx(yqe,{repo:c,open:!!c,onClose:()=>l(null),onConfirm:u})]})}function wqe(){const[t,a]=g.useState("skills"),n=[{id:"skills",label:"Skills",icon:It},{id:"integrations",label:"Integrations",icon:da},{id:"github",label:"GitHub",icon:Js},{id:"library",label:"My Library",icon:xu}];return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("div",{className:"flex-shrink-0 bg-surface-1 border-b border-border-subtle",children:e.jsxs("div",{className:"flex items-center px-5 h-11",children:[e.jsx("div",{className:"flex items-center",children:n.map(s=>{const o=s.icon;return e.jsxs("button",{onClick:()=>a(s.id),className:`flex items-center gap-1.5 px-3 py-2.5 text-xs font-semibold font-sans cursor-pointer select-none border-b-2 -mb-px transition-colors ${t===s.id?"border-accent text-text-0":"border-transparent text-text-3 hover:text-text-1"}`,children:[e.jsx(o,{size:12}),s.label]},s.id)})}),e.jsx("div",{className:"flex-1"})]})}),e.jsxs("div",{className:"flex-1 min-h-0",children:[t==="skills"&&e.jsx(vqe,{}),t==="integrations"&&e.jsx(kqe,{}),t==="github"&&e.jsx(bqe,{}),t==="library"&&e.jsx(Oqe,{})]})]})}function jqe({team:t,open:a,onOpenChange:n,onArchive:s,onDeletePermanently:o,onPromote:c,mode:l}){const[A,u]=g.useState(""),[f,x]=g.useState(!1),[m,y]=g.useState(!1);g.useEffect(()=>{a||(u(""),x(!1),y(!1))},[a]);const v=A===((t==null?void 0:t.name)||""),O=l!=="production";async function b(){y(!0);try{await c(t==null?void 0:t.id),n(!1)}catch{y(!1)}}return e.jsx(Ut,{open:a,onOpenChange:n,children:e.jsxs(Pt,{title:`Remove Team: ${(t==null?void 0:t.name)||""}`,description:"Choose how to remove this team",children:[e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e.jsx("p",{className:"text-sm text-text-1 font-sans",children:"What would you like to do with this team and its files?"}),O&&c&&e.jsxs("button",{onClick:b,disabled:m,className:"w-full flex items-start gap-3 p-3.5 rounded-lg border border-success/20 bg-success/5 hover:border-success/40 hover:bg-success/10 transition-all cursor-pointer text-left group disabled:opacity-50",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-success/10 flex items-center justify-center flex-shrink-0 group-hover:bg-success/20 transition-colors",children:e.jsx(za,{size:16,className:"text-success"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-semibold text-text-0 font-sans",children:m?"Promoting...":"Promote to Project"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-0.5",children:"Move files to the project directory. The team will be removed but your work stays in the project permanently."})]})]}),e.jsxs("button",{onClick:()=>{s(t==null?void 0:t.id),n(!1)},className:"w-full flex items-start gap-3 p-3.5 rounded-lg border border-border-subtle bg-surface-0 hover:border-accent/30 hover:bg-surface-2 transition-all cursor-pointer text-left group",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center flex-shrink-0 group-hover:bg-accent/20 transition-colors",children:e.jsx(CA,{size:16,className:"text-accent"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-semibold text-text-0 font-sans",children:"Archive"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-0.5",children:l==="production"?"Team metadata will be archived. Your files remain in the project directory.":"Files are preserved. You can restore the team later."})]})]}),e.jsxs("div",{className:"rounded-lg border border-danger/20 bg-danger/5 overflow-hidden",children:[e.jsxs("button",{onClick:()=>x(!0),className:"w-full flex items-start gap-3 p-3.5 cursor-pointer text-left group",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-danger/10 flex items-center justify-center flex-shrink-0 group-hover:bg-danger/20 transition-colors",children:e.jsx(At,{size:16,className:"text-danger"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-semibold text-danger font-sans",children:"Delete Permanently"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-0.5",children:l==="production"?"Team will be removed. Your files remain in the project directory.":"All files in this team will be permanently deleted."})]})]}),f&&e.jsxs("div",{className:"px-3.5 pb-3.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-warning font-sans",children:[e.jsx(Gt,{size:11}),e.jsxs("span",{children:["Type ",e.jsx("span",{className:"font-mono font-semibold text-text-0",children:t==null?void 0:t.name})," to confirm"]})]}),e.jsx("input",{type:"text",value:A,onChange:C=>u(C.target.value),placeholder:t==null?void 0:t.name,className:"w-full h-8 px-3 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-danger",autoFocus:!0,spellCheck:!1,onKeyDown:C=>{C.key==="Enter"&&v&&(o(t==null?void 0:t.id),n(!1)),C.key==="Escape"&&x(!1)}}),e.jsxs(fe,{variant:"danger",size:"sm",disabled:!v,onClick:()=>{o(t==null?void 0:t.id),n(!1)},className:"w-full",children:[e.jsx(At,{size:12})," Delete Forever"]})]})]})]}),e.jsx("div",{className:"px-5 py-3 border-t border-border-subtle flex justify-end",children:e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>n(!1),children:"Cancel"})})]})})}function Cqe({team:t,open:a,onOpenChange:n,onPurge:s}){const[o,c]=g.useState("");g.useEffect(()=>{a||c("")},[a]);const l=(t==null?void 0:t.originalName)||(t==null?void 0:t.name)||"",A=o===l;return e.jsx(Ut,{open:a,onOpenChange:n,children:e.jsxs(Pt,{title:"Permanently Delete",description:"Confirm permanent deletion",children:[e.jsxs("div",{className:"px-5 py-4 space-y-3",children:[e.jsxs("p",{className:"text-sm text-text-1 font-sans",children:["Permanently delete ",e.jsx("span",{className:"font-semibold text-text-0",children:l}),"?"]}),e.jsx("p",{className:"text-xs text-danger font-sans",children:"This cannot be undone. All team files will be permanently removed."}),e.jsxs("div",{className:"space-y-2 pt-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-warning font-sans",children:[e.jsx(Gt,{size:11}),e.jsxs("span",{children:["Type ",e.jsx("span",{className:"font-mono font-semibold text-text-0",children:l})," to confirm"]})]}),e.jsx("input",{type:"text",value:o,onChange:u=>c(u.target.value),placeholder:l,className:"w-full h-8 px-3 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-danger",autoFocus:!0,spellCheck:!1,onKeyDown:u=>{u.key==="Enter"&&A&&(s(t==null?void 0:t.id),n(!1))}})]})]}),e.jsxs("div",{className:"px-5 py-4 border-t border-border-subtle flex justify-end gap-2",children:[e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>n(!1),children:"Cancel"}),e.jsxs(fe,{variant:"danger",size:"sm",disabled:!A,onClick:()=>{s(t==null?void 0:t.id),n(!1)},children:[e.jsx(At,{size:12})," Delete Forever"]})]})]})})}function Nqe(){const t=$(M=>M.teams),a=$(M=>M.agents),n=$(M=>M.activeTeamId),s=$(M=>M.archiveTeam),o=$(M=>M.deleteTeamPermanently),c=$(M=>M.addToast),l=$(M=>M.archivedTeams),A=$(M=>M.fetchArchivedTeams),u=$(M=>M.restoreTeam),f=$(M=>M.purgeTeam),x=$(M=>M.promoteTeam),[m,y]=g.useState(null),[v,O]=g.useState(null),[b,C]=g.useState(null),[j,N]=g.useState(!1);return g.useEffect(()=>{A()},[]),t.length===0&&l.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(Fa,{size:28,className:"mx-auto text-text-4"}),e.jsx("p",{className:"text-xs font-sans text-text-3",children:"No teams yet"}),e.jsx("p",{className:"text-2xs font-sans text-text-4",children:"Teams are created when you spawn agents or launch a planner"})]})}):e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsx("div",{className:"p-4 space-y-3",children:t.map(M=>{const Q=a.filter(F=>F.teamId===M.id),L=Q.filter(F=>F.status==="running"||F.status==="starting"),B=Q.filter(F=>F.status==="completed"),S=Q.filter(F=>F.status==="crashed"),I=Q.reduce((F,K)=>F+(K.tokensUsed||0),0),z=Q.reduce((F,K)=>F+(K.costUsd||0),0),P=M.id===n;return e.jsxs("div",{className:V("rounded-md border bg-surface-1 overflow-hidden transition-colors",P?"border-accent/30":"border-border-subtle"),children:[e.jsxs("div",{className:"px-4 py-3 flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-text-0 font-sans",children:M.name}),P&&e.jsx(be,{variant:"accent",className:"text-2xs",children:"Active"}),e.jsx(be,{variant:M.mode==="production"?"success":"default",className:"text-2xs",children:M.mode==="production"?"Production":"Sandbox"})]}),M.workingDir&&e.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[e.jsx(Ko,{size:10,className:"text-text-4"}),e.jsx("span",{className:"text-2xs font-mono text-text-3 truncate",children:M.workingDir})]})]}),M.mode!=="production"&&e.jsx("button",{onClick:()=>C(M),className:"p-1.5 text-text-4 hover:text-success rounded transition-colors cursor-pointer",title:"Promote to production",children:e.jsx(za,{size:13})}),e.jsx("button",{onClick:()=>{if(Q.some(F=>F.status==="running"||F.status==="starting")){c("error","Stop running agents first");return}y(M)},className:"p-1.5 text-text-4 hover:text-danger rounded transition-colors cursor-pointer",title:"Archive team",children:e.jsx(At,{size:13})})]}),e.jsxs("div",{className:"px-4 py-2.5 border-t border-border-subtle bg-surface-0 flex items-center gap-4",children:[e.jsx(V1,{label:"Agents",value:Q.length}),e.jsx(V1,{label:"Running",value:L.length,color:L.length>0?"text-success":void 0}),e.jsx(V1,{label:"Done",value:B.length}),e.jsx(V1,{label:"Crashed",value:S.length,color:S.length>0?"text-danger":void 0}),e.jsx("div",{className:"flex-1"}),e.jsx(V1,{label:"Tokens",value:pt(I)}),z>0&&e.jsx(V1,{label:"Cost",value:Ai(z)})]}),Q.length>0&&e.jsx("div",{className:"border-t border-border-subtle",children:Q.map(F=>e.jsxs("div",{className:"flex items-center gap-2 px-4 py-1.5 border-b border-border-subtle last:border-b-0",children:[e.jsx(ia,{status:F.status,size:"sm"}),e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:F.name}),e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase",children:F.role}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"text-2xs font-mono text-text-2 tabular-nums",children:pt(F.tokensUsed||0)})]},F.id))})]},M.id)})}),l.length>0&&e.jsxs("div",{className:"border-t border-border-subtle",children:[e.jsxs("button",{onClick:()=>N(!j),className:"w-full flex items-center gap-2 px-5 py-3 text-left cursor-pointer hover:bg-surface-5/30 transition-colors",children:[e.jsx(Rt,{size:12,className:V("text-text-4 transition-transform duration-200",j&&"rotate-90")}),e.jsx(CA,{size:13,className:"text-text-3"}),e.jsx("span",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider flex-1",children:"Archived Teams"}),e.jsx("span",{className:"text-2xs font-mono text-text-4 bg-surface-4 px-1.5 py-0.5 rounded",children:l.length})]}),j&&e.jsx("div",{className:"px-4 pb-4 space-y-2",children:l.map(M=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-0 border border-border-subtle",children:[e.jsx(CA,{size:13,className:"text-text-4 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:M.originalName||M.name}),(M.deletedAt||M.archivedAt)&&e.jsxs("div",{className:"text-2xs text-text-4 font-mono mt-0.5",children:["Archived ",Mt(M.deletedAt||M.archivedAt)]})]}),e.jsx("button",{onClick:()=>u(M.id),className:"p-1.5 text-text-3 hover:text-accent rounded transition-colors cursor-pointer",title:"Restore team",children:e.jsx(Cs,{size:13})}),e.jsx("button",{onClick:()=>O(M),className:"p-1.5 text-text-4 hover:text-danger rounded transition-colors cursor-pointer",title:"Permanently delete",children:e.jsx(At,{size:13})})]},M.id))})]}),e.jsx(jqe,{team:m,open:!!m,onOpenChange:M=>!M&&y(null),onArchive:s,onDeletePermanently:o,onPromote:x,mode:(m==null?void 0:m.mode)||"sandbox"}),e.jsx(Cqe,{team:v,open:!!v,onOpenChange:M=>!M&&O(null),onPurge:f}),e.jsx(Mqe,{team:b,open:!!b,onOpenChange:M=>!M&&C(null),onPromote:x})]})}function Mqe({team:t,open:a,onOpenChange:n,onPromote:s}){const[o,c]=g.useState(!1);g.useEffect(()=>{a||c(!1)},[a]);async function l(){c(!0);try{await s(t==null?void 0:t.id),n(!1)}catch{c(!1)}}return e.jsx(Ut,{open:a,onOpenChange:n,children:e.jsxs(Pt,{title:"Promote to Production",description:"Promote this team to production mode",children:[e.jsxs("div",{className:"px-5 py-4 space-y-3",children:[e.jsxs("p",{className:"text-sm text-text-1 font-sans",children:["Promote ",e.jsx("span",{className:"font-semibold text-text-0",children:t==null?void 0:t.name})," to production?"]}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"This will move files from the team directory into the project directory. The team will be removed but your work stays in the project permanently."})]}),e.jsxs("div",{className:"px-5 py-3 border-t border-border-subtle flex justify-end gap-2",children:[e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>n(!1),children:"Cancel"}),e.jsxs(fe,{variant:"primary",size:"sm",disabled:o,onClick:l,className:"gap-1.5",children:[e.jsx(za,{size:12}),o?"Promoting...":"Promote"]})]})]})})}function V1({label:t,value:a,color:n}){return e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:V("text-xs font-mono tabular-nums",n||"text-text-1"),children:a}),e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider",children:t})]})}function Sqe(){const t=$(s=>s.pendingApprovals),a=$(s=>s.approveRequest),n=$(s=>s.rejectRequest);return t.length===0?null:e.jsxs("div",{className:"px-4 pt-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Gt,{size:12,className:"text-warning"}),e.jsxs("span",{className:"text-2xs font-mono text-warning uppercase tracking-wider",children:["Pending (",t.length,")"]})]}),t.map(s=>{var o,c,l;return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md bg-warning/5 border border-warning/20",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-xs text-text-0 font-sans font-medium truncate",children:[s.agentName,": ",((o=s.action)==null?void 0:o.description)||((c=s.action)==null?void 0:c.type)||"action"]}),((l=s.action)==null?void 0:l.filePath)&&e.jsx("div",{className:"text-2xs font-mono text-text-3 truncate mt-0.5",children:s.action.filePath}),e.jsx("div",{className:"text-2xs text-text-4 font-mono mt-0.5",children:Mt(s.requestedAt)})]}),e.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>a(s.id),className:"h-7 px-2.5 gap-1 text-2xs",children:[e.jsx(ku,{size:10})," Approve"]}),e.jsxs(fe,{variant:"danger",size:"sm",onClick:()=>n(s.id),className:"h-7 px-2.5 gap-1 text-2xs",children:[e.jsx($r,{size:10})," Reject"]})]})]},s.id)})]})}function Qqe(){const t=$(u=>u.resolvedApprovals),[a,n]=g.useState([]),[s,o]=g.useState(!0);g.useEffect(()=>{const u=setInterval(c,4e3);return c(),()=>clearInterval(u)},[]);async function c(){try{const u=await D.get("/pm/history");n(u.history||u||[])}catch{}o(!1)}const l=new Set,A=[...t,...a].filter(u=>{const f=u.id||`${u.agentName}-${u.timestamp}`;return l.has(f)?!1:(l.add(f),!0)});return e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsx(Sqe,{}),e.jsxs("div",{className:"p-4 space-y-1.5",children:[s&&A.length===0&&e.jsx("div",{className:"text-center py-12 text-text-4 font-mono text-xs",children:"Loading..."}),!s&&A.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Sa,{size:24,className:"mx-auto mb-2 text-text-4"}),e.jsx("p",{className:"text-xs font-sans text-text-3",children:"No approval history"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans mt-1",children:"Approvals appear when agents use Auto permission mode"})]}),A.map((u,f)=>{var m;const x=u.status==="approved"||u.verdict==="approved";return e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 rounded-md bg-surface-0 border border-border-subtle",children:[x?e.jsx(Sa,{size:12,className:"text-success flex-shrink-0"}):e.jsx(qn,{size:12,className:"text-danger flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"text-xs text-text-1 font-sans truncate",children:[e.jsx("span",{className:"font-medium text-text-0",children:u.agentName}),e.jsx("span",{className:"text-text-3 mx-1",children:"·"}),e.jsx("span",{children:((m=u.action)==null?void 0:m.description)||u.action||"action"})]}),u.reason&&e.jsx("div",{className:"text-2xs text-text-3 font-sans truncate mt-0.5",children:u.reason})]}),e.jsx("span",{className:"text-2xs font-mono text-text-4 flex-shrink-0",children:Mt(u.resolvedAt||u.timestamp)})]},u.id||f)})]})]})}function Bqe(){const[t,a]=g.useState([]),[n,s]=g.useState(!0),o=ln();g.useEffect(()=>{const A=setInterval(c,1e4);return c(),()=>clearInterval(A)},[]);async function c(){try{const A=await D.get("/schedules");a(A.schedules||A||[])}catch{}s(!1)}async function l(A,u){try{await D.post(`/schedules/${A}/${u?"disable":"enable"}`),c()}catch(f){o.error("Failed to toggle schedule",f.message)}}return e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"p-4 space-y-2",children:[n&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-4 font-mono text-xs",children:"Loading..."}),!n&&t.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Wo,{size:24,className:"mx-auto mb-2 text-text-4"}),e.jsx("p",{className:"text-xs font-sans text-text-3",children:"No schedules configured"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans mt-1",children:"Use the CLI to create agent schedules"})]}),t.map(A=>e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:A.name}),e.jsx(be,{variant:A.enabled?"success":"default",className:"text-2xs",children:A.enabled?"Active":"Paused"})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("span",{className:"text-2xs font-mono text-text-2",children:A.cron}),e.jsx("span",{className:"text-2xs text-text-4",children:"·"}),e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase",children:A.role}),A.teamId&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-text-4",children:"·"}),e.jsx("span",{className:"text-2xs font-sans text-text-3",children:A.teamName||A.teamId})]})]}),A.prompt&&e.jsx("div",{className:"text-2xs font-sans text-text-4 mt-1 truncate",children:A.prompt})]}),e.jsx(fe,{variant:"secondary",size:"sm",onClick:()=>l(A.id,A.enabled),className:"h-7 px-2.5 gap-1 text-2xs",children:A.enabled?e.jsxs(e.Fragment,{children:[e.jsx(L0,{size:10})," Pause"]}):e.jsxs(e.Fragment,{children:[e.jsx(ei,{size:10})," Enable"]})})]}),A.lastRunAt&&e.jsxs("div",{className:"px-4 py-1.5 border-t border-border-subtle bg-surface-1 text-2xs font-mono text-text-4",children:["Last run: ",Mt(A.lastRunAt),A.nextRunAt&&e.jsxs("span",{className:"ml-3",children:["Next: ",Mt(A.nextRunAt)]})]})]},A.id))]})})}function _qe(){return e.jsxs(Pz,{defaultValue:"dashboard",className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-4 pt-3 bg-surface-1 border-b border-border",children:[e.jsx("div",{className:"flex items-center gap-4 mb-0",children:e.jsx("h2",{className:"text-xs font-semibold text-text-0 font-sans tracking-wide uppercase",children:"Management"})}),e.jsxs(Ez,{className:"border-b-0",children:[e.jsxs(ys,{value:"dashboard",className:"inline-flex items-center gap-1.5",children:[e.jsx(k0,{size:12}),"Teams"]}),e.jsxs(ys,{value:"approvals",className:"inline-flex items-center gap-1.5",children:[e.jsx(w0,{size:12}),"Approvals"]}),e.jsxs(ys,{value:"schedules",className:"inline-flex items-center gap-1.5",children:[e.jsx(Wo,{size:12}),"Schedules"]})]})]}),e.jsx(vs,{value:"dashboard",className:"flex flex-col min-h-0",children:e.jsx(Nqe,{})}),e.jsx(vs,{value:"approvals",className:"flex flex-col min-h-0",children:e.jsx(Qqe,{})}),e.jsx(vs,{value:"schedules",className:"flex flex-col min-h-0",children:e.jsx(Bqe,{})})]})}const Lqe={code:"Code",general:"General"},Tqe={light:"text-success",medium:"text-accent",heavy:"text-warning"};function $qe(t){return t<1?`${Math.round(t*1024)} MB`:`${t} GB`}function yee({hardware:t}){if(!t)return null;const{totalRamGb:a,gpu:n,isAppleSilicon:s}=t;return e.jsxs("div",{className:"flex items-center gap-3 bg-surface-0 rounded-lg border border-border-subtle px-3 py-2.5",children:[e.jsx(Dr,{size:14,className:"text-text-3 flex-shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center gap-2 text-xs font-sans",children:[e.jsxs("span",{className:"text-text-0 font-semibold",children:[a," GB RAM"]}),n&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-4",children:"·"}),e.jsx("span",{className:"text-text-2",children:n.name})]}),s&&e.jsx(be,{variant:"accent",className:"text-2xs",children:"Unified Memory"})]})})]})}function Iqe({onRecheck:t}){const[a,n]=g.useState(null),[s,o]=g.useState(!1),[c,l]=g.useState(!1),[A,u]=g.useState(!1),f=$(Q=>Q.addToast);g.useEffect(()=>{D.post("/providers/ollama/check").then(n).catch(()=>{})},[]);async function x(){o(!0);try{const Q=await D.post("/providers/ollama/check");n(Q),Q.installed&&Q.serverRunning?(f("success","Ollama is ready!"),t()):Q.installed?f("info","Ollama installed — server needs to start"):f("info","Ollama not found — install and try again")}catch{}o(!1)}async function m(){l(!0);try{if((await D.post("/providers/ollama/serve")).ok){f("success","Ollama server started!");let L=!1;for(let B=0;B<5;B++){await new Promise(I=>setTimeout(I,2e3));const S=await D.post("/providers/ollama/check");if(n(S),S.serverRunning){L=!0;break}}L&&t()}}catch(Q){f("error","Could not start server",Q.message)}l(!1)}function y(Q){navigator.clipboard.writeText(Q),u(!0),setTimeout(()=>u(!1),2e3)}if(!a)return e.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Loading..."});const{hardware:v,install:O,requirements:b,installed:C,serverRunning:j}=a,N=v.totalRamGb>=b.minRAM,M=v.recommended;return e.jsxs("div",{className:"space-y-3 p-3",children:[e.jsx(yee,{hardware:v}),N?e.jsxs("div",{className:"flex items-start gap-2 bg-success/8 border border-success/20 rounded-lg px-3 py-2.5",children:[e.jsx(De,{size:14,className:"text-success flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-xs font-sans",children:[e.jsx("span",{className:"text-success font-semibold",children:"Your system is ready."}),e.jsx("span",{className:"text-text-2 ml-1",children:M.code?`Recommended: ${M.code}`:`${v.totalRamGb} GB RAM available`})]})]}):e.jsxs("div",{className:"flex items-start gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[e.jsx(Xt,{size:14,className:"text-warning flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-xs font-sans text-text-2",children:[e.jsxs("span",{className:"text-warning font-semibold",children:[v.totalRamGb," GB RAM detected."]})," ","Minimum ",b.minRAM," GB needed. Smallest models may still work."]})]}),C&&!j&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[e.jsx(Xt,{size:14,className:"text-warning flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-xs font-sans text-text-2",children:[e.jsx("span",{className:"text-warning font-semibold",children:"Ollama installed but server not running."})," ","The server needs to be running to pull and use models."]})]}),e.jsxs(fe,{variant:"primary",size:"md",onClick:m,disabled:c,className:"w-full gap-1.5",children:[e.jsx(wt,{size:12}),c?"Starting...":"Start Ollama Server"]})]}),!C&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-semibold text-text-1 font-sans",children:"Install Ollama"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 bg-surface-0 border border-border-subtle rounded-md px-3 py-2 text-xs font-mono text-text-1 truncate",children:O.command}),e.jsxs(fe,{variant:"secondary",size:"sm",onClick:()=>y(O.command),className:"h-8 px-2.5 gap-1 flex-shrink-0",children:[A?e.jsx(De,{size:12}):e.jsx(wn,{size:12}),A?"Copied":"Copy"]})]}),O.alt&&e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:O.alt})]}),e.jsxs(fe,{variant:"secondary",size:"md",onClick:x,disabled:s,className:"w-full gap-1.5",children:[e.jsx(ra,{size:12,className:s?"animate-spin":""}),s?"Checking...":C?"Check again":"I installed it — check again"]})]})}function Uqe({model:t,isInstalled:a,isRecommended:n,canRun:s,onPull:o,onDelete:c,pulling:l}){const A=l===t.id;return e.jsxs("div",{className:V("flex items-center gap-2 px-3 py-2 border-t border-border-subtle transition-colors",!s&&"opacity-40"),children:[a?e.jsx(De,{size:12,className:"text-success flex-shrink-0"}):e.jsx("div",{className:"w-3"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-mono text-text-1 truncate",children:t.name}),n&&e.jsx(IA,{size:10,className:"text-warning flex-shrink-0"})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsx("span",{className:V("text-2xs font-semibold font-sans",Tqe[t.tier]),children:t.tier}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:$qe(t.sizeGb)}),e.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:["· ",t.ramGb," GB RAM"]})]})]}),a?e.jsx("button",{onClick:()=>c(t.id),className:"p-1.5 text-text-4 hover:text-danger rounded transition-colors cursor-pointer",title:"Remove model",children:e.jsx(At,{size:12})}):s?e.jsx(fe,{variant:"secondary",size:"sm",onClick:()=>o(t.id),disabled:!!l,className:"h-7 px-2 text-2xs gap-1",children:A?e.jsxs(e.Fragment,{children:[e.jsx(ra,{size:10,className:"animate-spin"})," Pulling..."]}):e.jsxs(e.Fragment,{children:[e.jsx(_a,{size:10})," Pull"]})}):e.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:["Needs ",t.ramGb," GB"]})]})}function Pqe({onStopped:t}){const[a,n]=g.useState(null),s=$(l=>l.addToast);async function o(){n("stopping");try{(await D.post("/providers/ollama/stop")).ok?(s("info","Ollama server stopped"),t&&t()):s("error","Could not stop server")}catch(l){s("error","Stop failed",l.message)}n(null)}async function c(){n("restarting");try{(await D.post("/providers/ollama/restart")).ok?s("success","Ollama server restarted"):s("error","Restart failed")}catch(l){s("error","Restart failed",l.message)}n(null)}return e.jsxs("div",{className:"flex items-center gap-2 bg-success/8 border border-success/20 rounded-lg px-3 py-2",children:[e.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[e.jsx("span",{className:"absolute inset-0 rounded-full bg-success"}),e.jsx("span",{className:"absolute inset-[-2px] rounded-full bg-success opacity-20 animate-pulse"})]}),e.jsx("span",{className:"text-xs font-sans text-success font-semibold",children:"Server Running"}),e.jsx("span",{className:"text-2xs font-mono text-text-4",children:":11434"}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{onClick:c,disabled:!!a,className:"flex items-center gap-1 text-2xs font-sans text-text-3 hover:text-accent cursor-pointer transition-colors disabled:opacity-40",children:[e.jsx(ra,{size:10,className:a==="restarting"?"animate-spin":""}),a==="restarting"?"Restarting...":"Restart"]}),e.jsxs("button",{onClick:o,disabled:!!a,className:"flex items-center gap-1 text-2xs font-sans text-text-3 hover:text-danger cursor-pointer transition-colors disabled:opacity-40",children:[e.jsx(Xt,{size:10}),a==="stopping"?"Stopping...":"Stop"]})]})}function Eqe({onModelChange:t}){var I,z;const[a,n]=g.useState(null),[s,o]=g.useState(null),[c,l]=g.useState("code"),[A,u]=g.useState(!1),[f,x]=g.useState(!1),m=$(P=>P.addToast),y=g.useRef(!1);function v(){D.get("/providers/ollama/models").then(P=>{var F;n(P),!y.current&&((F=P.installed)==null?void 0:F.length)===0&&(y.current=!0,setTimeout(v,2e3))}).catch(()=>{})}g.useEffect(()=>{v()},[]);async function O(P){o(P);try{await D.post("/providers/ollama/pull",{model:P}),m("success",`Pulled ${P}`),v(),t&&t()}catch(F){m("error",`Pull failed: ${F.message}`)}o(null)}async function b(P){try{await D.delete(`/providers/ollama/models/${encodeURIComponent(P)}`),m("info",`Removed ${P}`),v(),t&&t()}catch(F){m("error",`Delete failed: ${F.message}`)}}if(!a)return e.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Loading..."});const{installed:C,catalog:j,hardware:N}=a,M=new Set(C.map(P=>P.id)),Q=N.totalRamGb,L=[(I=N.recommended)==null?void 0:I.code,(z=N.recommended)==null?void 0:z.general].filter(Boolean),B=j.filter(P=>P.category===c),S=A?B:B.filter(P=>P.ramGb<=Q);return f?e.jsxs("div",{className:"space-y-3 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[e.jsx(Xt,{size:14,className:"text-warning flex-shrink-0"}),e.jsxs("span",{className:"text-xs font-sans text-text-2",children:[e.jsx("span",{className:"text-warning font-semibold",children:"Ollama server stopped."})," ","Start it again to pull and use models."]})]}),e.jsxs(fe,{variant:"primary",size:"md",onClick:async()=>{try{(await D.post("/providers/ollama/serve")).ok&&(m("success","Ollama server started!"),x(!1),y.current=!1,setTimeout(v,2e3))}catch(P){m("error","Could not start server",P.message)}},className:"w-full gap-1.5",children:[e.jsx(wt,{size:12}),"Start Ollama Server"]})]}):e.jsxs("div",{className:"space-y-2 p-3",children:[e.jsx(Pqe,{onStopped:()=>x(!0)}),e.jsx(yee,{hardware:N}),C.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-sans text-text-2",children:[e.jsx(Kn,{size:12,className:"text-text-3"}),e.jsx("span",{className:"font-semibold",children:C.length})," model",C.length!==1?"s":""," installed"]}),e.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:Object.entries(Lqe).map(([P,F])=>e.jsx("button",{onClick:()=>l(P),className:V("flex-1 px-3 py-1.5 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",c===P?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:F},P))}),e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-0 overflow-hidden",children:[S.map(P=>e.jsx(Uqe,{model:P,isInstalled:M.has(P.id),isRecommended:L.includes(P.id),canRun:P.ramGb<=Q,onPull:O,onDelete:b,pulling:s},P.id)),S.length===0&&e.jsxs("div",{className:"px-3 py-4 text-center text-xs text-text-4 font-sans",children:["No ",c," models available for your hardware"]})]}),!A&&B.length>S.length&&e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1 text-2xs text-text-3 hover:text-accent font-sans cursor-pointer transition-colors",children:[e.jsx(bt,{size:10}),"Show ",B.length-S.length," more (exceed your RAM)"]})]})}function vee({isInstalled:t,onModelChange:a}){const[n,s]=g.useState(!1),[o,c]=g.useState(!1);return g.useEffect(()=>{t?D.post("/providers/ollama/check").then(l=>{s(l.installed&&l.serverRunning),c(!0)}).catch(()=>c(!0)):c(!0)},[t]),o?n?e.jsx(Eqe,{onModelChange:a}):e.jsx(Iqe,{onRecheck:()=>{s(!0),a&&a()}}):e.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Checking Ollama..."})}const UX={"claude-code":{name:"Claude Code",letter:"C",color:"bg-purple/20 text-purple",installLabel:"We are downloading Claude Code for you",authLabel:"Sign in with your Anthropic account",keyPlaceholder:"sk-ant-...",keyHint:"Paste from console.anthropic.com",loginLabel:"Sign In with Anthropic",authType:"subscription"},codex:{name:"Codex",letter:"X",color:"bg-success/20 text-success",installLabel:"We are downloading Codex for you",authLabel:"Connect your OpenAI account",keyPlaceholder:"sk-...",keyHint:"Paste from platform.openai.com",loginLabel:"Sign in with ChatGPT Plus",authType:"apikey"},gemini:{name:"Gemini CLI",letter:"G",color:"bg-info/20 text-info",installLabel:"We are downloading Gemini CLI for you",authLabel:"Add your Gemini API key",keyPlaceholder:"AIza...",keyHint:"Paste from aistudio.google.com",authType:"apikey"}},PX=["Install","Authenticate","Verify","Done"];function zqe({current:t}){return e.jsx("div",{className:"flex items-center gap-1 mb-6",children:PX.map((a,n)=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:V("w-6 h-6 rounded-full flex items-center justify-center text-2xs font-bold font-mono transition-colors",n<t?"bg-success/15 text-success":n===t?"bg-accent/15 text-accent ring-1 ring-accent/30":"bg-surface-4 text-text-4"),children:n<t?e.jsx(De,{size:10,strokeWidth:3}):n+1}),e.jsx("span",{className:V("text-2xs font-sans font-medium hidden sm:inline",n===t?"text-text-0":"text-text-4"),children:a}),n<PX.length-1&&e.jsx("div",{className:V("w-6 h-px mx-1",n<t?"bg-success/40":"bg-border-subtle")})]},a))})}function Fqe({providerId:t,meta:a}){const n=$(y=>y.installProvider),s=$(y=>y.providerInstallProgress[t]),[o,c]=g.useState(!1),[l,A]=g.useState(!1),u=s==null?void 0:s.installing,f=s==null?void 0:s.done,x=s==null?void 0:s.error,m=(s==null?void 0:s.percent)||0;return g.useEffect(()=>{l||(A(!0),n(t).catch(()=>{}))},[]),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:V("w-10 h-10 rounded-lg flex items-center justify-center text-sm font-bold font-mono",a.color),children:a.letter}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text-0 font-sans",children:a.installLabel}),e.jsx("p",{className:"text-2xs text-text-3 font-sans",children:"This may take a minute"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-2 bg-surface-4 rounded-full overflow-hidden",children:u?e.jsx("div",{className:"h-full bg-gradient-to-r from-accent to-accent/60 rounded-full transition-all duration-500 ease-out",style:{width:`${Math.max(m,5)}%`}}):f?e.jsx("div",{className:"h-full bg-success rounded-full w-full"}):x?e.jsx("div",{className:"h-full bg-danger rounded-full",style:{width:"100%"}}):null}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:V("text-2xs font-sans",x?"text-danger":f?"text-success":"text-text-3"),children:x?typeof x=="string"?x:"Something went wrong":f?"Installed successfully":(s==null?void 0:s.message)||"Preparing..."}),u&&e.jsxs("button",{onClick:()=>c(!o),className:"flex items-center gap-1 text-2xs text-text-4 hover:text-text-2 cursor-pointer font-sans",children:[o?"Hide":"Show"," details",o?e.jsx(su,{size:10}):e.jsx(bt,{size:10})]})]})]}),o&&(s==null?void 0:s.message)&&e.jsx("div",{className:"p-3 bg-surface-0 border border-border-subtle rounded-md max-h-24 overflow-y-auto",children:e.jsx("p",{className:"text-2xs font-mono text-text-3 whitespace-pre-wrap",children:s.message})}),x&&e.jsxs("div",{className:"space-y-3",children:[typeof x=="string"&&e.jsx("div",{className:"p-3 bg-danger/5 border border-danger/20 rounded-md max-h-32 overflow-y-auto",children:e.jsx("p",{className:"text-2xs font-mono text-danger whitespace-pre-wrap break-all",children:x})}),e.jsx("p",{className:"text-xs text-text-2 font-sans",children:"Check that npm is in your PATH and try again."}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>n(t).catch(()=>{}),className:"gap-1.5",children:[e.jsx(Cs,{size:11})," Try Again"]})]})]})}function Rqe({providerId:t,meta:a,onSaveKey:n}){const s=$(v=>v.addToast),[o,c]=g.useState(""),[l,A]=g.useState(!1),[u,f]=g.useState(!1),[x,m]=g.useState(t==="claude-code"||t==="codex"?"terminal":"apikey");async function y(){if(o.trim()){f(!0);try{await D.post(`/credentials/${encodeURIComponent(t)}`,{key:o.trim()}),s("success",`API key saved for ${a.name}`),n()}catch(v){s("error","Failed to save key",v.message)}finally{f(!1)}}}return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm font-medium text-text-0 font-sans",children:a.authLabel}),t==="claude-code"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-text-2 font-sans",children:"Sign in via the terminal with your Claude subscription."}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"1"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Open the Groove terminal below"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"2"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"claude"})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"3"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Follow the prompts to sign in with your Anthropic account"})]})]}),e.jsx("button",{onClick:()=>m(x==="apikey"?"terminal":"apikey"),className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans",children:x==="apikey"?"Use terminal login instead":"I have an API key instead"})]}),t==="codex"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-text-2 font-sans",children:"Sign in via the terminal with your OpenAI account."}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"1"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Open the Groove terminal below"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"2"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"npm i -g @openai/codex"})," (if not installed)"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"3"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"codex login"})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"4"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Follow the prompts to authenticate"})]})]}),e.jsx("button",{onClick:()=>m(x==="apikey"?"terminal":"apikey"),className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans",children:x==="apikey"?"Use terminal login instead":"I have an API key instead"})]}),x==="apikey"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"text-2xs font-semibold text-text-2 font-sans block",children:[a.name," API Key"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx("input",{type:l?"text":"password",value:o,onChange:v=>c(v.target.value),onKeyDown:v=>v.key==="Enter"&&y(),placeholder:a.keyPlaceholder,className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:()=>A(!l),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:l?e.jsx(jn,{size:12}):e.jsx(na,{size:12})})]}),e.jsx(fe,{variant:"primary",size:"lg",onClick:y,disabled:!o.trim()||u,children:u?"Saving...":"Save"})]}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:a.keyHint})]})]})}function Hqe({providerId:t,meta:a,onVerified:n}){const s=$(f=>f.verifyProvider),[o,c]=g.useState("verifying"),[l,A]=g.useState(null);async function u(){c("verifying"),A(null);try{const f=await s(t);f!=null&&f.installed&&!(f!=null&&f.error)?(c("success"),n()):(c("failed"),A((f==null?void 0:f.error)||"Could not verify the provider. Please check your credentials."))}catch(f){c("failed"),A(f.message||"Verification failed. Please try again.")}}return g.useEffect(()=>{u()},[]),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:V("w-10 h-10 rounded-lg flex items-center justify-center text-sm font-bold font-mono",a.color),children:a.letter}),e.jsx("p",{className:"text-sm font-medium text-text-0 font-sans",children:o==="verifying"?"Checking your connection...":o==="success"?"Everything looks good!":"We could not verify the connection"})]}),o==="verifying"&&e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-accent/5 border border-accent/15 rounded-md",children:[e.jsx($e,{size:14,className:"text-accent animate-spin"}),e.jsxs("span",{className:"text-xs text-accent font-sans",children:["Verifying ",a.name,"..."]})]}),o==="success"&&e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-success/8 border border-success/20 rounded-md",children:[e.jsx(De,{size:14,className:"text-success"}),e.jsxs("span",{className:"text-xs text-success font-sans",children:[a.name," is connected and ready to use"]})]}),o==="failed"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center gap-2 p-3 bg-danger/8 border border-danger/20 rounded-md",children:e.jsx("span",{className:"text-xs text-danger font-sans",children:l})}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:u,className:"gap-1.5",children:[e.jsx(Cs,{size:11})," Try Again"]})]})]})}function qqe({meta:t}){return e.jsxs("div",{className:"flex flex-col items-center text-center gap-4 py-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-success/15 flex items-center justify-center",children:e.jsx(De,{size:24,className:"text-success",strokeWidth:2.5})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-base font-semibold text-text-0 font-sans",children:[t.name," is ready!"]}),e.jsxs("p",{className:"text-xs text-text-3 font-sans mt-1",children:["You can now spawn agents using ",t.name,"."]})]})]})}function Dqe({open:t,onOpenChange:a,providerId:n,initialStep:s=0,onComplete:o}){const c=UX[n]||UX["claude-code"],[l,A]=g.useState(s),[u,f]=g.useState(!1),x=$(b=>{var C;return(C=b.providerInstallProgress[n])==null?void 0:C.done});g.useEffect(()=>{t&&(A(s),f(!1))},[t,n]);function m(){A(2)}function y(){f(!0)}function v(){a(!1),o&&o()}const O=l===0?!!x:l===1?!0:l===2?u:!0;return e.jsx(Ut,{open:t,onOpenChange:a,children:e.jsx(Pt,{title:`Set up ${c.name}`,description:`Install and configure ${c.name}`,className:"max-w-md",children:e.jsxs("div",{className:"px-5 py-4",children:[e.jsx(zqe,{current:l}),l===0&&e.jsx(Fqe,{providerId:n,meta:c}),l===1&&e.jsx(Rqe,{providerId:n,meta:c,onSaveKey:m}),l===2&&e.jsx(Hqe,{providerId:n,meta:c,onVerified:y}),l===3&&e.jsx(qqe,{meta:c}),e.jsxs("div",{className:"flex justify-between mt-6 pt-4 border-t border-border-subtle",children:[l>0&&l<3?e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>A(l-1),children:"Back"}):e.jsx("div",{}),l<3?e.jsx(fe,{variant:"primary",size:"sm",disabled:!O,onClick:()=>A(l+1),className:"gap-1.5",children:l===0?"Next":l===1?"Skip verification":"Continue"}):e.jsxs(fe,{variant:"primary",size:"sm",onClick:v,className:"gap-1.5",children:[e.jsx(It,{size:11})," Done"]})]})]})})})}function HT({children:t,...a}){return e.jsx(EG,{...a,children:t})}function qT({children:t,className:a,title:n,side:s="right",width:o=400,...c}){return e.jsxs(zG,{children:[e.jsx(FG,{className:"fixed inset-0 z-40 bg-black/30"}),e.jsxs(RG,{className:V("fixed top-0 z-50 h-full overflow-y-auto","bg-surface-1 border-l border-border shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out",s==="right"&&"right-0 data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",s==="left"&&"left-0 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",a),style:{width:o},...c,children:[n&&e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border-subtle sticky top-0 bg-surface-1 z-10",children:[e.jsx(kT,{className:"text-base font-semibold text-text-0 font-sans",children:n}),e.jsx(WE,{className:"p-1 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer",children:e.jsx(Ge,{size:16})})]}),e.jsx(HG,{className:"sr-only",children:"Panel"}),t]})]})}function kee({value:t,onChange:a}){return e.jsx("button",{onClick:()=>a(!t),className:V("w-9 h-5 rounded-full p-0.5 transition-colors cursor-pointer",t?"bg-accent":"bg-surface-5"),children:e.jsx("div",{className:V("w-4 h-4 rounded-full bg-white shadow-sm transition-transform",t?"translate-x-4":"translate-x-0")})})}const Vqe={"claude-code":"sk-ant-...",codex:"Paste from platform.openai.com",gemini:"Paste from aistudio.google.com",grok:"xai-..."};function Xqe({provider:t,onKeyChange:a}){var Z,J,Ae,W;const[n,s]=g.useState(!1),[o,c]=g.useState(""),[l,A]=g.useState(!1),[u,f]=g.useState(!1),[x,m]=g.useState(!1),[y,v]=g.useState(0),[O,b]=g.useState(!1),[C,j]=g.useState(""),[N,M]=g.useState(!1),Q=$(ae=>ae.addToast),L=$(ae=>ae.providerInstallProgress[t.id]),B=$(ae=>ae.setProviderPath),S=$(ae=>ae.verifyProvider),I=$(ae=>ae.installProvider),[z,P]=g.useState(!1),F=t.authType==="local",K=t.authType==="subscription",G=F?t.installed:K?t.installed&&((Z=t.authStatus)==null?void 0:Z.authenticated):t.installed&&t.hasKey;async function H(){if(o.trim())try{await D.post(`/credentials/${encodeURIComponent(t.id)}`,{key:o.trim()}),Q("success",`API key set for ${t.name}`),c(""),s(!1),a&&a()}catch(ae){Q("error","Failed to set key",ae.message)}}async function q(){try{await D.delete(`/credentials/${encodeURIComponent(t.id)}`),Q("info",`Removed ${t.name} key`),a&&a()}catch(ae){Q("error","Remove failed",ae.message)}}async function _(){if(C.trim()){M(!0);try{await B(t.id,C.trim()),b(!1),a&&a()}catch{}M(!1)}}if(F){const ae=((Ae=(J=t.models)==null?void 0:J.filter(ve=>!ve.disabled))==null?void 0:Ae.length)||0,Oe=()=>$.getState().setActiveView("models");return e.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[e.jsx(ia,{status:G&&ae>0?"running":"crashed",size:"sm"}),e.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:t.name}),e.jsx("div",{className:"flex-1"}),G&&ae>0?e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(De,{size:8})," ",ae," models"]}):G?e.jsx(be,{variant:"warning",className:"text-2xs",children:"No models pulled"}):e.jsx(be,{variant:"default",className:"text-2xs",children:"Not set up"})]}),e.jsx("div",{className:"flex-1",children:u?e.jsxs(e.Fragment,{children:[e.jsx(vee,{isInstalled:G,onModelChange:a}),e.jsxs("div",{className:"px-4 py-2 border-t border-border-subtle flex gap-2",children:[e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>f(!1),className:"flex-1 h-7 text-2xs",children:"Back"}),e.jsx(fe,{variant:"secondary",size:"sm",onClick:()=>{f(!1),Oe()},className:"flex-1 h-7 text-2xs gap-1",children:"Models Tab"})]})]}):e.jsxs("div",{className:"px-4 py-3 flex flex-col h-full",children:[e.jsx("div",{className:"text-xs text-text-3 font-sans flex-1",children:G&&ae>0?"Full agentic runtime — tool calling, context rotation, zero cloud cost":G?"Ollama is running. Pull a model to start using local agents.":"Run any open-source model locally — free, private, fully offline. Requires Ollama."}),e.jsxs("div",{className:"flex gap-2 mt-3",children:[G?e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>f(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[e.jsx(Ba,{size:11})," ",ae>0?"Manage":"Pull Models"]}):e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>f(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[e.jsx(Ba,{size:11})," Set Up Ollama"]}),e.jsx(fe,{variant:"secondary",size:"sm",onClick:Oe,className:"flex-1 h-7 text-2xs gap-1.5",children:"Models Tab"})]})]})})]})}const R=L==null?void 0:L.installing,U=t.installed||(L==null?void 0:L.done);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[e.jsx(ia,{status:G?"running":R?"idle":"crashed",size:"sm"}),e.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:t.name}),e.jsx("div",{className:"flex-1"}),G?e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(De,{size:8})," Ready"]}):R?e.jsxs(be,{variant:"default",className:"text-2xs gap-1",children:[e.jsx($e,{size:8,className:"animate-spin"})," Installing"]}):e.jsx(be,{variant:"default",className:"text-2xs",children:U?K?"Not signed in":"No key":"Not installed"})]}),e.jsxs("div",{className:"flex-1 flex flex-col px-4 py-3 min-h-[120px]",children:[((W=t.models)==null?void 0:W.length)>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:t.models.map(ae=>e.jsx("span",{className:"px-1.5 py-0.5 rounded bg-surface-4 text-2xs font-mono text-text-3",children:ae.name||ae.id},ae.id))}),R&&e.jsxs("div",{className:"space-y-2 mb-3",children:[e.jsx("div",{className:"h-1.5 bg-surface-4 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-accent to-accent/60 rounded-full transition-all duration-500 ease-out",style:{width:`${Math.max((L==null?void 0:L.percent)||0,5)}%`}})}),e.jsx("p",{className:"text-2xs text-text-3 font-sans",children:(L==null?void 0:L.message)||"Installing..."})]}),!U&&!R&&!n&&e.jsxs("div",{className:"flex flex-col gap-2.5 flex-1",children:[(L==null?void 0:L.error)&&e.jsx("div",{className:"p-2.5 bg-danger/5 border border-danger/15 rounded-md",children:e.jsx("p",{className:"text-2xs text-danger font-sans break-all",children:L.error})}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>I(t.id).catch(()=>{}),className:"w-full h-8 text-2xs gap-1.5",children:[e.jsx(_a,{size:11})," Install ",t.name]}),t.installCommand&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"Or install manually in your terminal:"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("code",{className:"flex-1 px-2 py-1.5 bg-surface-0 border border-border-subtle rounded text-2xs font-mono text-text-2 select-all",children:t.installCommand}),e.jsx("button",{onClick:()=>{navigator.clipboard.writeText(t.installCommand),Q("success","Copied")},className:"p-1.5 text-text-4 hover:text-text-2 cursor-pointer",children:e.jsx(wn,{size:10})})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsxs(fe,{variant:"ghost",size:"sm",onClick:async()=>{P(!0);try{await S(t.id),a&&a()}catch{}P(!1)},disabled:z,className:"h-7 text-2xs gap-1 px-2",children:[e.jsx(ra,{size:10,className:z?"animate-spin":""})," Re-check"]}),e.jsx("button",{onClick:()=>b(!O),className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans",children:"Set custom path"})]}),O&&e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:C,onChange:ae=>j(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&_(),placeholder:`/path/to/${t.id}`,className:"flex-1 h-7 px-2 text-2xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsx(fe,{variant:"primary",size:"sm",onClick:_,disabled:!C.trim()||N,className:"h-7 text-2xs px-2.5",children:N?"...":"Save"})]})})]}),U&&!G&&!n&&!R&&e.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[t.id==="claude-code"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-text-1 font-sans font-medium",children:"Sign in via terminal"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"1"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans flex items-center gap-1",children:[e.jsx(Ns,{size:10,className:"text-text-3 flex-shrink-0"}),"Open the Groove terminal below"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"2"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"claude"})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"3"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Follow the prompts to sign in with your Anthropic account"})]})]})]}),e.jsx("button",{onClick:()=>{s(!0),A(!1),c("")},className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans text-center",children:"I have an API key instead"})]}),t.id==="codex"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-text-1 font-sans font-medium",children:"Sign in via terminal"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"1"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans flex items-center gap-1",children:[e.jsx(Ns,{size:10,className:"text-text-3 flex-shrink-0"}),"Open the Groove terminal below"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"2"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"npm i -g @openai/codex"})," (if not installed)"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"3"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"codex login"})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"4"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Follow the prompts to authenticate"})]})]})]}),e.jsx("button",{onClick:()=>{s(!0),A(!1),c("")},className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans text-center",children:"I have an API key instead"})]}),t.id==="gemini"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-text-1 font-sans font-medium",children:"Add your Gemini API key"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"1"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Go to ",e.jsx("button",{onClick:()=>window.open("https://aistudio.google.com/apikey","_blank"),className:"text-accent hover:underline cursor-pointer font-sans",children:"aistudio.google.com"})," and sign in with Google"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"2"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:'Click "Create API Key" and copy it'})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"3"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Paste it below"})]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{value:o,onChange:ae=>c(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&H(),type:l?"text":"password",placeholder:"AIza...",className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:()=>A(!l),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:l?e.jsx(jn,{size:12}):e.jsx(na,{size:12})})]}),e.jsx(fe,{variant:"primary",size:"sm",onClick:H,disabled:!o.trim(),className:"w-full h-8 text-xs",children:"Save Key"})]}),t.id==="grok"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-text-1 font-sans font-medium",children:"Add your xAI API key"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"1"}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Go to ",e.jsx("button",{onClick:()=>window.open("https://console.x.ai","_blank"),className:"text-accent hover:underline cursor-pointer font-sans",children:"console.x.ai"})," and sign in"]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"2"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Create an API key and copy it"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-2xs font-bold text-accent font-mono mt-0.5",children:"3"}),e.jsx("p",{className:"text-2xs text-text-2 font-sans",children:"Paste it below"})]})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{value:o,onChange:ae=>c(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&H(),type:l?"text":"password",placeholder:"xai-...",className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:()=>A(!l),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:l?e.jsx(jn,{size:12}):e.jsx(na,{size:12})})]}),e.jsx(fe,{variant:"primary",size:"sm",onClick:H,disabled:!o.trim(),className:"w-full h-8 text-xs",children:"Save Key"})]})]}),K&&G&&!t.hasKey&&!n&&e.jsxs("div",{className:"flex items-center gap-1.5 h-8 px-2.5 bg-accent/8 border border-accent/20 rounded-md text-2xs font-sans text-accent mb-3",children:[e.jsx(De,{size:10})," Subscription active"]}),t.hasKey&&!n&&e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-1.5 h-8 px-2.5 bg-success/8 border border-success/20 rounded-md text-2xs font-sans text-success",children:[e.jsx(De,{size:10})," API Connected"]}),e.jsx("button",{onClick:()=>{s(!0),A(!1),c("")},className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans",children:"Edit"}),e.jsx("button",{onClick:q,className:"text-2xs text-text-4 hover:text-danger cursor-pointer font-sans",children:"Remove"})]}),e.jsx("div",{className:"flex-1"}),n&&e.jsxs("div",{className:"space-y-2.5 pt-1",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:t.hasKey?"Update API Key":`${t.name} API Key`}),!t.hasKey&&t.id==="claude-code"&&e.jsxs("p",{className:"text-2xs text-text-3 font-sans mb-1.5",children:["Get yours at ",e.jsx("button",{onClick:()=>window.open("https://console.anthropic.com/settings/keys","_blank"),className:"text-accent hover:underline cursor-pointer font-sans",children:"console.anthropic.com"})]}),!t.hasKey&&t.id==="codex"&&e.jsxs("p",{className:"text-2xs text-text-3 font-sans mb-1.5",children:["Get yours at ",e.jsx("button",{onClick:()=>window.open("https://platform.openai.com/api-keys","_blank"),className:"text-accent hover:underline cursor-pointer font-sans",children:"platform.openai.com"})]}),!t.hasKey&&t.id==="gemini"&&e.jsxs("p",{className:"text-2xs text-text-3 font-sans mb-1.5",children:["Get yours at ",e.jsx("button",{onClick:()=>window.open("https://aistudio.google.com/apikey","_blank"),className:"text-accent hover:underline cursor-pointer font-sans",children:"aistudio.google.com"})]}),!t.hasKey&&t.id==="grok"&&e.jsxs("p",{className:"text-2xs text-text-3 font-sans mb-1.5",children:["Get yours at ",e.jsx("button",{onClick:()=>window.open("https://console.x.ai","_blank"),className:"text-accent hover:underline cursor-pointer font-sans",children:"console.x.ai"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{value:o,onChange:ae=>c(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&H(),type:l?"text":"password",placeholder:Vqe[t.id]||"sk-...",className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:()=>A(!l),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:l?e.jsx(jn,{size:12}):e.jsx(na,{size:12})})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(fe,{variant:"primary",size:"sm",onClick:H,disabled:!o.trim(),className:"flex-1 h-8 text-xs",children:"Save Key"}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{s(!1),c("")},className:"h-8 text-xs px-3",children:"Cancel"})]})]}),G&&!n&&!t.hasKey&&K&&e.jsxs(fe,{variant:"secondary",size:"sm",onClick:()=>{s(!0),A(!1),c("")},className:"w-full h-8 text-2xs gap-1.5 mt-2",children:[e.jsx(ws,{size:11}),"Add API key for headless mode"]})]}),t.installed&&e.jsxs("div",{className:"border-t border-border-subtle",children:[e.jsxs("button",{onClick:()=>b(!O),className:"w-full flex items-center gap-2 px-4 py-2 text-left cursor-pointer hover:bg-surface-5/30 transition-colors",children:[e.jsx(Rt,{size:10,className:V("text-text-4 transition-transform duration-200",O&&"rotate-90")}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Set custom path"})]}),O&&e.jsxs("div",{className:"px-4 pb-3 space-y-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:C,onChange:ae=>j(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&_(),placeholder:`/path/to/${t.id}`,className:"flex-1 h-7 px-2 text-2xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsx(fe,{variant:"primary",size:"sm",onClick:_,disabled:!C.trim()||N,className:"h-7 text-2xs px-2.5",children:N?"...":"Save"})]}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"For non-standard install locations"})]})]})]}),e.jsx(Dqe,{open:x,onOpenChange:m,providerId:t.id,initialStep:y,onComplete:a})]})}function Of({icon:t,label:a,description:n,children:s}){return e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded bg-accent/8 flex items-center justify-center flex-shrink-0",children:e.jsx(t,{size:12,className:"text-accent"})}),e.jsx("div",{className:"text-[13px] font-medium text-text-0 font-sans leading-tight",children:a})]}),e.jsx("div",{className:"text-2xs text-text-4 font-sans leading-relaxed",children:n}),e.jsx("div",{className:"mt-auto pt-1",children:s})]})}const Oee={telegram:Xa,discord:Cn,slack:Yn},wA={telegram:"Telegram",discord:"Discord",slack:"Slack"},Zqe={telegram:"Bot token from @BotFather",discord:"Bot token from Developer Portal",slack:"Bot token (xoxb-...)"},Gqe=["critical","lifecycle","all"];function Wqe({type:t,open:a,onOpenChange:n}){if(!t)return null;const o={telegram:{title:"Set Up Telegram",icon:Xa,intro:"Create a Telegram bot and connect it to Groove in under 2 minutes. No dependencies required.",sections:[{title:"Create Your Bot",steps:[{text:"Open Telegram on any device and search for",link:"https://t.me/BotFather",linkText:"@BotFather"},{text:"Send /newbot to start the setup"},{text:"Choose a display name — we suggest GroovePilot"},{text:'Choose a username (must end in "bot") — e.g. GroovePilot_bot'},{text:"BotFather will reply with your bot token — copy it"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Telegram card"},{text:"Paste your bot token and click Save"},{text:"The gateway will connect automatically"}]},{title:"Link a Chat",steps:[{text:"Open a chat with your new bot in Telegram"},{text:'Send any message (e.g. "hello") — Groove captures the chat ID automatically'},{text:"Click Test in the gateway card to verify"}]},{title:"Commands",note:"All commands use / prefix in Telegram:",commands:["/instruct <team> <msg>","/query <team> <question>","/plan <description>","/log <team>","/brief","/tokens","/status","/agents","/help"]}]},discord:{title:"Set Up Discord",icon:Cn,intro:"Create a Discord bot and add it to your server. Requires discord.js (installed automatically with Groove).",sections:[{title:"Create the Application",steps:[{text:"Go to the",link:"https://discord.com/developers/applications",linkText:"Discord Developer Portal"},{text:"Click New Application and name it GroovePilot"},{text:"Go to the Bot tab in the left sidebar"},{text:"Click Reset Token and copy the bot token"}]},{title:"Set Permissions & Invite",steps:[{text:"Go to OAuth2 > URL Generator"},{text:"Under Scopes, check bot"},{text:"Under Bot Permissions, check:"}],scopes:["Send Messages","Read Message History","Embed Links","Use External Emojis"],after:[{text:"Copy the generated URL at the bottom and open it in your browser"},{text:"Select your server and click Authorize"}]},{title:"Enable Message Content Intent",steps:[{text:"Go back to the Bot tab in the Developer Portal"},{text:"Scroll to Privileged Gateway Intents"},{text:"Enable Message Content Intent — required for the bot to read commands"},{text:"Click Save Changes"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Discord card"},{text:"Paste your bot token and click Save"},{text:"Send a message in any channel where the bot is — Groove captures the channel automatically"}]},{title:"Commands",note:"All commands use / prefix in Discord:",commands:["/instruct <team> <msg>","/query <team> <question>","/plan <description>","/log <team>","/brief","/tokens","/status","/agents","/help"]}]},slack:{title:"Set Up Slack",icon:Yn,intro:"Create a Slack app with Socket Mode — no public URL needed. Requires @slack/bolt (installed automatically with Groove).",sections:[{title:"Create the App",steps:[{text:"Go to",link:"https://api.slack.com/apps",linkText:"api.slack.com/apps"},{text:"Click Create New App > From scratch"},{text:"Name it GroovePilot and select your workspace"}]},{title:"Enable Socket Mode",steps:[{text:"In the left sidebar, go to Settings > Socket Mode"},{text:"Toggle Enable Socket Mode to on"},{text:"It will ask you to create an App-Level Token"},{text:'Name it "groove", add the connections:write scope'},{text:"Click Generate — copy the xapp-... token (this is your App Token)"}],important:"Save this token now — you can't view it again after closing the dialog."},{title:"Set Bot Token Scopes",steps:[{text:"Go to Features > OAuth & Permissions"},{text:"Scroll to Bot Token Scopes and add all of these:"}],scopes:["chat:write","channels:read","channels:history","groups:read","groups:history","im:history","app_mentions:read"],after:[{text:"Scroll up and click Install to Workspace"},{text:"Click Allow to grant permissions"},{text:"Copy the Bot User OAuth Token (xoxb-...) — this is your Bot Token"}]},{title:"Enable Events",steps:[{text:"Go to Features > Event Subscriptions"},{text:"Toggle Enable Events to on"},{text:"Under Subscribe to bot events, add:"}],scopes:["message.channels","message.im","app_mention"],after:[{text:"Click Save Changes at the bottom"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Slack card"},{text:"Paste your Bot Token (xoxb-...) in the first field"},{text:"Paste your App Token (xapp-...) in the second field"},{text:"Click Save — Groove will auto-connect"}]},{title:"Link a Channel",steps:[{text:"Invite the bot to a channel: /invite @GroovePilot"},{text:"Select the channel from the dropdown in the gateway card"},{text:"Or @mention the bot — it will auto-capture the channel"},{text:"Click Test to verify"}],important:"For private channels, make sure you added the groups:read scope."},{title:"Commands",note:"In Slack, use plain text commands (no / prefix) or @mention the bot:",commands:["instruct <team> <msg>","query <team> <question>","plan <description>","log <team>","brief","tokens","status","agents","help","@GroovePilot status"]}]}}[t];if(!o)return null;const c=o.icon;return e.jsx(HT,{open:a,onOpenChange:n,children:e.jsx(qT,{title:o.title,width:480,children:e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-accent/5 border border-accent/15 rounded-lg",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-accent/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx(c,{size:16,className:"text-accent"})}),e.jsx("p",{className:"text-xs text-text-2 font-sans leading-relaxed",children:o.intro})]}),o.sections.map((l,A)=>{var u;return e.jsxs("div",{children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-0 font-sans mb-2.5 flex items-center gap-2",children:[e.jsx("span",{className:"w-5 h-5 rounded-full bg-accent/10 flex items-center justify-center text-2xs font-bold text-accent",children:A+1}),l.title]}),l.note&&e.jsx("p",{className:"text-2xs text-text-3 font-sans mb-2",children:l.note}),l.steps&&e.jsx("ol",{className:"space-y-2 mb-2",children:l.steps.map((f,x)=>e.jsxs("li",{className:"flex gap-2 text-2xs text-text-2 font-sans leading-relaxed",children:[e.jsxs("span",{className:"text-text-4 font-mono w-4 flex-shrink-0 pt-px",children:[x+1,"."]}),e.jsxs("span",{children:[f.text,f.link&&e.jsxs(e.Fragment,{children:[" ",e.jsxs("a",{href:f.link,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-0.5 font-medium",children:[f.linkText,e.jsx(ma,{size:9})]})]})]})]},x))}),l.scopes&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2 ml-6",children:l.scopes.map(f=>e.jsx("code",{className:"px-2 py-0.5 rounded bg-surface-4 text-2xs font-mono text-accent",children:f},f))}),l.after&&e.jsx("ol",{className:"space-y-2 mb-2",start:(((u=l.steps)==null?void 0:u.length)||0)+1,children:l.after.map((f,x)=>{var m;return e.jsxs("li",{className:"flex gap-2 text-2xs text-text-2 font-sans leading-relaxed",children:[e.jsxs("span",{className:"text-text-4 font-mono w-4 flex-shrink-0 pt-px",children:[(((m=l.steps)==null?void 0:m.length)||0)+x+1,"."]}),e.jsx("span",{children:f.text})]},x)})}),l.important&&e.jsx("div",{className:"ml-6 p-2 bg-warning/8 border border-warning/20 rounded-md text-2xs text-warning font-sans",children:l.important}),l.commands&&e.jsx("div",{className:"ml-6 p-2.5 bg-surface-0 border border-border-subtle rounded-md space-y-1",children:l.commands.map(f=>e.jsx("code",{className:"block text-2xs font-mono text-text-1",children:f},f))})]},A)}),e.jsxs("a",{href:"https://docs.groovedev.ai/guide/gateways",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium mt-2",children:[e.jsx(ma,{size:10}),"Full documentation at docs.groovedev.ai"]})]})})})}function Kqe({gateway:t,onRefresh:a}){var G,H;const[n,s]=g.useState(!1),[o,c]=g.useState(""),[l,A]=g.useState(""),[u,f]=g.useState(!1),[x,m]=g.useState(!1),[y,v]=g.useState(!1),[O,b]=g.useState([]),[C,j]=g.useState(!1),N=$(q=>q.addToast);g.useEffect(()=>{t.connected&&!t.chatId&&t.type==="slack"&&D.get(`/gateways/${encodeURIComponent(t.id)}/channels`).then(q=>b(Array.isArray(q)?q:[])).catch(()=>{})},[t.connected,t.chatId,t.id,t.type]);const M=Oee[t.type]||Jn,Q=t.type==="slack";async function L(){if(o.trim())try{await D.post(`/gateways/${encodeURIComponent(t.id)}/credentials`,{key:"bot_token",value:o.trim()}),Q&&l.trim()&&await D.post(`/gateways/${encodeURIComponent(t.id)}/credentials`,{key:"app_token",value:l.trim()}),N("success","Token saved — connecting..."),c(""),A(""),s(!1);try{await D.post(`/gateways/${encodeURIComponent(t.id)}/connect`),N("success",`${wA[t.type]} connected!`)}catch(q){N("error","Token saved but connect failed",q.message)}a()}catch(q){N("error","Failed to save token",q.message)}}async function B(){m(!0);try{await D.post(`/gateways/${encodeURIComponent(t.id)}/test`),N("success","Test message sent!")}catch(q){N("error","Test failed",q.message)}m(!1)}async function S(){v(!0);try{t.connected?(await D.post(`/gateways/${encodeURIComponent(t.id)}/disconnect`),N("info",`${wA[t.type]} disconnected`)):(await D.post(`/gateways/${encodeURIComponent(t.id)}/connect`),N("success",`${wA[t.type]} connected!`)),a()}catch(q){N("error",t.connected?"Disconnect failed":"Connect failed",q.message)}v(!1)}async function I(q){try{await D.patch(`/gateways/${encodeURIComponent(t.id)}`,{enabled:q}),a()}catch(_){N("error","Update failed",_.message)}}async function z(q){try{await D.patch(`/gateways/${encodeURIComponent(t.id)}`,{notifications:{preset:q}}),a()}catch(_){N("error","Update failed",_.message)}}async function P(q){try{await D.patch(`/gateways/${encodeURIComponent(t.id)}`,{commandPermission:q}),a()}catch(_){N("error","Update failed",_.message)}}async function F(){try{await D.delete(`/gateways/${encodeURIComponent(t.id)}`),N("info",`${wA[t.type]} gateway removed`),a()}catch(q){N("error","Delete failed",q.message)}}const K=((G=t.notifications)==null?void 0:G.preset)||"critical";return e.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[e.jsx(ia,{status:t.connected?"running":"crashed",size:"sm"}),e.jsx(M,{size:13,className:"text-text-2"}),e.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:wA[t.type]}),e.jsx("div",{className:"flex-1"}),t.connected?e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(Tr,{size:8})," Connected"]}):t.enabled?e.jsx(be,{variant:"warning",className:"text-2xs",children:"Disconnected"}):e.jsx(be,{variant:"default",className:"text-2xs",children:"Disabled"})]}),e.jsxs("div",{className:"flex-1 flex flex-col px-4 py-3 min-h-[140px]",children:[t.connected&&!n&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-1.5 h-8 px-2.5 bg-success/8 border border-success/20 rounded-md text-2xs font-sans text-success mb-3",children:[e.jsx(De,{size:10})," Gateway active",t.botUsername&&e.jsxs("span",{className:"text-text-4 ml-1",children:["@",t.botUsername]}),t.botTag&&e.jsx("span",{className:"text-text-4 ml-1",children:t.botTag})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:t.type==="slack"?"Channel":"Chat ID"}),t.chatId?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 flex items-center h-7 px-2 bg-surface-0 border border-border-subtle rounded-md text-2xs font-mono text-text-2",children:t.type==="slack"&&O.length>0?`#${((H=O.find(q=>q.id===t.chatId))==null?void 0:H.name)||t.chatId}`:t.chatId}),e.jsx("button",{onClick:async()=>{try{await D.patch(`/gateways/${encodeURIComponent(t.id)}`,{chatId:null}),a()}catch(q){N("error","Failed",q.message)}},className:"text-2xs text-text-4 hover:text-text-1 cursor-pointer font-sans",children:"Change"})]}):t.type==="slack"&&O.length>0?e.jsxs("select",{onChange:async q=>{if(q.target.value)try{await D.patch(`/gateways/${encodeURIComponent(t.id)}`,{chatId:q.target.value}),a()}catch(_){N("error","Failed to set channel",_.message)}},className:"w-full h-7 px-2 text-2xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Select a channel..."}),O.map(q=>e.jsxs("option",{value:q.id,children:["#",q.name]},q.id))]}):e.jsxs("div",{className:"text-2xs text-warning font-sans",children:[t.type==="slack"?"No channels found — invite the bot to a channel first.":"Send a message to the bot to auto-capture, or enter manually:",e.jsx("input",{placeholder:t.type==="slack"?"C0123456789":"Chat ID",className:"mt-1 w-full h-7 px-2 text-2xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",onKeyDown:async q=>{if(q.key==="Enter"&&q.target.value.trim())try{await D.patch(`/gateways/${encodeURIComponent(t.id)}`,{chatId:q.target.value.trim()}),a()}catch(_){N("error","Failed to set channel",_.message)}}})]})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:"Notifications"}),e.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:Gqe.map(q=>e.jsx("button",{onClick:()=>z(q),className:V("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer capitalize",K===q?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:q},q))})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:"Commands"}),e.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:["full","read-only"].map(q=>e.jsx("button",{onClick:()=>P(q),className:V("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer capitalize",(t.commandPermission||"full")===q?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:q==="full"?"Full Access":"Read Only"},q))})]})]}),!t.connected&&!n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-xs text-text-3 font-sans mb-2",children:t.enabled?t.hasCredentials?"Tokens saved — click Connect.":"Configure bot token to connect.":"Gateway is disabled."}),!t.hasCredentials&&e.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium cursor-pointer mb-2",children:[e.jsx(Na,{size:11}),"How to set up",e.jsx(ma,{size:9})]})]}),e.jsx(Wqe,{type:t.type,open:C,onOpenChange:j}),e.jsx("div",{className:"flex-1"}),n&&e.jsxs("div",{className:"space-y-2.5 pt-1",children:[e.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium cursor-pointer",children:[e.jsx(Na,{size:11}),"Where do I get these?"]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:"Bot Token"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{value:o,onChange:q=>c(q.target.value),onKeyDown:q=>q.key==="Enter"&&!Q&&L(),type:u?"text":"password",placeholder:Zqe[t.type],className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:()=>f(!u),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:u?e.jsx(jn,{size:12}):e.jsx(na,{size:12})})]})]}),Q&&e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:"App Token (Socket Mode)"}),e.jsx("input",{value:l,onChange:q=>A(q.target.value),onKeyDown:q=>q.key==="Enter"&&L(),type:u?"text":"password",placeholder:"xapp-...",className:"w-full h-9 px-3 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(fe,{variant:"primary",size:"sm",onClick:L,disabled:!o.trim(),className:"flex-1 h-8 text-xs",children:"Save Token"}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{s(!1),c(""),A("")},className:"h-8 text-xs px-3",children:"Cancel"})]})]}),!n&&e.jsxs("div",{className:"flex gap-2 mt-2",children:[!t.connected&&e.jsxs(fe,{variant:"primary",size:"sm",onClick:()=>s(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[e.jsx(ws,{size:11}),t.enabled?"Set Token":"Configure"]}),t.connected&&e.jsxs(e.Fragment,{children:[e.jsxs(fe,{variant:"secondary",size:"sm",onClick:B,disabled:x,className:"flex-1 h-7 text-2xs gap-1.5",children:[e.jsx(ti,{size:11}),x?"Sending...":"Test"]}),e.jsx(fe,{variant:"secondary",size:"sm",onClick:()=>s(!0),className:"h-7 text-2xs px-2.5",children:e.jsx(ws,{size:11})})]}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:S,disabled:y,className:"h-7 text-2xs px-2.5",title:t.connected?"Disconnect":"Connect",children:t.connected?e.jsx(da,{size:11}):e.jsx(Tr,{size:11})}),e.jsx(kee,{value:t.enabled,onChange:I}),e.jsx("button",{onClick:F,className:"text-text-4 hover:text-danger cursor-pointer p-1",title:"Remove gateway",children:e.jsx(At,{size:11})})]})]})]})}function Yqe({existingTypes:t,onAdd:a}){const[n,s]=g.useState(!1),o=["telegram","discord","slack"].filter(c=>!t.includes(c));return o.length===0?null:n?e.jsxs("div",{className:"flex flex-col rounded-lg border border-accent/30 bg-surface-1 overflow-hidden min-w-[220px]",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[e.jsx(Jn,{size:13,className:"text-accent"}),e.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:"Add Gateway"}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:()=>s(!1),className:"text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(Ge,{size:12})})]}),e.jsx("div",{className:"p-3 space-y-2",children:o.map(c=>{const l=Oee[c];return e.jsxs("button",{onClick:()=>{a(c),s(!1)},className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-0 hover:bg-accent/8 border border-border-subtle hover:border-accent/20 cursor-pointer transition-all group",children:[e.jsx(l,{size:14,className:"text-text-3 group-hover:text-accent"}),e.jsx("span",{className:"text-xs font-medium text-text-1 group-hover:text-accent font-sans",children:wA[c]})]},c)})})]}):e.jsxs("button",{onClick:()=>s(!0),className:"flex flex-col items-center justify-center rounded-lg border border-dashed border-border-subtle bg-surface-1/50 hover:bg-surface-1 hover:border-accent/30 min-h-[140px] min-w-[220px] cursor-pointer transition-all group",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-accent/8 group-hover:bg-accent/15 flex items-center justify-center mb-2 transition-colors",children:e.jsx(ht,{size:14,className:"text-accent"})}),e.jsx("span",{className:"text-2xs font-semibold text-text-3 group-hover:text-text-1 font-sans transition-colors",children:"Add Gateway"})]})}function Jqe(){const t=$(j=>j.trainingOptIn),a=$(j=>j.trainingStats),n=$(j=>j.setTrainingOptIn),s=$(j=>j.fetchTrainingStatus),o=$(j=>j.addToast),[c,l]=g.useState(!1),[A,u]=g.useState(!1),[f,x]=g.useState(!1);g.useEffect(()=>{s()},[]);function m(j){j?l(!0):n(!1)}async function y(){await n(!0),l(!1)}async function v(){x(!0);try{await D.post("/training/opt-in/delete"),$.setState({trainingOptIn:!1,trainingStats:null}),o("info","Training data deleted"),u(!1)}catch(j){o("error","Failed to delete data",j.message)}finally{x(!1)}}const O=(a==null?void 0:a.sessionsCaptured)??0,b=(a==null?void 0:a.envelopesSent)??0,C=(a==null?void 0:a.captureActive)??!1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Training Data"}),e.jsx("div",{className:"flex-1 h-px bg-border-subtle"})]}),e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5 max-w-md space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-6 h-6 rounded bg-accent/8 flex items-center justify-center flex-shrink-0",children:e.jsx(MA,{size:12,className:"text-accent"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-[13px] font-medium text-text-0 font-sans leading-tight",children:"Share Usage Data"}),e.jsx("div",{className:"text-2xs text-text-4 font-sans leading-relaxed mt-0.5",children:"Contribute anonymized session data to train Groove's MoE models. All data is PII-scrubbed before leaving your machine."})]}),e.jsx(kee,{value:t,onChange:m})]}),t&&e.jsxs("div",{className:"border-t border-border-subtle pt-3 space-y-2.5",children:[O===0&&b===0?e.jsx("div",{className:"text-2xs text-text-3 font-sans",children:"No data captured yet — stats will appear after your first agent session."}):e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs text-text-2 font-sans",children:"Sessions"}),e.jsx("div",{className:"text-sm font-semibold text-text-0 font-mono",children:O})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs text-text-2 font-sans",children:"Envelopes"}),e.jsx("div",{className:"text-sm font-semibold text-text-0 font-mono",children:b})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ia,{status:C?"running":"crashed",size:"sm"}),e.jsx("span",{className:"text-2xs text-text-2 font-sans",children:C?"Capturing":"Idle"})]})]}),e.jsx("div",{children:e.jsxs(fe,{variant:"ghost",size:"sm",onClick:()=>u(!0),className:"h-7 text-2xs text-danger hover:text-danger gap-1.5",children:[e.jsx(At,{size:10}),"Delete My Data"]})})]})]}),e.jsx(Ut,{open:c,onOpenChange:l,children:e.jsxs(Pt,{className:"max-w-2xl",description:"Review how your data helps build open source AI",children:[e.jsxs("div",{className:"relative bg-gradient-to-br from-accent/5 to-transparent px-6 pt-8 pb-6 text-center",children:[e.jsx(WE,{className:"absolute top-3 right-3 p-1.5 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-5 transition-colors",children:e.jsx(Ge,{size:16})}),e.jsx("div",{className:"flex justify-center mb-3",children:e.jsx("div",{className:"w-14 h-14 rounded-xl bg-accent/10 flex items-center justify-center",children:e.jsx(It,{size:32,className:"text-accent"})})}),e.jsx(kT,{className:"text-xl font-bold text-text-0 font-sans",children:"Help Build Open Source Intelligence"}),e.jsx("p",{className:"text-sm text-text-2 font-sans mt-2 max-w-md mx-auto",children:"Your usage data trains a free, local MoE model that every Groove user gets to use — including you."})]}),e.jsx("div",{className:"px-6 pt-5 pb-1",children:e.jsx("div",{className:"grid grid-cols-3 gap-3",children:[{icon:$0,title:"You Share",desc:"Anonymized agent session data: tool calls, error patterns, task flows"},{icon:Ba,title:"We Train",desc:"A Groove-specific Mixture of Experts model built on real multi-agent workflows"},{icon:m0,title:"Everyone Wins",desc:"Free, local, open source model for all Groove users. More data = smarter agents"}].map(({icon:j,title:N,desc:M})=>e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-2/50 p-3 text-center",children:[e.jsx("div",{className:"flex justify-center mb-2",children:e.jsx(j,{size:18,className:"text-accent"})}),e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans mb-1",children:N}),e.jsx("div",{className:"text-2xs text-text-2 font-sans leading-relaxed",children:M})]},N))})}),e.jsxs("div",{className:"px-6 pt-4",children:[e.jsx("div",{className:"text-xs font-semibold uppercase text-text-3 tracking-wider font-sans mb-2.5",children:"What We Collect"}),e.jsx("div",{className:"space-y-1.5",children:["Agent tool calling patterns","Error and recovery sequences","Task complexity and coordination events","Model and provider usage metadata","Session duration and outcomes"].map(j=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(De,{size:12,className:"text-accent flex-shrink-0"}),e.jsx("span",{className:"text-xs text-text-1 font-sans",children:j})]},j))}),e.jsx("p",{className:"text-xs text-text-0 font-sans font-medium mt-3",children:"That's it. Groove orchestration data only."})]}),e.jsx("div",{className:"px-6 pt-4",children:e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-2/30 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[e.jsx(La,{size:14,className:"text-text-2"}),e.jsx("span",{className:"text-xs font-semibold uppercase text-text-3 tracking-wider font-sans",children:"What We Never Collect"})]}),e.jsx("div",{className:"space-y-1.5",children:["Your source code or file contents","API keys, passwords, or credentials","Personal information — emails, names, file paths","Anything that could identify your IP or projects"].map(j=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{size:12,className:"text-danger flex-shrink-0"}),e.jsx("span",{className:"text-xs text-text-1 font-sans",children:j})]},j))}),e.jsx("p",{className:"text-xs text-text-0 font-sans font-medium mt-3",children:"13 categories of PII are automatically scrubbed before any data leaves your machine."})]})}),e.jsx("div",{className:"px-6 pt-4",children:e.jsx("div",{className:"border-l-2 border-accent/30 pl-3",children:e.jsx("p",{className:"text-xs text-text-3 italic leading-relaxed font-sans",children:"We believe in open source, decentralized intelligence. Not walled gardens. Not data hoarding. Every contribution makes the model better for everyone. We need your help to get there."})})}),e.jsxs("div",{className:"border-t border-border-subtle mt-5 pt-4 pb-1 px-6",children:[e.jsx(fe,{variant:"primary",size:"sm",onClick:y,className:"w-full h-10 text-sm font-semibold",children:"Join the Movement — Start Contributing"}),e.jsx("div",{className:"text-center mt-2.5",children:e.jsx("button",{onClick:()=>l(!1),className:"text-xs text-text-3 hover:text-text-1 transition-colors font-sans cursor-pointer",children:"Not now"})}),e.jsx("p",{className:"text-center text-2xs text-text-4 font-sans mt-2 mb-1",children:"You can opt out and delete your data anytime in Settings"})]})]})}),e.jsx(Ut,{open:A,onOpenChange:u,children:e.jsxs(Pt,{title:"Delete Training Data",description:"Confirm permanent deletion of all collected training data.",children:[e.jsx("div",{className:"px-5 py-4",children:e.jsx("p",{className:"text-xs text-text-1 font-sans leading-relaxed",children:"This will permanently delete all your collected training data and opt you out. This cannot be undone."})}),e.jsxs("div",{className:"flex items-center gap-2 px-5 py-4 border-t border-border-subtle",children:[e.jsx(fe,{variant:"danger",size:"sm",onClick:v,disabled:f,className:"flex-1 h-8 text-xs",children:f?"Deleting...":"Delete All Data"}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>u(!1),className:"h-8 text-xs px-3",children:"Cancel"})]})]})})]})}function eDe(){const t=$(m=>m.networkUnlocked),a=$(m=>m.activateBeta),n=$(m=>m.deactivateBeta),[s,o]=g.useState(""),[c,l]=g.useState(!1),[A,u]=g.useState("");g.useEffect(()=>{if(!A)return;const m=setTimeout(()=>u(""),3e3);return()=>clearTimeout(m)},[A]);async function f(){const m=s.trim();if(!(!m||c)){l(!0),u("");try{await a(m),o("")}catch(y){u(y.message||"Invalid code")}finally{l(!1)}}}async function x(){try{await n()}catch{}}return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Early Access"}),e.jsx("div",{className:"flex-1 h-px bg-border-subtle"})]}),e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5 max-w-md",children:[t?e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-success/10 flex items-center justify-center flex-shrink-0",children:e.jsx(De,{size:12,className:"text-success"})}),e.jsx("div",{className:"flex-1 text-xs font-sans text-text-1",children:"Early access enabled"}),e.jsx("button",{onClick:x,className:"text-2xs text-text-4 hover:text-danger cursor-pointer font-sans",children:"Deactivate"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j0,{size:12,className:"text-text-4 flex-shrink-0"}),e.jsx("input",{value:s,onChange:m=>o(m.target.value),onKeyDown:m=>m.key==="Enter"&&f(),type:"text",placeholder:"Enter invite code",className:"flex-1 h-8 px-2.5 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsx(fe,{variant:"primary",size:"sm",onClick:f,disabled:!s.trim()||c,className:"h-8 text-xs px-3",children:c?"...":"Submit"})]}),A&&!t&&e.jsx("div",{className:"mt-2 text-2xs text-danger font-sans",children:A})]})]})}function tDe(){var L,B;const[t,a]=g.useState([]),[n,s]=g.useState(null),[o,c]=g.useState(null),[l,A]=g.useState([]),[u,f]=g.useState(!0),[x,m]=g.useState(!1),y=$(S=>S.addToast),v=$(S=>S.remoteHomedir),O=$(S=>S._providerRefreshTick);function b(){D.get("/providers").then(S=>a(Array.isArray(S)?S:[])).catch(()=>{})}function C(){D.get("/gateways").then(S=>A(Array.isArray(S)?S:[])).catch(()=>{})}g.useEffect(()=>{Promise.all([D.get("/providers"),D.get("/config"),D.get("/status"),D.get("/gateways")]).then(([S,I,z,P])=>{a(Array.isArray(S)?S:[]),s(I),c(z),A(Array.isArray(P)?P:[]),f(!1)}).catch(()=>f(!1))},[]),g.useEffect(()=>{O&&b()},[O]);async function j(S){try{await D.post("/gateways",{type:S}),y("success",`${wA[S]} gateway added`),C()}catch(I){y("error","Failed to add gateway",I.message)}}async function N(S,I){try{const z=await D.patch("/config",{[S]:I});s(z)}catch(z){y("error","Update failed",z.message)}}if(u)return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("div",{className:"h-12 bg-surface-1 border-b border-border"}),e.jsxs("div",{className:"flex-1 p-4 space-y-4",children:[e.jsx("div",{className:"grid grid-cols-4 gap-3",children:[...Array(4)].map((S,I)=>e.jsx(Xn,{className:"h-40 rounded-lg"},I))}),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:[...Array(6)].map((S,I)=>e.jsx(Xn,{className:"h-28 rounded-lg"},I))})]})]});const M=t.filter(S=>S.id!=="groove-network"),Q=M.filter(S=>{var I;return S.authType==="local"?S.installed:S.authType==="subscription"?S.installed&&((I=S.authStatus)==null?void 0:I.authenticated):S.installed&&S.hasKey}).length;return n!=null&&n.rotationThreshold,e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 bg-surface-1 border-b border-border flex-shrink-0",children:[e.jsx("h2",{className:"text-sm font-semibold text-text-0 font-sans",children:"Settings"}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-4 text-2xs text-text-3 font-sans",children:[(o==null?void 0:o.version)&&e.jsxs("span",{children:["v",o.version]}),(o==null?void 0:o.port)&&e.jsxs("span",{children:[":",o.port]}),(o==null?void 0:o.uptime)>0&&e.jsxs("span",{children:["Up ",WA(o.uptime)]})]}),e.jsx(ia,{status:"running",size:"sm"})]}),e.jsx(it,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Providers"}),e.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),e.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:[Q,"/",M.length," connected"]})]}),e.jsx("div",{className:"grid grid-cols-4 gap-3",children:M.map(S=>e.jsx(Xqe,{provider:S,onKeyChange:b},S.id))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Gateways"}),e.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),e.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:[l.filter(S=>S.connected).length,"/",l.length," connected"]})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[l.map(S=>e.jsx(Kqe,{gateway:S,onRefresh:C},S.id)),e.jsx(Yqe,{existingTypes:l.map(S=>S.type),onAdd:j})]})]}),n&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Configuration"}),e.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Auto-saves"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsx(Of,{icon:Ba,label:"Default Provider",description:"Provider used when spawning new agents.",children:e.jsx("select",{value:n.defaultProvider||"claude-code",onChange:S=>N("defaultProvider",S.target.value),className:"w-full h-8 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",children:M.filter(S=>{var I;return S.installed&&(S.authType==="local"||S.authType==="subscription"&&((I=S.authStatus)==null?void 0:I.authenticated)||S.hasKey)}).map(S=>e.jsx("option",{value:S.id,children:S.name},S.id))})}),e.jsx(Of,{icon:Ba,label:"Default Model",description:"Model used for new agents. Auto routes by role.",children:e.jsxs("select",{value:n.defaultModel||"",onChange:S=>N("defaultModel",S.target.value||null),className:"w-full h-8 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",children:[e.jsx("option",{value:"",children:"Auto (route by role)"}),(((L=t.find(S=>S.id===(n.defaultProvider||"claude-code")))==null?void 0:L.models)||[]).map(S=>e.jsx("option",{value:S.id,children:S.name},S.id))]})}),e.jsx(Of,{icon:ga,label:"Working Directory",description:"Default root directory for new agents.",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("code",{className:"flex-1 h-8 px-2 flex items-center bg-surface-0 border border-border-subtle rounded-md text-2xs font-mono text-text-2 truncate min-w-0",children:n.defaultWorkingDir||"Project root"}),e.jsx(fe,{variant:"secondary",size:"sm",onClick:async()=>{var S,I;if((I=(S=window.groove)==null?void 0:S.folders)!=null&&I.select){const z=await window.groove.folders.select({title:"Select Working Directory",defaultPath:(n==null?void 0:n.defaultWorkingDir)||void 0});z&&N("defaultWorkingDir",z)}else m(!0)},className:"h-8 px-2 flex-shrink-0",children:e.jsx(SA,{size:12})})]})}),e.jsx(Of,{icon:Cn,label:"Default Chat Model",description:"Provider and model for new chat conversations.",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("select",{value:n.defaultChatProvider||n.defaultProvider||"claude-code",onChange:S=>{N("defaultChatProvider",S.target.value);const I=t.find(P=>P.id===S.target.value),z=((I==null?void 0:I.models)||[]).filter(P=>{const F=(typeof P=="string"?P:P.id||"").toLowerCase();return!F.includes("dall-e")&&!F.includes("imagen")&&!F.includes("image")});if(z.length>0){const P=typeof z[0]=="string"?z[0]:z[0].id;N("defaultChatModel",P)}},className:"w-full h-8 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",children:M.filter(S=>{var I;return S.installed&&(S.authType==="local"||S.authType==="subscription"&&((I=S.authStatus)==null?void 0:I.authenticated)||S.hasKey)}).map(S=>e.jsx("option",{value:S.id,children:S.name},S.id))}),e.jsxs("select",{value:n.defaultChatModel||"",onChange:S=>N("defaultChatModel",S.target.value||null),className:"w-full h-8 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",children:[e.jsx("option",{value:"",children:"Auto (Sonnet)"}),(((B=t.find(S=>S.id===(n.defaultChatProvider||n.defaultProvider||"claude-code")))==null?void 0:B.models)||[]).filter(S=>{const I=(typeof S=="string"?S:S.id||"").toLowerCase();return!I.includes("dall-e")&&!I.includes("imagen")&&!I.includes("image")}).map(S=>{const I=typeof S=="string"?S:S.id,z=typeof S=="string"?S:S.name||S.id;return e.jsx("option",{value:I,children:z},I)})]})]})})]})]}),e.jsx(eDe,{}),e.jsx(Jqe,{})]})}),e.jsx(Hu,{open:x,onOpenChange:m,currentPath:(n==null?void 0:n.defaultWorkingDir)||v||"/",homePath:v,onSelect:S=>N("defaultWorkingDir",S)})]})}const bee={light:"text-green-400",medium:"text-blue-400",heavy:"text-orange-400"};function iT(t){return t?t<1024*1024?`${(t/1024).toFixed(0)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`:"—"}function aDe(t){return t?t<1024*1024?`${(t/1024).toFixed(0)} KB/s`:`${(t/(1024*1024)).toFixed(1)} MB/s`:""}function nDe({serverRunning:t,installed:a,onStart:n,onStop:s,onRestart:o,actionInProgress:c}){return a?t?e.jsxs("div",{className:"flex items-center gap-2 bg-success/8 border border-success/20 rounded-lg px-3 py-2",children:[e.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[e.jsx("span",{className:"absolute inset-0 rounded-full bg-success"}),e.jsx("span",{className:"absolute inset-[-2px] rounded-full bg-success opacity-20 animate-pulse"})]}),e.jsx("span",{className:"text-xs font-sans text-success font-semibold",children:"Server Running"}),e.jsx("span",{className:"text-2xs font-mono text-text-4",children:":11434"}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{onClick:o,disabled:!!c,className:"flex items-center gap-1 text-2xs font-sans text-text-3 hover:text-accent cursor-pointer transition-colors disabled:opacity-40",children:[e.jsx(ra,{size:10,className:c==="restarting"?"animate-spin":""}),c==="restarting"?"Restarting...":"Restart"]}),e.jsxs("button",{onClick:s,disabled:!!c,className:"flex items-center gap-1 text-2xs font-sans text-text-3 hover:text-danger cursor-pointer transition-colors disabled:opacity-40",children:[e.jsx(Gr,{size:10}),c==="stopping"?"Stopping...":"Stop"]})]}):e.jsxs("div",{className:"flex items-center gap-2 bg-danger/8 border border-danger/20 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full bg-danger flex-shrink-0"}),e.jsx("span",{className:"text-xs font-sans text-danger font-semibold",children:"Server Stopped"}),e.jsx("span",{className:"text-2xs font-mono text-text-4",children:":11434"}),e.jsx("div",{className:"flex-1"}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:n,disabled:!!c,className:"h-6 px-2.5 text-2xs gap-1",children:[e.jsx(ei,{size:10}),c==="starting"?"Starting...":"Start Server"]})]}):e.jsxs("div",{className:"flex items-center gap-2 bg-surface-1 border border-border-subtle rounded-lg px-3 py-2",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full bg-text-4 flex-shrink-0"}),e.jsx("span",{className:"text-xs font-sans text-text-3 font-medium",children:"Ollama Not Installed"}),e.jsx("div",{className:"flex-1"}),e.jsx("a",{href:"https://ollama.ai/download",target:"_blank",rel:"noopener noreferrer",className:"text-2xs font-sans text-accent hover:underline",children:"Install Ollama"})]})}function sDe({hardware:t}){return t?e.jsxs("div",{className:"flex items-center gap-4 px-3 py-2 bg-surface-1 border border-border-subtle rounded-lg text-xs font-sans text-text-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(M0,{size:14,className:"text-text-3"}),e.jsxs("span",{children:[t.totalRamGb," GB RAM"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Ba,{size:14,className:"text-text-3"}),e.jsxs("span",{children:[t.cores," cores"]})]}),t.gpu&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Kn,{size:14,className:"text-text-3"}),e.jsxs("span",{children:[t.gpu.name,t.gpu.vram?` (${t.gpu.vram} GB)`:""]})]}),t.isAppleSilicon&&e.jsx(be,{variant:"accent",className:"text-2xs ml-auto",children:"Unified Memory"})]}):null}function rDe({model:t,onUnload:a,onSpawn:n,unloading:s}){const o=t.size?(t.size/1073741824).toFixed(1):"?",c=t.vram?(t.vram/1024**3).toFixed(1):o;return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-success/5 border border-success/20 rounded-lg",children:[e.jsxs("span",{className:"relative flex-shrink-0 w-2 h-2",children:[e.jsx("span",{className:"absolute inset-0 rounded-full bg-success"}),e.jsx("span",{className:"absolute inset-[-2px] rounded-full bg-success opacity-20 animate-pulse"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate",children:t.name}),e.jsx(be,{variant:"success",className:"text-2xs",children:"Running"})]}),e.jsxs("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:[c," GB VRAM · loaded in memory"]})]}),e.jsxs("button",{onClick:()=>n(t.name),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-2xs font-sans font-medium bg-accent/10 text-accent hover:bg-accent/20 transition-colors cursor-pointer",children:[e.jsx(es,{size:11}),"Spawn Agent"]}),e.jsx("button",{onClick:()=>a(t.name),disabled:s===t.name,className:"p-1.5 rounded-md text-text-4 hover:text-warning hover:bg-warning/10 transition-colors cursor-pointer disabled:opacity-40",title:"Unload from memory",children:s===t.name?e.jsx($e,{size:14,className:"animate-spin"}):e.jsx(Gr,{size:14})})]})}function oDe({model:t,catalogEntry:a,isRunning:n,onStart:s,onSpawn:o,onDelete:c,loading:l,deleting:A,serverRunning:u}){return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-surface-1 border border-border-subtle rounded-lg",children:[e.jsx(on,{size:18,className:V("flex-shrink-0",n?"text-success":"text-accent")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate",children:t.id}),t.tier&&e.jsx("span",{className:V("text-2xs font-semibold capitalize",bee[t.tier]||"text-text-3"),children:t.tier}),t.category&&t.category!=="other"&&e.jsx(be,{variant:"subtle",className:"text-2xs",children:t.category}),n&&e.jsx(be,{variant:"success",className:"text-2xs",children:"Running"})]}),e.jsxs("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:[t.size||"—",(a==null?void 0:a.ramGb)&&e.jsxs(e.Fragment,{children:[" · ~",a.ramGb," GB RAM needed"]}),(a==null?void 0:a.description)&&e.jsxs(e.Fragment,{children:[" · ",a.description]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[!n&&u&&e.jsxs("button",{onClick:()=>s(t.id),disabled:!!l,className:"flex items-center gap-1 px-2 py-1.5 rounded-md text-2xs font-sans font-medium text-text-2 hover:text-success hover:bg-success/10 transition-colors cursor-pointer disabled:opacity-40",title:"Load into memory",children:[l===t.id?e.jsx($e,{size:11,className:"animate-spin"}):e.jsx(ei,{size:11}),"Start"]}),e.jsxs("button",{onClick:()=>o(t.id),className:"flex items-center gap-1 px-2 py-1.5 rounded-md text-2xs font-sans font-medium text-accent hover:bg-accent/10 transition-colors cursor-pointer",title:"Spawn an agent with this model",children:[e.jsx(es,{size:11}),"Spawn"]}),e.jsx("button",{onClick:()=>c(t.id),disabled:A===t.id,className:"p-1.5 rounded-md text-text-4 hover:text-red-400 hover:bg-red-400/10 transition-colors cursor-pointer disabled:opacity-40",title:"Delete model",children:A===t.id?e.jsx($e,{size:13,className:"animate-spin"}):e.jsx(At,{size:13})})]})]})}function iDe({model:t,onImport:a,onDelete:n,importing:s,deleting:o}){return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-surface-1 border border-border-subtle rounded-lg",children:[e.jsx(on,{size:18,className:"flex-shrink-0 text-purple-400"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate",children:t.id}),t.quantization&&e.jsx(be,{variant:"subtle",className:"text-2xs",children:t.quantization}),t.parameters&&e.jsx("span",{className:"text-2xs font-semibold text-blue-400",children:t.parameters}),e.jsx(be,{variant:"accent",className:"text-2xs",children:"GGUF"})]}),e.jsxs("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:[t.sizeBytes?iT(t.sizeBytes):"—",t.repoId&&e.jsxs(e.Fragment,{children:[" · ",t.repoId]}),t.contextWindow&&e.jsxs(e.Fragment,{children:[" · ",(t.contextWindow/1024).toFixed(0),"K context"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("button",{onClick:()=>a(t.id),disabled:s===t.id||o===t.id,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-2xs font-sans font-medium bg-accent/10 text-accent hover:bg-accent/20 transition-colors cursor-pointer disabled:opacity-40",title:"Import into Ollama so you can use it to spawn agents",children:[s===t.id?e.jsx($e,{size:11,className:"animate-spin"}):e.jsx(es,{size:11}),s===t.id?"Importing...":"Import to Ollama"]}),e.jsx("button",{onClick:()=>n(t.id),disabled:o===t.id||s===t.id,className:"p-1.5 rounded-md text-text-4 hover:text-red-400 hover:bg-red-400/10 transition-colors cursor-pointer disabled:opacity-40",title:"Delete model file",children:o===t.id?e.jsx($e,{size:13,className:"animate-spin"}):e.jsx(At,{size:13})})]})]})}function cDe({download:t}){const a=Math.round((t.percent||0)*100);return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-2xs font-sans text-text-3",children:[e.jsx("span",{children:t.filename}),e.jsxs("span",{children:[a,"% ",aDe(t.speed)]})]}),e.jsx("div",{className:"h-1.5 bg-surface-3 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-accent rounded-full transition-all",style:{width:`${a}%`}})}),e.jsxs("div",{className:"text-2xs text-text-4",children:[iT(t.downloaded)," / ",iT(t.totalBytes)]})]})}function lDe({modelId:t,progress:a}){return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-accent/5 border border-accent/20 rounded-lg",children:[e.jsx($e,{size:14,className:"animate-spin text-accent flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs font-mono text-text-0",children:t}),e.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:a.progress||"Pulling..."})]})]})}function dDe({model:t,systemRamGb:a,onPull:n,pulling:s,isInstalled:o}){const c={code:"{}",general:"AI"},l=a?Math.round((1-t.ramGb/a)*100):null;return e.jsxs("div",{className:V("flex items-center gap-3 px-4 py-3 border rounded-lg transition-colors",o?"bg-success/5 border-success/20":"bg-surface-1 border-border-subtle hover:border-accent/20"),children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-surface-3 flex items-center justify-center text-xs font-mono text-text-2 flex-shrink-0",children:c[t.category]||"AI"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate",children:t.name}),e.jsx("span",{className:V("text-2xs font-semibold capitalize",bee[t.tier]),children:t.tier}),o&&e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(De,{size:8})," Installed"]})]}),e.jsx("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:t.description}),e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-2xs font-sans",children:[e.jsxs("span",{className:"text-text-2",children:[t.sizeGb," GB download"]}),e.jsxs("span",{className:"text-green-400 font-medium",children:[t.ramGb," GB RAM"]}),l!==null&&e.jsxs("span",{className:"text-text-4",children:[l,"% headroom"]})]})]}),o?e.jsx("span",{className:"text-xs text-success font-sans font-medium px-3 py-1.5",children:"Ready"}):e.jsxs("button",{onClick:()=>n(t.id),disabled:s===t.id,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-sans font-medium bg-accent/10 text-accent hover:bg-accent/20 transition-colors cursor-pointer disabled:opacity-40",children:[s===t.id?e.jsx($e,{size:12,className:"animate-spin"}):e.jsx(_a,{size:12}),"Pull"]})]})}function ADe({result:t,onExpand:a,expanded:n}){var s;return e.jsxs("button",{onClick:()=>a(n?null:t.id),className:"w-full text-left px-4 py-3 bg-surface-1 border border-border-subtle rounded-lg hover:border-accent/30 transition-colors cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate flex-1",children:t.name}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:t.author}),n?e.jsx(bt,{size:14,className:"text-text-3"}):e.jsx(Rt,{size:14,className:"text-text-3"})]}),e.jsxs("div",{className:"text-2xs text-text-3 font-sans mt-0.5 flex gap-3",children:[e.jsxs("span",{children:[(s=t.downloads)==null?void 0:s.toLocaleString()," downloads"]}),e.jsxs("span",{children:[t.likes," likes"]})]})]})}function uDe({repoId:t,onDownload:a,systemRamGb:n}){const[s,o]=g.useState(null),[c,l]=g.useState(!0),[A,u]=g.useState(null),f=ln();g.useEffect(()=>{l(!0),D.get(`/models/${t}/files`).then(m=>o(m.files||[])).catch(()=>f.error("Failed to load model files")).finally(()=>l(!1))},[t]);async function x(m){u(m.filename);try{await D.post("/models/download",{repoId:t,filename:m.filename}),f.success(`Downloading ${m.filename}`),a==null||a(m.filename)}catch(y){f.error(y.message)}u(null)}return c?e.jsx("div",{className:"py-3 px-4 text-2xs text-text-4 font-sans",children:"Loading quantization variants..."}):s!=null&&s.length?e.jsx("div",{className:"pl-6 pr-4 pb-2 space-y-1.5",children:s.map(m=>{const y=!m.estimatedRamGb||!n||m.estimatedRamGb<=n,v=m.estimatedRamGb&&n&&m.estimatedRamGb>n*.8&&y;return e.jsxs("div",{className:V("flex items-center gap-2 py-1.5 px-3 rounded-md text-xs font-sans",y?"bg-surface-2":"bg-red-500/5 border border-red-500/15"),children:[e.jsx("span",{className:"font-mono text-text-1 truncate flex-1",children:m.filename}),m.quantization&&e.jsx(be,{variant:"subtle",className:"text-2xs",children:m.quantization}),e.jsx("span",{className:"text-text-2 text-2xs w-16 text-right",children:iT(m.size)}),m.estimatedRamGb&&e.jsxs("span",{className:V("text-2xs w-20 text-right font-medium",y?v?"text-yellow-400":"text-green-400":"text-red-400"),children:["~",m.estimatedRamGb," GB RAM"]}),!y&&e.jsx("span",{className:"text-2xs text-red-400 font-medium",children:"too large"}),e.jsx("button",{onClick:()=>x(m),disabled:A===m.filename||!y,className:V("p-1 rounded transition-colors",y?"text-accent hover:bg-accent/10":"text-text-4 cursor-not-allowed","disabled:opacity-40"),children:A===m.filename?e.jsx($e,{size:13,className:"animate-spin"}):e.jsx(_a,{size:13})})]},m.filename)})}):e.jsx("div",{className:"py-3 px-4 text-2xs text-text-4 font-sans",children:"No GGUF files found in this repo."})}function xP({title:t,count:a,icon:n}){return e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n&&e.jsx(n,{size:14,className:"text-text-3"}),e.jsx("span",{className:"text-xs font-semibold font-sans text-text-2 uppercase tracking-wider",children:t}),a!==void 0&&e.jsx(be,{variant:"subtle",className:"text-2xs",children:a})]})}function hDe(){var Me;const[t,a]=g.useState("recommended"),[n,s]=g.useState(""),[o,c]=g.useState([]),[l,A]=g.useState(!1),[u,f]=g.useState([]),[x,m]=g.useState([]),[y,v]=g.useState(null),[O,b]=g.useState(null),[C,j]=g.useState(null),[N,M]=g.useState(null),[Q,L]=g.useState(null),[B,S]=g.useState([]),[I,z]=g.useState(null),[P,F]=g.useState(null),K=ln(),G=$(ie=>ie.ollamaStatus),H=$(ie=>ie.ollamaInstalledModels),q=$(ie=>ie.ollamaRunningModels),_=$(ie=>ie.ollamaCatalog),R=$(ie=>ie.ollamaPullProgress),U=$(ie=>ie.fetchOllamaStatus),Z=$(ie=>ie.startOllamaServer),J=$(ie=>ie.stopOllamaServer),Ae=$(ie=>ie.restartOllamaServer),W=$(ie=>ie.pullOllamaModel),ae=$(ie=>ie.deleteOllamaModel),Oe=$(ie=>ie.loadOllamaModel),ve=$(ie=>ie.unloadOllamaModel),ce=$(ie=>ie.spawnFromModel),he=g.useRef(null);g.useEffect(()=>(U(),he.current=setInterval(U,1e4),()=>clearInterval(he.current)),[U]),g.useEffect(()=>{D.get("/models/recommended").then(ie=>{f(ie.models||[])}).catch(()=>{}),D.get("/models/installed").then(ie=>{S((ie.models||[]).filter(Re=>Re.exists))}).catch(()=>{})},[]),g.useEffect(()=>{const ie=setInterval(()=>{D.get("/models/downloads").then(m).catch(()=>{})},2e3);return()=>clearInterval(ie)},[]),g.useEffect(()=>{function ie(xt){try{const St=JSON.parse(xt.data);St.type==="model:download:progress"&&m(at=>{const va=at.findIndex(Mn=>Mn.filename===St.data.filename);if(va>=0){const Mn=[...at];return Mn[va]=St.data,Mn}return[...at,St.data]}),St.type==="model:download:complete"&&(m(at=>at.filter(va=>va.filename!==St.data.filename)),K.success(`${St.data.filename} downloaded`),D.get("/models/installed").then(at=>{S((at.models||[]).filter(va=>va.exists))}).catch(()=>{})),St.type==="model:download:error"&&(m(at=>at.filter(va=>va.filename!==St.data.filename)),K.error(`Download failed: ${St.data.error}`))}catch{}}const Re=$.getState().ws;return Re&&Re.addEventListener("message",ie),()=>{Re&&Re.removeEventListener("message",ie)}},[K]);async function je(){b("starting");try{await Z()}catch{}b(null)}async function ee(){b("stopping");try{await J()}catch{}b(null)}async function ke(){b("restarting");try{await Ae()}catch{}b(null)}async function ye(ie){j(ie);try{await Oe(ie)}catch{}j(null)}async function Ne(ie){M(ie);try{await ve(ie)}catch{}M(null)}async function ze(ie){L(ie);try{await ae(ie)}catch{}L(null)}async function He(ie){F(ie);try{const Re=await D.post(`/models/${encodeURIComponent(ie)}/import-to-ollama`);K.success(`Imported as "${Re.ollamaName}" — now available in Ollama`),U(),S(xt=>xt.filter(St=>St.id!==ie))}catch(Re){K.error(`Import failed: ${Re.message}`)}F(null)}async function Tt(ie){z(ie);try{await D.delete(`/models/${encodeURIComponent(ie)}`),S(Re=>Re.filter(xt=>xt.id!==ie)),K.success(`Removed ${ie}`)}catch(Re){K.error(`Delete failed: ${Re.message}`)}z(null)}async function Et(ie){W(ie)}async function ya(){if(n.trim()){A(!0),a("search");try{const ie=await D.get(`/models/search?q=${encodeURIComponent(n.trim())}`);c(ie)}catch(ie){K.error(ie.message)}A(!1)}}new Set(H.map(ie=>ie.id));const Nn=new Set(q.map(ie=>ie.name)),Wt={};for(const ie of _){const Re=ie.id.split(":")[0];Wt[Re]=ie,Wt[ie.id]=ie}function se(ie){if(Wt[ie])return Wt[ie];const Re=ie.split(":")[0];return Wt[Re]||null}return e.jsxs("div",{className:"h-full flex flex-col bg-surface-0",children:[e.jsxs("div",{className:"flex-shrink-0 px-5 pt-4 pb-3 border-b border-border space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-base font-bold font-sans text-text-0",children:"Local Models"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(be,{variant:"subtle",className:"text-2xs",children:[H.length+B.length," installed"]}),q.length>0&&e.jsxs(be,{variant:"success",className:"text-2xs",children:[q.length," running"]})]})]}),e.jsx(nDe,{serverRunning:G.serverRunning,installed:G.installed,onStart:je,onStop:ee,onRestart:ke,actionInProgress:O}),e.jsx(sDe,{hardware:G.hardware})]}),x.length>0&&e.jsxs("div",{className:"px-5 py-3 border-b border-border space-y-2",children:[e.jsx("div",{className:"text-xs font-sans font-semibold text-text-2",children:"Downloading"}),x.map(ie=>e.jsx(cDe,{download:ie},ie.filename))]}),Object.keys(R).length>0&&e.jsxs("div",{className:"px-5 py-3 border-b border-border space-y-2",children:[e.jsx("div",{className:"text-xs font-sans font-semibold text-text-2",children:"Pulling Models"}),Object.entries(R).map(([ie,Re])=>e.jsx(lDe,{modelId:ie,progress:Re},ie))]}),e.jsx(it,{className:"flex-1",children:e.jsxs("div",{className:"px-5 py-4 space-y-6",children:[e.jsxs("div",{children:[e.jsx(xP,{title:"Running Models",count:q.length,icon:wt}),q.length===0?e.jsx("div",{className:"px-4 py-4 bg-surface-1 border border-border-subtle rounded-lg text-center",children:e.jsx("p",{className:"text-xs text-text-3 font-sans",children:G.serverRunning?"No models loaded — start one below":"Start the server to load models"})}):e.jsx("div",{className:"space-y-2",children:q.map(ie=>e.jsx(rDe,{model:ie,onUnload:Ne,onSpawn:ce,unloading:N},ie.name))})]}),e.jsxs("div",{children:[e.jsx(xP,{title:"Installed Models",count:H.length,icon:Kn}),H.length===0?e.jsxs("div",{className:"px-4 py-6 bg-surface-1 border border-border-subtle rounded-lg text-center",children:[e.jsx(on,{size:32,className:"mx-auto text-text-4 mb-2"}),e.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"No models installed"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Pull a model from the Recommended section below, or search HuggingFace."})]}):e.jsx("div",{className:"space-y-2",children:H.map(ie=>e.jsx(oDe,{model:ie,catalogEntry:se(ie.id),isRunning:Nn.has(ie.id),onStart:ye,onSpawn:ce,onDelete:ze,loading:C,deleting:Q,serverRunning:G.serverRunning},ie.id))})]}),B.length>0&&e.jsxs("div",{children:[e.jsx(xP,{title:"Downloaded Models (GGUF)",count:B.length,icon:_a}),e.jsx("div",{className:"space-y-2",children:B.map(ie=>e.jsx(iDe,{model:ie,onImport:He,onDelete:Tt,importing:P,deleting:I},ie.id))})]}),e.jsx("div",{className:"border-t border-border-subtle"}),e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center justify-between mb-3",children:e.jsx("span",{className:"text-xs font-semibold font-sans text-text-2 uppercase tracking-wider",children:"Discover Models"})}),e.jsxs("div",{className:"flex gap-2 mb-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(oa,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{value:n,onChange:ie=>s(ie.target.value),onKeyDown:ie=>ie.key==="Enter"&&ya(),placeholder:"Search HuggingFace for GGUF models...",className:"w-full h-8 pl-9 pr-3 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsx(fe,{onClick:ya,disabled:l,size:"sm",variant:"accent",children:l?e.jsx($e,{size:14,className:"animate-spin"}):"Search"})]}),e.jsx("div",{className:"flex gap-1 mb-3",children:[{id:"recommended",label:`Recommended (${u.length})`},{id:"search",label:`Search (${o.length})`}].map(ie=>e.jsx("button",{onClick:()=>a(ie.id),className:V("px-3 py-1 rounded-md text-xs font-sans font-medium transition-colors cursor-pointer",t===ie.id?"bg-accent/12 text-accent":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:ie.label},ie.id))}),e.jsxs("div",{className:"space-y-2",children:[t==="recommended"&&e.jsx(e.Fragment,{children:u.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Ba,{size:32,className:"mx-auto text-text-4 mb-2"}),e.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"Detecting hardware..."}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Make sure Ollama is installed so we can check your system."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-xs text-text-3 font-sans mb-2",children:["Top models for your system (",((Me=G.hardware)==null?void 0:Me.totalRamGb)||"?"," GB RAM). Click Pull to download via Ollama."]}),u.map(ie=>{var St;const Re=ie.id.split(":")[0],xt=H.some(at=>at.id===ie.id||at.id.startsWith(Re+":")||at.id===Re);return e.jsx(dDe,{model:ie,systemRamGb:(St=G.hardware)==null?void 0:St.totalRamGb,onPull:Et,pulling:R[ie.id]?ie.id:null,isInstalled:xt},ie.id)})]})}),t==="search"&&e.jsx(e.Fragment,{children:l?e.jsxs("div",{className:"text-center py-8",children:[e.jsx($e,{size:24,className:"mx-auto text-accent animate-spin mb-2"}),e.jsx("p",{className:"text-sm text-text-3 font-sans",children:"Searching HuggingFace..."})]}):o.length===0?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(oa,{size:32,className:"mx-auto text-text-4 mb-2"}),e.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"Search for GGUF models"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:'Try "qwen coder", "deepseek", "codestral", "llama"'})]}):o.map(ie=>{var Re;return e.jsxs("div",{className:"space-y-1",children:[e.jsx(ADe,{result:ie,expanded:y===ie.id,onExpand:v}),y===ie.id&&e.jsx(uDe,{repoId:ie.id,systemRamGb:(Re=G.hardware)==null?void 0:Re.totalRamGb})]},ie.id)})})]})]})]})})]})}function pDe(t){switch(t){case"established":return e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(ia,{status:"running",size:"sm"})," Connected"]});case"connecting":return e.jsx(be,{variant:"warning",className:"text-2xs",dot:"pulse",children:"Connecting"});case"error":return e.jsx(be,{variant:"danger",className:"text-2xs",children:"Error"});default:return e.jsx(be,{variant:"default",className:"text-2xs",children:"Unknown"})}}function fDe({onOpenWizard:t}){const a=$(x=>x.federation.connections),n=$(x=>x.federation.peers),s=$(x=>x.sendPouch),o=$(x=>x.disconnectPeer),c=$(x=>x.addToast),[l,A]=g.useState(null),u=n.length>0?n:a;async function f(x){A(x);try{await s(x,{type:"ping"})}catch{}A(null)}return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(aa,{size:12,className:"text-accent"}),e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"Connected Peers"}),u.length>0&&e.jsx(be,{variant:"success",className:"text-2xs",children:u.length})]}),e.jsxs(fe,{size:"sm",variant:"primary",onClick:t,className:"h-7 text-2xs gap-1.5",children:[e.jsx(ht,{size:11}),"Pair New Peer"]})]}),u.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border-subtle bg-surface-1/50 px-4 py-8 text-center",children:[e.jsx(Yo,{size:20,className:"text-text-4 mx-auto mb-2"}),e.jsx("p",{className:"text-xs text-text-3 font-sans mb-1",children:"No peers connected"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans mb-3",children:"Pair with a remote Groove daemon to share agents and coordinate work."}),e.jsxs(fe,{size:"sm",variant:"outline",onClick:t,className:"h-7 text-2xs gap-1.5",children:[e.jsx(ht,{size:11}),"Pair Your First Peer"]})]}):e.jsx("div",{className:"grid gap-2",children:u.map(x=>{const m=x.peerId||x.ip||x.id,y=x.name||x.peerId||"Unknown Peer",v=x.state||x.status||"unknown",O=x.ip||x.address||"",b=x.latency;return e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-1 p-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-accent/10 flex-shrink-0 mt-0.5",children:e.jsx(aa,{size:14,className:"text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:y}),pDe(v)]}),e.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3",children:[O&&e.jsxs("span",{className:"font-mono truncate",children:[O,x.port?`:${x.port}`:""]}),b!=null&&e.jsxs("span",{className:"flex items-center gap-1 font-sans",children:[e.jsx(UA,{size:9,className:V(b<100?"text-success":b<300?"text-warning":"text-danger")}),b,"ms"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-3 pt-2.5 border-t border-border-subtle",children:[e.jsxs(fe,{size:"sm",variant:"ghost",className:"h-6 text-2xs gap-1 text-text-2",onClick:()=>c("info",y,`ID: ${m}
8675
8675
  IP: ${O}${x.port?`:${x.port}`:""}
8676
8676
  Latency: ${b!=null?`${b}ms`:"N/A"}
8677
- State: ${v}`),children:[e.jsx(na,{size:10}),"Details"]}),e.jsxs(fe,{size:"sm",variant:"ghost",className:"h-6 text-2xs gap-1 text-text-2",disabled:l===m,onClick:()=>f(m),children:[e.jsx(Xa,{size:10}),"Send Pouch"]}),e.jsxs(fe,{size:"sm",variant:"ghost",className:"h-6 text-2xs gap-1 text-danger/70 hover:text-danger ml-auto",onClick:()=>o(m),children:[e.jsx(ai,{size:10}),"Disconnect"]})]})]},m)})})]})}const xDe=["All","Sent","Received"];function mDe(){const t=$(c=>c.federation.pouchLog),[a,n]=g.useState("All"),o=[...a==="All"?t:t.filter(c=>c.direction===a.toLowerCase())].reverse().slice(0,200);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Cn,{size:12,className:"text-accent"}),e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"Activity"}),t.length>0&&e.jsx(be,{variant:"default",className:"text-2xs",children:t.length})]}),e.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:xDe.map(c=>e.jsx("button",{onClick:()=>n(c),className:V("px-2.5 py-1 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",a===c?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:c},c))})]}),o.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border-subtle bg-surface-1/50 px-4 py-6 text-center",children:[e.jsx(Cn,{size:18,className:"text-text-4 mx-auto mb-1.5"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:a==="All"?"No diplomatic pouches exchanged yet.":`No ${a.toLowerCase()} pouches.`})]}):e.jsx(it,{className:"max-h-80",children:e.jsxs("div",{className:"relative pl-5",children:[e.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-px bg-border-subtle"}),o.map((c,l)=>{const A=c.direction==="sent";return e.jsxs("div",{className:"relative flex items-start gap-3 pb-3 last:pb-0",children:[e.jsx("div",{className:V("absolute left-[-13px] top-1.5 w-2.5 h-2.5 rounded-full border-2 border-surface-2 z-10",A?"bg-accent":"bg-success")}),e.jsxs("div",{className:"flex items-center gap-2 flex-1 rounded-md bg-surface-1 px-3 py-2 min-w-0",children:[A?e.jsx(c0,{size:11,className:"text-accent flex-shrink-0"}):e.jsx(o0,{size:11,className:"text-success flex-shrink-0"}),e.jsx("span",{className:"text-2xs text-text-1 font-sans truncate flex-1",children:c.contractType||c.type||"message"}),e.jsx("span",{className:"text-2xs text-text-4 font-mono truncate max-w-24",children:c.peerId||""}),e.jsx("span",{className:"text-2xs text-text-3 font-sans flex-shrink-0",children:Mt(c.timestamp||c.ts)})]})]},c.id||l)})]})})]})}const gDe=[{label:"Connect",icon:Yo},{label:"Verify",icon:aa},{label:"Paired",icon:De}];function yDe({current:t}){return e.jsx("div",{className:"flex items-center justify-center gap-2 mb-6",children:gDe.map((a,n)=>{const s=n<t,o=n===t,c=a.icon;return e.jsxs("div",{className:"flex items-center gap-2",children:[n>0&&e.jsx("div",{className:V("w-8 h-px",s?"bg-accent":"bg-border-subtle")}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:V("w-6 h-6 rounded-full flex items-center justify-center transition-colors",s?"bg-accent text-white":o?"bg-accent/15 text-accent border border-accent/30":"bg-surface-3 text-text-4"),children:s?e.jsx(De,{size:12}):e.jsx(c,{size:12})}),e.jsx("span",{className:V("text-2xs font-semibold font-sans",o?"text-text-0":s?"text-accent":"text-text-4"),children:a.label})]})]},a.label)})})}function vDe({open:t,onOpenChange:a}){const n=$(P=>P.addToWhitelist),s=$(P=>P.fetchFederationStatus),[o,c]=g.useState(0),[l,A]=g.useState(""),[u,f]=g.useState("31415"),[x,m]=g.useState(""),[y,v]=g.useState(!1),[O,b]=g.useState(null),[C,j]=g.useState(!1),[N,M]=g.useState(null),[Q,L]=g.useState(null);function B(){c(0),A(""),f("31415"),m(""),v(!1),b(null),j(!1),M(null),L(null)}function S(P){P||B(),a(P)}async function I(){v(!0),b(null),M(null);try{const P=`${l.trim()}:${u||"31415"}`,F=await fetch(`http://localhost:31415/api/federation/test?target=${encodeURIComponent(P)}`);if(F.ok){const K=await F.json();b("reachable"),L(K)}else b("unreachable")}catch{b("unreachable")}v(!1)}async function z(){j(!0),M(null);try{await n(l.trim(),parseInt(u,10)||31415,x.trim()||void 0),await s(),c(2)}catch(P){M(P.message||"Failed to pair with peer")}j(!1)}return e.jsx(Ut,{open:t,onOpenChange:S,children:e.jsx(Pt,{title:"Pair New Peer",description:"Connect to a remote Groove daemon",children:e.jsxs("div",{className:"px-5 py-5",children:[e.jsx(yDe,{current:o}),o===0&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(cn,{label:"Friendly Name",placeholder:"e.g. Production Server",value:x,onChange:P=>m(P.target.value)}),e.jsxs("div",{className:"grid grid-cols-[1fr,100px] gap-2",children:[e.jsx(cn,{label:"IP / Hostname",placeholder:"192.168.1.100",value:l,onChange:P=>A(P.target.value),mono:!0}),e.jsx(cn,{label:"Port",placeholder:"31415",value:u,onChange:P=>f(P.target.value),mono:!0})]}),O==="reachable"&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-success/10 border border-success/20 px-3 py-2",children:[e.jsx(UA,{size:13,className:"text-success"}),e.jsx("span",{className:"text-2xs text-success font-sans font-medium",children:"Peer is reachable"})]}),O==="unreachable"&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-danger/10 border border-danger/20 px-3 py-2",children:[e.jsx(Xt,{size:13,className:"text-danger"}),e.jsx("span",{className:"text-2xs text-danger font-sans font-medium",children:"Could not reach peer — check IP and port"})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsxs(fe,{size:"sm",variant:"ghost",disabled:!l.trim()||y,onClick:I,className:"h-8 text-xs gap-1.5",children:[y?e.jsx($e,{size:12,className:"animate-spin"}):e.jsx(UA,{size:12}),"Test Reachability"]}),e.jsxs(fe,{size:"sm",variant:"primary",disabled:!l.trim(),onClick:()=>c(1),className:"h-8 text-xs gap-1.5 ml-auto",children:["Continue",e.jsx(Fr,{size:12})]})]})]}),o===1&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-0 p-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-md bg-accent/10",children:e.jsx(aa,{size:16,className:"text-accent"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-text-0 font-sans",children:x||"Remote Peer"}),e.jsxs("p",{className:"text-2xs text-text-3 font-mono",children:[l,":",u||"31415"]})]})]}),Q&&e.jsxs("div",{className:"space-y-1.5 pt-2 border-t border-border-subtle",children:[Q.version&&e.jsxs("div",{className:"flex items-center justify-between text-2xs font-sans",children:[e.jsx("span",{className:"text-text-3",children:"Version"}),e.jsx("span",{className:"text-text-1 font-mono",children:Q.version})]}),Q.peerId&&e.jsxs("div",{className:"flex items-center justify-between text-2xs font-sans",children:[e.jsx("span",{className:"text-text-3",children:"Peer ID"}),e.jsx("span",{className:"text-text-1 font-mono truncate max-w-40",children:Q.peerId})]}),Q.agents!=null&&e.jsxs("div",{className:"flex items-center justify-between text-2xs font-sans",children:[e.jsx("span",{className:"text-text-3",children:"Active Agents"}),e.jsx("span",{className:"text-text-1",children:Q.agents})]})]})]}),N&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-danger/10 border border-danger/20 px-3 py-2",children:[e.jsx(Xt,{size:13,className:"text-danger"}),e.jsx("span",{className:"text-2xs text-danger font-sans",children:N})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsx(fe,{size:"sm",variant:"ghost",onClick:()=>c(0),className:"h-8 text-xs",children:"Back"}),e.jsxs(fe,{size:"sm",variant:"primary",disabled:C,onClick:z,className:"h-8 text-xs gap-1.5 ml-auto",children:[C?e.jsx($e,{size:12,className:"animate-spin"}):e.jsx(Yo,{size:12}),"Confirm Pairing"]})]})]}),o===2&&e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-success/15 mx-auto",children:e.jsx(De,{size:20,className:"text-success"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans mb-1",children:"Peer Paired Successfully"}),e.jsxs("p",{className:"text-2xs text-text-3 font-sans",children:[x||l," has been added to your federation whitelist."]})]}),e.jsx("div",{className:"rounded-md border border-border-subtle bg-surface-0 p-3 text-left",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-accent/10",children:e.jsx(aa,{size:14,className:"text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans block truncate",children:x||"Remote Peer"}),e.jsxs("span",{className:"text-2xs text-text-3 font-mono",children:[l,":",u||"31415"]})]}),e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(ia,{status:"running",size:"sm"}),"Whitelisted"]})]})}),e.jsx(fe,{size:"sm",variant:"primary",onClick:()=>S(!1),className:"h-8 text-xs",children:"Done"})]})]})})})}function kDe(t){switch(t){case"mutual":return e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(ia,{status:"running",size:"sm"})," Mutual"]});case"connected":return e.jsx(be,{variant:"info",className:"text-2xs",children:"Connected"});default:return e.jsx(be,{variant:"default",className:"text-2xs",children:"Waiting"})}}function ODe(){const t=$(j=>j.federation.whitelist),a=$(j=>j.addToWhitelist),n=$(j=>j.removeFromWhitelist),[s,o]=g.useState(!1),[c,l]=g.useState(""),[A,u]=g.useState("31415"),[f,x]=g.useState(""),[m,y]=g.useState(!1),[v,O]=g.useState("");async function b(j){if(j.preventDefault(),!!c.trim()){y(!0);try{await a(c.trim(),parseInt(A,10)||31415,f.trim()||void 0),l(""),u("31415"),x(""),o(!1)}catch{}y(!1)}}const C=g.useMemo(()=>{if(!v.trim())return t;const j=v.toLowerCase();return t.filter(N=>{const M=typeof N=="string"?N:N.ip,Q=typeof N=="object"?N.name:"";return(M==null?void 0:M.toLowerCase().includes(j))||(Q==null?void 0:Q.toLowerCase().includes(j))})},[t,v]);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(La,{size:12,className:"text-accent"}),e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"Whitelist"}),t.length>0&&e.jsx(be,{variant:"default",className:"text-2xs",children:t.length})]}),e.jsx(fe,{size:"sm",variant:s?"ghost":"primary",onClick:()=>o(!s),className:"h-7 text-2xs gap-1.5",children:s?e.jsxs(e.Fragment,{children:[e.jsx(su,{size:11})," Hide"]}):e.jsxs(e.Fragment,{children:[e.jsx(ht,{size:11})," Add Server"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s&&e.jsxs("form",{onSubmit:b,className:"rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"w-6 h-6 rounded bg-accent/8 flex items-center justify-center flex-shrink-0",children:e.jsx(ht,{size:12,className:"text-accent"})}),e.jsx("span",{className:"text-[13px] font-medium text-text-0 font-sans",children:"New Server"})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1 block",children:"Name"}),e.jsx(cn,{placeholder:"Server name",value:f,onChange:j=>x(j.target.value),className:"h-7 text-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1 block",children:"IP Address"}),e.jsx(cn,{placeholder:"100.64.0.2",value:c,onChange:j=>l(j.target.value),mono:!0,className:"h-7 text-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1 block",children:"Port"}),e.jsx(cn,{placeholder:"31415",value:A,onChange:j=>u(j.target.value),mono:!0,className:"h-7 text-xs w-28"})]}),e.jsx("div",{className:"pt-1",children:e.jsxs(fe,{type:"submit",variant:"primary",size:"sm",disabled:m||!c.trim(),className:"h-7 text-2xs gap-1",children:[m?e.jsx($e,{size:11,className:"animate-spin"}):e.jsx(ht,{size:11}),"Add to Whitelist"]})})]})]}),e.jsxs("div",{className:V("rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5",!s&&"col-span-2"),children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"w-6 h-6 rounded bg-accent/8 flex items-center justify-center flex-shrink-0",children:e.jsx(sa,{size:12,className:"text-accent"})}),e.jsx("span",{className:"text-[13px] font-medium text-text-0 font-sans",children:"Servers"}),t.length>=5&&e.jsxs("div",{className:"relative ml-auto",children:[e.jsx(oa,{size:10,className:"absolute left-2 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{type:"text",placeholder:"Filter…",value:v,onChange:j=>O(j.target.value),className:"h-6 pl-6 pr-2 w-32 text-2xs font-sans bg-surface-0 border border-border-subtle rounded-md text-text-0 placeholder:text-text-4 focus:outline-none focus:border-accent"})]})]}),C.length===0&&t.length===0?e.jsxs("div",{className:"px-2 py-4 text-center",children:[e.jsx(sa,{size:16,className:"text-text-4 mx-auto mb-1.5"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"No peers whitelisted yet."})]}):C.length===0?e.jsx("div",{className:"text-2xs text-text-4 font-sans py-3 text-center",children:"No servers match your filter."}):e.jsx("div",{className:"space-y-1.5",children:C.map(j=>{const N=typeof j=="string"?j:j.ip,M=typeof j=="object"?j.name:null,Q=typeof j=="object"?j.status:"waiting",L=typeof j=="object"?j.port:null;return e.jsxs("div",{className:"flex items-center gap-2.5 px-2.5 py-2 rounded-md bg-surface-0 border border-border-subtle",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[M&&e.jsx("span",{className:"text-xs font-sans font-medium text-text-0 block truncate",children:M}),e.jsxs("span",{className:V("font-mono truncate block",M?"text-2xs text-text-3":"text-xs text-text-1"),children:[N,L?`:${L}`:""]})]}),kDe(Q),e.jsx("button",{onClick:()=>n(N),className:"p-1 rounded text-text-4 hover:text-danger hover:bg-danger/10 cursor-pointer transition-colors flex-shrink-0",title:"Remove",children:e.jsx(At,{size:11})})]},N)})})]})]})]})}function bDe(){const t=$(a=>a.federation.ambassadors);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Fa,{size:12,className:"text-accent"}),e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"Ambassadors"}),t.length>0&&e.jsx(be,{variant:"info",className:"text-2xs",children:t.length})]}),t.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border-subtle bg-surface-1/50 px-4 py-6 text-center",children:[e.jsx(Fa,{size:18,className:"text-text-4 mx-auto mb-1.5"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"No active ambassadors. Ambassadors appear when agents are shared across federated peers."})]}):e.jsx("div",{className:"grid grid-cols-2 gap-2",children:t.map(a=>e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-3.5 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(ia,{status:a.status==="active"?"running":"stopped",size:"sm"}),e.jsx("span",{className:"text-xs font-sans font-medium text-text-0 truncate flex-1",children:a.name||a.agentId||a.id}),a.role&&e.jsx(be,{variant:"purple",className:"text-2xs",children:a.role})]}),e.jsxs("div",{className:"flex items-center justify-between text-2xs",children:[a.peerId?e.jsx("span",{className:"text-text-3 font-mono truncate max-w-28",children:a.peerId}):e.jsx("span",{className:"text-text-4 font-sans",children:"Local"}),e.jsx(be,{variant:a.status==="active"?"success":"default",className:"text-2xs",children:a.status||"idle"})]})]},a.id||a.agentId))})]})}function wDe(){const t=$(u=>u.fetchFederationStatus),a=$(u=>u.fetchPouchLog),n=$(u=>u.federation.peers),s=$(u=>u.federation.connections),o=$(u=>u.federation.whitelist),[c,l]=g.useState(!1),A=(n.length>0?n:s).length;return g.useEffect(()=>{t(),a()},[]),e.jsxs("div",{className:"flex flex-col h-full bg-surface-0",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center",children:e.jsx(sa,{size:16,className:"text-accent"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-semibold text-text-0 font-sans",children:"Federation"}),e.jsxs("p",{className:"text-2xs text-text-3 font-sans",children:[A," peer",A!==1?"s":""," · ",o.length," whitelisted"]})]})]}),e.jsxs(fe,{size:"sm",variant:"primary",onClick:()=>l(!0),className:"h-8 text-xs gap-1.5",children:[e.jsx(ht,{size:12}),"Add Peer"]})]}),e.jsx(it,{className:"flex-1",children:e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[e.jsx("div",{className:"rounded-lg border border-border-subtle bg-surface-1 p-4",children:e.jsx(fDe,{onOpenWizard:()=>l(!0)})}),e.jsx("div",{className:"rounded-lg border border-border-subtle bg-surface-1 p-4",children:e.jsx(mDe,{})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-lg border border-border-subtle bg-surface-1 p-4",children:e.jsx(ODe,{})}),e.jsx("div",{className:"rounded-lg border border-border-subtle bg-surface-1 p-4",children:e.jsx(bDe,{})})]})]})})}),e.jsx(vDe,{open:c,onOpenChange:l})]})}function wee({children:t,className:a,hover:n,...s}){return e.jsx("div",{className:V("rounded-md border border-border bg-surface-1",n&&"hover:border-accent/50 hover:bg-surface-2 transition-all duration-150 cursor-pointer",a),...s,children:t})}const jDe={beginner:"success",intermediate:"warning",advanced:"danger"};function CDe(t){if(!t)return on;const a=t.replace(/(^|-)(\w)/g,(n,s,o)=>o.toUpperCase());return TL[a]||TL[t]||on}function NDe({toy:t,onClick:a}){const n=CDe(t.icon);return e.jsxs(wee,{hover:!0,className:"group flex flex-col p-4 gap-3 transition-all duration-150 hover:scale-[1.02] hover:shadow-lg hover:shadow-black/20",onClick:()=>a(t),children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0 bg-accent/10 border border-accent/20 text-accent",children:e.jsx(n,{size:20})}),e.jsx("div",{className:"flex-1 min-w-0 pt-0.5",children:e.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans truncate pr-1",children:t.name})}),e.jsx(be,{variant:"default",className:"flex-shrink-0 mt-0.5",children:t.category})]}),e.jsx("p",{className:"text-xs text-text-2 font-sans leading-relaxed line-clamp-2",children:t.description}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-auto flex-wrap",children:[t.custom&&e.jsx(be,{variant:"accent",children:"Custom"}),e.jsx(be,{variant:jDe[t.difficulty]||"default",children:t.difficulty||"beginner"}),e.jsx(be,{variant:t.authType==="none"?"success":"warning",children:t.authType==="none"?"No Key Required":"API Key Required"})]})]})}function MDe(){return e.jsxs(wee,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-surface-4 animate-pulse"}),e.jsx("div",{className:"flex-1 space-y-2 pt-1",children:e.jsx("div",{className:"h-3.5 w-24 bg-surface-4 rounded animate-pulse"})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-3 w-full bg-surface-4 rounded animate-pulse"}),e.jsx("div",{className:"h-3 w-3/4 bg-surface-4 rounded animate-pulse"})]}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx("div",{className:"h-5 w-16 bg-surface-4 rounded animate-pulse"}),e.jsx("div",{className:"h-5 w-24 bg-surface-4 rounded animate-pulse"})]})]})}function SDe(t){if(!t)return on;const a=t.replace(/(^|-)(\w)/g,(n,s,o)=>o.toUpperCase());return TL[a]||TL[t]||on}function QDe({toy:t,open:a,onClose:n}){var C,j;const[s,o]=g.useState(""),[c,l]=g.useState(!1),[A,u]=g.useState(null),[f,x]=g.useState(!1),m=ln(),y=$(N=>N.setActiveView);if(!t)return null;const v=SDe(t.icon),O=t.authType!=="none";async function b(){if(O&&!s.trim()){m.warning("API key required",`${t.name} needs an API key to work.`);return}x(!0);try{await D.post(`/toys/${t.id}/launch`,{apiKey:O?s.trim():void 0,starterPrompt:A||void 0}),m.success(`${t.name} launched`,"Team is spinning up — switching to agents view."),y("agents"),n()}catch(N){m.error("Launch failed",N.message)}x(!1)}return e.jsx(HT,{open:a,onOpenChange:N=>!N&&n(),children:e.jsxs(qT,{title:t.name,width:440,children:[e.jsx(it,{className:"h-[calc(100%-65px)]",children:e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center flex-shrink-0 bg-accent/10 border border-accent/20 text-accent",children:e.jsx(v,{size:24})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(be,{variant:t.authType==="none"?"success":"warning",children:t.authType==="none"?"Free":"Key Required"}),e.jsx(be,{variant:"default",children:t.category})]}),e.jsx("p",{className:"text-xs text-text-2 font-sans leading-relaxed mt-2",children:t.description})]})]}),t.baseUrl&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-1.5",children:"Base URL"}),e.jsx("code",{className:"text-xs text-accent font-mono bg-surface-3 px-2.5 py-1.5 rounded block truncate",children:t.baseUrl})]}),((C=t.sampleEndpoints)==null?void 0:C.length)>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-1.5",children:"Endpoints"}),e.jsx("div",{className:"space-y-1",children:t.sampleEndpoints.map((N,M)=>{const Q=typeof N=="string"?N:`${N.method||"GET"} ${N.path||""}`,L=Q.indexOf(" "),B=L>0?Q.slice(0,L):"GET",S=L>0?Q.slice(L+1):Q;return e.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-text-2 bg-surface-3 px-2.5 py-1.5 rounded",children:[e.jsx(be,{variant:"accent",className:"text-[9px] px-1 py-0",children:B}),e.jsx("span",{className:"truncate",children:S})]},M)})})]}),((j=t.starterPrompts)==null?void 0:j.length)>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-1.5",children:"Starter Ideas"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.starterPrompts.map((N,M)=>e.jsx("button",{onClick:()=>u(A===N?null:N),className:`px-3 py-1.5 text-xs font-sans rounded-full cursor-pointer select-none transition-colors border ${A===N?"bg-accent/15 text-accent border-accent/25":"text-text-2 bg-surface-3 border-border-subtle hover:text-text-0 hover:border-border"}`,children:N},M))})]}),O&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-1.5",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:c?"text":"password",value:s,onChange:N=>o(N.target.value),placeholder:`Enter your ${t.name} API key`,className:"w-full bg-surface-3 border border-border-subtle rounded px-3 py-2 text-xs text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:border-accent/50 pr-9"}),e.jsx("button",{onClick:()=>l(!c),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-1 cursor-pointer bg-transparent border-0 p-0.5",children:c?e.jsx(jn,{size:14}):e.jsx(na,{size:14})})]})]}),t.docsUrl&&e.jsxs("a",{href:t.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-accent font-sans hover:underline",children:[e.jsx(ma,{size:12}),"View Documentation"]})]})}),e.jsx("div",{className:"px-5 py-3 border-t border-border-subtle bg-surface-1",children:e.jsx(fe,{variant:"primary",size:"lg",className:"w-full gap-2",onClick:b,disabled:f||O&&!s.trim(),children:f?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:14,className:"animate-spin"}),"Launching..."]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{size:14}),"Launch Team"]})})})]})})}const Mr={input:"input",researching:"researching"};function BDe({open:t,onClose:a,onCreated:n}){const[s,o]=g.useState(""),[c,l]=g.useState(""),[A,u]=g.useState(Mr.input),f=ln();function x(){o(""),l(""),u(Mr.input)}function m(){A!==Mr.researching&&(x(),a())}async function y(){const v=s.trim();if(!v){f.warning("URL required","Paste an API documentation or reference URL.");return}u(Mr.researching);try{const O=await D.post("/toys",{docsUrl:v,name:c.trim()||void 0});f.success("Toy created",`${O.name||"New toy"} is ready to launch.`),n==null||n(O),x(),a()}catch(O){f.error("Research failed",O.message),u(Mr.input)}}return e.jsx(HT,{open:t,onOpenChange:v=>!v&&m(),children:e.jsxs(qT,{title:"New Toy",width:440,children:[e.jsx(it,{className:"h-[calc(100%-65px)]",children:e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[A===Mr.input&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-accent/5 border border-accent/10",children:[e.jsx(It,{size:16,className:"text-accent mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-xs text-text-2 font-sans leading-relaxed",children:"Paste a docs URL and Groove's AI will research the API — endpoints, auth, data structures, rate limits — and build a reusable toy card you can launch anytime."})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-1.5",children:"API Docs URL"}),e.jsxs("div",{className:"relative",children:[e.jsx(Yo,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{type:"url",value:s,onChange:v=>o(v.target.value),placeholder:"https://api.example.com/docs",className:"w-full bg-surface-3 border border-border-subtle rounded pl-8 pr-3 py-2 text-xs text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:border-accent/50",onKeyDown:v=>v.key==="Enter"&&y(),autoFocus:!0})]})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"text-xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-1.5",children:["Name ",e.jsx("span",{className:"text-text-4 normal-case tracking-normal",children:"(optional)"})]}),e.jsx("input",{type:"text",value:c,onChange:v=>l(v.target.value),placeholder:"Auto-detected from docs",className:"w-full bg-surface-3 border border-border-subtle rounded px-3 py-2 text-xs text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:border-accent/50",onKeyDown:v=>v.key==="Enter"&&y()})]})]}),A===Mr.researching&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-xl bg-accent/10 border border-accent/20 flex items-center justify-center",children:e.jsx(sa,{size:24,className:"text-accent animate-pulse"})}),e.jsxs("div",{className:"text-center space-y-1.5",children:[e.jsx("p",{className:"text-sm font-semibold text-text-0 font-sans",children:"Researching API..."}),e.jsx("p",{className:"text-xs text-text-3 font-sans max-w-[260px]",children:"Reading documentation, mapping endpoints, and building your toy card. This takes 15–30 seconds."})]}),e.jsx($e,{size:16,className:"text-accent animate-spin"})]})]})}),e.jsxs("div",{className:"px-5 py-3 border-t border-border-subtle bg-surface-1",children:[A===Mr.input&&e.jsxs(fe,{variant:"primary",size:"lg",className:"w-full gap-2",onClick:y,disabled:!s.trim(),children:[e.jsx(It,{size:14}),"Research & Create"]}),A===Mr.researching&&e.jsxs(fe,{variant:"ghost",size:"lg",className:"w-full",disabled:!0,children:[e.jsx($e,{size:14,className:"animate-spin mr-2"}),"AI is analyzing..."]})]})]})})}const _De=["All","Space","Weather","Finance","Fun","Maps","Data"];function LDe(){const[t,a]=g.useState([]),[n,s]=g.useState(!0),[o,c]=g.useState(""),[l,A]=g.useState("All"),[u,f]=g.useState(null),[x,m]=g.useState(!1),y=$(j=>j.teams),v=g.useCallback(()=>{s(!0),D.get("/toys").then(j=>a(j.toys||j.items||(Array.isArray(j)?j:[]))).catch(()=>a([])).finally(()=>s(!1))},[]);g.useEffect(()=>{v()},[v]);const O=o.toLowerCase(),b=t.filter(j=>{var N,M,Q;return!(l!=="All"&&((N=j.category)==null?void 0:N.toLowerCase())!==l.toLowerCase()||O&&!((M=j.name)!=null&&M.toLowerCase().includes(O))&&!((Q=j.description)!=null&&Q.toLowerCase().includes(O)))}),C=(y||[]).filter(j=>(j.name||"").startsWith("Toy:"));return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex-shrink-0 px-5 pt-5 pb-4",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-1",children:[e.jsx(QA,{size:18,className:"text-accent"}),e.jsx("h1",{className:"text-lg font-bold text-text-0 font-sans",children:"Toys"}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{onClick:()=>m(!0),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold font-sans rounded-full cursor-pointer select-none transition-colors bg-accent/15 text-accent border border-accent/25 hover:bg-accent/25",children:[e.jsx(ht,{size:13}),"New"]})]}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"Plug in an API and start building"})]}),e.jsxs("div",{className:"flex-shrink-0 px-5 pb-4 space-y-3",children:[e.jsxs("div",{className:"relative w-full max-w-sm",children:[e.jsx(oa,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{type:"text",value:o,onChange:j=>c(j.target.value),placeholder:"Search toys...",className:"w-full bg-surface-1 border border-border-subtle rounded pl-8 pr-3 py-1.5 text-xs text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:border-accent/50"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[_De.map(j=>e.jsx("button",{onClick:()=>A(j),className:`px-3 py-1.5 text-xs font-semibold font-sans rounded-full cursor-pointer select-none transition-colors ${l===j?"bg-accent/15 text-accent border border-accent/25":"text-text-3 hover:text-text-1 border border-transparent hover:border-border-subtle"}`,children:j},j)),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"text-2xs text-text-4 font-mono",children:b.length})]})]}),e.jsx(it,{className:"flex-1 min-h-0",children:e.jsxs("div",{className:"px-5 pt-1 pb-5",children:[e.jsx("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(260px,1fr))]",children:n?Array.from({length:6}).map((j,N)=>e.jsx(MDe,{},N)):e.jsxs(e.Fragment,{children:[b.map(j=>e.jsx(NDe,{toy:j,onClick:f},j.id)),e.jsxs("button",{onClick:()=>m(!0),className:"flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 border-dashed border-border-subtle text-text-4 hover:text-accent hover:border-accent/30 hover:bg-accent/5 transition-colors cursor-pointer min-h-[140px]",children:[e.jsx(ht,{size:20}),e.jsx("span",{className:"text-xs font-semibold font-sans",children:"Add API"})]})]})}),!n&&b.length===0&&e.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No toys found. Try a different search or category."}),C.length>0&&e.jsxs("div",{className:"mt-8",children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[e.jsx(es,{size:12}),"Recent Toys (",C.length,")"]}),e.jsx("div",{className:"space-y-1.5",children:C.map(j=>{var N;return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-1 border border-border-subtle",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center flex-shrink-0",children:e.jsx(QA,{size:14,className:"text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:j.name}),e.jsxs("div",{className:"text-2xs text-text-4 font-sans",children:[((N=j.agents)==null?void 0:N.length)||0," agents"]})]}),e.jsx(be,{variant:"accent",children:"Active"})]},j.id)})})]})]})}),e.jsx(QDe,{toy:u,open:!!u,onClose:()=>f(null)}),e.jsx(BDe,{open:x,onClose:()=>m(!1),onCreated:()=>v()})]})}function TDe({value:t,onChange:a,options:n=[],placeholder:s,className:o,renderOption:c}){var N;const[l,A]=g.useState(!1),[u,f]=g.useState(""),[x,m]=g.useState(-1),y=g.useRef(null),v=g.useRef(null),O=u?n.filter(M=>(M.name||M.id).toLowerCase().includes(u.toLowerCase())):n;g.useEffect(()=>{function M(Q){y.current&&!y.current.contains(Q.target)&&A(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[]),g.useEffect(()=>{m(-1)},[u,l]);const b=g.useCallback(M=>{var Q;a(M),f(""),A(!1),(Q=v.current)==null||Q.blur()},[a]);function C(M){if(!l&&(M.key==="ArrowDown"||M.key==="Enter")){A(!0);return}l&&(M.key==="ArrowDown"?(M.preventDefault(),m(Q=>Math.min(Q+1,O.length-1))):M.key==="ArrowUp"?(M.preventDefault(),m(Q=>Math.max(Q-1,0))):M.key==="Enter"?(M.preventDefault(),x>=0&&O[x]?b(O[x].id||O[x].name):u.trim()&&b(u.trim())):M.key==="Escape"&&(A(!1),f("")))}const j=t&&!l?((N=n.find(M=>(M.id||M.name)===t))==null?void 0:N.name)||t:u;return e.jsxs("div",{ref:y,className:V("relative",o),children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{ref:v,value:j,onChange:M=>{f(M.target.value),A(!0)},onFocus:()=>A(!0),onKeyDown:C,placeholder:s,className:V("h-8 w-full rounded-md pl-3 pr-8 text-sm","bg-surface-1 border border-border text-text-0 font-sans","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","transition-colors duration-100")}),e.jsx(bt,{size:12,className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"})]}),l&&O.length>0&&e.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-30 bg-surface-1 border border-border rounded-md shadow-xl py-1 max-h-48 overflow-y-auto",children:O.map((M,Q)=>e.jsx("button",{onClick:()=>b(M.id||M.name),onMouseEnter:()=>m(Q),className:V("w-full text-left px-3 py-1.5 text-sm font-sans cursor-pointer transition-colors",(M.id||M.name)===t&&"text-accent",x===Q?"bg-accent/10 text-text-0":"text-text-2 hover:bg-surface-5 hover:text-text-0"),children:c?c(M):M.name||M.id},M.id||M.name))}),l&&O.length===0&&u&&e.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-30 bg-surface-1 border border-border rounded-md shadow-xl py-2 px-3",children:e.jsxs("p",{className:"text-xs text-text-3 font-sans",children:["Press Enter to use “",u,"”"]})})]})}const $De=[{value:"ollama",label:"Ollama"},{value:"vllm",label:"vLLM"},{value:"llama-cpp",label:"llama.cpp"},{value:"tgi",label:"TGI"},{value:"openai-compatible",label:"OpenAI Compatible"}],mP={ollama:"http://localhost:11434",vllm:"http://localhost:8000","llama-cpp":"http://localhost:8080",tgi:"http://localhost:8080","openai-compatible":"http://localhost:8000"};function IDe({open:t,onOpenChange:a}){const n=$(b=>b.addLabRuntime),[s,o]=g.useState(""),[c,l]=g.useState("ollama"),[A,u]=g.useState(mP.ollama),[f,x]=g.useState(""),[m,y]=g.useState(!1);function v(b){l(b),u(mP[b]||"")}async function O(){if(!(!s.trim()||!A.trim())){y(!0);try{await n({name:s.trim(),type:c,endpoint:A.trim(),apiKey:f.trim()||void 0}),o(""),l("ollama"),u(mP.ollama),x(""),a(!1)}catch{}y(!1)}}return e.jsx(Ut,{open:t,onOpenChange:a,children:e.jsx(Pt,{title:"Add Runtime",description:"Configure a new inference runtime",children:e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e.jsx(cn,{label:"Name",placeholder:"My vLLM Server",value:s,onChange:b=>o(b.target.value)}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-sans text-text-2 mb-1.5",children:"Type"}),e.jsxs(Ur,{value:c,onValueChange:v,children:[e.jsx(Pr,{placeholder:"Select type"}),e.jsx(Er,{children:$De.map(b=>e.jsx(Da,{value:b.value,children:b.label},b.value))})]})]}),e.jsx(cn,{label:"Endpoint URL",placeholder:"http://localhost:8000",value:A,onChange:b=>u(b.target.value),mono:!0}),e.jsx(cn,{label:"API Key (optional)",placeholder:"sk-...",value:f,onChange:b=>x(b.target.value),mono:!0}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(fe,{variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),e.jsx(fe,{variant:"primary",onClick:O,disabled:!s.trim()||!A.trim()||m,children:m?e.jsx($e,{size:14,className:"animate-spin"}):"Add Runtime"})]})]})})})}function UDe({runtime:t,active:a,onSelect:n,onTest:s,onRemove:o,testing:c}){return e.jsxs("button",{onClick:()=>n(t.id),className:V("w-full flex items-center gap-2.5 px-2.5 py-2 text-left transition-colors cursor-pointer rounded-sm",a?"bg-accent/8 text-text-0":"text-text-2 hover:bg-surface-3 hover:text-text-0"),children:[e.jsx("span",{className:V("w-1.5 h-1.5 rounded-full flex-shrink-0",t.status==="connected"?"bg-success":t.status==="error"?"bg-danger":"bg-text-4")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-sans font-medium truncate",children:t.name}),e.jsxs("div",{className:"text-2xs text-text-4 flex items-center gap-1.5",children:[e.jsx("span",{className:"font-mono",children:t.type}),t.status==="connected"&&e.jsx("span",{className:"text-success",children:"Healthy"}),t.status==="error"&&e.jsx("span",{className:"text-danger",children:"Unreachable"})]})]}),e.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[t.latency!=null&&e.jsxs("span",{className:"text-2xs font-mono text-text-4 mr-1",children:[Math.round(t.latency),"ms"]}),e.jsx(Nt,{content:"Test connection",children:e.jsx("button",{onClick:l=>{l.stopPropagation(),s(t.id)},className:"p-1 text-text-4 hover:text-accent transition-colors cursor-pointer",children:c===t.id?e.jsx($e,{size:11,className:"animate-spin"}):e.jsx(Cs,{size:11})})}),e.jsx(Nt,{content:"Remove",children:e.jsx("button",{onClick:l=>{l.stopPropagation(),o(t.id)},className:"p-1 text-text-4 hover:text-danger transition-colors cursor-pointer",children:e.jsx(At,{size:11})})})]})]})}function PDe(t){return t?t>=1e9?`${(t/1e9).toFixed(1)} GB`:t>=1e6?`${(t/1e6).toFixed(0)} MB`:`${(t/1e3).toFixed(0)} KB`:""}const EX=[{id:"llama-cpp",label:"llama.cpp",subtitle:"CPU + GPU, auto-managed",recommended:!0,autoLaunch:!0},{id:"vllm",label:"vLLM",subtitle:"GPU-optimized, guided setup",autoLaunch:!1},{id:"tgi",label:"TGI",subtitle:"HuggingFace, guided setup",autoLaunch:!1}];function EDe({phase:t,error:a}){return t?e.jsxs("div",{className:V("flex items-center gap-2 px-2.5 py-1.5 text-2xs font-sans rounded-sm",t==="ready"&&"bg-success/8 text-success",t==="error"&&"bg-danger/8 text-danger",(t==="starting"||t==="checking")&&"bg-accent/8 text-accent"),children:[t==="starting"&&e.jsxs(e.Fragment,{children:[e.jsx($e,{size:11,className:"animate-spin"})," Starting server..."]}),t==="checking"&&e.jsxs(e.Fragment,{children:[e.jsx($e,{size:11,className:"animate-spin"})," Checking..."]}),t==="ready"&&e.jsxs(e.Fragment,{children:[e.jsx(Sa,{size:11})," Server ready"]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx(Gt,{size:11})," ",a||"Launch failed"]})]}):null}function zDe(){const t=$(M=>M.labLocalModels),a=$(M=>M.fetchLabLocalModels),n=$(M=>M.checkLlamaStatus),s=$(M=>M.launchLocalModel),o=$(M=>M.labLaunching),c=$(M=>M.labLlamaInstalled),l=$(M=>M.labLaunchPhase),A=$(M=>M.labLaunchError),u=$(M=>M.launchLabAssistant),[f,x]=g.useState(null),[m,y]=g.useState("llama-cpp"),[v,O]=g.useState(!1);g.useEffect(()=>{a(),n()},[a,n]);const b=EX.find(M=>M.id===m),C=f&&(b==null?void 0:b.autoLaunch)&&c&&!o;function j(){C&&s(f)}async function N(){if(!v){O(!0);try{await u(b.id)}finally{O(!1)}}}return e.jsxs("div",{className:"space-y-3",children:[e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-3 uppercase tracking-wider",children:"Launch Model"}),t.length===0?e.jsxs("div",{className:"py-5 text-center",children:[e.jsx(Kn,{size:18,className:"mx-auto text-text-4 mb-1.5"}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No downloaded models"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans mt-0.5",children:"Download GGUFs from the Models tab"})]}):e.jsxs(e.Fragment,{children:[e.jsx(it,{className:"max-h-36",children:e.jsx("div",{className:"space-y-px",children:t.map(M=>{var Q;return e.jsxs("button",{onClick:()=>x(M.id),className:V("w-full flex items-center gap-2 px-2.5 py-2 text-left transition-colors cursor-pointer rounded-sm",f===M.id?"bg-accent/8 text-text-0":"text-text-2 hover:bg-surface-3 hover:text-text-0"),children:[e.jsx(Kn,{size:11,className:V("flex-shrink-0",f===M.id?"text-accent":"text-text-4")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-sans font-medium truncate",children:((Q=M.filename)==null?void 0:Q.replace(/\.gguf$/i,""))||M.id}),e.jsxs("div",{className:"text-2xs font-mono text-text-4 flex items-center gap-2",children:[M.quantization&&e.jsx("span",{children:M.quantization}),M.parameters&&e.jsx("span",{children:M.parameters}),M.sizeBytes&&e.jsx("span",{children:PDe(M.sizeBytes)})]})]}),f===M.id&&e.jsx(Rt,{size:11,className:"text-accent flex-shrink-0"})]},M.id)})})}),f&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-4 uppercase tracking-wider",children:"Backend"}),e.jsx("div",{className:"space-y-px",children:EX.map(M=>e.jsxs("button",{onClick:()=>y(M.id),className:V("w-full flex items-center gap-2.5 px-2.5 py-2 text-left transition-colors cursor-pointer rounded-sm",m===M.id?"bg-accent/8":"hover:bg-surface-3"),children:[e.jsx("span",{className:V("w-2 h-2 rounded-full border-[1.5px] flex-shrink-0",m===M.id?"border-accent bg-accent":"border-text-4")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:V("text-xs font-sans font-medium",m===M.id?"text-text-0":"text-text-2"),children:M.label}),M.recommended&&e.jsx(be,{variant:"success",className:"text-2xs",children:"Recommended"})]}),e.jsx("div",{className:"text-2xs text-text-4 font-sans",children:M.subtitle})]})]},M.id))}),m==="llama-cpp"&&e.jsxs("div",{className:"px-2.5",children:[c===null&&e.jsxs("div",{className:"flex items-center gap-2 text-2xs text-text-3 font-sans",children:[e.jsx($e,{size:10,className:"animate-spin"})," Checking llama-server..."]}),c===!0&&e.jsxs("div",{className:"flex items-center gap-2 text-2xs text-success font-sans",children:[e.jsx(Sa,{size:10})," llama-server found"]}),c===!1&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-2xs text-danger font-sans",children:[e.jsx(Gt,{size:10})," llama-server not found"]}),e.jsx("code",{className:"block text-2xs font-mono text-text-3 bg-surface-2 px-2 py-1 rounded-sm",children:"brew install llama.cpp"}),e.jsxs("button",{onClick:n,className:"flex items-center gap-1.5 text-2xs font-sans text-accent hover:text-accent/80 transition-colors cursor-pointer",children:[e.jsx(Cs,{size:10})," Recheck after install"]})]})]}),!(b!=null&&b.autoLaunch)&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{onClick:N,disabled:v,className:V("w-full flex items-center justify-center gap-1.5 px-3 py-2 text-xs font-sans font-medium rounded-sm transition-colors cursor-pointer",v?"bg-accent/20 text-accent":"bg-accent text-surface-0 hover:bg-accent/90"),children:v?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:12,className:"animate-spin"})," Starting Assistant..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ju,{size:12})," Setup ",b==null?void 0:b.label," with Assistant"]})}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"An AI assistant will check your system and handle the installation, or start your server manually and add it as a Runtime below."})]}),(b==null?void 0:b.autoLaunch)&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{disabled:!C,onClick:j,className:V("w-full flex items-center justify-center gap-1.5 px-3 py-2 text-xs font-sans font-medium rounded-sm transition-colors cursor-pointer",C?"bg-accent text-surface-0 hover:bg-accent/90":"bg-surface-3 text-text-4 cursor-not-allowed"),children:o?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:12,className:"animate-spin"})," Starting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ei,{size:12})," Launch"]})}),e.jsx(EDe,{phase:l,error:A})]})]})]})]})}function FDe(){const t=$(x=>x.labRuntimes),a=$(x=>x.labActiveRuntime),n=$(x=>x.setLabActiveRuntime),s=$(x=>x.testLabRuntime),o=$(x=>x.removeLabRuntime),[c,l]=g.useState(!1),[A,u]=g.useState(null);async function f(x){u(x),await s(x),u(null)}return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-3 uppercase tracking-wider",children:"Runtimes"}),e.jsx(Nt,{content:"Add runtime",children:e.jsx("button",{onClick:()=>l(!0),className:"p-1 text-text-4 hover:text-accent transition-colors cursor-pointer",children:e.jsx(ht,{size:13})})})]}),t.length===0?e.jsxs("div",{className:"py-5 text-center",children:[e.jsx(F0,{size:18,className:"mx-auto text-text-4 mb-1.5"}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No runtimes configured"}),e.jsxs("button",{onClick:()=>l(!0),className:"mt-2 flex items-center gap-1 mx-auto px-3 py-1.5 text-2xs font-sans text-text-3 hover:text-text-1 transition-colors cursor-pointer",children:[e.jsx(ht,{size:11})," Add Runtime"]})]}):e.jsx(it,{className:"max-h-48",children:e.jsx("div",{className:"space-y-px",children:t.map(x=>e.jsx(UDe,{runtime:x,active:a===x.id,onSelect:n,onTest:f,onRemove:o,testing:A},x.id))})}),e.jsx(IDe,{open:c,onOpenChange:l})]})}const RDe={temperature:.7,topP:.9,topK:40,repeatPenalty:1.1,maxTokens:2048,frequencyPenalty:0,presencePenalty:0},HDe=[{key:"temperature",label:"Temperature",min:0,max:2,step:.01},{key:"topP",label:"Top P",min:0,max:1,step:.01},{key:"topK",label:"Top K",min:0,max:200,step:1},{key:"repeatPenalty",label:"Repeat Penalty",min:0,max:2,step:.01},{key:"maxTokens",label:"Max Tokens",min:1,max:32768,step:1,format:t=>t>=1e3?`${(t/1e3).toFixed(1)}k`:t},{key:"frequencyPenalty",label:"Freq Penalty",min:0,max:2,step:.01},{key:"presencePenalty",label:"Pres Penalty",min:0,max:2,step:.01}];function qDe(){const t=$(s=>s.labParameters),a=$(s=>s.setLabParameter);function n(){for(const[s,o]of Object.entries(RDe))a(s,o)}return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-3 uppercase tracking-wider",children:"Parameters"}),e.jsx(Nt,{content:"Reset to defaults",children:e.jsx("button",{onClick:n,className:"p-1 text-text-4 hover:text-accent transition-colors cursor-pointer",children:e.jsx(Cs,{size:11})})})]}),HDe.map(s=>e.jsx(ri,{label:s.label,value:t[s.key],onChange:o=>a(s.key,o),min:s.min,max:s.max,step:s.step,formatValue:s.format},s.key))]})}const DDe=Ws.theme({"&":{backgroundColor:"var(--color-surface-1)",color:"#d4d8e0",fontFamily:"var(--font-mono)",fontSize:"11px",height:"100%",lineHeight:"1.6"},".cm-scroller":{overflow:"auto",padding:"4px 0"},".cm-content":{caretColor:"#33afbc",padding:"0 8px"},".cm-cursor":{borderLeftColor:"#33afbc",borderLeftWidth:"1.5px"},".cm-gutters":{backgroundColor:"var(--color-surface-1)",borderRight:"none",color:"#404852",minWidth:"28px"},".cm-activeLine":{backgroundColor:"rgba(255, 255, 255, 0.02)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"rgba(51, 175, 188, 0.15)"}}),VDe=nZ.define([{tag:X.keyword,color:"#b07fd5"},{tag:[X.name,X.deleted,X.character,X.macroName],color:"#d4d8e0"},{tag:[X.function(X.variableName),X.labelName],color:"#d9a45c"},{tag:[X.meta,X.comment],color:"#6e7681",fontStyle:"italic"},{tag:X.strong,fontWeight:"bold"},{tag:X.emphasis,fontStyle:"italic"},{tag:X.link,color:"#7ab0df",textDecoration:"underline"},{tag:X.heading,fontWeight:"400",color:"#bcc2cd"},{tag:[X.processingInstruction,X.string,X.inserted],color:"#a3b18a"},{tag:[X.atom,X.bool],color:"#c4956a"},{tag:X.invalid,color:"#d4736e"}]);function XDe(){const t=$(f=>f.labSystemPrompt),a=$(f=>f.setLabSystemPrompt),[n,s]=g.useState(!1),o=g.useRef(null),c=g.useRef(null),l=g.useRef(!1),A=t.length,u=g.useCallback(f=>{l.current||a(f)},[a]);return g.useEffect(()=>{if(!o.current)return;const f=Ws.updateListener.of(y=>{y.docChanged&&u(y.state.doc.toString())}),x=CE.create({doc:t,extensions:[sZ(),rZ(),cZ(VDe),jY(),ML.of([...oZ,...iZ]),DDe,f,Ws.lineWrapping]}),m=new Ws({state:x,parent:o.current});return c.current=m,()=>m.destroy()},[]),g.useEffect(()=>{const f=c.current;if(!f)return;const x=f.state.doc.toString();x!==t&&(l.current=!0,f.dispatch({changes:{from:0,to:x.length,insert:t}}),l.current=!1)},[t]),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("button",{onClick:()=>s(!n),className:"flex items-center gap-1.5 w-full cursor-pointer group",children:[n?e.jsx(Rt,{size:11,className:"text-text-4 group-hover:text-text-2 transition-colors"}):e.jsx(bt,{size:11,className:"text-text-4 group-hover:text-text-2 transition-colors"}),e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-3 uppercase tracking-wider group-hover:text-text-2 transition-colors",children:"System Prompt"}),e.jsx("span",{className:"text-2xs font-mono text-text-4 ml-auto",children:A>0?`${A}`:""})]}),e.jsx("div",{className:V("overflow-hidden transition-all duration-200",n?"h-0":"h-36"),children:e.jsx("div",{ref:o,className:"h-full border border-border-subtle rounded-sm overflow-hidden"})})]})}function ZDe({metrics:t}){return t?e.jsxs("div",{className:"flex items-center gap-3 mt-1 ml-5",children:[t.ttft!=null&&e.jsx(Nt,{content:"Time to first token",children:e.jsxs("span",{className:"text-2xs font-mono text-text-4 flex items-center gap-1",children:[e.jsx(Rr,{size:9})," ",Math.round(t.ttft),"ms"]})}),t.tokensPerSec!=null&&e.jsx(Nt,{content:"Tokens per second",children:e.jsxs("span",{className:"text-2xs font-mono text-text-4 flex items-center gap-1",children:[e.jsx(wt,{size:9})," ",t.tokensPerSec.toFixed(1)," t/s"]})}),t.tokens!=null&&e.jsxs("span",{className:"text-2xs font-mono text-text-4",children:[t.tokens," tokens"]}),t.generationTime!=null&&e.jsxs("span",{className:"text-2xs font-mono text-text-4",children:[(t.generationTime/1e3).toFixed(1),"s"]})]}):null}function GDe({msg:t}){return e.jsx("div",{className:"flex justify-end animate-chat-fade-in",children:e.jsx("div",{className:"max-w-[80%]",children:e.jsx("div",{className:"px-3.5 py-2 bg-accent/8 rounded rounded-br-none",children:e.jsx("p",{className:"text-xs text-text-0 font-sans whitespace-pre-wrap break-words leading-relaxed",children:t.content})})})})}function WDe({msg:t,streaming:a}){const n=a&&!t.content&&!t.reasoning&&!t.error,s=a&&t.reasoning&&!t.content;return e.jsxs("div",{className:"animate-chat-fade-in",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("div",{className:"w-4 h-4 rounded-sm bg-surface-4 flex items-center justify-center",children:e.jsx(Os,{size:10,className:"text-text-3"})}),e.jsx("span",{className:"text-2xs text-text-3 font-sans font-medium",children:"Assistant"})]}),t.reasoning&&e.jsx("div",{className:"ml-5 mb-1.5 pl-3 border-l border-text-4/20 py-1",children:e.jsxs("div",{className:"text-2xs font-sans text-text-4 italic whitespace-pre-wrap break-words leading-relaxed",children:[t.reasoning,s&&e.jsx("span",{className:"inline-block w-1 h-3 bg-text-4/40 ml-0.5 animate-pulse"})]})}),e.jsx("div",{className:"ml-5",children:t.content?e.jsxs("div",{className:V("text-xs font-sans whitespace-pre-wrap break-words leading-relaxed",t.error?"text-danger":"text-text-1"),children:[t.content,a&&!t.error&&e.jsx("span",{className:"inline-block w-1.5 h-3.5 bg-accent/60 ml-0.5 animate-pulse"})]}):n?e.jsxs("div",{className:"flex items-center gap-1.5 py-1",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-text-4 animate-pulse"}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-text-4 animate-pulse",style:{animationDelay:"150ms"}}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-text-4 animate-pulse",style:{animationDelay:"300ms"}})]}):null}),e.jsx(ZDe,{metrics:t.metrics})]})}function KDe({sessions:t,activeSession:a,onSelect:n,onNew:s}){const[o,c]=g.useState(!1),l=t.find(u=>u.id===a),A=l?`Session ${t.indexOf(l)+1}`:"No session";return t.length===0?null:e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>c(!o),className:"flex items-center gap-1 px-2 py-1 text-2xs font-sans text-text-3 hover:text-text-1 transition-colors cursor-pointer",children:[A," ",e.jsx(bt,{size:10})]}),o&&e.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 min-w-40 bg-surface-2 border border-border rounded py-1 shadow-xl",children:t.map((u,f)=>e.jsxs("button",{onClick:()=>{n(u.id),c(!1)},className:V("w-full text-left px-3 py-1.5 text-xs font-sans cursor-pointer transition-colors",u.id===a?"text-accent bg-accent/8":"text-text-2 hover:bg-surface-4 hover:text-text-0"),children:["Session ",f+1,e.jsxs("span",{className:"text-2xs text-text-4 ml-2",children:[u.messages.length," msgs"]})]},u.id))})]})}function YDe(){var j;const t=$(N=>N.labSessions),a=$(N=>N.labActiveSession),n=$(N=>N.labStreaming),s=$(N=>N.sendLabMessage),o=$(N=>N.newLabSession),c=$(N=>N.loadLabSession),l=$(N=>N.labActiveRuntime),A=$(N=>N.labActiveModel),[u,f]=g.useState(""),x=g.useRef(null),m=g.useRef(null),y=t.find(N=>N.id===a),v=(y==null?void 0:y.messages)||[];g.useEffect(()=>{if(x.current){const N=x.current.querySelector("[data-radix-scroll-area-viewport]");N&&(N.scrollTop=N.scrollHeight)}},[v.length,(j=v[v.length-1])==null?void 0:j.content]);const O=g.useCallback(()=>{const N=u.trim();!N||n||(f(""),s(N))},[u,n,s]);function b(N){N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),O())}const C=u.trim()&&l&&A&&!n;return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 flex items-center justify-between px-4 pb-2",children:[e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(KDe,{sessions:t,activeSession:a,onSelect:c,onNew:o})}),e.jsx(Nt,{content:"New session",children:e.jsxs("button",{onClick:o,className:"flex items-center gap-1 px-2 py-1 text-2xs font-sans text-text-3 hover:text-text-1 transition-colors cursor-pointer",children:[e.jsx(ht,{size:11})," New"]})})]}),e.jsx(it,{ref:x,className:"flex-1 min-h-0",children:e.jsx("div",{className:"px-4 py-3 space-y-5",children:v.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx("div",{className:"w-10 h-10 rounded bg-surface-2 flex items-center justify-center mb-3",children:e.jsx(Os,{size:20,className:"text-text-4"})}),e.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"Start a conversation"}),e.jsx("p",{className:"text-xs text-text-4 font-sans mt-1",children:l?A?"Send a message to test your model":"Select a model to get started":"Select a runtime to get started"})]}):v.map((N,M)=>N.role==="user"?e.jsx(GDe,{msg:N},M):e.jsx(WDe,{msg:N,streaming:n&&M===v.length-1},M))})}),e.jsx("div",{className:"flex-shrink-0 px-4 py-3",children:e.jsxs("div",{className:"flex items-end gap-2 bg-surface-1 border border-border-subtle rounded-md p-1.5 focus-within:border-accent/30 transition-colors",children:[e.jsx("textarea",{ref:m,value:u,onChange:N=>f(N.target.value),onKeyDown:b,placeholder:l?A?"Type a message...":"Select a model first":"Select a runtime first",disabled:!l||!A,rows:1,className:V("flex-1 resize-none bg-transparent px-2 py-1.5","text-xs text-text-0 font-sans placeholder:text-text-4","focus:outline-none","disabled:opacity-40 disabled:cursor-not-allowed","min-h-[28px] max-h-32"),style:{height:"auto",overflowY:u.split(`
8677
+ State: ${v}`),children:[e.jsx(na,{size:10}),"Details"]}),e.jsxs(fe,{size:"sm",variant:"ghost",className:"h-6 text-2xs gap-1 text-text-2",disabled:l===m,onClick:()=>f(m),children:[e.jsx(Xa,{size:10}),"Send Pouch"]}),e.jsxs(fe,{size:"sm",variant:"ghost",className:"h-6 text-2xs gap-1 text-danger/70 hover:text-danger ml-auto",onClick:()=>o(m),children:[e.jsx(ai,{size:10}),"Disconnect"]})]})]},m)})})]})}const xDe=["All","Sent","Received"];function mDe(){const t=$(c=>c.federation.pouchLog),[a,n]=g.useState("All"),o=[...a==="All"?t:t.filter(c=>c.direction===a.toLowerCase())].reverse().slice(0,200);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Cn,{size:12,className:"text-accent"}),e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"Activity"}),t.length>0&&e.jsx(be,{variant:"default",className:"text-2xs",children:t.length})]}),e.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:xDe.map(c=>e.jsx("button",{onClick:()=>n(c),className:V("px-2.5 py-1 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",a===c?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:c},c))})]}),o.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border-subtle bg-surface-1/50 px-4 py-6 text-center",children:[e.jsx(Cn,{size:18,className:"text-text-4 mx-auto mb-1.5"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:a==="All"?"No diplomatic pouches exchanged yet.":`No ${a.toLowerCase()} pouches.`})]}):e.jsx(it,{className:"max-h-80",children:e.jsxs("div",{className:"relative pl-5",children:[e.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-px bg-border-subtle"}),o.map((c,l)=>{const A=c.direction==="sent";return e.jsxs("div",{className:"relative flex items-start gap-3 pb-3 last:pb-0",children:[e.jsx("div",{className:V("absolute left-[-13px] top-1.5 w-2.5 h-2.5 rounded-full border-2 border-surface-2 z-10",A?"bg-accent":"bg-success")}),e.jsxs("div",{className:"flex items-center gap-2 flex-1 rounded-md bg-surface-1 px-3 py-2 min-w-0",children:[A?e.jsx(c0,{size:11,className:"text-accent flex-shrink-0"}):e.jsx(o0,{size:11,className:"text-success flex-shrink-0"}),e.jsx("span",{className:"text-2xs text-text-1 font-sans truncate flex-1",children:c.contractType||c.type||"message"}),e.jsx("span",{className:"text-2xs text-text-4 font-mono truncate max-w-24",children:c.peerId||""}),e.jsx("span",{className:"text-2xs text-text-3 font-sans flex-shrink-0",children:Mt(c.timestamp||c.ts)})]})]},c.id||l)})]})})]})}const gDe=[{label:"Connect",icon:Yo},{label:"Verify",icon:aa},{label:"Paired",icon:De}];function yDe({current:t}){return e.jsx("div",{className:"flex items-center justify-center gap-2 mb-6",children:gDe.map((a,n)=>{const s=n<t,o=n===t,c=a.icon;return e.jsxs("div",{className:"flex items-center gap-2",children:[n>0&&e.jsx("div",{className:V("w-8 h-px",s?"bg-accent":"bg-border-subtle")}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:V("w-6 h-6 rounded-full flex items-center justify-center transition-colors",s?"bg-accent text-white":o?"bg-accent/15 text-accent border border-accent/30":"bg-surface-3 text-text-4"),children:s?e.jsx(De,{size:12}):e.jsx(c,{size:12})}),e.jsx("span",{className:V("text-2xs font-semibold font-sans",o?"text-text-0":s?"text-accent":"text-text-4"),children:a.label})]})]},a.label)})})}function vDe({open:t,onOpenChange:a}){const n=$(P=>P.addToWhitelist),s=$(P=>P.fetchFederationStatus),[o,c]=g.useState(0),[l,A]=g.useState(""),[u,f]=g.useState("31415"),[x,m]=g.useState(""),[y,v]=g.useState(!1),[O,b]=g.useState(null),[C,j]=g.useState(!1),[N,M]=g.useState(null),[Q,L]=g.useState(null);function B(){c(0),A(""),f("31415"),m(""),v(!1),b(null),j(!1),M(null),L(null)}function S(P){P||B(),a(P)}async function I(){v(!0),b(null),M(null);try{const P=`${l.trim()}:${u||"31415"}`,F=await fetch(`http://localhost:31415/api/federation/test?target=${encodeURIComponent(P)}`);if(F.ok){const K=await F.json();b("reachable"),L(K)}else b("unreachable")}catch{b("unreachable")}v(!1)}async function z(){j(!0),M(null);try{await n(l.trim(),parseInt(u,10)||31415,x.trim()||void 0),await s(),c(2)}catch(P){M(P.message||"Failed to pair with peer")}j(!1)}return e.jsx(Ut,{open:t,onOpenChange:S,children:e.jsx(Pt,{title:"Pair New Peer",description:"Connect to a remote Groove daemon",children:e.jsxs("div",{className:"px-5 py-5",children:[e.jsx(yDe,{current:o}),o===0&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(cn,{label:"Friendly Name",placeholder:"e.g. Production Server",value:x,onChange:P=>m(P.target.value)}),e.jsxs("div",{className:"grid grid-cols-[1fr,100px] gap-2",children:[e.jsx(cn,{label:"IP / Hostname",placeholder:"192.168.1.100",value:l,onChange:P=>A(P.target.value),mono:!0}),e.jsx(cn,{label:"Port",placeholder:"31415",value:u,onChange:P=>f(P.target.value),mono:!0})]}),O==="reachable"&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-success/10 border border-success/20 px-3 py-2",children:[e.jsx(UA,{size:13,className:"text-success"}),e.jsx("span",{className:"text-2xs text-success font-sans font-medium",children:"Peer is reachable"})]}),O==="unreachable"&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-danger/10 border border-danger/20 px-3 py-2",children:[e.jsx(Xt,{size:13,className:"text-danger"}),e.jsx("span",{className:"text-2xs text-danger font-sans font-medium",children:"Could not reach peer — check IP and port"})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsxs(fe,{size:"sm",variant:"ghost",disabled:!l.trim()||y,onClick:I,className:"h-8 text-xs gap-1.5",children:[y?e.jsx($e,{size:12,className:"animate-spin"}):e.jsx(UA,{size:12}),"Test Reachability"]}),e.jsxs(fe,{size:"sm",variant:"primary",disabled:!l.trim(),onClick:()=>c(1),className:"h-8 text-xs gap-1.5 ml-auto",children:["Continue",e.jsx(Fr,{size:12})]})]})]}),o===1&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-0 p-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-md bg-accent/10",children:e.jsx(aa,{size:16,className:"text-accent"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-text-0 font-sans",children:x||"Remote Peer"}),e.jsxs("p",{className:"text-2xs text-text-3 font-mono",children:[l,":",u||"31415"]})]})]}),Q&&e.jsxs("div",{className:"space-y-1.5 pt-2 border-t border-border-subtle",children:[Q.version&&e.jsxs("div",{className:"flex items-center justify-between text-2xs font-sans",children:[e.jsx("span",{className:"text-text-3",children:"Version"}),e.jsx("span",{className:"text-text-1 font-mono",children:Q.version})]}),Q.peerId&&e.jsxs("div",{className:"flex items-center justify-between text-2xs font-sans",children:[e.jsx("span",{className:"text-text-3",children:"Peer ID"}),e.jsx("span",{className:"text-text-1 font-mono truncate max-w-40",children:Q.peerId})]}),Q.agents!=null&&e.jsxs("div",{className:"flex items-center justify-between text-2xs font-sans",children:[e.jsx("span",{className:"text-text-3",children:"Active Agents"}),e.jsx("span",{className:"text-text-1",children:Q.agents})]})]})]}),N&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-danger/10 border border-danger/20 px-3 py-2",children:[e.jsx(Xt,{size:13,className:"text-danger"}),e.jsx("span",{className:"text-2xs text-danger font-sans",children:N})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsx(fe,{size:"sm",variant:"ghost",onClick:()=>c(0),className:"h-8 text-xs",children:"Back"}),e.jsxs(fe,{size:"sm",variant:"primary",disabled:C,onClick:z,className:"h-8 text-xs gap-1.5 ml-auto",children:[C?e.jsx($e,{size:12,className:"animate-spin"}):e.jsx(Yo,{size:12}),"Confirm Pairing"]})]})]}),o===2&&e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-success/15 mx-auto",children:e.jsx(De,{size:20,className:"text-success"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans mb-1",children:"Peer Paired Successfully"}),e.jsxs("p",{className:"text-2xs text-text-3 font-sans",children:[x||l," has been added to your federation whitelist."]})]}),e.jsx("div",{className:"rounded-md border border-border-subtle bg-surface-0 p-3 text-left",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-accent/10",children:e.jsx(aa,{size:14,className:"text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans block truncate",children:x||"Remote Peer"}),e.jsxs("span",{className:"text-2xs text-text-3 font-mono",children:[l,":",u||"31415"]})]}),e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(ia,{status:"running",size:"sm"}),"Whitelisted"]})]})}),e.jsx(fe,{size:"sm",variant:"primary",onClick:()=>S(!1),className:"h-8 text-xs",children:"Done"})]})]})})})}function kDe(t){switch(t){case"mutual":return e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx(ia,{status:"running",size:"sm"})," Mutual"]});case"connected":return e.jsx(be,{variant:"info",className:"text-2xs",children:"Connected"});default:return e.jsx(be,{variant:"default",className:"text-2xs",children:"Waiting"})}}function ODe(){const t=$(j=>j.federation.whitelist),a=$(j=>j.addToWhitelist),n=$(j=>j.removeFromWhitelist),[s,o]=g.useState(!1),[c,l]=g.useState(""),[A,u]=g.useState("31415"),[f,x]=g.useState(""),[m,y]=g.useState(!1),[v,O]=g.useState("");async function b(j){if(j.preventDefault(),!!c.trim()){y(!0);try{await a(c.trim(),parseInt(A,10)||31415,f.trim()||void 0),l(""),u("31415"),x(""),o(!1)}catch{}y(!1)}}const C=g.useMemo(()=>{if(!v.trim())return t;const j=v.toLowerCase();return t.filter(N=>{const M=typeof N=="string"?N:N.ip,Q=typeof N=="object"?N.name:"";return(M==null?void 0:M.toLowerCase().includes(j))||(Q==null?void 0:Q.toLowerCase().includes(j))})},[t,v]);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(La,{size:12,className:"text-accent"}),e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"Whitelist"}),t.length>0&&e.jsx(be,{variant:"default",className:"text-2xs",children:t.length})]}),e.jsx(fe,{size:"sm",variant:s?"ghost":"primary",onClick:()=>o(!s),className:"h-7 text-2xs gap-1.5",children:s?e.jsxs(e.Fragment,{children:[e.jsx(su,{size:11})," Hide"]}):e.jsxs(e.Fragment,{children:[e.jsx(ht,{size:11})," Add Server"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s&&e.jsxs("form",{onSubmit:b,className:"rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"w-6 h-6 rounded bg-accent/8 flex items-center justify-center flex-shrink-0",children:e.jsx(ht,{size:12,className:"text-accent"})}),e.jsx("span",{className:"text-[13px] font-medium text-text-0 font-sans",children:"New Server"})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1 block",children:"Name"}),e.jsx(cn,{placeholder:"Server name",value:f,onChange:j=>x(j.target.value),className:"h-7 text-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1 block",children:"IP Address"}),e.jsx(cn,{placeholder:"100.64.0.2",value:c,onChange:j=>l(j.target.value),mono:!0,className:"h-7 text-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1 block",children:"Port"}),e.jsx(cn,{placeholder:"31415",value:A,onChange:j=>u(j.target.value),mono:!0,className:"h-7 text-xs w-28"})]}),e.jsx("div",{className:"pt-1",children:e.jsxs(fe,{type:"submit",variant:"primary",size:"sm",disabled:m||!c.trim(),className:"h-7 text-2xs gap-1",children:[m?e.jsx($e,{size:11,className:"animate-spin"}):e.jsx(ht,{size:11}),"Add to Whitelist"]})})]})]}),e.jsxs("div",{className:V("rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5",!s&&"col-span-2"),children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"w-6 h-6 rounded bg-accent/8 flex items-center justify-center flex-shrink-0",children:e.jsx(sa,{size:12,className:"text-accent"})}),e.jsx("span",{className:"text-[13px] font-medium text-text-0 font-sans",children:"Servers"}),t.length>=5&&e.jsxs("div",{className:"relative ml-auto",children:[e.jsx(oa,{size:10,className:"absolute left-2 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{type:"text",placeholder:"Filter…",value:v,onChange:j=>O(j.target.value),className:"h-6 pl-6 pr-2 w-32 text-2xs font-sans bg-surface-0 border border-border-subtle rounded-md text-text-0 placeholder:text-text-4 focus:outline-none focus:border-accent"})]})]}),C.length===0&&t.length===0?e.jsxs("div",{className:"px-2 py-4 text-center",children:[e.jsx(sa,{size:16,className:"text-text-4 mx-auto mb-1.5"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"No peers whitelisted yet."})]}):C.length===0?e.jsx("div",{className:"text-2xs text-text-4 font-sans py-3 text-center",children:"No servers match your filter."}):e.jsx("div",{className:"space-y-1.5",children:C.map(j=>{const N=typeof j=="string"?j:j.ip,M=typeof j=="object"?j.name:null,Q=typeof j=="object"?j.status:"waiting",L=typeof j=="object"?j.port:null;return e.jsxs("div",{className:"flex items-center gap-2.5 px-2.5 py-2 rounded-md bg-surface-0 border border-border-subtle",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[M&&e.jsx("span",{className:"text-xs font-sans font-medium text-text-0 block truncate",children:M}),e.jsxs("span",{className:V("font-mono truncate block",M?"text-2xs text-text-3":"text-xs text-text-1"),children:[N,L?`:${L}`:""]})]}),kDe(Q),e.jsx("button",{onClick:()=>n(N),className:"p-1 rounded text-text-4 hover:text-danger hover:bg-danger/10 cursor-pointer transition-colors flex-shrink-0",title:"Remove",children:e.jsx(At,{size:11})})]},N)})})]})]})]})}function bDe(){const t=$(a=>a.federation.ambassadors);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Fa,{size:12,className:"text-accent"}),e.jsx("span",{className:"text-xs font-semibold text-text-1 font-sans",children:"Ambassadors"}),t.length>0&&e.jsx(be,{variant:"info",className:"text-2xs",children:t.length})]}),t.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border-subtle bg-surface-1/50 px-4 py-6 text-center",children:[e.jsx(Fa,{size:18,className:"text-text-4 mx-auto mb-1.5"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"No active ambassadors. Ambassadors appear when agents are shared across federated peers."})]}):e.jsx("div",{className:"grid grid-cols-2 gap-2",children:t.map(a=>e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-3.5 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(ia,{status:a.status==="active"?"running":"stopped",size:"sm"}),e.jsx("span",{className:"text-xs font-sans font-medium text-text-0 truncate flex-1",children:a.name||a.agentId||a.id}),a.role&&e.jsx(be,{variant:"purple",className:"text-2xs",children:a.role})]}),e.jsxs("div",{className:"flex items-center justify-between text-2xs",children:[a.peerId?e.jsx("span",{className:"text-text-3 font-mono truncate max-w-28",children:a.peerId}):e.jsx("span",{className:"text-text-4 font-sans",children:"Local"}),e.jsx(be,{variant:a.status==="active"?"success":"default",className:"text-2xs",children:a.status||"idle"})]})]},a.id||a.agentId))})]})}function wDe(){const t=$(u=>u.fetchFederationStatus),a=$(u=>u.fetchPouchLog),n=$(u=>u.federation.peers),s=$(u=>u.federation.connections),o=$(u=>u.federation.whitelist),[c,l]=g.useState(!1),A=(n.length>0?n:s).length;return g.useEffect(()=>{t(),a()},[]),e.jsxs("div",{className:"flex flex-col h-full bg-surface-0",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center",children:e.jsx(sa,{size:16,className:"text-accent"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-semibold text-text-0 font-sans",children:"Federation"}),e.jsxs("p",{className:"text-2xs text-text-3 font-sans",children:[A," peer",A!==1?"s":""," · ",o.length," whitelisted"]})]})]}),e.jsxs(fe,{size:"sm",variant:"primary",onClick:()=>l(!0),className:"h-8 text-xs gap-1.5",children:[e.jsx(ht,{size:12}),"Add Peer"]})]}),e.jsx(it,{className:"flex-1",children:e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[e.jsx("div",{className:"rounded-lg border border-border-subtle bg-surface-1 p-4",children:e.jsx(fDe,{onOpenWizard:()=>l(!0)})}),e.jsx("div",{className:"rounded-lg border border-border-subtle bg-surface-1 p-4",children:e.jsx(mDe,{})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"rounded-lg border border-border-subtle bg-surface-1 p-4",children:e.jsx(ODe,{})}),e.jsx("div",{className:"rounded-lg border border-border-subtle bg-surface-1 p-4",children:e.jsx(bDe,{})})]})]})})}),e.jsx(vDe,{open:c,onOpenChange:l})]})}function wee({children:t,className:a,hover:n,...s}){return e.jsx("div",{className:V("rounded-md border border-border bg-surface-1",n&&"hover:border-accent/50 hover:bg-surface-2 transition-all duration-150 cursor-pointer",a),...s,children:t})}const jDe={beginner:"success",intermediate:"warning",advanced:"danger"};function CDe(t){if(!t)return on;const a=t.replace(/(^|-)(\w)/g,(n,s,o)=>o.toUpperCase());return TL[a]||TL[t]||on}function NDe({toy:t,onClick:a}){const n=CDe(t.icon);return e.jsxs(wee,{hover:!0,className:"group flex flex-col p-4 gap-3 transition-all duration-150 hover:scale-[1.02] hover:shadow-lg hover:shadow-black/20",onClick:()=>a(t),children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0 bg-accent/10 border border-accent/20 text-accent",children:e.jsx(n,{size:20})}),e.jsx("div",{className:"flex-1 min-w-0 pt-0.5",children:e.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans truncate pr-1",children:t.name})}),e.jsx(be,{variant:"default",className:"flex-shrink-0 mt-0.5",children:t.category})]}),e.jsx("p",{className:"text-xs text-text-2 font-sans leading-relaxed line-clamp-2",children:t.description}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-auto flex-wrap",children:[t.custom&&e.jsx(be,{variant:"accent",children:"Custom"}),e.jsx(be,{variant:jDe[t.difficulty]||"default",children:t.difficulty||"beginner"}),e.jsx(be,{variant:t.authType==="none"?"success":"warning",children:t.authType==="none"?"No Key Required":"API Key Required"})]})]})}function MDe(){return e.jsxs(wee,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-surface-4 animate-pulse"}),e.jsx("div",{className:"flex-1 space-y-2 pt-1",children:e.jsx("div",{className:"h-3.5 w-24 bg-surface-4 rounded animate-pulse"})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-3 w-full bg-surface-4 rounded animate-pulse"}),e.jsx("div",{className:"h-3 w-3/4 bg-surface-4 rounded animate-pulse"})]}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx("div",{className:"h-5 w-16 bg-surface-4 rounded animate-pulse"}),e.jsx("div",{className:"h-5 w-24 bg-surface-4 rounded animate-pulse"})]})]})}function SDe(t){if(!t)return on;const a=t.replace(/(^|-)(\w)/g,(n,s,o)=>o.toUpperCase());return TL[a]||TL[t]||on}function QDe({toy:t,open:a,onClose:n}){var C,j;const[s,o]=g.useState(""),[c,l]=g.useState(!1),[A,u]=g.useState(null),[f,x]=g.useState(!1),m=ln(),y=$(N=>N.setActiveView);if(!t)return null;const v=SDe(t.icon),O=t.authType!=="none";async function b(){if(O&&!s.trim()){m.warning("API key required",`${t.name} needs an API key to work.`);return}x(!0);try{await D.post(`/toys/${t.id}/launch`,{apiKey:O?s.trim():void 0,starterPrompt:A||void 0}),m.success(`${t.name} launched`,"Team is spinning up — switching to agents view."),y("agents"),n()}catch(N){m.error("Launch failed",N.message)}x(!1)}return e.jsx(HT,{open:a,onOpenChange:N=>!N&&n(),children:e.jsxs(qT,{title:t.name,width:440,children:[e.jsx(it,{className:"h-[calc(100%-65px)]",children:e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center flex-shrink-0 bg-accent/10 border border-accent/20 text-accent",children:e.jsx(v,{size:24})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(be,{variant:t.authType==="none"?"success":"warning",children:t.authType==="none"?"Free":"Key Required"}),e.jsx(be,{variant:"default",children:t.category})]}),e.jsx("p",{className:"text-xs text-text-2 font-sans leading-relaxed mt-2",children:t.description})]})]}),t.baseUrl&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-1.5",children:"Base URL"}),e.jsx("code",{className:"text-xs text-accent font-mono bg-surface-3 px-2.5 py-1.5 rounded block truncate",children:t.baseUrl})]}),((C=t.sampleEndpoints)==null?void 0:C.length)>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-1.5",children:"Endpoints"}),e.jsx("div",{className:"space-y-1",children:t.sampleEndpoints.map((N,M)=>{const Q=typeof N=="string"?N:`${N.method||"GET"} ${N.path||""}`,L=Q.indexOf(" "),B=L>0?Q.slice(0,L):"GET",S=L>0?Q.slice(L+1):Q;return e.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-text-2 bg-surface-3 px-2.5 py-1.5 rounded",children:[e.jsx(be,{variant:"accent",className:"text-[9px] px-1 py-0",children:B}),e.jsx("span",{className:"truncate",children:S})]},M)})})]}),((j=t.starterPrompts)==null?void 0:j.length)>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-1.5",children:"Starter Ideas"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.starterPrompts.map((N,M)=>e.jsx("button",{onClick:()=>u(A===N?null:N),className:`px-3 py-1.5 text-xs font-sans rounded-full cursor-pointer select-none transition-colors border ${A===N?"bg-accent/15 text-accent border-accent/25":"text-text-2 bg-surface-3 border-border-subtle hover:text-text-0 hover:border-border"}`,children:N},M))})]}),O&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-1.5",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:c?"text":"password",value:s,onChange:N=>o(N.target.value),placeholder:`Enter your ${t.name} API key`,className:"w-full bg-surface-3 border border-border-subtle rounded px-3 py-2 text-xs text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:border-accent/50 pr-9"}),e.jsx("button",{onClick:()=>l(!c),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-1 cursor-pointer bg-transparent border-0 p-0.5",children:c?e.jsx(jn,{size:14}):e.jsx(na,{size:14})})]})]}),t.docsUrl&&e.jsxs("a",{href:t.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-accent font-sans hover:underline",children:[e.jsx(ma,{size:12}),"View Documentation"]})]})}),e.jsx("div",{className:"px-5 py-3 border-t border-border-subtle bg-surface-1",children:e.jsx(fe,{variant:"primary",size:"lg",className:"w-full gap-2",onClick:b,disabled:f||O&&!s.trim(),children:f?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:14,className:"animate-spin"}),"Launching..."]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{size:14}),"Launch Team"]})})})]})})}const Mr={input:"input",researching:"researching"};function BDe({open:t,onClose:a,onCreated:n}){const[s,o]=g.useState(""),[c,l]=g.useState(""),[A,u]=g.useState(Mr.input),f=ln();function x(){o(""),l(""),u(Mr.input)}function m(){A!==Mr.researching&&(x(),a())}async function y(){const v=s.trim();if(!v){f.warning("URL required","Paste an API documentation or reference URL.");return}u(Mr.researching);try{const O=await D.post("/toys",{docsUrl:v,name:c.trim()||void 0});f.success("Toy created",`${O.name||"New toy"} is ready to launch.`),n==null||n(O),x(),a()}catch(O){f.error("Research failed",O.message),u(Mr.input)}}return e.jsx(HT,{open:t,onOpenChange:v=>!v&&m(),children:e.jsxs(qT,{title:"New Toy",width:440,children:[e.jsx(it,{className:"h-[calc(100%-65px)]",children:e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[A===Mr.input&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-accent/5 border border-accent/10",children:[e.jsx(It,{size:16,className:"text-accent mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-xs text-text-2 font-sans leading-relaxed",children:"Paste a docs URL and Groove's AI will research the API — endpoints, auth, data structures, rate limits — and build a reusable toy card you can launch anytime."})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-1.5",children:"API Docs URL"}),e.jsxs("div",{className:"relative",children:[e.jsx(Yo,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{type:"url",value:s,onChange:v=>o(v.target.value),placeholder:"https://api.example.com/docs",className:"w-full bg-surface-3 border border-border-subtle rounded pl-8 pr-3 py-2 text-xs text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:border-accent/50",onKeyDown:v=>v.key==="Enter"&&y(),autoFocus:!0})]})]}),e.jsxs("div",{children:[e.jsxs("h4",{className:"text-xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-1.5",children:["Name ",e.jsx("span",{className:"text-text-4 normal-case tracking-normal",children:"(optional)"})]}),e.jsx("input",{type:"text",value:c,onChange:v=>l(v.target.value),placeholder:"Auto-detected from docs",className:"w-full bg-surface-3 border border-border-subtle rounded px-3 py-2 text-xs text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:border-accent/50",onKeyDown:v=>v.key==="Enter"&&y()})]})]}),A===Mr.researching&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-xl bg-accent/10 border border-accent/20 flex items-center justify-center",children:e.jsx(sa,{size:24,className:"text-accent animate-pulse"})}),e.jsxs("div",{className:"text-center space-y-1.5",children:[e.jsx("p",{className:"text-sm font-semibold text-text-0 font-sans",children:"Researching API..."}),e.jsx("p",{className:"text-xs text-text-3 font-sans max-w-[260px]",children:"Reading documentation, mapping endpoints, and building your toy card. This takes 15–30 seconds."})]}),e.jsx($e,{size:16,className:"text-accent animate-spin"})]})]})}),e.jsxs("div",{className:"px-5 py-3 border-t border-border-subtle bg-surface-1",children:[A===Mr.input&&e.jsxs(fe,{variant:"primary",size:"lg",className:"w-full gap-2",onClick:y,disabled:!s.trim(),children:[e.jsx(It,{size:14}),"Research & Create"]}),A===Mr.researching&&e.jsxs(fe,{variant:"ghost",size:"lg",className:"w-full",disabled:!0,children:[e.jsx($e,{size:14,className:"animate-spin mr-2"}),"AI is analyzing..."]})]})]})})}const _De=["All","Space","Weather","Finance","Fun","Maps","Data"];function LDe(){const[t,a]=g.useState([]),[n,s]=g.useState(!0),[o,c]=g.useState(""),[l,A]=g.useState("All"),[u,f]=g.useState(null),[x,m]=g.useState(!1),y=$(j=>j.teams),v=g.useCallback(()=>{s(!0),D.get("/toys").then(j=>a(j.toys||j.items||(Array.isArray(j)?j:[]))).catch(()=>a([])).finally(()=>s(!1))},[]);g.useEffect(()=>{v()},[v]);const O=o.toLowerCase(),b=t.filter(j=>{var N,M,Q;return!(l!=="All"&&((N=j.category)==null?void 0:N.toLowerCase())!==l.toLowerCase()||O&&!((M=j.name)!=null&&M.toLowerCase().includes(O))&&!((Q=j.description)!=null&&Q.toLowerCase().includes(O)))}),C=(y||[]).filter(j=>(j.name||"").startsWith("Toy:"));return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex-shrink-0 px-5 pt-5 pb-4",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-1",children:[e.jsx(QA,{size:18,className:"text-accent"}),e.jsx("h1",{className:"text-lg font-bold text-text-0 font-sans",children:"Toys"}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{onClick:()=>m(!0),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold font-sans rounded-full cursor-pointer select-none transition-colors bg-accent/15 text-accent border border-accent/25 hover:bg-accent/25",children:[e.jsx(ht,{size:13}),"New"]})]}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"Plug in an API and start building"})]}),e.jsxs("div",{className:"flex-shrink-0 px-5 pb-4 space-y-3",children:[e.jsxs("div",{className:"relative w-full max-w-sm",children:[e.jsx(oa,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{type:"text",value:o,onChange:j=>c(j.target.value),placeholder:"Search toys...",className:"w-full bg-surface-1 border border-border-subtle rounded pl-8 pr-3 py-1.5 text-xs text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:border-accent/50"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[_De.map(j=>e.jsx("button",{onClick:()=>A(j),className:`px-3 py-1.5 text-xs font-semibold font-sans rounded-full cursor-pointer select-none transition-colors ${l===j?"bg-accent/15 text-accent border border-accent/25":"text-text-3 hover:text-text-1 border border-transparent hover:border-border-subtle"}`,children:j},j)),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"text-2xs text-text-4 font-mono",children:b.length})]})]}),e.jsx(it,{className:"flex-1 min-h-0",children:e.jsxs("div",{className:"px-5 pt-1 pb-5",children:[e.jsx("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(260px,1fr))]",children:n?Array.from({length:6}).map((j,N)=>e.jsx(MDe,{},N)):e.jsxs(e.Fragment,{children:[b.map(j=>e.jsx(NDe,{toy:j,onClick:f},j.id)),e.jsxs("button",{onClick:()=>m(!0),className:"flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 border-dashed border-border-subtle text-text-4 hover:text-accent hover:border-accent/30 hover:bg-accent/5 transition-colors cursor-pointer min-h-[140px]",children:[e.jsx(ht,{size:20}),e.jsx("span",{className:"text-xs font-semibold font-sans",children:"Add API"})]})]})}),!n&&b.length===0&&e.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No toys found. Try a different search or category."}),C.length>0&&e.jsxs("div",{className:"mt-8",children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[e.jsx(es,{size:12}),"Recent Toys (",C.length,")"]}),e.jsx("div",{className:"space-y-1.5",children:C.map(j=>{var N;return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-1 border border-border-subtle",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center flex-shrink-0",children:e.jsx(QA,{size:14,className:"text-accent"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:j.name}),e.jsxs("div",{className:"text-2xs text-text-4 font-sans",children:[((N=j.agents)==null?void 0:N.length)||0," agents"]})]}),e.jsx(be,{variant:"accent",children:"Active"})]},j.id)})})]})]})}),e.jsx(QDe,{toy:u,open:!!u,onClose:()=>f(null)}),e.jsx(BDe,{open:x,onClose:()=>m(!1),onCreated:()=>v()})]})}function TDe({value:t,onChange:a,options:n=[],placeholder:s,className:o,renderOption:c}){var N;const[l,A]=g.useState(!1),[u,f]=g.useState(""),[x,m]=g.useState(-1),y=g.useRef(null),v=g.useRef(null),O=u?n.filter(M=>(M.name||M.id).toLowerCase().includes(u.toLowerCase())):n;g.useEffect(()=>{function M(Q){y.current&&!y.current.contains(Q.target)&&A(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[]),g.useEffect(()=>{m(-1)},[u,l]);const b=g.useCallback(M=>{var Q;a(M),f(""),A(!1),(Q=v.current)==null||Q.blur()},[a]);function C(M){if(!l&&(M.key==="ArrowDown"||M.key==="Enter")){A(!0);return}l&&(M.key==="ArrowDown"?(M.preventDefault(),m(Q=>Math.min(Q+1,O.length-1))):M.key==="ArrowUp"?(M.preventDefault(),m(Q=>Math.max(Q-1,0))):M.key==="Enter"?(M.preventDefault(),x>=0&&O[x]?b(O[x].id||O[x].name):u.trim()&&b(u.trim())):M.key==="Escape"&&(A(!1),f("")))}const j=t&&!l?((N=n.find(M=>(M.id||M.name)===t))==null?void 0:N.name)||t:u;return e.jsxs("div",{ref:y,className:V("relative",o),children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{ref:v,value:j,onChange:M=>{f(M.target.value),A(!0)},onFocus:()=>A(!0),onKeyDown:C,placeholder:s,className:V("h-8 w-full rounded-md pl-3 pr-8 text-sm","bg-surface-1 border border-border text-text-0 font-sans","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","transition-colors duration-100")}),e.jsx(bt,{size:12,className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"})]}),l&&O.length>0&&e.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-30 bg-surface-1 border border-border rounded-md shadow-xl py-1 max-h-48 overflow-y-auto",children:O.map((M,Q)=>e.jsx("button",{onClick:()=>b(M.id||M.name),onMouseEnter:()=>m(Q),className:V("w-full text-left px-3 py-1.5 text-sm font-sans cursor-pointer transition-colors",(M.id||M.name)===t&&"text-accent",x===Q?"bg-accent/10 text-text-0":"text-text-2 hover:bg-surface-5 hover:text-text-0"),children:c?c(M):M.name||M.id},M.id||M.name))}),l&&O.length===0&&u&&e.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-30 bg-surface-1 border border-border rounded-md shadow-xl py-2 px-3",children:e.jsxs("p",{className:"text-xs text-text-3 font-sans",children:["Press Enter to use “",u,"”"]})})]})}const $De=[{value:"ollama",label:"Ollama"},{value:"vllm",label:"vLLM"},{value:"llama-cpp",label:"llama.cpp"},{value:"tgi",label:"TGI"},{value:"openai-compatible",label:"OpenAI Compatible"}],mP={ollama:"http://localhost:11434",vllm:"http://localhost:8000","llama-cpp":"http://localhost:8080",tgi:"http://localhost:8080","openai-compatible":"http://localhost:8000"};function IDe({open:t,onOpenChange:a}){const n=$(b=>b.addLabRuntime),[s,o]=g.useState(""),[c,l]=g.useState("ollama"),[A,u]=g.useState(mP.ollama),[f,x]=g.useState(""),[m,y]=g.useState(!1);function v(b){l(b),u(mP[b]||"")}async function O(){if(!(!s.trim()||!A.trim())){y(!0);try{await n({name:s.trim(),type:c,endpoint:A.trim(),apiKey:f.trim()||void 0}),o(""),l("ollama"),u(mP.ollama),x(""),a(!1)}catch{}y(!1)}}return e.jsx(Ut,{open:t,onOpenChange:a,children:e.jsx(Pt,{title:"Add Runtime",description:"Configure a new inference runtime",children:e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e.jsx(cn,{label:"Name",placeholder:"My vLLM Server",value:s,onChange:b=>o(b.target.value)}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-sans text-text-2 mb-1.5",children:"Type"}),e.jsxs(Ur,{value:c,onValueChange:v,children:[e.jsx(Pr,{placeholder:"Select type"}),e.jsx(Er,{children:$De.map(b=>e.jsx(Da,{value:b.value,children:b.label},b.value))})]})]}),e.jsx(cn,{label:"Endpoint URL",placeholder:"http://localhost:8000",value:A,onChange:b=>u(b.target.value),mono:!0}),e.jsx(cn,{label:"API Key (optional)",placeholder:"sk-...",value:f,onChange:b=>x(b.target.value),mono:!0}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(fe,{variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),e.jsx(fe,{variant:"primary",onClick:O,disabled:!s.trim()||!A.trim()||m,children:m?e.jsx($e,{size:14,className:"animate-spin"}):"Add Runtime"})]})]})})})}function UDe({runtime:t,active:a,onSelect:n,onTest:s,onRemove:o,testing:c}){return e.jsxs("button",{onClick:()=>n(t.id),className:V("w-full flex items-center gap-2.5 px-2.5 py-2 text-left transition-colors cursor-pointer rounded-sm",a?"bg-accent/8 text-text-0":"text-text-2 hover:bg-surface-3 hover:text-text-0"),children:[e.jsx("span",{className:V("w-1.5 h-1.5 rounded-full flex-shrink-0",t.status==="connected"?"bg-success":t.status==="error"?"bg-danger":"bg-text-4")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-sans font-medium truncate",children:t.name}),e.jsxs("div",{className:"text-2xs text-text-4 flex items-center gap-1.5",children:[e.jsx("span",{className:"font-mono",children:t.type}),t.status==="connected"&&e.jsx("span",{className:"text-success",children:"Healthy"}),t.status==="error"&&e.jsx("span",{className:"text-danger",children:"Unreachable"})]})]}),e.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[t.latency!=null&&e.jsxs("span",{className:"text-2xs font-mono text-text-4 mr-1",children:[Math.round(t.latency),"ms"]}),e.jsx(Nt,{content:"Test connection",children:e.jsx("button",{onClick:l=>{l.stopPropagation(),s(t.id)},className:"p-1 text-text-4 hover:text-accent transition-colors cursor-pointer",children:c===t.id?e.jsx($e,{size:11,className:"animate-spin"}):e.jsx(Cs,{size:11})})}),e.jsx(Nt,{content:"Remove",children:e.jsx("button",{onClick:l=>{l.stopPropagation(),o(t.id)},className:"p-1 text-text-4 hover:text-danger transition-colors cursor-pointer",children:e.jsx(At,{size:11})})})]})]})}function PDe(t){return t?t>=1e9?`${(t/1e9).toFixed(1)} GB`:t>=1e6?`${(t/1e6).toFixed(0)} MB`:`${(t/1e3).toFixed(0)} KB`:""}const EX=[{id:"llama-cpp",label:"llama.cpp",subtitle:"CPU + GPU, auto-managed",recommended:!0,autoLaunch:!0},{id:"vllm",label:"vLLM",subtitle:"GPU-optimized, guided setup",autoLaunch:!1},{id:"tgi",label:"TGI",subtitle:"HuggingFace, guided setup",autoLaunch:!1}];function EDe({phase:t,error:a}){return t?e.jsxs("div",{className:V("flex items-center gap-2 px-2.5 py-1.5 text-2xs font-sans rounded-sm",t==="ready"&&"bg-success/8 text-success",t==="error"&&"bg-danger/8 text-danger",(t==="starting"||t==="checking")&&"bg-accent/8 text-accent"),children:[t==="starting"&&e.jsxs(e.Fragment,{children:[e.jsx($e,{size:11,className:"animate-spin"})," Starting server..."]}),t==="checking"&&e.jsxs(e.Fragment,{children:[e.jsx($e,{size:11,className:"animate-spin"})," Checking..."]}),t==="ready"&&e.jsxs(e.Fragment,{children:[e.jsx(Sa,{size:11})," Server ready"]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx(Gt,{size:11})," ",a||"Launch failed"]})]}):null}function zDe(){const t=$(M=>M.labLocalModels),a=$(M=>M.fetchLabLocalModels),n=$(M=>M.checkLlamaStatus),s=$(M=>M.launchLocalModel),o=$(M=>M.labLaunching),c=$(M=>M.labLlamaInstalled),l=$(M=>M.labLaunchPhase),A=$(M=>M.labLaunchError),u=$(M=>M.launchLabAssistant),[f,x]=g.useState(null),[m,y]=g.useState("llama-cpp"),[v,O]=g.useState(!1);g.useEffect(()=>{a(),n()},[a,n]);const b=EX.find(M=>M.id===m),C=f&&(b==null?void 0:b.autoLaunch)&&c&&!o;function j(){C&&s(f)}async function N(){if(!v){O(!0);try{await u(b.id)}finally{O(!1)}}}return e.jsxs("div",{className:"space-y-3",children:[e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-3 uppercase tracking-wider",children:"Launch Model"}),t.length===0?e.jsxs("div",{className:"py-5 text-center",children:[e.jsx(Kn,{size:18,className:"mx-auto text-text-4 mb-1.5"}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No downloaded models"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans mt-0.5",children:"Download GGUFs from the Models tab"})]}):e.jsxs(e.Fragment,{children:[e.jsx(it,{className:"max-h-36",children:e.jsx("div",{className:"space-y-px",children:t.map(M=>{var Q;return e.jsxs("button",{onClick:()=>x(M.id),className:V("w-full flex items-center gap-2 px-2.5 py-2 text-left transition-colors cursor-pointer rounded-sm",f===M.id?"bg-accent/8 text-text-0":"text-text-2 hover:bg-surface-3 hover:text-text-0"),children:[e.jsx(Kn,{size:11,className:V("flex-shrink-0",f===M.id?"text-accent":"text-text-4")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-sans font-medium truncate",children:((Q=M.filename)==null?void 0:Q.replace(/\.gguf$/i,""))||M.id}),e.jsxs("div",{className:"text-2xs font-mono text-text-4 flex items-center gap-2",children:[M.quantization&&e.jsx("span",{children:M.quantization}),M.parameters&&e.jsx("span",{children:M.parameters}),M.sizeBytes&&e.jsx("span",{children:PDe(M.sizeBytes)})]})]}),f===M.id&&e.jsx(Rt,{size:11,className:"text-accent flex-shrink-0"})]},M.id)})})}),f&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-4 uppercase tracking-wider",children:"Backend"}),e.jsx("div",{className:"space-y-px",children:EX.map(M=>e.jsxs("button",{onClick:()=>y(M.id),className:V("w-full flex items-center gap-2.5 px-2.5 py-2 text-left transition-colors cursor-pointer rounded-sm",m===M.id?"bg-accent/8":"hover:bg-surface-3"),children:[e.jsx("span",{className:V("w-2 h-2 rounded-full border-[1.5px] flex-shrink-0",m===M.id?"border-accent bg-accent":"border-text-4")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:V("text-xs font-sans font-medium",m===M.id?"text-text-0":"text-text-2"),children:M.label}),M.recommended&&e.jsx(be,{variant:"success",className:"text-2xs",children:"Recommended"})]}),e.jsx("div",{className:"text-2xs text-text-4 font-sans",children:M.subtitle})]})]},M.id))}),m==="llama-cpp"&&e.jsxs("div",{className:"px-2.5",children:[c===null&&e.jsxs("div",{className:"flex items-center gap-2 text-2xs text-text-3 font-sans",children:[e.jsx($e,{size:10,className:"animate-spin"})," Checking llama-server..."]}),c===!0&&e.jsxs("div",{className:"flex items-center gap-2 text-2xs text-success font-sans",children:[e.jsx(Sa,{size:10})," llama-server found"]}),c===!1&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-2xs text-danger font-sans",children:[e.jsx(Gt,{size:10})," llama-server not found"]}),e.jsx("code",{className:"block text-2xs font-mono text-text-3 bg-surface-2 px-2 py-1 rounded-sm",children:"brew install llama.cpp"}),e.jsxs("button",{onClick:n,className:"flex items-center gap-1.5 text-2xs font-sans text-accent hover:text-accent/80 transition-colors cursor-pointer",children:[e.jsx(Cs,{size:10})," Recheck after install"]})]})]}),!(b!=null&&b.autoLaunch)&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{onClick:N,disabled:v,className:V("w-full flex items-center justify-center gap-1.5 px-3 py-2 text-xs font-sans font-medium rounded-sm transition-colors cursor-pointer",v?"bg-accent/20 text-accent":"bg-accent text-surface-0 hover:bg-accent/90"),children:v?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:12,className:"animate-spin"})," Starting Assistant..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ju,{size:12})," Setup ",b==null?void 0:b.label," with Assistant"]})}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"An AI assistant will check your system and handle the installation, or start your server manually and add it as a Runtime below."})]}),(b==null?void 0:b.autoLaunch)&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{disabled:!C,onClick:j,className:V("w-full flex items-center justify-center gap-1.5 px-3 py-2 text-xs font-sans font-medium rounded-sm transition-colors cursor-pointer",C?"bg-accent text-surface-0 hover:bg-accent/90":"bg-surface-3 text-text-4 cursor-not-allowed"),children:o?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:12,className:"animate-spin"})," Starting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ei,{size:12})," Launch"]})}),e.jsx(EDe,{phase:l,error:A})]})]})]})]})}function FDe(){const t=$(x=>x.labRuntimes),a=$(x=>x.labActiveRuntime),n=$(x=>x.setLabActiveRuntime),s=$(x=>x.testLabRuntime),o=$(x=>x.removeLabRuntime),[c,l]=g.useState(!1),[A,u]=g.useState(null);async function f(x){u(x),await s(x),u(null)}return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-3 uppercase tracking-wider",children:"Runtimes"}),e.jsx(Nt,{content:"Add runtime",children:e.jsx("button",{onClick:()=>l(!0),className:"p-1 text-text-4 hover:text-accent transition-colors cursor-pointer",children:e.jsx(ht,{size:13})})})]}),t.length===0?e.jsxs("div",{className:"py-5 text-center",children:[e.jsx(F0,{size:18,className:"mx-auto text-text-4 mb-1.5"}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No runtimes configured"}),e.jsxs("button",{onClick:()=>l(!0),className:"mt-2 flex items-center gap-1 mx-auto px-3 py-1.5 text-2xs font-sans text-text-3 hover:text-text-1 transition-colors cursor-pointer",children:[e.jsx(ht,{size:11})," Add Runtime"]})]}):e.jsx(it,{className:"max-h-48",children:e.jsx("div",{className:"space-y-px",children:t.map(x=>e.jsx(UDe,{runtime:x,active:a===x.id,onSelect:n,onTest:f,onRemove:o,testing:A},x.id))})}),e.jsx(IDe,{open:c,onOpenChange:l})]})}const RDe={temperature:.7,topP:.9,topK:40,repeatPenalty:1.1,maxTokens:2048,frequencyPenalty:0,presencePenalty:0},HDe=[{key:"temperature",label:"Temperature",min:0,max:2,step:.01},{key:"topP",label:"Top P",min:0,max:1,step:.01},{key:"topK",label:"Top K",min:0,max:200,step:1},{key:"repeatPenalty",label:"Repeat Penalty",min:0,max:2,step:.01},{key:"maxTokens",label:"Max Tokens",min:1,max:32768,step:1,format:t=>t>=1e3?`${(t/1e3).toFixed(1)}k`:t},{key:"frequencyPenalty",label:"Freq Penalty",min:0,max:2,step:.01},{key:"presencePenalty",label:"Pres Penalty",min:0,max:2,step:.01}];function qDe(){const t=$(s=>s.labParameters),a=$(s=>s.setLabParameter);function n(){for(const[s,o]of Object.entries(RDe))a(s,o)}return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-3 uppercase tracking-wider",children:"Parameters"}),e.jsx(Nt,{content:"Reset to defaults",children:e.jsx("button",{onClick:n,className:"p-1 text-text-4 hover:text-accent transition-colors cursor-pointer",children:e.jsx(Cs,{size:11})})})]}),HDe.map(s=>e.jsx(ri,{label:s.label,value:t[s.key],onChange:o=>a(s.key,o),min:s.min,max:s.max,step:s.step,formatValue:s.format},s.key))]})}const DDe=Ws.theme({"&":{backgroundColor:"var(--color-surface-1)",color:"#d4d8e0",fontFamily:"var(--font-mono)",fontSize:"11px",height:"100%",lineHeight:"1.6"},".cm-scroller":{overflow:"auto",padding:"4px 0"},".cm-content":{caretColor:"#33afbc",padding:"0 8px"},".cm-cursor":{borderLeftColor:"#33afbc",borderLeftWidth:"1.5px"},".cm-gutters":{backgroundColor:"var(--color-surface-1)",borderRight:"none",color:"#404852",minWidth:"28px"},".cm-activeLine":{backgroundColor:"rgba(255, 255, 255, 0.02)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"rgba(51, 175, 188, 0.15)"}}),VDe=nZ.define([{tag:X.keyword,color:"#b07fd5"},{tag:[X.name,X.deleted,X.character,X.macroName],color:"#d4d8e0"},{tag:[X.function(X.variableName),X.labelName],color:"#dcc9a0"},{tag:[X.meta,X.comment],color:"#6e7681",fontStyle:"italic"},{tag:X.strong,fontWeight:"bold"},{tag:X.emphasis,fontStyle:"italic"},{tag:X.link,color:"#7ab0df",textDecoration:"underline"},{tag:X.heading,fontWeight:"400",color:"#bcc2cd"},{tag:[X.processingInstruction,X.string,X.inserted],color:"#95b2b8"},{tag:[X.atom,X.bool],color:"#d4a07a"},{tag:X.invalid,color:"#d4736e"}]);function XDe(){const t=$(f=>f.labSystemPrompt),a=$(f=>f.setLabSystemPrompt),[n,s]=g.useState(!1),o=g.useRef(null),c=g.useRef(null),l=g.useRef(!1),A=t.length,u=g.useCallback(f=>{l.current||a(f)},[a]);return g.useEffect(()=>{if(!o.current)return;const f=Ws.updateListener.of(y=>{y.docChanged&&u(y.state.doc.toString())}),x=CE.create({doc:t,extensions:[sZ(),rZ(),cZ(VDe),jY(),ML.of([...oZ,...iZ]),DDe,f,Ws.lineWrapping]}),m=new Ws({state:x,parent:o.current});return c.current=m,()=>m.destroy()},[]),g.useEffect(()=>{const f=c.current;if(!f)return;const x=f.state.doc.toString();x!==t&&(l.current=!0,f.dispatch({changes:{from:0,to:x.length,insert:t}}),l.current=!1)},[t]),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("button",{onClick:()=>s(!n),className:"flex items-center gap-1.5 w-full cursor-pointer group",children:[n?e.jsx(Rt,{size:11,className:"text-text-4 group-hover:text-text-2 transition-colors"}):e.jsx(bt,{size:11,className:"text-text-4 group-hover:text-text-2 transition-colors"}),e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-3 uppercase tracking-wider group-hover:text-text-2 transition-colors",children:"System Prompt"}),e.jsx("span",{className:"text-2xs font-mono text-text-4 ml-auto",children:A>0?`${A}`:""})]}),e.jsx("div",{className:V("overflow-hidden transition-all duration-200",n?"h-0":"h-36"),children:e.jsx("div",{ref:o,className:"h-full border border-border-subtle rounded-sm overflow-hidden"})})]})}function ZDe({metrics:t}){return t?e.jsxs("div",{className:"flex items-center gap-3 mt-1 ml-5",children:[t.ttft!=null&&e.jsx(Nt,{content:"Time to first token",children:e.jsxs("span",{className:"text-2xs font-mono text-text-4 flex items-center gap-1",children:[e.jsx(Rr,{size:9})," ",Math.round(t.ttft),"ms"]})}),t.tokensPerSec!=null&&e.jsx(Nt,{content:"Tokens per second",children:e.jsxs("span",{className:"text-2xs font-mono text-text-4 flex items-center gap-1",children:[e.jsx(wt,{size:9})," ",t.tokensPerSec.toFixed(1)," t/s"]})}),t.tokens!=null&&e.jsxs("span",{className:"text-2xs font-mono text-text-4",children:[t.tokens," tokens"]}),t.generationTime!=null&&e.jsxs("span",{className:"text-2xs font-mono text-text-4",children:[(t.generationTime/1e3).toFixed(1),"s"]})]}):null}function GDe({msg:t}){return e.jsx("div",{className:"flex justify-end animate-chat-fade-in",children:e.jsx("div",{className:"max-w-[80%]",children:e.jsx("div",{className:"px-3.5 py-2 bg-accent/8 rounded rounded-br-none",children:e.jsx("p",{className:"text-xs text-text-0 font-sans whitespace-pre-wrap break-words leading-relaxed",children:t.content})})})})}function WDe({msg:t,streaming:a}){const n=a&&!t.content&&!t.reasoning&&!t.error,s=a&&t.reasoning&&!t.content;return e.jsxs("div",{className:"animate-chat-fade-in",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("div",{className:"w-4 h-4 rounded-sm bg-surface-4 flex items-center justify-center",children:e.jsx(Os,{size:10,className:"text-text-3"})}),e.jsx("span",{className:"text-2xs text-text-3 font-sans font-medium",children:"Assistant"})]}),t.reasoning&&e.jsx("div",{className:"ml-5 mb-1.5 pl-3 border-l border-text-4/20 py-1",children:e.jsxs("div",{className:"text-2xs font-sans text-text-4 italic whitespace-pre-wrap break-words leading-relaxed",children:[t.reasoning,s&&e.jsx("span",{className:"inline-block w-1 h-3 bg-text-4/40 ml-0.5 animate-pulse"})]})}),e.jsx("div",{className:"ml-5",children:t.content?e.jsxs("div",{className:V("text-xs font-sans whitespace-pre-wrap break-words leading-relaxed",t.error?"text-danger":"text-text-1"),children:[t.content,a&&!t.error&&e.jsx("span",{className:"inline-block w-1.5 h-3.5 bg-accent/60 ml-0.5 animate-pulse"})]}):n?e.jsxs("div",{className:"flex items-center gap-1.5 py-1",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-text-4 animate-pulse"}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-text-4 animate-pulse",style:{animationDelay:"150ms"}}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-text-4 animate-pulse",style:{animationDelay:"300ms"}})]}):null}),e.jsx(ZDe,{metrics:t.metrics})]})}function KDe({sessions:t,activeSession:a,onSelect:n,onNew:s}){const[o,c]=g.useState(!1),l=t.find(u=>u.id===a),A=l?`Session ${t.indexOf(l)+1}`:"No session";return t.length===0?null:e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>c(!o),className:"flex items-center gap-1 px-2 py-1 text-2xs font-sans text-text-3 hover:text-text-1 transition-colors cursor-pointer",children:[A," ",e.jsx(bt,{size:10})]}),o&&e.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 min-w-40 bg-surface-2 border border-border rounded py-1 shadow-xl",children:t.map((u,f)=>e.jsxs("button",{onClick:()=>{n(u.id),c(!1)},className:V("w-full text-left px-3 py-1.5 text-xs font-sans cursor-pointer transition-colors",u.id===a?"text-accent bg-accent/8":"text-text-2 hover:bg-surface-4 hover:text-text-0"),children:["Session ",f+1,e.jsxs("span",{className:"text-2xs text-text-4 ml-2",children:[u.messages.length," msgs"]})]},u.id))})]})}function YDe(){var j;const t=$(N=>N.labSessions),a=$(N=>N.labActiveSession),n=$(N=>N.labStreaming),s=$(N=>N.sendLabMessage),o=$(N=>N.newLabSession),c=$(N=>N.loadLabSession),l=$(N=>N.labActiveRuntime),A=$(N=>N.labActiveModel),[u,f]=g.useState(""),x=g.useRef(null),m=g.useRef(null),y=t.find(N=>N.id===a),v=(y==null?void 0:y.messages)||[];g.useEffect(()=>{if(x.current){const N=x.current.querySelector("[data-radix-scroll-area-viewport]");N&&(N.scrollTop=N.scrollHeight)}},[v.length,(j=v[v.length-1])==null?void 0:j.content]);const O=g.useCallback(()=>{const N=u.trim();!N||n||(f(""),s(N))},[u,n,s]);function b(N){N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),O())}const C=u.trim()&&l&&A&&!n;return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 flex items-center justify-between px-4 pb-2",children:[e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(KDe,{sessions:t,activeSession:a,onSelect:c,onNew:o})}),e.jsx(Nt,{content:"New session",children:e.jsxs("button",{onClick:o,className:"flex items-center gap-1 px-2 py-1 text-2xs font-sans text-text-3 hover:text-text-1 transition-colors cursor-pointer",children:[e.jsx(ht,{size:11})," New"]})})]}),e.jsx(it,{ref:x,className:"flex-1 min-h-0",children:e.jsx("div",{className:"px-4 py-3 space-y-5",children:v.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx("div",{className:"w-10 h-10 rounded bg-surface-2 flex items-center justify-center mb-3",children:e.jsx(Os,{size:20,className:"text-text-4"})}),e.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"Start a conversation"}),e.jsx("p",{className:"text-xs text-text-4 font-sans mt-1",children:l?A?"Send a message to test your model":"Select a model to get started":"Select a runtime to get started"})]}):v.map((N,M)=>N.role==="user"?e.jsx(GDe,{msg:N},M):e.jsx(WDe,{msg:N,streaming:n&&M===v.length-1},M))})}),e.jsx("div",{className:"flex-shrink-0 px-4 py-3",children:e.jsxs("div",{className:"flex items-end gap-2 bg-surface-1 border border-border-subtle rounded-md p-1.5 focus-within:border-accent/30 transition-colors",children:[e.jsx("textarea",{ref:m,value:u,onChange:N=>f(N.target.value),onKeyDown:b,placeholder:l?A?"Type a message...":"Select a model first":"Select a runtime first",disabled:!l||!A,rows:1,className:V("flex-1 resize-none bg-transparent px-2 py-1.5","text-xs text-text-0 font-sans placeholder:text-text-4","focus:outline-none","disabled:opacity-40 disabled:cursor-not-allowed","min-h-[28px] max-h-32"),style:{height:"auto",overflowY:u.split(`
8678
8678
  `).length>4?"auto":"hidden"},onInput:N=>{N.target.style.height="auto",N.target.style.height=`${Math.min(N.target.scrollHeight,128)}px`}}),n?e.jsx("button",{onClick:()=>$.getState().stopLabInference(),className:"flex-shrink-0 w-7 h-7 flex items-center justify-center rounded-sm bg-danger/15 text-danger hover:bg-danger/25 transition-colors cursor-pointer",children:e.jsx(Gr,{size:12})}):e.jsx("button",{disabled:!C,onClick:O,className:V("flex-shrink-0 w-7 h-7 flex items-center justify-center rounded-sm transition-colors cursor-pointer",C?"bg-accent text-surface-0 hover:bg-accent/90":"bg-surface-3 text-text-4 cursor-not-allowed"),children:e.jsx(Xa,{size:12})})]})})]})}function JDe({msg:t}){return e.jsxs("div",{className:"animate-chat-fade-in",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("div",{className:"w-4 h-4 rounded-sm bg-surface-4 flex items-center justify-center",children:e.jsx(Os,{size:10,className:"text-text-3"})}),e.jsx("span",{className:"text-2xs text-text-3 font-sans font-medium",children:"Lab Assistant"})]}),e.jsx("div",{className:"ml-5",children:e.jsx("div",{className:V("text-xs font-sans whitespace-pre-wrap break-words leading-relaxed",t.error?"text-danger":"text-text-1"),children:t.text})})]})}function eVe({msg:t}){return e.jsx("div",{className:"flex justify-end animate-chat-fade-in",children:e.jsx("div",{className:"max-w-[80%]",children:e.jsx("div",{className:"px-3.5 py-2 bg-accent/8 rounded rounded-br-none",children:e.jsx("p",{className:"text-xs text-text-0 font-sans whitespace-pre-wrap break-words leading-relaxed",children:t.text})})})})}function tVe(){var M,Q;const t=$(L=>L.labAssistantAgentId),a=$(L=>L.labAssistantBackend),n=$(L=>L.chatHistory),s=$(L=>L.agents),o=$(L=>L.thinkingAgents),c=$(L=>L.instructAgent),l=$(L=>L.dismissLabAssistant),A=$(L=>L.setLabAssistantMode),[u,f]=g.useState(""),x=g.useRef(null),m=g.useRef(null),y=s.find(L=>L.id===t),v=n[t]||[],O=(M=o==null?void 0:o.has)==null?void 0:M.call(o,t),b=(y==null?void 0:y.status)==="running",C=y&&y.status!=="running";g.useEffect(()=>{if(x.current){const L=x.current.querySelector("[data-radix-scroll-area-viewport]");L&&(L.scrollTop=L.scrollHeight)}},[v.length,(Q=v[v.length-1])==null?void 0:Q.text]);const j=g.useCallback(()=>{const L=u.trim();!L||!t||!b||(f(""),c(t,L))},[u,t,b,c]);function N(L){L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),j())}return t?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 flex items-center justify-between px-4 pb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[a&&e.jsx("span",{className:"text-2xs font-mono text-text-3",children:a}),y&&e.jsx(be,{variant:b?"success":C?"default":"warning",className:"text-2xs",children:y.status})]}),e.jsx("button",{onClick:l,className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",children:e.jsx(Ge,{size:14})})]}),e.jsx(it,{ref:x,className:"flex-1 min-h-0",children:e.jsxs("div",{className:"px-4 py-3 space-y-5",children:[v.length===0&&!O?e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx("div",{className:"w-10 h-10 rounded bg-surface-2 flex items-center justify-center mb-3",children:e.jsx(Os,{size:20,className:"text-text-4"})}),e.jsxs("p",{className:"text-sm text-text-2 font-sans font-medium",children:["Setting up ",a]}),e.jsx("p",{className:"text-xs text-text-4 font-sans mt-1",children:"The assistant is starting up..."})]}):v.map((L,B)=>L.from==="user"?e.jsx(eVe,{msg:L},B):e.jsx(JDe,{msg:L},B)),O&&e.jsxs("div",{className:"animate-chat-fade-in",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("div",{className:"w-4 h-4 rounded-sm bg-surface-4 flex items-center justify-center",children:e.jsx(Os,{size:10,className:"text-text-3"})}),e.jsx("span",{className:"text-2xs text-text-3 font-sans font-medium",children:"Lab Assistant"})]}),e.jsxs("div",{className:"ml-5 flex items-center gap-1.5 py-1",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-text-4 animate-pulse"}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-text-4 animate-pulse",style:{animationDelay:"150ms"}}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-text-4 animate-pulse",style:{animationDelay:"300ms"}})]})]})]})}),C&&v.length>0&&e.jsx("div",{className:"flex-shrink-0 px-4 py-2 bg-success/5 border-t border-success/10",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-sans text-success font-medium",children:"Setup complete"}),e.jsxs("button",{onClick:()=>A(!1),className:"flex items-center gap-1 px-3 py-1.5 text-xs font-sans font-medium text-surface-0 bg-accent hover:bg-accent/90 rounded-sm transition-colors cursor-pointer",children:[e.jsx(Fr,{size:12})," Playground"]})]})}),e.jsx("div",{className:"flex-shrink-0 px-4 py-3",children:e.jsxs("div",{className:"flex items-end gap-2 bg-surface-1 border border-border-subtle rounded-md p-1.5 focus-within:border-accent/30 transition-colors",children:[e.jsx("textarea",{ref:m,value:u,onChange:L=>f(L.target.value),onKeyDown:N,placeholder:b?"Type a message...":"Assistant is not running",disabled:!b,rows:1,className:V("flex-1 resize-none bg-transparent px-2 py-1.5","text-xs text-text-0 font-sans placeholder:text-text-4","focus:outline-none","disabled:opacity-40 disabled:cursor-not-allowed","min-h-[28px] max-h-32"),style:{height:"auto",overflowY:u.split(`
8679
8679
  `).length>4?"auto":"hidden"},onInput:L=>{L.target.style.height="auto",L.target.style.height=`${Math.min(L.target.scrollHeight,128)}px`}}),e.jsx("button",{disabled:!u.trim()||!b,onClick:j,className:V("flex-shrink-0 w-7 h-7 flex items-center justify-center rounded-sm transition-colors cursor-pointer",u.trim()&&b?"bg-accent text-surface-0 hover:bg-accent/90":"bg-surface-3 text-text-4 cursor-not-allowed"),children:e.jsx(Xa,{size:12})})]})})]}):null}function aVe({value:t}){if(t==null)return e.jsxs("div",{className:"text-center py-4",children:[e.jsx("div",{className:"text-2xl font-mono font-bold text-text-4 tabular-nums",children:"--"}),e.jsx("div",{className:"text-2xs text-text-4 font-sans mt-1",children:"TTFT"})]});const a=t<200?"text-success":t<500?"text-warning":"text-danger";return e.jsxs("div",{className:"text-center py-4",children:[e.jsx("div",{className:V("text-2xl font-mono font-bold tabular-nums",a),children:Math.round(t)}),e.jsx("div",{className:"text-2xs text-text-3 font-sans mt-1",children:"ms TTFT"})]})}function nVe({data:t,width:a=140,height:n=32,color:s=te.accent}){if(!t||t.length<2)return e.jsx("div",{className:"flex-shrink-0",style:{width:a,height:n}});const o=t.filter(x=>x!=null);if(o.length<2)return e.jsx("div",{className:"flex-shrink-0",style:{width:a,height:n}});const c=Math.min(...o),A=Math.max(...o)-c||1,u=o.map((x,m)=>{const y=m/(o.length-1)*a,v=n-(x-c)/A*(n-2)-1;return`${y},${v}`}).join(" "),f=`0,${n} ${u} ${a},${n}`;return e.jsxs("svg",{width:a,height:n,className:"w-full",children:[e.jsx("polyline",{points:f,fill:qe(s,.08),stroke:"none"}),e.jsx("polyline",{points:u,fill:"none",stroke:s,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round",strokeOpacity:"0.7"})]})}function gP({icon:t,label:a,value:n,unit:s,tooltip:o}){const c=e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t,{size:11,className:"text-text-4 flex-shrink-0"}),e.jsx("span",{className:"text-2xs text-text-3 font-sans",children:a})]}),e.jsxs("span",{className:"text-xs font-mono font-medium text-text-1 tabular-nums",children:[n??"--",s&&n!=null?e.jsx("span",{className:"text-text-4 ml-0.5 text-2xs",children:s}):""]})]});return o?e.jsx(Nt,{content:o,children:c}):c}function sVe(){const t=$(n=>n.labMetrics),a=$(n=>n.labActiveRuntime);return e.jsxs("div",{className:"space-y-5",children:[e.jsx(aVe,{value:t.ttft}),e.jsx("div",{className:"h-px bg-border-subtle"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(wt,{size:11,className:"text-accent"}),e.jsx("span",{className:"text-2xs text-text-3 font-sans",children:"Tokens/sec"})]}),e.jsx("span",{className:"text-sm font-mono font-bold text-text-0 tabular-nums",children:t.tokensPerSec!=null?t.tokensPerSec.toFixed(1):"--"})]}),e.jsx(nVe,{data:t.tokensPerSecHistory})]}),e.jsx("div",{className:"h-px bg-border-subtle"}),e.jsxs("div",{className:"space-y-0",children:[e.jsx(gP,{icon:Ba,label:"Memory",value:t.memory!=null?`${(t.memory/1024/1024).toFixed(0)}`:null,unit:"MB",tooltip:"GPU/CPU memory usage"}),e.jsx(gP,{icon:du,label:"Total Tokens",value:t.totalTokens>0?pt(t.totalTokens):null,tooltip:"Total tokens generated this session"}),e.jsx(gP,{icon:P0,label:"Gen Time",value:t.generationTime!=null?`${(t.generationTime/1e3).toFixed(1)}`:null,unit:"s",tooltip:"Last generation time"})]}),a&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-px bg-border-subtle"}),e.jsx(Nt,{content:"Use current preset when spawning a new agent",children:e.jsxs("button",{className:"w-full flex items-center justify-center gap-1.5 px-3 py-2 text-2xs font-sans text-text-3 hover:text-text-1 border border-border-subtle rounded-sm hover:border-border transition-colors cursor-pointer",children:[e.jsx(b0,{size:11})," Attach to Agent"]})})]})]})}function rVe({open:t,onOpenChange:a}){const n=$(A=>A.saveLabPreset),[s,o]=g.useState("");function c(){s.trim()&&(n(s.trim()),o(""),a(!1))}function l(A){A.key==="Enter"&&c()}return e.jsx(Ut,{open:t,onOpenChange:a,children:e.jsx(Pt,{title:"Save Preset",description:"Save current parameters as a preset",children:e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e.jsx(cn,{label:"Preset Name",placeholder:"My Custom Preset",value:s,onChange:A=>o(A.target.value),onKeyDown:l}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(fe,{variant:"ghost",onClick:()=>a(!1),children:"Cancel"}),e.jsx(fe,{variant:"primary",onClick:c,disabled:!s.trim(),children:"Save"})]})]})})})}function oVe(){const t=$(l=>l.labPresets),a=$(l=>l.labActivePreset),n=$(l=>l.loadLabPreset),s=$(l=>l.deleteLabPreset),[o,c]=g.useState(!1);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-3 uppercase tracking-wider",children:"Presets"}),e.jsx(Nt,{content:"Save current settings as preset",children:e.jsx("button",{onClick:()=>c(!0),className:"p-1 text-text-4 hover:text-accent transition-colors cursor-pointer",children:e.jsx(Xr,{size:13})})})]}),t.length===0?e.jsxs("div",{className:"py-3 text-center",children:[e.jsx(d0,{size:14,className:"mx-auto text-text-4 mb-1"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"No presets saved"})]}):e.jsx(it,{className:"max-h-32",children:e.jsx("div",{className:"space-y-px",children:t.map(l=>e.jsxs("div",{className:V("flex items-center gap-2 px-2.5 py-1.5 rounded-sm transition-colors",a===l.id?"bg-accent/8":"hover:bg-surface-3"),children:[e.jsx("button",{onClick:()=>n(l.id),className:"flex-1 text-left min-w-0 cursor-pointer",children:e.jsx("div",{className:V("text-xs font-sans truncate",a===l.id?"text-accent font-medium":"text-text-2"),children:l.name})}),e.jsx(Nt,{content:"Delete preset",children:e.jsx("button",{onClick:()=>s(l.id),className:"p-0.5 text-text-4 hover:text-danger transition-colors cursor-pointer flex-shrink-0",children:e.jsx(At,{size:10})})})]},l.id))})}),e.jsx(rVe,{open:o,onOpenChange:c})]})}const iVe=280,cVe=220,lVe=400,dVe=240,AVe=200,uVe=360;function hVe(){const t=$(o=>o.labModels),a=$(o=>o.labActiveRuntime),n=$(o=>o.labActiveModel),s=$(o=>o.setLabActiveModel);return a?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-3 uppercase tracking-wider",children:"Model"}),e.jsx(TDe,{value:n||"",onChange:s,options:t.map(o=>({id:o.id||o.name,name:o.name,size:o.size})),placeholder:"Select or type a model name",renderOption:o=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(on,{size:12,className:"text-text-3 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:o.name}),o.size&&e.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:o.size})]})}),!n&&t.length===0&&e.jsx("p",{className:"text-2xs text-text-4 font-sans px-1",children:"No models discovered — type a model name or test the runtime"})]}):null}function zX({onMouseDown:t}){return e.jsxs("div",{onMouseDown:t,className:"flex-shrink-0 w-[3px] cursor-col-resize group relative",children:[e.jsx("div",{className:"absolute inset-y-0 -left-1 -right-1"}),e.jsx("div",{className:"absolute inset-y-0 left-[1px] w-px bg-border group-hover:bg-accent/50 transition-colors"})]})}function bf({collapsed:t,onClick:a,side:n}){const s=n==="left"?t?xs:fs:t?_0:B0,o=n==="left"?t?"Show config":"Hide config":t?"Show metrics":"Hide metrics";return e.jsx(Nt,{content:o,children:e.jsx("button",{onClick:a,className:V("p-1 transition-colors cursor-pointer",t?"text-text-4 hover:text-text-1":"text-text-3 hover:text-text-1"),children:e.jsx(s,{size:14})})})}function pVe(){const t=$(N=>N.fetchLabRuntimes),a=$(N=>N.labAssistantAgentId),n=$(N=>N.labAssistantMode),s=$(N=>N.setLabAssistantMode);g.useEffect(()=>{t()},[t]),g.useEffect(()=>{const N=setInterval(t,3e4);return()=>clearInterval(N)},[t]);const[o,c]=g.useState(!1),[l,A]=g.useState(!1),[u,f]=g.useState(iVe),[x,m]=g.useState(dVe),y=g.useRef(!1),v=g.useRef(!1),O=g.useRef(0),b=g.useRef(0),C=g.useCallback(N=>{N.preventDefault(),y.current=!0,O.current=N.clientX,b.current=u;function M(L){if(!y.current)return;const B=L.clientX-O.current;f(Math.min(Math.max(b.current+B,cVe),lVe))}function Q(){y.current=!1,document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",Q)}document.addEventListener("mousemove",M),document.addEventListener("mouseup",Q)},[u]),j=g.useCallback(N=>{N.preventDefault(),v.current=!0,O.current=N.clientX,b.current=x;function M(L){if(!v.current)return;const B=O.current-L.clientX;m(Math.min(Math.max(b.current+B,AVe),uVe))}function Q(){v.current=!1,document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",Q)}document.addEventListener("mousemove",M),document.addEventListener("mouseup",Q)},[x]);return e.jsx("div",{className:"h-full flex flex-col bg-surface-0",children:e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsx("div",{className:V("flex-shrink-0 transition-all duration-200 overflow-hidden",o&&"w-0"),style:o?void 0:{width:u},children:e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 flex items-center justify-between px-4 h-10",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(cu,{size:13,className:"text-accent"}),e.jsx("span",{className:"text-xs font-semibold font-sans text-text-1",children:"Model Lab"})]}),e.jsx(bf,{collapsed:!1,onClick:()=>c(!0),side:"left"})]}),e.jsx(it,{className:"flex-1 min-h-0",children:e.jsxs("div",{className:"px-4 pb-4 space-y-5",children:[e.jsx(zDe,{}),e.jsx("div",{className:"h-px bg-border-subtle"}),e.jsx(FDe,{}),e.jsx("div",{className:"h-px bg-border-subtle"}),e.jsx(hVe,{}),e.jsx("div",{className:"h-px bg-border-subtle"}),e.jsx(qDe,{}),e.jsx("div",{className:"h-px bg-border-subtle"}),e.jsx(oVe,{}),e.jsx("div",{className:"h-px bg-border-subtle"}),e.jsx(XDe,{})]})})]})}),!o&&e.jsx(zX,{onMouseDown:C}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 flex items-center h-10 px-3 gap-2",children:[o&&e.jsx(bf,{collapsed:!0,onClick:()=>c(!1),side:"left"}),a&&e.jsxs("div",{className:"flex items-center gap-px bg-surface-2 rounded p-px",children:[e.jsx("button",{onClick:()=>s(!1),className:V("px-3 py-1 text-2xs font-sans font-medium rounded-sm transition-colors cursor-pointer",n?"text-text-3 hover:text-text-1":"text-text-0 bg-surface-4"),children:"Playground"}),e.jsx("button",{onClick:()=>s(!0),className:V("px-3 py-1 text-2xs font-sans font-medium rounded-sm transition-colors cursor-pointer",n?"text-text-0 bg-surface-4":"text-text-3 hover:text-text-1"),children:"Assistant"})]}),e.jsx("div",{className:"flex-1"}),l&&e.jsx(bf,{collapsed:!0,onClick:()=>A(!1),side:"right"})]}),e.jsx("div",{className:"flex-1 min-h-0",children:n&&a?e.jsx(tVe,{}):e.jsx(YDe,{})})]}),!l&&e.jsx(zX,{onMouseDown:j}),e.jsx("div",{className:V("flex-shrink-0 transition-all duration-200 overflow-hidden",l&&"w-0"),style:l?void 0:{width:x},children:e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 flex items-center justify-between px-4 h-10",children:[e.jsx("span",{className:"text-2xs font-semibold font-sans text-text-3 uppercase tracking-wider",children:"Metrics"}),e.jsx(bf,{collapsed:!1,onClick:()=>A(!0),side:"right"})]}),e.jsx(it,{className:"flex-1 min-h-0",children:e.jsx("div",{className:"px-4 pb-4",children:e.jsx(sVe,{})})})]})})]})})}function fVe(t){return t.active&&t.status==="connected"?"running":t.status==="connecting"?"starting":"stopped"}const xVe=g.memo(function(){const a=$(l=>l.networkNode),n=$(l=>l.networkWallet),[s,o]=g.useState(!1),c=g.useCallback(async()=>{if(a.nodeId)try{await navigator.clipboard.writeText(a.nodeId),o(!0),setTimeout(()=>o(!1),1500)}catch{}},[a.nodeId]);return e.jsxs("div",{className:"flex items-center h-11 px-4 bg-surface-0 border-b border-border-subtle gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx(ia,{status:fVe(a),size:"sm"}),e.jsx("code",{className:"text-xs font-mono text-text-0 truncate",children:a.nodeId||"—"}),e.jsx(Nt,{content:s?"Copied":"Copy address",side:"bottom",children:e.jsx("button",{onClick:c,className:"h-6 w-6 inline-flex items-center justify-center rounded border border-border-subtle text-text-3 hover:text-accent hover:border-accent/40 cursor-pointer transition-colors flex-shrink-0",children:s?e.jsx(De,{size:10}):e.jsx(wn,{size:10})})})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs font-mono text-text-2",children:[e.jsx("span",{className:"text-text-0",children:n.balance}),e.jsx("span",{className:"text-text-3",children:" GROOVE"})]}),e.jsxs(fe,{variant:"outline",size:"sm",className:"text-2xs gap-1.5",disabled:!0,children:[e.jsx(wu,{size:12}),"Connect Wallet"]})]})]})});function FX(t){return t?(t/1024).toFixed(1):"0"}function mVe({data:t,color:a=te.accent,width:n=60,height:s=16}){if(!t||t.length<2)return e.jsx("div",{style:{width:n,height:s}});const o=t.map(x=>typeof x=="number"?x:x.v),c=Math.min(...o),A=Math.max(...o)-c||1,u=o.map((x,m)=>{const y=m/(o.length-1)*n,v=s-(x-c)/A*(s-2)-1;return`${y},${v}`}).join(" "),f=`ch-${a.replace("#","")}`;return e.jsxs("svg",{width:n,height:s,className:"flex-shrink-0 mt-1",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:f,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:"0.25"}),e.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:"0"})]})}),e.jsx("polygon",{points:`0,${s} ${u} ${n},${s}`,fill:`url(#${f})`}),e.jsx("polyline",{points:u,fill:"none",stroke:a,strokeWidth:"1.5",strokeLinejoin:"round",strokeOpacity:"0.8"})]})}function gVe({label:t,value:a,color:n,hint:s,sparkData:o,className:c}){return e.jsxs("div",{className:V("px-3 py-2 min-w-0",c),children:[e.jsxs("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider truncate flex items-center gap-1",children:[t,s&&e.jsx(Nt,{content:e.jsx("span",{className:"max-w-[220px] block leading-relaxed",children:s}),side:"bottom",children:e.jsx(Na,{size:9,className:"text-text-4 hover:text-text-2 cursor-help flex-shrink-0 transition-colors"})})]}),e.jsx("div",{className:"text-base font-mono font-semibold tabular-nums leading-none mt-0.5",style:{color:n||te.text0},children:a}),o&&e.jsx(mVe,{data:o,color:n||te.accent})]})}const yVe=g.memo(function(){const a=$(N=>N.networkCompute),n=$(N=>N.networkStatus),s=$(N=>N.networkSnapshots),o=$(N=>N.networkTokenTiming),c=$(N=>N.networkPerfSnapshots),A=(n.nodes||[]).filter(N=>N.status==="active"),u=A.length>0?A.reduce((N,M)=>N+(M.gpu_utilization_pct||0),0)/A.length:0,f=n.totalLayers||36,x=n.coverage||0,m=x>=f?te.success:x>=f*.5?te.warning:te.danger,y=u>80?te.danger:u>50?te.warning:te.success,v=s.map(N=>({v:N.nodeCount??0})),O=s.map(N=>({v:N.globalSessions??0})),b=s.map(N=>({v:N.totalVramMb??0})),C=s.map(N=>({v:N.totalRamMb??0})),j=[{label:"NODES",value:`${a.activeNodes}/${a.totalNodes}`,color:te.accent,hint:"Active nodes / total registered",sparkData:v},{label:"SESSIONS",value:`${n.activeSessions||0}`,color:te.info,hint:"Active inference sessions",sparkData:O},{label:"COVERAGE",value:`${x}/${f}`,color:m,hint:"Layer coverage — green=full, orange=partial, red=<50%"},{label:"VRAM",value:`${FX(a.totalVramMb)} GB`,color:te.purple,hint:"Total GPU VRAM across nodes",sparkData:b},{label:"RAM",value:`${FX(a.totalRamMb)} GB`,color:te.info,hint:"Total RAM across nodes",sparkData:C},{label:"GPU UTIL",value:u>0?`${Math.round(u)}%`:"--",color:y,hint:"Average GPU utilization — green <50%, yellow 50-80%, red >80%"},{label:"TPS",value:(o==null?void 0:o.tps)!=null?`${o.tps.toFixed(1)} t/s`:"--",color:te.accent,hint:"Live tokens per second during inference",sparkData:c.length>=2?c.map(N=>({v:N.tps??0})):void 0},...(o==null?void 0:o.ttft_ms)!=null?[{label:"TTFT",value:`${(o.ttft_ms/1e3).toFixed(2)}s`,color:te.info,hint:"Time to first token"}]:[]];return e.jsx("div",{className:"flex flex-shrink-0 border-b border-border-subtle bg-surface-0",children:j.map((N,M)=>e.jsx(gVe,{label:N.label,value:N.value,color:N.color,hint:N.hint,sparkData:N.sparkData,className:V("basis-[16%] min-w-[120px] flex-shrink-0",M<j.length-1&&"border-r border-border-subtle")},N.label))})});function vVe(t){return!t||typeof t!="string"?"—":t.length<14?t:`${t.slice(0,6)}…${t.slice(-4)}`}const kVe=g.memo(function(){const a=$(B=>B.networkSnapshots),n=$(B=>B.networkPerfSnapshots),s=$(B=>B.networkStatus.nodes||[]),o=$(B=>B.networkNode.nodeId),c=g.useRef(null),l=g.useRef(null),[A,u]=g.useState({width:0,height:0}),[f,x]=g.useState(null),[m,y]=g.useState("sessions"),{width:v,height:O}=A,b={top:28,right:12,bottom:8,left:12},C=Math.max(v-b.left-b.right,0),j=Math.max(O-b.top-b.bottom,0),N=g.useMemo(()=>m==="performance"?!n||n.length<2?[]:n:!a||a.length<2?[]:a,[a,n,m]);g.useEffect(()=>{const B=c.current;if(!B)return;const S=new ResizeObserver(I=>{const{width:z,height:P}=I[0].contentRect;z>0&&P>0&&u({width:Math.floor(z),height:Math.floor(P)})});return S.observe(B),()=>S.disconnect()},[]);const M=g.useCallback(B=>{const S=l.current;if(!S||!N.length||C<=0)return;const I=S.getBoundingClientRect(),z=B.clientX-I.left-b.left;if(z<0||z>C){x(null);return}const P=Math.round(z/C*(N.length-1));x({x:b.left+P/Math.max(N.length-1,1)*C,index:P})},[N,C,b.left]),Q=g.useCallback(()=>x(null),[]);g.useEffect(()=>{const B=l.current;if(!B||!N.length||v<=0||O<=0||C<=0||j<=0)return;const S=B.getContext("2d"),I=window.devicePixelRatio||1;if(B.width=v*I,B.height=O*I,S.scale(I,I),S.clearRect(0,0,v,O),m==="performance"){const P=N.map(q=>q.tps||0),F=Math.max(...P,1),K=q=>b.left+q/Math.max(N.length-1,1)*C,G=q=>b.top+j-q/F*j;S.setLineDash([2,4]),S.strokeStyle=qe(te.text4,.2),S.lineWidth=1;for(let q=1;q<=3;q++){const _=b.top+j/4*q;S.beginPath(),S.moveTo(b.left,_),S.lineTo(b.left+C,_),S.stroke()}S.setLineDash([]),S.font="9px 'JetBrains Mono Variable', monospace",S.textAlign="left",S.fillStyle=qe(te.text3,.5),S.fillText(`${F.toFixed(1)} t/s`,b.left+4,b.top+10),S.beginPath(),S.moveTo(b.left,b.top+j);for(let q=0;q<N.length;q++)S.lineTo(K(q),G(P[q]));S.lineTo(K(N.length-1),b.top+j),S.closePath();const H=S.createLinearGradient(0,b.top,0,b.top+j);H.addColorStop(0,qe(te.accent,.2)),H.addColorStop(.7,qe(te.accent,.04)),H.addColorStop(1,qe(te.accent,0)),S.fillStyle=H,S.fill(),S.beginPath(),S.strokeStyle=te.accent,S.lineWidth=1.5,S.lineJoin="round";for(let q=0;q<N.length;q++)q===0?S.moveTo(K(q),G(P[q])):S.lineTo(K(q),G(P[q]));if(S.stroke(),S.font="9px 'Inter Variable', sans-serif",S.textAlign="right",S.fillStyle=te.accent,S.fillText("TPS",v-b.right-4,14),f&&f.index>=0&&f.index<N.length){const q=f.x,_=N[f.index];S.beginPath(),S.moveTo(q,b.top),S.lineTo(q,b.top+j),S.strokeStyle=qe(te.text1,.15),S.lineWidth=1,S.stroke(),S.beginPath(),S.arc(q,G(_.tps||0),3,0,Math.PI*2),S.fillStyle=te.accent,S.fill();const R=90,U=28;let Z=q+12;Z+R>v-8&&(Z=q-R-12);const J=Math.max(b.top,G(_.tps||0)-U/2);S.fillStyle=qe(te.surface0,.92),S.beginPath(),S.roundRect(Z,J,R,U,4),S.fill(),S.strokeStyle=qe(te.text4,.2),S.lineWidth=1,S.stroke(),S.font="9px 'JetBrains Mono Variable', monospace",S.textAlign="center",S.fillStyle=te.text0,S.fillText(`${(_.tps||0).toFixed(1)} t/s`,Z+R/2,J+17)}}else{const P=N.map(U=>U.globalSessions),F=N.map(U=>U.mySessions),K=Math.max(...P,...F,1),G=U=>b.left+U/Math.max(N.length-1,1)*C,H=U=>b.top+j-U/K*j;S.setLineDash([2,4]),S.strokeStyle=qe(te.text4,.2),S.lineWidth=1;for(let U=1;U<=3;U++){const Z=b.top+j/4*U;S.beginPath(),S.moveTo(b.left,Z),S.lineTo(b.left+C,Z),S.stroke()}S.setLineDash([]),S.font="9px 'JetBrains Mono Variable', monospace",S.textAlign="left",S.fillStyle=qe(te.text3,.5),S.fillText(String(K),b.left+4,b.top+10),S.fillText(String(Math.round(K/2)),b.left+4,b.top+j/2+4),S.beginPath(),S.moveTo(b.left,b.top+j);for(let U=0;U<N.length;U++)S.lineTo(G(U),H(P[U]));S.lineTo(G(N.length-1),b.top+j),S.closePath();const q=S.createLinearGradient(0,b.top,0,b.top+j);q.addColorStop(0,qe(te.purple,.2)),q.addColorStop(.7,qe(te.purple,.04)),q.addColorStop(1,qe(te.purple,0)),S.fillStyle=q,S.fill(),S.beginPath(),S.strokeStyle=te.purple,S.lineWidth=1.5,S.lineJoin="round";for(let U=0;U<N.length;U++){const Z=G(U),J=H(P[U]);U===0?S.moveTo(Z,J):S.lineTo(Z,J)}S.stroke(),S.beginPath(),S.strokeStyle=te.accent,S.lineWidth=1.5,S.lineJoin="round";for(let U=0;U<N.length;U++){const Z=G(U),J=H(F[U]);U===0?S.moveTo(Z,J):S.lineTo(Z,J)}S.stroke(),S.font="9px 'Inter Variable', sans-serif",S.textAlign="right";let _=v-b.right-4;const R=14;if(S.fillStyle=te.accent,S.fillText("Your Node",_,R),_-=S.measureText("Your Node").width+4,S.beginPath(),S.arc(_,R-3,2.5,0,Math.PI*2),S.fill(),_-=14,S.fillStyle=te.purple,S.fillText("Network",_,R),_-=S.measureText("Network").width+4,S.beginPath(),S.arc(_,R-3,2.5,0,Math.PI*2),S.fill(),f&&f.index>=0&&f.index<N.length){const U=f.x,Z=N[f.index];S.beginPath(),S.moveTo(U,b.top),S.lineTo(U,b.top+j),S.strokeStyle=qe(te.text1,.15),S.lineWidth=1,S.stroke(),S.beginPath(),S.arc(U,H(Z.globalSessions),3,0,Math.PI*2),S.fillStyle=te.purple,S.fill(),S.beginPath(),S.arc(U,H(Z.mySessions),3,0,Math.PI*2),S.fillStyle=te.accent,S.fill();const J=[{label:"Network",value:String(Z.globalSessions),color:te.purple},{label:"Your Node",value:String(Z.mySessions),color:te.accent},{label:"Nodes",value:String(Z.nodeCount),color:te.text2}],Ae=104,W=J.length*16+12;let ae=U+12;ae+Ae>v-8&&(ae=U-Ae-12);const Oe=Math.max(b.top,H(Z.globalSessions)-W/2);S.fillStyle=qe(te.surface0,.92),S.beginPath(),S.roundRect(ae,Oe,Ae,W,4),S.fill(),S.strokeStyle=qe(te.text4,.2),S.lineWidth=1,S.stroke(),S.textAlign="left",J.forEach((ve,ce)=>{const he=Oe+14+ce*16;S.beginPath(),S.arc(ae+8,he-3,2,0,Math.PI*2),S.fillStyle=ve.color,S.fill(),S.font="8px 'Inter Variable', sans-serif",S.fillStyle=te.text3,S.fillText(ve.label,ae+14,he),S.font="9px 'JetBrains Mono Variable', monospace",S.fillStyle=te.text0,S.textAlign="right",S.fillText(ve.value,ae+Ae-8,he),S.textAlign="left"})}}},[N,v,O,f,C,j,b,m]);const L=s.filter(B=>B.status==="active");return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Network Activity"}),e.jsxs("div",{className:"flex items-center bg-surface-2 rounded-full p-0.5",children:[e.jsx("button",{onClick:()=>y("sessions"),className:V("px-2 py-0.5 text-2xs font-mono rounded-full transition-colors",m==="sessions"?"bg-surface-4 text-text-0":"text-text-3 hover:text-text-1"),children:"Sessions"}),e.jsx("button",{onClick:()=>y("performance"),className:V("px-2 py-0.5 text-2xs font-mono rounded-full transition-colors",m==="performance"?"bg-surface-4 text-text-0":"text-text-3 hover:text-text-1"),children:"Perf"})]})]}),e.jsxs("span",{className:"text-2xs font-mono text-text-3 tabular-nums",children:[L.length," nodes"]})]}),e.jsx("div",{ref:c,className:"relative flex-1 min-h-0",children:N.length<2?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-mono text-text-3",children:"Collecting network data…"})}):v>0&&O>0?e.jsx("canvas",{ref:l,style:{width:v,height:O},className:"absolute inset-0 block cursor-crosshair",onMouseMove:M,onMouseLeave:Q}):null}),e.jsxs("div",{className:"px-3 py-1.5 border-t border-border-subtle flex items-center gap-2 flex-shrink-0 font-mono text-2xs",style:{background:qe(te.accent,.04)},children:[e.jsxs("span",{className:"text-text-3",children:[L.length," node",L.length!==1?"s":""," online"]}),L.map(B=>{const S=B.node_id||B.nodeId||"",I=o&&S===o,z=Array.isArray(B.layers)?`${B.layers[0]}-${B.layers[1]}`:"";return e.jsxs("span",{className:I?"text-accent":"text-text-2",children:[vVe(S),I?" (You":"(",z?` · ${z}`:"",")"]},S)})]})]})}),OVe=["All","Sessions","Errors","Connections"],bVe={Sessions:["session"],Errors:["error","warning"],Connections:["connected","disconnected"]},wVe={info:te.text3,success:te.success,warning:te.warning,error:te.danger,connected:te.success,disconnected:te.warning,session:te.accent};function jVe(t){return t?new Date(t).toLocaleTimeString("en-GB",{hour12:!1}):"--:--:--"}function CVe(t){return{info:"info",success:" ok ",warning:"warn",error:"ERR!",connected:"conn",disconnected:"disc",session:"sess"}[t]||t||"info"}const NVe=g.memo(function(){const a=$(A=>A.networkEvents),[n,s]=g.useState("All"),o=g.useRef(null),l=(n==="All"?a:a.filter(A=>{const u=A.level||A.type||"info";return(bVe[n]||[]).includes(u)})).slice(-200);return g.useEffect(()=>{var A;(A=o.current)==null||A.scrollIntoView({behavior:"smooth"})},[l.length]),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 pt-2.5 pb-1 flex-shrink-0",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Activity"}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex items-center gap-0.5",children:OVe.map(A=>e.jsx("button",{onClick:()=>s(A),className:V("px-2 py-0.5 text-2xs font-mono rounded-sm transition-colors cursor-pointer",n===A?"bg-[rgba(51,175,188,0.15)] text-accent":"bg-surface-4 text-text-3 hover:text-text-2"),children:A},A))})]}),e.jsx(it,{className:"flex-1 min-h-0",children:l.length===0?e.jsx("div",{className:"px-3 py-6 text-2xs font-mono text-text-4 text-center",children:"No events yet — toggle your node on to start."}):e.jsxs("div",{className:"px-2 py-1",children:[l.map((A,u)=>{const f=A.level||A.type||"info",x=wVe[f]||te.text3;return e.jsxs("div",{className:"flex items-start gap-0 font-mono text-2xs leading-relaxed",children:[e.jsxs("span",{className:"text-text-4 flex-shrink-0 w-[62px]",children:["[",jVe(A.timestamp||A.ts),"]"]}),e.jsx("span",{className:"flex-shrink-0 w-[36px]",style:{color:x},children:CVe(f)}),e.jsx("span",{className:"text-text-2 break-words min-w-0",children:A.msg||A.message||A.text||"event"})]},u)}),e.jsx("div",{ref:o})]})})]})});function MVe(t,a){const n=t/a;return n>=1?{color:te.success,label:"Full coverage"}:n>=.5?{color:te.warning,label:"Partial"}:{color:te.danger,label:"Insufficient"}}const SVe=g.memo(function(){const a=$(f=>f.networkStatus),n=$(f=>f.networkStatusReachable),s=$(f=>f.networkNode);Array.isArray(a.nodes)&&a.nodes;const o=a.totalLayers||36,c=a.coverage||0,l=MVe(c,o),A=Math.min(100,c/o*100),u=Array.isArray(a.models)?a.models:[];return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0",children:e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Network Health"})}),e.jsx(it,{className:"flex-1 min-h-0",children:e.jsxs("div",{className:"px-3 py-2 space-y-3",children:[e.jsx("div",{className:"bg-surface-0 rounded p-2.5",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[e.jsx("span",{className:"absolute inset-0 rounded-sm",style:{background:n?te.success:te.danger}}),n&&e.jsx("span",{className:"absolute inset-[-2px] rounded-sm",style:{background:te.success,opacity:.15,animation:"node-pulse-bar 2s ease-in-out infinite"}})]}),e.jsx("span",{className:"text-2xs font-mono text-text-3",children:"Signal"}),e.jsx("span",{className:"text-2xs font-mono text-text-1",children:"signal.groovedev.ai"}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"text-2xs font-mono",style:{color:n?te.success:te.danger},children:n?"Connected":"Unreachable"})]})}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:"Layer Coverage"}),e.jsxs("span",{className:"text-2xs font-mono tabular-nums",style:{color:l.color},children:[c,"/",o]})]}),e.jsx("div",{className:"h-0.5 rounded-sm overflow-hidden",style:{background:qe(te.accent,.08)},children:e.jsx("div",{className:"h-full rounded-sm transition-all duration-700",style:{width:`${A}%`,background:l.color}})}),e.jsx("div",{className:"mt-1 text-2xs font-mono text-text-4",children:l.label})]}),e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:"Sessions"}),e.jsx("span",{className:"text-base font-mono font-semibold text-text-0 tabular-nums leading-none",children:pt(a.activeSessions||0)})]}),e.jsx("div",{className:"text-2xs font-mono text-text-4 mt-0.5",children:"Active streams"})]}),s.active&&e.jsxs("div",{className:"bg-surface-0 rounded p-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:"Node Status"}),e.jsx("span",{className:"text-2xs font-mono capitalize",style:{color:s.status==="connected"?te.success:te.warning},children:s.status||"disconnected"})]}),s.sessions>0&&e.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[e.jsx("span",{className:"text-2xs font-mono text-text-4",children:"Local Sessions"}),e.jsx("span",{className:"text-xs font-mono text-text-1 tabular-nums",children:s.sessions})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1.5",children:"Models"}),u.length===0?e.jsx("div",{className:"text-2xs font-mono text-text-4",children:"No models available"}):e.jsx("div",{className:"space-y-1",children:u.map((f,x)=>{const m=typeof f=="string"?f:f.name,y=typeof f=="string"?!0:!!f.available;return e.jsxs("div",{className:"flex items-center gap-2 bg-surface-0 rounded px-2.5 py-1.5",children:[e.jsx("span",{className:"relative flex-shrink-0 w-[5px] h-[5px]",children:e.jsx("span",{className:"absolute inset-0 rounded-sm",style:{background:y?te.success:te.text4}})}),e.jsx("span",{className:"text-xs font-mono text-text-1 truncate flex-1",children:m}),e.jsx("span",{className:"text-2xs font-mono",style:{color:y?te.success:te.text3},children:y?"Online":"Offline"})]},x)})})]})]})})]})});function QVe(t){return!t||typeof t!="string"?"—":t.length<14?t:`${t.slice(0,6)}…${t.slice(-4)}`}function BVe(t){return t.active&&t.status==="connected"?"running":t.status==="connecting"?"starting":"stopped"}function _Ve(t){if(!t)return"—";const a=t.split("/");return a[a.length-1]}const LVe=g.memo(function(){const a=$(l=>l.networkNode),n=a.hardware||{},s=Number.isFinite(a.memoryPct)?a.memoryPct:null,o=Array.isArray(a.layers)?`${a.layers[0]}-${a.layers[1]}`:"—",c=[{label:"DEVICE",value:n.device||"auto"},{label:"GPU",value:n.gpu||"None"},{label:"LAYERS",value:o},{label:"MODEL",value:_Ve(a.model)},{label:"SESSIONS",value:a.sessions??0},{label:"VRAM",value:n.memory||"—"}];return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("div",{className:"px-3 pt-2.5 pb-1",children:e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Your Node"})}),e.jsxs("div",{className:"px-3 py-2 space-y-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs text-text-4 uppercase tracking-wider",children:"ADDRESS"}),e.jsx("div",{className:"text-xs font-mono text-accent truncate",children:QVe(a.nodeId)})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ia,{status:BVe(a),size:"sm"}),e.jsx("span",{className:"text-2xs capitalize text-text-2",children:a.status||"disconnected"})]}),e.jsx("div",{className:"border-t border-border-subtle my-1"}),e.jsx("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1.5",children:c.map(l=>e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs text-text-4 uppercase tracking-wider",children:l.label}),e.jsx("div",{className:"text-xs font-mono text-text-1 tabular-nums truncate",children:l.value})]},l.label))}),s!=null&&e.jsxs("div",{className:"mt-1",children:[e.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[e.jsx("span",{className:"text-2xs text-text-4 uppercase tracking-wider",children:"MEM"}),e.jsxs("span",{className:"text-2xs font-mono text-text-3 tabular-nums",children:[Math.round(s),"%"]})]}),e.jsx("div",{className:"h-1 w-full rounded-full bg-surface-3 overflow-hidden",children:e.jsx("div",{className:V("h-full rounded-full transition-all",s>90?"bg-danger":s>70?"bg-warning":"bg-accent"),style:{width:`${Math.min(100,Math.max(0,s))}%`}})})]})]})]})}),TVe=[{label:"Today",value:"—"},{label:"This Week",value:"—"},{label:"All Time",value:"—"}],$Ve=g.memo(function(){return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-3 pt-2.5 pb-1 flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"EARNINGS"}),e.jsx(be,{variant:"purple",children:"SOON"})]}),e.jsxs("div",{className:"px-3 py-2 space-y-1.5",children:[TVe.map(a=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-sans text-text-4",children:a.label}),e.jsx("span",{className:"text-xs font-mono text-text-3 tabular-nums",children:a.value})]},a.label)),e.jsx("div",{className:"text-2xs text-text-4 mt-2 italic",children:"Connect wallet to track earnings"})]})]})});function IVe(t){return!t||typeof t!="string"?"—":t.length<14?t:`${t.slice(0,6)}…${t.slice(-4)}`}function Fo(t){return!t&&t!==0?"—":t>=1024?`${(t/1024).toFixed(1)} GB`:`${Math.round(t)} MB`}const Fn=[{key:"status",label:"STATUS",w:"w-[52px]"},{key:"node",label:"NODE",w:"flex-1 min-w-[90px]"},{key:"device",label:"DEVICE",w:"w-[72px]"},{key:"gpu",label:"GPU",w:"w-[90px]"},{key:"ram",label:"RAM",w:"w-[88px]",numeric:!0},{key:"vram",label:"VRAM",w:"w-[88px]",numeric:!0},{key:"cpu",label:"CPU",w:"w-[42px]",numeric:!0},{key:"gpuUtil",label:"GPU%",w:"w-[48px]",numeric:!0},{key:"layers",label:"LAYERS",w:"w-[60px]"},{key:"sessions",label:"SESS",w:"w-[42px]",numeric:!0},{key:"uptime",label:"UPTIME",w:"w-[60px]"}];function RX(t,a){switch(a){case"status":return t.status==="active"?0:t.status==="connecting"?1:2;case"node":return(t.node_id||t.nodeId||"").toLowerCase();case"device":return(t.device||"").toLowerCase();case"gpu":return(t.gpu_model||"").toLowerCase();case"ram":return t.ram_mb||0;case"vram":return t.vram_mb||0;case"cpu":return t.cpu_cores||0;case"layers":return Array.isArray(t.layers)?t.layers[0]:0;case"gpuUtil":return t.gpu_utilization_pct??-1;case"sessions":return t.sessions||t.active_sessions||0;case"uptime":return t.uptime_seconds||0;default:return 0}}function UVe({node:t}){const a=t.gpu_utilization_pct,n=[{label:"GPU Utilization",value:a!=null?`${Math.round(a)}%`:"—"},{label:"VRAM Used",value:t.vram_used_mb!=null?Fo(t.vram_used_mb):"—"},{label:"RAM Used",value:t.ram_used_mb!=null?Fo(t.ram_used_mb):"—"},{label:"Uptime",value:t.uptime_seconds?WA(t.uptime_seconds):"—"},{label:"Bandwidth",value:t.bandwidth_mbps?`${Math.round(t.bandwidth_mbps)} Mbps`:"—"}];return e.jsx("div",{className:"px-3 py-2 bg-surface-0 border-t border-border-subtle",children:e.jsx("div",{className:"grid grid-cols-5 gap-3",children:n.map(s=>e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider",children:s.label}),e.jsx("div",{className:"text-xs font-mono text-text-1 tabular-nums",children:s.value})]},s.label))})})}const PVe=g.memo(function(){const a=$(O=>O.networkStatus.nodes||[]),n=$(O=>O.networkNode.nodeId),[s,o]=g.useState("status"),[c,l]=g.useState(!0),[A,u]=g.useState(""),[f,x]=g.useState(null),m=g.useCallback(O=>{o(b=>b===O?(l(C=>!C),b):(l(!0),O))},[]),y=g.useMemo(()=>{if(!A.trim())return a;const O=A.toLowerCase();return a.filter(b=>{const C=(b.node_id||b.nodeId||"").toLowerCase(),j=(b.gpu_model||"").toLowerCase(),N=(b.device||"").toLowerCase();return C.includes(O)||j.includes(O)||N.includes(O)})},[a,A]),v=g.useMemo(()=>{const O=[...y];return O.sort((b,C)=>{const j=RX(b,s),N=RX(C,s);return j<N?c?-1:1:j>N?c?1:-1:0}),O},[y,s,c]);return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0 flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Node Fleet"}),e.jsxs("span",{className:"text-2xs font-mono text-text-3 tabular-nums",children:[a.length," nodes"]})]}),e.jsx("div",{className:"px-3 pb-1 flex-shrink-0",children:e.jsxs("div",{className:"relative",children:[e.jsx(oa,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{type:"text",placeholder:"Search nodes...",value:A,onChange:O=>u(O.target.value),className:"h-7 w-full rounded-md pl-7 pr-2 text-xs bg-surface-1 border border-border-subtle text-text-0 placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent font-mono transition-colors"})]})}),e.jsx("div",{className:"flex items-center gap-0 px-3 py-1 flex-shrink-0 bg-accent/[0.04]",children:Fn.map(O=>e.jsxs("button",{onClick:()=>m(O.key),className:V("flex items-center gap-0.5 text-2xs font-mono text-text-4 uppercase tracking-wider cursor-pointer hover:text-text-2 transition-colors",O.w,O.numeric&&"justify-end"),children:[O.label,s===O.key&&(c?e.jsx(eu,{size:8}):e.jsx(i0,{size:8}))]},O.key))}),e.jsx(it,{className:"flex-1 min-h-0",children:v.length===0?e.jsx("div",{className:"px-3 py-6 text-2xs font-mono text-text-4 text-center",children:A?"No matching nodes":"No nodes online"}):e.jsx("div",{children:v.map((O,b)=>{const C=O.node_id||O.nodeId||"",j=n&&C&&C===n,N=Array.isArray(O.layers)?`${O.layers[0]}-${O.layers[1]}`:O.layers||"—",M=O.status==="active"||O.status==="connecting",Q=O.gpu_utilization_pct,L=Q==null?void 0:Q>80?te.danger:Q>50?te.warning:te.success,B=O.ram_pct||(O.ram_mb>0&&O.ram_used_mb!=null?O.ram_used_mb/O.ram_mb*100:null),S=O.vram_mb>0&&O.vram_used_mb!=null?O.vram_used_mb/O.vram_mb*100:null,I=f===C;return e.jsxs("div",{children:[e.jsxs("div",{onClick:()=>x(I?null:C),className:V("flex items-center gap-0 px-3 py-2 text-xs font-mono transition-colors cursor-pointer",j?"border-l-2 border-accent bg-accent/[0.04]":"hover:bg-surface-2"),children:[e.jsx("div",{className:V("flex items-center gap-1.5",Fn[0].w),children:e.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[e.jsx("span",{className:"absolute inset-0 rounded-sm",style:{background:M?te.success:te.text4}}),M&&e.jsx("span",{className:"absolute inset-[-2px] rounded-sm",style:{background:te.success,opacity:.15,animation:"node-pulse-bar 2s ease-in-out infinite"}})]})}),e.jsxs("div",{className:V("truncate text-text-1",Fn[1].w),children:[IVe(C),j&&e.jsx(be,{variant:"accent",className:"ml-1 text-2xs",children:"You"})]}),e.jsx("div",{className:V("truncate text-text-2",Fn[2].w),children:O.device||"—"}),e.jsx("div",{className:V("truncate text-text-2",Fn[3].w),children:O.gpu_model||"—"}),e.jsxs("div",{className:V("text-right tabular-nums",Fn[4].w),children:[e.jsx("div",{className:"text-text-2",children:O.ram_used_mb!=null?`${Fo(O.ram_used_mb)}/${Fo(O.ram_mb)}`:Fo(O.ram_mb)}),B!=null&&e.jsx("div",{className:"h-0.5 rounded-sm mt-0.5 overflow-hidden bg-accent/[0.08]",children:e.jsx("div",{className:"h-full rounded-sm",style:{width:`${Math.min(100,B)}%`,background:B>90?te.danger:B>70?te.warning:te.accent}})})]}),e.jsxs("div",{className:V("text-right tabular-nums",Fn[5].w),children:[e.jsx("div",{className:"text-text-2",children:O.vram_used_mb!=null?`${Fo(O.vram_used_mb)}/${Fo(O.vram_mb)}`:Fo(O.vram_mb)}),S!=null&&e.jsx("div",{className:"h-0.5 rounded-sm mt-0.5 overflow-hidden bg-accent/[0.08]",children:e.jsx("div",{className:"h-full rounded-sm",style:{width:`${Math.min(100,S)}%`,background:S>90?te.danger:S>70?te.warning:te.info}})})]}),e.jsx("div",{className:V("text-right text-text-2 tabular-nums",Fn[6].w),children:O.cpu_cores||"—"}),e.jsx("div",{className:V("text-right tabular-nums",Fn[7].w),style:{color:L},children:Q!=null?`${Math.round(Q)}%`:"—"}),e.jsx("div",{className:V("text-text-2",Fn[8].w),children:N}),e.jsx("div",{className:V("text-right text-text-2 tabular-nums",Fn[9].w),children:O.sessions??O.active_sessions??0}),e.jsx("div",{className:V("text-text-2",Fn[10].w),children:O.uptime_seconds?WA(O.uptime_seconds):"—"})]}),I&&e.jsx(UVe,{node:O})]},C||b)})})})]})}),EVe=[{icon:Ba,label:"Compute Hours",value:"—"},{icon:Ys,label:"Sessions Served",value:"—"},{icon:Rr,label:"Uptime Score",value:"—"},{icon:wt,label:"Network Score",value:"—"}],zVe=["Date","Amount","Status","TX"],FVe=g.memo(function(){return e.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[e.jsxs("div",{className:"px-6 py-8 text-center border-b border-border-subtle bg-surface-0",children:[e.jsx("div",{className:"text-3xl font-mono font-semibold text-text-0 tabular-nums",children:"0.00"}),e.jsx("div",{className:"text-sm font-mono text-text-3 mt-1",children:"GROOVE"}),e.jsx(be,{variant:"purple",className:"mt-3",children:"Base L2"}),e.jsx("div",{className:"mt-4",children:e.jsxs(fe,{variant:"primary",size:"md",className:"gap-2",disabled:!0,children:[e.jsx(wu,{size:14}),"Connect Wallet"]})}),e.jsx("div",{className:"text-2xs text-text-4 mt-2",children:"Connect your Base wallet to claim rewards"})]}),e.jsxs("div",{className:"px-4 py-4",children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest mb-3",children:"EARNING POTENTIAL"}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:EVe.map(a=>e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-1 px-3 py-3 text-center",children:[e.jsx(a.icon,{size:16,className:"text-text-3 mx-auto mb-1.5"}),e.jsx("div",{className:"text-lg font-mono text-text-0 tabular-nums",children:a.value}),e.jsx("div",{className:"text-2xs text-text-4 mt-0.5",children:a.label})]},a.label))})]}),e.jsxs("div",{className:"px-4 py-4 border-t border-border-subtle",children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest mb-3",children:"EARNINGS HISTORY"}),e.jsx("div",{className:"h-40 rounded-md border border-border-subtle bg-surface-0 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-mono text-text-4",children:"Earnings data will appear here"})})]}),e.jsxs("div",{className:"px-4 py-4 border-t border-border-subtle",children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest mb-3",children:"PAYOUT HISTORY"}),e.jsx("div",{className:"grid grid-cols-4 px-3 py-1.5 text-2xs font-mono text-text-4 uppercase tracking-wider",children:zVe.map(a=>e.jsx("span",{children:a},a))}),e.jsx("div",{className:"px-3 py-6 text-center text-xs font-mono text-text-4",children:"No payouts yet"})]}),e.jsx("div",{className:"px-4 pb-6",children:e.jsxs("div",{className:"rounded-md border border-purple/20 bg-purple/5 px-4 py-3 flex items-center gap-3",children:[e.jsx(wt,{size:16,className:"text-purple flex-shrink-0"}),e.jsx("span",{className:"text-xs font-sans text-text-2",children:"Rewards go live when the GROOVE token launches on Base. Keep your node running to accumulate compute credits."})]})})]})}),yP={serialize_ms:te.info,send_ms:te.accent,wait_ms:te.text3,forward_ms:te.success,queue_ms:te.warning},HX={serialize_ms:"Serialize",send_ms:"Send",wait_ms:"Wait",forward_ms:"Forward",queue_ms:"Queue"};function RVe(t){return!t||typeof t!="string"?"—":t.length<14?t:`${t.slice(0,6)}…${t.slice(-4)}`}const HVe=g.memo(function(){const a=$(c=>c.networkTokenTiming),n=g.useMemo(()=>!(a!=null&&a.stages)||!Array.isArray(a.stages)?[]:a.stages,[a]);if(!n.length)return e.jsx("div",{className:"flex items-center justify-center py-6",children:e.jsx("span",{className:"text-xs font-mono text-text-3",children:"Waiting for token timing data\\u2026"})});const s=Math.max(...n.map(c=>c.rtt_ms||1),1),o=Object.keys(yP);return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"flex items-center gap-3 px-3 py-1.5 flex-wrap",children:o.map(c=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm flex-shrink-0",style:{background:yP[c]}}),e.jsx("span",{className:"text-2xs font-mono text-text-3",children:HX[c]})]},c))}),n.map((c,l)=>{const A=c.rtt_ms||1,u=c.node_telemetry,f=u==null?void 0:u.gpu_model,x=u==null?void 0:u.device;return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1",children:[e.jsxs("div",{className:"w-[110px] flex-shrink-0 flex flex-col gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-2xs font-mono text-text-2 truncate",children:RVe(c.node)}),e.jsx(be,{variant:c.via==="p2p"?"success":"warning",className:"text-2xs px-1 py-0 leading-tight",children:c.via||"?"})]}),f&&e.jsxs("div",{className:"flex items-center gap-1",children:[x&&e.jsx("span",{className:V("text-2xs font-mono px-1 py-0 rounded leading-tight",x==="cuda"?"bg-info/20 text-info":"bg-purple/20 text-purple"),children:x}),e.jsx("span",{className:"text-2xs font-mono text-text-4 truncate",children:f})]})]}),e.jsx("div",{className:"flex-1 min-w-0 h-4 bg-surface-2 rounded-sm overflow-hidden relative flex",children:o.map(m=>{const y=c[m]||0,v=y/s*100;return e.jsx("div",{className:"h-full flex-shrink-0 transition-all",style:{width:`${v}%`,background:yP[m]},title:`${HX[m]}: ${y.toFixed(1)}ms`},m)})}),e.jsxs("span",{className:"text-2xs font-mono text-text-3 tabular-nums w-[52px] text-right flex-shrink-0",children:[A.toFixed(1),"ms"]})]},l)})]})});function jee(t){return!t||typeof t!="string"?"—":t.length<14?t:`${t.slice(0,6)}…${t.slice(-4)}`}const qVe=g.memo(function(){const a=$(u=>u.networkTokenTiming),n=a==null?void 0:a.tps,s=a==null?void 0:a.ttft_ms,o=(a==null?void 0:a.tokens_generated)??0,{p2pCount:c,relayCount:l}=g.useMemo(()=>{if(!(a!=null&&a.stages))return{p2pCount:0,relayCount:0};let u=0,f=0;for(const x of a.stages)x.via==="p2p"?u++:f++;return{p2pCount:u,relayCount:f}},[a]),A=[{label:"TPS",value:n!=null?`${n.toFixed(1)}`:"—",unit:"t/s",color:te.accent},{label:"TTFT",value:s!=null?`${(s/1e3).toFixed(2)}`:"—",unit:"s",color:te.info},{label:"TOKENS",value:o>0?String(o):"—",unit:"",color:te.text0},{label:"P2P",value:`${c}/${c+l}`,unit:"hops",color:c>=l?te.success:te.warning}];return e.jsx("div",{className:"flex items-stretch border-b border-border-subtle bg-surface-0",children:A.map((u,f)=>e.jsxs("div",{className:V("px-4 py-2.5 min-w-[100px]",f<A.length-1&&"border-r border-border-subtle"),children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider",children:u.label}),e.jsxs("div",{className:"flex items-baseline gap-1 mt-0.5",children:[e.jsx("span",{className:"text-lg font-mono font-semibold tabular-nums leading-none",style:{color:u.color},children:u.value}),u.unit&&e.jsx("span",{className:"text-2xs font-mono text-text-3",children:u.unit})]})]},u.label))})}),DVe=g.memo(function(){const a=$(f=>f.networkBenchmarks),n=$(f=>f.networkPerfSnapshots),s=g.useRef(null),o=g.useRef(null),[c,l]=g.useState({width:0,height:0}),A=g.useMemo(()=>{const f=a.map(y=>({t:y.t||Date.now(),tps:y.tps||0})),x=n||[],m=[...f,...x];return m.length<2?[]:m.slice(-100)},[a,n]),u=A.length>0?A[A.length-1].tps:0;return g.useEffect(()=>{const f=s.current;if(!f)return;const x=new ResizeObserver(m=>{const{width:y,height:v}=m[0].contentRect;y>0&&v>0&&l({width:Math.floor(y),height:Math.floor(v)})});return x.observe(f),()=>x.disconnect()},[]),g.useEffect(()=>{const f=o.current,{width:x,height:m}=c;if(!f||!A.length||x<=0||m<=0)return;const y=f.getContext("2d"),v=window.devicePixelRatio||1;f.width=x*v,f.height=m*v,y.scale(v,v),y.clearRect(0,0,x,m);const O={top:24,right:12,bottom:8,left:12},b=x-O.left-O.right,C=m-O.top-O.bottom;if(b<=0||C<=0)return;const j=A.map(B=>B.tps),N=Math.max(...j,1),M=B=>O.left+B/Math.max(A.length-1,1)*b,Q=B=>O.top+C-B/N*C;y.setLineDash([2,4]),y.strokeStyle=qe(te.text4,.2),y.lineWidth=1;for(let B=1;B<=3;B++){const S=O.top+C/4*B;y.beginPath(),y.moveTo(O.left,S),y.lineTo(O.left+b,S),y.stroke()}y.setLineDash([]),y.font="9px 'JetBrains Mono Variable', monospace",y.textAlign="left",y.fillStyle=qe(te.text3,.5),y.fillText(`${N.toFixed(1)} t/s`,O.left+4,O.top+10),y.beginPath(),y.moveTo(O.left,O.top+C);for(let B=0;B<A.length;B++)y.lineTo(M(B),Q(j[B]));y.lineTo(M(A.length-1),O.top+C),y.closePath();const L=y.createLinearGradient(0,O.top,0,O.top+C);L.addColorStop(0,qe(te.accent,.2)),L.addColorStop(.7,qe(te.accent,.04)),L.addColorStop(1,qe(te.accent,0)),y.fillStyle=L,y.fill(),y.beginPath(),y.strokeStyle=te.accent,y.lineWidth=1.5,y.lineJoin="round";for(let B=0;B<A.length;B++)B===0?y.moveTo(M(B),Q(j[B])):y.lineTo(M(B),Q(j[B]));y.stroke(),y.font="9px 'Inter Variable', sans-serif",y.textAlign="right",y.fillStyle=te.accent,y.fillText("TPS",x-O.right-4,14)},[A,c]),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0 flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"TPS Trend"}),e.jsx("span",{className:"text-sm font-mono font-semibold tabular-nums",style:{color:te.accent},children:u>0?`${u.toFixed(1)} t/s`:"—"})]}),e.jsx("div",{ref:s,className:"relative flex-1 min-h-0",style:{minHeight:120},children:A.length<2?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-mono text-text-3",children:"Collecting performance data\\u2026"})}):c.width>0&&c.height>0?e.jsx("canvas",{ref:o,style:{width:c.width,height:c.height},className:"absolute inset-0 block"}):null})]})}),wf=[{key:"serialize_ms",label:"Serialize",color:te.info},{key:"send_ms",label:"Send",color:te.accent},{key:"wait_ms",label:"Wait",color:te.text3},{key:"forward_ms",label:"Forward",color:te.success},{key:"queue_ms",label:"Queue",color:te.warning}],VVe=g.memo(function(){const a=$(o=>o.networkTokenTiming),n=g.useMemo(()=>{const o=(a==null?void 0:a.stages)||[];if(!o.length)return null;const c={};let l=0;for(const u of wf){const f=o.reduce((x,m)=>x+(m[u.key]||0),0)/o.length;c[u.key]=f,l+=f}if(l===0)return null;const A=o.reduce((u,f)=>{const x=f.rtt_ms||0,m=wf.reduce((y,v)=>y+(f[v.key]||0),0);return u+Math.max(0,x-m)},0)/o.length;return c._overhead=A,c._sum=l+A,c},[a]);if(!n)return e.jsx("div",{className:"flex items-center justify-center py-6",children:e.jsx("span",{className:"text-xs font-mono text-text-3",children:"No stage data available"})});const s=n._sum;return e.jsxs("div",{className:"flex flex-col gap-2 px-3 py-2",children:[e.jsxs("div",{className:"h-5 rounded-sm overflow-hidden flex bg-surface-2",children:[wf.map(o=>{const c=(n[o.key]||0)/s*100;return c<.5?null:e.jsx("div",{className:"h-full transition-all",style:{width:`${c}%`,background:o.color},title:`${o.label}: ${c.toFixed(1)}%`},o.key)}),n._overhead>0&&e.jsx("div",{className:"h-full transition-all",style:{width:`${n._overhead/s*100}%`,background:te.orange},title:`Overhead: ${(n._overhead/s*100).toFixed(1)}%`})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[wf.map(o=>{const c=(n[o.key]||0)/s*100;return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm flex-shrink-0",style:{background:o.color}}),e.jsx("span",{className:"text-2xs font-mono text-text-3",children:o.label}),e.jsxs("span",{className:"text-2xs font-mono text-text-2 tabular-nums",children:[c.toFixed(0),"%"]})]},o.key)}),n._overhead>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm flex-shrink-0",style:{background:te.orange}}),e.jsx("span",{className:"text-2xs font-mono text-text-3",children:"Overhead"}),e.jsxs("span",{className:"text-2xs font-mono text-text-2 tabular-nums",children:[(n._overhead/s*100).toFixed(0),"%"]})]})]})]})}),XVe=g.memo(function(){const a=$(y=>y.networkBenchmarks),n=$(y=>y.networkTokenTiming),s=a.length>0?a[a.length-1]:null,o=(s==null?void 0:s.ttft_ms)??(n==null?void 0:n.ttft_ms),c=(s==null?void 0:s.tokens_generated)??(n==null?void 0:n.tokens_generated)??0,l=(s==null?void 0:s.total_network_ms)??(s==null?void 0:s.total_compute_ms),A=(s==null?void 0:s.p2p_sends)??0,u=(s==null?void 0:s.relay_sends)??0,f=A+u,x=f>0?A/f*100:0,m=[{label:"TTFT",value:o!=null?`${(o/1e3).toFixed(2)}s`:"—",color:te.accent},{label:"Tokens",value:c>0?String(c):"—",color:te.text0},{label:"Total Time",value:l!=null?`${(l/1e3).toFixed(1)}s`:"—",color:te.text0},{label:"TPS",value:(s==null?void 0:s.tps)!=null?`${s.tps.toFixed(1)}`:"—",color:te.accent}];return e.jsxs("div",{className:"flex flex-col gap-3 px-3 py-2",children:[e.jsx("div",{className:"grid grid-cols-2 gap-2",children:m.map(y=>e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider",children:y.label}),e.jsx("div",{className:"text-sm font-mono font-semibold tabular-nums",style:{color:y.color},children:y.value})]},y.label))}),f>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider mb-1",children:"P2P vs Relay"}),e.jsxs("div",{className:"h-3 rounded-sm overflow-hidden flex bg-surface-2",children:[e.jsx("div",{className:"h-full transition-all",style:{width:`${x}%`,background:te.success},title:`P2P: ${A} (${x.toFixed(0)}%)`}),e.jsx("div",{className:"h-full transition-all",style:{width:`${100-x}%`,background:te.orange},title:`Relay: ${u} (${(100-x).toFixed(0)}%)`})]}),e.jsxs("div",{className:"flex items-center justify-between mt-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm",style:{background:te.success}}),e.jsxs("span",{className:"text-2xs font-mono text-text-3",children:["P2P ",A]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm",style:{background:te.orange}}),e.jsxs("span",{className:"text-2xs font-mono text-text-3",children:["Relay ",u]})]})]})]})]})});function vP({value:t,max:a,peakValue:n,color:s,label:o,unit:c}){const l=a>0?Math.min(t/a*100,100):0,A=n&&a>0?Math.min(n/a*100,100):null,u=l>90?te.danger:l>70?te.warning:s;return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-mono text-text-4 uppercase",children:o}),e.jsxs("span",{className:"text-2xs font-mono text-text-2 tabular-nums",children:[typeof t=="number"?`${Math.round(t)}`:"—",c?` ${c}`:"",a>0&&typeof t=="number"?` / ${Math.round(a)}`:""]})]}),e.jsxs("div",{className:"h-2 rounded-sm overflow-hidden bg-surface-3 relative",children:[e.jsx("div",{className:"h-full rounded-sm transition-all duration-300",style:{width:`${l}%`,background:u}}),A!=null&&e.jsx("div",{className:"absolute top-0 h-full w-px",style:{left:`${A}%`,background:te.danger,opacity:.7},title:`Peak: ${Math.round(n)} ${c||""}`})]})]})}const ZVe=g.memo(function({nodeId:a,telemetry:n}){const s=n.device||"unknown",o=n.gpu_model||s,c=Array.isArray(n.layers)?`L${n.layers[0]}–${n.layers[1]}`:null,l=s==="cuda",A=s==="mps",u=n.updatedAt&&Date.now()-n.updatedAt>1e4;return e.jsxs("div",{className:V("rounded-md border bg-surface-0 p-3 flex flex-col gap-2 transition-opacity",u?"border-border-subtle opacity-60":"border-border-subtle"),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(Ba,{size:12,className:"text-text-3 flex-shrink-0"}),e.jsx("span",{className:"text-xs font-mono text-text-1 truncate",children:jee(a)})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx(be,{variant:l?"info":A?"purple":"default",className:"text-2xs px-1.5 py-0 leading-tight",children:s}),c&&e.jsx("span",{className:"text-2xs font-mono text-text-3 bg-surface-3 px-1.5 py-0 rounded",children:c})]})]}),e.jsx("div",{className:"text-2xs font-mono text-text-3 truncate",children:o}),(l||A)&&(n.vram_total_mb>0||n.vram_used_mb>0)&&e.jsx(vP,{label:"VRAM",value:n.vram_used_mb,max:n.vram_total_mb||n.vram_peak_mb||n.vram_used_mb,peakValue:n.vram_total_mb?n.vram_peak_mb:void 0,color:te.purple,unit:"MB"}),e.jsx(vP,{label:"RAM",value:n.ram_pct,max:100,color:te.info,unit:"%"}),e.jsx(vP,{label:"CPU",value:n.cpu_pct,max:100,color:te.accent,unit:"%"}),n.forward_ms!=null&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-2xs font-mono text-text-4 uppercase",children:"Forward"}),e.jsxs("span",{className:"text-xs font-mono font-semibold tabular-nums",style:{color:n.forward_ms>200?te.warning:te.success},children:[n.forward_ms.toFixed(1),"ms"]})]})]})}),GVe=g.memo(function(){const a=$(s=>s.networkNodeTelemetry),n=g.useMemo(()=>Object.entries(a).sort(([,s],[,o])=>{var c,l;return(((c=s.layers)==null?void 0:c[0])??0)-(((l=o.layers)==null?void 0:l[0])??0)}),[a]);return n.length?e.jsx("div",{className:"grid grid-cols-1 gap-2 p-3",children:n.map(([s,o])=>e.jsx(ZVe,{nodeId:s,telemetry:o},s))}):e.jsx("div",{className:"flex items-center justify-center py-6",children:e.jsx("span",{className:"text-xs font-mono text-text-3",children:"No node telemetry received yet"})})}),WVe=g.memo(function(){const a=$(o=>o.networkTraces),n=$(o=>o.networkBenchmarks),s=g.useMemo(()=>{if(Array.isArray(a)&&a.length>0){const o=a[a.length-1];if(o!=null&&o.pipeline&&Array.isArray(o.pipeline))return o.pipeline}if(n.length>0){const o=n[n.length-1];if(o!=null&&o.pipeline&&Array.isArray(o.pipeline))return o.pipeline}return null},[a,n]);return!s||!s.length?e.jsx("div",{className:"flex items-center justify-center py-6",children:e.jsx("span",{className:"text-xs font-mono text-text-3",children:"No pipeline data available"})}):e.jsx("div",{className:"flex items-center gap-0 px-3 py-3 overflow-x-auto",children:s.map((o,c)=>{const l=Array.isArray(o.layers)?`L${o.layers[0]}–${o.layers[1]}`:"",A=o.device==="cuda",u=(o.score||0)>=80?te.success:(o.score||0)>=60?te.warning:te.danger;return e.jsxs("div",{className:"flex items-center gap-0 flex-shrink-0",children:[e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-0 px-3 py-2 min-w-[140px]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx(Ba,{size:10,className:"text-text-3"}),e.jsx("span",{className:"text-2xs font-mono text-text-1",children:jee(o.node_id)})]}),e.jsx("div",{className:"text-2xs font-mono text-text-3 truncate mb-1",children:o.gpu_model||o.device||"—"}),e.jsxs("div",{className:"flex items-center gap-2",children:[l&&e.jsx("span",{className:"text-2xs font-mono text-text-2 bg-surface-3 px-1 rounded",children:l}),e.jsx(be,{variant:A?"info":"purple",className:"text-2xs px-1 py-0 leading-tight",children:o.device})]}),o.score!=null&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[e.jsx("span",{className:"text-2xs font-mono text-text-4",children:"Score"}),e.jsx("span",{className:"text-xs font-mono font-semibold tabular-nums",style:{color:u},children:o.score.toFixed(1)})]})]}),c<s.length-1&&e.jsx("div",{className:"px-1 flex-shrink-0",children:e.jsx(Fr,{size:14,className:"text-text-4"})})]},o.node_id||c)})})}),KVe=g.memo(function({active:a}){const n=$(o=>o.fetchNetworkBenchmarks),s=$(o=>o.fetchNetworkTraces);return g.useEffect(()=>{a&&(n(),s())},[a,n,s]),e.jsxs(it,{className:"h-full",children:[e.jsx(qVe,{}),e.jsxs("div",{className:"p-4 grid grid-cols-1 lg:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"rounded-md border border-border-subtle bg-surface-0 overflow-hidden",style:{minHeight:200},children:e.jsx(DVe,{})}),e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-0 overflow-hidden",children:[e.jsx("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0",children:e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Token Waterfall"})}),e.jsx(HVe,{})]}),e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-0 overflow-hidden",children:[e.jsx("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0",children:e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Bottleneck Breakdown"})}),e.jsx(VVe,{})]})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-0 overflow-hidden",children:[e.jsxs("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0 flex items-center gap-1.5",children:[e.jsx(wt,{size:10,className:"text-accent"}),e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Node Resource Gauges"})]}),e.jsx(GVe,{})]}),e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-0 overflow-hidden",children:[e.jsx("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0",children:e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Session Summary"})}),e.jsx(XVe,{})]})]})]}),e.jsx("div",{className:"px-4 pb-4",children:e.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-0 overflow-hidden",children:[e.jsx("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0",children:e.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Pipeline"})}),e.jsx(WVe,{})]})})]})}),YVe=["Python 3.10 or higher","~2 GB disk space for model shards","8 GB+ RAM recommended"];function JVe({progress:t}){const a=Math.max(0,Math.min(100,Number.isFinite(t.percent)?t.percent:0));return e.jsxs("div",{className:"w-full flex flex-col gap-3",children:[e.jsx("div",{className:"h-2 w-full rounded-full bg-surface-3 overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500 ease-out",style:{width:`${a}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-2xs font-mono text-text-3 tabular-nums",children:[e.jsxs("div",{className:"flex items-center gap-2 text-text-2 font-sans",children:[e.jsx($e,{size:12,className:"animate-spin text-accent"}),e.jsx("span",{className:"truncate",children:t.message||"Installing…"})]}),e.jsxs("span",{children:[a,"%"]})]})]})}function eXe({message:t,onRetry:a}){return e.jsxs("div",{className:"w-full flex flex-col gap-3",children:[e.jsxs("div",{className:"rounded-md border border-danger/40 bg-danger/10 px-4 py-3 flex items-start gap-2.5 text-left",children:[e.jsx(Xt,{size:14,className:"text-danger flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-danger font-sans mb-0.5",children:"Install failed"}),e.jsx("div",{className:"text-xs text-text-1 font-sans break-words",children:t})]})]}),e.jsxs(fe,{variant:"primary",size:"lg",onClick:a,className:"w-full",children:[e.jsx(_a,{size:14}),"Retry Install"]})]})}function tXe(){const t=$(o=>o.installNetworkPackage),a=$(o=>o.networkInstallProgress),{installing:n,error:s}=a;return e.jsx("div",{className:"flex flex-col items-center justify-center min-h-full px-6 py-12",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center text-center",children:[e.jsx("div",{className:"mb-5 rounded-full bg-surface-2 border border-border-subtle p-5",children:e.jsx(sa,{size:48,className:"text-text-3",strokeWidth:1.25})}),e.jsx("h3",{className:"text-base font-semibold text-text-0 font-sans mb-2",children:"Install Groove Network"}),e.jsx("p",{className:"text-sm text-text-2 font-sans leading-relaxed mb-6",children:"The network package enables decentralized LLM inference. Contribute your compute power or run models across the Groove network."}),e.jsxs("div",{className:"w-full rounded-md border border-border-subtle bg-surface-1 px-4 py-3 mb-6",children:[e.jsx("div",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider mb-2 text-left",children:"Requirements"}),e.jsx("ul",{className:"flex flex-col gap-1.5",children:YVe.map(o=>e.jsxs("li",{className:"flex items-center gap-2 text-xs font-sans text-text-1 text-left",children:[e.jsx(De,{size:12,className:"text-accent flex-shrink-0"}),e.jsx("span",{children:o})]},o))})]}),n?e.jsx(JVe,{progress:a}):s?e.jsx(eXe,{message:s,onRetry:()=>t()}):e.jsxs(e.Fragment,{children:[e.jsxs(fe,{variant:"primary",size:"lg",onClick:()=>t(),className:"w-full",children:[e.jsx(_a,{size:14}),"Install Network Package"]}),e.jsx("p",{className:"text-2xs font-sans text-text-3 mt-3",children:"This will download and set up the Groove Network runtime (~500 MB)"})]})]})})}function aXe({progress:t}){const a=Math.max(0,Math.min(100,Number.isFinite(t.percent)?t.percent:0));return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-md border border-border-subtle bg-surface-0",children:[e.jsx($e,{size:11,className:"animate-spin text-accent flex-shrink-0"}),e.jsxs("div",{className:"flex flex-col min-w-0",children:[e.jsx("span",{className:"text-2xs font-sans text-text-1 truncate",children:t.message||"Updating…"}),e.jsx("div",{className:"h-1 w-32 rounded-full bg-surface-3 overflow-hidden mt-0.5",children:e.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500 ease-out",style:{width:`${a}%`}})})]}),e.jsxs("span",{className:"text-2xs font-mono text-text-3 tabular-nums",children:[a,"%"]})]})}function nXe(){const[t,a]=g.useState(!1),n=$(l=>l.networkVersion),s=$(l=>l.networkUpdateProgress),o=$(l=>l.updateNetworkPackage);if(s.updating)return e.jsx(aXe,{progress:s});if(!n.updateAvailable)return null;const c=async()=>{try{await o(),a(!1)}catch{}};return e.jsxs(Ut,{open:t,onOpenChange:a,children:[e.jsx(qG,{asChild:!0,children:e.jsx("button",{type:"button",className:"inline-flex items-center gap-1",title:`Update to ${n.latest}`,children:e.jsxs(be,{variant:"warning",className:"cursor-pointer",children:[e.jsx(za,{size:10}),"Update Available"]})})}),e.jsxs(Pt,{title:"Update Network Package",description:"Confirm update",children:[e.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[e.jsxs("p",{className:"text-sm text-text-1 font-sans leading-relaxed",children:["Update to ",e.jsx("span",{className:"font-mono text-accent",children:n.latest}),"?"]}),e.jsxs("p",{className:"text-xs text-text-3 font-sans leading-relaxed",children:["You are currently running ",e.jsx("span",{className:"font-mono",children:n.installed||"unknown"}),". Your node will be stopped during the update and restarted after."]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border-subtle bg-surface-0",children:[e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>a(!1),children:"Cancel"}),e.jsxs(fe,{variant:"primary",size:"sm",onClick:c,children:[e.jsx(za,{size:12}),"Update"]})]})]})]})}function sXe(){const[t,a]=g.useState(!1),n=$(l=>l.uninstallNetworkPackage),[s,o]=g.useState(!1),c=async()=>{o(!0);try{await n(),a(!1)}catch{}finally{o(!1)}};return e.jsxs(Ut,{open:t,onOpenChange:a,children:[e.jsx(qG,{asChild:!0,children:e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 text-2xs font-sans text-text-3 hover:text-danger transition-colors",children:[e.jsx(At,{size:11}),"Uninstall"]})}),e.jsxs(Pt,{title:"Uninstall Network Package",description:"Confirm uninstall",children:[e.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[e.jsxs("p",{className:"text-sm text-text-1 font-sans leading-relaxed",children:["This will stop your node and remove the network package from ",e.jsx("span",{className:"font-mono text-text-2",children:"~/.groove/network"}),"."]}),e.jsxs("p",{className:"text-xs text-text-3 font-sans leading-relaxed",children:["Your identity (",e.jsx("span",{className:"font-mono",children:"~/.groove/node_key.json"}),") will be preserved — you can reinstall later without losing your wallet."]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border-subtle bg-surface-0",children:[e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>a(!1),disabled:s,children:"Cancel"}),e.jsxs(fe,{variant:"danger",size:"sm",onClick:c,disabled:s,children:[s?e.jsx($e,{size:12,className:"animate-spin"}):e.jsx(At,{size:12}),"Uninstall"]})]})]})]})}function rXe({value:t,onChange:a,disabled:n}){return e.jsx("button",{onClick:()=>!n&&a(!t),disabled:n,className:V("relative inline-flex h-5 w-9 rounded-full p-0.5 transition-colors flex-shrink-0",n?"opacity-50 cursor-not-allowed":"cursor-pointer",t?"bg-accent":"bg-surface-5"),children:e.jsx("span",{className:V("inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform",t?"translate-x-4":"translate-x-0")})})}function OE(){const t=$(f=>f.networkNode),a=$(f=>f.networkInstalled),n=$(f=>f.networkVersion),s=$(f=>f.networkStatusReachable),o=$(f=>f.startNetworkNode),c=$(f=>f.stopNetworkNode),[l,A]=g.useState(!1);async function u(f){A(!0);try{f?await o():await c()}catch{}A(!1)}return e.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-surface-1 border-b border-border flex-shrink-0",children:[e.jsx("h2",{className:"text-xs font-semibold text-text-0 font-sans tracking-wide uppercase",children:"Network Command Center"}),a&&n.installed&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-4",children:"/"}),e.jsxs("span",{className:"text-xs font-mono text-text-2 tabular-nums",children:["v",String(n.installed).replace(/^v/,"")]})]}),a&&e.jsx(nXe,{}),e.jsx("div",{className:"flex-1"}),a&&e.jsxs("div",{className:"flex items-center gap-3.5 text-xs font-mono text-text-2",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(rXe,{value:!!t.active,onChange:u,disabled:l}),e.jsx("span",{className:"text-text-3",children:t.active?"Contributing":"Idle"})]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"relative flex-shrink-0 w-[5px] h-[5px]",children:e.jsx("span",{className:"absolute inset-0 rounded-sm",style:{background:s?te.accent:te.danger}})}),e.jsx("span",{className:"text-text-3",children:"Signal"})]})]}),a&&e.jsx(sXe,{}),e.jsx(ia,{status:a&&t.active?"running":a?"stopped":"crashed",size:"sm"})]})}function oXe(){const t=$(f=>f.networkNode),a=$(f=>f.networkStatus),n=$(f=>f.startNetworkNode),[s,o]=g.useState(!1),c=t.hardware||{},l=(a.nodes||[]).filter(f=>f.status==="active").length,A=a.activeSessions||0;async function u(){o(!0);try{await n()}catch{}o(!1)}return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(OE,{}),e.jsx("div",{className:"flex-1 flex items-center justify-center bg-surface-0",style:{background:`radial-gradient(ellipse at 50% 40%, ${qe(te.accent,.06)} 0%, transparent 70%) ${te.surface0}`},children:e.jsxs("div",{className:"max-w-lg w-full px-6 flex flex-col items-center text-center",children:[e.jsx("div",{className:"w-24 h-24 rounded-full flex items-center justify-center mb-6 mx-auto",style:{background:qe(te.accent,.08),border:`1px solid ${qe(te.accent,.15)}`,boxShadow:`0 0 40px ${qe(te.accent,.1)}`},children:e.jsx(sa,{size:56,className:"text-accent",strokeWidth:1.25})}),e.jsx("h2",{className:"text-xl font-semibold text-text-0 font-sans text-center",children:"Join the Groove Network"}),e.jsx("p",{className:"text-sm text-text-2 font-sans text-center leading-relaxed mt-2 max-w-sm mx-auto",children:"Contribute your compute to power decentralized AI inference. Your hardware runs model shards alongside other nodes in the network."}),e.jsxs("div",{className:"mt-8 w-full",children:[e.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest mb-2 text-left",children:"Your Hardware"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs("div",{className:"bg-surface-1 rounded-sm border border-border-subtle px-4 py-3",children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider",children:"Device"}),e.jsx("div",{className:"text-sm font-mono text-text-0 mt-1 truncate",children:c.device||"auto"})]}),e.jsxs("div",{className:"bg-surface-1 rounded-sm border border-border-subtle px-4 py-3",children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider",children:"Memory"}),e.jsx("div",{className:"text-sm font-mono text-text-0 mt-1 truncate",children:c.memory||"—"})]}),e.jsxs("div",{className:"bg-surface-1 rounded-sm border border-border-subtle px-4 py-3",children:[e.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider",children:"GPU"}),e.jsx("div",{className:"text-sm font-mono text-text-0 mt-1 truncate",children:c.gpu||"None"})]})]})]}),e.jsx("div",{className:"mt-6 w-full max-w-sm mx-auto",children:e.jsx(fe,{variant:"primary",size:"lg",onClick:u,disabled:s,className:"w-full",children:s?e.jsxs(e.Fragment,{children:[e.jsx($e,{size:14,className:"animate-spin"})," Connecting…"]}):e.jsxs(e.Fragment,{children:[e.jsx(wt,{size:14})," Start Contributing"]})})}),e.jsx("div",{className:"mt-4 text-center text-2xs font-mono text-text-3",children:l>0||A>0?e.jsxs("span",{children:[e.jsx("span",{className:"text-accent",children:l})," node",l!==1?"s":""," online · ",A," active session",A!==1?"s":""]}):e.jsx("span",{children:"Checking network status…"})}),t.nodeId&&e.jsxs("div",{className:"mt-6 text-center text-2xs font-mono text-text-4",children:["Node identity: ",t.nodeId.length>14?`${t.nodeId.slice(0,6)}…${t.nodeId.slice(-4)}`:t.nodeId]})]})})]})}function iXe(){return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(yVe,{}),e.jsxs("div",{className:"flex-1 min-h-0 grid",style:{gridTemplateColumns:"2.5fr 1fr",gap:"1px",background:te.surface3},children:[e.jsxs("div",{className:"flex flex-col min-w-0 min-h-0",style:{gap:"1px"},children:[e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden bg-surface-1",children:e.jsx(kVe,{})}),e.jsx("div",{className:"flex-[0.5] min-h-0 overflow-hidden bg-surface-1",children:e.jsx(NVe,{})})]}),e.jsxs("div",{className:"flex flex-col min-w-0 min-h-0",style:{gap:"1px"},children:[e.jsx("div",{className:"min-h-0 overflow-hidden bg-surface-1",children:e.jsx(LVe,{})}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden bg-surface-1",children:e.jsx(SVe,{})}),e.jsx("div",{className:"min-h-0 overflow-hidden bg-surface-1",children:e.jsx($Ve,{})})]})]})]})}function cXe(){const t=$(A=>A.fetchNetworkNodeStatus),a=$(A=>A.fetchNetworkStatus),n=$(A=>A.checkNetworkUpdate),s=$(A=>A.networkInstalled),o=$(A=>A.networkNode.active),[c,l]=g.useState("overview");return g.useEffect(()=>{if(t(),s){a(),n();const A=setInterval(()=>{a()},1e4);return()=>clearInterval(A)}},[t,a,n,s]),s?o?e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(OE,{}),e.jsx(xVe,{}),e.jsxs(Pz,{value:c,onValueChange:l,className:"flex-1 min-h-0 flex flex-col",children:[e.jsxs(Ez,{className:"bg-surface-0 border-b border-border-subtle px-4 flex-shrink-0",children:[e.jsx(ys,{value:"overview",className:"text-xs",children:"Overview"}),e.jsx(ys,{value:"fleet",className:"text-xs",children:"Fleet"}),e.jsxs(ys,{value:"performance",className:"text-xs flex items-center gap-1",children:[e.jsx(wt,{size:10}),"Performance"]}),e.jsx(ys,{value:"wallet",className:"text-xs",children:"Wallet"})]}),e.jsx(vs,{value:"overview",className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(iXe,{})}),e.jsx(vs,{value:"fleet",className:"flex-1 min-h-0 overflow-hidden bg-surface-1",children:e.jsx(PVe,{})}),e.jsx(vs,{value:"performance",className:"flex-1 min-h-0 overflow-hidden bg-surface-1",children:e.jsx(KVe,{active:c==="performance"})}),e.jsx(vs,{value:"wallet",className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(FVe,{})})]})]}):e.jsx(oXe,{}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(OE,{}),e.jsx(it,{className:"flex-1",children:e.jsx(tXe,{})})]})}function qz(t){return t?t.replace(/^claude-/,"").replace(/-(\d)/," $1").split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "):""}const lXe={frontier:{label:"Frontier",variant:"purple",icon:It},mid:{label:"Mid",variant:"accent",icon:wt},fast:{label:"Fast",variant:"success",icon:wt}};function dXe(t){const a=(t||"").toLowerCase();return a.includes("gpt-5.5")||a.includes("gpt-5.4-pro")?"frontier":a.includes("gpt-5.4-mini")||a.includes("gpt-5-mini")?"mid":a.includes("gpt-5.4-nano")||a.includes("gpt-5-nano")?"fast":a.includes("gpt-5.4")||a.includes("opus")||a.includes("pro")||a.includes("o3")||a.includes("gpt-4o")?"frontier":a.includes("sonnet")||a.includes("flash")||a.includes("o4-mini")?"mid":"fast"}function AXe(t){const a=(t||"").toLowerCase();return a.startsWith("gpt-5")||a.includes("opus")||a.includes("sonnet")||a.includes("haiku")?"200k":a.includes("pro")||a.includes("flash")?"1M":(a.includes("o3")||a.includes("o4"),"128k")}function NL(t){if(!t)return!1;const a=t.toLowerCase();return a.includes("dall-e")||a.includes("imagen")||a.includes("gpt-image")||a.includes("imagine")||a.includes("nano-banana")}function uXe({value:t,onChange:a,disabled:n}){const[s,o]=g.useState(!1),[c,l]=g.useState([]),A=$(j=>j.fetchProviders),u=g.useRef(null);g.useEffect(()=>{A().then(j=>{Array.isArray(j)?l(j):j!=null&&j.providers&&l(j.providers)}).catch(()=>{})},[A]),g.useEffect(()=>{if(!s)return;function j(N){u.current&&!u.current.contains(N.target)&&o(!1)}return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[s]);const f=(t==null?void 0:t.model)||"",x=f?qz(f):"Select model",m=(t==null?void 0:t.provider)||"",y=m==="groove-network",v=NL(f),O=[],b=[];for(const j of c){const N=j.models||[],M=[],Q=[];for(const L of N){const B=typeof L=="string"?L:L.id||L.name;(typeof L=="object"?L.type:void 0)==="image"||NL(B)?Q.push(L):M.push(L)}M.length>0&&O.push({...j,models:M}),Q.length>0&&b.push({...j,models:Q})}function C(j,N){return j.length===0?null:e.jsxs(e.Fragment,{children:[N&&e.jsxs("div",{className:"px-3 py-1.5 text-2xs font-semibold text-text-4 uppercase tracking-wider font-sans bg-surface-0 border-b border-border-subtle flex items-center gap-1.5",children:[N==="Image Generation"&&e.jsx(Zn,{size:10,className:"text-purple"}),N]}),j.map(M=>{const Q=M.id==="groove-network";return e.jsxs("div",{children:[e.jsxs("div",{className:"px-3 py-1.5 text-2xs font-semibold text-text-3 uppercase tracking-wider font-sans bg-surface-2 border-b border-border-subtle flex items-center gap-1.5",children:[Q&&e.jsx(sa,{size:10,className:"text-purple"}),M.name||M.id]}),M.models.map(L=>{const B=typeof L=="string"?L:L.id||L.name,S=typeof L=="string"?L:L.name||L.id,z=(typeof L=="object"?L.type:void 0)==="image"||NL(B),P=z?null:dXe(B),F=P?lXe[P]:null,K=F==null?void 0:F.icon,G=f===B&&m===M.id;return e.jsxs("button",{onClick:()=>{a({provider:M.id,model:B}),o(!1)},className:V("w-full flex items-center gap-2 px-3 py-2 text-left transition-colors cursor-pointer",G?"bg-accent/10 text-text-0":"hover:bg-surface-3 text-text-1"),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[z&&e.jsx(Zn,{size:11,className:"text-purple flex-shrink-0"}),e.jsx("span",{className:"text-xs font-medium font-sans truncate",children:S})]}),!z&&e.jsxs("div",{className:"text-2xs text-text-4 font-sans",children:[AXe(B)," context"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[Q&&e.jsxs(be,{variant:"purple",className:"text-[9px]",children:[e.jsx(sa,{size:8})," Decentralized"]}),z?e.jsxs(be,{variant:"purple",className:"text-[9px]",children:[e.jsx(Zn,{size:8})," Image"]}):F&&e.jsxs(be,{variant:F.variant,className:"text-[9px]",children:[e.jsx(K,{size:8})," ",F.label]})]})]},B)})]},M.id)})]})}return e.jsxs("div",{ref:u,className:"relative",children:[e.jsxs("button",{onClick:()=>!n&&o(!s),disabled:n,className:V("flex items-center gap-1.5 h-8 px-2.5 rounded-lg text-xs font-medium font-sans transition-colors cursor-pointer","bg-surface-4 border border-border-subtle hover:bg-surface-5","disabled:opacity-40 disabled:cursor-not-allowed",y&&"border-purple/30 bg-purple/8",v&&"border-purple/30 bg-purple/8"),children:[v?e.jsx(Zn,{size:12,className:"text-purple"}):y?e.jsx(sa,{size:12,className:"text-purple"}):e.jsx(Ba,{size:12,className:"text-text-3"}),e.jsx("span",{className:V("max-w-[120px] truncate",v?"text-purple":"text-text-1"),children:x}),e.jsx(bt,{size:12,className:"text-text-4"})]}),s&&e.jsxs("div",{className:"absolute top-full right-0 mt-1 w-72 max-h-80 overflow-y-auto rounded-lg border border-border bg-surface-1 shadow-xl z-50",children:[c.length===0&&e.jsx("div",{className:"px-4 py-6 text-center text-xs text-text-3 font-sans",children:"No providers available"}),C(O,null),C(b,"Image Generation")]})]})}function hXe(t){const a=new Date,n=new Date(a.getFullYear(),a.getMonth(),a.getDate()),s=new Date(n);s.setDate(n.getDate()-1);const o=new Date(n);o.setDate(n.getDate()-7);const c={pinned:[],today:[],yesterday:[],week:[],older:[]};for(const l of t){if(l.pinned){c.pinned.push(l);continue}const A=new Date(l.updatedAt||l.createdAt);A>=n?c.today.push(l):A>=s?c.yesterday.push(l):A>=o?c.week.push(l):c.older.push(l)}return c}function pXe({label:t}){return e.jsx("div",{className:"px-3 pt-4 pb-1.5",children:e.jsx("span",{className:"text-2xs font-semibold text-text-4 uppercase tracking-wider font-sans",children:t})})}function fXe({conv:t,isActive:a,onSelect:n,onRename:s,onPin:o,onDelete:c}){return e.jsxs(Bz,{children:[e.jsx(_z,{asChild:!0,children:e.jsxs("button",{onClick:()=>n(t.id),className:V("w-full flex items-center gap-2 px-3 py-2.5 text-left transition-colors cursor-pointer group border-b border-border-subtle/50",a?"text-text-0":"text-text-2 hover:bg-surface-3/40 hover:text-text-1"),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-medium font-sans truncate",children:t.title||"New Chat"}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[t.mode==="agent"?e.jsx(Os,{size:9,className:"text-purple flex-shrink-0"}):e.jsx(wt,{size:9,className:"text-accent flex-shrink-0"}),t.model&&e.jsx(be,{variant:"default",className:"text-[8px] px-1 py-0",children:qz(t.model)}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:Mt(t.updatedAt||t.createdAt)})]})]}),t.pinned&&e.jsx(LA,{size:10,className:"text-accent flex-shrink-0"})]})}),e.jsxs(Lz,{children:[e.jsxs(ms,{onSelect:()=>s(t),children:[e.jsx(js,{size:12})," Rename"]}),e.jsxs(ms,{onSelect:()=>o(t),children:[t.pinned?e.jsx(gu,{size:12}):e.jsx(LA,{size:12}),t.pinned?"Unpin":"Pin"]}),e.jsx(Tz,{}),e.jsxs(ms,{danger:!0,onSelect:()=>c(t.id),children:[e.jsx(At,{size:12})," Delete"]})]})]})}function xXe({onNewChat:t,onCollapse:a}){const n=$(y=>y.conversations),s=$(y=>y.activeConversationId),o=$(y=>y.setActiveConversation),c=$(y=>y.renameConversation),l=$(y=>y.pinConversation),A=$(y=>y.deleteConversation),u=g.useMemo(()=>hXe(n),[n]);function f(y){const v=prompt("Rename conversation:",y.title||"");v&&v.trim()&&c(y.id,v.trim())}function x(y){l(y.id,!y.pinned)}const m=(y,v)=>v.length===0?null:e.jsxs("div",{children:[e.jsx(pXe,{label:y}),v.map(O=>e.jsx(fXe,{conv:O,isActive:O.id===s,onSelect:o,onRename:f,onPin:x,onDelete:A},O.id))]},y);return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 pt-3 pb-2",children:[e.jsx("span",{className:"text-xs font-semibold text-text-2 font-sans",children:"Chats"}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("button",{onClick:t,className:"w-7 h-7 flex items-center justify-center rounded-md text-text-3 hover:text-text-0 hover:bg-surface-3 transition-colors cursor-pointer",title:"New chat",children:e.jsx(sn,{size:15})}),e.jsx("button",{onClick:a,className:"w-7 h-7 flex items-center justify-center rounded-md text-text-3 hover:text-text-0 hover:bg-surface-3 transition-colors cursor-pointer",title:"Collapse sidebar",children:e.jsx(fs,{size:15})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto pt-1 pb-3",children:n.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center px-4",children:[e.jsx(Yn,{size:24,className:"text-text-4 mb-3"}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No conversations yet"}),e.jsx("p",{className:"text-2xs text-text-4 font-sans mt-1",children:"Start a new chat to begin"})]}):e.jsxs(e.Fragment,{children:[m("Pinned",u.pinned),m("Today",u.today),m("Yesterday",u.yesterday),m("Previous 7 Days",u.week),m("Older",u.older)]})})]})}const qX=[{id:"fullstack",label:"Fullstack",desc:"End-to-end engineering"},{id:"backend",label:"Backend",desc:"APIs, services, databases"},{id:"frontend",label:"Frontend",desc:"UI, components, styling"},{id:"devops",label:"DevOps",desc:"CI/CD, infra, deployment"},{id:"security",label:"Security",desc:"Audits, vulnerabilities"},{id:"database",label:"Database",desc:"Schema, migrations, queries"},{id:"testing",label:"Testing",desc:"Tests, coverage, QA"},{id:"docs",label:"Docs",desc:"Documentation, guides"},{id:"cmo",label:"CMO",desc:"Marketing, content, growth"},{id:"cfo",label:"CFO",desc:"Finance, metrics, forecasting"},{id:"ea",label:"EA",desc:"Executive assistant"},{id:"analyst",label:"Analyst",desc:"Data analysis, insights"},{id:"creative",label:"Writer",desc:"Copy, articles, proposals"},{id:"support",label:"Support",desc:"Customer support, FAQs"}];function mXe({conversation:t,model:a,onModelChange:n,role:s,onRoleChange:o,sidebarCollapsed:c}){var S;const l=$(I=>I.renameConversation),A=$(I=>I.pinConversation),u=$(I=>I.deleteConversation),[f,x]=g.useState(!1),[m,y]=g.useState(t.title||""),[v,O]=g.useState(!1),[b,C]=g.useState(!1),j=g.useRef(null),N=g.useRef(null),M=g.useRef(null);g.useEffect(()=>{y(t.title||""),x(!1)},[t.id,t.title]),g.useEffect(()=>{f&&j.current&&j.current.focus()},[f]),g.useEffect(()=>{if(!v)return;function I(z){N.current&&!N.current.contains(z.target)&&O(!1)}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[v]),g.useEffect(()=>{if(!b)return;function I(z){M.current&&!M.current.contains(z.target)&&C(!1)}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[b]);function Q(){const I=m.trim();I&&I!==t.title?l(t.id,I):y(t.title||""),x(!1)}const L=$(I=>I.agents.find(z=>z.id===t.agentId)),B=(L==null?void 0:L.tokensUsed)||0;return e.jsxs("div",{className:V("h-12 flex items-center gap-3 border-b border-border-subtle bg-surface-0/80 flex-shrink-0",c?"pl-10 pr-4":"px-4"),children:[e.jsx(du,{size:14,className:"text-text-4 flex-shrink-0"}),f?e.jsx("input",{ref:j,value:m,onChange:I=>y(I.target.value),onKeyDown:I=>{I.key==="Enter"&&Q(),I.key==="Escape"&&(y(t.title||""),x(!1))},onBlur:Q,className:"flex-1 min-w-0 bg-transparent text-sm font-semibold text-text-0 font-sans outline-none border-b border-accent",maxLength:100}):e.jsx("button",{onClick:()=>x(!0),className:"flex-1 min-w-0 text-left text-sm font-semibold text-text-0 font-sans truncate hover:text-accent transition-colors cursor-pointer",children:t.title||"New Chat"}),e.jsx("div",{className:"w-px h-5 bg-border-subtle"}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsxs("div",{ref:M,className:"relative",children:[e.jsxs("button",{onClick:()=>C(!b),className:V("flex items-center gap-1.5 h-7 px-2.5 rounded-lg text-2xs font-semibold font-sans transition-colors cursor-pointer border",s?"border-current/20":"bg-surface-3 border-border-subtle text-text-3 hover:text-text-1"),style:s?{background:On(s).bg,color:On(s).text,borderColor:`${On(s).border}33`}:void 0,children:[s?((S=qX.find(I=>I.id===s))==null?void 0:S.label)||s:"Role",s?e.jsx(Ge,{size:10,className:"opacity-60 hover:opacity-100",onClick:I=>{I.stopPropagation(),o==null||o(null)}}):e.jsx(bt,{size:10})]}),b&&e.jsx("div",{className:"absolute left-0 top-full mt-1 w-56 rounded-lg border border-border bg-surface-1 shadow-xl z-50 py-1 max-h-72 overflow-y-auto",children:qX.map(I=>{const z=On(I.id),P=s===I.id;return e.jsxs("button",{onClick:()=>{o==null||o(I.id),C(!1)},className:V("w-full flex items-center gap-2.5 px-3 py-2 text-left hover:bg-surface-3 cursor-pointer transition-colors",P&&"bg-surface-3"),children:[e.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:z.text}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold font-sans text-text-0",children:I.label}),e.jsx("div",{className:"text-2xs text-text-3 font-sans",children:I.desc})]}),P&&e.jsx("span",{className:"text-2xs text-accent font-mono",children:"active"})]},I.id)})})]}),e.jsx(uXe,{value:a||{provider:t.provider,model:t.model},onChange:n,disabled:!1}),B>0&&e.jsxs("span",{className:"text-2xs text-text-3 font-mono tabular-nums",children:[pt(B)," tok"]}),e.jsxs("div",{ref:N,className:"relative",children:[e.jsx("button",{onClick:()=>O(!v),className:"w-7 h-7 flex items-center justify-center rounded-md text-text-3 hover:text-text-1 hover:bg-surface-3 transition-colors cursor-pointer",children:e.jsx(Uo,{size:14})}),v&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 rounded-md border border-border bg-surface-1 shadow-xl z-50 py-1",children:[e.jsxs("button",{onClick:()=>{x(!0),O(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-text-1 hover:bg-surface-5 cursor-pointer font-sans",children:[e.jsx(js,{size:12})," Rename"]}),e.jsxs("button",{onClick:()=>{A(t.id,!t.pinned),O(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-text-1 hover:bg-surface-5 cursor-pointer font-sans",children:[t.pinned?e.jsx(gu,{size:12}):e.jsx(LA,{size:12}),t.pinned?"Unpin":"Pin"]}),e.jsx("div",{className:"h-px my-1 bg-border-subtle"}),e.jsxs("button",{onClick:()=>{u(t.id),O(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-danger hover:bg-danger/10 cursor-pointer font-sans",children:[e.jsx(At,{size:12})," Delete"]})]})]})]})]})}const DX=["Reading through the codebase...","Thinking through your request...","Planning the approach...","Running tool calls...","Working through the problem...","Reasoning step by step...","Reviewing context...","Considering options...","Analyzing the code...","Making progress..."];function Cee({agent:t,className:a}){const[n,s]=g.useState(0),[o,c]=g.useState(!0);return g.useEffect(()=>{const l=setInterval(()=>{c(!1),setTimeout(()=>{s(A=>(A+1)%DX.length),c(!0)},250)},2800);return()=>clearInterval(l)},[]),e.jsxs("div",{className:`${a||""}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-1 font-sans",children:(t==null?void 0:t.name)||"Agent"}),e.jsx("span",{className:"text-2xs text-accent font-mono",children:"thinking"})]}),e.jsxs("div",{className:"border-l border-accent/40 pl-3.5 py-1 flex items-center gap-2.5",children:[e.jsx("div",{className:"relative w-3.5 h-3.5 flex-shrink-0",children:e.jsx("span",{className:"absolute inset-0 rounded-full border border-transparent border-t-accent animate-spin",style:{animationDuration:"0.9s"}})}),e.jsx("span",{className:"text-[12px] font-sans text-text-3 transition-opacity duration-[250ms]",style:{opacity:o?1:0},children:DX[n]})]})]})}const VX=["Generating response...","Processing...","Thinking...","Almost there..."];function gXe(t){return t?t.replace(new RegExp("\\p{Extended_Pictographic}","gu"),"").replace(/[️‍⃣]/g,"").replace(/\s{2,}/g," "):""}function Nee({text:t,className:a}){const[n,s]=g.useState(!1);function o(){navigator.clipboard.writeText(t).then(()=>{s(!0),setTimeout(()=>s(!1),2e3)})}return e.jsxs("button",{onClick:o,className:V("flex items-center gap-1 px-2 py-1 text-2xs font-sans text-text-3 hover:text-text-1 transition-colors cursor-pointer",a),children:[n?e.jsx(De,{size:12,className:"text-success"}):e.jsx(wn,{size:12}),n?"Copied":"Copy"]})}function yXe({language:t,code:a}){return e.jsxs("div",{className:"my-3 rounded-lg border border-border-subtle overflow-hidden bg-surface-0",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-3 border-b border-border-subtle",children:[e.jsx("span",{className:"text-2xs font-mono text-text-3",children:t||"code"}),e.jsx(Nee,{text:a})]}),e.jsx("pre",{className:"px-4 py-3 overflow-x-auto",children:e.jsx("code",{className:"text-xs font-mono text-text-1 leading-relaxed whitespace-pre",children:a})})]})}function vXe(t){if(!t)return[];const a=t.split(`
8680
8680
  `),n=[];let s=0;for(;s<a.length;){const o=a[s];if(o.startsWith("```")){const A=o.slice(3).trim(),u=[];for(s++;s<a.length&&!a[s].startsWith("```");)u.push(a[s]),s++;s++,n.push({type:"code",language:A,code:u.join(`
@@ -8683,7 +8683,7 @@ State: ${v}`),children:[e.jsx(na,{size:10}),"Details"]}),e.jsxs(fe,{size:"sm",va
8683
8683
  `)})}return n}function Zh({text:t}){if(!t)return null;const a=t.split(/(```[\s\S]*?```|`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|~~[^~]+~~|\[([^\]]+)\]\(([^)]+)\))/g);return e.jsx(e.Fragment,{children:a.map((n,s)=>{if(!n)return null;if(n.startsWith("`")&&n.endsWith("`")&&!n.startsWith("``"))return e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-surface-0 text-xs font-mono text-accent",children:n.slice(1,-1)},s);if(n.startsWith("**")&&n.endsWith("**"))return e.jsx("strong",{className:"font-semibold text-text-0",children:n.slice(2,-2)},s);if(n.startsWith("*")&&n.endsWith("*")&&!n.startsWith("**"))return e.jsx("em",{className:"italic",children:n.slice(1,-1)},s);if(n.startsWith("~~")&&n.endsWith("~~"))return e.jsx("del",{className:"line-through text-text-3",children:n.slice(2,-2)},s);const o=n.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return o?e.jsx("a",{href:o[2],target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:o[1]},s):e.jsx("span",{children:n},s)})})}function kXe({text:t}){const a=vXe(t);return e.jsx("div",{className:"space-y-2",children:a.map((n,s)=>{switch(n.type){case"code":return e.jsx(yXe,{language:n.language,code:n.code},s);case"heading":{const o=["text-lg font-bold","text-base font-bold","text-sm font-semibold","text-sm font-semibold","text-xs font-semibold","text-xs font-semibold"];return e.jsx("div",{className:V(o[n.level-1]||o[0],"text-text-0 font-sans mt-3 mb-1"),children:e.jsx(Zh,{text:n.text})},s)}case"hr":return e.jsx("hr",{className:"border-border-subtle my-3"},s);case"blockquote":return e.jsx("div",{className:"border-l-2 border-accent/40 pl-3 py-1 text-sm text-text-2 italic font-sans",children:e.jsx(Zh,{text:n.text})},s);case"ul":return e.jsx("ul",{className:"list-disc list-inside space-y-0.5 text-sm text-text-0 font-sans",children:n.items.map((o,c)=>e.jsx("li",{children:e.jsx(Zh,{text:o})},c))},s);case"ol":return e.jsx("ol",{className:"list-decimal list-inside space-y-0.5 text-sm text-text-0 font-sans",children:n.items.map((o,c)=>e.jsx("li",{children:e.jsx(Zh,{text:o})},c))},s);case"table":return e.jsx(sz,{headers:n.headers,rows:n.rows},s);case"paragraph":return e.jsx("p",{className:"text-sm text-text-0 font-sans leading-relaxed whitespace-pre-wrap break-words",children:e.jsx(Zh,{text:n.text})},s);default:return null}})})}function OXe({msg:t}){return e.jsx("div",{className:"flex justify-end",children:e.jsxs("div",{className:"max-w-[85%]",children:[e.jsx("div",{className:"px-3.5 py-2.5 rounded-2xl rounded-br-md bg-info/10 border border-info/15",children:e.jsx("p",{className:"text-sm text-text-0 font-sans whitespace-pre-wrap break-words leading-relaxed",children:t.text})}),e.jsx("div",{className:"text-2xs text-text-4 font-sans mt-1 text-right",children:Mt(t.timestamp)})]})})}function bXe({msg:t,model:a,role:n}){const s=gXe(t.text),o=a||"Assistant",c=n?n.charAt(0).toUpperCase()+n.slice(1):null;return e.jsxs("div",{className:"max-w-[85%]",children:[e.jsxs("div",{className:"text-2xs font-sans mb-1 font-medium",children:[e.jsx("span",{className:"text-text-1",children:o}),c&&e.jsx("span",{className:"text-text-3 ml-1",children:c})]}),e.jsx("div",{className:"border-l-2 border-accent pl-3.5 py-1",children:e.jsx("div",{className:"text-sm text-text-1 font-sans whitespace-pre-wrap break-words leading-relaxed",children:e.jsx(kXe,{text:s})})}),e.jsx("div",{className:"text-2xs text-text-4 font-sans mt-1",children:Mt(t.timestamp)})]})}function wXe({msg:t}){return e.jsx("div",{className:"max-w-[85%]",children:e.jsxs("div",{className:"rounded-2xl rounded-tl-md bg-surface-1/80 border border-border-subtle overflow-hidden",children:[e.jsx("div",{className:"w-80 h-80 image-loading-shimmer flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-surface-3/80 flex items-center justify-center",children:e.jsx(Zn,{size:18,className:"text-accent animate-pulse"})}),e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Generating image..."})]})}),t.prompt&&e.jsx("div",{className:"px-4 py-2.5 border-t border-border-subtle",children:e.jsxs("p",{className:"text-2xs text-text-3 font-sans italic truncate",children:['"',t.prompt,'"']})})]})})}function jXe({msg:t,onReply:a}){const[n,s]=g.useState(!1),[o,c]=g.useState(!1),l=g.useCallback(()=>{if(!t.imageUrl)return;const A=document.createElement("a");A.href=t.imageUrl,A.download=`groove-${t.model||"image"}-${Date.now()}.png`,document.body.appendChild(A),A.click(),document.body.removeChild(A)},[t.imageUrl,t.model]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"max-w-[85%]",children:[t.model&&e.jsxs("div",{className:"text-2xs text-text-3 font-mono mb-1.5 font-medium flex items-center gap-1.5",children:[e.jsx(Zn,{size:10})," ",t.model]}),e.jsxs("div",{className:"rounded-2xl rounded-tl-md bg-surface-1/80 border border-border-subtle overflow-hidden",children:[e.jsxs("div",{className:"relative group",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[e.jsx("img",{src:t.imageUrl,alt:t.prompt||"Generated image",className:"max-w-full max-h-[480px] object-contain cursor-pointer",onClick:()=>s(!0)}),o&&e.jsxs("div",{className:"absolute top-2 right-2 flex gap-1.5",children:[e.jsx("button",{onClick:l,className:"w-8 h-8 rounded-lg bg-surface-0/90 backdrop-blur-sm border border-border-subtle flex items-center justify-center text-text-2 hover:text-accent hover:border-accent/30 transition-colors cursor-pointer",title:"Download",children:e.jsx(_a,{size:14})}),e.jsx("button",{onClick:()=>s(!0),className:"w-8 h-8 rounded-lg bg-surface-0/90 backdrop-blur-sm border border-border-subtle flex items-center justify-center text-text-2 hover:text-accent hover:border-accent/30 transition-colors cursor-pointer",title:"Fullscreen",children:e.jsx(BA,{size:14})}),e.jsx(Nee,{text:t.prompt||"",className:"h-8 rounded-lg bg-surface-0/90 backdrop-blur-sm border border-border-subtle text-text-2 hover:text-accent"})]})]}),e.jsxs("div",{className:"px-4 py-2.5 border-t border-border-subtle flex items-center gap-2",children:[e.jsxs("p",{className:"flex-1 text-2xs text-text-3 font-sans italic truncate",children:['"',t.prompt,'"']}),a&&e.jsxs("button",{onClick:()=>a(t),className:"text-2xs text-accent hover:text-accent/80 font-sans font-medium cursor-pointer flex items-center gap-1 flex-shrink-0",children:[e.jsx(ra,{size:10})," Iterate"]})]})]}),e.jsx("div",{className:"text-2xs text-text-4 font-sans mt-1",children:Mt(t.timestamp)})]}),n&&e.jsxs("div",{className:"fixed inset-0 z-[200] bg-surface-0/95 backdrop-blur-md flex items-center justify-center",onClick:()=>s(!1),children:[e.jsx("button",{onClick:()=>s(!1),className:"absolute top-4 right-4 w-10 h-10 rounded-full bg-surface-3 border border-border flex items-center justify-center text-text-2 hover:text-text-0 transition-colors cursor-pointer z-10",children:e.jsx(Ge,{size:18})}),e.jsx("div",{className:"absolute bottom-4 right-4 flex gap-2 z-10",children:e.jsxs("button",{onClick:A=>{A.stopPropagation(),l()},className:"h-9 px-4 rounded-lg bg-surface-3 border border-border flex items-center gap-2 text-xs font-sans text-text-1 hover:text-accent hover:border-accent/30 transition-colors cursor-pointer",children:[e.jsx(_a,{size:14})," Download"]})}),e.jsx("img",{src:t.imageUrl,alt:t.prompt||"Generated image",className:"max-w-[90vw] max-h-[90vh] object-contain rounded-lg shadow-2xl",onClick:A=>A.stopPropagation()}),t.prompt&&e.jsx("div",{className:"absolute bottom-4 left-4 max-w-md px-4 py-2 rounded-lg bg-surface-3/90 backdrop-blur-sm border border-border-subtle z-10",children:e.jsxs("p",{className:"text-xs text-text-2 font-sans italic",children:['"',t.prompt,'"']})})]})]})}function CXe({msg:t}){return e.jsx("div",{className:"flex justify-center py-1",children:e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 rounded-full bg-surface-4/50",children:[e.jsx(Fr,{size:10,className:"text-text-4"}),e.jsx("span",{className:"text-2xs text-text-3 font-sans",children:t.text})]})})}function NXe(){return e.jsx("div",{className:"flex flex-col items-center justify-center h-full text-center py-16",children:e.jsx("p",{className:"text-sm text-text-3 font-sans",children:"Send a message to start"})})}function MXe(){const[t,a]=g.useState(0),[n,s]=g.useState(!0);return g.useEffect(()=>{const o=setInterval(()=>{s(!1),setTimeout(()=>{a(c=>(c+1)%VX.length),s(!0)},250)},2800);return()=>clearInterval(o)},[]),e.jsxs("div",{className:"flex items-center gap-2.5 ml-8 py-1",children:[e.jsx("div",{className:"relative w-3.5 h-3.5 flex-shrink-0",children:e.jsx("span",{className:"absolute inset-0 rounded-full border border-transparent border-t-accent animate-spin",style:{animationDuration:"0.9s"}})}),e.jsx("span",{className:"text-2xs font-sans text-text-3 transition-opacity duration-[250ms]",style:{opacity:n?1:0},children:VX[t]})]})}function SXe({messages:t,isStreaming:a,model:n,mode:s,onImageReply:o,role:c}){const l=g.useRef(null),A=g.useRef(!0);return g.useEffect(()=>{const u=l.current;if(!u)return;function f(){A.current=u.scrollHeight-u.scrollTop-u.clientHeight<50}return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)},[]),g.useEffect(()=>{A.current&&l.current&&(l.current.scrollTop=l.current.scrollHeight)},[t==null?void 0:t.length,a]),!t||t.length===0?e.jsx("div",{ref:l,className:"flex-1 overflow-y-auto",children:e.jsx(NXe,{})}):e.jsxs("div",{ref:l,className:"flex-1 overflow-y-auto px-6 py-5 space-y-5",children:[t.map((u,f)=>u.type==="image-loading"?e.jsx(wXe,{msg:u},f):u.type==="image"?e.jsx(jXe,{msg:u,onReply:o},f):u.from==="user"?e.jsx(OXe,{msg:u},f):u.from==="system"?e.jsx(CXe,{msg:u},f):e.jsx(bXe,{msg:u,model:n,role:c},f)),a&&(s==="agent"?e.jsx(Cee,{className:"py-1"}):e.jsx(MXe,{}))]})}const QXe=[{value:"none",label:"None"},{value:"low",label:"Low"},{value:"medium",label:"Med"},{value:"high",label:"High"},{value:"xhigh",label:"XHigh"}],BXe=[{value:"low",label:"Concise"},{value:"medium",label:"Normal"}];function XX({onSend:t,onStop:a,sending:n,streaming:s,disabled:o,isImageModel:c,currentModel:l,replyContext:A,onClearReply:u,role:f,isCodex:x,reasoningEffort:m,onReasoningEffortChange:y,verbosity:v,onVerbosityChange:O,mode:b,onModeChange:C,modeChanging:j}){const[N,M]=g.useState(""),[Q,L]=g.useState(40),B=g.useRef(null),S=g.useRef(null);g.useEffect(()=>{!o&&B.current&&B.current.focus()},[o]);function I(){const _=N.trim();!_||n||o||(t(_),M(""),L(40))}function z(_){_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),I())}function P(_){const R=Array.from(_.target.files||[]);if(R.length===0)return;const U=R.map(Z=>Z.name).join(", ");M(Z=>Z+(Z?`
8684
8684
  `:"")+`[Attached: ${U}]`),_.target.value=""}const F=g.useCallback(_=>{_.preventDefault();const R=_.clientY,U=Q,Z=Ae=>L(Math.min(Math.max(40,U-(Ae.clientY-R)),400)),J=()=>{window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",J)};window.addEventListener("mousemove",Z),window.addEventListener("mouseup",J)},[Q]),K=s||n,G=N.trim()&&!n&&!o,H=b||"api",q=o?"Select a model to start chatting...":c?"Describe the image you want to generate...":f?`Ask your ${f}...`:"Send a message...";return e.jsxs("div",{className:"border-t border-border-subtle bg-surface-1",children:[e.jsx("div",{onMouseDown:F,className:"flex items-center justify-center h-3 cursor-row-resize hover:bg-surface-3/50 transition-colors group",children:e.jsx(lu,{size:10,className:"text-text-4 group-hover:text-text-2 transition-colors"})}),e.jsxs("div",{className:"px-4 pb-3",children:[A&&e.jsxs("div",{className:"flex items-center gap-2 mb-2 px-3 py-2 rounded-lg bg-accent/5 border border-accent/15",children:[e.jsx(Zn,{size:12,className:"text-accent flex-shrink-0"}),e.jsxs("span",{className:"flex-1 text-2xs text-text-2 font-sans truncate",children:['Iterating: "',A.prompt,'"']}),e.jsx("button",{onClick:u,className:"text-text-4 hover:text-text-1 cursor-pointer flex-shrink-0",children:e.jsx(Gr,{size:10})})]}),e.jsx("textarea",{ref:B,value:N,onChange:_=>M(_.target.value),onKeyDown:z,placeholder:q,disabled:o,rows:1,style:{height:Q},className:V("w-full resize-none rounded-xl px-4 py-2.5 text-sm","bg-surface-0 border text-text-0 font-sans","placeholder:text-text-4","focus:outline-none focus:ring-1","border-border focus:ring-accent/40","disabled:opacity-50 disabled:cursor-not-allowed")}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx("input",{ref:S,type:"file",multiple:!0,accept:".pdf,.png,.jpg,.jpeg,.gif,.svg,.csv,.txt,.md,.json,.yaml,.yml,.docx,.pptx,.xlsx",onChange:P,className:"hidden"}),e.jsx("button",{onClick:()=>{var _;return(_=S.current)==null?void 0:_.click()},disabled:o,className:"w-8 h-8 flex items-center justify-center rounded-lg text-text-4 hover:text-text-1 hover:bg-surface-3 transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed flex-shrink-0",title:"Attach file",children:e.jsx(mu,{size:14})}),e.jsxs("div",{className:"flex items-center h-7 rounded-lg bg-surface-3 border border-border-subtle p-0.5",children:[e.jsxs("button",{onClick:()=>C==null?void 0:C("api"),disabled:j,className:V("flex items-center gap-1 h-6 px-2 rounded-md text-2xs font-semibold font-sans transition-colors cursor-pointer","disabled:opacity-50 disabled:cursor-not-allowed",H==="api"?"bg-accent/15 text-accent border border-accent/25":"text-text-3 hover:text-text-1"),title:"Lightweight — fast and cheap, no tools",children:[e.jsx(wt,{size:11})," Chat"]}),e.jsxs("button",{onClick:()=>C==null?void 0:C("agent"),disabled:j,className:V("flex items-center gap-1 h-6 px-2 rounded-md text-2xs font-semibold font-sans transition-colors cursor-pointer","disabled:opacity-50 disabled:cursor-not-allowed",H==="agent"?"bg-purple/15 text-purple border border-purple/25":"text-text-3 hover:text-text-1"),title:"Full agent — tools, files, session resume",children:[e.jsx(Os,{size:11})," Agent"]})]}),l&&e.jsxs("div",{className:V("flex items-center gap-1 h-6 px-2 rounded-md text-2xs font-mono border",c?"bg-purple/8 border-purple/20 text-purple":"bg-surface-3 border-border-subtle text-text-3"),children:[c&&e.jsx(Zn,{size:9}),e.jsx("span",{className:"max-w-[80px] truncate",children:qz(l)})]}),x&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center h-6 rounded-md bg-surface-3 border border-border-subtle p-0.5",children:QXe.map(_=>e.jsx("button",{onClick:()=>y==null?void 0:y(_.value),className:V("h-5 px-1.5 rounded text-2xs font-semibold font-sans transition-colors cursor-pointer",m===_.value?"bg-accent/15 text-accent":"text-text-4 hover:text-text-1"),title:`Reasoning: ${_.label}`,children:_.label},_.value))}),e.jsx("div",{className:"flex items-center h-6 rounded-md bg-surface-3 border border-border-subtle p-0.5",children:BXe.map(_=>e.jsx("button",{onClick:()=>O==null?void 0:O(_.value),className:V("h-5 px-1.5 rounded text-2xs font-semibold font-sans transition-colors cursor-pointer",v===_.value?"bg-accent/15 text-accent":"text-text-4 hover:text-text-1"),title:`Verbosity: ${_.label}`,children:_.label},_.value))})]}),e.jsx("div",{className:"flex-1"}),K?e.jsx("button",{onClick:a,className:"w-8 h-8 flex items-center justify-center rounded-lg bg-danger/80 text-white hover:bg-danger transition-all cursor-pointer shadow-lg shadow-danger/20 flex-shrink-0",title:"Stop generation",children:e.jsx(Gr,{size:14,fill:"currentColor"})}):e.jsx("button",{onClick:I,disabled:!G,className:V("w-8 h-8 flex items-center justify-center rounded-lg transition-all cursor-pointer flex-shrink-0","disabled:opacity-20 disabled:cursor-not-allowed",G?"bg-accent/15 text-accent hover:bg-accent/25 border border-accent/25":"bg-surface-4 text-text-4"),children:n?e.jsx($e,{size:14,className:"animate-spin"}):e.jsx(Xa,{size:14})})]})]})]})}function _Xe({onNewChat:t}){return e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("h1",{className:"text-lg font-semibold text-text-1 font-sans",children:"Groove Chat"}),e.jsx("p",{className:"text-sm text-text-3 font-sans",children:"Every provider, every model, full project context."}),e.jsxs("button",{onClick:t,className:"inline-flex items-center gap-2 h-9 px-5 rounded-lg bg-accent/15 text-accent text-sm font-semibold font-sans hover:bg-accent/25 transition-colors cursor-pointer border border-accent/20",children:[e.jsx(ht,{size:14}),"New Chat"]})]})})}function LXe(){const t=$(ce=>ce.conversations),a=$(ce=>ce.activeConversationId),n=$(ce=>ce.conversationMessages),s=$(ce=>ce.sendingMessage),o=$(ce=>ce.streamingConversationId),c=$(ce=>ce.createConversation);$(ce=>ce.setActiveConversation);const l=$(ce=>ce.sendChatMessage),A=$(ce=>ce.sendImageMessage),u=$(ce=>ce.stopAgent),f=$(ce=>ce.stopChatStreaming),x=$(ce=>ce.setConversationMode),m=$(ce=>ce.setConversationModel),y=$(ce=>ce.conversationRoles),v=$(ce=>ce.setConversationRole),O=$(ce=>ce.conversationReasoningEffort),b=$(ce=>ce.setConversationReasoningEffort),C=$(ce=>ce.conversationVerbosity),j=$(ce=>ce.setConversationVerbosity),[N,M]=g.useState(!1),[Q,L]=g.useState(null),[B,S]=g.useState(!1),I=a&&(y==null?void 0:y[a])||null,z=a&&(O==null?void 0:O[a])||"medium",P=a&&(C==null?void 0:C[a])||"medium",F=t.find(ce=>ce.id===a)||null,K=(F==null?void 0:F.provider)==="codex",G=a?n[a]||[]:[],H=o===a&&s,q=F?NL(F.model):!1,_=g.useCallback(async(ce,he)=>{try{await c(ce||null,he||null,"api")}catch{}},[c]),R=g.useCallback(async ce=>{if(!(!a||B)){S(!0);try{await x(a,ce)}finally{S(!1)}}},[a,x,B]),U=g.useCallback(ce=>{a&&v(a,ce)},[a,v]),Z=g.useCallback(ce=>{if(a)if(q){const he=Q?`${ce} (iterating on: "${Q.prompt}")`:ce;A(a,he,{model:F.model}),L(null)}else l(a,ce)},[a,F,q,Q,l,A]),J=g.useCallback(()=>{F&&(F.mode==="agent"&&F.agentId?u(F.agentId):f(a))},[F,a,u,f]),Ae=g.useCallback(async ce=>{a?await m(a,ce.provider,ce.model):await _(ce.provider,ce.model)},[a,m,_]),W=g.useCallback(ce=>{L(ce)},[]),ae=g.useCallback(ce=>{a&&b(a,ce)},[a,b]),Oe=g.useCallback(ce=>{a&&j(a,ce)},[a,j]),ve=F?{provider:F.provider,model:F.model}:null;return e.jsxs("div",{className:"flex h-full bg-surface-0",children:[e.jsx("div",{className:V("relative flex-shrink-0 border-r border-accent/12 bg-surface-1 transition-all duration-200 overflow-hidden",N?"w-0 border-r-0":"w-64"),children:e.jsx(xXe,{onNewChat:()=>_(),onCollapse:()=>M(!0)})}),e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[N&&e.jsx("button",{onClick:()=>M(!1),className:"absolute top-3 left-2 z-10 w-7 h-7 flex items-center justify-center rounded-md text-text-3 hover:text-text-0 hover:bg-surface-3 transition-colors cursor-pointer",title:"Show sidebar",children:e.jsx(xs,{size:15})}),F?e.jsxs(e.Fragment,{children:[e.jsx(mXe,{conversation:F,model:ve,onModelChange:Ae,role:I,onRoleChange:U,sidebarCollapsed:N}),e.jsx(SXe,{messages:G,isStreaming:H,model:F.model,mode:F.mode||"api",onImageReply:W,role:I}),e.jsx(XX,{onSend:Z,onStop:J,sending:s,streaming:H,disabled:!1,isImageModel:q,currentModel:F.model,replyContext:Q,onClearReply:()=>L(null),role:I,isCodex:K,reasoningEffort:z,onReasoningEffortChange:ae,verbosity:P,onVerbosityChange:Oe,mode:(F==null?void 0:F.mode)||"api",onModeChange:R,modeChanging:B})]}):e.jsxs(e.Fragment,{children:[e.jsx(_Xe,{onNewChat:()=>_()}),e.jsx(XX,{onSend:ce=>{_().then(()=>{setTimeout(()=>{const he=$.getState().activeConversationId;he&&l(he,ce)},500)})},onStop:()=>{},sending:!1,streaming:!1,disabled:!1,isImageModel:!1,currentModel:null})]})]})]})}function TXe(){return e.jsx(LXe,{})}function $Xe(){return e.jsx(KW,{})}const bE=[];function Mee(t){const a=(t||"").toLowerCase();return a.includes("reading")||a.includes("read ")?{icon:na,color:"text-info",label:"Reading"}:a.includes("editing")||a.includes("wrote")||a.includes("writing")||a.includes("edit ")?{icon:ps,color:"text-warning",label:"Editing"}:a.includes("searching")||a.includes("search")||a.includes("grep")||a.includes("glob")?{icon:oa,color:"text-purple",label:"Searching"}:a.includes("running")||a.includes("bash")||a.includes("command")||a.includes("exec")?{icon:Ns,color:"text-orange",label:"Running"}:a.includes("test")||a.includes("pass")?{icon:Hn,color:"text-success",label:"Testing"}:a.includes("error")||a.includes("fail")||a.includes("crash")?{icon:Xt,color:"text-danger",label:"Error"}:a.includes("rotat")?{icon:Vr,color:"text-accent",label:"Rotating"}:a.includes("spawn")||a.includes("start")?{icon:wt,color:"text-success",label:"Spawned"}:a.includes("tool")||a.includes("function")?{icon:ju,color:"text-text-2",label:"Tool"}:a.includes("complet")||a.includes("done")||a.includes("finish")?{icon:Hn,color:"text-success",label:"Done"}:{icon:Zt,color:"text-text-3",label:"Activity"}}function G1({text:t}){return t?t.split(/(\*\*[^*]+\*\*|`[^`]+`)/g).map((a,n)=>a.startsWith("**")&&a.endsWith("**")?e.jsx("strong",{className:"font-semibold text-text-0",children:a.slice(2,-2)},n):a.startsWith("`")&&a.endsWith("`")?e.jsx("code",{className:"px-1 py-px rounded bg-accent/8 text-[11px] font-mono text-accent",children:a.slice(1,-1)},n):e.jsx("span",{children:a},n)):null}function IXe({text:t}){if(!t)return null;const a=[],n=t.split(`
8685
8685
  `);let s=0;for(;s<n.length;){const o=n[s];if(o.trimStart().startsWith("```")){const l=[],A=o.trim().slice(3);for(s++;s<n.length&&!n[s].trimStart().startsWith("```");)l.push(n[s]),s++;s++,a.push({type:"code",content:l.join(`
8686
- `),lang:A});continue}if(/^#{1,3}\s/.test(o)||/^\*\*[^*]+:\*\*\s*$/.test(o.trim())){const l=o.replace(/^#+\s*/,"").replace(/^\*\*/,"").replace(/:\*\*\s*$/,":").trim();a.push({type:"heading",content:l}),s++;continue}if(/^\s*[-*]\s/.test(o)){const l=[];for(;s<n.length&&/^\s*[-*]\s/.test(n[s]);)l.push(n[s].replace(/^\s*[-*]\s+/,"").trim()),s++;a.push({type:"list",items:l});continue}if(/^\s*\d+[\.)]\s/.test(o)){const l=[];for(;s<n.length&&/^\s*\d+[\.)]\s/.test(n[s]);)l.push(n[s].replace(/^\s*\d+[\.)]\s+/,"").trim()),s++;a.push({type:"numbered",items:l});continue}if(o.includes("|")&&s+1<n.length&&/^\|?\s*[-:]+/.test(n[s+1])){const l=o.split("|").map(u=>u.trim()).filter(Boolean);s+=2;const A=[];for(;s<n.length&&n[s].includes("|");)A.push(n[s].split("|").map(u=>u.trim()).filter(Boolean)),s++;a.push({type:"table",headers:l,rows:A});continue}if(!o.trim()){s++;continue}if(/^(Note|Warning|Important|IMPORTANT|TODO):/i.test(o.trim())){a.push({type:"note",content:o.trim()}),s++;continue}const c=[];for(;s<n.length&&n[s].trim()&&!/^#{1,3}\s/.test(n[s])&&!/^\s*[-*]\s/.test(n[s])&&!/^\s*\d+[\.)]\s/.test(n[s])&&!n[s].trimStart().startsWith("```");)c.push(n[s].trim()),s++;c.length>0&&a.push({type:"para",content:c.join(" ")})}return e.jsx("div",{className:"space-y-2",children:a.map((o,c)=>{switch(o.type){case"heading":return e.jsxs("div",{className:"flex items-center gap-1.5 pt-1.5 first:pt-0",children:[e.jsx("div",{className:"w-1 h-3.5 rounded-full bg-accent/40 flex-shrink-0"}),e.jsx("span",{className:"text-[12px] font-semibold text-text-0 font-sans",children:e.jsx(G1,{text:o.content})})]},c);case"list":return e.jsx("div",{className:"space-y-1 pl-2",children:o.items.map((l,A)=>e.jsxs("div",{className:"flex gap-2 text-[12px] text-text-0 font-sans leading-relaxed",children:[e.jsx("span",{className:"text-accent/50 mt-0.5 flex-shrink-0",children:"-"}),e.jsx("span",{className:"min-w-0",children:e.jsx(G1,{text:l})})]},A))},c);case"numbered":return e.jsx("div",{className:"space-y-1 pl-2",children:o.items.map((l,A)=>e.jsxs("div",{className:"flex gap-2 text-[12px] text-text-0 font-sans leading-relaxed",children:[e.jsxs("span",{className:"text-text-4 font-mono w-4 text-right flex-shrink-0",children:[A+1,"."]}),e.jsx("span",{className:"min-w-0",children:e.jsx(G1,{text:l})})]},A))},c);case"code":return e.jsx("pre",{className:"p-2.5 rounded-md bg-[#0d1117] text-[11px] font-mono text-[#c9d1d9] overflow-x-auto whitespace-pre-wrap border border-white/[0.06] leading-relaxed",children:o.content},c);case"table":return e.jsx(sz,{headers:o.headers,rows:o.rows},c);case"note":return e.jsxs("div",{className:"flex items-start gap-1.5 px-2.5 py-1.5 rounded-md bg-warning/6 border border-warning/12",children:[e.jsx(Xt,{size:10,className:"text-warning mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-[11px] text-warning/80 font-sans",children:e.jsx(G1,{text:o.content})})]},c);case"para":default:return e.jsx("p",{className:"text-[12px] text-text-0 font-sans leading-relaxed",children:e.jsx(G1,{text:o.content})},c)}})})}function UXe({text:t}){if(!t)return null;const a=t.split(/(```[\s\S]*?```)/g);return e.jsx("span",{children:a.map((n,s)=>{if(n.startsWith("```")&&n.endsWith("```")){const o=n.slice(3,-3).replace(/^\w+\n/,"");return e.jsx("pre",{className:"my-1.5 p-2 rounded-md bg-[#0d1117] text-[11px] font-mono text-[#c9d1d9] overflow-x-auto whitespace-pre-wrap border border-white/[0.06]",children:o},s)}return e.jsx("span",{children:e.jsx(G1,{text:n})},s)})})}function PXe({msg:t}){const a=t.isQuery;return e.jsx("div",{className:"flex justify-end pl-8",children:e.jsxs("div",{className:"max-w-[90%]",children:[a&&e.jsxs("div",{className:"flex items-center justify-end gap-1 mb-1",children:[e.jsx(Na,{size:9,className:"text-info"}),e.jsx("span",{className:"text-2xs text-info font-sans font-medium",children:"Query"})]}),e.jsx("div",{className:V("px-3.5 py-2.5 rounded-lg border","bg-info/10 border-info/25"),children:e.jsx("div",{className:"text-[12px] font-sans whitespace-pre-wrap break-words leading-relaxed text-text-0",children:e.jsx(UXe,{text:t.text})})}),e.jsx("div",{className:"text-[10px] text-text-4 font-sans mt-1 text-right",children:Mt(t.timestamp)})]})})}function EXe({msg:t,agent:a}){var c,l;const[n,s]=g.useState(((c=t.text)==null?void 0:c.length)>600),o=((l=t.text)==null?void 0:l.length)>600;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-1 font-sans",children:(a==null?void 0:a.name)||"Agent"}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:a==null?void 0:a.role}),e.jsx("span",{className:"text-[10px] text-text-4 font-sans ml-auto",children:Mt(t.timestamp)})]}),e.jsx("div",{className:"border-l border-accent pl-3.5 py-1",children:e.jsx(IXe,{text:n?t.text.slice(0,600)+"...":t.text})}),n&&e.jsxs("button",{onClick:()=>s(!1),className:"ml-3.5 mt-1.5 flex items-center gap-1.5 text-[11px] text-accent/70 hover:text-accent font-sans font-medium cursor-pointer transition-colors",children:[e.jsx(bt,{size:11}),"Show full response"]}),o&&!n&&e.jsxs("button",{onClick:()=>s(!0),className:"ml-3.5 mt-1.5 flex items-center gap-1.5 text-[11px] text-accent/70 hover:text-accent font-sans font-medium cursor-pointer transition-colors",children:[e.jsx(bt,{size:11,className:"rotate-180"}),"Collapse"]})]})}function zXe({msg:t}){return e.jsxs("div",{className:"flex items-center gap-3 py-2",children:[e.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),e.jsx("span",{className:"text-[10px] text-text-4 font-sans flex-shrink-0 uppercase tracking-wide",children:t.text}),e.jsx("div",{className:"flex-1 h-px bg-border-subtle"})]})}function FXe({entries:t,isLive:a}){const[n,s]=g.useState(0);if(g.useEffect(()=>{if(!a||t.length<=1)return;const c=setInterval(()=>s(l=>(l+1)%t.length),1500);return()=>clearInterval(c)},[t.length,a]),!a){const c=t[t.length-1],A=Mee(c.text).icon;return e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 text-[10px] text-text-4 font-mono",children:[e.jsx(A,{size:10,className:"opacity-50"}),e.jsxs("span",{children:[t.length," tool call",t.length!==1?"s":""]})]})}const o=t[Math.min(n,t.length-1)];return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 w-full rounded-md bg-surface-3/50 border border-border-subtle/30",children:[e.jsx($e,{size:11,className:"text-accent animate-spin flex-shrink-0"}),e.jsx("span",{className:"text-[11px] text-text-2 font-mono truncate min-w-0 flex-1 transition-opacity duration-300",children:o.text}),t.length>1&&e.jsx("span",{className:"text-[10px] text-text-4 font-mono flex-shrink-0",children:t.length})]})}function RXe({agent:t}){const a=$(u=>u.activityLog[t.id])||bE,n=a[a.length-1],s=n?Mee(n.text):null,o=(s==null?void 0:s.icon)||Zt,c=n&&Date.now()-n.timestamp<1e4,l=c&&n.text?n.text.length>60?n.text.slice(0,60)+"...":n.text:null,A=Math.round((t.contextUsage||0)*100);return e.jsxs("div",{className:"flex items-center gap-3 px-4 h-8 border-b border-border-subtle bg-surface-1/80 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("span",{className:"absolute inset-0 rounded-full bg-accent/15 animate-ping",style:{animationDuration:"2s"}}),e.jsx("span",{className:"relative w-1.5 h-1.5 rounded-full bg-accent"})]}),c?e.jsxs(e.Fragment,{children:[e.jsx(o,{size:10,className:V(s.color,"flex-shrink-0")}),e.jsx("span",{className:"text-[11px] text-text-2 font-sans truncate",children:l})]}):e.jsx("span",{className:"text-[11px] text-text-3 font-sans",children:"Working..."})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-[10px] text-text-4 font-mono",children:HXe(t.tokensUsed)}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-14 h-0.5 rounded-sm bg-surface-4 overflow-hidden",children:e.jsx("div",{className:"h-full rounded-sm transition-all duration-500",style:{width:`${A}%`,background:A>=75?"var(--color-danger)":A>=50?"var(--color-warning)":"var(--color-accent)"}})}),e.jsxs("span",{className:"text-[10px] text-text-4 font-mono w-7 text-right",children:[A,"%"]})]})]})]})}function HXe(t){return t?t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":String(t):"0"}function qXe({agent:t}){const[a,n]=g.useState([]),s=[{text:`Initializing ${t.name}`,delay:0},{text:`Role: ${t.role}`,delay:400},{text:`Provider: ${t.provider||"claude-code"}`,delay:700},{text:"Loading workspace context",delay:1e3},{text:"Scanning project structure",delay:1400},{text:"Session active",delay:1900}];return g.useEffect(()=>{const o=s.map((c,l)=>setTimeout(()=>n(A=>[...A,l]),c.delay));return()=>o.forEach(clearTimeout)},[]),e.jsxs("div",{className:"flex flex-col px-4 pt-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsxs("div",{className:"relative w-9 h-9",children:[e.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-accent/20 animate-ping",style:{animationDuration:"2s"}}),e.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-accent animate-spin",style:{animationDuration:"1s"}}),e.jsx("span",{className:"absolute inset-[5px] rounded-full bg-accent/8"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-text-0 font-sans",children:t.name}),e.jsx("p",{className:"text-2xs text-accent font-mono",children:"starting up"})]})]}),e.jsx("div",{className:"space-y-2 pl-3 border-l border-accent/15",children:s.map((o,c)=>{const l=a.includes(c),A=c===s.length-1;return e.jsxs("div",{className:V("flex items-center gap-2.5 transition-all duration-300",l?"opacity-100 translate-x-0":"opacity-0 -translate-x-2"),children:[e.jsx("span",{className:V("w-1 h-1 rounded-full flex-shrink-0",A&&l?"bg-accent":l?"bg-text-3":"bg-transparent")}),e.jsx("span",{className:V("text-[11px] font-mono",A&&l?"text-accent":"text-text-3"),children:o.text}),A&&l&&e.jsxs("span",{className:"flex gap-0.5 ml-1",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-accent animate-pulse",style:{animationDelay:"0ms"}}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-accent animate-pulse",style:{animationDelay:"200ms"}}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-accent animate-pulse",style:{animationDelay:"400ms"}})]})]},c)})})]})}function DXe({agent:t}){const a=$(F=>F.chatHistory[t.id])||bE,n=$(F=>F.activityLog[t.id])||bE,s=$(F=>F.instructAgent),o=$(F=>F.queryAgent),c=$(F=>{var K;return(K=F.thinkingAgents)==null?void 0:K.has(t.id)}),l=$(F=>F.chatInputs[t.id]||""),A=F=>$.setState(K=>({chatInputs:{...K.chatInputs,[t.id]:F}})),u=l,f=A,[x,m]=g.useState("instruct"),[y,v]=g.useState(!1),[O,b]=g.useState(36),C=g.useRef(null),j=g.useRef(null),N=g.useRef(null),M=g.useRef(null),Q=g.useRef(!0);g.useEffect(()=>{const F=j.current;if(!F)return;function K(){Q.current=F.scrollHeight-F.scrollTop-F.clientHeight<60}return F.addEventListener("scroll",K),()=>F.removeEventListener("scroll",K)},[]);const L=g.useCallback(F=>{F.preventDefault();const K=F.clientY,G=O,H=_=>b(Math.min(Math.max(36,G-(_.clientY-K)),280)),q=()=>{window.removeEventListener("mousemove",H),window.removeEventListener("mouseup",q)};window.addEventListener("mousemove",H),window.addEventListener("mouseup",q)},[O]),B=g.useMemo(()=>{var R;const F=[],K=new Set;for(const U of a){const Z=`${U.from}:${(R=U.text)==null?void 0:R.slice(0,100)}`;F.find(Ae=>{var W;return Ae.kind==="chat"&&`${Ae.from}:${(W=Ae.text)==null?void 0:W.slice(0,100)}`===Z&&Math.abs(Ae.ts-U.timestamp)<5e3})||(F.push({...U,kind:"chat",ts:U.timestamp}),K.add(U.text))}const G=K,H=n.slice(-30);for(const U of H)(U.text||"").trim()&&!G.has(U.text)&&F.push({...U,kind:"activity",ts:U.timestamp});F.sort((U,Z)=>U.ts-Z.ts);const q=[];let _=[];for(const U of F)U.kind==="activity"?_.push(U):(_.length>0&&(q.push({kind:"activity-group",entries:_}),_=[]),q.push(U));return _.length>0&&q.push({kind:"activity-group",entries:_}),q},[a,n]);g.useEffect(()=>{Q.current&&j.current&&requestAnimationFrame(()=>{j.current&&(j.current.scrollTop=j.current.scrollHeight)})},[B.length]);async function S(F){var q;const K=Array.from(F.target.files||[]);if(K.length===0)return;const G=$.getState().addToast,H=[];for(const _ of K)try{const R=await new Promise((U,Z)=>{const J=new FileReader;J.onload=()=>U(J.result.split(",")[1]),J.onerror=Z,J.readAsDataURL(_)});await D.post(`/agents/${t.id}/upload`,{filename:_.name,content:R}),H.push(_.name)}catch(R){G("error",`Upload failed: ${_.name}`,R.message)}if(H.length>0){const _=H.join(", ");f(R=>(R?R+`
8687
- `:"")+`[Uploaded: ${_}] — I've uploaded these files to your working directory. Read them and use their content.`),G("success",`Uploaded ${H.length} file${H.length>1?"s":""}`)}F.target.value="",(q=N.current)==null||q.focus()}async function I(){var K;const F=u.trim();if(!(!F||y)){if(F==="/rotate"){const G=$.getState().rotateAgent;f("");try{await G(t.id)}catch{}return}f(""),v(!0);try{x==="query"?await o(t.id,F):await s(t.id,F)}catch{}v(!1),(K=N.current)==null||K.focus()}}function z(F){F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),I())}const P=t.status==="running"||t.status==="starting";return e.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[P&&e.jsx(RXe,{agent:t}),e.jsxs("div",{ref:j,className:"flex-1 overflow-y-auto px-4 py-4 space-y-4",children:[!B.some(F=>F.from==="agent"||F.kind==="activity-group")&&(P?e.jsx(qXe,{agent:t}):e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center py-8",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-surface-3 flex items-center justify-center mb-3",children:e.jsx(Cn,{size:18,className:"text-text-4"})}),e.jsx("p",{className:"text-sm font-semibold text-text-0 font-sans",children:t.name}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Session complete — send a message to continue"})]})),B.map((F,K)=>{if(F.kind==="activity-group"){const G=!B.slice(K+1).some(H=>H.kind==="activity-group"||H.from==="agent");return e.jsx("div",{children:e.jsx(FXe,{entries:F.entries,isLive:P&&G})},`grp-${K}`)}return F.from==="user"?e.jsx(PXe,{msg:F},`msg-${K}`):F.from==="system"?e.jsx(zXe,{msg:F},`msg-${K}`):e.jsx(EXe,{msg:F,agent:t},`msg-${K}`)}),e.jsx(Pu,{children:(y||c)&&e.jsx(as.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.25,ease:"easeOut"},children:e.jsx(Cee,{agent:t})},"thinking")})]}),e.jsxs("div",{className:"bg-surface-1/50 flex-shrink-0",children:[e.jsx("div",{ref:C,onMouseDown:L,className:"flex items-center justify-center h-5 cursor-row-resize border-t border-border hover:bg-surface-3/50 transition-colors group",children:e.jsx(lu,{size:12,className:"text-text-4 group-hover:text-text-2 transition-colors"})}),e.jsxs("div",{className:"px-4 pb-3",children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2",children:[e.jsxs("button",{onClick:()=>m("instruct"),className:V("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[11px] font-sans font-medium transition-colors cursor-pointer",x==="instruct"?"bg-accent/12 text-accent border border-accent/20":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:[e.jsx(js,{size:10}),"Instruct"]}),e.jsxs("button",{onClick:()=>m("query"),className:V("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[11px] font-sans font-medium transition-colors cursor-pointer",x==="query"?"bg-info/12 text-info border border-info/20":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:[e.jsx(Na,{size:10}),"Query"]}),e.jsx("span",{className:"text-[10px] text-text-4 font-sans ml-auto",children:x==="query"?"Read-only — agent keeps working":P?"Directs the agent":"Continues the session"})]}),e.jsxs("div",{className:V("flex items-end gap-1 rounded-xl border bg-surface-0 p-1 transition-colors",x==="query"?"border-info/20 focus-within:border-info/40":"border-border-subtle focus-within:border-accent/30"),children:[e.jsx("input",{ref:M,type:"file",multiple:!0,accept:".pdf,.png,.jpg,.jpeg,.gif,.svg,.csv,.txt,.md,.json,.yaml,.yml,.docx,.pptx,.xlsx",onChange:S,className:"hidden"}),e.jsx("button",{onClick:()=>{var F;return(F=M.current)==null?void 0:F.click()},className:"w-9 h-9 flex items-center justify-center rounded-lg text-text-4 hover:text-text-1 hover:bg-surface-3 transition-colors cursor-pointer flex-shrink-0 mb-px",title:"Attach file",children:e.jsx(mu,{size:14})}),e.jsx("textarea",{ref:N,value:u,onChange:F=>f(F.target.value),onKeyDown:z,placeholder:x==="query"?"Ask about this agent's work...":P?"Send an instruction...":"Continue this session...",rows:1,className:V("flex-1 resize-none px-3 py-2 text-[13px]","bg-transparent text-text-0 font-sans","placeholder:text-text-4","focus:outline-none"),style:{height:O}}),P&&e.jsx("button",{onClick:()=>$.getState().stopAgent(t.id),title:"Stop agent",className:"w-9 h-9 flex items-center justify-center rounded-lg hover:bg-danger/10 transition-colors cursor-pointer flex-shrink-0 mb-px",children:e.jsxs("span",{className:"relative flex items-center justify-center w-3.5 h-3.5",children:[e.jsx("span",{className:"absolute inset-0 rounded-full bg-danger/30 animate-ping",style:{animationDuration:"2s"}}),e.jsx("span",{className:"relative w-2.5 h-2.5 rounded-full bg-danger"})]})}),e.jsx("button",{onClick:I,disabled:!u.trim()||y,className:V("w-9 h-9 flex items-center justify-center rounded-lg transition-all cursor-pointer flex-shrink-0 mb-px","disabled:opacity-15 disabled:cursor-not-allowed",u.trim()?x==="query"?"bg-info/15 text-info hover:bg-info/25 border border-info/25":"bg-accent/15 text-accent hover:bg-accent/25 border border-accent/25":"bg-transparent text-text-4"),children:y?e.jsx($e,{size:15,className:"animate-spin"}):e.jsx(Xa,{size:15})})]})]})]})]})}function jf({options:t,value:a,onChange:n}){return e.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:t.map(s=>e.jsx("button",{onClick:()=>n(s.value),className:V("flex-1 px-3 py-1.5 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",a===s.value?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:s.label},s.value))})}function nn({label:t,icon:a,children:n,description:s}){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-semibold text-text-1 font-sans",children:[a&&e.jsx(a,{size:13,className:"text-text-3"}),t]}),s&&e.jsx("p",{className:"text-2xs text-text-4 font-sans mt-0.5",children:s})]}),n]})}function VXe({agent:t}){const a=$(O=>O.killAgent),n=$(O=>O.rotateAgent),s=$(O=>O.spawnAgent),o=$(O=>O.closeDetail),c=$(O=>O.addToast),[l,A]=g.useState(null),[u,f]=g.useState(!1),x=t.status==="running"||t.status==="starting";async function m(){A("rotate");try{await n(t.id)}catch{}A(null)}async function y(){if(!u){f(!0),setTimeout(()=>f(!1),3e3);return}A("kill");try{await a(t.id,!x),o()}catch{}A(null),f(!1)}async function v(){A("clone");try{await s({role:t.role,provider:t.provider,model:t.model,name:`${t.name}-clone`,scope:t.scope,workingDir:t.workingDir}),c("success",`Cloned ${t.name}`)}catch{}A(null)}return x?e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs(fe,{variant:"primary",size:"md",onClick:m,disabled:l==="rotate",className:"gap-1.5",children:[e.jsx(Vr,{size:12,className:l==="rotate"?"animate-spin":""}),"Rotate"]}),e.jsxs(fe,{variant:"info",size:"md",onClick:v,disabled:!!l,className:"gap-1.5",children:[e.jsx(wn,{size:12})," Clone"]}),e.jsxs(fe,{variant:"danger",size:"md",onClick:y,disabled:l==="kill",className:"gap-1.5",children:[e.jsx($A,{size:12}),u?"Confirm":"Kill"]})]})}):e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs(fe,{variant:"info",size:"md",onClick:v,disabled:!!l,className:"gap-1.5",children:[e.jsx(wn,{size:12})," Clone"]}),e.jsxs(fe,{variant:"danger",size:"md",onClick:y,disabled:l==="kill",className:"gap-1.5",children:[e.jsx(At,{size:12}),u?"Confirm":"Remove"]})]})}function XXe({agent:t}){var Wt;const a=$(se=>se.addToast),n=$(se=>se.remoteHomedir),[s,o]=g.useState([]),[c,l]=g.useState(t.model||""),[A,u]=g.useState(""),[f,x]=g.useState(t.effort||"default"),[m,y]=g.useState(!1),[v,O]=g.useState(""),[b,C]=g.useState(null),[j,N]=g.useState(!1),[M,Q]=g.useState(null),[L,B]=g.useState(t.routingMode||"auto"),[S,I]=g.useState([]),[z,P]=g.useState([]),[F,K]=g.useState("hr"),[G,H]=g.useState("1"),[q,_]=g.useState(!1),[R,U]=g.useState(""),[Z,J]=g.useState(!1),[Ae,W]=g.useState([]),[ae,Oe]=g.useState(!1),[ve,ce]=g.useState([]),[he,je]=g.useState(null),ee=t.status==="running"||t.status==="starting";g.useEffect(()=>{ke(),D.get("/skills/installed").then(Me=>I(Array.isArray(Me)?Me:Me.skills||[])).catch(()=>{}),D.get("/integrations/installed").then(Me=>ce(Array.isArray(Me)?Me:[])).catch(()=>{}),D.get("/repos/imported").then(Me=>P((Array.isArray(Me)?Me:[]).filter(ie=>ie.status==="active"))).catch(()=>{}),t.provider==="claude-code"&&D.get("/providers/claude-code/auth").then(Me=>je(Me)).catch(()=>je(null));function se(){ke()}return window.addEventListener("groove:providers-changed",se),()=>window.removeEventListener("groove:providers-changed",se)},[]);function ke(){D.get("/providers").then(se=>o(Array.isArray(se)?se:[])).catch(()=>{})}g.useEffect(()=>{l(t.model||""),D.get(`/agents/${t.id}/routing/recommend`).then(se=>{B((se==null?void 0:se.mode)||"fixed")}).catch(()=>{})},[t.id,t.model]),g.useEffect(()=>{J(!1),t.personality?D.get(`/personalities/${t.name}`).then(se=>{U((se==null?void 0:se.content)||""),J(!0)}).catch(()=>{U(""),J(!0)}):(U(""),J(!0)),D.get("/personalities").then(se=>{W(Array.isArray(se)?se:se.personalities||[])}).catch(()=>{})},[t.id,t.name]);const ye=s.find(se=>se.id===t.provider);async function Ne(se,Me){l(Me);try{const ie={model:Me};se&&se!==t.provider&&(ie.provider=se),await D.patch(`/agents/${t.id}`,ie),a("success",`Model → ${Me}${ie.provider?` (${se})`:""}`)}catch(ie){a("error","Model swap failed",ie.message)}}async function ze(se){try{await D.patch(`/agents/${t.id}`,{workingDir:se}),a("success",`Working dir → ${se.split("/").pop()||se}`)}catch(Me){a("error","Update failed",Me.message)}}async function He(se){x(se);try{await D.patch(`/agents/${t.id}`,{effort:se}),a("success",`Effort → ${se}`)}catch(Me){a("error","Update failed",Me.message)}}async function Tt(se){if(!se.trim())return;const Me=[...t.scope||[],se.trim()];try{await D.patch(`/agents/${t.id}`,{scope:Me}),u("")}catch(ie){a("error","Scope update failed",ie.message)}}async function Et(se){const Me=(t.scope||[]).filter((ie,Re)=>Re!==se);try{await D.patch(`/agents/${t.id}`,{scope:Me})}catch(ie){a("error","Scope update failed",ie.message)}}async function ya(se){if(v.trim())try{await D.post(`/credentials/${se}`,{key:v.trim()}),a("success",`API key set for ${se}`),O(""),C(null),ke(),window.dispatchEvent(new CustomEvent("groove:providers-changed"))}catch(Me){a("error","Failed to set key",Me.message)}}const Nn=t.spawnedAt||t.createdAt;return e.jsxs("div",{className:"px-5 py-5 space-y-6 overflow-y-auto h-full",children:[e.jsx(nn,{label:"Active Model",icon:Ba,children:e.jsxs("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-bold font-mono text-text-0",children:t.model||"auto"}),e.jsx("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:(ye==null?void 0:ye.name)||t.provider})]}),(ye==null?void 0:ye.canHotSwap)&&ee&&e.jsxs(be,{variant:"accent",className:"text-2xs gap-1",children:[e.jsx(wt,{size:8})," Hot-swap"]})]}),((Wt=ye==null?void 0:ye.models)==null?void 0:Wt.length)>1&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3 pt-3 border-t border-border-subtle",children:ye.models.filter(se=>!se.disabled).map(se=>{const Me=se.id===t.model;return e.jsx("button",{onClick:()=>Ne(t.provider,se.id),disabled:!1,className:V("px-2.5 py-1 rounded-md text-xs font-mono transition-all","cursor-pointer",Me?"bg-accent/15 text-accent font-semibold":"bg-surface-4 text-text-2 hover:bg-surface-5 hover:text-text-0"),children:se.name||se.id},se.id)})})]})}),e.jsx(VXe,{agent:t}),e.jsxs(nn,{label:"Providers",icon:Dn,description:"Click a provider to see its models and connection status.",children:[e.jsx("div",{className:"space-y-1.5",children:s.map(se=>{var St;const Me=se.id===t.provider,ie=se.authType==="subscription"?se.installed||((St=se.authStatus)==null?void 0:St.authenticated):se.authType==="local"?se.installed:se.installed&&se.hasKey,Re=M===se.id,xt=se.models||[];return e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-0 overflow-hidden",children:[e.jsxs("button",{onClick:()=>Q(Re?null:se.id),className:"w-full flex items-center gap-2.5 px-3 py-2 cursor-pointer hover:bg-surface-4/50 transition-colors",children:[e.jsx("div",{className:V("w-2 h-2 rounded-full flex-shrink-0",ie?"bg-success":"bg-text-4")}),e.jsx("span",{className:V("text-xs font-semibold font-sans flex-1 text-left",ie?"text-text-0":"text-text-3"),children:se.name||se.id}),Me&&e.jsx(be,{variant:"accent",className:"text-2xs",children:"Active"}),!ie&&e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:se.installed?"No key":"Not installed"}),e.jsx(bt,{size:12,className:V("text-text-4 transition-transform",Re&&"rotate-180")})]}),Re&&se.authType==="local"&&e.jsx("div",{className:"border-t border-border-subtle",children:e.jsx(vee,{isInstalled:ie,onModelChange:ke})}),Re&&se.authType!=="local"&&e.jsxs("div",{className:"border-t border-border-subtle",children:[(!ie||se.hasKey)&&e.jsx("div",{className:"px-3 py-2 bg-surface-1/50",children:b===se.id?e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx("input",{value:v,onChange:at=>O(at.target.value),onKeyDown:at=>at.key==="Enter"&&ya(se.id),type:j?"text":"password",placeholder:`${se.name||se.id} API key...`,className:"w-full h-7 px-2.5 pr-7 text-2xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:()=>N(!j),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:j?e.jsx(jn,{size:10}):e.jsx(na,{size:10})})]}),e.jsx(fe,{variant:"primary",size:"sm",onClick:()=>ya(se.id),disabled:!v.trim(),className:"h-7 px-2 text-2xs",children:"Save"}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{C(null),O("")},className:"h-7 px-2 text-2xs",children:"Cancel"})]}):e.jsxs("button",{onClick:()=>{C(se.id),O(""),N(!1)},className:"flex items-center gap-1.5 text-2xs text-text-3 hover:text-accent font-sans cursor-pointer transition-colors",children:[e.jsx(ws,{size:10}),ie?"Update API key":"Add API key to enable"]})}),ie&&xt.filter(at=>!at.disabled).length>0&&xt.filter(at=>!at.disabled).map(at=>{const va=se.id===t.provider&&at.id===t.model;return e.jsxs("button",{onClick:()=>Ne(se.id,at.id),disabled:!1,className:V("w-full flex items-center gap-2 px-3 py-2 text-left text-xs font-sans transition-colors","border-t border-border-subtle","cursor-pointer hover:bg-surface-4/50",va?"text-accent":"text-text-2"),children:[va?e.jsx(De,{size:11,className:"text-accent flex-shrink-0"}):e.jsx("div",{className:"w-[11px]"}),e.jsx("span",{className:"font-mono flex-1 truncate",children:at.name||at.id}),e.jsx(be,{variant:va?"accent":"default",className:"text-2xs",children:at.tier})]},at.id)})]})]},se.id)})}),ee&&e.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-3 font-sans mt-1.5",children:[e.jsx(Xt,{size:10}),e.jsx("span",{children:"Model changes apply on next rotation or respawn."})]})]}),t.provider==="claude-code"&&he&&!he.authenticated&&e.jsxs("div",{className:"rounded-lg border border-warning/30 bg-warning/5 px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xt,{size:13,className:"text-warning flex-shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:"Claude Code is not signed in"})]}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Open the terminal and run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"claude"})]})]}),t.provider==="claude-code"&&(he==null?void 0:he.authenticated)&&e.jsxs("div",{className:"flex items-center gap-2 text-2xs text-text-2 font-sans",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-success flex-shrink-0"}),"Signed in as ",he.email||"Claude user"," (",he.subscriptionType||"subscription",")"]}),e.jsx(nn,{label:"Working Directory",icon:ga,description:"The root directory this agent operates in.",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"flex-1 bg-surface-0 rounded-lg px-3 py-2.5 text-sm font-mono text-text-1 border border-border-subtle truncate min-w-0",children:t.workingDir||"Project root"}),e.jsxs(fe,{variant:"secondary",size:"md",onClick:()=>y(!0),className:"gap-1.5 flex-shrink-0",children:[e.jsx(SA,{size:14})," Browse"]})]})}),e.jsx(nn,{label:"Permission Mode",icon:La,description:"Full Send = no approvals. Agent Approve = Fullstack Manager reviews risky operations.",children:e.jsx(jf,{options:[{value:"full",label:"Full Send"},{value:"auto",label:"Agent Approve"}],value:t.permission||"full",onChange:async se=>{try{await D.patch(`/agents/${t.id}`,{permission:se}),a("success",`Permission → ${se==="full"?"Full Send":"Agent Approve"}`)}catch(Me){a("error","Update failed",Me.message)}}})}),e.jsxs(nn,{label:"Model Routing",icon:Ys,description:"How Groove selects models for this agent's tasks.",children:[e.jsx(jf,{options:[{value:"fixed",label:"Fixed"},{value:"auto",label:"Auto"},{value:"auto-floor",label:"Auto + Floor"}],value:L,onChange:async se=>{B(se);try{await D.post(`/agents/${t.id}/routing`,{mode:se}),a("success",`Routing → ${se}`)}catch(Me){a("error","Update failed",Me.message)}}}),e.jsxs("div",{className:"text-2xs text-text-4 font-sans mt-1",children:[L==="fixed"&&"Uses the selected model for all tasks.",L==="auto"&&"Groove picks Opus/Sonnet/Haiku based on task complexity.",L==="auto-floor"&&"Auto-routes but never drops below Sonnet."]})]}),e.jsx(nn,{label:"File Scope",icon:La,description:"Restrict which files this agent can access. Empty = unrestricted.",children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[(t.scope||[]).map((se,Me)=>e.jsxs(be,{variant:"default",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[se,e.jsx("button",{onClick:()=>Et(Me),className:"hover:text-danger cursor-pointer",children:e.jsx(Ge,{size:10})})]},Me)),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("input",{value:A,onChange:se=>u(se.target.value),onKeyDown:se=>se.key==="Enter"&&Tt(A),placeholder:"e.g. src/**",className:"w-28 h-7 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsx("button",{onClick:()=>Tt(A),disabled:!A.trim(),className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:e.jsx(ht,{size:12})})]})]})}),e.jsx(nn,{label:"Effort Level",icon:x0,description:"Controls how deep the agent reasons. Higher = more tokens but better results.",children:e.jsx(jf,{options:[{value:"min",label:"Min"},{value:"low",label:"Low"},{value:"default",label:"Default"},{value:"high",label:"High"},{value:"max",label:"Max"}],value:f,onChange:He})}),e.jsx(nn,{label:"Agent Details",icon:Dn,children:e.jsxs("div",{className:"bg-surface-0 rounded-lg border border-border-subtle divide-y divide-border-subtle",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"ID"}),e.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.id})]}),e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Role"}),e.jsx("span",{className:"text-xs text-text-1 font-sans capitalize",children:t.role})]}),e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Provider"}),e.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.provider})]}),e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Model"}),e.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.model||"auto"})]}),e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Status"}),e.jsx("span",{className:"text-xs text-text-1 font-sans capitalize",children:t.status})]}),e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Spawned"}),e.jsx("span",{className:"text-xs text-text-1 font-sans",children:Nn?Mt(Nn):"—"})]}),t.sessionId&&e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Session"}),e.jsxs("span",{className:"text-xs text-text-1 font-mono",children:[t.sessionId.slice(0,16),"..."]})]})]})}),e.jsx(nn,{label:"Skills",icon:It,description:"Attach installed skills to this agent's context.",children:e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(t.skills||[]).map(se=>e.jsxs(be,{variant:"accent",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[se,e.jsx("button",{onClick:async()=>{try{await D.delete(`/agents/${t.id}/skills/${se}`),a("success",`Detached ${se}`)}catch(Me){a("error","Detach failed",Me.message)}},className:"hover:text-danger cursor-pointer",children:e.jsx(Ge,{size:10})})]},se)),S.filter(se=>!(t.skills||[]).includes(se.id)).length>0&&e.jsxs("div",{className:"relative group",children:[e.jsx("button",{className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer transition-colors",children:e.jsx(ht,{size:12})}),e.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 hidden group-hover:block bg-surface-2 border border-border-subtle rounded-lg shadow-xl py-1 min-w-[160px]",children:S.filter(se=>!(t.skills||[]).includes(se.id)).map(se=>e.jsx("button",{onClick:async()=>{try{await D.post(`/agents/${t.id}/skills/${se.id}`),a("success",`Attached ${se.name||se.id}`)}catch(Me){a("error","Attach failed",Me.message)}},className:"w-full text-left px-3 py-1.5 text-xs font-sans text-text-1 hover:bg-surface-4 cursor-pointer transition-colors",children:se.name||se.id},se.id))})]}),(t.skills||[]).length===0&&S.length===0&&e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"No skills installed — browse the Marketplace"})]})}),e.jsxs(nn,{label:"Integrations",icon:da,description:"Attach MCP integrations for external services.",children:[e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(t.integrations||[]).map(se=>{const Me=zA[se],ie=ve.find(Re=>Re.id===se);return e.jsxs(be,{variant:"accent",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[Me?e.jsx("img",{src:Me,alt:"",className:"w-2.5 h-2.5"}):e.jsx(da,{size:9}),(ie==null?void 0:ie.name)||se,e.jsx("button",{onClick:async()=>{try{await D.delete(`/agents/${t.id}/integrations/${se}`),a("success",`Detached ${(ie==null?void 0:ie.name)||se}`)}catch(Re){a("error","Detach failed",Re.message)}},className:"hover:text-danger cursor-pointer",children:e.jsx(Ge,{size:10})})]},se)}),ve.filter(se=>se.configured!==!1&&!(t.integrations||[]).includes(se.id)).length>0&&e.jsxs("div",{className:"relative group",children:[e.jsx("button",{className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer transition-colors",children:e.jsx(ht,{size:12})}),e.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 hidden group-hover:block bg-surface-2 border border-border-subtle rounded-lg shadow-xl py-1 min-w-[200px]",children:ve.filter(se=>se.configured!==!1&&!(t.integrations||[]).includes(se.id)).map(se=>{const Me=zA[se.id];return e.jsxs("button",{onClick:async()=>{try{await D.post(`/agents/${t.id}/integrations/${se.id}`),a("success",`Attached ${se.name||se.id}`)}catch(ie){a("error","Attach failed",ie.message)}},className:"w-full flex items-center gap-2 text-left px-3 py-1.5 text-xs font-sans text-text-1 hover:bg-surface-4 cursor-pointer transition-colors",children:[Me?e.jsx("img",{src:Me,alt:"",className:"w-3.5 h-3.5 flex-shrink-0"}):e.jsx(da,{size:12,className:"text-text-3 flex-shrink-0"}),se.name||se.id]},se.id)})})]}),(t.integrations||[]).length===0&&ve.length===0&&e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"No integrations installed — browse the Marketplace"})]}),(t.integrations||[]).length>0&&e.jsxs("div",{className:"mt-3",children:[e.jsx("label",{className:"text-2xs font-medium text-text-3 font-sans block mb-1.5",children:"Integration Approvals"}),e.jsx(jf,{options:[{value:"auto",label:"Auto"},{value:"manual",label:"Manual"}],value:t.integrationApproval||"manual",onChange:async se=>{try{await D.patch(`/agents/${t.id}`,{integrationApproval:se}),a("success",`Integration approvals → ${se==="auto"?"Auto":"Manual"}`)}catch(Me){a("error","Update failed",Me.message)}}})]})]}),z.length>0&&e.jsx(nn,{label:"Repos",icon:Js,description:"Attach imported repos so this agent knows where they are.",children:e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(t.repos||[]).map(se=>{const Me=z.find(ie=>ie.id===se);return e.jsxs(be,{variant:"accent",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[(Me==null?void 0:Me.name)||se,e.jsx("button",{onClick:async()=>{try{await D.delete(`/agents/${t.id}/repos/${se}`),a("success",`Detached ${(Me==null?void 0:Me.name)||se}`)}catch(ie){a("error","Detach failed",ie.message)}},className:"hover:text-danger cursor-pointer",children:e.jsx(Ge,{size:10})})]},se)}),z.filter(se=>!(t.repos||[]).includes(se.id)).length>0&&e.jsxs("div",{className:"relative group",children:[e.jsx("button",{className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer transition-colors",children:e.jsx(ht,{size:12})}),e.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 hidden group-hover:block bg-surface-2 border border-border-subtle rounded-lg shadow-xl py-1 min-w-[200px]",children:z.filter(se=>!(t.repos||[]).includes(se.id)).map(se=>e.jsxs("button",{onClick:async()=>{try{await D.post(`/agents/${t.id}/repos/${se.id}`),a("success",`Attached ${se.name||se.id}`)}catch(Me){a("error","Attach failed",Me.message)}},className:"w-full text-left px-3 py-1.5 text-xs font-sans text-text-1 hover:bg-surface-4 cursor-pointer transition-colors",children:[e.jsx("div",{className:"font-semibold",children:se.name||se.repo}),e.jsx("div",{className:"text-2xs text-text-4 font-mono truncate",children:se.clonedTo})]},se.id))})]}),(t.repos||[]).length===0&&e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"No repos attached — import one from the Marketplace"})]})}),e.jsx(nn,{label:"Schedule",icon:Wo,description:"Run this agent on a recurring schedule.",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-text-2 font-sans",children:"Every"}),e.jsx("input",{value:G,onChange:se=>H(se.target.value.replace(/\D/g,"").slice(0,3)),className:"w-12 h-7 px-2 text-xs text-center bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent",placeholder:"1"}),e.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:[{value:"min",label:"Min"},{value:"hr",label:"Hr"},{value:"day",label:"Day"},{value:"wk",label:"Wk"},{value:"mo",label:"Mo"}].map(se=>e.jsx("button",{onClick:()=>K(se.value),className:V("px-2 py-1 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",F===se.value?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:se.label},se.value))}),e.jsxs(fe,{variant:"primary",size:"sm",disabled:q||!G||parseInt(G,10)<1,onClick:async()=>{const se=parseInt(G,10);if(!se||se<1)return;const Me={min:se===1?"* * * * *":`*/${se} * * * *`,hr:se===1?"0 * * * *":`0 */${se} * * *`,day:se===1?"0 0 * * *":`0 0 */${se} * *`,wk:`0 0 * * ${se===1?"1":"*"}`,mo:`0 0 ${se===1?"1":se} * *`};_(!0);try{await D.post("/schedules",{name:`${t.name} schedule`,cron:Me[F],agentConfig:{role:t.role,provider:t.provider,model:t.model,scope:t.scope,workingDir:t.workingDir,prompt:t.prompt}}),a("success",`Scheduled every ${se} ${F}`)}catch(ie){a("error","Schedule failed",ie.message)}_(!1)},className:"h-7 px-3 text-2xs gap-1",children:[e.jsx(Wo,{size:10}),q?"...":"Set"]})]})}),e.jsxs(nn,{label:"Personality",icon:Yn,description:"Injected into every prompt. Changes apply on next spawn or rotation.",children:[e.jsx("textarea",{value:R,onChange:se=>U(se.target.value),placeholder:Z?"Describe this agent's personality, tone, and behavior...":"Loading...",rows:4,className:"w-full min-h-[4rem] max-h-[10rem] resize-y bg-surface-0 border border-border-subtle rounded-md p-2 text-xs font-mono text-text-1 placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(fe,{variant:"primary",size:"sm",disabled:ae,onClick:async()=>{Oe(!0);try{await D.put(`/personalities/${t.name}`,{content:R}),a("success","Personality saved")}catch(se){a("error","Save failed",se.message)}Oe(!1)},className:"h-7 px-3 text-2xs gap-1",children:[e.jsx(Xr,{size:10}),ae?"Saving...":"Save"]}),Ae.length>0&&e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:"",onChange:se=>{if(!se.target.value)return;const Me=Ae.find(ie=>(ie.name||ie)===se.target.value);Me&&D.get(`/personalities/${Me.name||Me}`).then(ie=>{ie!=null&&ie.content&&U(ie.content)}).catch(()=>{})},className:"h-7 px-2 pr-7 text-2xs rounded-md bg-surface-1 border border-border-subtle text-text-2 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent",children:[e.jsx("option",{value:"",children:"Clone from..."}),Ae.filter(se=>(se.name||se)!==t.name).map(se=>e.jsx("option",{value:se.name||se,children:se.name||se},se.name||se))]}),e.jsx(bt,{size:10,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"})]})]})]}),t.prompt&&e.jsx(nn,{label:"Original Prompt",icon:Ys,children:e.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3 py-3 text-xs text-text-2 font-sans leading-relaxed max-h-40 overflow-y-auto",children:t.prompt})}),e.jsx(Hu,{open:m,onOpenChange:y,currentPath:t.workingDir||n||"/",homePath:n,onSelect:ze})]})}const ZX=[];function ZXe({data:t,isAlive:a,height:n=48}){const s=g.useRef(null);return g.useEffect(()=>{const o=s.current;if(!o||!t.length)return;const c=o.getContext("2d"),l=window.devicePixelRatio||1,A=o.clientWidth,u=o.clientHeight;o.width=A*l,o.height=u*l,c.scale(l,l),c.clearRect(0,0,A,u);const f=t.map(O=>O.v),x=Math.min(...f),y=Math.max(...f,1)-x||1;c.beginPath(),c.moveTo(0,u),t.forEach((O,b)=>{const C=b/(t.length-1)*A,j=u-(O.v-x)/y*(u-4)-2;c.lineTo(C,j)}),c.lineTo(A,u),c.closePath();const v=c.createLinearGradient(0,0,0,u);if(v.addColorStop(0,a?"rgba(51,175,188,0.15)":"rgba(110,118,129,0.08)"),v.addColorStop(1,"rgba(0,0,0,0)"),c.fillStyle=v,c.fill(),c.beginPath(),c.strokeStyle=a?te.accent:te.text3,c.lineWidth=1.5,t.forEach((O,b)=>{const C=b/(t.length-1)*A,j=u-(O.v-x)/y*(u-4)-2;b===0?c.moveTo(C,j):c.lineTo(C,j)}),c.stroke(),t.length>1&&a){const O=t[t.length-1],b=A-1,C=u-(O.v-x)/y*(u-4)-2;c.beginPath(),c.arc(b,C,5,0,Math.PI*2),c.fillStyle="rgba(51,175,188,0.3)",c.fill(),c.beginPath(),c.arc(b,C,2.5,0,Math.PI*2),c.fillStyle=te.accent,c.fill()}},[t,a]),e.jsx("div",{className:"w-full rounded-lg bg-surface-0 overflow-hidden border border-border-subtle",style:{height:n},children:e.jsx("canvas",{ref:s,className:"w-full h-full"})})}function Cf({icon:t,label:a,value:n,color:s,sub:o}){return e.jsxs("div",{className:"bg-surface-0 rounded-lg px-3 py-2.5 border border-border-subtle",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(t,{size:12,className:s||"text-text-3"}),e.jsx("span",{className:"text-2xs text-text-4 font-sans uppercase tracking-wider",children:a})]}),e.jsx("div",{className:V("text-lg font-bold font-mono tabular-nums",s||"text-text-0"),children:n}),o&&e.jsx("div",{className:"text-2xs text-text-4 font-sans mt-0.5",children:o})]})}function GXe({score:t}){const a=Math.min(Math.max(t,0),100);let n=te.success,s="Healthy";return a<40?(n=te.danger,s="Degraded"):a<70&&(n=te.warning,s="Fair"),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsxs("span",{className:"text-2xs text-text-3 font-sans flex items-center gap-1.5",children:[e.jsx(v0,{size:11}),"Session Health"]}),e.jsxs("span",{className:"text-xs font-bold font-mono",style:{color:n},children:[a,"/100"]})]}),e.jsx("div",{className:"h-2 bg-surface-0 rounded-full overflow-hidden border border-border-subtle",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${a}%`,background:n}})}),e.jsx("span",{className:"text-2xs font-sans mt-1 block",style:{color:n},children:s})]})}function WXe(t){const a=(t||"").toLowerCase();return a.includes("edit")||a.includes("writ")?{icon:ps,color:"text-warning"}:a.includes("read")||a.includes("view")?{icon:na,color:"text-info"}:a.includes("search")||a.includes("grep")||a.includes("glob")?{icon:oa,color:"text-purple"}:a.includes("bash")||a.includes("command")||a.includes("terminal")?{icon:Ns,color:"text-orange"}:a.includes("error")||a.includes("fail")?{icon:Xt,color:"text-danger"}:a.includes("spawn")||a.includes("start")?{icon:wt,color:"text-success"}:a.includes("complet")||a.includes("done")?{icon:Hn,color:"text-success"}:{icon:Rr,color:"text-text-4"}}function KXe({agent:t}){const a=$(l=>l.tokenTimeline[t.id])||ZX,n=$(l=>l.activityLog[t.id])||ZX,s=t.status==="running"||t.status==="starting",o=g.useMemo(()=>{if(a.length<2)return 0;const l=a.slice(-10),A=(l[l.length-1].t-l[0].t)/6e4,u=l[l.length-1].v-l[0].v;return A>0?Math.round(u/A):0},[a]),c=g.useMemo(()=>{const l=t.contextUsage||0;let A=100;return l>90?A-=50:l>70?A-=25:l>50&&(A-=10),o>5e3?A-=15:o>3e3&&(A-=8),t.status==="crashed"&&(A=10),t.status==="completed"&&(A=95),Math.max(0,Math.min(100,A))},[t.contextUsage,t.status,o]);return e.jsxs("div",{className:"px-5 py-5 space-y-5 overflow-y-auto h-full",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Token Burn"}),s&&e.jsx("span",{className:"text-2xs text-accent font-mono animate-pulse",children:"LIVE"})]}),e.jsx(ZXe,{data:a,isAlive:s,height:56})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(Cf,{icon:p0,label:"Burn Rate",value:o>0?`${pt(o)}/m`:"—",color:o>5e3?"text-danger":o>2e3?"text-warning":"text-text-0"}),e.jsx(Cf,{icon:h0,label:"Cost",value:Ai(t.costUsd||0),color:"text-text-0"}),e.jsx(Cf,{icon:Vr,label:"Rotations",value:t.rotations||"0",color:"text-text-0"}),e.jsx(Cf,{icon:wt,label:"Turns",value:t.turns||"0",color:"text-text-0"})]}),e.jsx(GXe,{score:c}),t.prompt&&e.jsxs("div",{children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider block mb-1.5",children:"Task"}),e.jsx("div",{className:"bg-surface-0 rounded-lg px-3 py-2.5 text-xs text-text-2 font-sans leading-relaxed max-h-28 overflow-y-auto border border-border-subtle",children:t.prompt})]}),n.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider block mb-2",children:"Activity"}),e.jsxs("div",{className:"space-y-0 relative",children:[e.jsx("div",{className:"absolute left-[9px] top-2 bottom-2 w-px bg-border-subtle"}),n.slice(-12).reverse().map((l,A)=>{const u=WXe(l.text),f=u.icon;return e.jsxs("div",{className:"flex items-start gap-3 py-1.5 relative",children:[e.jsx("div",{className:V("w-[18px] h-[18px] rounded-full flex items-center justify-center flex-shrink-0 z-10","bg-surface-1 border border-border-subtle"),children:e.jsx(f,{size:9,className:u.color})}),e.jsx("span",{className:"text-2xs text-text-2 font-sans flex-1 line-clamp-1 pt-0.5",children:l.text}),e.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0 pt-0.5",children:Mt(l.timestamp)})]},A)})]})]})]})}function YXe({agent:t}){const a=$(S=>S.addToast),[n,s]=g.useState([]),[o,c]=g.useState(""),[l,A]=g.useState(null),[u,f]=g.useState(""),[x,m]=g.useState(""),[y,v]=g.useState(!1),[O,b]=g.useState(!1),[C,j]=g.useState("");async function N(){try{const S=await D.get(`/agents/${t.id}/mdfiles`);s(S.files||[]),c(S.workingDir||"")}catch{}}g.useEffect(()=>{N()},[t.id]);async function M(S){try{const I=await D.get(`/agents/${t.id}/mdfiles/read?path=${encodeURIComponent(S)}`);f(I.content||""),m(I.content||""),A(S)}catch(I){a("error","Failed to read file",I.message)}}async function Q(){if(l){v(!0);try{await D.put(`/agents/${t.id}/mdfiles/write`,{path:l,content:u}),m(u),a("success",`Saved ${l}`)}catch(S){a("error","Save failed",S.message)}v(!1)}}async function L(){const S=C.trim();if(S)try{await D.post(`/agents/${t.id}/mdfiles/create`,{name:S}),j(""),b(!1),a("success",`Created ${S}.md`),N()}catch(I){a("error","Create failed",I.message)}}const B=u!==x;return l?e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-subtle",children:[e.jsx("button",{onClick:()=>{A(null),f(""),m("")},className:"p-1 text-text-3 hover:text-text-0 cursor-pointer",children:e.jsx(bs,{size:14})}),e.jsx(Va,{size:12,className:"text-accent"}),e.jsx("span",{className:"text-xs text-text-0 font-sans font-medium flex-1 truncate",children:l}),B&&e.jsx("span",{className:"text-[10px] text-warning font-sans",children:"unsaved"}),e.jsxs("button",{onClick:Q,disabled:!B||y,className:V("flex items-center gap-1 px-2.5 py-1 rounded text-2xs font-sans font-medium cursor-pointer transition-colors",B?"bg-accent/15 text-accent hover:bg-accent/25":"text-text-4 opacity-50 cursor-not-allowed"),children:[e.jsx(Xr,{size:10}),y?"Saving...":"Save"]})]}),e.jsx("textarea",{value:u,onChange:S=>f(S.target.value),className:"flex-1 w-full px-4 py-3 bg-surface-0 text-[12px] font-mono text-text-1 leading-relaxed resize-none focus:outline-none",spellCheck:!1})]}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-border-subtle",children:[e.jsx(Va,{size:12,className:"text-text-3"}),e.jsx("span",{className:"text-2xs font-semibold text-text-2 font-sans uppercase tracking-wider flex-1",children:"Markdown Files"}),e.jsx("button",{onClick:()=>b(!0),className:"p-1 text-text-4 hover:text-accent cursor-pointer",title:"Create file",children:e.jsx(ht,{size:12})}),e.jsx("button",{onClick:N,className:"p-1 text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(ra,{size:11})})]}),o&&e.jsx("div",{className:"px-4 py-1.5 text-[10px] text-text-4 font-mono truncate border-b border-border-subtle/50",children:o}),O&&e.jsxs("div",{className:"flex items-center gap-1.5 px-4 py-2 border-b border-border-subtle bg-surface-0",children:[e.jsx(Va,{size:11,className:"text-accent flex-shrink-0"}),e.jsx("input",{autoFocus:!0,value:C,onChange:S=>j(S.target.value),onKeyDown:S=>{S.key==="Enter"&&L(),S.key==="Escape"&&(b(!1),j(""))},placeholder:"filename",className:"flex-1 bg-transparent text-xs text-text-0 font-mono outline-none placeholder:text-text-4"}),e.jsx("span",{className:"text-[10px] text-text-4 font-mono",children:".md"}),e.jsx("button",{onClick:L,className:"p-0.5 text-accent hover:text-accent/80 cursor-pointer",children:e.jsx(Xr,{size:11})}),e.jsx("button",{onClick:()=>{b(!1),j("")},className:"p-0.5 text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(Ge,{size:11})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:n.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-4",children:[e.jsx(Va,{size:20,className:"text-text-4 mb-2"}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No markdown files found"}),e.jsx("p",{className:"text-[10px] text-text-4 font-sans mt-1",children:"MD files in the agent's working directory will appear here"})]}):e.jsx("div",{className:"py-1",children:n.map(S=>e.jsxs("button",{onClick:()=>M(S.path),className:"w-full flex items-center gap-2.5 px-4 py-2 text-left hover:bg-surface-5 transition-colors cursor-pointer",children:[e.jsx(Va,{size:13,className:"text-accent flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs text-text-0 font-sans block truncate",children:S.name}),e.jsx("span",{className:"text-[10px] text-text-4 font-mono",children:S.path})]}),e.jsx("span",{className:"text-[10px] text-text-4 font-mono flex-shrink-0",children:S.size>1024?`${(S.size/1024).toFixed(1)}K`:`${S.size}B`}),S.source==="personality"&&e.jsx("span",{className:"text-[9px] font-mono text-purple bg-purple/10 px-1 py-px rounded flex-shrink-0",children:"personality"}),S.source==="user"&&e.jsx("span",{className:"text-[9px] font-mono text-accent bg-accent/10 px-1 py-px rounded flex-shrink-0",children:"custom"})]},S.path))})})]})}const JXe={running:"success",starting:"warning",stopped:"default",crashed:"danger",completed:"accent",killed:"default",rotating:"purple"},eZe={running:"Running",starting:"Starting",stopped:"Stopped",crashed:"Crashed",completed:"Done",killed:"Killed",rotating:"Rotating"},tZe=[{id:"command",label:"Chat",icon:Cn},{id:"config",label:"Config",icon:Zr},{id:"telemetry",label:"Monitor",icon:Ys},{id:"mdfiles",label:"Files",icon:Va}];function aZe({agent:t}){const a=$(u=>u.addToast),[n,s]=g.useState(!1),[o,c]=g.useState(t.name),l=g.useRef(null);async function A(){const u=o.trim();if(!u||u===t.name){s(!1);return}try{await D.patch(`/agents/${t.id}`,{name:u.replace(/\s+/g,"-")}),a("success",`Renamed → ${u}`)}catch(f){a("error","Rename failed",f.message),c(t.name)}s(!1)}return n?e.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0",children:[e.jsx("input",{ref:l,value:o,onChange:u=>c(u.target.value),onKeyDown:u=>{u.key==="Enter"&&A(),u.key==="Escape"&&(c(t.name),s(!1))},className:"flex-1 min-w-0 h-6 px-1.5 text-sm font-bold bg-surface-0 border border-accent/30 rounded text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent/40",autoFocus:!0}),e.jsx("button",{onClick:A,className:"p-0.5 text-accent hover:text-accent/80 cursor-pointer",children:e.jsx(De,{size:12})}),e.jsx("button",{onClick:()=>{c(t.name),s(!1)},className:"p-0.5 text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(Ge,{size:12})})]}):e.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0 group",children:[e.jsx("h2",{className:"text-sm font-bold text-text-0 font-sans truncate",children:t.name}),e.jsx("button",{onClick:()=>{c(t.name),s(!0)},className:"p-0.5 text-text-4 opacity-0 group-hover:opacity-100 hover:text-text-1 cursor-pointer transition-opacity",children:e.jsx(js,{size:10})})]})}function nZe(){const t=$(x=>x.detailPanel),a=$(x=>x.agents),n=$(x=>x.activeTeamId),[s,o]=g.useState("command");if((t==null?void 0:t.type)!=="agent")return null;const c=a.find(x=>x.id===t.agentId);if(!c||n&&c.teamId&&c.teamId!==n)return null;const l=c.status==="running"||c.status==="starting",A=Math.round((c.contextUsage||0)*100),u=c.spawnedAt||c.createdAt,f=u?Math.floor((Date.now()-new Date(u).getTime())/1e3):0;return On(c.role),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex-shrink-0",children:[e.jsxs("div",{className:"pl-4 pr-10 pt-3 pb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(aZe,{agent:c}),e.jsx(be,{variant:JXe[c.status]||"default",dot:l?"pulse":void 0,className:"text-2xs flex-shrink-0",children:eZe[c.status]||c.status})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-1 text-2xs text-text-3 font-mono",children:[e.jsx("span",{className:"capitalize",children:c.role}),e.jsx("span",{className:"text-text-4",children:"·"}),e.jsxs("span",{children:[c.provider,":",c.model||"auto"]}),e.jsx("span",{className:"text-text-4",children:"·"}),e.jsxs("span",{children:[pt(c.tokensUsed||0)," tok"]}),A>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-4",children:"·"}),e.jsxs("span",{className:V(A>80?"text-danger":A>60?"text-warning":"text-text-3"),children:[A,"% ctx"]})]}),e.jsx("span",{className:"text-text-4",children:"·"}),e.jsx("span",{children:WA(f)})]})]}),e.jsx("div",{className:"flex items-center px-4 border-b border-border-subtle",children:tZe.map(x=>{const m=x.icon,y=s===x.id;return e.jsxs("button",{onClick:()=>o(x.id),className:V("flex items-center gap-1.5 px-3 py-2 text-2xs font-semibold font-sans transition-all cursor-pointer select-none border-b-2 -mb-px",y?"border-accent text-text-0":"border-transparent text-text-3 hover:text-text-1"),children:[e.jsx(m,{size:11}),x.label]},x.id)})})]}),e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[s==="command"&&e.jsx(DXe,{agent:c}),s==="config"&&e.jsx(XXe,{agent:c}),s==="telemetry"&&e.jsx(KXe,{agent:c}),s==="mdfiles"&&e.jsx(YXe,{agent:c})]})]})}const sZe=[{id:"chat",label:"Chat",desc:"Companion, assistant, conversation",icon:Yn,tier:"Medium"},{id:"planner",label:"Planner",desc:"Plans the team and tasks",icon:es,tier:"Heavy"},{id:"backend",label:"Backend",desc:"APIs, services, databases",icon:aa,tier:"Medium"},{id:"frontend",label:"Frontend",desc:"UI, components, styling",icon:Dr,tier:"Medium"},{id:"fullstack",label:"Fullstack",desc:"End-to-end implementation",icon:Zt,tier:"Heavy"},{id:"testing",label:"Testing",desc:"Tests, coverage, QA",icon:ti,tier:"Medium"},{id:"devops",label:"DevOps",desc:"CI/CD, infra, deployment",icon:NA,tier:"Medium"},{id:"docs",label:"Docs",desc:"Documentation, guides",icon:Va,tier:"Light"},{id:"security",label:"Security",desc:"Audits, vulnerabilities",icon:La,tier:"Medium"},{id:"database",label:"Database",desc:"Schema, migrations, queries",icon:MA,tier:"Medium"},{id:"cmo",label:"CMO",desc:"Marketing, content, growth",icon:_A,tier:"Medium"},{id:"cfo",label:"CFO",desc:"Finance, metrics, forecasting",icon:tu,tier:"Medium"},{id:"ea",label:"EA",desc:"Executive assistant, scheduling",icon:Ou,tier:"Light"},{id:"support",label:"Support",desc:"Customer support, FAQs",icon:Au,tier:"Medium"},{id:"analyst",label:"Analyst",desc:"Data analysis, insights",icon:hs,tier:"Medium"},{id:"creative",label:"Writer",desc:"Copy, articles, proposals",icon:Lr,tier:"Heavy",skillHint:!0},{id:"slides",label:"Slides",desc:"Pitch decks, presentations",icon:yu,tier:"Heavy",skillHint:!0},{id:"ambassador",label:"Ambassador",desc:"Bridge to federated server",icon:sa,tier:"Light"}];function kP(){return e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",className:"text-accent flex-shrink-0",children:[e.jsx("circle",{cx:"7",cy:"7",r:"6",fill:"currentColor",fillOpacity:"0.15",stroke:"currentColor",strokeWidth:"1"}),e.jsx("path",{d:"M4.5 7 L6.5 9 L9.5 5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function rZe(){const t=$(re=>re.detailPanel),a=$(re=>re.closeDetail),n=$(re=>re.spawnAgent),s=$(re=>re.fetchProviders),o=(t==null?void 0:t.type)==="spawn",[c,l]=g.useState(""),[A,u]=g.useState(""),[f,x]=g.useState(""),[m,y]=g.useState(""),[v,O]=g.useState(""),[b,C]=g.useState(""),[j,N]=g.useState([]),[M,Q]=g.useState([]),[L,B]=g.useState([]),[S,I]=g.useState(!1),[z,P]=g.useState(""),[F,K]=g.useState([]),[G,H]=g.useState([]),[q,_]=g.useState(!1),[R,U]=g.useState(""),[Z,J]=g.useState("manual"),[Ae,W]=g.useState([]),[ae,Oe]=g.useState([]),[ve,ce]=g.useState(!1),[he,je]=g.useState(""),[ee,ke]=g.useState([]),[ye,Ne]=g.useState(""),[ze,He]=g.useState(!1),[Tt,Et]=g.useState(!1),[ya,Nn]=g.useState(""),[Wt,se]=g.useState([]),[Me,ie]=g.useState(null),[Re,xt]=g.useState(null),[St,at]=g.useState([]),[va,Mn]=g.useState(!1),DT=$(re=>re.federation),Vu=$(re=>re.ollamaRunningModels),ua=c||A,Sn=j.find(re=>re.id===m),ao=(Sn==null?void 0:Sn.models)||[],ka=j.filter(re=>re.authType==="api-key"?re.installed&&re.hasKey:re.installed);g.useEffect(()=>{if(o){const re=(t==null?void 0:t.presetProvider)||"",Ce=(t==null?void 0:t.presetModel)||"";s().then(Ee=>{const ct=Array.isArray(Ee)?Ee:Ee.providers||[];N(ct);const Qn=ct.filter(Ia=>Ia.authType==="api-key"?Ia.installed&&Ia.hasKey:Ia.installed);if(Qn.length>0&&!re){const no=["claude-code","gemini","codex","ollama"].find(pi=>Qn.some(VT=>VT.id===pi))||Qn[0].id;y(no)}}).catch(()=>{}),D.get("/skills/installed").then(Ee=>{Q(Array.isArray(Ee)?Ee:[])}).catch(()=>{}),D.get("/integrations/installed").then(Ee=>{K(Array.isArray(Ee)?Ee:[])}).catch(()=>{}),D.get("/repos/imported").then(Ee=>{W((Array.isArray(Ee)?Ee:[]).filter(ct=>ct.status==="active"))}).catch(()=>{}),D.get("/personalities").then(Ee=>{ke(Array.isArray(Ee)?Ee:Ee.personalities||[])}).catch(()=>{}),l(""),u(""),x(""),y(re),O(Ce),C(""),B([]),H([]),J("manual"),Oe([]),Ne(""),Nn(""),He(!1),se([]),ie(null),xt(null)}},[o,s]),g.useEffect(()=>{if(!ua||!o){se([]);return}D.get(`/roles/integrations?role=${encodeURIComponent(ua)}`).then(re=>{const Ce=Array.isArray(re)?re:(re==null?void 0:re.recommendations)||[];se(Ce);const Ee=Ce.filter(ct=>ct.installed&&ct.configured&&ct.authenticated).map(ct=>ct.id);Ee.length>0&&H(ct=>[...new Set([...ct,...Ee])])}).catch(()=>se([]))},[ua,o]),g.useEffect(()=>{if(!o||m!=="claude-code"){xt(null);return}D.get("/providers/claude-code/auth").then(re=>{xt(re)}).catch(()=>xt(null))},[o,m]),g.useEffect(()=>{if(!o||m!=="ollama"){at([]);return}D.get("/providers/ollama/models").then(re=>{at(re.installed||[])}).catch(()=>at([])),D.post("/providers/ollama/check").then(re=>{Mn(re.serverRunning)}).catch(()=>Mn(!1))},[o,m]);async function rs(){Et(!0);try{const re={role:ua,...f&&{name:f.replace(/\s+/g,"-")},...m&&{provider:m},...v&&{model:v},...b&&{prompt:b},...L.length>0&&{skills:L},...G.length>0&&{integrations:G},...G.length>0&&{integrationApproval:Z},...ae.length>0&&{repos:ae},...ye&&{personality:ye},...ua==="ambassador"&&ya&&{peerId:ya}};await n(re),a()}catch{}Et(!1)}async function Ra(){var re;if(ua){try{const Ce=await D.post("/agents/preflight",{role:ua,integrations:G});if(((re=Ce==null?void 0:Ce.issues)==null?void 0:re.length)>0){ie(Ce.issues);return}}catch{}rs()}}const k2=m==="claude-code"&&Re&&!Re.authenticated;return e.jsxs(HT,{open:o,onOpenChange:re=>{re||a()},children:[e.jsx(qT,{title:"Spawn Agent",width:480,children:e.jsxs("div",{className:"flex flex-col h-[calc(100%-57px)]",children:[e.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block mb-3",children:"Choose Role"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:sZe.map(re=>{const Ce=On(re.id),Ee=c===re.id;return e.jsxs("button",{onClick:()=>{l(re.id),u("")},className:V("flex items-center gap-2.5 p-3 rounded-md border text-left transition-all cursor-pointer",Ee?"border-accent bg-accent/5":"border-border-subtle bg-surface-1 hover:border-border hover:bg-surface-2"),children:[e.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center flex-shrink-0",style:{background:Ce.bg},children:e.jsx(re.icon,{size:16,style:{color:Ce.text}})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:re.label}),re.skillHint&&e.jsx("span",{className:"text-2xs font-mono text-warning/70 bg-warning/8 px-1 py-px rounded",children:"skill"})]}),e.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:re.desc})]})]},re.id)})}),e.jsx("div",{className:"mt-3",children:e.jsx(cn,{placeholder:"or type a custom role (e.g. chat-agent)...",value:A,onChange:re=>{u(re.target.value.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").slice(0,50)),l("")},className:"text-xs"})})]}),ua&&Wt.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block mb-2",children:"Recommended Integrations"}),e.jsx("div",{className:"space-y-1.5",children:Wt.map(re=>{const Ce=zA[re.id];return re.installed&&re.configured&&re.authenticated?e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 rounded-md bg-success/5 border border-success/20",children:[e.jsx(De,{size:13,className:"text-success flex-shrink-0"}),Ce?e.jsx("img",{src:Ce,alt:"",className:"w-3.5 h-3.5 flex-shrink-0"}):e.jsx(da,{size:12,className:"text-text-3 flex-shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:re.name||re.id}),e.jsx(be,{variant:"success",className:"text-2xs ml-auto",children:"Ready"})]},re.id):re.installed?e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 rounded-md bg-warning/5 border border-warning/20",children:[e.jsx(Gt,{size:13,className:"text-warning flex-shrink-0"}),Ce?e.jsx("img",{src:Ce,alt:"",className:"w-3.5 h-3.5 flex-shrink-0"}):e.jsx(da,{size:12,className:"text-text-3 flex-shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:re.name||re.id}),e.jsx(fe,{variant:"ghost",size:"sm",className:"ml-auto text-2xs text-warning h-6 px-2",onClick:()=>{a(),$.getState().setActiveView("marketplace")},children:"Configure"})]},re.id):e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 rounded-md bg-surface-1 border border-border-subtle",children:[Ce?e.jsx("img",{src:Ce,alt:"",className:"w-3.5 h-3.5 flex-shrink-0 opacity-40"}):e.jsx(da,{size:12,className:"text-text-4 flex-shrink-0"}),e.jsx("span",{className:"text-xs text-text-3 font-sans",children:re.name||re.id}),e.jsx("button",{onClick:()=>{a(),$.getState().setActiveView("marketplace")},className:"ml-auto text-2xs text-accent hover:underline font-sans cursor-pointer",children:"Install in Marketplace"})]},re.id)})})]}),ua==="ambassador"&&(()=>{const re=DT.whitelist.filter(Ce=>typeof Ce=="object"&&(Ce.status==="mutual"||Ce.status==="connected"));return re.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border-subtle bg-surface-1/50 px-4 py-4 text-center",children:[e.jsx(sa,{size:18,className:"text-text-4 mx-auto mb-1.5"}),e.jsx("p",{className:"text-2xs text-text-3 font-sans mb-2",children:"No federated servers connected. Add one in the Federation view."}),e.jsx(fe,{variant:"ghost",size:"sm",className:"text-2xs text-accent",onClick:()=>{a(),$.getState().setActiveView("federation")},children:"Go to Federation"})]}):e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block mb-2",children:"Target Server"}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:ya,onChange:Ce=>Nn(Ce.target.value),className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent",children:[e.jsx("option",{value:"",children:"Select a server..."}),re.map(Ce=>e.jsx("option",{value:Ce.ip,children:Ce.name||`${Ce.ip}:${Ce.port||31415}`},Ce.ip))]}),e.jsx(bt,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]})]})})(),ua&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block",children:"Configuration"}),e.jsx(cn,{label:"Name (optional)",value:f,onChange:re=>x(re.target.value),placeholder:`${ua}-1`}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Provider"}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:m,onChange:re=>{y(re.target.value),O("")},className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent",children:[e.jsx("option",{value:"",children:"Auto"}),j.map(re=>e.jsxs("option",{value:re.id,disabled:re.authType==="api-key"?!(re.installed&&re.hasKey):!re.installed,children:[re.name,re.installed?re.authType==="api-key"&&!re.hasKey?" (No API key)":"":" (Not installed)"]},re.id))]}),e.jsx(bt,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Model"}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:v,onChange:re=>O(re.target.value),disabled:!m,className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-40",children:[e.jsx("option",{value:"",children:"Auto"}),m==="ollama"&&St.length>0?e.jsxs(e.Fragment,{children:[e.jsx("optgroup",{label:"Installed Models",children:St.map(re=>{const Ce=Vu.some(Ee=>Ee.name===re.id);return e.jsxs("option",{value:re.id,children:[re.name||re.id," (",re.size,")",Ce?" ● Running":""]},re.id)})}),e.jsx("optgroup",{label:"Catalog",children:ao.filter(re=>!St.some(Ce=>Ce.id===re.id)).map(re=>e.jsxs("option",{value:re.id,children:[re.name," (not installed)"]},re.id))})]}):ao.map(re=>e.jsx("option",{value:re.id,children:re.name},re.id))]}),e.jsx(bt,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]})]})]}),m&&Sn&&e.jsx("div",{className:"text-2xs text-text-3 font-sans flex items-center gap-2 flex-wrap",children:Sn.authType==="local"?e.jsx(be,{variant:"success",children:"Local"}):Sn.authType==="subscription"?e.jsx(be,{variant:"accent",children:"Subscription"}):Sn.hasKey?e.jsx(be,{variant:"success",children:"API key set"}):e.jsxs(be,{variant:"warning",children:["No API key — set with: groove set-key ",m," YOUR_KEY"]})}),m==="ollama"&&v&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-2xs font-sans",children:[Vu.some(re=>re.name===v)?e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-success"}),"Ready — running in memory"]}):St.some(re=>re.id===v)?e.jsx(be,{variant:"subtle",className:"text-2xs",children:"Will auto-start when agent spawns"}):e.jsx(be,{variant:"warning",className:"text-2xs",children:"Not installed — will pull first"}),!va&&e.jsx("span",{className:"text-warning",children:"Server not running — will auto-start"})]}),k2&&e.jsxs("div",{className:"rounded-lg border border-warning/30 bg-warning/5 px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Gt,{size:13,className:"text-warning flex-shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:"Claude Code is not signed in"})]}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Open the terminal and run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"claude"})]})]}),m==="claude-code"&&(Re==null?void 0:Re.authenticated)&&e.jsxs("div",{className:"flex items-center gap-2 text-2xs text-text-2 font-sans",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-success flex-shrink-0"}),"Signed in as ",Re.email||"Claude user"," (",Re.subscriptionType||"subscription",")"]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Skills"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[L.map(re=>{const Ce=M.find(Ee=>Ee.id===re);return e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded bg-accent/12 text-accent border border-accent/25 text-2xs font-sans",children:[e.jsx(It,{size:9}),(Ce==null?void 0:Ce.name)||re,e.jsx("button",{onClick:()=>B(Ee=>Ee.filter(ct=>ct!==re)),className:"ml-0.5 hover:text-text-0 cursor-pointer",children:e.jsx(Ge,{size:9})})]},re)}),e.jsxs("button",{onClick:()=>{I(!0),P("")},className:V("inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-2xs font-sans transition-colors cursor-pointer","bg-surface-0 text-text-2 border border-border-subtle hover:border-border hover:text-text-0"),children:[e.jsx(It,{size:10}),L.length>0?"Add skill":"Attach skill"]})]})]}),e.jsx(Ut,{open:S,onOpenChange:I,children:e.jsx(Pt,{title:"Select Skill",className:"max-w-sm",children:e.jsxs("div",{className:"space-y-3 p-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(oa,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{value:z,onChange:re=>P(re.target.value),placeholder:"Search skills...",autoFocus:!0,className:"w-full h-8 pl-8 pr-3 text-xs rounded-md bg-surface-0 border border-border text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsxs("div",{className:"max-h-64 overflow-y-auto space-y-1",children:[M.filter(re=>{if(!z)return!0;const Ce=z.toLowerCase();return(re.name||re.id).toLowerCase().includes(Ce)||(re.description||"").toLowerCase().includes(Ce)}).map(re=>{const Ce=L.includes(re.id);return e.jsxs("button",{onClick:()=>{B(Ee=>Ce?Ee.filter(ct=>ct!==re.id):[...Ee,re.id])},className:V("w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors cursor-pointer",Ce?"bg-accent/10 border border-accent/25":"hover:bg-surface-3 border border-transparent"),children:[e.jsx(It,{size:12,className:Ce?"text-accent":"text-text-3"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:re.name||re.id}),re.description&&e.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:re.description})]}),Ce&&e.jsx(kP,{})]},re.id)}),M.length===0&&e.jsx("div",{className:"text-center py-6 text-xs text-text-3 font-sans",children:"No skills installed. Visit the Marketplace to install skills."})]})]})})}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Integrations"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[G.map(re=>{const Ce=F.find(ct=>ct.id===re),Ee=zA[re];return e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded bg-accent/12 text-accent border border-accent/25 text-2xs font-sans",children:[Ee?e.jsx("img",{src:Ee,alt:"",className:"w-2.5 h-2.5"}):e.jsx(da,{size:9}),(Ce==null?void 0:Ce.name)||re,e.jsx("button",{onClick:()=>H(ct=>ct.filter(Qn=>Qn!==re)),className:"ml-0.5 hover:text-text-0 cursor-pointer",children:e.jsx(Ge,{size:9})})]},re)}),e.jsxs("button",{onClick:()=>{_(!0),U("")},className:V("inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-2xs font-sans transition-colors cursor-pointer","bg-surface-0 text-text-2 border border-border-subtle hover:border-border hover:text-text-0"),children:[e.jsx(da,{size:10}),G.length>0?"Add integration":"Attach integration"]})]})]}),e.jsx(Ut,{open:q,onOpenChange:_,children:e.jsx(Pt,{title:"Select Integration",className:"max-w-sm",children:e.jsxs("div",{className:"space-y-3 p-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(oa,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{value:R,onChange:re=>U(re.target.value),placeholder:"Search integrations...",autoFocus:!0,className:"w-full h-8 pl-8 pr-3 text-xs rounded-md bg-surface-0 border border-border text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsxs("div",{className:"max-h-64 overflow-y-auto space-y-1",children:[F.filter(re=>{if(!R)return!0;const Ce=R.toLowerCase();return(re.name||re.id).toLowerCase().includes(Ce)||(re.description||"").toLowerCase().includes(Ce)}).map(re=>{const Ce=G.includes(re.id),Ee=re.configured!==!1,ct=zA[re.id],Qn=ua&&Array.isArray(re.roles)&&re.roles.includes(ua);return e.jsxs("button",{onClick:()=>{Ee&&H(Ia=>Ce?Ia.filter(no=>no!==re.id):[...Ia,re.id])},disabled:!Ee,className:V("w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors",Ee?"cursor-pointer":"opacity-40 cursor-not-allowed",Ce?"bg-accent/10 border border-accent/25":Ee?"hover:bg-surface-3 border border-transparent":"border border-transparent"),children:[ct?e.jsx("img",{src:ct,alt:"",className:"w-4 h-4 flex-shrink-0"}):e.jsx(da,{size:12,className:Ce?"text-accent":"text-text-3"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:re.name||re.id}),!Ee&&e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"(not configured)"}),Ee&&Qn&&e.jsx("span",{className:"text-2xs font-mono text-accent/70 bg-accent/8 px-1 py-px rounded",children:"rec"})]}),re.description&&e.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:re.description}),!Ee&&e.jsx("div",{className:"text-2xs text-text-4 font-sans",children:"Configure in Marketplace"})]}),Ce&&e.jsx(kP,{})]},re.id)}),F.length===0&&e.jsx("div",{className:"text-center py-6 text-xs text-text-3 font-sans",children:"No integrations installed. Visit the Marketplace to install integrations."})]})]})})}),G.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Integration Approvals"}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs("button",{onClick:()=>J("manual"),className:V("flex-1 flex items-center gap-2 px-3 py-2 rounded-md border text-left transition-all cursor-pointer",Z==="manual"?"border-accent bg-accent/5":"border-border-subtle bg-surface-1 hover:border-border"),children:[e.jsx(La,{size:13,className:Z==="manual"?"text-accent":"text-text-3"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-semibold text-text-0 font-sans",children:"Manual"}),e.jsx("div",{className:"text-2xs text-text-3 font-sans",children:"You approve each action"})]})]}),e.jsxs("button",{onClick:()=>J("auto"),className:V("flex-1 flex items-center gap-2 px-3 py-2 rounded-md border text-left transition-all cursor-pointer",Z==="auto"?"border-warning bg-warning/5":"border-border-subtle bg-surface-1 hover:border-border"),children:[e.jsx(It,{size:13,className:Z==="auto"?"text-warning":"text-text-3"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-semibold text-text-0 font-sans",children:"Auto"}),e.jsx("div",{className:"text-2xs text-text-3 font-sans",children:"Agent acts without asking"})]})]})]})]}),Ae.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Repos"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[ae.map(re=>{const Ce=Ae.find(Ee=>Ee.id===re);return e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded bg-accent/12 text-accent border border-accent/25 text-2xs font-sans",children:[e.jsx(Js,{size:9}),(Ce==null?void 0:Ce.name)||re,e.jsx("button",{onClick:()=>Oe(Ee=>Ee.filter(ct=>ct!==re)),className:"ml-0.5 hover:text-text-0 cursor-pointer",children:e.jsx(Ge,{size:9})})]},re)}),e.jsxs("button",{onClick:()=>{ce(!0),je("")},className:V("inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-2xs font-sans transition-colors cursor-pointer","bg-surface-0 text-text-2 border border-border-subtle hover:border-border hover:text-text-0"),children:[e.jsx(Js,{size:10}),ae.length>0?"Add repo":"Attach repo"]})]})]}),e.jsx(Ut,{open:ve,onOpenChange:ce,children:e.jsx(Pt,{title:"Select Repository",className:"max-w-sm",children:e.jsxs("div",{className:"space-y-3 p-4",children:[Ae.length>1&&e.jsxs("div",{className:"relative",children:[e.jsx(oa,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{value:he,onChange:re=>je(re.target.value),placeholder:"Search repos...",autoFocus:!0,className:"w-full h-8 pl-8 pr-3 text-xs rounded-md bg-surface-0 border border-border text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsx("div",{className:"max-h-64 overflow-y-auto space-y-1",children:Ae.filter(re=>{if(!he)return!0;const Ce=he.toLowerCase();return(re.name||re.repo||re.id).toLowerCase().includes(Ce)}).map(re=>{const Ce=ae.includes(re.id);return e.jsxs("button",{onClick:()=>{Oe(Ee=>Ce?Ee.filter(ct=>ct!==re.id):[...Ee,re.id])},className:V("w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors cursor-pointer",Ce?"bg-accent/10 border border-accent/25":"hover:bg-surface-3 border border-transparent"),children:[e.jsx(Js,{size:12,className:Ce?"text-accent":"text-text-3"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:re.name||re.repo}),e.jsx("div",{className:"text-2xs text-text-4 font-mono truncate",children:re.clonedTo})]}),Ce&&e.jsx(kP,{})]},re.id)})})]})})}),(c==="chat"||ze)&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Personality"}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:ye,onChange:re=>Ne(re.target.value),className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent",children:[e.jsx("option",{value:"",children:"None (blank)"}),ee.map(re=>e.jsx("option",{value:re.name||re,children:re.name||re},re.name||re))]}),e.jsx(bt,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"Personality is injected into every prompt for this agent."})]}),c!=="chat"&&!ze&&e.jsx("button",{onClick:()=>He(!0),className:"text-2xs text-text-3 hover:text-accent font-sans transition-colors cursor-pointer",children:"+ Advanced options"})]})]}),e.jsxs("div",{className:"border-t border-border-subtle px-5 py-4 bg-surface-1",children:[ka.length===0&&j.length>0&&e.jsxs("div",{className:"flex items-center gap-2 mb-3 px-3 py-2 rounded-md bg-warning/8 border border-warning/20",children:[e.jsx(Gt,{size:13,className:"text-warning flex-shrink-0"}),e.jsx("span",{className:"text-2xs font-sans text-text-2",children:"No AI providers installed. Install Claude Code, Gemini CLI, Codex, or Ollama to spawn agents."})]}),ua&&ka.length>0&&e.jsxs("div",{className:"flex items-center gap-2 mb-3 text-xs text-text-3 font-sans",children:[e.jsx("span",{children:"Spawning"}),e.jsx(be,{variant:"accent",children:ua}),m&&e.jsxs("span",{children:["on ",(Sn==null?void 0:Sn.name)||m]}),f&&e.jsxs("span",{children:["as ",f.replace(/\s+/g,"-")]})]}),e.jsx(fe,{variant:"primary",size:"lg",onClick:Ra,disabled:!ua||Tt||ka.length===0||k2,className:"w-full",children:Tt?"Spawning...":"Spawn Agent"})]})]})}),e.jsx(Ut,{open:!!Me,onOpenChange:re=>{re||ie(null)},children:e.jsx(Pt,{title:"Integration Warning",className:"max-w-sm",children:e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx("div",{className:"space-y-2",children:(Me||[]).map((re,Ce)=>e.jsxs("div",{className:"flex items-start gap-2 text-xs text-text-1 font-sans",children:[e.jsx(Gt,{size:13,className:"text-warning flex-shrink-0 mt-0.5"}),e.jsx("span",{children:re.name?`${re.name}: ${re.problem==="not_installed"?"not installed":re.problem==="not_configured"?"not configured":"not authenticated"}`:re.message||String(re)})]},Ce))}),e.jsx("p",{className:"text-2xs text-text-3 font-sans",children:"Continue anyway?"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(fe,{variant:"ghost",size:"md",onClick:()=>ie(null),className:"flex-1",children:"Cancel"}),e.jsx(fe,{variant:"warning",size:"md",onClick:()=>{ie(null),rs()},className:"flex-1",children:"Spawn Anyway"})]})]})})})]})}function GX({title:t,icon:a,defaultOpen:n=!1,badge:s,children:o,className:c}){const[l,A]=g.useState(n);return e.jsxs("div",{className:V("border-t border-border-subtle",c),children:[e.jsxs("button",{onClick:()=>A(!l),className:"w-full flex items-center gap-2 px-5 py-3 text-left cursor-pointer hover:bg-surface-5/30 transition-colors group",children:[e.jsx(Rt,{size:12,className:V("text-text-4 transition-transform duration-200 flex-shrink-0",l&&"rotate-90")}),a&&e.jsx(a,{size:13,className:"text-text-3 flex-shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider flex-1",children:t}),s&&e.jsx("span",{className:"text-2xs font-mono text-text-4 bg-surface-4 px-1.5 py-0.5 rounded",children:s})]}),l&&e.jsx("div",{className:"px-5 pb-4",children:o})]})}function oZe(){const t=$(m=>m.journalistStatus),a=$(m=>m.fetchJournalist),n=$(m=>m.triggerJournalistCycle),[s,o]=g.useState(!0),[c,l]=g.useState(!1);g.useEffect(()=>{a().then(()=>o(!1));const m=setInterval(a,1e4);return()=>clearInterval(m)},[a]);async function A(){l(!0);try{await n()}catch{}l(!1)}if(s)return e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsx(Xn,{className:"h-6 w-32 rounded"}),e.jsx(Xn,{className:"h-20 rounded-md"}),e.jsx(Xn,{className:"h-20 rounded-md"})]});const u=t||{},f=u.lastSynthesis,x=u.history||[];return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-5 py-4 border-b border-border-subtle flex items-center gap-2",children:[e.jsx(Jo,{size:16,className:"text-accent"}),e.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans flex-1",children:"Journalist"}),e.jsxs(fe,{variant:"secondary",size:"sm",onClick:A,disabled:c,className:"gap-1.5 text-2xs",children:[e.jsx(ra,{size:11,className:c?"animate-spin":""}),c?"Running...":"Run Synthesis"]})]}),e.jsx(it,{className:"flex-1",children:e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ys,{size:10}),e.jsxs("span",{children:[u.cycleCount||0," cycles"]})]}),u.lastCycleTime&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Rr,{size:10}),e.jsxs("span",{children:["Last: ",Mt(u.lastCycleTime)]})]}),e.jsx(be,{variant:u.cycleCount>0?"success":"default",className:"text-2xs",children:u.cycleCount>0?"Active":"Idle"})]}),(f==null?void 0:f.summary)&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-xs font-semibold text-text-1 font-sans flex items-center gap-1.5",children:[e.jsx(Va,{size:12,className:"text-text-3"}),"Latest Summary"]}),e.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-sans leading-relaxed",children:f.summary})]}),(f==null?void 0:f.projectMap)&&e.jsx(GX,{title:"Project Map",icon:N0,children:e.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-mono leading-relaxed max-h-64 overflow-y-auto whitespace-pre-wrap",children:f.projectMap})}),(f==null?void 0:f.decisions)&&e.jsx(GX,{title:"Decisions Log",icon:Va,children:e.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-mono leading-relaxed max-h-64 overflow-y-auto whitespace-pre-wrap",children:f.decisions})}),x.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-xs font-semibold text-text-1 font-sans flex items-center gap-1.5",children:[e.jsx(Rr,{size:12,className:"text-text-3"}),"History (",x.length,")"]}),e.jsx("div",{className:"space-y-1.5",children:x.slice().reverse().slice(0,20).map((m,y)=>e.jsxs("div",{className:"bg-surface-0 rounded-md border border-border-subtle px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[e.jsxs(be,{variant:"default",className:"text-2xs",children:["Cycle ",m.cycle]}),e.jsxs("span",{className:"text-text-4 font-sans",children:[m.agentCount," agent",m.agentCount!==1?"s":""]}),e.jsx("span",{className:"text-text-4 font-sans ml-auto",children:Mt(m.timestamp)})]}),m.summary&&e.jsx("p",{className:"text-xs text-text-2 font-sans mt-1 leading-relaxed",children:m.summary})]},y))})]}),!f&&x.length===0&&e.jsxs("div",{className:"text-center py-8 text-text-4 font-sans",children:[e.jsx(Jo,{size:28,className:"mx-auto mb-2"}),e.jsx("p",{className:"text-sm",children:"No synthesis data yet"}),e.jsx("p",{className:"text-2xs mt-1",children:"The journalist runs automatically when agents are active, or trigger manually above"})]})]})})]})}function iZe({children:t,height:a,onHeightChange:n,visible:s,fullHeight:o,tabs:c,activeTab:l,onSelectTab:A,onAddTab:u,onCloseTab:f,onToggleFullHeight:x,onMinimize:m,onRenameTab:y}){const v=g.useRef(!1),[O,b]=g.useState(null),[C,j]=g.useState(""),N=g.useRef(0),M=g.useRef(0),Q=g.useCallback(B=>{if(o)return;B.preventDefault(),v.current=!0,N.current=B.clientY,M.current=a;function S(z){if(!v.current)return;const P=N.current-z.clientY,F=Math.min(Math.max(M.current+P,120),600);n(F)}function I(){v.current=!1,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",I)}document.addEventListener("mousemove",S),document.addEventListener("mouseup",I)},[a,n,o]),L=c||[{id:"default",label:"Terminal"}];return e.jsxs("div",{className:V("flex flex-col border-t border-border bg-surface-0 relative",!s&&"hidden"),style:s?o?{flex:1,minHeight:0}:{height:a,flexShrink:0}:{height:0},children:[!o&&e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-row-resize hover:bg-accent/30 transition-colors z-10",onMouseDown:Q}),e.jsxs("div",{className:"flex items-center h-9 bg-surface-1 border-b border-border flex-shrink-0 pl-0 pr-3",children:[e.jsxs("div",{className:"flex items-center gap-0 flex-1 min-w-0 overflow-x-auto scrollbar-none h-full",children:[L.map(B=>e.jsxs("button",{onClick:()=>A==null?void 0:A(B.id),onDoubleClick:()=>{b(B.id),j(B.label)},className:V("inline-flex items-center gap-1.5 px-3 h-full text-[11px] font-medium font-sans cursor-pointer select-none transition-colors duration-100 flex-shrink-0",B.id===l?"text-text-0 bg-surface-3":"text-text-2 hover:text-text-0 hover:bg-surface-5/50"),children:[e.jsx(Ns,{size:11}),O===B.id?e.jsx("input",{className:"bg-transparent border border-border rounded px-1 text-[11px] text-text-0 outline-none w-20 font-sans",value:C,onChange:S=>j(S.target.value),onBlur:()=>{C.trim()&&(y==null||y(B.id,C.trim())),b(null)},onKeyDown:S=>{S.key==="Enter"&&(C.trim()&&(y==null||y(B.id,C.trim())),b(null)),S.key==="Escape"&&b(null)},autoFocus:!0,onClick:S=>S.stopPropagation()}):e.jsx("span",{className:"truncate max-w-[100px]",children:B.label}),L.length>1&&e.jsx("button",{onClick:S=>{S.stopPropagation(),f==null||f(B.id)},className:"ml-1 p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(Ge,{size:9})})]},B.id)),e.jsx("button",{onClick:u,className:"flex items-center justify-center w-6 h-6 text-text-3 hover:text-text-0 hover:bg-surface-5/50 rounded cursor-pointer transition-colors flex-shrink-0 ml-1",title:"New terminal",children:e.jsx(ht,{size:11})})]}),e.jsx("div",{className:"flex items-center gap-0.5 flex-shrink-0 ml-2",children:o?e.jsx("button",{onClick:m,className:"p-1.5 rounded text-text-3 hover:text-text-0 hover:bg-surface-5 cursor-pointer transition-colors",title:"Restore",children:e.jsx(S0,{size:12})}):e.jsx("button",{onClick:x,className:"p-1.5 rounded text-text-3 hover:text-text-0 hover:bg-surface-5 cursor-pointer transition-colors",title:"Maximize",children:e.jsx(BA,{size:12})})})]}),e.jsx("div",{className:"flex-1 min-h-0 pl-2 pt-1",children:t})]})}const cZe={background:"#1a1e25",foreground:"#c8ccd4",cursor:"#33afbc",cursorAccent:"#1a1e25",selectionBackground:"rgba(51, 175, 188, 0.3)",selectionForeground:"#ffffff",black:"#1a1e25",red:"#e06c75",green:"#4ae168",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#33afbc",white:"#abb2bf",brightBlack:"#5c6370",brightRed:"#f07178",brightGreen:"#4ae168",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#ffffff"};let OP=0,lZe=0;function dZe({tabId:t,visible:a,registerKill:n}){const s=g.useRef(null),o=g.useRef(null),c=g.useRef(null),l=g.useRef(null),A=g.useRef(null),u=g.useRef(!1),f=g.useRef(a),x=g.useRef({cols:0,rows:0});return g.useEffect(()=>{n==null||n(t,()=>{const m=$.getState().ws;(m==null?void 0:m.readyState)===WebSocket.OPEN&&l.current&&m.send(JSON.stringify({type:"terminal:kill",id:l.current}))})},[t,n]),g.useEffect(()=>{if(!s.current||u.current)return;u.current=!0;const m=new fne({theme:cZe,fontFamily:"'JetBrains Mono Variable', 'SF Mono', monospace",fontSize:12,lineHeight:1.1,letterSpacing:0,cursorBlink:!0,cursorStyle:"bar",cursorWidth:1,scrollback:1e4,allowProposedApi:!0,minimumContrastRatio:1,drawBoldTextInBrightColors:!0,fontWeight:"400",fontWeightBold:"600",overviewRulerWidth:0}),y=new xne;m.loadAddon(y),m.loadAddon(new mne),m.open(s.current),o.current=m,c.current=y;let v=0;function O(){v++;const C=$.getState().ws;if(!C||C.readyState!==WebSocket.OPEN){v<20&&setTimeout(O,500);return}const j=`spawn-${++lZe}`;C.send(JSON.stringify({type:"terminal:spawn",cols:m.cols,rows:m.rows,requestId:j}));function N(M){let Q;try{Q=JSON.parse(M.data)}catch{return}Q.type==="terminal:spawned"&&Q.requestId===j&&!l.current?l.current=Q.id:Q.type==="terminal:output"&&Q.id===l.current?m.write(Q.data):Q.type==="terminal:exit"&&Q.id===l.current&&(m.write(`\r
8686
+ `),lang:A});continue}if(/^#{1,3}\s/.test(o)||/^\*\*[^*]+:\*\*\s*$/.test(o.trim())){const l=o.replace(/^#+\s*/,"").replace(/^\*\*/,"").replace(/:\*\*\s*$/,":").trim();a.push({type:"heading",content:l}),s++;continue}if(/^\s*[-*]\s/.test(o)){const l=[];for(;s<n.length&&/^\s*[-*]\s/.test(n[s]);)l.push(n[s].replace(/^\s*[-*]\s+/,"").trim()),s++;a.push({type:"list",items:l});continue}if(/^\s*\d+[\.)]\s/.test(o)){const l=[];for(;s<n.length&&/^\s*\d+[\.)]\s/.test(n[s]);)l.push(n[s].replace(/^\s*\d+[\.)]\s+/,"").trim()),s++;a.push({type:"numbered",items:l});continue}if(o.includes("|")&&s+1<n.length&&/^\|?\s*[-:]+/.test(n[s+1])){const l=o.split("|").map(u=>u.trim()).filter(Boolean);s+=2;const A=[];for(;s<n.length&&n[s].includes("|");)A.push(n[s].split("|").map(u=>u.trim()).filter(Boolean)),s++;a.push({type:"table",headers:l,rows:A});continue}if(!o.trim()){s++;continue}if(/^(Note|Warning|Important|IMPORTANT|TODO):/i.test(o.trim())){a.push({type:"note",content:o.trim()}),s++;continue}const c=[];for(;s<n.length&&n[s].trim()&&!/^#{1,3}\s/.test(n[s])&&!/^\s*[-*]\s/.test(n[s])&&!/^\s*\d+[\.)]\s/.test(n[s])&&!n[s].trimStart().startsWith("```");)c.push(n[s].trim()),s++;c.length>0&&a.push({type:"para",content:c.join(" ")})}return e.jsx("div",{className:"space-y-2",children:a.map((o,c)=>{switch(o.type){case"heading":return e.jsxs("div",{className:"flex items-center gap-1.5 pt-1.5 first:pt-0",children:[e.jsx("div",{className:"w-1 h-3.5 rounded-full bg-accent/40 flex-shrink-0"}),e.jsx("span",{className:"text-[12px] font-semibold text-text-0 font-sans",children:e.jsx(G1,{text:o.content})})]},c);case"list":return e.jsx("div",{className:"space-y-1 pl-2",children:o.items.map((l,A)=>e.jsxs("div",{className:"flex gap-2 text-[12px] text-text-0 font-sans leading-relaxed",children:[e.jsx("span",{className:"text-accent/50 mt-0.5 flex-shrink-0",children:"-"}),e.jsx("span",{className:"min-w-0",children:e.jsx(G1,{text:l})})]},A))},c);case"numbered":return e.jsx("div",{className:"space-y-1 pl-2",children:o.items.map((l,A)=>e.jsxs("div",{className:"flex gap-2 text-[12px] text-text-0 font-sans leading-relaxed",children:[e.jsxs("span",{className:"text-text-4 font-mono w-4 text-right flex-shrink-0",children:[A+1,"."]}),e.jsx("span",{className:"min-w-0",children:e.jsx(G1,{text:l})})]},A))},c);case"code":return e.jsx("pre",{className:"p-2.5 rounded-md bg-[#0d1117] text-[11px] font-mono text-[#c9d1d9] overflow-x-auto whitespace-pre-wrap border border-white/[0.06] leading-relaxed",children:o.content},c);case"table":return e.jsx(sz,{headers:o.headers,rows:o.rows},c);case"note":return e.jsxs("div",{className:"flex items-start gap-1.5 px-2.5 py-1.5 rounded-md bg-warning/6 border border-warning/12",children:[e.jsx(Xt,{size:10,className:"text-warning mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-[11px] text-warning/80 font-sans",children:e.jsx(G1,{text:o.content})})]},c);case"para":default:return e.jsx("p",{className:"text-[12px] text-text-0 font-sans leading-relaxed",children:e.jsx(G1,{text:o.content})},c)}})})}function UXe({text:t}){if(!t)return null;const a=t.split(/(```[\s\S]*?```)/g);return e.jsx("span",{children:a.map((n,s)=>{if(n.startsWith("```")&&n.endsWith("```")){const o=n.slice(3,-3).replace(/^\w+\n/,"");return e.jsx("pre",{className:"my-1.5 p-2 rounded-md bg-[#0d1117] text-[11px] font-mono text-[#c9d1d9] overflow-x-auto whitespace-pre-wrap border border-white/[0.06]",children:o},s)}return e.jsx("span",{children:e.jsx(G1,{text:n})},s)})})}function PXe({msg:t}){const a=t.isQuery;return e.jsx("div",{className:"flex justify-end pl-8",children:e.jsxs("div",{className:"max-w-[90%]",children:[a&&e.jsxs("div",{className:"flex items-center justify-end gap-1 mb-1",children:[e.jsx(Na,{size:9,className:"text-info"}),e.jsx("span",{className:"text-2xs text-info font-sans font-medium",children:"Query"})]}),e.jsx("div",{className:V("px-3.5 py-2.5 rounded-lg border","bg-info/10 border-info/25"),children:e.jsx("div",{className:"text-[12px] font-sans whitespace-pre-wrap break-words leading-relaxed text-text-0",children:e.jsx(UXe,{text:t.text})})}),e.jsx("div",{className:"text-[10px] text-text-4 font-sans mt-1 text-right",children:Mt(t.timestamp)})]})})}function EXe({msg:t,agent:a}){var c,l;const[n,s]=g.useState(((c=t.text)==null?void 0:c.length)>600),o=((l=t.text)==null?void 0:l.length)>600;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-1 font-sans",children:(a==null?void 0:a.name)||"Agent"}),e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:a==null?void 0:a.role}),e.jsx("span",{className:"text-[10px] text-text-4 font-sans ml-auto",children:Mt(t.timestamp)})]}),e.jsx("div",{className:"border-l border-accent pl-3.5 py-1",children:e.jsx(IXe,{text:n?t.text.slice(0,600)+"...":t.text})}),n&&e.jsxs("button",{onClick:()=>s(!1),className:"ml-3.5 mt-1.5 flex items-center gap-1.5 text-[11px] text-accent/70 hover:text-accent font-sans font-medium cursor-pointer transition-colors",children:[e.jsx(bt,{size:11}),"Show full response"]}),o&&!n&&e.jsxs("button",{onClick:()=>s(!0),className:"ml-3.5 mt-1.5 flex items-center gap-1.5 text-[11px] text-accent/70 hover:text-accent font-sans font-medium cursor-pointer transition-colors",children:[e.jsx(bt,{size:11,className:"rotate-180"}),"Collapse"]})]})}function zXe({msg:t}){return e.jsxs("div",{className:"flex items-center gap-3 py-2",children:[e.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),e.jsx("span",{className:"text-[10px] text-text-4 font-sans flex-shrink-0 uppercase tracking-wide",children:t.text}),e.jsx("div",{className:"flex-1 h-px bg-border-subtle"})]})}function FXe({entries:t,isLive:a}){const[n,s]=g.useState(0);if(g.useEffect(()=>{if(!a||t.length<=1)return;const c=setInterval(()=>s(l=>(l+1)%t.length),1500);return()=>clearInterval(c)},[t.length,a]),!a){const c=t[t.length-1],A=Mee(c.text).icon;return e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 text-[10px] text-text-4 font-mono",children:[e.jsx(A,{size:10,className:"opacity-50"}),e.jsxs("span",{children:[t.length," tool call",t.length!==1?"s":""]})]})}const o=t[Math.min(n,t.length-1)];return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 w-full rounded-md bg-surface-3/50 border border-border-subtle/30",children:[e.jsx($e,{size:11,className:"text-accent animate-spin flex-shrink-0"}),e.jsx("span",{className:"text-[11px] text-text-2 font-mono truncate min-w-0 flex-1 transition-opacity duration-300",children:o.text}),t.length>1&&e.jsx("span",{className:"text-[10px] text-text-4 font-mono flex-shrink-0",children:t.length})]})}function RXe({agent:t}){const a=$(u=>u.activityLog[t.id])||bE,n=a[a.length-1],s=n?Mee(n.text):null,o=(s==null?void 0:s.icon)||Zt,c=n&&Date.now()-n.timestamp<1e4,l=c&&n.text?n.text.length>60?n.text.slice(0,60)+"...":n.text:null,A=Math.round((t.contextUsage||0)*100);return e.jsxs("div",{className:"flex items-center gap-3 px-4 h-8 border-b border-border-subtle bg-surface-1/80 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("span",{className:"absolute inset-0 rounded-full bg-accent/15 animate-ping",style:{animationDuration:"2s"}}),e.jsx("span",{className:"relative w-1.5 h-1.5 rounded-full bg-accent"})]}),c?e.jsxs(e.Fragment,{children:[e.jsx(o,{size:10,className:V(s.color,"flex-shrink-0")}),e.jsx("span",{className:"text-[11px] text-text-2 font-sans truncate",children:l})]}):e.jsx("span",{className:"text-[11px] text-text-3 font-sans",children:"Working..."})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-[10px] text-text-4 font-mono",children:HXe(t.tokensUsed)}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-14 h-0.5 rounded-sm bg-surface-4 overflow-hidden",children:e.jsx("div",{className:"h-full rounded-sm transition-all duration-500",style:{width:`${A}%`,background:A>=75?"var(--color-danger)":A>=50?"var(--color-warning)":"var(--color-accent)"}})}),e.jsxs("span",{className:"text-[10px] text-text-4 font-mono w-7 text-right",children:[A,"%"]})]})]})]})}function HXe(t){return t?t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":String(t):"0"}function qXe({agent:t}){const[a,n]=g.useState([]),s=[{text:`Initializing ${t.name}`,delay:0},{text:`Role: ${t.role}`,delay:400},{text:`Provider: ${t.provider||"claude-code"}`,delay:700},{text:"Loading workspace context",delay:1e3},{text:"Scanning project structure",delay:1400},{text:"Session active",delay:1900}];return g.useEffect(()=>{const o=s.map((c,l)=>setTimeout(()=>n(A=>[...A,l]),c.delay));return()=>o.forEach(clearTimeout)},[]),e.jsxs("div",{className:"flex flex-col px-4 pt-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsxs("div",{className:"relative w-9 h-9",children:[e.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-accent/20 animate-ping",style:{animationDuration:"2s"}}),e.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-accent animate-spin",style:{animationDuration:"1s"}}),e.jsx("span",{className:"absolute inset-[5px] rounded-full bg-accent/8"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-text-0 font-sans",children:t.name}),e.jsx("p",{className:"text-2xs text-accent font-mono",children:"starting up"})]})]}),e.jsx("div",{className:"space-y-2 pl-3 border-l border-accent/15",children:s.map((o,c)=>{const l=a.includes(c),A=c===s.length-1;return e.jsxs("div",{className:V("flex items-center gap-2.5 transition-all duration-300",l?"opacity-100 translate-x-0":"opacity-0 -translate-x-2"),children:[e.jsx("span",{className:V("w-1 h-1 rounded-full flex-shrink-0",A&&l?"bg-accent":l?"bg-text-3":"bg-transparent")}),e.jsx("span",{className:V("text-[11px] font-mono",A&&l?"text-accent":"text-text-3"),children:o.text}),A&&l&&e.jsxs("span",{className:"flex gap-0.5 ml-1",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-accent animate-pulse",style:{animationDelay:"0ms"}}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-accent animate-pulse",style:{animationDelay:"200ms"}}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-accent animate-pulse",style:{animationDelay:"400ms"}})]})]},c)})})]})}function DXe({agent:t}){const a=$(F=>F.chatHistory[t.id])||bE,n=$(F=>F.activityLog[t.id])||bE,s=$(F=>F.instructAgent),o=$(F=>F.queryAgent),c=$(F=>{var K;return(K=F.thinkingAgents)==null?void 0:K.has(t.id)}),l=$(F=>F.chatInputs[t.id]||""),A=F=>$.setState(K=>({chatInputs:{...K.chatInputs,[t.id]:F}})),u=l,f=A,[x,m]=g.useState("instruct"),[y,v]=g.useState(!1),[O,b]=g.useState(36),C=g.useRef(null),j=g.useRef(null),N=g.useRef(null),M=g.useRef(null),Q=g.useRef(!0);g.useEffect(()=>{const F=j.current;if(!F)return;function K(){Q.current=F.scrollHeight-F.scrollTop-F.clientHeight<60}return F.addEventListener("scroll",K),()=>F.removeEventListener("scroll",K)},[]);const L=g.useCallback(F=>{F.preventDefault();const K=F.clientY,G=O,H=_=>b(Math.min(Math.max(36,G-(_.clientY-K)),280)),q=()=>{window.removeEventListener("mousemove",H),window.removeEventListener("mouseup",q)};window.addEventListener("mousemove",H),window.addEventListener("mouseup",q)},[O]),B=g.useMemo(()=>{var R;const F=[],K=new Set;for(const U of a){const Z=`${U.from}:${(R=U.text)==null?void 0:R.slice(0,100)}`;F.find(Ae=>{var W;return Ae.kind==="chat"&&`${Ae.from}:${(W=Ae.text)==null?void 0:W.slice(0,100)}`===Z&&Math.abs(Ae.ts-U.timestamp)<5e3})||(F.push({...U,kind:"chat",ts:U.timestamp}),K.add(U.text))}const G=K,H=n.slice(-30);for(const U of H)(U.text||"").trim()&&!G.has(U.text)&&F.push({...U,kind:"activity",ts:U.timestamp});F.sort((U,Z)=>U.ts-Z.ts);const q=[];let _=[];for(const U of F)U.kind==="activity"?_.push(U):(_.length>0&&(q.push({kind:"activity-group",entries:_}),_=[]),q.push(U));return _.length>0&&q.push({kind:"activity-group",entries:_}),q},[a,n]);g.useEffect(()=>{Q.current&&j.current&&requestAnimationFrame(()=>{j.current&&(j.current.scrollTop=j.current.scrollHeight)})},[B.length,y,c]);async function S(F){var q;const K=Array.from(F.target.files||[]);if(K.length===0)return;const G=$.getState().addToast,H=[];for(const _ of K)try{const R=await new Promise((U,Z)=>{const J=new FileReader;J.onload=()=>U(J.result.split(",")[1]),J.onerror=Z,J.readAsDataURL(_)});await D.post(`/agents/${t.id}/upload`,{filename:_.name,content:R}),H.push(_.name)}catch(R){G("error",`Upload failed: ${_.name}`,R.message)}if(H.length>0){const _=H.join(", ");f(R=>(R?R+`
8687
+ `:"")+`[Uploaded: ${_}] — I've uploaded these files to your working directory. Read them and use their content.`),G("success",`Uploaded ${H.length} file${H.length>1?"s":""}`)}F.target.value="",(q=N.current)==null||q.focus()}async function I(){var K;const F=u.trim();if(!(!F||y)){if(F==="/rotate"){const G=$.getState().rotateAgent;f("");try{await G(t.id)}catch{}return}f(""),v(!0),Q.current=!0,requestAnimationFrame(()=>{j.current&&(j.current.scrollTop=j.current.scrollHeight)});try{x==="query"?await o(t.id,F):await s(t.id,F)}catch{}v(!1),(K=N.current)==null||K.focus()}}function z(F){F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),I())}const P=t.status==="running"||t.status==="starting";return e.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[P&&e.jsx(RXe,{agent:t}),e.jsxs("div",{ref:j,className:"flex-1 overflow-y-auto px-4 py-4 space-y-4",children:[!B.some(F=>F.from==="agent"||F.kind==="activity-group")&&(P?e.jsx(qXe,{agent:t}):e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center py-8",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-surface-3 flex items-center justify-center mb-3",children:e.jsx(Cn,{size:18,className:"text-text-4"})}),e.jsx("p",{className:"text-sm font-semibold text-text-0 font-sans",children:t.name}),e.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Session complete — send a message to continue"})]})),B.map((F,K)=>{if(F.kind==="activity-group"){const G=!B.slice(K+1).some(H=>H.kind==="activity-group"||H.from==="agent");return e.jsx("div",{children:e.jsx(FXe,{entries:F.entries,isLive:P&&G})},`grp-${K}`)}return F.from==="user"?e.jsx(PXe,{msg:F},`msg-${K}`):F.from==="system"?e.jsx(zXe,{msg:F},`msg-${K}`):e.jsx(EXe,{msg:F,agent:t},`msg-${K}`)}),e.jsx(Pu,{children:(y||c)&&e.jsx(as.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.25,ease:"easeOut"},children:e.jsx(Cee,{agent:t})},"thinking")})]}),e.jsxs("div",{className:"bg-surface-1/50 flex-shrink-0",children:[e.jsx("div",{ref:C,onMouseDown:L,className:"flex items-center justify-center h-5 cursor-row-resize border-t border-border hover:bg-surface-3/50 transition-colors group",children:e.jsx(lu,{size:12,className:"text-text-4 group-hover:text-text-2 transition-colors"})}),e.jsxs("div",{className:"px-4 pb-3",children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2",children:[e.jsxs("button",{onClick:()=>m("instruct"),className:V("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[11px] font-sans font-medium transition-colors cursor-pointer",x==="instruct"?"bg-accent/12 text-accent border border-accent/20":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:[e.jsx(js,{size:10}),"Instruct"]}),e.jsxs("button",{onClick:()=>m("query"),className:V("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[11px] font-sans font-medium transition-colors cursor-pointer",x==="query"?"bg-info/12 text-info border border-info/20":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:[e.jsx(Na,{size:10}),"Query"]}),e.jsx("span",{className:"text-[10px] text-text-4 font-sans ml-auto",children:x==="query"?"Read-only — agent keeps working":P?"Directs the agent":"Continues the session"})]}),e.jsxs("div",{className:V("flex items-end gap-1 rounded-xl border bg-surface-0 p-1 transition-colors",x==="query"?"border-info/20 focus-within:border-info/40":"border-border-subtle focus-within:border-accent/30"),children:[e.jsx("input",{ref:M,type:"file",multiple:!0,accept:".pdf,.png,.jpg,.jpeg,.gif,.svg,.csv,.txt,.md,.json,.yaml,.yml,.docx,.pptx,.xlsx",onChange:S,className:"hidden"}),e.jsx("button",{onClick:()=>{var F;return(F=M.current)==null?void 0:F.click()},className:"w-9 h-9 flex items-center justify-center rounded-lg text-text-4 hover:text-text-1 hover:bg-surface-3 transition-colors cursor-pointer flex-shrink-0 mb-px",title:"Attach file",children:e.jsx(mu,{size:14})}),e.jsx("textarea",{ref:N,value:u,onChange:F=>f(F.target.value),onKeyDown:z,placeholder:x==="query"?"Ask about this agent's work...":P?"Send an instruction...":"Continue this session...",rows:1,className:V("flex-1 resize-none px-3 py-2 text-[13px]","bg-transparent text-text-0 font-sans","placeholder:text-text-4","focus:outline-none"),style:{height:O}}),P&&e.jsx("button",{onClick:()=>$.getState().stopAgent(t.id),title:"Stop agent",className:"w-9 h-9 flex items-center justify-center rounded-lg hover:bg-danger/10 transition-colors cursor-pointer flex-shrink-0 mb-px",children:e.jsxs("span",{className:"relative flex items-center justify-center w-3.5 h-3.5",children:[e.jsx("span",{className:"absolute inset-0 rounded-full bg-danger/30 animate-ping",style:{animationDuration:"2s"}}),e.jsx("span",{className:"relative w-2.5 h-2.5 rounded-full bg-danger"})]})}),e.jsx("button",{onClick:I,disabled:!u.trim()||y,className:V("w-9 h-9 flex items-center justify-center rounded-lg transition-all cursor-pointer flex-shrink-0 mb-px","disabled:opacity-15 disabled:cursor-not-allowed",u.trim()?x==="query"?"bg-info/15 text-info hover:bg-info/25 border border-info/25":"bg-accent/15 text-accent hover:bg-accent/25 border border-accent/25":"bg-transparent text-text-4"),children:y?e.jsx($e,{size:15,className:"animate-spin"}):e.jsx(Xa,{size:15})})]})]})]})]})}function jf({options:t,value:a,onChange:n}){return e.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:t.map(s=>e.jsx("button",{onClick:()=>n(s.value),className:V("flex-1 px-3 py-1.5 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",a===s.value?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:s.label},s.value))})}function nn({label:t,icon:a,children:n,description:s}){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-semibold text-text-1 font-sans",children:[a&&e.jsx(a,{size:13,className:"text-text-3"}),t]}),s&&e.jsx("p",{className:"text-2xs text-text-4 font-sans mt-0.5",children:s})]}),n]})}function VXe({agent:t}){const a=$(O=>O.killAgent),n=$(O=>O.rotateAgent),s=$(O=>O.spawnAgent),o=$(O=>O.closeDetail),c=$(O=>O.addToast),[l,A]=g.useState(null),[u,f]=g.useState(!1),x=t.status==="running"||t.status==="starting";async function m(){A("rotate");try{await n(t.id)}catch{}A(null)}async function y(){if(!u){f(!0),setTimeout(()=>f(!1),3e3);return}A("kill");try{await a(t.id,!x),o()}catch{}A(null),f(!1)}async function v(){A("clone");try{await s({role:t.role,provider:t.provider,model:t.model,name:`${t.name}-clone`,scope:t.scope,workingDir:t.workingDir}),c("success",`Cloned ${t.name}`)}catch{}A(null)}return x?e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs(fe,{variant:"primary",size:"md",onClick:m,disabled:l==="rotate",className:"gap-1.5",children:[e.jsx(Vr,{size:12,className:l==="rotate"?"animate-spin":""}),"Rotate"]}),e.jsxs(fe,{variant:"info",size:"md",onClick:v,disabled:!!l,className:"gap-1.5",children:[e.jsx(wn,{size:12})," Clone"]}),e.jsxs(fe,{variant:"danger",size:"md",onClick:y,disabled:l==="kill",className:"gap-1.5",children:[e.jsx($A,{size:12}),u?"Confirm":"Kill"]})]})}):e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs(fe,{variant:"info",size:"md",onClick:v,disabled:!!l,className:"gap-1.5",children:[e.jsx(wn,{size:12})," Clone"]}),e.jsxs(fe,{variant:"danger",size:"md",onClick:y,disabled:l==="kill",className:"gap-1.5",children:[e.jsx(At,{size:12}),u?"Confirm":"Remove"]})]})}function XXe({agent:t}){var Wt;const a=$(se=>se.addToast),n=$(se=>se.remoteHomedir),[s,o]=g.useState([]),[c,l]=g.useState(t.model||""),[A,u]=g.useState(""),[f,x]=g.useState(t.effort||"default"),[m,y]=g.useState(!1),[v,O]=g.useState(""),[b,C]=g.useState(null),[j,N]=g.useState(!1),[M,Q]=g.useState(null),[L,B]=g.useState(t.routingMode||"auto"),[S,I]=g.useState([]),[z,P]=g.useState([]),[F,K]=g.useState("hr"),[G,H]=g.useState("1"),[q,_]=g.useState(!1),[R,U]=g.useState(""),[Z,J]=g.useState(!1),[Ae,W]=g.useState([]),[ae,Oe]=g.useState(!1),[ve,ce]=g.useState([]),[he,je]=g.useState(null),ee=t.status==="running"||t.status==="starting";g.useEffect(()=>{ke(),D.get("/skills/installed").then(Me=>I(Array.isArray(Me)?Me:Me.skills||[])).catch(()=>{}),D.get("/integrations/installed").then(Me=>ce(Array.isArray(Me)?Me:[])).catch(()=>{}),D.get("/repos/imported").then(Me=>P((Array.isArray(Me)?Me:[]).filter(ie=>ie.status==="active"))).catch(()=>{}),t.provider==="claude-code"&&D.get("/providers/claude-code/auth").then(Me=>je(Me)).catch(()=>je(null));function se(){ke()}return window.addEventListener("groove:providers-changed",se),()=>window.removeEventListener("groove:providers-changed",se)},[]);function ke(){D.get("/providers").then(se=>o(Array.isArray(se)?se:[])).catch(()=>{})}g.useEffect(()=>{l(t.model||""),D.get(`/agents/${t.id}/routing/recommend`).then(se=>{B((se==null?void 0:se.mode)||"fixed")}).catch(()=>{})},[t.id,t.model]),g.useEffect(()=>{J(!1),t.personality?D.get(`/personalities/${t.name}`).then(se=>{U((se==null?void 0:se.content)||""),J(!0)}).catch(()=>{U(""),J(!0)}):(U(""),J(!0)),D.get("/personalities").then(se=>{W(Array.isArray(se)?se:se.personalities||[])}).catch(()=>{})},[t.id,t.name]);const ye=s.find(se=>se.id===t.provider);async function Ne(se,Me){l(Me);try{const ie={model:Me};se&&se!==t.provider&&(ie.provider=se),await D.patch(`/agents/${t.id}`,ie),a("success",`Model → ${Me}${ie.provider?` (${se})`:""}`)}catch(ie){a("error","Model swap failed",ie.message)}}async function ze(se){try{await D.patch(`/agents/${t.id}`,{workingDir:se}),a("success",`Working dir → ${se.split("/").pop()||se}`)}catch(Me){a("error","Update failed",Me.message)}}async function He(se){x(se);try{await D.patch(`/agents/${t.id}`,{effort:se}),a("success",`Effort → ${se}`)}catch(Me){a("error","Update failed",Me.message)}}async function Tt(se){if(!se.trim())return;const Me=[...t.scope||[],se.trim()];try{await D.patch(`/agents/${t.id}`,{scope:Me}),u("")}catch(ie){a("error","Scope update failed",ie.message)}}async function Et(se){const Me=(t.scope||[]).filter((ie,Re)=>Re!==se);try{await D.patch(`/agents/${t.id}`,{scope:Me})}catch(ie){a("error","Scope update failed",ie.message)}}async function ya(se){if(v.trim())try{await D.post(`/credentials/${se}`,{key:v.trim()}),a("success",`API key set for ${se}`),O(""),C(null),ke(),window.dispatchEvent(new CustomEvent("groove:providers-changed"))}catch(Me){a("error","Failed to set key",Me.message)}}const Nn=t.spawnedAt||t.createdAt;return e.jsxs("div",{className:"px-5 py-5 space-y-6 overflow-y-auto h-full",children:[e.jsx(nn,{label:"Active Model",icon:Ba,children:e.jsxs("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-bold font-mono text-text-0",children:t.model||"auto"}),e.jsx("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:(ye==null?void 0:ye.name)||t.provider})]}),(ye==null?void 0:ye.canHotSwap)&&ee&&e.jsxs(be,{variant:"accent",className:"text-2xs gap-1",children:[e.jsx(wt,{size:8})," Hot-swap"]})]}),((Wt=ye==null?void 0:ye.models)==null?void 0:Wt.length)>1&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3 pt-3 border-t border-border-subtle",children:ye.models.filter(se=>!se.disabled).map(se=>{const Me=se.id===t.model;return e.jsx("button",{onClick:()=>Ne(t.provider,se.id),disabled:!1,className:V("px-2.5 py-1 rounded-md text-xs font-mono transition-all","cursor-pointer",Me?"bg-accent/15 text-accent font-semibold":"bg-surface-4 text-text-2 hover:bg-surface-5 hover:text-text-0"),children:se.name||se.id},se.id)})})]})}),e.jsx(VXe,{agent:t}),e.jsxs(nn,{label:"Providers",icon:Dn,description:"Click a provider to see its models and connection status.",children:[e.jsx("div",{className:"space-y-1.5",children:s.map(se=>{var St;const Me=se.id===t.provider,ie=se.authType==="subscription"?se.installed||((St=se.authStatus)==null?void 0:St.authenticated):se.authType==="local"?se.installed:se.installed&&se.hasKey,Re=M===se.id,xt=se.models||[];return e.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-0 overflow-hidden",children:[e.jsxs("button",{onClick:()=>Q(Re?null:se.id),className:"w-full flex items-center gap-2.5 px-3 py-2 cursor-pointer hover:bg-surface-4/50 transition-colors",children:[e.jsx("div",{className:V("w-2 h-2 rounded-full flex-shrink-0",ie?"bg-success":"bg-text-4")}),e.jsx("span",{className:V("text-xs font-semibold font-sans flex-1 text-left",ie?"text-text-0":"text-text-3"),children:se.name||se.id}),Me&&e.jsx(be,{variant:"accent",className:"text-2xs",children:"Active"}),!ie&&e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:se.installed?"No key":"Not installed"}),e.jsx(bt,{size:12,className:V("text-text-4 transition-transform",Re&&"rotate-180")})]}),Re&&se.authType==="local"&&e.jsx("div",{className:"border-t border-border-subtle",children:e.jsx(vee,{isInstalled:ie,onModelChange:ke})}),Re&&se.authType!=="local"&&e.jsxs("div",{className:"border-t border-border-subtle",children:[(!ie||se.hasKey)&&e.jsx("div",{className:"px-3 py-2 bg-surface-1/50",children:b===se.id?e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx("input",{value:v,onChange:at=>O(at.target.value),onKeyDown:at=>at.key==="Enter"&&ya(se.id),type:j?"text":"password",placeholder:`${se.name||se.id} API key...`,className:"w-full h-7 px-2.5 pr-7 text-2xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),e.jsx("button",{onClick:()=>N(!j),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:j?e.jsx(jn,{size:10}):e.jsx(na,{size:10})})]}),e.jsx(fe,{variant:"primary",size:"sm",onClick:()=>ya(se.id),disabled:!v.trim(),className:"h-7 px-2 text-2xs",children:"Save"}),e.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{C(null),O("")},className:"h-7 px-2 text-2xs",children:"Cancel"})]}):e.jsxs("button",{onClick:()=>{C(se.id),O(""),N(!1)},className:"flex items-center gap-1.5 text-2xs text-text-3 hover:text-accent font-sans cursor-pointer transition-colors",children:[e.jsx(ws,{size:10}),ie?"Update API key":"Add API key to enable"]})}),ie&&xt.filter(at=>!at.disabled).length>0&&xt.filter(at=>!at.disabled).map(at=>{const va=se.id===t.provider&&at.id===t.model;return e.jsxs("button",{onClick:()=>Ne(se.id,at.id),disabled:!1,className:V("w-full flex items-center gap-2 px-3 py-2 text-left text-xs font-sans transition-colors","border-t border-border-subtle","cursor-pointer hover:bg-surface-4/50",va?"text-accent":"text-text-2"),children:[va?e.jsx(De,{size:11,className:"text-accent flex-shrink-0"}):e.jsx("div",{className:"w-[11px]"}),e.jsx("span",{className:"font-mono flex-1 truncate",children:at.name||at.id}),e.jsx(be,{variant:va?"accent":"default",className:"text-2xs",children:at.tier})]},at.id)})]})]},se.id)})}),ee&&e.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-3 font-sans mt-1.5",children:[e.jsx(Xt,{size:10}),e.jsx("span",{children:"Model changes apply on next rotation or respawn."})]})]}),t.provider==="claude-code"&&he&&!he.authenticated&&e.jsxs("div",{className:"rounded-lg border border-warning/30 bg-warning/5 px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xt,{size:13,className:"text-warning flex-shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:"Claude Code is not signed in"})]}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Open the terminal and run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"claude"})]})]}),t.provider==="claude-code"&&(he==null?void 0:he.authenticated)&&e.jsxs("div",{className:"flex items-center gap-2 text-2xs text-text-2 font-sans",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-success flex-shrink-0"}),"Signed in as ",he.email||"Claude user"," (",he.subscriptionType||"subscription",")"]}),e.jsx(nn,{label:"Working Directory",icon:ga,description:"The root directory this agent operates in.",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"flex-1 bg-surface-0 rounded-lg px-3 py-2.5 text-sm font-mono text-text-1 border border-border-subtle truncate min-w-0",children:t.workingDir||"Project root"}),e.jsxs(fe,{variant:"secondary",size:"md",onClick:()=>y(!0),className:"gap-1.5 flex-shrink-0",children:[e.jsx(SA,{size:14})," Browse"]})]})}),e.jsx(nn,{label:"Permission Mode",icon:La,description:"Full Send = no approvals. Agent Approve = Fullstack Manager reviews risky operations.",children:e.jsx(jf,{options:[{value:"full",label:"Full Send"},{value:"auto",label:"Agent Approve"}],value:t.permission||"full",onChange:async se=>{try{await D.patch(`/agents/${t.id}`,{permission:se}),a("success",`Permission → ${se==="full"?"Full Send":"Agent Approve"}`)}catch(Me){a("error","Update failed",Me.message)}}})}),e.jsxs(nn,{label:"Model Routing",icon:Ys,description:"How Groove selects models for this agent's tasks.",children:[e.jsx(jf,{options:[{value:"fixed",label:"Fixed"},{value:"auto",label:"Auto"},{value:"auto-floor",label:"Auto + Floor"}],value:L,onChange:async se=>{B(se);try{await D.post(`/agents/${t.id}/routing`,{mode:se}),a("success",`Routing → ${se}`)}catch(Me){a("error","Update failed",Me.message)}}}),e.jsxs("div",{className:"text-2xs text-text-4 font-sans mt-1",children:[L==="fixed"&&"Uses the selected model for all tasks.",L==="auto"&&"Groove picks Opus/Sonnet/Haiku based on task complexity.",L==="auto-floor"&&"Auto-routes but never drops below Sonnet."]})]}),e.jsx(nn,{label:"File Scope",icon:La,description:"Restrict which files this agent can access. Empty = unrestricted.",children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[(t.scope||[]).map((se,Me)=>e.jsxs(be,{variant:"default",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[se,e.jsx("button",{onClick:()=>Et(Me),className:"hover:text-danger cursor-pointer",children:e.jsx(Ge,{size:10})})]},Me)),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("input",{value:A,onChange:se=>u(se.target.value),onKeyDown:se=>se.key==="Enter"&&Tt(A),placeholder:"e.g. src/**",className:"w-28 h-7 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsx("button",{onClick:()=>Tt(A),disabled:!A.trim(),className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:e.jsx(ht,{size:12})})]})]})}),e.jsx(nn,{label:"Effort Level",icon:x0,description:"Controls how deep the agent reasons. Higher = more tokens but better results.",children:e.jsx(jf,{options:[{value:"min",label:"Min"},{value:"low",label:"Low"},{value:"default",label:"Default"},{value:"high",label:"High"},{value:"max",label:"Max"}],value:f,onChange:He})}),e.jsx(nn,{label:"Agent Details",icon:Dn,children:e.jsxs("div",{className:"bg-surface-0 rounded-lg border border-border-subtle divide-y divide-border-subtle",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"ID"}),e.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.id})]}),e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Role"}),e.jsx("span",{className:"text-xs text-text-1 font-sans capitalize",children:t.role})]}),e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Provider"}),e.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.provider})]}),e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Model"}),e.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.model||"auto"})]}),e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Status"}),e.jsx("span",{className:"text-xs text-text-1 font-sans capitalize",children:t.status})]}),e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Spawned"}),e.jsx("span",{className:"text-xs text-text-1 font-sans",children:Nn?Mt(Nn):"—"})]}),t.sessionId&&e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Session"}),e.jsxs("span",{className:"text-xs text-text-1 font-mono",children:[t.sessionId.slice(0,16),"..."]})]})]})}),e.jsx(nn,{label:"Skills",icon:It,description:"Attach installed skills to this agent's context.",children:e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(t.skills||[]).map(se=>e.jsxs(be,{variant:"accent",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[se,e.jsx("button",{onClick:async()=>{try{await D.delete(`/agents/${t.id}/skills/${se}`),a("success",`Detached ${se}`)}catch(Me){a("error","Detach failed",Me.message)}},className:"hover:text-danger cursor-pointer",children:e.jsx(Ge,{size:10})})]},se)),S.filter(se=>!(t.skills||[]).includes(se.id)).length>0&&e.jsxs("div",{className:"relative group",children:[e.jsx("button",{className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer transition-colors",children:e.jsx(ht,{size:12})}),e.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 hidden group-hover:block bg-surface-2 border border-border-subtle rounded-lg shadow-xl py-1 min-w-[160px]",children:S.filter(se=>!(t.skills||[]).includes(se.id)).map(se=>e.jsx("button",{onClick:async()=>{try{await D.post(`/agents/${t.id}/skills/${se.id}`),a("success",`Attached ${se.name||se.id}`)}catch(Me){a("error","Attach failed",Me.message)}},className:"w-full text-left px-3 py-1.5 text-xs font-sans text-text-1 hover:bg-surface-4 cursor-pointer transition-colors",children:se.name||se.id},se.id))})]}),(t.skills||[]).length===0&&S.length===0&&e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"No skills installed — browse the Marketplace"})]})}),e.jsxs(nn,{label:"Integrations",icon:da,description:"Attach MCP integrations for external services.",children:[e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(t.integrations||[]).map(se=>{const Me=zA[se],ie=ve.find(Re=>Re.id===se);return e.jsxs(be,{variant:"accent",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[Me?e.jsx("img",{src:Me,alt:"",className:"w-2.5 h-2.5"}):e.jsx(da,{size:9}),(ie==null?void 0:ie.name)||se,e.jsx("button",{onClick:async()=>{try{await D.delete(`/agents/${t.id}/integrations/${se}`),a("success",`Detached ${(ie==null?void 0:ie.name)||se}`)}catch(Re){a("error","Detach failed",Re.message)}},className:"hover:text-danger cursor-pointer",children:e.jsx(Ge,{size:10})})]},se)}),ve.filter(se=>se.configured!==!1&&!(t.integrations||[]).includes(se.id)).length>0&&e.jsxs("div",{className:"relative group",children:[e.jsx("button",{className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer transition-colors",children:e.jsx(ht,{size:12})}),e.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 hidden group-hover:block bg-surface-2 border border-border-subtle rounded-lg shadow-xl py-1 min-w-[200px]",children:ve.filter(se=>se.configured!==!1&&!(t.integrations||[]).includes(se.id)).map(se=>{const Me=zA[se.id];return e.jsxs("button",{onClick:async()=>{try{await D.post(`/agents/${t.id}/integrations/${se.id}`),a("success",`Attached ${se.name||se.id}`)}catch(ie){a("error","Attach failed",ie.message)}},className:"w-full flex items-center gap-2 text-left px-3 py-1.5 text-xs font-sans text-text-1 hover:bg-surface-4 cursor-pointer transition-colors",children:[Me?e.jsx("img",{src:Me,alt:"",className:"w-3.5 h-3.5 flex-shrink-0"}):e.jsx(da,{size:12,className:"text-text-3 flex-shrink-0"}),se.name||se.id]},se.id)})})]}),(t.integrations||[]).length===0&&ve.length===0&&e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"No integrations installed — browse the Marketplace"})]}),(t.integrations||[]).length>0&&e.jsxs("div",{className:"mt-3",children:[e.jsx("label",{className:"text-2xs font-medium text-text-3 font-sans block mb-1.5",children:"Integration Approvals"}),e.jsx(jf,{options:[{value:"auto",label:"Auto"},{value:"manual",label:"Manual"}],value:t.integrationApproval||"manual",onChange:async se=>{try{await D.patch(`/agents/${t.id}`,{integrationApproval:se}),a("success",`Integration approvals → ${se==="auto"?"Auto":"Manual"}`)}catch(Me){a("error","Update failed",Me.message)}}})]})]}),z.length>0&&e.jsx(nn,{label:"Repos",icon:Js,description:"Attach imported repos so this agent knows where they are.",children:e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(t.repos||[]).map(se=>{const Me=z.find(ie=>ie.id===se);return e.jsxs(be,{variant:"accent",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[(Me==null?void 0:Me.name)||se,e.jsx("button",{onClick:async()=>{try{await D.delete(`/agents/${t.id}/repos/${se}`),a("success",`Detached ${(Me==null?void 0:Me.name)||se}`)}catch(ie){a("error","Detach failed",ie.message)}},className:"hover:text-danger cursor-pointer",children:e.jsx(Ge,{size:10})})]},se)}),z.filter(se=>!(t.repos||[]).includes(se.id)).length>0&&e.jsxs("div",{className:"relative group",children:[e.jsx("button",{className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer transition-colors",children:e.jsx(ht,{size:12})}),e.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 hidden group-hover:block bg-surface-2 border border-border-subtle rounded-lg shadow-xl py-1 min-w-[200px]",children:z.filter(se=>!(t.repos||[]).includes(se.id)).map(se=>e.jsxs("button",{onClick:async()=>{try{await D.post(`/agents/${t.id}/repos/${se.id}`),a("success",`Attached ${se.name||se.id}`)}catch(Me){a("error","Attach failed",Me.message)}},className:"w-full text-left px-3 py-1.5 text-xs font-sans text-text-1 hover:bg-surface-4 cursor-pointer transition-colors",children:[e.jsx("div",{className:"font-semibold",children:se.name||se.repo}),e.jsx("div",{className:"text-2xs text-text-4 font-mono truncate",children:se.clonedTo})]},se.id))})]}),(t.repos||[]).length===0&&e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"No repos attached — import one from the Marketplace"})]})}),e.jsx(nn,{label:"Schedule",icon:Wo,description:"Run this agent on a recurring schedule.",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-text-2 font-sans",children:"Every"}),e.jsx("input",{value:G,onChange:se=>H(se.target.value.replace(/\D/g,"").slice(0,3)),className:"w-12 h-7 px-2 text-xs text-center bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent",placeholder:"1"}),e.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:[{value:"min",label:"Min"},{value:"hr",label:"Hr"},{value:"day",label:"Day"},{value:"wk",label:"Wk"},{value:"mo",label:"Mo"}].map(se=>e.jsx("button",{onClick:()=>K(se.value),className:V("px-2 py-1 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",F===se.value?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:se.label},se.value))}),e.jsxs(fe,{variant:"primary",size:"sm",disabled:q||!G||parseInt(G,10)<1,onClick:async()=>{const se=parseInt(G,10);if(!se||se<1)return;const Me={min:se===1?"* * * * *":`*/${se} * * * *`,hr:se===1?"0 * * * *":`0 */${se} * * *`,day:se===1?"0 0 * * *":`0 0 */${se} * *`,wk:`0 0 * * ${se===1?"1":"*"}`,mo:`0 0 ${se===1?"1":se} * *`};_(!0);try{await D.post("/schedules",{name:`${t.name} schedule`,cron:Me[F],agentConfig:{role:t.role,provider:t.provider,model:t.model,scope:t.scope,workingDir:t.workingDir,prompt:t.prompt}}),a("success",`Scheduled every ${se} ${F}`)}catch(ie){a("error","Schedule failed",ie.message)}_(!1)},className:"h-7 px-3 text-2xs gap-1",children:[e.jsx(Wo,{size:10}),q?"...":"Set"]})]})}),e.jsxs(nn,{label:"Personality",icon:Yn,description:"Injected into every prompt. Changes apply on next spawn or rotation.",children:[e.jsx("textarea",{value:R,onChange:se=>U(se.target.value),placeholder:Z?"Describe this agent's personality, tone, and behavior...":"Loading...",rows:4,className:"w-full min-h-[4rem] max-h-[10rem] resize-y bg-surface-0 border border-border-subtle rounded-md p-2 text-xs font-mono text-text-1 placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(fe,{variant:"primary",size:"sm",disabled:ae,onClick:async()=>{Oe(!0);try{await D.put(`/personalities/${t.name}`,{content:R}),a("success","Personality saved")}catch(se){a("error","Save failed",se.message)}Oe(!1)},className:"h-7 px-3 text-2xs gap-1",children:[e.jsx(Xr,{size:10}),ae?"Saving...":"Save"]}),Ae.length>0&&e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:"",onChange:se=>{if(!se.target.value)return;const Me=Ae.find(ie=>(ie.name||ie)===se.target.value);Me&&D.get(`/personalities/${Me.name||Me}`).then(ie=>{ie!=null&&ie.content&&U(ie.content)}).catch(()=>{})},className:"h-7 px-2 pr-7 text-2xs rounded-md bg-surface-1 border border-border-subtle text-text-2 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent",children:[e.jsx("option",{value:"",children:"Clone from..."}),Ae.filter(se=>(se.name||se)!==t.name).map(se=>e.jsx("option",{value:se.name||se,children:se.name||se},se.name||se))]}),e.jsx(bt,{size:10,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"})]})]})]}),t.prompt&&e.jsx(nn,{label:"Original Prompt",icon:Ys,children:e.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3 py-3 text-xs text-text-2 font-sans leading-relaxed max-h-40 overflow-y-auto",children:t.prompt})}),e.jsx(Hu,{open:m,onOpenChange:y,currentPath:t.workingDir||n||"/",homePath:n,onSelect:ze})]})}const ZX=[];function ZXe({data:t,isAlive:a,height:n=48}){const s=g.useRef(null);return g.useEffect(()=>{const o=s.current;if(!o||!t.length)return;const c=o.getContext("2d"),l=window.devicePixelRatio||1,A=o.clientWidth,u=o.clientHeight;o.width=A*l,o.height=u*l,c.scale(l,l),c.clearRect(0,0,A,u);const f=t.map(O=>O.v),x=Math.min(...f),y=Math.max(...f,1)-x||1;c.beginPath(),c.moveTo(0,u),t.forEach((O,b)=>{const C=b/(t.length-1)*A,j=u-(O.v-x)/y*(u-4)-2;c.lineTo(C,j)}),c.lineTo(A,u),c.closePath();const v=c.createLinearGradient(0,0,0,u);if(v.addColorStop(0,a?"rgba(51,175,188,0.15)":"rgba(110,118,129,0.08)"),v.addColorStop(1,"rgba(0,0,0,0)"),c.fillStyle=v,c.fill(),c.beginPath(),c.strokeStyle=a?te.accent:te.text3,c.lineWidth=1.5,t.forEach((O,b)=>{const C=b/(t.length-1)*A,j=u-(O.v-x)/y*(u-4)-2;b===0?c.moveTo(C,j):c.lineTo(C,j)}),c.stroke(),t.length>1&&a){const O=t[t.length-1],b=A-1,C=u-(O.v-x)/y*(u-4)-2;c.beginPath(),c.arc(b,C,5,0,Math.PI*2),c.fillStyle="rgba(51,175,188,0.3)",c.fill(),c.beginPath(),c.arc(b,C,2.5,0,Math.PI*2),c.fillStyle=te.accent,c.fill()}},[t,a]),e.jsx("div",{className:"w-full rounded-lg bg-surface-0 overflow-hidden border border-border-subtle",style:{height:n},children:e.jsx("canvas",{ref:s,className:"w-full h-full"})})}function Cf({icon:t,label:a,value:n,color:s,sub:o}){return e.jsxs("div",{className:"bg-surface-0 rounded-lg px-3 py-2.5 border border-border-subtle",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(t,{size:12,className:s||"text-text-3"}),e.jsx("span",{className:"text-2xs text-text-4 font-sans uppercase tracking-wider",children:a})]}),e.jsx("div",{className:V("text-lg font-bold font-mono tabular-nums",s||"text-text-0"),children:n}),o&&e.jsx("div",{className:"text-2xs text-text-4 font-sans mt-0.5",children:o})]})}function GXe({score:t}){const a=Math.min(Math.max(t,0),100);let n=te.success,s="Healthy";return a<40?(n=te.danger,s="Degraded"):a<70&&(n=te.warning,s="Fair"),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsxs("span",{className:"text-2xs text-text-3 font-sans flex items-center gap-1.5",children:[e.jsx(v0,{size:11}),"Session Health"]}),e.jsxs("span",{className:"text-xs font-bold font-mono",style:{color:n},children:[a,"/100"]})]}),e.jsx("div",{className:"h-2 bg-surface-0 rounded-full overflow-hidden border border-border-subtle",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${a}%`,background:n}})}),e.jsx("span",{className:"text-2xs font-sans mt-1 block",style:{color:n},children:s})]})}function WXe(t){const a=(t||"").toLowerCase();return a.includes("edit")||a.includes("writ")?{icon:ps,color:"text-warning"}:a.includes("read")||a.includes("view")?{icon:na,color:"text-info"}:a.includes("search")||a.includes("grep")||a.includes("glob")?{icon:oa,color:"text-purple"}:a.includes("bash")||a.includes("command")||a.includes("terminal")?{icon:Ns,color:"text-orange"}:a.includes("error")||a.includes("fail")?{icon:Xt,color:"text-danger"}:a.includes("spawn")||a.includes("start")?{icon:wt,color:"text-success"}:a.includes("complet")||a.includes("done")?{icon:Hn,color:"text-success"}:{icon:Rr,color:"text-text-4"}}function KXe({agent:t}){const a=$(l=>l.tokenTimeline[t.id])||ZX,n=$(l=>l.activityLog[t.id])||ZX,s=t.status==="running"||t.status==="starting",o=g.useMemo(()=>{if(a.length<2)return 0;const l=a.slice(-10),A=(l[l.length-1].t-l[0].t)/6e4,u=l[l.length-1].v-l[0].v;return A>0?Math.round(u/A):0},[a]),c=g.useMemo(()=>{const l=t.contextUsage||0;let A=100;return l>90?A-=50:l>70?A-=25:l>50&&(A-=10),o>5e3?A-=15:o>3e3&&(A-=8),t.status==="crashed"&&(A=10),t.status==="completed"&&(A=95),Math.max(0,Math.min(100,A))},[t.contextUsage,t.status,o]);return e.jsxs("div",{className:"px-5 py-5 space-y-5 overflow-y-auto h-full",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Token Burn"}),s&&e.jsx("span",{className:"text-2xs text-accent font-mono animate-pulse",children:"LIVE"})]}),e.jsx(ZXe,{data:a,isAlive:s,height:56})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(Cf,{icon:p0,label:"Burn Rate",value:o>0?`${pt(o)}/m`:"—",color:o>5e3?"text-danger":o>2e3?"text-warning":"text-text-0"}),e.jsx(Cf,{icon:h0,label:"Cost",value:Ai(t.costUsd||0),color:"text-text-0"}),e.jsx(Cf,{icon:Vr,label:"Rotations",value:t.rotations||"0",color:"text-text-0"}),e.jsx(Cf,{icon:wt,label:"Turns",value:t.turns||"0",color:"text-text-0"})]}),e.jsx(GXe,{score:c}),t.prompt&&e.jsxs("div",{children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider block mb-1.5",children:"Task"}),e.jsx("div",{className:"bg-surface-0 rounded-lg px-3 py-2.5 text-xs text-text-2 font-sans leading-relaxed max-h-28 overflow-y-auto border border-border-subtle",children:t.prompt})]}),n.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider block mb-2",children:"Activity"}),e.jsxs("div",{className:"space-y-0 relative",children:[e.jsx("div",{className:"absolute left-[9px] top-2 bottom-2 w-px bg-border-subtle"}),n.slice(-12).reverse().map((l,A)=>{const u=WXe(l.text),f=u.icon;return e.jsxs("div",{className:"flex items-start gap-3 py-1.5 relative",children:[e.jsx("div",{className:V("w-[18px] h-[18px] rounded-full flex items-center justify-center flex-shrink-0 z-10","bg-surface-1 border border-border-subtle"),children:e.jsx(f,{size:9,className:u.color})}),e.jsx("span",{className:"text-2xs text-text-2 font-sans flex-1 line-clamp-1 pt-0.5",children:l.text}),e.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0 pt-0.5",children:Mt(l.timestamp)})]},A)})]})]})]})}function YXe({agent:t}){const a=$(S=>S.addToast),[n,s]=g.useState([]),[o,c]=g.useState(""),[l,A]=g.useState(null),[u,f]=g.useState(""),[x,m]=g.useState(""),[y,v]=g.useState(!1),[O,b]=g.useState(!1),[C,j]=g.useState("");async function N(){try{const S=await D.get(`/agents/${t.id}/mdfiles`);s(S.files||[]),c(S.workingDir||"")}catch{}}g.useEffect(()=>{N()},[t.id]);async function M(S){try{const I=await D.get(`/agents/${t.id}/mdfiles/read?path=${encodeURIComponent(S)}`);f(I.content||""),m(I.content||""),A(S)}catch(I){a("error","Failed to read file",I.message)}}async function Q(){if(l){v(!0);try{await D.put(`/agents/${t.id}/mdfiles/write`,{path:l,content:u}),m(u),a("success",`Saved ${l}`)}catch(S){a("error","Save failed",S.message)}v(!1)}}async function L(){const S=C.trim();if(S)try{await D.post(`/agents/${t.id}/mdfiles/create`,{name:S}),j(""),b(!1),a("success",`Created ${S}.md`),N()}catch(I){a("error","Create failed",I.message)}}const B=u!==x;return l?e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-subtle",children:[e.jsx("button",{onClick:()=>{A(null),f(""),m("")},className:"p-1 text-text-3 hover:text-text-0 cursor-pointer",children:e.jsx(bs,{size:14})}),e.jsx(Va,{size:12,className:"text-accent"}),e.jsx("span",{className:"text-xs text-text-0 font-sans font-medium flex-1 truncate",children:l}),B&&e.jsx("span",{className:"text-[10px] text-warning font-sans",children:"unsaved"}),e.jsxs("button",{onClick:Q,disabled:!B||y,className:V("flex items-center gap-1 px-2.5 py-1 rounded text-2xs font-sans font-medium cursor-pointer transition-colors",B?"bg-accent/15 text-accent hover:bg-accent/25":"text-text-4 opacity-50 cursor-not-allowed"),children:[e.jsx(Xr,{size:10}),y?"Saving...":"Save"]})]}),e.jsx("textarea",{value:u,onChange:S=>f(S.target.value),className:"flex-1 w-full px-4 py-3 bg-surface-0 text-[12px] font-mono text-text-1 leading-relaxed resize-none focus:outline-none",spellCheck:!1})]}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-border-subtle",children:[e.jsx(Va,{size:12,className:"text-text-3"}),e.jsx("span",{className:"text-2xs font-semibold text-text-2 font-sans uppercase tracking-wider flex-1",children:"Markdown Files"}),e.jsx("button",{onClick:()=>b(!0),className:"p-1 text-text-4 hover:text-accent cursor-pointer",title:"Create file",children:e.jsx(ht,{size:12})}),e.jsx("button",{onClick:N,className:"p-1 text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(ra,{size:11})})]}),o&&e.jsx("div",{className:"px-4 py-1.5 text-[10px] text-text-4 font-mono truncate border-b border-border-subtle/50",children:o}),O&&e.jsxs("div",{className:"flex items-center gap-1.5 px-4 py-2 border-b border-border-subtle bg-surface-0",children:[e.jsx(Va,{size:11,className:"text-accent flex-shrink-0"}),e.jsx("input",{autoFocus:!0,value:C,onChange:S=>j(S.target.value),onKeyDown:S=>{S.key==="Enter"&&L(),S.key==="Escape"&&(b(!1),j(""))},placeholder:"filename",className:"flex-1 bg-transparent text-xs text-text-0 font-mono outline-none placeholder:text-text-4"}),e.jsx("span",{className:"text-[10px] text-text-4 font-mono",children:".md"}),e.jsx("button",{onClick:L,className:"p-0.5 text-accent hover:text-accent/80 cursor-pointer",children:e.jsx(Xr,{size:11})}),e.jsx("button",{onClick:()=>{b(!1),j("")},className:"p-0.5 text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(Ge,{size:11})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:n.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-4",children:[e.jsx(Va,{size:20,className:"text-text-4 mb-2"}),e.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No markdown files found"}),e.jsx("p",{className:"text-[10px] text-text-4 font-sans mt-1",children:"MD files in the agent's working directory will appear here"})]}):e.jsx("div",{className:"py-1",children:n.map(S=>e.jsxs("button",{onClick:()=>M(S.path),className:"w-full flex items-center gap-2.5 px-4 py-2 text-left hover:bg-surface-5 transition-colors cursor-pointer",children:[e.jsx(Va,{size:13,className:"text-accent flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs text-text-0 font-sans block truncate",children:S.name}),e.jsx("span",{className:"text-[10px] text-text-4 font-mono",children:S.path})]}),e.jsx("span",{className:"text-[10px] text-text-4 font-mono flex-shrink-0",children:S.size>1024?`${(S.size/1024).toFixed(1)}K`:`${S.size}B`}),S.source==="personality"&&e.jsx("span",{className:"text-[9px] font-mono text-purple bg-purple/10 px-1 py-px rounded flex-shrink-0",children:"personality"}),S.source==="user"&&e.jsx("span",{className:"text-[9px] font-mono text-accent bg-accent/10 px-1 py-px rounded flex-shrink-0",children:"custom"})]},S.path))})})]})}const JXe={running:"success",starting:"warning",stopped:"default",crashed:"danger",completed:"accent",killed:"default",rotating:"purple"},eZe={running:"Running",starting:"Starting",stopped:"Stopped",crashed:"Crashed",completed:"Done",killed:"Killed",rotating:"Rotating"},tZe=[{id:"command",label:"Chat",icon:Cn},{id:"config",label:"Config",icon:Zr},{id:"telemetry",label:"Monitor",icon:Ys},{id:"mdfiles",label:"Files",icon:Va}];function aZe({agent:t}){const a=$(u=>u.addToast),[n,s]=g.useState(!1),[o,c]=g.useState(t.name),l=g.useRef(null);async function A(){const u=o.trim();if(!u||u===t.name){s(!1);return}try{await D.patch(`/agents/${t.id}`,{name:u.replace(/\s+/g,"-")}),a("success",`Renamed → ${u}`)}catch(f){a("error","Rename failed",f.message),c(t.name)}s(!1)}return n?e.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0",children:[e.jsx("input",{ref:l,value:o,onChange:u=>c(u.target.value),onKeyDown:u=>{u.key==="Enter"&&A(),u.key==="Escape"&&(c(t.name),s(!1))},className:"flex-1 min-w-0 h-6 px-1.5 text-sm font-bold bg-surface-0 border border-accent/30 rounded text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent/40",autoFocus:!0}),e.jsx("button",{onClick:A,className:"p-0.5 text-accent hover:text-accent/80 cursor-pointer",children:e.jsx(De,{size:12})}),e.jsx("button",{onClick:()=>{c(t.name),s(!1)},className:"p-0.5 text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(Ge,{size:12})})]}):e.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0 group",children:[e.jsx("h2",{className:"text-sm font-bold text-text-0 font-sans truncate",children:t.name}),e.jsx("button",{onClick:()=>{c(t.name),s(!0)},className:"p-0.5 text-text-4 opacity-0 group-hover:opacity-100 hover:text-text-1 cursor-pointer transition-opacity",children:e.jsx(js,{size:10})})]})}function nZe(){const t=$(x=>x.detailPanel),a=$(x=>x.agents),n=$(x=>x.activeTeamId),[s,o]=g.useState("command");if((t==null?void 0:t.type)!=="agent")return null;const c=a.find(x=>x.id===t.agentId);if(!c||n&&c.teamId&&c.teamId!==n)return null;const l=c.status==="running"||c.status==="starting",A=Math.round((c.contextUsage||0)*100),u=c.spawnedAt||c.createdAt,f=u?Math.floor((Date.now()-new Date(u).getTime())/1e3):0;return On(c.role),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex-shrink-0",children:[e.jsxs("div",{className:"pl-4 pr-10 pt-3 pb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(aZe,{agent:c}),e.jsx(be,{variant:JXe[c.status]||"default",dot:l?"pulse":void 0,className:"text-2xs flex-shrink-0",children:eZe[c.status]||c.status})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-1 text-2xs text-text-3 font-mono",children:[e.jsx("span",{className:"capitalize",children:c.role}),e.jsx("span",{className:"text-text-4",children:"·"}),e.jsxs("span",{children:[c.provider,":",c.model||"auto"]}),e.jsx("span",{className:"text-text-4",children:"·"}),e.jsxs("span",{children:[pt(c.tokensUsed||0)," tok"]}),A>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-4",children:"·"}),e.jsxs("span",{className:V(A>80?"text-danger":A>60?"text-warning":"text-text-3"),children:[A,"% ctx"]})]}),e.jsx("span",{className:"text-text-4",children:"·"}),e.jsx("span",{children:WA(f)})]})]}),e.jsx("div",{className:"flex items-center px-4 border-b border-border-subtle",children:tZe.map(x=>{const m=x.icon,y=s===x.id;return e.jsxs("button",{onClick:()=>o(x.id),className:V("flex items-center gap-1.5 px-3 py-2 text-2xs font-semibold font-sans transition-all cursor-pointer select-none border-b-2 -mb-px",y?"border-accent text-text-0":"border-transparent text-text-3 hover:text-text-1"),children:[e.jsx(m,{size:11}),x.label]},x.id)})})]}),e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[s==="command"&&e.jsx(DXe,{agent:c}),s==="config"&&e.jsx(XXe,{agent:c}),s==="telemetry"&&e.jsx(KXe,{agent:c}),s==="mdfiles"&&e.jsx(YXe,{agent:c})]})]})}const sZe=[{id:"chat",label:"Chat",desc:"Companion, assistant, conversation",icon:Yn,tier:"Medium"},{id:"planner",label:"Planner",desc:"Plans the team and tasks",icon:es,tier:"Heavy"},{id:"backend",label:"Backend",desc:"APIs, services, databases",icon:aa,tier:"Medium"},{id:"frontend",label:"Frontend",desc:"UI, components, styling",icon:Dr,tier:"Medium"},{id:"fullstack",label:"Fullstack",desc:"End-to-end implementation",icon:Zt,tier:"Heavy"},{id:"testing",label:"Testing",desc:"Tests, coverage, QA",icon:ti,tier:"Medium"},{id:"devops",label:"DevOps",desc:"CI/CD, infra, deployment",icon:NA,tier:"Medium"},{id:"docs",label:"Docs",desc:"Documentation, guides",icon:Va,tier:"Light"},{id:"security",label:"Security",desc:"Audits, vulnerabilities",icon:La,tier:"Medium"},{id:"database",label:"Database",desc:"Schema, migrations, queries",icon:MA,tier:"Medium"},{id:"cmo",label:"CMO",desc:"Marketing, content, growth",icon:_A,tier:"Medium"},{id:"cfo",label:"CFO",desc:"Finance, metrics, forecasting",icon:tu,tier:"Medium"},{id:"ea",label:"EA",desc:"Executive assistant, scheduling",icon:Ou,tier:"Light"},{id:"support",label:"Support",desc:"Customer support, FAQs",icon:Au,tier:"Medium"},{id:"analyst",label:"Analyst",desc:"Data analysis, insights",icon:hs,tier:"Medium"},{id:"creative",label:"Writer",desc:"Copy, articles, proposals",icon:Lr,tier:"Heavy",skillHint:!0},{id:"slides",label:"Slides",desc:"Pitch decks, presentations",icon:yu,tier:"Heavy",skillHint:!0},{id:"ambassador",label:"Ambassador",desc:"Bridge to federated server",icon:sa,tier:"Light"}];function kP(){return e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",className:"text-accent flex-shrink-0",children:[e.jsx("circle",{cx:"7",cy:"7",r:"6",fill:"currentColor",fillOpacity:"0.15",stroke:"currentColor",strokeWidth:"1"}),e.jsx("path",{d:"M4.5 7 L6.5 9 L9.5 5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function rZe(){const t=$(re=>re.detailPanel),a=$(re=>re.closeDetail),n=$(re=>re.spawnAgent),s=$(re=>re.fetchProviders),o=(t==null?void 0:t.type)==="spawn",[c,l]=g.useState(""),[A,u]=g.useState(""),[f,x]=g.useState(""),[m,y]=g.useState(""),[v,O]=g.useState(""),[b,C]=g.useState(""),[j,N]=g.useState([]),[M,Q]=g.useState([]),[L,B]=g.useState([]),[S,I]=g.useState(!1),[z,P]=g.useState(""),[F,K]=g.useState([]),[G,H]=g.useState([]),[q,_]=g.useState(!1),[R,U]=g.useState(""),[Z,J]=g.useState("manual"),[Ae,W]=g.useState([]),[ae,Oe]=g.useState([]),[ve,ce]=g.useState(!1),[he,je]=g.useState(""),[ee,ke]=g.useState([]),[ye,Ne]=g.useState(""),[ze,He]=g.useState(!1),[Tt,Et]=g.useState(!1),[ya,Nn]=g.useState(""),[Wt,se]=g.useState([]),[Me,ie]=g.useState(null),[Re,xt]=g.useState(null),[St,at]=g.useState([]),[va,Mn]=g.useState(!1),DT=$(re=>re.federation),Vu=$(re=>re.ollamaRunningModels),ua=c||A,Sn=j.find(re=>re.id===m),ao=(Sn==null?void 0:Sn.models)||[],ka=j.filter(re=>re.authType==="api-key"?re.installed&&re.hasKey:re.installed);g.useEffect(()=>{if(o){const re=(t==null?void 0:t.presetProvider)||"",Ce=(t==null?void 0:t.presetModel)||"";s().then(Ee=>{const ct=Array.isArray(Ee)?Ee:Ee.providers||[];N(ct);const Qn=ct.filter(Ia=>Ia.authType==="api-key"?Ia.installed&&Ia.hasKey:Ia.installed);if(Qn.length>0&&!re){const no=["claude-code","gemini","codex","ollama"].find(pi=>Qn.some(VT=>VT.id===pi))||Qn[0].id;y(no)}}).catch(()=>{}),D.get("/skills/installed").then(Ee=>{Q(Array.isArray(Ee)?Ee:[])}).catch(()=>{}),D.get("/integrations/installed").then(Ee=>{K(Array.isArray(Ee)?Ee:[])}).catch(()=>{}),D.get("/repos/imported").then(Ee=>{W((Array.isArray(Ee)?Ee:[]).filter(ct=>ct.status==="active"))}).catch(()=>{}),D.get("/personalities").then(Ee=>{ke(Array.isArray(Ee)?Ee:Ee.personalities||[])}).catch(()=>{}),l(""),u(""),x(""),y(re),O(Ce),C(""),B([]),H([]),J("manual"),Oe([]),Ne(""),Nn(""),He(!1),se([]),ie(null),xt(null)}},[o,s]),g.useEffect(()=>{if(!ua||!o){se([]);return}D.get(`/roles/integrations?role=${encodeURIComponent(ua)}`).then(re=>{const Ce=Array.isArray(re)?re:(re==null?void 0:re.recommendations)||[];se(Ce);const Ee=Ce.filter(ct=>ct.installed&&ct.configured&&ct.authenticated).map(ct=>ct.id);Ee.length>0&&H(ct=>[...new Set([...ct,...Ee])])}).catch(()=>se([]))},[ua,o]),g.useEffect(()=>{if(!o||m!=="claude-code"){xt(null);return}D.get("/providers/claude-code/auth").then(re=>{xt(re)}).catch(()=>xt(null))},[o,m]),g.useEffect(()=>{if(!o||m!=="ollama"){at([]);return}D.get("/providers/ollama/models").then(re=>{at(re.installed||[])}).catch(()=>at([])),D.post("/providers/ollama/check").then(re=>{Mn(re.serverRunning)}).catch(()=>Mn(!1))},[o,m]);async function rs(){Et(!0);try{const re={role:ua,...f&&{name:f.replace(/\s+/g,"-")},...m&&{provider:m},...v&&{model:v},...b&&{prompt:b},...L.length>0&&{skills:L},...G.length>0&&{integrations:G},...G.length>0&&{integrationApproval:Z},...ae.length>0&&{repos:ae},...ye&&{personality:ye},...ua==="ambassador"&&ya&&{peerId:ya}};await n(re),a()}catch{}Et(!1)}async function Ra(){var re;if(ua){try{const Ce=await D.post("/agents/preflight",{role:ua,integrations:G});if(((re=Ce==null?void 0:Ce.issues)==null?void 0:re.length)>0){ie(Ce.issues);return}}catch{}rs()}}const k2=m==="claude-code"&&Re&&!Re.authenticated;return e.jsxs(HT,{open:o,onOpenChange:re=>{re||a()},children:[e.jsx(qT,{title:"Spawn Agent",width:480,children:e.jsxs("div",{className:"flex flex-col h-[calc(100%-57px)]",children:[e.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block mb-3",children:"Choose Role"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:sZe.map(re=>{const Ce=On(re.id),Ee=c===re.id;return e.jsxs("button",{onClick:()=>{l(re.id),u("")},className:V("flex items-center gap-2.5 p-3 rounded-md border text-left transition-all cursor-pointer",Ee?"border-accent bg-accent/5":"border-border-subtle bg-surface-1 hover:border-border hover:bg-surface-2"),children:[e.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center flex-shrink-0",style:{background:Ce.bg},children:e.jsx(re.icon,{size:16,style:{color:Ce.text}})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:re.label}),re.skillHint&&e.jsx("span",{className:"text-2xs font-mono text-warning/70 bg-warning/8 px-1 py-px rounded",children:"skill"})]}),e.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:re.desc})]})]},re.id)})}),e.jsx("div",{className:"mt-3",children:e.jsx(cn,{placeholder:"or type a custom role (e.g. chat-agent)...",value:A,onChange:re=>{u(re.target.value.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").slice(0,50)),l("")},className:"text-xs"})})]}),ua&&Wt.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block mb-2",children:"Recommended Integrations"}),e.jsx("div",{className:"space-y-1.5",children:Wt.map(re=>{const Ce=zA[re.id];return re.installed&&re.configured&&re.authenticated?e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 rounded-md bg-success/5 border border-success/20",children:[e.jsx(De,{size:13,className:"text-success flex-shrink-0"}),Ce?e.jsx("img",{src:Ce,alt:"",className:"w-3.5 h-3.5 flex-shrink-0"}):e.jsx(da,{size:12,className:"text-text-3 flex-shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:re.name||re.id}),e.jsx(be,{variant:"success",className:"text-2xs ml-auto",children:"Ready"})]},re.id):re.installed?e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 rounded-md bg-warning/5 border border-warning/20",children:[e.jsx(Gt,{size:13,className:"text-warning flex-shrink-0"}),Ce?e.jsx("img",{src:Ce,alt:"",className:"w-3.5 h-3.5 flex-shrink-0"}):e.jsx(da,{size:12,className:"text-text-3 flex-shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:re.name||re.id}),e.jsx(fe,{variant:"ghost",size:"sm",className:"ml-auto text-2xs text-warning h-6 px-2",onClick:()=>{a(),$.getState().setActiveView("marketplace")},children:"Configure"})]},re.id):e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 rounded-md bg-surface-1 border border-border-subtle",children:[Ce?e.jsx("img",{src:Ce,alt:"",className:"w-3.5 h-3.5 flex-shrink-0 opacity-40"}):e.jsx(da,{size:12,className:"text-text-4 flex-shrink-0"}),e.jsx("span",{className:"text-xs text-text-3 font-sans",children:re.name||re.id}),e.jsx("button",{onClick:()=>{a(),$.getState().setActiveView("marketplace")},className:"ml-auto text-2xs text-accent hover:underline font-sans cursor-pointer",children:"Install in Marketplace"})]},re.id)})})]}),ua==="ambassador"&&(()=>{const re=DT.whitelist.filter(Ce=>typeof Ce=="object"&&(Ce.status==="mutual"||Ce.status==="connected"));return re.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border-subtle bg-surface-1/50 px-4 py-4 text-center",children:[e.jsx(sa,{size:18,className:"text-text-4 mx-auto mb-1.5"}),e.jsx("p",{className:"text-2xs text-text-3 font-sans mb-2",children:"No federated servers connected. Add one in the Federation view."}),e.jsx(fe,{variant:"ghost",size:"sm",className:"text-2xs text-accent",onClick:()=>{a(),$.getState().setActiveView("federation")},children:"Go to Federation"})]}):e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block mb-2",children:"Target Server"}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:ya,onChange:Ce=>Nn(Ce.target.value),className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent",children:[e.jsx("option",{value:"",children:"Select a server..."}),re.map(Ce=>e.jsx("option",{value:Ce.ip,children:Ce.name||`${Ce.ip}:${Ce.port||31415}`},Ce.ip))]}),e.jsx(bt,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]})]})})(),ua&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block",children:"Configuration"}),e.jsx(cn,{label:"Name (optional)",value:f,onChange:re=>x(re.target.value),placeholder:`${ua}-1`}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Provider"}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:m,onChange:re=>{y(re.target.value),O("")},className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent",children:[e.jsx("option",{value:"",children:"Auto"}),j.map(re=>e.jsxs("option",{value:re.id,disabled:re.authType==="api-key"?!(re.installed&&re.hasKey):!re.installed,children:[re.name,re.installed?re.authType==="api-key"&&!re.hasKey?" (No API key)":"":" (Not installed)"]},re.id))]}),e.jsx(bt,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Model"}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:v,onChange:re=>O(re.target.value),disabled:!m,className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-40",children:[e.jsx("option",{value:"",children:"Auto"}),m==="ollama"&&St.length>0?e.jsxs(e.Fragment,{children:[e.jsx("optgroup",{label:"Installed Models",children:St.map(re=>{const Ce=Vu.some(Ee=>Ee.name===re.id);return e.jsxs("option",{value:re.id,children:[re.name||re.id," (",re.size,")",Ce?" ● Running":""]},re.id)})}),e.jsx("optgroup",{label:"Catalog",children:ao.filter(re=>!St.some(Ce=>Ce.id===re.id)).map(re=>e.jsxs("option",{value:re.id,children:[re.name," (not installed)"]},re.id))})]}):ao.map(re=>e.jsx("option",{value:re.id,children:re.name},re.id))]}),e.jsx(bt,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]})]})]}),m&&Sn&&e.jsx("div",{className:"text-2xs text-text-3 font-sans flex items-center gap-2 flex-wrap",children:Sn.authType==="local"?e.jsx(be,{variant:"success",children:"Local"}):Sn.authType==="subscription"?e.jsx(be,{variant:"accent",children:"Subscription"}):Sn.hasKey?e.jsx(be,{variant:"success",children:"API key set"}):e.jsxs(be,{variant:"warning",children:["No API key — set with: groove set-key ",m," YOUR_KEY"]})}),m==="ollama"&&v&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-2xs font-sans",children:[Vu.some(re=>re.name===v)?e.jsxs(be,{variant:"success",className:"text-2xs gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-success"}),"Ready — running in memory"]}):St.some(re=>re.id===v)?e.jsx(be,{variant:"subtle",className:"text-2xs",children:"Will auto-start when agent spawns"}):e.jsx(be,{variant:"warning",className:"text-2xs",children:"Not installed — will pull first"}),!va&&e.jsx("span",{className:"text-warning",children:"Server not running — will auto-start"})]}),k2&&e.jsxs("div",{className:"rounded-lg border border-warning/30 bg-warning/5 px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Gt,{size:13,className:"text-warning flex-shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:"Claude Code is not signed in"})]}),e.jsxs("p",{className:"text-2xs text-text-2 font-sans",children:["Open the terminal and run: ",e.jsx("code",{className:"font-mono text-accent bg-surface-4 px-1.5 py-0.5 rounded text-2xs",children:"claude"})]})]}),m==="claude-code"&&(Re==null?void 0:Re.authenticated)&&e.jsxs("div",{className:"flex items-center gap-2 text-2xs text-text-2 font-sans",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-success flex-shrink-0"}),"Signed in as ",Re.email||"Claude user"," (",Re.subscriptionType||"subscription",")"]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Skills"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[L.map(re=>{const Ce=M.find(Ee=>Ee.id===re);return e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded bg-accent/12 text-accent border border-accent/25 text-2xs font-sans",children:[e.jsx(It,{size:9}),(Ce==null?void 0:Ce.name)||re,e.jsx("button",{onClick:()=>B(Ee=>Ee.filter(ct=>ct!==re)),className:"ml-0.5 hover:text-text-0 cursor-pointer",children:e.jsx(Ge,{size:9})})]},re)}),e.jsxs("button",{onClick:()=>{I(!0),P("")},className:V("inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-2xs font-sans transition-colors cursor-pointer","bg-surface-0 text-text-2 border border-border-subtle hover:border-border hover:text-text-0"),children:[e.jsx(It,{size:10}),L.length>0?"Add skill":"Attach skill"]})]})]}),e.jsx(Ut,{open:S,onOpenChange:I,children:e.jsx(Pt,{title:"Select Skill",className:"max-w-sm",children:e.jsxs("div",{className:"space-y-3 p-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(oa,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{value:z,onChange:re=>P(re.target.value),placeholder:"Search skills...",autoFocus:!0,className:"w-full h-8 pl-8 pr-3 text-xs rounded-md bg-surface-0 border border-border text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsxs("div",{className:"max-h-64 overflow-y-auto space-y-1",children:[M.filter(re=>{if(!z)return!0;const Ce=z.toLowerCase();return(re.name||re.id).toLowerCase().includes(Ce)||(re.description||"").toLowerCase().includes(Ce)}).map(re=>{const Ce=L.includes(re.id);return e.jsxs("button",{onClick:()=>{B(Ee=>Ce?Ee.filter(ct=>ct!==re.id):[...Ee,re.id])},className:V("w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors cursor-pointer",Ce?"bg-accent/10 border border-accent/25":"hover:bg-surface-3 border border-transparent"),children:[e.jsx(It,{size:12,className:Ce?"text-accent":"text-text-3"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:re.name||re.id}),re.description&&e.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:re.description})]}),Ce&&e.jsx(kP,{})]},re.id)}),M.length===0&&e.jsx("div",{className:"text-center py-6 text-xs text-text-3 font-sans",children:"No skills installed. Visit the Marketplace to install skills."})]})]})})}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Integrations"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[G.map(re=>{const Ce=F.find(ct=>ct.id===re),Ee=zA[re];return e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded bg-accent/12 text-accent border border-accent/25 text-2xs font-sans",children:[Ee?e.jsx("img",{src:Ee,alt:"",className:"w-2.5 h-2.5"}):e.jsx(da,{size:9}),(Ce==null?void 0:Ce.name)||re,e.jsx("button",{onClick:()=>H(ct=>ct.filter(Qn=>Qn!==re)),className:"ml-0.5 hover:text-text-0 cursor-pointer",children:e.jsx(Ge,{size:9})})]},re)}),e.jsxs("button",{onClick:()=>{_(!0),U("")},className:V("inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-2xs font-sans transition-colors cursor-pointer","bg-surface-0 text-text-2 border border-border-subtle hover:border-border hover:text-text-0"),children:[e.jsx(da,{size:10}),G.length>0?"Add integration":"Attach integration"]})]})]}),e.jsx(Ut,{open:q,onOpenChange:_,children:e.jsx(Pt,{title:"Select Integration",className:"max-w-sm",children:e.jsxs("div",{className:"space-y-3 p-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx(oa,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{value:R,onChange:re=>U(re.target.value),placeholder:"Search integrations...",autoFocus:!0,className:"w-full h-8 pl-8 pr-3 text-xs rounded-md bg-surface-0 border border-border text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsxs("div",{className:"max-h-64 overflow-y-auto space-y-1",children:[F.filter(re=>{if(!R)return!0;const Ce=R.toLowerCase();return(re.name||re.id).toLowerCase().includes(Ce)||(re.description||"").toLowerCase().includes(Ce)}).map(re=>{const Ce=G.includes(re.id),Ee=re.configured!==!1,ct=zA[re.id],Qn=ua&&Array.isArray(re.roles)&&re.roles.includes(ua);return e.jsxs("button",{onClick:()=>{Ee&&H(Ia=>Ce?Ia.filter(no=>no!==re.id):[...Ia,re.id])},disabled:!Ee,className:V("w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors",Ee?"cursor-pointer":"opacity-40 cursor-not-allowed",Ce?"bg-accent/10 border border-accent/25":Ee?"hover:bg-surface-3 border border-transparent":"border border-transparent"),children:[ct?e.jsx("img",{src:ct,alt:"",className:"w-4 h-4 flex-shrink-0"}):e.jsx(da,{size:12,className:Ce?"text-accent":"text-text-3"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:re.name||re.id}),!Ee&&e.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"(not configured)"}),Ee&&Qn&&e.jsx("span",{className:"text-2xs font-mono text-accent/70 bg-accent/8 px-1 py-px rounded",children:"rec"})]}),re.description&&e.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:re.description}),!Ee&&e.jsx("div",{className:"text-2xs text-text-4 font-sans",children:"Configure in Marketplace"})]}),Ce&&e.jsx(kP,{})]},re.id)}),F.length===0&&e.jsx("div",{className:"text-center py-6 text-xs text-text-3 font-sans",children:"No integrations installed. Visit the Marketplace to install integrations."})]})]})})}),G.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Integration Approvals"}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs("button",{onClick:()=>J("manual"),className:V("flex-1 flex items-center gap-2 px-3 py-2 rounded-md border text-left transition-all cursor-pointer",Z==="manual"?"border-accent bg-accent/5":"border-border-subtle bg-surface-1 hover:border-border"),children:[e.jsx(La,{size:13,className:Z==="manual"?"text-accent":"text-text-3"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-semibold text-text-0 font-sans",children:"Manual"}),e.jsx("div",{className:"text-2xs text-text-3 font-sans",children:"You approve each action"})]})]}),e.jsxs("button",{onClick:()=>J("auto"),className:V("flex-1 flex items-center gap-2 px-3 py-2 rounded-md border text-left transition-all cursor-pointer",Z==="auto"?"border-warning bg-warning/5":"border-border-subtle bg-surface-1 hover:border-border"),children:[e.jsx(It,{size:13,className:Z==="auto"?"text-warning":"text-text-3"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-2xs font-semibold text-text-0 font-sans",children:"Auto"}),e.jsx("div",{className:"text-2xs text-text-3 font-sans",children:"Agent acts without asking"})]})]})]})]}),Ae.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Repos"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[ae.map(re=>{const Ce=Ae.find(Ee=>Ee.id===re);return e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded bg-accent/12 text-accent border border-accent/25 text-2xs font-sans",children:[e.jsx(Js,{size:9}),(Ce==null?void 0:Ce.name)||re,e.jsx("button",{onClick:()=>Oe(Ee=>Ee.filter(ct=>ct!==re)),className:"ml-0.5 hover:text-text-0 cursor-pointer",children:e.jsx(Ge,{size:9})})]},re)}),e.jsxs("button",{onClick:()=>{ce(!0),je("")},className:V("inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-2xs font-sans transition-colors cursor-pointer","bg-surface-0 text-text-2 border border-border-subtle hover:border-border hover:text-text-0"),children:[e.jsx(Js,{size:10}),ae.length>0?"Add repo":"Attach repo"]})]})]}),e.jsx(Ut,{open:ve,onOpenChange:ce,children:e.jsx(Pt,{title:"Select Repository",className:"max-w-sm",children:e.jsxs("div",{className:"space-y-3 p-4",children:[Ae.length>1&&e.jsxs("div",{className:"relative",children:[e.jsx(oa,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),e.jsx("input",{value:he,onChange:re=>je(re.target.value),placeholder:"Search repos...",autoFocus:!0,className:"w-full h-8 pl-8 pr-3 text-xs rounded-md bg-surface-0 border border-border text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsx("div",{className:"max-h-64 overflow-y-auto space-y-1",children:Ae.filter(re=>{if(!he)return!0;const Ce=he.toLowerCase();return(re.name||re.repo||re.id).toLowerCase().includes(Ce)}).map(re=>{const Ce=ae.includes(re.id);return e.jsxs("button",{onClick:()=>{Oe(Ee=>Ce?Ee.filter(ct=>ct!==re.id):[...Ee,re.id])},className:V("w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors cursor-pointer",Ce?"bg-accent/10 border border-accent/25":"hover:bg-surface-3 border border-transparent"),children:[e.jsx(Js,{size:12,className:Ce?"text-accent":"text-text-3"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:re.name||re.repo}),e.jsx("div",{className:"text-2xs text-text-4 font-mono truncate",children:re.clonedTo})]}),Ce&&e.jsx(kP,{})]},re.id)})})]})})}),(c==="chat"||ze)&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Personality"}),e.jsxs("div",{className:"relative",children:[e.jsxs("select",{value:ye,onChange:re=>Ne(re.target.value),className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent",children:[e.jsx("option",{value:"",children:"None (blank)"}),ee.map(re=>e.jsx("option",{value:re.name||re,children:re.name||re},re.name||re))]}),e.jsx(bt,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]}),e.jsx("p",{className:"text-2xs text-text-4 font-sans",children:"Personality is injected into every prompt for this agent."})]}),c!=="chat"&&!ze&&e.jsx("button",{onClick:()=>He(!0),className:"text-2xs text-text-3 hover:text-accent font-sans transition-colors cursor-pointer",children:"+ Advanced options"})]})]}),e.jsxs("div",{className:"border-t border-border-subtle px-5 py-4 bg-surface-1",children:[ka.length===0&&j.length>0&&e.jsxs("div",{className:"flex items-center gap-2 mb-3 px-3 py-2 rounded-md bg-warning/8 border border-warning/20",children:[e.jsx(Gt,{size:13,className:"text-warning flex-shrink-0"}),e.jsx("span",{className:"text-2xs font-sans text-text-2",children:"No AI providers installed. Install Claude Code, Gemini CLI, Codex, or Ollama to spawn agents."})]}),ua&&ka.length>0&&e.jsxs("div",{className:"flex items-center gap-2 mb-3 text-xs text-text-3 font-sans",children:[e.jsx("span",{children:"Spawning"}),e.jsx(be,{variant:"accent",children:ua}),m&&e.jsxs("span",{children:["on ",(Sn==null?void 0:Sn.name)||m]}),f&&e.jsxs("span",{children:["as ",f.replace(/\s+/g,"-")]})]}),e.jsx(fe,{variant:"primary",size:"lg",onClick:Ra,disabled:!ua||Tt||ka.length===0||k2,className:"w-full",children:Tt?"Spawning...":"Spawn Agent"})]})]})}),e.jsx(Ut,{open:!!Me,onOpenChange:re=>{re||ie(null)},children:e.jsx(Pt,{title:"Integration Warning",className:"max-w-sm",children:e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx("div",{className:"space-y-2",children:(Me||[]).map((re,Ce)=>e.jsxs("div",{className:"flex items-start gap-2 text-xs text-text-1 font-sans",children:[e.jsx(Gt,{size:13,className:"text-warning flex-shrink-0 mt-0.5"}),e.jsx("span",{children:re.name?`${re.name}: ${re.problem==="not_installed"?"not installed":re.problem==="not_configured"?"not configured":"not authenticated"}`:re.message||String(re)})]},Ce))}),e.jsx("p",{className:"text-2xs text-text-3 font-sans",children:"Continue anyway?"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(fe,{variant:"ghost",size:"md",onClick:()=>ie(null),className:"flex-1",children:"Cancel"}),e.jsx(fe,{variant:"warning",size:"md",onClick:()=>{ie(null),rs()},className:"flex-1",children:"Spawn Anyway"})]})]})})})]})}function GX({title:t,icon:a,defaultOpen:n=!1,badge:s,children:o,className:c}){const[l,A]=g.useState(n);return e.jsxs("div",{className:V("border-t border-border-subtle",c),children:[e.jsxs("button",{onClick:()=>A(!l),className:"w-full flex items-center gap-2 px-5 py-3 text-left cursor-pointer hover:bg-surface-5/30 transition-colors group",children:[e.jsx(Rt,{size:12,className:V("text-text-4 transition-transform duration-200 flex-shrink-0",l&&"rotate-90")}),a&&e.jsx(a,{size:13,className:"text-text-3 flex-shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider flex-1",children:t}),s&&e.jsx("span",{className:"text-2xs font-mono text-text-4 bg-surface-4 px-1.5 py-0.5 rounded",children:s})]}),l&&e.jsx("div",{className:"px-5 pb-4",children:o})]})}function oZe(){const t=$(m=>m.journalistStatus),a=$(m=>m.fetchJournalist),n=$(m=>m.triggerJournalistCycle),[s,o]=g.useState(!0),[c,l]=g.useState(!1);g.useEffect(()=>{a().then(()=>o(!1));const m=setInterval(a,1e4);return()=>clearInterval(m)},[a]);async function A(){l(!0);try{await n()}catch{}l(!1)}if(s)return e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsx(Xn,{className:"h-6 w-32 rounded"}),e.jsx(Xn,{className:"h-20 rounded-md"}),e.jsx(Xn,{className:"h-20 rounded-md"})]});const u=t||{},f=u.lastSynthesis,x=u.history||[];return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-5 py-4 border-b border-border-subtle flex items-center gap-2",children:[e.jsx(Jo,{size:16,className:"text-accent"}),e.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans flex-1",children:"Journalist"}),e.jsxs(fe,{variant:"secondary",size:"sm",onClick:A,disabled:c,className:"gap-1.5 text-2xs",children:[e.jsx(ra,{size:11,className:c?"animate-spin":""}),c?"Running...":"Run Synthesis"]})]}),e.jsx(it,{className:"flex-1",children:e.jsxs("div",{className:"px-5 py-4 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ys,{size:10}),e.jsxs("span",{children:[u.cycleCount||0," cycles"]})]}),u.lastCycleTime&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Rr,{size:10}),e.jsxs("span",{children:["Last: ",Mt(u.lastCycleTime)]})]}),e.jsx(be,{variant:u.cycleCount>0?"success":"default",className:"text-2xs",children:u.cycleCount>0?"Active":"Idle"})]}),(f==null?void 0:f.summary)&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-xs font-semibold text-text-1 font-sans flex items-center gap-1.5",children:[e.jsx(Va,{size:12,className:"text-text-3"}),"Latest Summary"]}),e.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-sans leading-relaxed",children:f.summary})]}),(f==null?void 0:f.projectMap)&&e.jsx(GX,{title:"Project Map",icon:N0,children:e.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-mono leading-relaxed max-h-64 overflow-y-auto whitespace-pre-wrap",children:f.projectMap})}),(f==null?void 0:f.decisions)&&e.jsx(GX,{title:"Decisions Log",icon:Va,children:e.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-mono leading-relaxed max-h-64 overflow-y-auto whitespace-pre-wrap",children:f.decisions})}),x.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-xs font-semibold text-text-1 font-sans flex items-center gap-1.5",children:[e.jsx(Rr,{size:12,className:"text-text-3"}),"History (",x.length,")"]}),e.jsx("div",{className:"space-y-1.5",children:x.slice().reverse().slice(0,20).map((m,y)=>e.jsxs("div",{className:"bg-surface-0 rounded-md border border-border-subtle px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[e.jsxs(be,{variant:"default",className:"text-2xs",children:["Cycle ",m.cycle]}),e.jsxs("span",{className:"text-text-4 font-sans",children:[m.agentCount," agent",m.agentCount!==1?"s":""]}),e.jsx("span",{className:"text-text-4 font-sans ml-auto",children:Mt(m.timestamp)})]}),m.summary&&e.jsx("p",{className:"text-xs text-text-2 font-sans mt-1 leading-relaxed",children:m.summary})]},y))})]}),!f&&x.length===0&&e.jsxs("div",{className:"text-center py-8 text-text-4 font-sans",children:[e.jsx(Jo,{size:28,className:"mx-auto mb-2"}),e.jsx("p",{className:"text-sm",children:"No synthesis data yet"}),e.jsx("p",{className:"text-2xs mt-1",children:"The journalist runs automatically when agents are active, or trigger manually above"})]})]})})]})}function iZe({children:t,height:a,onHeightChange:n,visible:s,fullHeight:o,tabs:c,activeTab:l,onSelectTab:A,onAddTab:u,onCloseTab:f,onToggleFullHeight:x,onMinimize:m,onRenameTab:y}){const v=g.useRef(!1),[O,b]=g.useState(null),[C,j]=g.useState(""),N=g.useRef(0),M=g.useRef(0),Q=g.useCallback(B=>{if(o)return;B.preventDefault(),v.current=!0,N.current=B.clientY,M.current=a;function S(z){if(!v.current)return;const P=N.current-z.clientY,F=Math.min(Math.max(M.current+P,120),600);n(F)}function I(){v.current=!1,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",I)}document.addEventListener("mousemove",S),document.addEventListener("mouseup",I)},[a,n,o]),L=c||[{id:"default",label:"Terminal"}];return e.jsxs("div",{className:V("flex flex-col border-t border-border bg-surface-0 relative",!s&&"hidden"),style:s?o?{flex:1,minHeight:0}:{height:a,flexShrink:0}:{height:0},children:[!o&&e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-row-resize hover:bg-accent/30 transition-colors z-10",onMouseDown:Q}),e.jsxs("div",{className:"flex items-center h-9 bg-surface-1 border-b border-border flex-shrink-0 pl-0 pr-3",children:[e.jsxs("div",{className:"flex items-center gap-0 flex-1 min-w-0 overflow-x-auto scrollbar-none h-full",children:[L.map(B=>e.jsxs("button",{onClick:()=>A==null?void 0:A(B.id),onDoubleClick:()=>{b(B.id),j(B.label)},className:V("inline-flex items-center gap-1.5 px-3 h-full text-[11px] font-medium font-sans cursor-pointer select-none transition-colors duration-100 flex-shrink-0",B.id===l?"text-text-0 bg-surface-3":"text-text-2 hover:text-text-0 hover:bg-surface-5/50"),children:[e.jsx(Ns,{size:11}),O===B.id?e.jsx("input",{className:"bg-transparent border border-border rounded px-1 text-[11px] text-text-0 outline-none w-20 font-sans",value:C,onChange:S=>j(S.target.value),onBlur:()=>{C.trim()&&(y==null||y(B.id,C.trim())),b(null)},onKeyDown:S=>{S.key==="Enter"&&(C.trim()&&(y==null||y(B.id,C.trim())),b(null)),S.key==="Escape"&&b(null)},autoFocus:!0,onClick:S=>S.stopPropagation()}):e.jsx("span",{className:"truncate max-w-[100px]",children:B.label}),L.length>1&&e.jsx("button",{onClick:S=>{S.stopPropagation(),f==null||f(B.id)},className:"ml-1 p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 cursor-pointer",children:e.jsx(Ge,{size:9})})]},B.id)),e.jsx("button",{onClick:u,className:"flex items-center justify-center w-6 h-6 text-text-3 hover:text-text-0 hover:bg-surface-5/50 rounded cursor-pointer transition-colors flex-shrink-0 ml-1",title:"New terminal",children:e.jsx(ht,{size:11})})]}),e.jsx("div",{className:"flex items-center gap-0.5 flex-shrink-0 ml-2",children:o?e.jsx("button",{onClick:m,className:"p-1.5 rounded text-text-3 hover:text-text-0 hover:bg-surface-5 cursor-pointer transition-colors",title:"Restore",children:e.jsx(S0,{size:12})}):e.jsx("button",{onClick:x,className:"p-1.5 rounded text-text-3 hover:text-text-0 hover:bg-surface-5 cursor-pointer transition-colors",title:"Maximize",children:e.jsx(BA,{size:12})})})]}),e.jsx("div",{className:"flex-1 min-h-0 pl-2 pt-1",children:t})]})}const cZe={background:"#1a1e25",foreground:"#c8ccd4",cursor:"#33afbc",cursorAccent:"#1a1e25",selectionBackground:"rgba(51, 175, 188, 0.3)",selectionForeground:"#ffffff",black:"#1a1e25",red:"#e06c75",green:"#4ae168",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#33afbc",white:"#abb2bf",brightBlack:"#5c6370",brightRed:"#f07178",brightGreen:"#4ae168",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#ffffff"};let OP=0,lZe=0;function dZe({tabId:t,visible:a,registerKill:n}){const s=g.useRef(null),o=g.useRef(null),c=g.useRef(null),l=g.useRef(null),A=g.useRef(null),u=g.useRef(!1),f=g.useRef(a),x=g.useRef({cols:0,rows:0});return g.useEffect(()=>{n==null||n(t,()=>{const m=$.getState().ws;(m==null?void 0:m.readyState)===WebSocket.OPEN&&l.current&&m.send(JSON.stringify({type:"terminal:kill",id:l.current}))})},[t,n]),g.useEffect(()=>{if(!s.current||u.current)return;u.current=!0;const m=new fne({theme:cZe,fontFamily:"'JetBrains Mono Variable', 'SF Mono', monospace",fontSize:12,lineHeight:1.1,letterSpacing:0,cursorBlink:!0,cursorStyle:"bar",cursorWidth:1,scrollback:1e4,allowProposedApi:!0,minimumContrastRatio:1,drawBoldTextInBrightColors:!0,fontWeight:"400",fontWeightBold:"600",overviewRulerWidth:0}),y=new xne;m.loadAddon(y),m.loadAddon(new mne),m.open(s.current),o.current=m,c.current=y;let v=0;function O(){v++;const C=$.getState().ws;if(!C||C.readyState!==WebSocket.OPEN){v<20&&setTimeout(O,500);return}const j=`spawn-${++lZe}`;C.send(JSON.stringify({type:"terminal:spawn",cols:m.cols,rows:m.rows,requestId:j}));function N(M){let Q;try{Q=JSON.parse(M.data)}catch{return}Q.type==="terminal:spawned"&&Q.requestId===j&&!l.current?l.current=Q.id:Q.type==="terminal:output"&&Q.id===l.current?m.write(Q.data):Q.type==="terminal:exit"&&Q.id===l.current&&(m.write(`\r
8688
8688
  \x1B[90m[session ended]\x1B[0m\r
8689
8689
  `),l.current=null)}C.addEventListener("message",N),A.current={ws:C,handler:N},m.onData(M=>{const Q=$.getState().ws;(Q==null?void 0:Q.readyState)===WebSocket.OPEN&&l.current&&Q.send(JSON.stringify({type:"terminal:input",id:l.current,data:M}))}),m.onResize(({cols:M,rows:Q})=>{if(M===x.current.cols&&Q===x.current.rows||M<2||Q<2)return;x.current={cols:M,rows:Q};const L=$.getState().ws;(L==null?void 0:L.readyState)===WebSocket.OPEN&&l.current&&L.send(JSON.stringify({type:"terminal:resize",id:l.current,rows:Q,cols:M}))})}requestAnimationFrame(()=>{try{y.fit()}catch{}O()});const b=new ResizeObserver(()=>{f.current&&requestAnimationFrame(()=>{try{y.fit()}catch{}})});return b.observe(s.current),()=>{b.disconnect(),A.current&&A.current.ws.removeEventListener("message",A.current.handler),m.dispose(),c.current=null,u.current=!1}},[]),g.useEffect(()=>{f.current=a,a&&c.current&&requestAnimationFrame(()=>{try{c.current.fit()}catch{}})},[a]),e.jsx("div",{ref:s,className:"w-full h-full overflow-hidden",style:{display:a?"block":"none"}})}function AZe(){const t=$(b=>b.terminalVisible),a=$(b=>b.terminalHeight),n=$(b=>b.setTerminalVisible),s=$(b=>b.setTerminalHeight),o=$(b=>b.terminalFullHeight),c=$(b=>b.setTerminalFullHeight),[l,A]=g.useState([{id:"term-0",label:"Terminal"}]),[u,f]=g.useState("term-0"),x=g.useRef({}),m=g.useCallback((b,C)=>{x.current[b]=C},[]),y=g.useCallback(()=>{OP++;const b=`term-${OP}`;A(C=>[...C,{id:b,label:`Terminal ${OP+1}`}]),f(b)},[]),v=g.useCallback((b,C)=>{A(j=>j.map(N=>N.id===b?{...N,label:C}:N))},[]),O=g.useCallback(b=>{var C,j;(j=(C=x.current)[b])==null||j.call(C),delete x.current[b],A(N=>{const M=N.filter(Q=>Q.id!==b);if(M.length===0)return n(!1),N;if(u===b){const Q=N.findIndex(B=>B.id===b),L=M[Math.min(Q,M.length-1)];f(L.id)}return M})},[u,n]);return e.jsx(iZe,{visible:t,height:a,onHeightChange:s,fullHeight:o,tabs:l,activeTab:u,onSelectTab:f,onAddTab:y,onCloseTab:O,onRenameTab:v,onToggleFullHeight:()=>c(!0),onMinimize:()=>c(!1),children:l.map(b=>e.jsx(dZe,{tabId:b.id,visible:b.id===u,registerKill:m},b.id))})}class Nf extends Lo.Component{constructor(a){super(a),this.state={error:null}}static getDerivedStateFromError(a){return{error:a}}render(){return this.state.error?e.jsxs("div",{className:"h-screen bg-surface-0 p-10 font-sans",children:[e.jsx("h2",{className:"text-lg font-semibold text-text-0 mb-4",children:"Groove — Render Error"}),e.jsx("pre",{className:"text-sm text-danger whitespace-pre-wrap mb-4",children:this.state.error.message}),e.jsx("pre",{className:"text-xs text-text-3 whitespace-pre-wrap",children:this.state.error.stack}),e.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-6 px-4 py-2 bg-accent text-surface-0 rounded-md font-medium text-sm cursor-pointer",children:"Try Again"})]}):this.props.children}}function uZe(){const t=$(c=>c.activeView),a=$(c=>c.detailPanel);$(c=>c.agents);const n=$(c=>c.networkUnlocked);let s;switch(t){case"agents":s=e.jsx(uP,{});break;case"editor":s=e.jsx(yHe,{});break;case"dashboard":s=e.jsx(KHe,{});break;case"marketplace":s=e.jsx(wqe,{});break;case"toys":s=e.jsx(LDe,{});break;case"teams":s=e.jsx(_qe,{});break;case"models":s=e.jsx(hDe,{});break;case"model-lab":s=e.jsx(pVe,{});break;case"federation":s=e.jsx(wDe,{});break;case"settings":s=e.jsx(tDe,{});break;case"chat":s=e.jsx(TXe,{});break;case"preview":s=e.jsx($Xe,{});break;case"network":s=n?e.jsx(cXe,{}):e.jsx(uP,{});break;default:s=e.jsx(uP,{})}let o=null;if(a)switch(a.type){case"agent":{o=e.jsx(nZe,{});break}case"journalist":o=e.jsx(oZe,{});break;case"spawn":o=null;break}return e.jsxs(qRe,{detailContent:o,terminalContent:e.jsx(AZe,{}),children:[s,e.jsx(rZe,{})]})}function hZe(){const t=$(n=>n.remoteHomedir),a=$(n=>n.setProjectDir);return e.jsxs("div",{className:"fixed inset-0 z-40 bg-surface-0 flex flex-col items-center justify-center gap-3",children:[e.jsx("img",{src:"/favicon.png",alt:"",className:"w-10 h-10 opacity-60"}),e.jsx("p",{className:"text-sm text-text-3 font-sans",children:"Connected — choose a project directory to continue"}),e.jsx(Hu,{open:!0,onOpenChange:()=>{},currentPath:t||"/home",homePath:t,onSelect:n=>a(n),mandatory:!0})]})}function pZe(){return e.jsxs("div",{className:"h-screen bg-surface-0 flex flex-col items-center justify-center gap-4",children:[e.jsx("img",{src:"/favicon.png",alt:"",className:"w-10 h-10 opacity-60 animate-pulse"}),e.jsx("p",{className:"text-sm text-text-3 font-sans",children:"Connecting..."})]})}function fZe(){const t=$(l=>l.connect),a=$(l=>l.hydrated),n=$(l=>l.tunneled),s=$(l=>l.onboardingComplete),o=$(l=>l.showProjectPicker);g.useEffect(()=>{t()},[t]),g.useEffect(()=>{async function l(){var f;if((f=window.groove)!=null&&f.getInstanceInfo){const x=await window.groove.getInstanceInfo();if(x!=null&&x.name){document.title=`${x.name} — Groove`;return}}const u=new URLSearchParams(window.location.search).get("instance");if(u){const x=u.replace(/[\x00-\x1F]/g,"").slice(0,50);document.title=`${x} — Groove`}else n?document.title="Remote — Groove":document.title="Groove"}l()},[n]);const c=g.useMemo(()=>{var l;return(l=window.groove)!=null&&l.openFolder?[{key:"o",meta:!0,handler:()=>window.groove.openFolder()}]:[]},[]);return lZ(c),a?s?o&&n?e.jsx(Nf,{children:e.jsx(hZe,{})}):o?e.jsxs(Nf,{children:[e.jsx(rHe,{}),e.jsx(SX,{})]}):e.jsxs(Nf,{children:[e.jsx(uZe,{}),e.jsx(SX,{}),e.jsx(sHe,{})]}):e.jsx(Nf,{children:e.jsx(aHe,{})}):e.jsx(pZe,{})}One.createRoot(document.getElementById("root")).render(e.jsx(g.StrictMode,{children:e.jsx(fZe,{})}));