@ai-sdet/test-manager 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +312 -0
- package/dist/cli.js +16455 -0
- package/dist/client/assets/AIView-BYoeRnLC.js +73 -0
- package/dist/client/assets/AdminSettingsView-JqCQI3K1.js +1 -0
- package/dist/client/assets/ChatSection-rpiFyFcg.js +8 -0
- package/dist/client/assets/MilestonesView-CTJ8r67W.js +1 -0
- package/dist/client/assets/ReportsView-DJ8KPr1J.js +1 -0
- package/dist/client/assets/RunExecution-BJnn0cq7.js +1 -0
- package/dist/client/assets/RunsView-oDa9JyRq.js +1 -0
- package/dist/client/assets/SettingsView-BVCLWqOk.js +1 -0
- package/dist/client/assets/SpaceView-BxtPCtW1.js +1 -0
- package/dist/client/assets/TestEditor-Dthst0HS.js +63 -0
- package/dist/client/assets/TestMuImportDialog-B2yx7BdF.js +5 -0
- package/dist/client/assets/TrashView-B5uFN2Ua.js +1 -0
- package/dist/client/assets/UserGroupsView-MGu6frpT.js +1 -0
- package/dist/client/assets/UsersView-DwWeOblN.js +1 -0
- package/dist/client/assets/comments-section-CHZSUoK5.js +53 -0
- package/dist/client/assets/hooks-BItXZ0yP.js +1 -0
- package/dist/client/assets/hooks-BM-wcPhm.js +4 -0
- package/dist/client/assets/icons-J9gKYxTz.js +41 -0
- package/dist/client/assets/index-CYPrMEmp.css +1 -0
- package/dist/client/assets/index-a9kCDHqT.js +7 -0
- package/dist/client/assets/markdown-YKl4gdXq.js +29 -0
- package/dist/client/assets/radix-ui-Cxk3sw_C.js +41 -0
- package/dist/client/assets/react-D-pHAthU.js +40 -0
- package/dist/client/assets/tiptap-Ch64zYGz.js +167 -0
- package/dist/client/index.html +62 -0
- package/dist/index.js +12990 -0
- package/dist/server/index.js +16195 -0
- package/package.json +124 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-white:#fff;--spacing:.25rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:before,:after{box-sizing:border-box}}@layer components;@layer utilities{.\@container\/card-header{container:card-header/inline-size}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.top-1\/2{top:50%}.left-1\/2{left:50%}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-3{height:calc(var(--spacing) * 3)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-14{height:calc(var(--spacing) * 14)}.h-full{height:100%}.h-screen{height:100vh}.min-h-16{min-height:calc(var(--spacing) * 16)}.w-3{width:calc(var(--spacing) * 3)}.w-9{width:calc(var(--spacing) * 9)}.w-36{width:calc(var(--spacing) * 36)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-125{max-width:calc(var(--spacing) * 125)}.max-w-lg{max-width:var(--container-lg)}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.auto-rows-min{grid-auto-rows:min-content}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-border{border-color:var(--border)}.border-destructive\/20{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/20{border-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.border-destructive\/30{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/30{border-color:color-mix(in oklab,var(--destructive) 30%,transparent)}}.border-green\/20{border-color:#22c55e33}.border-green\/30{border-color:#22c55e4d}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive,.bg-destructive\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.bg-green{background-color:#22c55e}.bg-green\/10{background-color:#22c55e1a}.bg-muted{background-color:var(--muted)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.p-1{padding:var(--spacing)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.text-center{text-align:center}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-green{color:#22c55e}.text-muted-foreground,.text-muted-foreground\/60{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/60{color:color-mix(in oklab,var(--muted-foreground) 60%,transparent)}}.text-primary-foreground{color:var(--primary-foreground)}.text-purple{color:#a855f7}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.text-yellow{color:#eab308}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-700{--tw-duration:.7s;transition-duration:.7s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media (hover:hover){.hover\:bg-destructive\/10:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/10:hover{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.hover\:bg-green\/10:hover{background-color:#22c55e1a}.hover\:underline:hover{text-decoration-line:underline}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:scale-\[0\.97\]:active{scale:.97}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--foreground)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media (min-width:48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\"size-\"\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}@media (hover:hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}a.\[a\&\]\:hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}}:root{--t-bg-base:#000;--t-bg-surface:#0d0d0d;--t-bg-panel:#111;--t-bg-elevated:#141414;--t-bg-hover:#161616;--t-sidebar-hover:#ffffff0d;--t-sidebar-active:#ffffff17;--t-border-subtle:#1a1a1a;--t-border-default:#222;--t-border-strong:#333;--t-text-primary:#ededed;--t-text-secondary:#888;--t-text-muted:#555;--t-accent-danger:#e5484d;--t-accent-success:#1a9e5e;--t-accent-warning:#b45309;--t-accent-blocked:#f97316;--t-row-hover:#ffffff06;--t-row-selected:#ffffff0a;--t-elem-hover:#ffffff12;--t-shadow-sm:0 4px 16px #00000080;--t-shadow-lg:0 24px 60px #000c;--t-overlay:#0009;--t-font-sans:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;--t-font-mono:ui-monospace, SFMono-Regular, "Cascadia Code", monospace;--t-font-size:14px;--t-text-2xs:calc(var(--t-font-size) - 3px);--t-text-xs:calc(var(--t-font-size) - 2px);--t-text-sm:calc(var(--t-font-size) - 1px);--t-text-base:var(--t-font-size);--t-text-lg:calc(var(--t-font-size) + 1px);--t-text-xl:calc(var(--t-font-size) + 3px);--t-text-2xl:calc(var(--t-font-size) + 5px);--t-radius:8px;--background:var(--t-bg-base);--foreground:var(--t-text-primary);--card:var(--t-bg-surface);--card-foreground:var(--t-text-primary);--popover:var(--t-bg-panel);--popover-foreground:var(--t-text-primary);--primary:#0070f3;--primary-foreground:#fff;--secondary:var(--t-bg-surface);--secondary-foreground:var(--t-text-secondary);--muted:var(--t-bg-panel);--muted-foreground:var(--t-text-secondary);--accent:var(--t-bg-surface);--accent-foreground:var(--t-text-primary);--destructive:var(--t-accent-danger);--border:var(--t-border-strong);--input:var(--t-bg-surface);--ring:#0070f3;--radius:.375rem}html,body,#root{background:var(--t-bg-base);height:100%;color:var(--t-text-primary);font-family:var(--t-font-sans);font-size:var(--t-font-size,14px);-webkit-font-smoothing:antialiased;line-height:1.5}::-webkit-scrollbar{width:4px;height:4px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--t-border-strong);border-radius:99px}::-webkit-scrollbar-thumb:hover{background:var(--t-text-muted)}button,input,textarea,select{font-family:inherit;font-size:inherit}.rich-preview p{margin:0 0 5px}.rich-preview p:last-child{margin-bottom:0}.rich-preview h1{margin:8px 0 5px;font-size:17px;font-weight:700}.rich-preview h2{margin:6px 0 4px;font-size:14px;font-weight:600}.rich-preview h3{margin:5px 0 3px;font-size:13px;font-weight:600}.rich-preview ul,.rich-preview ol{margin:3px 0;padding-left:20px}.rich-preview li{margin:2px 0}.rich-preview ul[data-type=taskList]{padding-left:2px;list-style:none}.rich-preview ul[data-type=taskList] li{align-items:flex-start;gap:7px;margin:3px 0;display:flex}.rich-preview ul[data-type=taskList] li>div{flex:1}.rich-preview code{background:var(--t-bg-surface);border:1px solid var(--t-border-subtle);border-radius:4px;padding:1px 5px;font-family:Menlo,Monaco,monospace;font-size:11px}.rich-preview pre{background:var(--t-bg-surface);border:1px solid var(--t-border-subtle);border-radius:6px;margin:5px 0;padding:10px 12px;font-family:Menlo,Monaco,monospace;font-size:11px;overflow-x:auto}.rich-preview pre code{background:0 0;border:none;padding:0}.rich-preview blockquote{border-left:3px solid var(--t-border-default);color:var(--t-text-secondary);margin:5px 0;padding-left:12px}.rich-preview hr{border:none;border-top:1px solid var(--t-border-subtle);margin:8px 0}.rich-preview strong{font-weight:600}.rich-preview em{font-style:italic}.rich-preview u{text-decoration:underline}.rich-preview s{text-decoration:line-through}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AIView-BYoeRnLC.js","assets/react-D-pHAthU.js","assets/icons-J9gKYxTz.js","assets/ChatSection-rpiFyFcg.js","assets/hooks-BM-wcPhm.js","assets/comments-section-CHZSUoK5.js","assets/tiptap-Ch64zYGz.js","assets/markdown-YKl4gdXq.js","assets/radix-ui-Cxk3sw_C.js","assets/AdminSettingsView-JqCQI3K1.js","assets/hooks-BItXZ0yP.js","assets/SpaceView-BxtPCtW1.js","assets/TestEditor-Dthst0HS.js","assets/RunsView-oDa9JyRq.js","assets/RunExecution-BJnn0cq7.js","assets/MilestonesView-CTJ8r67W.js","assets/SettingsView-BVCLWqOk.js","assets/TrashView-B5uFN2Ua.js","assets/UsersView-DwWeOblN.js","assets/UserGroupsView-MGu6frpT.js","assets/TestMuImportDialog-B2yx7BdF.js","assets/ReportsView-DJ8KPr1J.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as l,j as s,a as kn,e as Cn}from"./react-D-pHAthU.js";import{m as Rn,n as ys,a as Ns,b as is,f as Xs,c as xe,d as Tn,e as En,g as Zs,X as zn,h as Pn,i as Dt,s as er,j as Ls,k as os,l as bs,o as at,p as On,q as it,r as ns,t as tr,u as In,v as Dn,w as Nn,x as sr,y as rr,z as nr,A as or,B as ar,C as vs,D as Cs,E as Ss,F as ir,G as Ln,H as An,I as Rs,J as ls,K as Ts,L as Mn,M as _n,N as Fn}from"./icons-J9gKYxTz.js";import{S as Jn,R as Bn,D as lr,a as dr,b as cr,c as Vn,d as Wn,e as Gn,f as ur}from"./radix-ui-Cxk3sw_C.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const d of i)if(d.type==="childList")for(const c of d.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function r(i){const d={};return i.integrity&&(d.integrity=i.integrity),i.referrerPolicy&&(d.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?d.credentials="include":i.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function n(i){if(i.ep)return;i.ep=!0;const d=r(i);fetch(i.href,d)}})();const pr=l.createContext({clipboard:null,copy:()=>{},cut:()=>{},clear:()=>{}});function Un({children:e}){const[t,r]=l.useState(null),n=c=>r({...c,mode:"copy"}),i=c=>r({...c,mode:"cut"}),d=()=>r(null);return s.jsx(pr.Provider,{value:{clipboard:t,copy:n,cut:i,clear:d},children:e})}function Hn(){return l.useContext(pr)}const o="/api";async function a(e,t){const r=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}});if(r.status===401&&window.dispatchEvent(new CustomEvent("auth:unauthorized")),!r.ok){const n=await r.json().catch(()=>({error:r.statusText}));throw new Error(n.error||r.statusText)}return r.json()}const I={apps:{list:()=>a(`${o}/apps`),get:e=>a(`${o}/apps/${e}`),create:e=>a(`${o}/apps`,{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>a(`${o}/apps/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>a(`${o}/apps/${e}`,{method:"DELETE"}),myRole:e=>a(`${o}/apps/${e}/my-role`)},spaces:{list:e=>a(`${o}/apps/${e}/spaces`),get:(e,t)=>a(`${o}/apps/${e}/spaces/${t}`),create:(e,t)=>a(`${o}/apps/${e}/spaces`,{method:"POST",body:JSON.stringify(t)}),update:(e,t,r)=>a(`${o}/apps/${e}/spaces/${t}`,{method:"PUT",body:JSON.stringify(r)}),delete:(e,t)=>a(`${o}/apps/${e}/spaces/${t}`,{method:"DELETE"})},folders:{list:e=>a(`${o}/spaces/${e}/folders`),create:(e,t)=>a(`${o}/spaces/${e}/folders`,{method:"POST",body:JSON.stringify(t)}),update:(e,t,r)=>a(`${o}/spaces/${e}/folders/${t}`,{method:"PUT",body:JSON.stringify(r)}),delete:(e,t)=>a(`${o}/spaces/${e}/folders/${t}`,{method:"DELETE"})},tests:{list:e=>a(`${o}/folders/${e}/tests`),get:(e,t)=>a(`${o}/folders/${e}/tests/${t}`),create:(e,t)=>a(`${o}/folders/${e}/tests`,{method:"POST",body:JSON.stringify(t)}),update:(e,t,r)=>a(`${o}/folders/${e}/tests/${t}`,{method:"PUT",body:JSON.stringify(r)}),delete:(e,t)=>a(`${o}/folders/${e}/tests/${t}`,{method:"DELETE"}),history:(e,t)=>a(`${o}/folders/${e}/tests/${t}/history`),steps:{list:(e,t)=>a(`${o}/folders/${e}/tests/${t}/steps`),create:(e,t,r)=>a(`${o}/folders/${e}/tests/${t}/steps`,{method:"POST",body:JSON.stringify(r)}),update:(e,t,r,n)=>a(`${o}/folders/${e}/tests/${t}/steps/${r}`,{method:"PUT",body:JSON.stringify(n)}),delete:(e,t,r)=>a(`${o}/folders/${e}/tests/${t}/steps/${r}`,{method:"DELETE"})},scenarios:{list:(e,t)=>a(`${o}/folders/${e}/tests/${t}/scenarios`),create:(e,t,r)=>a(`${o}/folders/${e}/tests/${t}/scenarios`,{method:"POST",body:JSON.stringify(r)}),update:(e,t,r,n)=>a(`${o}/folders/${e}/tests/${t}/scenarios/${r}`,{method:"PUT",body:JSON.stringify(n)}),delete:(e,t,r)=>a(`${o}/folders/${e}/tests/${t}/scenarios/${r}`,{method:"DELETE"}),steps:{create:(e,t,r,n)=>a(`${o}/folders/${e}/tests/${t}/scenarios/${r}/steps`,{method:"POST",body:JSON.stringify(n)}),update:(e,t,r,n,i)=>a(`${o}/folders/${e}/tests/${t}/scenarios/${r}/steps/${n}`,{method:"PUT",body:JSON.stringify(i)}),delete:(e,t,r,n)=>a(`${o}/folders/${e}/tests/${t}/scenarios/${r}/steps/${n}`,{method:"DELETE"})}}},runs:{list:e=>a(`${o}/apps/${e}/runs`),get:(e,t)=>a(`${o}/apps/${e}/runs/${t}`),create:(e,t)=>a(`${o}/apps/${e}/runs`,{method:"POST",body:JSON.stringify(t)}),update:(e,t,r)=>a(`${o}/apps/${e}/runs/${t}`,{method:"PATCH",body:JSON.stringify(r)}),setStatus:(e,t,r)=>a(`${o}/apps/${e}/runs/${t}/status`,{method:"PATCH",body:JSON.stringify({status:r})}),delete:(e,t)=>a(`${o}/apps/${e}/runs/${t}`,{method:"DELETE"}),duplicate:(e,t)=>a(`${o}/apps/${e}/runs/${t}/duplicate`,{method:"POST",body:JSON.stringify({})}),results:(e,t)=>a(`${o}/apps/${e}/runs/${t}/results`),markResult:(e,t,r,n)=>a(`${o}/apps/${e}/runs/${t}/results/${r}`,{method:"PATCH",body:JSON.stringify(n)}),markBulk:(e,t,r)=>a(`${o}/apps/${e}/runs/${t}/results/bulk`,{method:"PATCH",body:JSON.stringify(r)}),markStep:(e,t,r,n,i)=>a(`${o}/apps/${e}/runs/${t}/results/${r}/steps/${n}`,{method:"PATCH",body:JSON.stringify(i)}),report:(e,t)=>a(`${o}/apps/${e}/runs/${t}/report`),addItems:(e,t,r)=>a(`${o}/apps/${e}/runs/${t}/items`,{method:"POST",body:JSON.stringify({pack:r})}),resetProgress:(e,t,r)=>a(`${o}/apps/${e}/runs/${t}/results/reset`,{method:"POST",body:JSON.stringify(r!=null?{folderId:r}:{})}),resetResult:(e,t,r)=>a(`${o}/apps/${e}/runs/${t}/results/${r}/reset`,{method:"POST",body:JSON.stringify({})}),removeResult:(e,t,r)=>a(`${o}/apps/${e}/runs/${t}/results/${r}`,{method:"DELETE"})},milestones:{list:e=>a(`${o}/apps/${e}/milestones`),get:(e,t)=>a(`${o}/apps/${e}/milestones/${t}`),create:(e,t)=>a(`${o}/apps/${e}/milestones`,{method:"POST",body:JSON.stringify(t)}),update:(e,t,r)=>a(`${o}/apps/${e}/milestones/${t}`,{method:"PATCH",body:JSON.stringify(r)}),delete:(e,t)=>a(`${o}/apps/${e}/milestones/${t}`,{method:"DELETE"}),runs:(e,t)=>a(`${o}/apps/${e}/milestones/${t}/runs`)},comments:{list:(e,t)=>a(`${o}/runs/${e}/results/${t}/comments`),listStep:(e,t,r)=>a(`${o}/runs/${e}/results/${t}/steps/${r}/comments`),create:(e,t,r)=>a(`${o}/runs/${e}/results/${t}/comments`,{method:"POST",body:JSON.stringify({content:r})}),createStep:(e,t,r,n)=>a(`${o}/runs/${e}/results/${t}/steps/${r}/comments`,{method:"POST",body:JSON.stringify({content:n})}),reply:(e,t,r)=>a(`${o}/runs/${e}/comments/${t}/replies`,{method:"POST",body:JSON.stringify({content:r})}),update:(e,t,r)=>a(`${o}/runs/${e}/comments/${t}`,{method:"PUT",body:JSON.stringify({content:r})}),delete:(e,t)=>a(`${o}/runs/${e}/comments/${t}`,{method:"DELETE"}),updateTicket:(e,t,r)=>a(`${o}/runs/${e}/results/${t}/ticket`,{method:"PATCH",body:JSON.stringify({ticketId:r})}),updateStepTicket:(e,t,r,n)=>a(`${o}/runs/${e}/results/${t}/steps/${r}/ticket`,{method:"PATCH",body:JSON.stringify({ticketId:n})})},attachments:{list:(e,t)=>a(`${o}/runs/${e}/results/${t}/attachments`),listStep:(e,t,r)=>a(`${o}/runs/${e}/results/${t}/steps/${r}/attachments`)},mentionables:{list:e=>a(`${o}/apps/${e}/mentionables`),detail:(e,t)=>a(`${o}/apps/${e}/mentionables/${encodeURIComponent(t)}`)},settings:{get:e=>a(`${o}/apps/${e}/app-settings`),set:(e,t,r)=>a(`${o}/apps/${e}/app-settings/${t}`,{method:"PUT",body:JSON.stringify({value:r})})},fields:{list:e=>a(`${o}/apps/${e}/fields`),create:(e,t)=>a(`${o}/apps/${e}/fields`,{method:"POST",body:JSON.stringify(t)}),update:(e,t,r)=>a(`${o}/apps/${e}/fields/${t}`,{method:"PUT",body:JSON.stringify(r)}),delete:(e,t)=>a(`${o}/apps/${e}/fields/${t}`,{method:"DELETE"}),values:{list:(e,t)=>a(`${o}/apps/${e}/fields/values/${t}`),set:(e,t,r,n)=>a(`${o}/apps/${e}/fields/values/${t}`,{method:"PUT",body:JSON.stringify({fieldId:r,value:n})})}},bulk:{tests:{duplicate:e=>a(`${o}/bulk/tests/duplicate`,{method:"POST",body:JSON.stringify(e)}),move:e=>a(`${o}/bulk/tests/move`,{method:"PATCH",body:JSON.stringify(e)}),delete:e=>a(`${o}/bulk/tests/delete`,{method:"POST",body:JSON.stringify(e)}),update:e=>a(`${o}/bulk/tests/update`,{method:"PATCH",body:JSON.stringify(e)})},folders:{duplicate:e=>a(`${o}/bulk/folders/duplicate`,{method:"POST",body:JSON.stringify(e)}),move:e=>a(`${o}/bulk/folders/move`,{method:"PATCH",body:JSON.stringify(e)})}},trash:{list:e=>a(`${o}/spaces/${e}/trash`),restoreTests:(e,t)=>a(`${o}/spaces/${e}/trash/tests/restore`,{method:"POST",body:JSON.stringify({testIds:t})}),restoreFolders:(e,t)=>a(`${o}/spaces/${e}/trash/folders/restore`,{method:"POST",body:JSON.stringify({folderIds:t})}),deleteTestPermanently:(e,t)=>a(`${o}/spaces/${e}/trash/tests/${t}`,{method:"DELETE"}),deleteFolderPermanently:(e,t)=>a(`${o}/spaces/${e}/trash/folders/${t}`,{method:"DELETE"})},integrations:{list:e=>a(`${o}/apps/${e}/integrations`),upsert:(e,t,r,n)=>a(`${o}/apps/${e}/integrations/${t}`,{method:"PUT",body:JSON.stringify({config:r,enabled:n})}),delete:(e,t)=>a(`${o}/apps/${e}/integrations/${t}`,{method:"DELETE"}),discoverMrField:(e,t)=>a(`${o}/apps/${e}/integrations/jira/discover-mr-field`,{method:"POST",body:JSON.stringify({ticketKey:t})})},jiraTickets:{getTickets:(e,t)=>a(`${o}/apps/${e}/jira/tickets?filterId=${encodeURIComponent(t)}`),listFilters:e=>a(`${o}/apps/${e}/jira/filters`),addFilter:(e,t)=>a(`${o}/apps/${e}/jira/filters`,{method:"POST",body:JSON.stringify({filterId:t})}),removeFilter:(e,t)=>a(`${o}/apps/${e}/jira/filters/${encodeURIComponent(t)}`,{method:"DELETE"})},auth:{login:(e,t)=>a(`${o}/auth/login`,{method:"POST",body:JSON.stringify({email:e,password:t})}),logout:()=>a(`${o}/auth/logout`,{method:"POST"}),me:()=>a(`${o}/auth/me`),forgotPassword:e=>a(`${o}/auth/forgot-password`,{method:"POST",body:JSON.stringify({email:e})}),resetPassword:(e,t)=>a(`${o}/auth/reset-password`,{method:"POST",body:JSON.stringify({token:e,newPassword:t})}),changePassword:(e,t)=>a(`${o}/auth/change-password`,{method:"POST",body:JSON.stringify({currentPassword:e,newPassword:t})})},tokens:{list:()=>a(`${o}/tokens`),create:(e,t)=>a(`${o}/tokens`,{method:"POST",body:JSON.stringify({name:e,expiresAt:t})}),delete:e=>a(`${o}/tokens/${e}`,{method:"DELETE"})},members:{app:{list:e=>a(`${o}/apps/${e}/members`),add:(e,t,r)=>a(`${o}/apps/${e}/members`,{method:"POST",body:JSON.stringify({userId:t,role:r})}),update:(e,t,r)=>a(`${o}/apps/${e}/members/${t}`,{method:"PUT",body:JSON.stringify({role:r})}),remove:(e,t)=>a(`${o}/apps/${e}/members/${t}`,{method:"DELETE"})},space:{list:e=>a(`${o}/spaces/${e}/members`),add:(e,t,r)=>a(`${o}/spaces/${e}/members`,{method:"POST",body:JSON.stringify({userId:t,role:r})}),update:(e,t,r)=>a(`${o}/spaces/${e}/members/${t}`,{method:"PUT",body:JSON.stringify({role:r})}),remove:(e,t)=>a(`${o}/spaces/${e}/members/${t}`,{method:"DELETE"})},appGroups:{list:e=>a(`${o}/apps/${e}/group-access`),add:(e,t,r)=>a(`${o}/apps/${e}/group-access`,{method:"POST",body:JSON.stringify({groupId:t,role:r})}),update:(e,t,r)=>a(`${o}/apps/${e}/group-access/${t}`,{method:"PUT",body:JSON.stringify({role:r})}),remove:(e,t)=>a(`${o}/apps/${e}/group-access/${t}`,{method:"DELETE"})},spaceGroups:{list:e=>a(`${o}/spaces/${e}/group-access`),add:(e,t,r)=>a(`${o}/spaces/${e}/group-access`,{method:"POST",body:JSON.stringify({groupId:t,role:r})}),update:(e,t,r)=>a(`${o}/spaces/${e}/group-access/${t}`,{method:"PUT",body:JSON.stringify({role:r})}),remove:(e,t)=>a(`${o}/spaces/${e}/group-access/${t}`,{method:"DELETE"})}},groups:{list:()=>a(`${o}/groups`),create:e=>a(`${o}/groups`,{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>a(`${o}/groups/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>a(`${o}/groups/${e}`,{method:"DELETE"}),members:{list:e=>a(`${o}/groups/${e}/members`),add:(e,t)=>a(`${o}/groups/${e}/members`,{method:"POST",body:JSON.stringify({userId:t})}),remove:(e,t)=>a(`${o}/groups/${e}/members/${t}`,{method:"DELETE"})}},users:{list:()=>a(`${o}/users`),search:e=>a(`${o}/users/search?q=${encodeURIComponent(e)}`),create:e=>a(`${o}/users`,{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>a(`${o}/users/${e}`,{method:"PUT",body:JSON.stringify(t)}),resetPassword:e=>a(`${o}/users/${e}/reset-password`,{method:"POST"}),delete:e=>a(`${o}/users/${e}`,{method:"DELETE"})},authConfig:{get:()=>a(`${o}/auth-config`),update:e=>a(`${o}/auth-config`,{method:"PUT",body:JSON.stringify(e)}),testEmail:e=>a(`${o}/auth-config/test-email`,{method:"POST",body:JSON.stringify(e)})},sso:{config:()=>a(`${o}/auth/sso/config`)},cacheConfig:{get:()=>a(`${o}/cache-config`),test:e=>a(`${o}/cache-config/test`,{method:"POST",body:JSON.stringify(e)}),update:e=>a(`${o}/cache-config`,{method:"PUT",body:JSON.stringify(e)})},branding:{get:()=>a(`${o}/branding`),update:e=>a(`${o}/branding`,{method:"PUT",body:JSON.stringify(e)}),reset:()=>a(`${o}/branding/reset`,{method:"POST",body:"{}"})},theme:{get:()=>a(`${o}/theme`),update:e=>a(`${o}/theme`,{method:"PUT",body:JSON.stringify(e)}),reset:()=>a(`${o}/theme/reset`,{method:"POST",body:"{}"})},globalTags:{list:()=>a(`${o}/global-tags`),create:e=>a(`${o}/global-tags`,{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>a(`${o}/global-tags/${e}`,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>a(`${o}/global-tags/${e}`,{method:"DELETE"})},spaceTags:{list:e=>a(`${o}/spaces/${e}/space-tags`),create:(e,t)=>a(`${o}/spaces/${e}/space-tags`,{method:"POST",body:JSON.stringify(t)}),update:(e,t,r)=>a(`${o}/spaces/${e}/space-tags/${t}`,{method:"PATCH",body:JSON.stringify(r)}),delete:(e,t)=>a(`${o}/spaces/${e}/space-tags/${t}`,{method:"DELETE"})},dbConfig:{get:()=>a(`${o}/db-config`),test:e=>a(`${o}/db-config/test`,{method:"POST",body:JSON.stringify(e)}),update:e=>a(`${o}/db-config`,{method:"PUT",body:JSON.stringify(e)})},aiRepos:{list:e=>a(`${o}/apps/${e}/repos`),add:(e,t)=>a(`${o}/apps/${e}/repos`,{method:"POST",body:JSON.stringify(t)}),updateToken:(e,t)=>a(`${o}/apps/${e}/repos/token`,{method:"PATCH",body:JSON.stringify(t)}),sync:(e,t,r)=>a(`${o}/apps/${e}/repos/${t}/sync`,{method:"POST",...r?{body:JSON.stringify({gitToken:r})}:{}}),remove:(e,t)=>a(`${o}/apps/${e}/repos/${t}`,{method:"DELETE"})},appAiConfig:{get:e=>a(`${o}/apps/${e}/ai-config`),set:(e,t)=>a(`${o}/apps/${e}/ai-config`,{method:"PUT",body:JSON.stringify({aiServerId:t})}),setPlanFormat:(e,t)=>a(`${o}/apps/${e}/ai-config`,{method:"PUT",body:JSON.stringify(t)})},aiServers:{list:()=>a(`${o}/ai-servers`),add:e=>a(`${o}/ai-servers`,{method:"POST",body:JSON.stringify(e)}),test:e=>a(`${o}/ai-servers/${e}/test`,{method:"POST"}),delete:e=>a(`${o}/ai-servers/${e}`,{method:"DELETE"})},aiConfig:{get:()=>a(`${o}/ai-config`),save:(e,t)=>a(`${o}/ai-config/${e}`,{method:"PUT",body:JSON.stringify(t)}),test:(e,t)=>a(`${o}/ai-config/${e}/test`,{method:"POST",body:JSON.stringify(t)})},agents:{list:()=>a(`${o}/agents`),create:e=>a(`${o}/agents`,{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>a(`${o}/agents/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>a(`${o}/agents/${e}`,{method:"DELETE"}),reset:e=>a(`${o}/agents/${e}/reset`,{method:"POST"}),setDefault:e=>a(`${o}/agents/${e}/set-default`,{method:"POST"}),generatePrompt:(e,t)=>a(`${o}/agents/generate-prompt`,{method:"POST",body:JSON.stringify({agentType:e,description:t})})},tools:{list:()=>a(`${o}/tools`),create:e=>a(`${o}/tools`,{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>a(`${o}/tools/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>a(`${o}/tools/${e}`,{method:"DELETE"})},analyses:{list:e=>a(`${o}/apps/${e}/analyses`),get:(e,t)=>a(`${o}/apps/${e}/analyses/${t}`),create:(e,t)=>a(`${o}/apps/${e}/analyses`,{method:"POST",body:JSON.stringify(t)}),updateStatus:(e,t,r)=>a(`${o}/apps/${e}/analyses/${t}`,{method:"PATCH",body:JSON.stringify({status:r})}),delete:(e,t)=>a(`${o}/apps/${e}/analyses/${t}`,{method:"DELETE"}),comments:{list:(e,t)=>a(`${o}/apps/${e}/analyses/${t}/comments`),create:(e,t,r)=>a(`${o}/apps/${e}/analyses/${t}/comments`,{method:"POST",body:JSON.stringify({content:r})}),reply:(e,t,r,n)=>a(`${o}/apps/${e}/analyses/${t}/comments/${r}/replies`,{method:"POST",body:JSON.stringify({content:n})}),update:(e,t,r,n)=>a(`${o}/apps/${e}/analyses/${t}/comments/${r}`,{method:"PUT",body:JSON.stringify({content:n})}),delete:(e,t,r)=>a(`${o}/apps/${e}/analyses/${t}/comments/${r}`,{method:"DELETE"})}},plans:{list:e=>a(`${o}/apps/${e}/plans`),get:(e,t)=>a(`${o}/apps/${e}/plans/${t}`),create:(e,t)=>a(`${o}/apps/${e}/plans`,{method:"POST",body:JSON.stringify(t)}),updateStatus:(e,t,r)=>a(`${o}/apps/${e}/plans/${t}`,{method:"PATCH",body:JSON.stringify({status:r})}),delete:(e,t)=>a(`${o}/apps/${e}/plans/${t}`,{method:"DELETE"}),comments:{list:(e,t)=>a(`${o}/apps/${e}/plans/${t}/comments`),create:(e,t,r)=>a(`${o}/apps/${e}/plans/${t}/comments`,{method:"POST",body:JSON.stringify({content:r})}),reply:(e,t,r,n)=>a(`${o}/apps/${e}/plans/${t}/comments/${r}/replies`,{method:"POST",body:JSON.stringify({content:n})}),update:(e,t,r,n)=>a(`${o}/apps/${e}/plans/${t}/comments/${r}`,{method:"PUT",body:JSON.stringify({content:n})}),delete:(e,t,r)=>a(`${o}/apps/${e}/plans/${t}/comments/${r}`,{method:"DELETE"})}},testCaseProfiles:{list:e=>a(`${o}/apps/${e}/test-case-profiles`),create:(e,t)=>a(`${o}/apps/${e}/test-case-profiles`,{method:"POST",body:JSON.stringify(t)}),update:(e,t,r)=>a(`${o}/apps/${e}/test-case-profiles/${t}`,{method:"PUT",body:JSON.stringify(r)}),delete:(e,t)=>a(`${o}/apps/${e}/test-case-profiles/${t}`,{method:"DELETE"}),setDefault:(e,t)=>a(`${o}/apps/${e}/test-case-profiles/${t}/set-default`,{method:"POST"}),generateBlock:(e,t,r)=>a(`${o}/apps/${e}/test-case-profiles/generate-block`,{method:"POST",body:JSON.stringify({repoId:t,block:r})})},chat:{send:e=>a(`${o}/chat`,{method:"POST",body:JSON.stringify(e)}),streamUrl:()=>`${o}/chat/stream`},conversations:{list:(e,t)=>{const r=t?`?${new URLSearchParams(Object.fromEntries(Object.entries(t).filter(([,n])=>n!=null).map(([n,i])=>[n,String(i)]))).toString()}`:"";return a(`${o}/apps/${e}/conversations${r}`)},create:(e,t)=>a(`${o}/apps/${e}/conversations`,{method:"POST",body:JSON.stringify(t)}),get:(e,t)=>a(`${o}/apps/${e}/conversations/${t}`),delete:(e,t)=>a(`${o}/apps/${e}/conversations/${t}`,{method:"DELETE"}),deleteAll:e=>a(`${o}/apps/${e}/conversations`,{method:"DELETE"})}},fr=l.createContext(null);function bt(){const e=l.useContext(fr);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function Yn({children:e}){const[t,r]=l.useState(null),[n,i]=l.useState(!0),[d,c]=l.useState("login"),[f,m]=l.useState(null);l.useEffect(()=>{const b=new URLSearchParams(window.location.search).get("token");b&&(m(b),c("reset-password"),window.history.replaceState({},"",window.location.pathname))},[]),l.useEffect(()=>{I.auth.me().then(r).catch(()=>r(null)).finally(()=>i(!1))},[]),l.useEffect(()=>{const j=()=>{r(null),c("login")};return window.addEventListener("auth:unauthorized",j),()=>window.removeEventListener("auth:unauthorized",j)},[]);const y=l.useCallback(async(j,b)=>{const{user:S}=await I.auth.login(j,b);r(S)},[]),p=l.useCallback(async()=>{await I.auth.logout().catch(()=>{}),r(null),c("login")},[]),h=l.useCallback(async()=>{try{const j=await I.auth.me();r(j)}catch{r(null)}},[]);return s.jsx(fr.Provider,{value:{user:t,loading:n,authScreen:d,setAuthScreen:c,resetToken:f,login:y,logout:p,refreshUser:h},children:e})}const It={appTitle:"noob-sdet",iconDataDark:null,iconDataLight:null,logoData:null,logoDataDark:null},mr=l.createContext(null);let gr=It,hr=!1;function Nt(e,t){return t&&e.iconDataLight?e.iconDataLight:e.iconDataDark}function xr(e){let t,r;e?(t=e,r=e.startsWith("data:image/png")?"image/png":"image/svg+xml"):(t=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90">🧪</text></svg>')}`,r="image/svg+xml"),document.querySelectorAll('link[rel~="icon"]').forEach(i=>i.remove());const n=document.createElement("link");n.rel="icon",n.type=r,n.href=t,document.head.appendChild(n)}function Zt(e,t=hr){gr=e,document.title=e.appTitle,xr(Nt(e,t))}function qn(e){hr=e,xr(Nt(gr,e))}function Kn({children:e}){const[t,r]=l.useState(It);l.useEffect(()=>{I.branding.get().then(d=>{const c={...It,...d};r(c),Zt(c)}).catch(()=>Zt(It))},[]);const n=async(d,c=!0)=>{r(d),Zt(d),c&&await I.branding.update(d)},i=async()=>{const d=await I.branding.reset(),c={...It,...d};r(c),Zt(c)};return s.jsx(mr.Provider,{value:{branding:t,setBranding:n,resetBranding:i},children:e})}function Es(){const e=l.useContext(mr);if(!e)throw new Error("useBranding must be used inside BrandingProvider");return e}function yr(e,t){return Nt(e,t)}function Qn(e,t){return t?e.logoData??e.logoDataDark??Nt(e,t):e.logoDataDark??e.logoData??Nt(e,t)}const js=[{name:"Dark",bgBase:"#000000",bgSurface:"#0d0d0d",bgPanel:"#111111",bgElevated:"#141414",bgHover:"#161616",borderSubtle:"#1a1a1a",borderDefault:"#222222",borderStrong:"#333333",textPrimary:"#ededed",textSecondary:"#888888",textMuted:"#555555",accentPrimary:"#818cf8",accentDanger:"#e5484d",accentSuccess:"#1a9e5e",accentWarning:"#b45309",accentBlocked:"#f97316",fontSans:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif',fontMono:'ui-monospace, SFMono-Regular, "Cascadia Code", monospace',fontSize:14,radius:8},{name:"Dim",bgBase:"#0a0a0f",bgSurface:"#12121a",bgPanel:"#18181f",bgElevated:"#1e1e28",bgHover:"#202030",borderSubtle:"#22222e",borderDefault:"#2a2a38",borderStrong:"#38384a",textPrimary:"#e2e2f0",textSecondary:"#8888aa",textMuted:"#55556a",accentPrimary:"#7c7cf0",accentDanger:"#e5484d",accentSuccess:"#1a9e5e",accentWarning:"#b45309",accentBlocked:"#f97316",fontSans:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif',fontMono:'ui-monospace, SFMono-Regular, "Cascadia Code", monospace',fontSize:14,radius:8},{name:"Light",bgBase:"#f0f0f2",bgSurface:"#ffffff",bgPanel:"#f7f7f9",bgElevated:"#ffffff",bgHover:"#e8e8eb",borderSubtle:"#e2e2e6",borderDefault:"#d0d0d5",borderStrong:"#a0a0a8",textPrimary:"#111113",textSecondary:"#4a4a55",textMuted:"#6b6b78",accentPrimary:"#4f46e5",accentDanger:"#dc2626",accentSuccess:"#16a34a",accentWarning:"#d97706",accentBlocked:"#ea580c",fontSans:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif',fontMono:'ui-monospace, SFMono-Regular, "Cascadia Code", monospace',fontSize:14,radius:8},{name:"Midnight",bgBase:"#030712",bgSurface:"#0f172a",bgPanel:"#1e293b",bgElevated:"#1e293b",bgHover:"#1a2540",borderSubtle:"#1e293b",borderDefault:"#334155",borderStrong:"#475569",textPrimary:"#f1f5f9",textSecondary:"#94a3b8",textMuted:"#475569",accentPrimary:"#818cf8",accentDanger:"#ef4444",accentSuccess:"#22c55e",accentWarning:"#f59e0b",accentBlocked:"#f97316",fontSans:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif',fontMono:'ui-monospace, SFMono-Regular, "Cascadia Code", monospace',fontSize:14,radius:6}];function es(e){const t=document.documentElement;t.style.setProperty("--t-bg-base",e.bgBase),t.style.setProperty("--t-bg-surface",e.bgSurface),t.style.setProperty("--t-bg-panel",e.bgPanel),t.style.setProperty("--t-bg-elevated",e.bgElevated),t.style.setProperty("--t-bg-hover",e.bgHover??"#161616");const r=parseInt(e.bgBase.slice(1,3),16)>128;t.style.setProperty("--t-sidebar-hover",r?"rgba(0,0,0,0.07)":"rgba(255,255,255,0.05)"),t.style.setProperty("--t-sidebar-active",r?"rgba(0,0,0,0.13)":"rgba(255,255,255,0.09)"),t.style.setProperty("--t-row-hover",r?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.025)"),t.style.setProperty("--t-row-selected",r?"rgba(0,0,0,0.07)":"rgba(255,255,255,0.04)"),t.style.setProperty("--t-elem-hover",r?"rgba(0,0,0,0.06)":"rgba(255,255,255,0.07)"),t.style.setProperty("--t-shadow-sm",r?"0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06)":"0 4px 16px rgba(0,0,0,0.5)"),t.style.setProperty("--t-shadow-lg",r?"0 8px 28px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08)":"0 24px 60px rgba(0,0,0,0.8)"),t.style.setProperty("--t-overlay",r?"rgba(0,0,0,0.35)":"rgba(0,0,0,0.6)"),t.style.setProperty("--t-accent-primary",e.accentPrimary??(r?"#4f46e5":"#818cf8")),t.style.setProperty("--t-accent-blocked",e.accentBlocked),t.style.setProperty("--t-border-subtle",e.borderSubtle),t.style.setProperty("--t-border-default",e.borderDefault),t.style.setProperty("--t-border-strong",e.borderStrong),t.style.setProperty("--t-text-primary",e.textPrimary),t.style.setProperty("--t-text-secondary",e.textSecondary),t.style.setProperty("--t-text-muted",e.textMuted),t.style.setProperty("--t-accent-danger",e.accentDanger),t.style.setProperty("--t-accent-success",e.accentSuccess),t.style.setProperty("--t-accent-warning",e.accentWarning),t.style.setProperty("--t-font-sans",e.fontSans),t.style.setProperty("--t-font-mono",e.fontMono),t.style.setProperty("--t-font-size",`${e.fontSize??14}px`),t.style.setProperty("--t-radius",`${e.radius}px`),t.style.setProperty("--background",e.bgBase),t.style.setProperty("--foreground",e.textPrimary),t.style.setProperty("--border",e.borderStrong),t.style.setProperty("--muted",e.bgPanel),t.style.setProperty("--muted-foreground",e.textSecondary),t.style.setProperty("--destructive",e.accentDanger),qn(r)}const br=l.createContext(null),vr="noob-theme";function ws(e){const r={...js.find(n=>n.name===e.name)??js[0]};for(const[n,i]of Object.entries(e))i!=null&&(r[n]=i);return r}function Xn(){try{const e=localStorage.getItem(vr);return e?ws(JSON.parse(e)):null}catch{return null}}function gs(e){try{localStorage.setItem(vr,JSON.stringify(e))}catch{}}function Zn({children:e}){const[t,r]=l.useState(()=>Xn()??js[0]),[n,i]=l.useState(!0);l.useEffect(()=>{I.theme.get().then(f=>{const m=ws(f);r(m),es(m),gs(m)}).catch(()=>{es(t)}).finally(()=>i(!1))},[]);const d=async(f,m=!0)=>{r(f),es(f),gs(f),m&&await I.theme.update(f)},c=async()=>{const f=await I.theme.reset(),m=ws(f);r(m),es(m),gs(m)};return s.jsx(br.Provider,{value:{theme:t,setTheme:d,resetTheme:c,loading:n},children:e})}function Sr(){const e=l.useContext(br);if(!e)throw new Error("useTheme must be used inside ThemeProvider");return e}const As="__skeleton_shimmer__";if(typeof document<"u"&&!document.getElementById(As)){const e=document.createElement("style");e.id=As,e.textContent=`
|
|
3
|
+
@keyframes _sk_shimmer {
|
|
4
|
+
from { transform: translateX(-100%); }
|
|
5
|
+
to { transform: translateX(200%); }
|
|
6
|
+
}
|
|
7
|
+
`,document.head.appendChild(e)}function ye({width:e,height:t=14,borderRadius:r=4,style:n}){return s.jsx("div",{style:{width:e??"100%",height:t,borderRadius:r,background:"var(--t-border-default)",position:"relative",overflow:"hidden",flexShrink:0,...n},children:s.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, transparent 0%, var(--t-bg-hover) 50%, transparent 100%)",animation:"_sk_shimmer 1.5s ease-in-out infinite"}})})}function eo({count:e=5,rowHeight:t=44,gap:r=1,padding:n="0 16px",showIcon:i=!0,iconSize:d=28}){return s.jsx(s.Fragment,{children:Array.from({length:e}).map((c,f)=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:n,height:t,borderBottom:`${r}px solid var(--t-border-subtle)`,flexShrink:0},children:[i&&s.jsx(ye,{width:d,height:d,borderRadius:6}),s.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[s.jsx(ye,{height:11,width:`${50+f*17%35}%`,borderRadius:3}),s.jsx(ye,{height:9,width:`${25+f*11%25}%`,borderRadius:3})]}),s.jsx(ye,{width:48,height:22,borderRadius:4})]},f))})}function Pt({i:e=0}){return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"0 10px",height:30,flexShrink:0},children:[s.jsx(ye,{width:14,height:14,borderRadius:3}),s.jsx(ye,{height:11,width:`${45+e*19%40}%`,borderRadius:3})]})}function Wa({lines:e=3,style:t}){const r=["80%","60%","70%","50%","65%"];return s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10,padding:"16px",border:"1px solid var(--t-border-subtle)",borderRadius:8,background:"var(--t-bg-surface)",...t},children:Array.from({length:e}).map((n,i)=>s.jsx(ye,{height:12,width:r[i%r.length],borderRadius:3},i))})}function jr(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=jr(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function wr(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=jr(e))&&(n&&(n+=" "),n+=t);return n}const Ms=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,_s=wr,to=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return _s(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:d}=t,c=Object.keys(i).map(y=>{const p=r==null?void 0:r[y],h=d==null?void 0:d[y];if(p===null)return null;const j=Ms(p)||Ms(h);return i[y][j]}),f=r&&Object.entries(r).reduce((y,p)=>{let[h,j]=p;return j===void 0||(y[h]=j),y},{}),m=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((y,p)=>{let{class:h,className:j,...b}=p;return Object.entries(b).every(S=>{let[w,k]=S;return Array.isArray(k)?k.includes({...d,...f}[w]):{...d,...f}[w]===k})?[...y,h,j]:y},[]);return _s(e,c,m,r==null?void 0:r.class,r==null?void 0:r.className)},so=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},ro=(e,t)=>({classGroupId:e,validator:t}),$r=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),as="-",Fs=[],no="arbitrary..",oo=e=>{const t=io(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return ao(c);const f=c.split(as),m=f[0]===""&&f.length>1?1:0;return kr(f,m,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const m=n[c],y=r[c];return m?y?so(y,m):m:y||Fs}return r[c]||Fs}}},kr=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],d=r.nextPart.get(i);if(d){const y=kr(e,t+1,d);if(y)return y}const c=r.validators;if(c===null)return;const f=t===0?e.join(as):e.slice(t).join(as),m=c.length;for(let y=0;y<m;y++){const p=c[y];if(p.validator(f))return p.classGroupId}},ao=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?no+n:void 0})(),io=e=>{const{theme:t,classGroups:r}=e;return lo(r,t)},lo=(e,t)=>{const r=$r();for(const n in e){const i=e[n];zs(i,r,n,t)}return r},zs=(e,t,r,n)=>{const i=e.length;for(let d=0;d<i;d++){const c=e[d];co(c,t,r,n)}},co=(e,t,r,n)=>{if(typeof e=="string"){uo(e,t,r);return}if(typeof e=="function"){po(e,t,r,n);return}fo(e,t,r,n)},uo=(e,t,r)=>{const n=e===""?t:Cr(t,e);n.classGroupId=r},po=(e,t,r,n)=>{if(mo(e)){zs(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(ro(r,e))},fo=(e,t,r,n)=>{const i=Object.entries(e),d=i.length;for(let c=0;c<d;c++){const[f,m]=i[c];zs(m,Cr(t,f),r,n)}},Cr=(e,t)=>{let r=e;const n=t.split(as),i=n.length;for(let d=0;d<i;d++){const c=n[d];let f=r.nextPart.get(c);f||(f=$r(),r.nextPart.set(c,f)),r=f}return r},mo=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,go=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const i=(d,c)=>{r[d]=c,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(d){let c=r[d];if(c!==void 0)return c;if((c=n[d])!==void 0)return i(d,c),c},set(d,c){d in r?r[d]=c:i(d,c)}}},$s="!",Js=":",ho=[],Bs=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),xo=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=i=>{const d=[];let c=0,f=0,m=0,y;const p=i.length;for(let w=0;w<p;w++){const k=i[w];if(c===0&&f===0){if(k===Js){d.push(i.slice(m,w)),m=w+1;continue}if(k==="/"){y=w;continue}}k==="["?c++:k==="]"?c--:k==="("?f++:k===")"&&f--}const h=d.length===0?i:i.slice(m);let j=h,b=!1;h.endsWith($s)?(j=h.slice(0,-1),b=!0):h.startsWith($s)&&(j=h.slice(1),b=!0);const S=y&&y>m?y-m:void 0;return Bs(d,b,j,S)};if(t){const i=t+Js,d=n;n=c=>c.startsWith(i)?d(c.slice(i.length)):Bs(ho,!1,c,void 0,!0)}if(r){const i=n;n=d=>r({className:d,parseClassName:i})}return n},yo=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let d=0;d<r.length;d++){const c=r[d],f=c[0]==="[",m=t.has(c);f||m?(i.length>0&&(i.sort(),n.push(...i),i=[]),n.push(c)):i.push(c)}return i.length>0&&(i.sort(),n.push(...i)),n}},bo=e=>({cache:go(e.cacheSize),parseClassName:xo(e),sortModifiers:yo(e),postfixLookupClassGroupIds:vo(e),...oo(e)}),vo=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)t[r[n]]=!0;return t},So=/\s+/,jo=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:d,postfixLookupClassGroupIds:c}=t,f=[],m=e.trim().split(So);let y="";for(let p=m.length-1;p>=0;p-=1){const h=m[p],{isExternal:j,modifiers:b,hasImportantModifier:S,baseClassName:w,maybePostfixModifierPosition:k}=r(h);if(j){y=h+(y.length>0?" "+y:y);continue}let C=!!k,M;if(C){const v=w.substring(0,k);M=n(v);const g=M&&c[M]?n(w):void 0;g&&g!==M&&(M=g,C=!1)}else M=n(w);if(!M){if(!C){y=h+(y.length>0?" "+y:y);continue}if(M=n(w),!M){y=h+(y.length>0?" "+y:y);continue}C=!1}const H=b.length===0?"":b.length===1?b[0]:d(b).join(":"),te=S?H+$s:H,ne=te+M;if(f.indexOf(ne)>-1)continue;f.push(ne);const L=i(M,C);for(let v=0;v<L.length;++v){const g=L[v];f.push(te+g)}y=h+(y.length>0?" "+y:y)}return y},wo=(...e)=>{let t=0,r,n,i="";for(;t<e.length;)(r=e[t++])&&(n=Rr(r))&&(i&&(i+=" "),i+=n);return i},Rr=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Rr(e[n]))&&(r&&(r+=" "),r+=t);return r},$o=(e,...t)=>{let r,n,i,d;const c=m=>{const y=t.reduce((p,h)=>h(p),e());return r=bo(y),n=r.cache.get,i=r.cache.set,d=f,f(m)},f=m=>{const y=n(m);if(y)return y;const p=jo(m,r);return i(m,p),p};return d=c,(...m)=>d(wo(...m))},ko=[],ae=e=>{const t=r=>r[e]||ko;return t.isThemeGetter=!0,t},Tr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Er=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Co=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ro=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,To=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Eo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Po=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xe=e=>Co.test(e),J=e=>!!e&&!Number.isNaN(Number(e)),De=e=>!!e&&Number.isInteger(Number(e)),hs=e=>e.endsWith("%")&&J(e.slice(0,-1)),Ve=e=>Ro.test(e),zr=()=>!0,Oo=e=>To.test(e)&&!Eo.test(e),Ps=()=>!1,Io=e=>zo.test(e),Do=e=>Po.test(e),No=e=>!E(e)&&!z(e),Lo=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Ao=e=>et(e,Ir,Ps),E=e=>Tr.test(e),ot=e=>et(e,Dr,Oo),Vs=e=>et(e,Go,J),Mo=e=>et(e,Lr,zr),_o=e=>et(e,Nr,Ps),Ws=e=>et(e,Pr,Ps),Fo=e=>et(e,Or,Do),ts=e=>et(e,Ar,Io),z=e=>Er.test(e),Ot=e=>lt(e,Dr),Jo=e=>lt(e,Nr),Gs=e=>lt(e,Pr),Bo=e=>lt(e,Ir),Vo=e=>lt(e,Or),ss=e=>lt(e,Ar,!0),Wo=e=>lt(e,Lr,!0),et=(e,t,r)=>{const n=Tr.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},lt=(e,t,r=!1)=>{const n=Er.exec(e);return n?n[1]?t(n[1]):r:!1},Pr=e=>e==="position"||e==="percentage",Or=e=>e==="image"||e==="url",Ir=e=>e==="length"||e==="size"||e==="bg-size",Dr=e=>e==="length",Go=e=>e==="number",Nr=e=>e==="family-name",Lr=e=>e==="number"||e==="weight",Ar=e=>e==="shadow",Uo=()=>{const e=ae("color"),t=ae("font"),r=ae("text"),n=ae("font-weight"),i=ae("tracking"),d=ae("leading"),c=ae("breakpoint"),f=ae("container"),m=ae("spacing"),y=ae("radius"),p=ae("shadow"),h=ae("inset-shadow"),j=ae("text-shadow"),b=ae("drop-shadow"),S=ae("blur"),w=ae("perspective"),k=ae("aspect"),C=ae("ease"),M=ae("animate"),H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],te=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ne=()=>[...te(),z,E],L=()=>["auto","hidden","clip","visible","scroll"],v=()=>["auto","contain","none"],g=()=>[z,E,m],T=()=>[Xe,"full","auto",...g()],F=()=>[De,"none","subgrid",z,E],N=()=>["auto",{span:["full",De,z,E]},De,z,E],_=()=>[De,"auto",z,E],D=()=>["auto","min","max","fr",z,E],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],se=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...g()],Q=()=>[Xe,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...g()],ie=()=>[Xe,"screen","full","dvw","lvw","svw","min","max","fit",...g()],$e=()=>[Xe,"screen","full","lh","dvh","lvh","svh","min","max","fit",...g()],O=()=>[e,z,E],st=()=>[...te(),Gs,Ws,{position:[z,E]}],Ue=()=>["no-repeat",{repeat:["","x","y","space","round"]}],He=()=>["auto","cover","contain",Bo,Ao,{size:[z,E]}],ze=()=>[hs,Ot,ot],oe=()=>["","none","full",y,z,E],re=()=>["",J,Ot,ot],Pe=()=>["solid","dashed","dotted","double"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[J,hs,Gs,Ws],Ye=()=>["","none",S,z,E],qe=()=>["none",J,z,E],Se=()=>["none",J,z,E],Oe=()=>[J,z,E],pe=()=>[Xe,"full",...g()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ve],breakpoint:[Ve],color:[zr],container:[Ve],"drop-shadow":[Ve],ease:["in","out","in-out"],font:[No],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ve],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ve],shadow:[Ve],spacing:["px",J],text:[Ve],"text-shadow":[Ve],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xe,E,z,k]}],container:["container"],"container-type":[{"@container":["","normal","size",z,E]}],"container-named":[Lo],columns:[{columns:[J,E,z,f]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:ne()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:v()}],"overscroll-x":[{"overscroll-x":v()}],"overscroll-y":[{"overscroll-y":v()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:["visible","invisible","collapse"],z:[{z:[De,"auto",z,E]}],basis:[{basis:[Xe,"full","auto",f,...g()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[J,Xe,"auto","initial","none",E]}],grow:[{grow:["",J,z,E]}],shrink:[{shrink:["",J,z,E]}],order:[{order:[De,"first","last","none",z,E]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:g()}],"gap-x":[{"gap-x":g()}],"gap-y":[{"gap-y":g()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...se(),"normal"]}],"justify-self":[{"justify-self":["auto",...se()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...se(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...se(),"baseline"]}],"place-self":[{"place-self":["auto",...se()]}],p:[{p:g()}],px:[{px:g()}],py:[{py:g()}],ps:[{ps:g()}],pe:[{pe:g()}],pbs:[{pbs:g()}],pbe:[{pbe:g()}],pt:[{pt:g()}],pr:[{pr:g()}],pb:[{pb:g()}],pl:[{pl:g()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":g()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":g()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...ie()]}],"min-inline-size":[{"min-inline":["auto",...ie()]}],"max-inline-size":[{"max-inline":["none",...ie()]}],"block-size":[{block:["auto",...$e()]}],"min-block-size":[{"min-block":["auto",...$e()]}],"max-block-size":[{"max-block":["none",...$e()]}],w:[{w:[f,"screen",...Q()]}],"min-w":[{"min-w":[f,"screen","none",...Q()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",r,Ot,ot]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Wo,Mo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",hs,E]}],"font-family":[{font:[Jo,_o,t]}],"font-features":[{"font-features":[E]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,z,E]}],"line-clamp":[{"line-clamp":[J,"none",z,Vs]}],leading:[{leading:[d,...g()]}],"list-image":[{"list-image":["none",z,E]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",z,E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[J,"from-font","auto",z,ot]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[J,"auto",z,E]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:g()}],"tab-size":[{tab:[De,z,E]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",z,E]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",z,E]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:st()}],"bg-repeat":[{bg:Ue()}],"bg-size":[{bg:He()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},De,z,E],radial:["",z,E],conic:[De,z,E]},Vo,Fo]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:ze()}],"gradient-via-pos":[{via:ze()}],"gradient-to-pos":[{to:ze()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Pe(),"hidden","none"]}],"divide-style":[{divide:[...Pe(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...Pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[J,z,E]}],"outline-w":[{outline:["",J,Ot,ot]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",p,ss,ts]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",h,ss,ts]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[J,ot]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",j,ss,ts]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[J,z,E]}],"mix-blend":[{"mix-blend":[...ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ke()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[J]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[z,E]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":te()}],"mask-image-conic-pos":[{"mask-conic":[J]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:st()}],"mask-repeat":[{mask:Ue()}],"mask-size":[{mask:He()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",z,E]}],filter:[{filter:["","none",z,E]}],blur:[{blur:Ye()}],brightness:[{brightness:[J,z,E]}],contrast:[{contrast:[J,z,E]}],"drop-shadow":[{"drop-shadow":["","none",b,ss,ts]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",J,z,E]}],"hue-rotate":[{"hue-rotate":[J,z,E]}],invert:[{invert:["",J,z,E]}],saturate:[{saturate:[J,z,E]}],sepia:[{sepia:["",J,z,E]}],"backdrop-filter":[{"backdrop-filter":["","none",z,E]}],"backdrop-blur":[{"backdrop-blur":Ye()}],"backdrop-brightness":[{"backdrop-brightness":[J,z,E]}],"backdrop-contrast":[{"backdrop-contrast":[J,z,E]}],"backdrop-grayscale":[{"backdrop-grayscale":["",J,z,E]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[J,z,E]}],"backdrop-invert":[{"backdrop-invert":["",J,z,E]}],"backdrop-opacity":[{"backdrop-opacity":[J,z,E]}],"backdrop-saturate":[{"backdrop-saturate":[J,z,E]}],"backdrop-sepia":[{"backdrop-sepia":["",J,z,E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":g()}],"border-spacing-x":[{"border-spacing-x":g()}],"border-spacing-y":[{"border-spacing-y":g()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",z,E]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[J,"initial",z,E]}],ease:[{ease:["linear","initial",C,z,E]}],delay:[{delay:[J,z,E]}],animate:[{animate:["none",M,z,E]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,z,E]}],"perspective-origin":[{"perspective-origin":ne()}],rotate:[{rotate:qe()}],"rotate-x":[{"rotate-x":qe()}],"rotate-y":[{"rotate-y":qe()}],"rotate-z":[{"rotate-z":qe()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Oe()}],"skew-x":[{"skew-x":Oe()}],"skew-y":[{"skew-y":Oe()}],transform:[{transform:[z,E,"","none","gpu","cpu"]}],"transform-origin":[{origin:ne()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:pe()}],"translate-x":[{"translate-x":pe()}],"translate-y":[{"translate-y":pe()}],"translate-z":[{"translate-z":pe()}],"translate-none":["translate-none"],zoom:[{zoom:[De,z,E]}],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",z,E]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":g()}],"scroll-mx":[{"scroll-mx":g()}],"scroll-my":[{"scroll-my":g()}],"scroll-ms":[{"scroll-ms":g()}],"scroll-me":[{"scroll-me":g()}],"scroll-mbs":[{"scroll-mbs":g()}],"scroll-mbe":[{"scroll-mbe":g()}],"scroll-mt":[{"scroll-mt":g()}],"scroll-mr":[{"scroll-mr":g()}],"scroll-mb":[{"scroll-mb":g()}],"scroll-ml":[{"scroll-ml":g()}],"scroll-p":[{"scroll-p":g()}],"scroll-px":[{"scroll-px":g()}],"scroll-py":[{"scroll-py":g()}],"scroll-ps":[{"scroll-ps":g()}],"scroll-pe":[{"scroll-pe":g()}],"scroll-pbs":[{"scroll-pbs":g()}],"scroll-pbe":[{"scroll-pbe":g()}],"scroll-pt":[{"scroll-pt":g()}],"scroll-pr":[{"scroll-pr":g()}],"scroll-pb":[{"scroll-pb":g()}],"scroll-pl":[{"scroll-pl":g()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",z,E]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[J,Ot,ot,Vs]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ho=$o(Uo);function tt(...e){return Ho(wr(e))}const Yo=to("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 cursor-pointer border-none outline-none",{variants:{variant:{default:"text-white active:scale-[0.97]",destructive:"text-white active:scale-[0.97]",outline:"active:scale-[0.97]",secondary:"active:scale-[0.97]",ghost:"",link:"underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 px-3 text-xs",lg:"h-10 px-6",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Us={default:{background:"var(--t-text-primary)",color:"var(--t-bg-base)"},destructive:{background:"var(--t-accent-danger)",color:"#fff"},outline:{background:"transparent",border:"1px solid var(--t-border-default)",color:"var(--t-text-primary)"},secondary:{background:"var(--t-bg-surface)",color:"var(--t-text-primary)",border:"1px solid var(--t-border-subtle)"},ghost:{background:"transparent",color:"var(--t-text-muted)",border:"none"},link:{background:"transparent",color:"var(--t-text-primary)",border:"none"}},qo={default:{background:"var(--t-text-secondary)"},destructive:{background:"var(--t-accent-danger)"},outline:{background:"var(--t-bg-surface)",borderColor:"var(--t-border-strong)"},secondary:{background:"var(--t-bg-panel)"},ghost:{background:"var(--t-bg-surface)",color:"var(--t-text-primary)"},link:{}},K=l.forwardRef(function({className:t,variant:r="default",size:n,asChild:i=!1,style:d,onMouseEnter:c,onMouseLeave:f,...m},y){const p=i?Jn:"button",h=r??"default";return s.jsx(p,{ref:y,"data-slot":"button",className:tt(Yo({variant:r,size:n,className:t})),style:{...Us[h],...d},onMouseEnter:j=>{const b=j.currentTarget,S=qo[h];S.background&&(b.style.background=S.background),S.color&&(b.style.color=S.color),S.borderColor&&(b.style.borderColor=S.borderColor),c==null||c(j)},onMouseLeave:j=>{const b=j.currentTarget,S=Us[h];b.style.background=S.background??"",b.style.color=S.color??"",b.style.borderColor="",f==null||f(j)},...m})});function q({className:e,type:t,style:r,...n}){return s.jsx("input",{type:t,"data-slot":"input",className:tt("flex h-9 w-full min-w-0 rounded-md px-3 py-1 text-sm transition-all outline-none disabled:pointer-events-none disabled:opacity-50",e),style:{background:"var(--t-bg-elevated)",border:"1px solid var(--t-border-default)",color:"var(--t-text-primary)",...r},onFocus:i=>{i.currentTarget.style.borderColor="var(--t-border-strong)",i.currentTarget.style.boxShadow="0 0 0 3px rgba(128,128,128,0.15)"},onBlur:i=>{i.currentTarget.style.borderColor="var(--t-border-default)",i.currentTarget.style.boxShadow="none"},...n})}function B({className:e,...t}){return s.jsx(Bn,{"data-slot":"label",className:tt("flex items-center gap-2 text-sm font-medium leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Lt({title:e,subtitle:t,children:r}){const{branding:n}=Es(),{theme:i}=Sr(),d=parseInt(i.bgBase.slice(1,3),16)>128,c=Qn(n,d);return s.jsx("div",{style:{minHeight:"100vh",background:"var(--t-bg-base)",display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsxs("div",{style:{width:380,background:"var(--t-bg-surface)",border:"1px solid var(--t-border-subtle)",borderRadius:12,padding:"36px 32px"},children:[s.jsxs("div",{style:{marginBottom:28,textAlign:"center"},children:[c?s.jsx("img",{src:c,alt:n.appTitle,style:{display:"block",margin:"0 auto 10px",height:16,width:"auto",objectFit:"contain"}}):s.jsx("div",{style:{width:48,height:48,borderRadius:10,background:"var(--t-bg-elevated)",border:"1px solid var(--t-border-default)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22,fontWeight:700,color:"var(--t-text-secondary)",margin:"0 auto 10px",letterSpacing:"-0.02em"},children:n.appTitle.charAt(0).toUpperCase()}),s.jsx("div",{style:{fontSize:44,fontWeight:700,letterSpacing:"-0.02em",color:"var(--t-text-primary)"},children:n.appTitle})]}),s.jsx("h1",{style:{fontSize:18,fontWeight:600,color:"var(--t-text-primary)",marginBottom:6,textAlign:"center"},children:e}),t&&s.jsx("p",{style:{fontSize:"var(--t-text-base)",color:"var(--t-text-muted)",textAlign:"center",marginBottom:24},children:t}),r]})})}function Ko({message:e}){return s.jsx("div",{style:{background:"rgba(229,72,77,0.1)",border:"1px solid rgba(229,72,77,0.3)",borderRadius:6,padding:"10px 14px",color:"var(--t-accent-danger)",fontSize:"var(--t-text-base)",marginBottom:16},children:e})}const Qo={invalid_state:"SSO authentication failed — please try again.",missing_code:"SSO provider did not return an authorization code.",account_not_found:"No account found for this SSO identity. Contact your admin.",account_disabled:"Your account is disabled. Contact your admin.",callback_failed:"SSO sign-in failed — check your provider configuration.",sso_not_configured:"SSO is not configured on this server."};function Xo(){const{login:e,setAuthScreen:t}=bt(),[r,n]=l.useState(""),[i,d]=l.useState(""),[c,f]=l.useState(null),[m,y]=l.useState(!1),[p,h]=l.useState(null);l.useEffect(()=>{I.sso.config().then(h).catch(()=>{});const S=new URLSearchParams(window.location.search).get("sso_error");S&&(f(Qo[S]??`SSO error: ${S}`),window.history.replaceState({},"","/"))},[]);async function j(b){b.preventDefault(),f(null),y(!0);try{await e(r,i)}catch(S){f(S instanceof Error?S.message:"Login failed")}finally{y(!1)}}return s.jsx(Lt,{title:"Sign in to your workspace",children:s.jsxs("form",{onSubmit:j,style:{display:"flex",flexDirection:"column",gap:16},children:[c&&s.jsx(Ko,{message:c}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[s.jsx(B,{htmlFor:"email",style:{color:"var(--t-text-secondary)",fontSize:"var(--t-text-sm)"},children:"Email"}),s.jsx(q,{id:"email",type:"email",value:r,onChange:b=>n(b.target.value),placeholder:"you@company.com",required:!0,autoFocus:!0})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[s.jsx(B,{htmlFor:"password",style:{color:"var(--t-text-secondary)",fontSize:"var(--t-text-sm)"},children:"Password"}),s.jsx(q,{id:"password",type:"password",value:i,onChange:b=>d(b.target.value),placeholder:"••••••••",required:!0})]}),s.jsx(K,{type:"submit",disabled:m,style:{marginTop:4},children:m?"Signing in…":"Sign in"}),s.jsx("button",{type:"button",onClick:()=>t("forgot-password"),style:{background:"none",border:"none",color:"var(--t-text-muted)",fontSize:"var(--t-text-sm)",cursor:"pointer",textAlign:"center",padding:0},onMouseEnter:b=>b.currentTarget.style.color="var(--t-text-primary)",onMouseLeave:b=>b.currentTarget.style.color="var(--t-text-muted)",children:"Forgot password?"}),(p==null?void 0:p.enabled)&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,margin:"4px 0"},children:[s.jsx("div",{style:{flex:1,height:1,background:"var(--t-border-subtle)"}}),s.jsx("span",{style:{fontSize:"var(--t-text-xs)",color:"var(--t-text-muted)"},children:"or"}),s.jsx("div",{style:{flex:1,height:1,background:"var(--t-border-subtle)"}})]}),s.jsxs("a",{href:"/api/auth/sso/redirect",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"9px 16px",borderRadius:8,border:"1px solid var(--t-border-default)",background:"var(--t-bg-panel)",color:"var(--t-text-secondary)",fontSize:"var(--t-text-base)",fontWeight:500,textDecoration:"none",transition:"border-color 0.15s, color 0.15s"},onMouseEnter:b=>{b.currentTarget.style.borderColor="var(--t-border-strong)",b.currentTarget.style.color="var(--t-text-primary)"},onMouseLeave:b=>{b.currentTarget.style.borderColor="var(--t-border-default)",b.currentTarget.style.color="var(--t-text-secondary)"},children:[p.provider==="github"&&s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})}),p.provider==="github"?"Sign in with GitHub":"Sign in with SSO"]})]})]})})}function Zo(){const{setAuthScreen:e}=bt(),[t,r]=l.useState(""),[n,i]=l.useState(null),[d,c]=l.useState(!1),[f,m]=l.useState(null),[y,p]=l.useState(!1);async function h(j){j.preventDefault(),i(null),p(!0);try{const b=await I.auth.forgotPassword(t);b.tempPassword&&m(b.tempPassword),c(!0)}catch(b){i(b instanceof Error?b.message:"Request failed")}finally{p(!1)}}return d?s.jsxs(Lt,{title:"Check your inbox",subtitle:f?"Your admin has generated a temporary password.":`A reset link has been sent to ${t}`,children:[f&&s.jsxs("div",{style:{background:"#141414",border:"1px solid #2a2a2a",borderRadius:8,padding:"12px 16px",marginBottom:20,textAlign:"center"},children:[s.jsx("p",{style:{fontSize:"var(--t-text-xs)",color:"#666",marginBottom:6},children:"Temporary password (shown once)"}),s.jsx("code",{style:{fontSize:18,fontWeight:700,color:"#ededed",letterSpacing:"0.1em"},children:f})]}),s.jsx("p",{style:{fontSize:"var(--t-text-base)",color:"#666",textAlign:"center",marginBottom:20},children:f?"Use this to sign in, then change your password immediately.":"Click the link in the email to reset your password. It expires in 30 minutes."}),s.jsx(K,{onClick:()=>e("login"),style:{width:"100%"},children:"Back to sign in"})]}):s.jsx(Lt,{title:"Reset your password",subtitle:"Enter your email and we'll send you instructions.",children:s.jsxs("form",{onSubmit:h,style:{display:"flex",flexDirection:"column",gap:16},children:[n&&s.jsx("div",{style:{background:"rgba(229,72,77,0.1)",border:"1px solid rgba(229,72,77,0.3)",borderRadius:6,padding:"10px 14px",color:"#e5484d",fontSize:"var(--t-text-base)"},children:n}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[s.jsx(B,{htmlFor:"forgot-email",style:{color:"#999",fontSize:"var(--t-text-sm)"},children:"Email"}),s.jsx(q,{id:"forgot-email",type:"email",value:t,onChange:j=>r(j.target.value),placeholder:"you@company.com",required:!0,autoFocus:!0})]}),s.jsx(K,{type:"submit",disabled:y,children:y?"Sending…":"Send reset instructions"}),s.jsx("button",{type:"button",onClick:()=>e("login"),style:{background:"none",border:"none",color:"#555",fontSize:"var(--t-text-sm)",cursor:"pointer",textAlign:"center",padding:0},onMouseEnter:j=>j.currentTarget.style.color="#0070f3",onMouseLeave:j=>j.currentTarget.style.color="#555",children:"Back to sign in"})]})})}function ea(){const{resetToken:e,setAuthScreen:t}=bt(),[r,n]=l.useState(""),[i,d]=l.useState(""),[c,f]=l.useState(null),[m,y]=l.useState(!1),[p,h]=l.useState(!1);async function j(b){if(b.preventDefault(),f(null),r!==i){f("Passwords do not match");return}if(r.length<8){f("Password must be at least 8 characters");return}if(!e){f("Invalid or missing reset token. Please request a new reset link.");return}h(!0);try{await I.auth.resetPassword(e,r),y(!0)}catch(S){f(S instanceof Error?S.message:"Reset failed")}finally{h(!1)}}return m?s.jsxs(Lt,{title:"Password updated",subtitle:"Your password has been reset successfully.",children:[s.jsxs("div",{style:{textAlign:"center",marginBottom:24},children:[s.jsx("div",{style:{width:48,height:48,borderRadius:"50%",background:"rgba(0,112,243,0.1)",border:"1px solid rgba(0,112,243,0.3)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",fontSize:22},children:"✓"}),s.jsx("p",{style:{fontSize:"var(--t-text-base)",color:"#666"},children:"You can now sign in with your new password."})]}),s.jsx(K,{onClick:()=>t("login"),style:{width:"100%"},children:"Sign in"})]}):s.jsx(Lt,{title:"Set a new password",subtitle:"Choose a strong password for your account.",children:s.jsxs("form",{onSubmit:j,style:{display:"flex",flexDirection:"column",gap:16},children:[c&&s.jsx("div",{style:{background:"rgba(229,72,77,0.1)",border:"1px solid rgba(229,72,77,0.3)",borderRadius:6,padding:"10px 14px",color:"#e5484d",fontSize:"var(--t-text-base)"},children:c}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[s.jsx(B,{htmlFor:"new-password",style:{color:"#999",fontSize:"var(--t-text-sm)"},children:"New password"}),s.jsx(q,{id:"new-password",type:"password",value:r,onChange:b=>n(b.target.value),placeholder:"At least 8 characters",required:!0,autoFocus:!0})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[s.jsx(B,{htmlFor:"confirm-password",style:{color:"#999",fontSize:"var(--t-text-sm)"},children:"Confirm password"}),s.jsx(q,{id:"confirm-password",type:"password",value:i,onChange:b=>d(b.target.value),placeholder:"••••••••",required:!0})]}),s.jsx(K,{type:"submit",disabled:p,style:{marginTop:4},children:p?"Updating…":"Set new password"}),s.jsx("button",{type:"button",onClick:()=>t("login"),style:{background:"none",border:"none",color:"#555",fontSize:"var(--t-text-sm)",cursor:"pointer",textAlign:"center",padding:0},onMouseEnter:b=>b.currentTarget.style.color="#0070f3",onMouseLeave:b=>b.currentTarget.style.color="#555",children:"Back to sign in"})]})})}function At({items:e,size:t=28,alwaysVisible:r=!1}){const[n,i]=l.useState(!1),[d,c]=l.useState({top:0,left:0}),f=l.useRef(null),m=l.useRef(null),y=p=>{if(p.stopPropagation(),!n&&f.current){const h=f.current.getBoundingClientRect();c({top:h.bottom+4,left:h.right-168})}i(h=>!h)};return l.useEffect(()=>{if(!n)return;const p=h=>{m.current&&!m.current.contains(h.target)&&f.current&&!f.current.contains(h.target)&&i(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]),s.jsxs(s.Fragment,{children:[s.jsx("button",{ref:f,onClick:y,className:"row-action-btn",style:{width:t,height:t,borderRadius:6,border:"none",cursor:"pointer",background:n?"var(--t-bg-surface)":"transparent",color:n?"var(--t-text-secondary)":"var(--t-text-muted)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,opacity:n||r?1:0,transition:"opacity 0.1s, background 0.1s"},onMouseEnter:p=>{p.currentTarget.style.background="var(--t-bg-surface)",p.currentTarget.style.color="var(--t-text-secondary)"},onMouseLeave:p=>{n||(p.currentTarget.style.background="transparent",p.currentTarget.style.color="var(--t-text-muted)")},title:"More actions",children:s.jsx(Rn,{size:14,weight:"bold"})}),n&&kn.createPortal(s.jsx("div",{ref:m,style:{position:"fixed",top:d.top,left:Math.max(d.left,8),width:168,background:"var(--t-bg-panel)",border:"1px solid var(--t-border-default)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden",padding:"4px 0"},children:e.map((p,h)=>s.jsxs("div",{children:[p.separator&&s.jsx("div",{style:{height:1,background:"var(--t-border-subtle)",margin:"4px 0"}}),s.jsxs("button",{onClick:j=>{j.stopPropagation(),i(!1),p.action()},style:{width:"100%",display:"flex",alignItems:"center",gap:10,padding:"8px 12px",border:"none",background:"transparent",cursor:"pointer",color:p.destructive?"var(--t-accent-danger)":"var(--t-text-secondary)",fontSize:"var(--t-text-base)",textAlign:"left"},onMouseEnter:j=>{j.currentTarget.style.background=p.destructive?"rgba(229,72,77,0.08)":"var(--t-bg-surface)"},onMouseLeave:j=>{j.currentTarget.style.background="transparent"},children:[s.jsx("span",{style:{flexShrink:0,opacity:.7},children:p.icon}),p.label]})]},h))}),document.body)]})}function ks({appId:e,value:t,onChange:r,placeholder:n="Assign to…"}){const[i,d]=l.useState(!1),[c,f]=l.useState(""),[m,y]=l.useState([]),[p,h]=l.useState([]),[j,b]=l.useState(!1),S=l.useRef(null);l.useEffect(()=>{let v=!1;return Promise.all([I.members.app.list(e),I.groups.list()]).then(([g,T])=>{v||(y(g),h(T),b(!0))}).catch(()=>{v||b(!0)}),()=>{v=!0}},[e]),l.useEffect(()=>{if(!i)return;const v=g=>{S.current&&!S.current.contains(g.target)&&(d(!1),f(""))};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[i]);const w=()=>{if(!t)return null;if(t.startsWith("user:")){const v=parseInt(t.slice(5),10),g=m.find(T=>T.userId===v);return g?g.name||g.email:j?t:"…"}if(t.startsWith("group:")){const v=parseInt(t.slice(6),10),g=p.find(T=>T.id===v);return g?g.name:j?t:"…"}return t},k=c.toLowerCase(),C=m.filter(v=>(v.name||"").toLowerCase().includes(k)||v.email.toLowerCase().includes(k)),M=p.filter(v=>v.name.toLowerCase().includes(k)),H=v=>{r(`user:${v.userId}`),d(!1),f("")},te=v=>{r(`group:${v.id}`),d(!1),f("")},ne=w(),L=t==null?void 0:t.startsWith("group:");return s.jsxs("div",{ref:S,style:{position:"relative"},children:[s.jsx("div",{onClick:()=>d(v=>!v),style:{minHeight:34,padding:t?"4px 8px":"0 10px",borderRadius:6,border:`1px solid ${i?"var(--t-border-strong)":"var(--t-border-default)"}`,background:"var(--t-bg-surface)",cursor:"pointer",display:"flex",alignItems:"center",gap:6},children:t&&ne?s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,padding:"2px 8px 2px 6px",borderRadius:99,background:"var(--t-sidebar-hover)",border:"1px solid var(--t-border-default)",fontSize:"var(--t-text-sm)",color:"var(--t-text-primary)"},children:[L?s.jsx(ys,{size:11,style:{color:"var(--t-text-muted)"}}):s.jsx(Ns,{size:11,style:{color:"var(--t-text-muted)"}}),ne,s.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),r(null)},style:{background:"none",border:"none",padding:0,marginLeft:2,cursor:"pointer",color:"var(--t-text-muted)",display:"flex",alignItems:"center",lineHeight:1},children:s.jsx(is,{size:10})})]}):s.jsx("span",{style:{fontSize:"var(--t-text-base)",color:"var(--t-text-muted)"},children:n})}),i&&s.jsxs("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:1e3,background:"var(--t-bg-panel)",border:"1px solid var(--t-border-default)",borderRadius:8,boxShadow:"var(--t-shadow-lg)",overflow:"hidden"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"7px 10px",borderBottom:"1px solid var(--t-border-subtle)"},children:[s.jsx(Xs,{size:13,style:{color:"var(--t-text-muted)",flexShrink:0}}),s.jsx("input",{autoFocus:!0,value:c,onChange:v=>f(v.target.value),placeholder:"Search users or groups…",style:{flex:1,border:"none",background:"transparent",fontSize:"var(--t-text-sm)",color:"var(--t-text-primary)",outline:"none"}})]}),s.jsx("div",{style:{maxHeight:220,overflowY:"auto"},children:j?s.jsxs(s.Fragment,{children:[C.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{padding:"6px 10px 2px",fontSize:10,fontWeight:600,color:"var(--t-text-muted)",textTransform:"uppercase",letterSpacing:"0.06em"},children:"Users"}),C.map(v=>s.jsxs("button",{type:"button",onClick:()=>H(v),style:{width:"100%",padding:"6px 10px",display:"flex",alignItems:"center",gap:7,background:"none",border:"none",cursor:"pointer",fontSize:"var(--t-text-sm)",color:"var(--t-text-primary)",textAlign:"left"},onMouseEnter:g=>g.currentTarget.style.background="var(--t-elem-hover)",onMouseLeave:g=>g.currentTarget.style.background="none",children:[s.jsx(Ns,{size:13,style:{color:"var(--t-text-muted)",flexShrink:0}}),s.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:v.name||v.email}),s.jsx("span",{style:{fontSize:"var(--t-text-2xs)",color:"var(--t-text-muted)",flexShrink:0},children:v.role})]},v.userId))]}),M.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{padding:"6px 10px 2px",fontSize:10,fontWeight:600,color:"var(--t-text-muted)",textTransform:"uppercase",letterSpacing:"0.06em"},children:"Groups"}),M.map(v=>s.jsxs("button",{type:"button",onClick:()=>te(v),style:{width:"100%",padding:"6px 10px",display:"flex",alignItems:"center",gap:7,background:"none",border:"none",cursor:"pointer",fontSize:"var(--t-text-sm)",color:"var(--t-text-primary)",textAlign:"left"},onMouseEnter:g=>g.currentTarget.style.background="var(--t-elem-hover)",onMouseLeave:g=>g.currentTarget.style.background="none",children:[s.jsx(ys,{size:13,style:{color:"var(--t-text-muted)",flexShrink:0}}),s.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:v.name})]},v.id))]}),C.length===0&&M.length===0&&s.jsx("p",{style:{fontSize:"var(--t-text-xs)",color:"var(--t-text-muted)",padding:"8px 10px",fontStyle:"italic"},children:c?`No matches for "${c}"`:"No users or groups found"})]}):s.jsx("p",{style:{fontSize:"var(--t-text-xs)",color:"var(--t-text-muted)",padding:"8px 10px"},children:"Loading…"})})]})]})}function ta(e){return e?`${e}22`:"rgba(255,255,255,0.06)"}function sa(e){return e??"var(--t-text-secondary)"}function ra(e){return e?`${e}55`:"var(--t-border-subtle)"}function Mr({name:e,color:t,onRemove:r,size:n="md"}){const i=n==="sm"?10:11,d=n==="sm"?"2px 6px":"3px 8px";return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:d,borderRadius:20,fontSize:i,fontWeight:600,background:ta(t),color:sa(t),border:`1px solid ${ra(t)}`,whiteSpace:"nowrap"},children:[e,r&&s.jsx("button",{onClick:c=>{c.stopPropagation(),r()},style:{background:"none",border:"none",cursor:"pointer",padding:0,display:"flex",alignItems:"center",color:"inherit",opacity:.7},title:`Remove ${e}`,children:s.jsx(is,{size:9,weight:"bold"})})]})}function Ga({selected:e,onChange:t,globalTags:r,spaceTags:n,onCreateSpaceTag:i,disabled:d=!1}){const[c,f]=l.useState(!1),[m,y]=l.useState(""),[p,h]=l.useState(!1),j=l.useRef(null),b=l.useRef(null);l.useEffect(()=>{function v(g){j.current&&!j.current.contains(g.target)&&(f(!1),y(""))}return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[]);const S=new Set(r.map(v=>v.name.toLowerCase())),w=m.trim().toLowerCase(),k=r.filter(v=>!e.includes(v.name)&&(w===""||v.name.toLowerCase().includes(w))),C=n.filter(v=>!e.includes(v.name)&&(w===""||v.name.toLowerCase().includes(w))),M=w!==""&&!S.has(w)&&!n.find(v=>v.name.toLowerCase()===w)&&!r.find(v=>v.name.toLowerCase()===w)&&!e.find(v=>v.toLowerCase()===w);function H(v){e.includes(v)?t(e.filter(g=>g!==v)):(t([...e,v]),y(""))}function te(v){t(e.filter(g=>g!==v))}async function ne(){if(!M||p)return;h(!0);const v=await i(m.trim());v&&t([...e,v.name]),y(""),h(!1)}const L=k.length>0||C.length>0||M;return s.jsxs("div",{ref:j,style:{position:"relative"},children:[s.jsxs("div",{onClick:()=>{d||(f(!0),setTimeout(()=>{var v;return(v=b.current)==null?void 0:v.focus()},0))},style:{minHeight:36,border:"1px solid var(--t-border-default)",borderRadius:8,padding:"4px 8px",display:"flex",flexWrap:"wrap",gap:4,alignItems:"center",background:"var(--t-bg-input, var(--t-bg-panel))",cursor:d?"default":"text",opacity:d?.6:1},children:[e.map(v=>{const g=r.find(N=>N.name===v),T=n.find(N=>N.name===v),F=(g==null?void 0:g.color)??(T==null?void 0:T.color)??null;return s.jsx(Mr,{name:v,color:F,onRemove:d?void 0:()=>te(v)},v)}),!d&&s.jsx("input",{ref:b,value:m,onChange:v=>{y(v.target.value),f(!0)},onFocus:()=>f(!0),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),M&&ne()),v.key==="Escape"&&(f(!1),y("")),v.key==="Backspace"&&m===""&&e.length>0&&te(e[e.length-1])},placeholder:e.length===0?"Search or create tags…":"",style:{flex:1,minWidth:120,border:"none",outline:"none",background:"transparent",fontSize:"var(--t-text-base)",color:"var(--t-text-primary)"}})]}),c&&!d&&s.jsxs("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:200,background:"var(--t-bg-surface)",border:"1px solid var(--t-border-default)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.3)",overflow:"hidden",maxHeight:280,overflowY:"auto"},children:[!L&&s.jsx("div",{style:{padding:"12px 14px",fontSize:"var(--t-text-sm)",color:"var(--t-text-muted)",textAlign:"center"},children:"No tags found"}),M&&s.jsxs("button",{onClick:ne,disabled:p,style:{width:"100%",padding:"9px 14px",display:"flex",alignItems:"center",gap:8,background:"none",border:"none",borderBottom:"1px solid var(--t-border-subtle)",cursor:p?"wait":"pointer",color:"var(--t-text-primary)",fontSize:"var(--t-text-base)",textAlign:"left"},children:[s.jsx(xe,{size:14,style:{color:"var(--t-text-secondary)",flexShrink:0}}),s.jsxs("span",{children:["Create space tag"," ",s.jsxs("strong",{style:{color:"var(--t-text-secondary)"},children:["“",m.trim(),"”"]})]})]}),k.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{padding:"6px 14px 3px",fontSize:10,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.08em",color:"var(--t-text-muted)",display:"flex",alignItems:"center",gap:5},children:[s.jsx(Tn,{size:11}),"Global"]}),k.map(v=>s.jsx(Hs,{tag:v,onSelect:()=>H(v.name)},`g-${v.id}`))]}),C.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{padding:"6px 14px 3px",fontSize:10,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.08em",color:"var(--t-text-muted)",display:"flex",alignItems:"center",gap:5,borderTop:k.length>0?"1px solid var(--t-border-subtle)":void 0,marginTop:k.length>0?4:0},children:[s.jsx(En,{size:11}),"Space"]}),C.map(v=>s.jsx(Hs,{tag:v,onSelect:()=>H(v.name)},`s-${v.id}`))]})]})]})}function Hs({tag:e,onSelect:t}){return s.jsxs("button",{onClick:t,style:{width:"100%",padding:"7px 14px",display:"flex",alignItems:"center",gap:8,background:"none",border:"none",cursor:"pointer",color:"var(--t-text-primary)",fontSize:"var(--t-text-base)",textAlign:"left"},onMouseEnter:r=>r.currentTarget.style.background="rgba(255,255,255,0.05)",onMouseLeave:r=>r.currentTarget.style.background="none",children:[s.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:e.color??"var(--t-text-muted)",flexShrink:0}}),s.jsx(Zs,{size:12,style:{color:"var(--t-text-muted)",flexShrink:0}}),e.name]})}const Ae=lr,na=dr;function oa({...e}){return s.jsx(ur,{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(2px)",zIndex:50},...e})}function Me({className:e,children:t,style:r,...n}){return s.jsxs(na,{children:[s.jsx(oa,{}),s.jsxs(cr,{className:tt("fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-xl p-6 flex flex-col",e),style:{background:"var(--t-bg-panel)",border:"1px solid var(--t-border-default)",boxShadow:"0 24px 60px rgba(0,0,0,0.6)",...r},...n,children:[t,s.jsx(Vn,{style:{position:"absolute",right:14,top:14,width:28,height:28,borderRadius:6,border:"none",cursor:"pointer",background:"transparent",color:"var(--t-text-muted)",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.1s"},onMouseEnter:i=>{i.currentTarget.style.background="var(--t-bg-surface)",i.currentTarget.style.color="var(--t-text-primary)"},onMouseLeave:i=>{i.currentTarget.style.background="transparent",i.currentTarget.style.color="var(--t-text-muted)"},children:s.jsx(zn,{size:14})})]})]})}function _e({className:e,...t}){return s.jsx("div",{className:tt("flex flex-col gap-1",e),...t})}function Fe({className:e,...t}){return s.jsx(Wn,{className:tt("text-base font-semibold",e),style:{color:"var(--t-text-primary)"},...t})}function _r({className:e,...t}){return s.jsx(Gn,{className:tt("text-sm",e),style:{color:"var(--t-text-secondary)"},...t})}function Je({className:e,...t}){return s.jsx("div",{className:tt("flex justify-end gap-2",e),...t})}function Fr({open:e,title:t,description:r,confirmLabel:n="Delete",confirmVariant:i="destructive",onConfirm:d,onCancel:c}){return s.jsx(lr,{open:e,onOpenChange:f=>{f||c()},children:s.jsxs(dr,{children:[s.jsx(ur,{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(2px)",zIndex:50}}),s.jsxs(cr,{style:{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%,-50%)",zIndex:51,width:400,background:"var(--t-bg-panel)",border:"1px solid var(--t-border-default)",borderRadius:12,padding:24,boxShadow:"0 24px 60px rgba(0,0,0,0.6)"},children:[s.jsxs("div",{style:{display:"flex",gap:14,alignItems:"flex-start"},children:[s.jsx("div",{style:{width:36,height:36,borderRadius:8,flexShrink:0,background:"rgba(229,72,77,0.12)",border:"1px solid rgba(229,72,77,0.25)",display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Pn,{size:18,weight:"fill",color:"var(--t-accent-danger)"})}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("p",{style:{fontSize:"var(--t-text-lg)",fontWeight:600,color:"var(--t-text-primary)",marginBottom:6},children:t}),s.jsx("p",{style:{fontSize:"var(--t-text-base)",color:"var(--t-text-muted)",lineHeight:1.5},children:r})]})]}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:24},children:[s.jsx(K,{variant:"outline",size:"sm",onClick:c,children:"Cancel"}),s.jsx(K,{size:"sm",onClick:d,variant:i,children:n})]})]})]})})}function aa(e){const t=new Map;e.forEach(n=>t.set(n.id,{...n,children:[]}));const r=[];return e.forEach(n=>{var d;const i=t.get(n.id);n.parentFolderId===null?r.push(i):(d=t.get(n.parentFolderId))==null||d.children.push(i)}),r}const Ee=new Map;function Jr(e){const t=e!==null?Ee.get(e)??null:null,[r,n]=l.useState(t??[]),[i,d]=l.useState(t===null&&e!==null),[c,f]=l.useState(null),m=l.useRef(0),y=l.useRef(null);if(y.current!==e){y.current=e,m.current++;const S=e!==null?Ee.get(e)??null:null;n(S??[]),d(S===null&&e!==null),f(null)}const p=l.useCallback(async()=>{if(e===null)return;const S=++m.current;Ee.has(e)||d(!0);try{f(null);const w=await I.folders.list(e);if(m.current!==S)return;Ee.set(e,w),n(w)}catch(w){if(m.current!==S)return;f(w instanceof Error?w.message:"Failed to fetch folders")}finally{m.current===S&&d(!1)}},[e]);l.useEffect(()=>{p()},[p]);const h=async S=>{if(e===null)return;const w=await I.folders.create(e,S);return n(k=>{const C=[...k,w];return Ee.set(e,C),C}),w},j=async S=>{e!==null&&(await I.folders.delete(e,S),n(w=>{const k=w.filter(C=>C.id!==S);return Ee.set(e,k),k}))},b=l.useCallback(async()=>{e!==null&&Ee.delete(e),await p()},[e,p]);return{folders:r,tree:aa(r),loading:i,error:c,addFolder:h,removeFolder:j,refetch:b}}function Ua(){return Ee.size}function Ha(){Ee.clear()}function Ya(e){return Ee.get(e)}function qa(e,t){Ee.set(e,t)}const xs=new Map;function Br(e){const t=e!==null?xs.get(e)??null:null,[r,n]=l.useState(t),[i,d]=l.useState(t===null&&e!==null),c=l.useRef(null);if(c.current!==e){c.current=e;const f=e!==null?xs.get(e)??null:null;n(f),d(f===null&&e!==null)}return l.useEffect(()=>{if(e===null)return;let f=!1;return I.apps.myRole(e).then(m=>{f||(xs.set(e,m.role),n(m.role))}).catch(()=>{}).finally(()=>{f||d(!1)}),()=>{f=!0}},[e]),{role:r,loading:i,isAdmin:r==="admin",isEditor:r==="admin"||r==="editor",isViewer:r!==null}}let Te=null;function Ka(){return Te!==null?Te.length:0}function Qa(){Te=null}function ia(){const[e,t]=l.useState(Te??[]),[r,n]=l.useState(Te===null),[i,d]=l.useState(null),c=l.useCallback(async()=>{Te===null&&n(!0);try{d(null);const h=await I.apps.list();Te=h,t(h)}catch(h){d(h instanceof Error?h.message:"Failed to fetch apps")}finally{n(!1)}},[]);l.useEffect(()=>{c()},[c]);const f=async h=>{const j=await I.apps.create(h);return t(b=>{const S=[...b,j];return Te=S,S}),j},m=async(h,j)=>{const b=await I.apps.update(h,j);return t(S=>{const w=S.map(k=>k.id===h?b:k);return Te=w,w}),b},y=async h=>{await I.apps.delete(h),t(j=>{const b=j.filter(S=>S.id!==h);return Te=b,b})},p=l.useCallback(async()=>{Te=null,await c()},[c]);return{apps:e,loading:r,error:i,addApp:f,updateApp:m,removeApp:y,refetch:p}}function Ne({icon:e,label:t,active:r,disabled:n,onClick:i}){return s.jsx("button",{title:n?`${t} (select an app first)`:t,onClick:n?void 0:i,style:{width:40,height:40,borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",border:"none",cursor:n?"not-allowed":"pointer",transition:"all 0.12s",background:r?"var(--t-sidebar-hover)":"transparent",color:r?"var(--t-text-primary)":n?"var(--t-border-strong)":"var(--t-text-muted)",outline:r?"1px solid var(--t-border-default)":"none",opacity:n?.4:1},onMouseEnter:d=>{if(!r&&!n){const c=d.currentTarget;c.style.background="var(--t-sidebar-hover)",c.style.color="var(--t-text-secondary)"}},onMouseLeave:d=>{if(!r&&!n){const c=d.currentTarget;c.style.background="transparent",c.style.color="var(--t-text-muted)"}},children:e})}function rs({value:e,onChange:t,placeholder:r}){return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,margin:"2px 8px 4px",padding:"4px 8px",borderRadius:6,background:"var(--t-bg-surface)",border:"1px solid var(--t-border-subtle)"},children:[s.jsx(Xs,{size:12,style:{color:"var(--t-text-muted)",flexShrink:0}}),s.jsx("input",{value:e,onChange:n=>t(n.target.value),placeholder:r,style:{flex:1,background:"none",border:"none",outline:"none",fontSize:"var(--t-text-sm)",color:"var(--t-text-primary)",minWidth:0}}),e&&s.jsx("button",{onClick:()=>t(""),style:{background:"none",border:"none",cursor:"pointer",padding:0,color:"var(--t-text-muted)",display:"flex",lineHeight:1},children:s.jsx(is,{size:11})})]})}function Vr({title:e,onClick:t,children:r}){return s.jsx("button",{onClick:t,title:e,style:{width:20,height:20,borderRadius:4,border:"none",cursor:"pointer",background:"transparent",color:"var(--t-text-muted)",display:"flex",alignItems:"center",justifyContent:"center",padding:0},onMouseEnter:n=>{const i=n.currentTarget;i.style.background="var(--t-sidebar-hover)",i.style.color="var(--t-text-secondary)"},onMouseLeave:n=>{const i=n.currentTarget;i.style.background="transparent",i.style.color="var(--t-text-muted)"},children:r})}function Le({label:e,onAdd:t,extraActions:r}){return s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px 4px"},children:[s.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--t-text-muted)",textTransform:"uppercase",letterSpacing:"0.08em"},children:e}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2},children:[r,t&&s.jsx(Vr,{title:`New ${e.replace(/s$/,"")}`,onClick:t,children:s.jsx(xe,{size:11})})]})]})}function Ze({icon:e,label:t,subtitle:r,active:n,depth:i=0,chevron:d,onClick:c,onDelete:f,onRename:m,onAddChild:y,addChildTitle:p}){const[h,j]=l.useState(!1),b=!!(f||m||y),S=[...y?[{label:p??"Add child",icon:s.jsx(xe,{size:13}),action:y}]:[],...m?[{label:"Rename",icon:s.jsx(ls,{size:13}),action:m,separator:!y}]:[],...f?[{label:"Delete",icon:s.jsx(it,{size:13}),action:f,destructive:!0,separator:!0}]:[]];return s.jsxs("div",{style:{position:"relative",margin:"1px 6px",borderRadius:6,background:n||h?"var(--t-sidebar-hover)":"transparent",transition:"background 0.1s"},onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[s.jsxs("button",{onClick:c,style:{width:"100%",height:44,display:"flex",alignItems:"center",gap:8,paddingLeft:10+i*14,paddingRight:h&&b?34:8,border:"none",cursor:"pointer",borderRadius:6,background:"transparent",color:n?"var(--t-text-primary)":h?"var(--t-text-secondary)":"var(--t-text-muted)",textAlign:"left",transition:"color 0.1s, padding-right 0.1s",overflow:"hidden"},children:[s.jsx("span",{style:{flexShrink:0,display:"flex",alignSelf:"center",color:n||h?"var(--t-text-secondary)":"var(--t-text-muted)"},children:e}),s.jsxs("span",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"center"},children:[s.jsx("span",{style:{fontSize:"var(--t-text-base)",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:1.3},children:t}),r&&s.jsx("span",{style:{fontSize:"var(--t-text-2xs)",color:"var(--t-text-muted)",display:"block",marginTop:2,lineHeight:1.2},children:r})]}),d&&!h&&s.jsx(Ts,{size:11,color:"var(--t-text-muted)",style:{flexShrink:0}})]}),b&&s.jsx("div",{style:{position:"absolute",right:6,top:"50%",transform:"translateY(-50%)"},children:s.jsx(At,{items:S,size:24,alwaysVisible:h})})]})}function la({node:e,depth:t,isActive:r,isCollapsed:n,onSelect:i,onToggleCollapse:d,onAddSubfolder:c,onDelete:f,onRename:m,onCopy:y,onCut:p,onDuplicate:h,onPaste:j,showPaste:b}){const[S,w]=l.useState(!1),k=e.children.length>0,C=[];e.children.length>0&&C.push(`${e.children.length} folder${e.children.length!==1?"s":""}`),(e.testCount??0)>0&&C.push(`${e.testCount} test${e.testCount!==1?"s":""}`);const M=C.length>0?C.join(" · "):void 0;return s.jsxs("div",{style:{position:"relative",margin:"1px 6px",borderRadius:6,background:r||S?"var(--t-sidebar-hover)":"transparent",transition:"background 0.1s"},onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[s.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[s.jsx("button",{onClick:k?d:void 0,style:{width:22+t*14,minWidth:22+t*14,height:44,flexShrink:0,border:"none",background:"transparent",cursor:k?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center",paddingLeft:6,paddingRight:6,color:S?"var(--t-text-muted)":"var(--t-border-strong)"},children:k?n?s.jsx(Ts,{size:10}):s.jsx(Mn,{size:10}):null}),s.jsxs("button",{onClick:i,style:{flex:1,height:44,display:"flex",alignItems:"center",gap:6,paddingRight:8,border:"none",cursor:"pointer",background:"transparent",color:r?"var(--t-text-primary)":S?"var(--t-text-secondary)":"var(--t-text-muted)",textAlign:"left",transition:"color 0.1s",overflow:"hidden"},children:[s.jsx("span",{style:{color:r||S?"var(--t-text-secondary)":"var(--t-text-muted)",flexShrink:0,alignSelf:"center",display:"flex"},children:s.jsx(Rs,{size:20,weight:r?"fill":"regular"})}),s.jsxs("span",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"center"},children:[s.jsx("span",{style:{fontSize:"var(--t-text-base)",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:1.3},children:e.name}),M&&s.jsx("span",{style:{fontSize:"var(--t-text-2xs)",color:"var(--t-text-muted)",display:"block",marginTop:2,lineHeight:1.2},children:M})]})]})]}),s.jsx("div",{style:{position:"absolute",right:6,top:"50%",transform:"translateY(-50%)",display:S?"flex":"none"},children:s.jsx(At,{size:24,alwaysVisible:!0,items:[...c?[{label:"Add subfolder",icon:s.jsx(xe,{size:13}),action:c}]:[],...b&&j?[{label:"Paste here",icon:s.jsx(Cs,{size:13}),action:j,separator:!0}]:[],{label:"Copy",icon:s.jsx(Ss,{size:13}),action:y,separator:!(b&&j)&&!c},{label:"Cut",icon:s.jsx(_n,{size:13}),action:p},{label:"Duplicate",icon:s.jsx(Ss,{size:13,weight:"fill"}),action:h},...m?[{label:"Rename",icon:s.jsx(ls,{size:13}),action:m,separator:!0}]:[],...f?[{label:"Delete",icon:s.jsx(it,{size:13}),action:f,destructive:!0,separator:!m}]:[]]})})]})}function Wr({nodes:e,spaceId:t,appId:r,depth:n,view:i,collapsedIds:d,onNavigate:c,onAddSubfolder:f,onDeleteFolder:m,onRenameFolder:y,onToggleCollapse:p,onCopyFolder:h,onCutFolder:j,onDuplicateFolder:b,onPasteFolder:S,clipboardFolderActive:w,invalidPasteFolderIds:k}){return s.jsx(s.Fragment,{children:e.map(C=>{const M=(i.type==="tests"||i.type==="test-editor")&&"folderId"in i&&i.folderId===C.id,H=d.has(C.id);return s.jsxs("div",{children:[s.jsx(la,{node:C,depth:n,isActive:M,isCollapsed:H,onSelect:()=>c({type:"tests",appId:r,spaceId:t,folderId:C.id}),onToggleCollapse:()=>p(C.id),onAddSubfolder:f?()=>f(C.id):void 0,onDelete:m?()=>m(C.id,C.name):void 0,onRename:y?()=>y(C.id,C.name):void 0,onCopy:()=>h(C.id),onCut:()=>j(C.id),onDuplicate:()=>b(C.id),onPaste:()=>S(C.id),showPaste:w&&!k.has(C.id)}),C.children.length>0&&!H&&s.jsx(Wr,{nodes:C.children,spaceId:t,appId:r,depth:n+1,view:i,collapsedIds:d,onNavigate:c,onAddSubfolder:f,onDeleteFolder:m,onRenameFolder:y,onToggleCollapse:p,onCopyFolder:h,onCutFolder:j,onDuplicateFolder:b,onPasteFolder:S,clipboardFolderActive:w,invalidPasteFolderIds:k})]},C.id)})})}function Ys({icon:e,label:t,danger:r,onClick:n}){const i=r?"#e5484d":"#aaa";return s.jsxs("button",{onClick:n,style:{width:"100%",display:"flex",alignItems:"center",gap:9,padding:"7px 14px",background:"none",border:"none",color:i,fontSize:"var(--t-text-base)",cursor:"pointer",textAlign:"left"},onMouseEnter:d=>{d.currentTarget.style.background=r?"rgba(229,72,77,0.08)":"var(--t-sidebar-hover)",d.currentTarget.style.color=r?"#ff6166":"var(--t-text-primary)"},onMouseLeave:d=>{d.currentTarget.style.background="none",d.currentTarget.style.color=i},children:[e,t]})}function da({apps:e,selectedApp:t,spaces:r,spacesLoading:n,runs:i,runsLoading:d,milestones:c,milestonesLoading:f,onCreateMilestone:m,onDeleteMilestone:y,view:p,onNavigate:h,onAddApp:j,onDeleteApp:b,onAddSpace:S,onDeleteSpace:w,onCreateRun:k,onDeleteRun:C,onDuplicateRun:M}){const{branding:H}=Es(),{theme:te}=Sr(),ne=parseInt(te.bgBase.slice(1,3),16)>128,L=yr(H,ne),[v,g]=l.useState(!1),[T,F]=l.useState(!1),[N,_]=l.useState(!1),[D,Y]=l.useState(void 0),[se,A]=l.useState(!1),[Q,ie]=l.useState(""),[$e,O]=l.useState(""),[st,Ue]=l.useState(""),[He,ze]=l.useState(""),[oe,re]=l.useState(null),[Pe,ke]=l.useState(null),[Z,Ye]=l.useState(null),[qe,Se]=l.useState(!1),[Oe,pe]=l.useState(""),[dt,vt]=l.useState(""),[Mt,St]=l.useState("open"),[_t,jt]=l.useState(""),[Ft,wt]=l.useState(""),[Jt,$t]=l.useState(null),[ct,ds]=l.useState(""),[Bt,kt]=l.useState(null),[le,Ke]=l.useState(""),[ut,Ct]=l.useState(""),[pt,rt]=l.useState(""),[Ie,Rt]=l.useState(""),[ft,W]=l.useState(""),[Tt,Et]=l.useState(""),[fe,me]=l.useState(!1),[$,R]=l.useState(null),[de,Ce]=l.useState(new Set),{clipboard:je,copy:Ur,cut:Hr,clear:Yr}=Hn(),{user:V,logout:qr}=bt(),{isEditor:Re,isAdmin:nt,loading:Kr}=Br((t==null?void 0:t.id)??null),[mt,Vt]=l.useState(!1),[U,gt]=l.useState(null),[zt,Wt]=l.useState(""),[cs,Gt]=l.useState(""),[Ut,Qr]=l.useState(""),[ht,Xr]=l.useState(""),[Ht,Zr]=l.useState(""),[Yt,qt]=l.useState([]),[en,tn]=l.useState([]),[xt,Kt]=l.useState(""),[us,sn]=l.useState("#6366f1"),[Os,Qe]=l.useState(""),[ps,Qt]=l.useState(!1),G=p.type==="ai"?"ai":p.type==="runs"||p.type==="run-execution"?"runs":p.type==="milestones"||p.type==="milestone-detail"?"milestones":p.type==="reports"||p.type==="analysis-detail"||p.type==="plan-detail"?"reports":p.type==="settings"?"settings":p.type==="trash"?"trash":p.type==="users"?"users":p.type==="admin-settings"?"admin-settings":p.type==="apps"?"apps":"nav",ge="spaceId"in p?p.spaceId:null,Xt=r.find(u=>u.id===ge)??null,{tree:Be,loading:rn,addFolder:nn,removeFolder:on,refetch:yt}=Jr(ge);l.useEffect(()=>{const u=()=>void yt();return window.addEventListener("sdet:folders:refresh",u),()=>window.removeEventListener("sdet:folders:refresh",u)},[yt]),l.useEffect(()=>{const u=()=>{Y(void 0),W(""),_(!0)};return window.addEventListener("sdet:open:add-folder",u),()=>window.removeEventListener("sdet:open:add-folder",u)},[]);const fs=t?(p.type==="tests"||p.type==="test-editor")&&Xt?"folders":t?"spaces":"apps":"apps",an=u=>{Ur({kind:"folder",ids:[u],sourceSpaceId:ge??void 0})},ln=u=>{Hr({kind:"folder",ids:[u],sourceSpaceId:ge??void 0})},dn=async u=>{ge&&(await I.bulk.folders.duplicate({folderIds:[u],spaceId:ge}),await yt())},cn=async u=>{if(!je||je.kind!=="folder")return;const x=je.sourceSpaceId??ge;x&&(je.mode==="copy"?await I.bulk.folders.duplicate({folderIds:je.ids,spaceId:x,targetParentFolderId:u}):await I.bulk.folders.move({folderIds:je.ids,targetParentFolderId:u}),Yr(),await yt())},ms=(je==null?void 0:je.kind)==="folder",un=l.useMemo(()=>{if(!ms||!je)return new Set;const u=je.ids,x=new Set;function P(X){x.add(X.id);for(const be of X.children)P(be)}function ee(X){for(const be of X)u.includes(be.id)?P(be):ee(be.children)}return ee(Be),x},[ms,je,Be]),pn=u=>{Ce(x=>{const P=new Set(x);return P.has(u)?P.delete(u):P.add(u),P})};function fn(u){const x=[];function P(ee){for(const X of ee)x.push(X.id),X.children.length>0&&P(X.children)}return P(u),x}const mn=()=>Ce(new Set),gn=()=>Ce(new Set(fn(Be))),Is=l.useMemo(()=>{if(!ht.trim())return[];const u=ht.toLowerCase(),x=[];function P(ee,X){for(const be of ee){const Ds=X?`${X} / ${be.name}`:be.name;be.name.toLowerCase().includes(u)&&x.push({node:be,path:Ds}),P(be.children,Ds)}}return P(Be,""),x},[ht,Be]),hn=async u=>{if(u.preventDefault(),!!le.trim()){me(!0);try{const x=await j({name:le.trim(),description:ut.trim()||void 0});Ke(""),Ct(""),g(!1),h({type:"ai",appId:x.id,section:"chat"})}finally{me(!1)}}},xn=async u=>{if(u.preventDefault(),!!pt.trim()){me(!0);try{await S({name:pt.trim(),description:Ie.trim()||void 0}),rt(""),Rt(""),F(!1)}finally{me(!1)}}},yn=async u=>{if(u.preventDefault(),!!ft.trim()){me(!0);try{await nn({name:ft.trim(),description:Tt.trim()||void 0,parentFolderId:D}),W(""),Et(""),Y(void 0),_(!1)}finally{me(!1)}}},bn=u=>{Y(u),W(""),Et(""),_(!0)},vn=async()=>{$&&($.kind==="app"?await b($.id):$.kind==="space"?await w($.id):$.kind==="run"?await C($.id):$.kind==="milestone"?await y($.id):$.kind==="folder"&&(await on($.id),await yt()),R(null))},Sn=(u,x,P=null)=>{gt({kind:"app",id:u,currentName:x,currentDescription:P}),Wt(x),Gt(P??"")},jn=(u,x,P=null)=>{t&&(gt({kind:"space",appId:t.id,id:u,currentName:x,currentDescription:P}),Wt(x),Gt(P??""),Kt(""),Qe(""),I.spaceTags.list(u).then(qt).catch(()=>{}),I.globalTags.list().then(tn).catch(()=>{}))},wn=(u,x,P)=>{ge&&(gt({kind:"folder",spaceId:ge,id:u,currentName:x,currentDescription:P??null}),Wt(x),Gt(P??""))},$n=async u=>{if(u.preventDefault(),!(!U||!zt.trim())){me(!0);try{const x=zt.trim(),P=cs.trim()||void 0;U.kind==="app"?(await I.apps.update(U.id,{name:x,description:P}),window.dispatchEvent(new CustomEvent("sdet:apps:refresh"))):U.kind==="space"?(await I.spaces.update(U.appId,U.id,{name:x,description:P}),window.dispatchEvent(new CustomEvent("sdet:spaces:refresh"))):U.kind==="folder"&&(await I.folders.update(U.spaceId,U.id,{name:x,description:P??null}),await yt()),gt(null)}finally{me(!1)}}};return s.jsxs("div",{style:{display:"flex",height:"100%",flexShrink:0},children:[s.jsxs("div",{style:{width:52,flexShrink:0,background:"var(--t-bg-base)",borderRight:"1px solid var(--t-border-subtle)",display:"flex",flexDirection:"column",alignItems:"center",paddingTop:8,paddingBottom:8,gap:2},children:[s.jsx("div",{title:H.appTitle,style:{width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:L?s.jsx("img",{src:L,alt:H.appTitle,style:{width:26,height:26,objectFit:"contain",borderRadius:6}}):s.jsx("div",{style:{width:26,height:26,borderRadius:6,background:"var(--t-bg-elevated)",border:"1px solid var(--t-border-default)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"var(--t-text-sm)",fontWeight:700,color:"var(--t-text-secondary)",letterSpacing:"-0.02em"},children:H.appTitle.charAt(0).toUpperCase()})}),s.jsx("div",{style:{height:1,width:24,background:"var(--t-border-subtle)",margin:"4px 0"}}),s.jsx(Ne,{icon:s.jsx(Dt,{size:17,weight:G==="apps"?"fill":"regular"}),label:"Apps",active:G==="apps",onClick:()=>h({type:"apps"})}),s.jsx("div",{style:{height:1,width:24,background:"var(--t-border-subtle)",margin:"4px 0"}}),s.jsx(Ne,{icon:s.jsx(er,{size:17,weight:G==="ai"?"fill":"regular"}),label:"AI",active:G==="ai",disabled:!t,onClick:()=>{t&&h({type:"ai",appId:t.id})}}),s.jsx(Ne,{icon:s.jsx(Ls,{size:17,weight:G==="nav"?"fill":"regular"}),label:"Spaces & Folders",active:G==="nav",disabled:!t,onClick:()=>{t&&h({type:"spaces",appId:t.id})}}),s.jsx(Ne,{icon:s.jsx(os,{size:17,weight:G==="runs"?"fill":"regular"}),label:"Test Runs",active:G==="runs",disabled:!t,onClick:()=>{t&&h({type:"runs",appId:t.id})}}),s.jsx(Ne,{icon:s.jsx(bs,{size:17,weight:G==="milestones"?"fill":"regular"}),label:"Milestones",active:G==="milestones",disabled:!t,onClick:()=>{t&&h({type:"milestones",appId:t.id})}}),s.jsx(Ne,{icon:s.jsx(at,{size:17,weight:G==="reports"?"fill":"regular"}),label:"Reports",active:G==="reports",disabled:!t,onClick:()=>{t&&h({type:"reports",appId:t.id,section:"analysis"})}}),Re&&s.jsx(Ne,{icon:s.jsx(On,{size:17,weight:G==="settings"?"fill":"regular"}),label:"Settings",active:G==="settings",disabled:!t,onClick:()=>{t&&h({type:"settings",appId:t.id})}}),s.jsx(Ne,{icon:s.jsx(it,{size:17,weight:G==="trash"?"fill":"regular"}),label:"Trash",active:G==="trash",disabled:!t||!ge,onClick:()=>{t&&ge&&h({type:"trash",appId:t.id,spaceId:ge})}}),s.jsx("div",{style:{flex:1}}),s.jsx("div",{style:{height:1,width:24,background:"var(--t-border-subtle)",margin:"4px 0"}}),(V==null?void 0:V.globalRole)==="super_admin"&&s.jsx(Ne,{icon:s.jsx(ns,{size:17,weight:G==="users"?"fill":"regular"}),label:"User Management",active:G==="users",onClick:()=>h({type:"users",section:"users"})}),(V==null?void 0:V.globalRole)==="super_admin"&&s.jsx(Ne,{icon:s.jsx(tr,{size:17,weight:G==="admin-settings"?"fill":"regular"}),label:"Admin Settings",active:G==="admin-settings",onClick:()=>h({type:"admin-settings"})}),s.jsxs("div",{style:{position:"relative"},children:[s.jsx("button",{title:(V==null?void 0:V.name)??(V==null?void 0:V.email)??"Account",onClick:()=>Vt(u=>!u),style:{width:40,height:40,borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",background:mt?"var(--t-sidebar-hover)":"transparent",border:mt?"1px solid var(--t-border-default)":"1px solid transparent",cursor:"pointer",color:mt?"var(--t-text-primary)":"var(--t-text-muted)",transition:"all 0.12s",padding:0},onMouseEnter:u=>{mt||(u.currentTarget.style.background="var(--t-sidebar-hover)",u.currentTarget.style.color="var(--t-text-secondary)")},onMouseLeave:u=>{mt||(u.currentTarget.style.background="transparent",u.currentTarget.style.color="#666")},children:V!=null&&V.name?s.jsx("div",{style:{width:26,height:26,borderRadius:"50%",background:"var(--t-bg-surface)",border:"1px solid var(--t-border-default)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"var(--t-text-xs)",fontWeight:700,color:"var(--t-text-primary)",letterSpacing:"-0.02em"},children:V.name.charAt(0).toUpperCase()}):s.jsx(In,{size:22})}),mt&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{position:"fixed",inset:0,zIndex:199},onClick:()=>Vt(!1)}),s.jsxs("div",{style:{position:"absolute",bottom:48,left:0,zIndex:200,background:"var(--t-bg-panel)",border:"1px solid var(--t-border-default)",borderRadius:10,padding:"6px 0",minWidth:200,boxShadow:"0 8px 24px rgba(0,0,0,0.5)"},children:[s.jsxs("div",{style:{padding:"8px 14px 10px",borderBottom:"1px solid var(--t-border-subtle)",marginBottom:4},children:[s.jsx("div",{style:{fontSize:"var(--t-text-base)",fontWeight:600,color:"var(--t-text-primary)"},children:(V==null?void 0:V.name)??"—"}),s.jsx("div",{style:{fontSize:"var(--t-text-xs)",color:"var(--t-text-muted)",marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:V==null?void 0:V.email}),(V==null?void 0:V.globalRole)==="super_admin"&&s.jsx("span",{style:{display:"inline-flex",marginTop:6,fontSize:10,fontWeight:600,color:"var(--t-text-secondary)",background:"var(--t-bg-surface)",border:"1px solid rgba(0,112,243,0.25)",borderRadius:5,padding:"1px 7px",letterSpacing:"0.04em",textTransform:"uppercase"},children:"Super Admin"})]}),s.jsx(Ys,{icon:s.jsx(Dn,{size:13}),label:"Change password",onClick:()=>{Vt(!1),h({type:"settings",appId:(t==null?void 0:t.id)??0})}}),s.jsx("div",{style:{height:1,background:"var(--t-border-subtle)",margin:"4px 0"}}),s.jsx(Ys,{icon:s.jsx(Nn,{size:13}),label:"Sign out",danger:!0,onClick:()=>{Vt(!1),qr()}})]})]})]})]}),G!=="apps"&&G!=="trash"&&G!=="admin-settings"&&s.jsxs("div",{style:{width:G==="ai"||G==="reports"||G==="settings"?240:400,flexShrink:0,background:"var(--t-bg-surface)",borderRight:"1px solid var(--t-border-subtle)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[G==="ai"&&s.jsx("div",{style:{flex:1,overflowY:"auto",paddingBottom:8},children:t?Kr?s.jsxs(s.Fragment,{children:[s.jsx(Le,{label:t.name}),Array.from({length:3}).map((u,x)=>s.jsx(Pt,{i:x},x))]}):s.jsxs(s.Fragment,{children:[s.jsx(Le,{label:t.name}),[{section:"chat",label:"Chat",icon:sr,adminOnly:!1},{section:"tickets",label:"Tickets",icon:rr,adminOnly:!1},{section:"repos",label:"Repo Management",icon:nr,adminOnly:!1},{section:"commands",label:"Custom Commands",icon:or,adminOnly:!0},{section:"settings",label:"Settings",icon:ar,adminOnly:!0}].filter(({adminOnly:u})=>u?nt||(V==null?void 0:V.globalRole)==="super_admin":!0).map(({section:u,label:x,icon:P})=>{const X=(p.type==="ai"?p.section??"chat":"chat")===u;return s.jsx(Ze,{icon:s.jsx(P,{size:20,weight:X?"fill":"regular"}),label:x,active:X,onClick:()=>h({type:"ai",appId:t.id,section:u})},u)})]}):s.jsx("p",{style:{fontSize:"var(--t-text-sm)",color:"var(--t-text-muted)",padding:"10px 14px",fontStyle:"italic"},children:"Select an app first"})}),G==="reports"&&s.jsx("div",{style:{flex:1,overflowY:"auto",paddingBottom:8},children:t?s.jsxs(s.Fragment,{children:[s.jsx(Le,{label:t.name}),[{section:"analysis",label:"Analysis",icon:at},{section:"test-plan",label:"Test Plans",icon:vs},{section:"test-report",label:"Test Reports",icon:Cs}].map(({section:u,label:x,icon:P})=>{const X=(p.type==="reports"?p.section??"analysis":p.type==="plan-detail"?"test-plan":"analysis")===u;return s.jsx(Ze,{icon:s.jsx(P,{size:20,weight:X?"fill":"regular"}),label:x,active:X,onClick:()=>h({type:"reports",appId:t.id,section:u})},u)})]}):s.jsx("p",{style:{fontSize:"var(--t-text-sm)",color:"var(--t-text-muted)",padding:"10px 14px",fontStyle:"italic"},children:"Select an app first"})}),G==="settings"&&s.jsx("div",{style:{flex:1,overflowY:"auto",paddingBottom:8},children:t?s.jsxs(s.Fragment,{children:[s.jsx(Le,{label:t.name}),s.jsx(Ze,{icon:s.jsx(Ls,{size:20,weight:p.type==="settings"&&(p.section==="tests"||!p.section)?"fill":"regular"}),label:"Tests",active:p.type==="settings"&&(p.section==="tests"||!p.section),onClick:()=>h({type:"settings",appId:t.id,section:"tests"})}),nt&&s.jsx(Ze,{icon:s.jsx(ns,{size:20,weight:p.type==="settings"&&p.section==="members"?"fill":"regular"}),label:"Members",active:p.type==="settings"&&p.section==="members",onClick:()=>h({type:"settings",appId:t.id,section:"members"})})]}):s.jsx("p",{style:{fontSize:"var(--t-text-sm)",color:"var(--t-text-muted)",padding:"10px 14px",fontStyle:"italic"},children:"Select an app first"})}),G==="users"&&s.jsxs("div",{style:{flex:1,overflowY:"auto",paddingBottom:8},children:[s.jsx(Le,{label:"User Management"}),s.jsx(Ze,{icon:s.jsx(ns,{size:20,weight:p.type==="users"&&(p.section==="users"||!p.section)?"fill":"regular"}),label:"Users",active:p.type==="users"&&(p.section==="users"||!p.section),onClick:()=>h({type:"users",section:"users"})}),s.jsx(Ze,{icon:s.jsx(ys,{size:20,weight:p.type==="users"&&p.section==="user-groups"?"fill":"regular"}),label:"User Groups",active:p.type==="users"&&p.section==="user-groups",onClick:()=>h({type:"users",section:"user-groups"})})]}),G==="runs"&&(t?s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{flexShrink:0},children:[s.jsx(Le,{label:"Runs",onAdd:Re?()=>{ie(""),O(""),A(!0)}:void 0}),s.jsx(rs,{value:Ht,onChange:Zr,placeholder:"Search runs…"})]}),s.jsxs("div",{style:{flex:1,overflowY:"auto",paddingBottom:8},children:[d?Array.from({length:4}).map((u,x)=>s.jsx(Pt,{i:x},x)):i.length===0&&s.jsx("p",{style:{fontSize:"var(--t-text-xs)",color:"var(--t-text-muted)",padding:"6px 14px",fontStyle:"italic"},children:"No runs yet"}),(()=>{const u=Ht.trim()?i.filter(x=>x.name.toLowerCase().includes(Ht.toLowerCase())):i;return i.length>0&&u.length===0?s.jsxs("p",{style:{fontSize:"var(--t-text-xs)",color:"var(--t-text-muted)",padding:"6px 14px",fontStyle:"italic"},children:["No runs match “",Ht,"”"]}):u.map(x=>{const P=p.type==="run-execution"&&p.runId===x.id,ee=x.status==="passed"?"#3fb950":x.status==="failed"?"#f85149":x.status==="running"?"#d29922":"var(--t-text-muted)",X=[t.name,x.testCount!=null?`${x.testCount} test${x.testCount!==1?"s":""}`:null].filter(Boolean).join(" · ");return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 4px 6px 12px",borderRadius:6,margin:"1px 6px",cursor:"pointer",background:P||Z===x.id?"var(--t-sidebar-hover)":"transparent",userSelect:"none"},onMouseEnter:()=>Ye(x.id),onMouseLeave:()=>Ye(null),onClick:()=>h({type:"run-execution",appId:t.id,runId:x.id}),children:[s.jsx(os,{size:17,weight:"fill",color:ee,style:{flexShrink:0,alignSelf:"center"}}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("div",{style:{fontSize:"var(--t-text-sm)",color:P?"var(--t-text-primary)":"var(--t-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:P?500:400},children:x.name}),s.jsx("div",{style:{fontSize:"var(--t-text-2xs)",color:"var(--t-text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:1},children:X})]}),s.jsx("span",{style:{fontSize:10,color:ee,background:"var(--t-bg-elevated)",border:"1px solid var(--t-border-default)",borderRadius:4,padding:"1px 4px",textTransform:"uppercase",flexShrink:0},children:x.status}),(Re||nt)&&s.jsx("div",{onClick:be=>be.stopPropagation(),children:s.jsx(At,{size:24,alwaysVisible:Z===x.id,items:[...Re?[{label:"Duplicate run",icon:s.jsx(Ss,{size:13}),action:()=>M(x.id)}]:[],...nt?[{label:"Delete run",icon:s.jsx(it,{size:13}),action:()=>R({kind:"run",id:x.id,name:x.name}),destructive:!0,separator:Re}]:[]]})})]},x.id)})})()]})]}):s.jsx("div",{style:{flex:1,overflowY:"auto",paddingBottom:8},children:s.jsx("p",{style:{fontSize:"var(--t-text-sm)",color:"var(--t-text-muted)",padding:"10px 14px",fontStyle:"italic"},children:"Select an app first"})})),G==="milestones"&&(t?s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{flexShrink:0},children:[s.jsx(Le,{label:"Milestones",onAdd:Re?()=>{pe(""),Se(!0)}:void 0}),s.jsx(rs,{value:ct,onChange:ds,placeholder:"Search milestones…"})]}),s.jsxs("div",{style:{flex:1,overflowY:"auto",paddingBottom:8},children:[f?Array.from({length:3}).map((u,x)=>s.jsx(Pt,{i:x},x)):c.length===0&&s.jsx("p",{style:{fontSize:"var(--t-text-xs)",color:"var(--t-text-muted)",padding:"6px 14px",fontStyle:"italic"},children:"No milestones yet"}),(()=>{const u=ct.trim()?c.filter(x=>x.name.toLowerCase().includes(ct.toLowerCase())):c;return c.length>0&&u.length===0?s.jsxs("p",{style:{fontSize:"var(--t-text-xs)",color:"var(--t-text-muted)",padding:"6px 14px",fontStyle:"italic"},children:["No milestones match “",ct,"”"]}):u.map(x=>{const P=p.type==="milestone-detail"&&p.milestoneId===x.id,ee=x.status==="completed"?"#22c55e":x.status==="in_progress"?"#d97706":x.status==="archived"?"#94a3b8":"var(--t-text-muted)";return s.jsxs("div",{onMouseEnter:()=>kt(x.id),onMouseLeave:()=>kt(null),onClick:()=>h({type:"milestone-detail",appId:t.id,milestoneId:x.id}),style:{display:"flex",alignItems:"center",gap:8,padding:"6px 4px 6px 12px",borderRadius:6,margin:"1px 6px",cursor:"pointer",background:P||Bt===x.id?"var(--t-sidebar-hover)":"transparent"},children:[s.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:ee,flexShrink:0}}),s.jsx("div",{style:{flex:1,overflow:"hidden",minWidth:0},children:s.jsx("div",{style:{fontSize:"var(--t-text-sm)",fontWeight:P?600:400,color:"var(--t-text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.name})}),nt&&s.jsx("div",{onClick:X=>X.stopPropagation(),children:s.jsx(At,{size:24,alwaysVisible:Bt===x.id,items:[{label:"Delete milestone",icon:s.jsx(it,{size:13}),action:()=>R({kind:"milestone",id:x.id,name:x.name}),destructive:!0}]})})]},x.id)})})()]})]}):s.jsx("div",{style:{flex:1,overflowY:"auto",paddingBottom:8},children:s.jsx("p",{style:{fontSize:"var(--t-text-sm)",color:"var(--t-text-muted)",padding:"10px 14px",fontStyle:"italic"},children:"Select an app first"})})),G==="nav"&&fs==="apps"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{flexShrink:0},children:s.jsx(Le,{label:"Apps",onAdd:(V==null?void 0:V.globalRole)==="super_admin"?()=>{Ke(""),Ct(""),g(!0)}:void 0})}),s.jsx("div",{style:{flex:1,overflowY:"auto",paddingBottom:8},children:e.length===0?s.jsx("p",{style:{fontSize:"var(--t-text-sm)",color:"var(--t-text-muted)",padding:"6px 14px",fontStyle:"italic"},children:"No apps yet"}):e.map(u=>s.jsx(Ze,{icon:s.jsx(Dt,{size:20,weight:(t==null?void 0:t.id)===u.id?"fill":"regular"}),label:u.name,active:(t==null?void 0:t.id)===u.id,chevron:!0,onClick:()=>h({type:"ai",appId:u.id}),onRename:(V==null?void 0:V.globalRole)==="super_admin"?()=>Sn(u.id,u.name,u.description??null):void 0,onDelete:(V==null?void 0:V.globalRole)==="super_admin"?()=>R({kind:"app",id:u.id,name:u.name}):void 0},u.id))})]}),G==="nav"&&fs==="spaces"&&t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{flexShrink:0},children:[s.jsx(Le,{label:"Spaces",onAdd:Re?()=>{rt(""),Rt(""),F(!0)}:void 0}),s.jsx(rs,{value:Ut,onChange:Qr,placeholder:"Search spaces…"})]}),s.jsx("div",{style:{flex:1,overflowY:"auto",paddingBottom:8},children:n?Array.from({length:4}).map((u,x)=>s.jsx(Pt,{i:x},x)):r.length===0?s.jsx("p",{style:{fontSize:"var(--t-text-sm)",color:"var(--t-text-muted)",padding:"6px 14px",fontStyle:"italic"},children:"No spaces yet"}):(()=>{const u=Ut.trim()?r.filter(x=>x.name.toLowerCase().includes(Ut.toLowerCase())):r;return u.length===0?s.jsxs("p",{style:{fontSize:"var(--t-text-sm)",color:"var(--t-text-muted)",padding:"6px 14px",fontStyle:"italic"},children:["No spaces match “",Ut,"”"]}):u.map(x=>{const P=[];return(x.folderCount??0)>0&&P.push(`${x.folderCount} folder${x.folderCount!==1?"s":""}`),(x.testCount??0)>0&&P.push(`${x.testCount} test${x.testCount!==1?"s":""}`),s.jsx(Ze,{icon:s.jsx(ir,{size:20,weight:ge===x.id?"fill":"regular"}),label:x.name,subtitle:P.length>0?P.join(" · "):void 0,active:ge===x.id,chevron:!0,onClick:()=>h({type:"tests",appId:t.id,spaceId:x.id}),onRename:Re?()=>jn(x.id,x.name,x.description??null):void 0,onDelete:nt?()=>R({kind:"space",id:x.id,name:x.name}):void 0},x.id)})})()})]}),G==="nav"&&fs==="folders"&&t&&Xt&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{flexShrink:0},children:[s.jsx(Le,{label:"Folders",onAdd:Re?()=>{W(""),Y(void 0),_(!0)}:void 0,extraActions:Be.length>0?s.jsx(Vr,{title:de.size===0?"Collapse all folders":"Expand all folders",onClick:de.size===0?gn:mn,children:de.size===0?s.jsx(Ln,{size:11}):s.jsx(An,{size:11})}):void 0}),s.jsx(rs,{value:ht,onChange:Xr,placeholder:"Search folders…"})]}),s.jsx("div",{style:{flex:1,overflowY:"auto",paddingBottom:8},children:rn?Array.from({length:6}).map((u,x)=>s.jsx(Pt,{i:x},x)):Be.length===0?s.jsx("p",{style:{fontSize:"var(--t-text-sm)",color:"var(--t-text-muted)",padding:"6px 14px",fontStyle:"italic"},children:"No folders yet"}):ht.trim()?Is.length===0?s.jsxs("p",{style:{fontSize:"var(--t-text-sm)",color:"var(--t-text-muted)",padding:"6px 14px",fontStyle:"italic"},children:["No folders match “",ht,"”"]}):Is.map(({node:u,path:x})=>s.jsxs("div",{onClick:()=>h({type:"tests",appId:t.id,spaceId:Xt.id,folderId:u.id}),style:{display:"flex",alignItems:"center",gap:7,padding:"5px 12px",margin:"1px 6px",borderRadius:6,cursor:"pointer",background:"folderId"in p&&p.folderId===u.id?"var(--t-sidebar-hover)":"transparent"},onMouseEnter:P=>{P.currentTarget.style.background="var(--t-sidebar-hover)"},onMouseLeave:P=>{P.currentTarget.style.background="folderId"in p&&p.folderId===u.id?"var(--t-sidebar-hover)":"transparent"},children:[s.jsx(Rs,{size:14,style:{color:"var(--t-text-muted)",flexShrink:0}}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("div",{style:{fontSize:"var(--t-text-sm)",color:"var(--t-text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.name}),x!==u.name&&s.jsx("div",{style:{fontSize:"var(--t-text-2xs)",color:"var(--t-text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:1},children:x})]})]},u.id)):s.jsx(Wr,{nodes:Be,spaceId:Xt.id,appId:t.id,depth:0,view:p,collapsedIds:de,onNavigate:h,onAddSubfolder:Re?bn:void 0,onDeleteFolder:nt?(u,x)=>R({kind:"folder",id:u,name:x}):void 0,onRenameFolder:Re?(u,x)=>{const P=Be.flatMap(function ee(X){return[X,...X.children.flatMap(ee)]}).find(ee=>ee.id===u);wn(u,x,P==null?void 0:P.description)}:void 0,onToggleCollapse:pn,onCopyFolder:an,onCutFolder:ln,onDuplicateFolder:dn,onPasteFolder:cn,clipboardFolderActive:ms,invalidPasteFolderIds:un})})]})]}),s.jsx(Ae,{open:v,onOpenChange:g,children:s.jsxs(Me,{children:[s.jsx(_e,{children:s.jsx(Fe,{children:"Create App"})}),s.jsxs("form",{onSubmit:hn,style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs(B,{children:["Name ",s.jsx("span",{style:{color:"var(--t-accent-danger, #e5484d)"},children:"*"})]}),s.jsx(q,{value:le,onChange:u=>Ke(u.target.value),placeholder:"My Application",autoFocus:!0})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Description"}),s.jsx(q,{value:ut,onChange:u=>Ct(u.target.value),placeholder:"Optional"})]}),s.jsxs(Je,{style:{marginTop:8},children:[s.jsx(K,{type:"button",variant:"outline",onClick:()=>g(!1),children:"Cancel"}),s.jsxs(K,{type:"submit",disabled:fe,children:[s.jsx(xe,{size:13})," ",fe?"Creating…":"Create"]})]})]})]})}),s.jsx(Ae,{open:T,onOpenChange:F,children:s.jsxs(Me,{children:[s.jsx(_e,{children:s.jsx(Fe,{children:"Create Space"})}),s.jsxs("form",{onSubmit:xn,style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs(B,{children:["Name ",s.jsx("span",{style:{color:"var(--t-accent-danger, #e5484d)"},children:"*"})]}),s.jsx(q,{value:pt,onChange:u=>rt(u.target.value),placeholder:"e.g. Web App",autoFocus:!0})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Description"}),s.jsx(q,{value:Ie,onChange:u=>Rt(u.target.value),placeholder:"Optional"})]}),s.jsxs(Je,{style:{marginTop:8},children:[s.jsx(K,{type:"button",variant:"outline",onClick:()=>F(!1),children:"Cancel"}),s.jsxs(K,{type:"submit",disabled:fe,children:[s.jsx(xe,{size:13})," ",fe?"Creating…":"Create"]})]})]})]})}),s.jsx(Ae,{open:N,onOpenChange:u=>{u||(W(""),Et("")),_(u)},children:s.jsxs(Me,{children:[s.jsx(_e,{children:s.jsx(Fe,{children:D!==void 0?"Create Subfolder":"Create Folder"})}),s.jsxs("form",{onSubmit:yn,style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs(B,{children:["Name ",s.jsx("span",{style:{color:"var(--t-accent-danger, #e5484d)"},children:"*"})]}),s.jsx(q,{value:ft,onChange:u=>W(u.target.value),placeholder:"e.g. Login flows",autoFocus:!0})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Description"}),s.jsx(q,{value:Tt,onChange:u=>Et(u.target.value),placeholder:"Optional"})]}),s.jsxs(Je,{style:{marginTop:8},children:[s.jsx(K,{type:"button",variant:"outline",onClick:()=>_(!1),children:"Cancel"}),s.jsxs(K,{type:"submit",disabled:fe,children:[s.jsx(xe,{size:13})," ",fe?"Creating…":"Create"]})]})]})]})}),s.jsx(Ae,{open:se,onOpenChange:A,children:s.jsxs(Me,{className:"max-w-125",children:[s.jsx(_e,{children:s.jsx(Fe,{children:"New Run"})}),s.jsxs("form",{onSubmit:async u=>{if(u.preventDefault(),!!Q.trim()){me(!0);try{const x=await k({name:Q.trim(),environment:$e.trim()||void 0,jiraIssueKey:st.trim()||void 0,referenceDoc:He.trim()||void 0,assigneeId:oe||void 0,milestoneId:Pe??void 0});ie(""),O(""),Ue(""),ze(""),re(null),ke(null),A(!1),x&&t&&h({type:"run-execution",appId:t.id,runId:x.id})}finally{me(!1)}}},style:{display:"flex",flexDirection:"column",gap:14,marginTop:8},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs(B,{children:["Name ",s.jsx("span",{style:{color:"var(--t-accent-danger, #e5484d)"},children:"*"})]}),s.jsx(q,{value:Q,onChange:u=>ie(u.target.value),placeholder:"e.g. Sprint 12 Smoke",autoFocus:!0})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Environment"}),s.jsxs("div",{style:{position:"relative"},children:[s.jsx(q,{value:$e,onChange:u=>O(u.target.value),placeholder:"e.g. Staging",list:"run-env-opts-sidebar"}),s.jsxs("datalist",{id:"run-env-opts-sidebar",children:[s.jsx("option",{value:"Development"}),s.jsx("option",{value:"Staging"}),s.jsx("option",{value:"Production"}),s.jsx("option",{value:"QA"}),s.jsx("option",{value:"UAT"}),s.jsx("option",{value:"Pre-production"}),s.jsx("option",{value:"Local"})]})]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Milestone"}),s.jsxs("select",{value:Pe??"",onChange:u=>ke(u.target.value?Number(u.target.value):null),style:{height:36,padding:"0 8px",borderRadius:6,border:"1px solid var(--t-border-default)",background:"var(--t-bg-surface)",color:Pe?"var(--t-text-primary)":"var(--t-text-muted)",fontSize:"var(--t-text-base)",outline:"none",cursor:"pointer"},children:[s.jsx("option",{value:"",children:"None"}),c.map(u=>s.jsx("option",{value:u.id,children:u.name},u.id))]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Jira Issue Key"}),s.jsx(q,{value:st,onChange:u=>Ue(u.target.value),placeholder:"e.g. PROJ-123"})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Reference Document"}),s.jsx(q,{value:He,onChange:u=>ze(u.target.value),placeholder:"Confluence URL"})]}),t&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Assignee"}),s.jsx(ks,{appId:t.id,value:oe,onChange:re})]}),s.jsxs(Je,{style:{marginTop:4},children:[s.jsx(K,{type:"button",variant:"outline",onClick:()=>A(!1),children:"Cancel"}),s.jsxs(K,{type:"submit",disabled:fe||!Q.trim(),children:[s.jsx(xe,{size:13})," ",fe?"Creating…":"Create"]})]})]})]})}),s.jsx(Ae,{open:qe,onOpenChange:u=>{u||(pe(""),vt(""),St("open"),jt(""),wt(""),$t(null)),Se(u)},children:s.jsxs(Me,{className:"max-w-125",children:[s.jsx(_e,{children:s.jsx(Fe,{children:"New Milestone"})}),s.jsxs("form",{onSubmit:async u=>{if(u.preventDefault(),!!Oe.trim()){me(!0);try{const x=await m({name:Oe.trim(),description:dt.trim()||void 0,status:Mt,jiraIssueKey:_t.trim()||void 0,referenceDoc:Ft.trim()||void 0,assigneeId:Jt||void 0});pe(""),vt(""),St("open"),jt(""),wt(""),$t(null),Se(!1),x&&t&&h({type:"milestone-detail",appId:t.id,milestoneId:x.id})}finally{me(!1)}}},style:{display:"flex",flexDirection:"column",gap:14,marginTop:8},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs(B,{children:["Name ",s.jsx("span",{style:{color:"var(--t-accent-danger, #e5484d)"},children:"*"})]}),s.jsx(q,{value:Oe,onChange:u=>pe(u.target.value),placeholder:"e.g. v2.0 Release",autoFocus:!0})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Description"}),s.jsx("textarea",{value:dt,onChange:u=>vt(u.target.value),placeholder:"What's included in this milestone?",rows:3,style:{padding:"8px 10px",borderRadius:6,border:"1px solid var(--t-border-default)",background:"var(--t-bg-surface)",color:"var(--t-text-primary)",fontSize:"var(--t-text-base)",outline:"none",width:"100%",boxSizing:"border-box",resize:"vertical",fontFamily:"inherit",lineHeight:"1.5"}})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Status"}),s.jsxs("select",{value:Mt,onChange:u=>St(u.target.value),style:{height:36,padding:"0 8px",borderRadius:6,border:"1px solid var(--t-border-default)",background:"var(--t-bg-surface)",color:"var(--t-text-primary)",fontSize:"var(--t-text-base)",outline:"none",cursor:"pointer"},children:[s.jsx("option",{value:"open",children:"Open"}),s.jsx("option",{value:"in_progress",children:"In Progress"}),s.jsx("option",{value:"completed",children:"Completed"}),s.jsx("option",{value:"archived",children:"Archived"})]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Jira Issue Key"}),s.jsx(q,{value:_t,onChange:u=>jt(u.target.value),placeholder:"e.g. PROJ-123"})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Reference Document"}),s.jsx(q,{value:Ft,onChange:u=>wt(u.target.value),placeholder:"Confluence URL"})]}),t&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Assignee"}),s.jsx(ks,{appId:t.id,value:Jt,onChange:$t})]}),s.jsxs(Je,{style:{marginTop:4},children:[s.jsx(K,{type:"button",variant:"outline",onClick:()=>Se(!1),children:"Cancel"}),s.jsxs(K,{type:"submit",disabled:fe||!Oe.trim(),children:[s.jsx(xe,{size:13})," ",fe?"Creating…":"Create"]})]})]})]})}),s.jsx(Fr,{open:$!==null,title:`Delete ${($==null?void 0:$.kind)??""}`,description:($==null?void 0:$.kind)==="app"?`"${$.name}" and all its spaces, folders, and tests will be permanently deleted.`:($==null?void 0:$.kind)==="space"?`"${$==null?void 0:$.name}" and all its folders and tests will be permanently deleted.`:($==null?void 0:$.kind)==="run"?`"${$==null?void 0:$.name}" and all its test results will be permanently deleted.`:($==null?void 0:$.kind)==="milestone"?`"${$==null?void 0:$.name}" will be permanently deleted. Linked runs will be unlinked.`:`"${$==null?void 0:$.name}" and all its tests will be permanently deleted.`,confirmLabel:($==null?void 0:$.kind)==="app"?"Delete App":($==null?void 0:$.kind)==="space"?"Delete Space":($==null?void 0:$.kind)==="run"?"Delete Run":($==null?void 0:$.kind)==="milestone"?"Delete Milestone":"Delete Folder",onConfirm:vn,onCancel:()=>R(null)}),s.jsx(Ae,{open:U!==null,onOpenChange:u=>{u||gt(null)},children:s.jsxs(Me,{children:[s.jsx(_e,{children:s.jsxs(Fe,{children:["Rename"," ",(U==null?void 0:U.kind)==="app"?"App":(U==null?void 0:U.kind)==="space"?"Space":"Folder"]})}),s.jsxs("form",{onSubmit:$n,style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs(B,{children:["Name ",s.jsx("span",{style:{color:"var(--t-accent-danger, #e5484d)"},children:"*"})]}),s.jsx(q,{value:zt,onChange:u=>Wt(u.target.value),placeholder:U==null?void 0:U.currentName,autoFocus:!0})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Description"}),s.jsx(q,{value:cs,onChange:u=>Gt(u.target.value),placeholder:"Optional description"})]}),(U==null?void 0:U.kind)==="space"&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[s.jsx(Zs,{size:13,style:{color:"var(--t-text-muted)"}}),s.jsx(B,{style:{margin:0},children:"Space Tags"})]}),Yt.length>0&&s.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:Yt.map(u=>s.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:3},children:[s.jsx(Mr,{name:u.name,color:u.color,size:"sm"}),s.jsx("button",{type:"button",title:"Remove tag",onClick:async()=>{U&&(await I.spaceTags.delete(U.id,u.id).catch(()=>{}),qt(x=>x.filter(P=>P.id!==u.id)))},style:{background:"none",border:"none",cursor:"pointer",color:"var(--t-text-muted)",padding:2,display:"flex",borderRadius:3,lineHeight:1},onMouseEnter:x=>{x.currentTarget.style.color="var(--t-accent-danger)"},onMouseLeave:x=>{x.currentTarget.style.color="var(--t-text-muted)"},children:s.jsx(is,{size:9,weight:"bold"})})]},u.id))}),s.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[s.jsx("input",{type:"color",value:us,onChange:u=>sn(u.target.value),title:"Tag color",style:{width:30,height:30,padding:2,borderRadius:6,border:"1px solid var(--t-border-default)",background:"var(--t-bg-elevated)",cursor:"pointer",flexShrink:0}}),s.jsx(q,{value:xt,onChange:u=>{Kt(u.target.value),Qe("")},onKeyDown:async u=>{if(u.key!=="Enter"||(u.preventDefault(),!xt.trim()||!U||ps))return;const x=xt.trim();if(Yt.some(P=>P.name.toLowerCase()===x.toLowerCase())){Qe("A tag with this name already exists in this space");return}Qt(!0),Qe("");try{const P=await I.spaceTags.create(U.id,{name:x,color:us});qt(ee=>ee.some(X=>X.id===P.id)?ee:[...ee,P]),Kt("")}catch(P){Qe(P.message)}finally{Qt(!1)}},placeholder:"Tag name… (Enter to add)",style:{flex:1,fontSize:"var(--t-text-sm)"}}),s.jsxs(K,{type:"button",size:"sm",variant:"outline",disabled:!xt.trim()||ps,onClick:async()=>{if(!xt.trim()||!U||ps)return;const u=xt.trim();if(Yt.some(x=>x.name.toLowerCase()===u.toLowerCase())){Qe("A tag with this name already exists in this space");return}Qt(!0),Qe("");try{const x=await I.spaceTags.create(U.id,{name:u,color:us});qt(P=>P.some(ee=>ee.id===x.id)?P:[...P,x]),Kt("")}catch(x){Qe(x.message)}finally{Qt(!1)}},style:{gap:4,flexShrink:0},children:[s.jsx(xe,{size:12})," Add"]})]}),Os&&s.jsx("p",{style:{margin:0,fontSize:"var(--t-text-xs)",color:"var(--t-accent-danger)"},children:Os}),en.length>0&&s.jsx("p",{style:{margin:0,fontSize:"var(--t-text-xs)",color:"var(--t-text-muted)"},children:"Global tags are available in all spaces automatically. Space tags cannot share a name with a global tag."})]}),s.jsxs(Je,{style:{marginTop:8},children:[s.jsx(K,{type:"button",variant:"outline",onClick:()=>gt(null),children:"Cancel"}),s.jsxs(K,{type:"submit",disabled:fe||!zt.trim()||zt.trim()===(U==null?void 0:U.currentName)&&cs.trim()===((U==null?void 0:U.currentDescription)??""),children:[s.jsx(ls,{size:13})," ",fe?"Saving…":"Rename"]})]})]})]})}),!1,!1]})}function ca({open:e,onOpenChange:t,onAdd:r}){const[n,i]=l.useState(""),[d,c]=l.useState(""),[f,m]=l.useState(!1),[y,p]=l.useState(""),h=async j=>{if(j.preventDefault(),!n.trim()){p("Name is required");return}m(!0),p("");try{await r({name:n.trim(),description:d.trim()||void 0}),i(""),c(""),t(!1)}catch(b){p(b instanceof Error?b.message:"Failed")}finally{m(!1)}};return s.jsx(Ae,{open:e,onOpenChange:t,children:s.jsxs(Me,{children:[s.jsxs(_e,{children:[s.jsx(Fe,{children:"Create App"}),s.jsx(_r,{children:"Apps are top-level containers for your test spaces and runs."})]}),s.jsxs("form",{onSubmit:h,className:"flex flex-col gap-4 mt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs(B,{htmlFor:"new-app-name",children:["Name ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(q,{id:"new-app-name",value:n,onChange:j=>i(j.target.value),placeholder:"My Application",autoFocus:!0})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(B,{htmlFor:"new-app-desc",children:"Description"}),s.jsx(q,{id:"new-app-desc",value:d,onChange:j=>c(j.target.value),placeholder:"Optional description"})]}),y&&s.jsx("p",{className:"text-sm text-destructive",children:y}),s.jsxs(Je,{className:"mt-2",children:[s.jsx(K,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsxs(K,{type:"submit",disabled:f,children:[s.jsx(xe,{size:14}),f?"Creating…":"Create App"]})]})]})]})})}function ua({apps:e,loading:t,onNavigate:r,onAdd:n,onRename:i,onDelete:d}){const[c,f]=l.useState(!1),[m,y]=l.useState(null),[p,h]=l.useState(null),[j,b]=l.useState(""),[S,w]=l.useState(""),[k,C]=l.useState(!1),[M,H]=l.useState(null),te=L=>{h({id:L.id,name:L.name,description:L.description??null}),b(L.name),w(L.description??"")},ne=async L=>{if(L.preventDefault(),!(!p||!j.trim())){C(!0);try{await i(p.id,{name:j.trim(),description:S.trim()||void 0}),h(null)}finally{C(!1)}}};return s.jsxs("div",{className:"flex-1 overflow-y-auto",style:{background:"var(--t-bg-base)"},children:[s.jsxs("div",{style:{maxWidth:720,margin:"0 auto",padding:"48px 32px"},children:[s.jsxs("div",{className:"flex items-center justify-between mb-8",children:[s.jsxs("div",{children:[s.jsx("h1",{style:{fontSize:20,fontWeight:600,color:"var(--t-text-primary)",letterSpacing:"-0.02em",lineHeight:1.3},children:"Apps"}),s.jsx("p",{style:{fontSize:"var(--t-text-base)",color:"var(--t-text-muted)",marginTop:4},children:"Manage your top-level application containers."})]}),s.jsxs(K,{onClick:()=>f(!0),style:{gap:6},children:[s.jsx(xe,{size:14}),"New App"]})]}),t?s.jsx("div",{style:{border:"1px solid var(--t-border-subtle)",borderRadius:10,overflow:"hidden",background:"var(--t-bg-surface)"},children:Array.from({length:4}).map((L,v)=>s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"14px 18px",borderTop:v>0?"1px solid var(--t-border-subtle)":"none"},children:[s.jsx(ye,{width:36,height:36,borderRadius:10}),s.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:6},children:[s.jsx(ye,{height:13,width:`${35+v*20%30}%`,borderRadius:3}),s.jsx(ye,{height:10,width:`${20+v*13%25}%`,borderRadius:3})]}),s.jsx(ye,{width:16,height:16,borderRadius:3})]},v))}):e.length===0?s.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:20,padding:"80px 24px",textAlign:"center",border:"1px dashed var(--t-border-default)",borderRadius:12,background:"var(--t-bg-surface)"},children:[s.jsx("div",{style:{width:56,height:56,borderRadius:14,background:"var(--t-bg-panel)",border:"1px solid var(--t-border-default)",display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(Dt,{size:26,weight:"duotone",color:"var(--t-text-muted)"})}),s.jsxs("div",{children:[s.jsx("p",{style:{fontSize:"var(--t-text-xl)",fontWeight:500,color:"var(--t-text-primary)"},children:"No apps yet"}),s.jsx("p",{style:{fontSize:"var(--t-text-base)",color:"var(--t-text-muted)",marginTop:6},children:"Create your first app to get started with test management."})]}),s.jsxs(K,{onClick:()=>f(!0),variant:"outline",style:{gap:6},children:[s.jsx(xe,{size:14}),"Create App"]})]}):s.jsx("div",{style:{border:"1px solid var(--t-border-subtle)",borderRadius:10,overflow:"hidden",background:"var(--t-bg-surface)"},children:e.map((L,v)=>{const g=M===L.id;return s.jsxs("div",{onClick:()=>r({type:"ai",appId:L.id,section:"chat"}),style:{display:"flex",alignItems:"center",gap:14,padding:"14px 18px",cursor:"pointer",borderTop:v>0?"1px solid var(--t-border-subtle)":"none",background:g?"var(--t-bg-hover)":"transparent",transition:"background 0.1s"},onMouseEnter:()=>H(L.id),onMouseLeave:()=>H(null),children:[s.jsx("div",{style:{width:36,height:36,borderRadius:10,background:"var(--t-bg-panel)",border:"1px solid var(--t-border-default)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s.jsx(Dt,{size:16,weight:"duotone",color:"var(--t-text-muted)"})}),s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsx("p",{style:{fontSize:"var(--t-text-lg)",fontWeight:500,color:"var(--t-text-primary)"},children:L.name}),L.description&&s.jsx("p",{style:{fontSize:"var(--t-text-sm)",color:"var(--t-text-muted)",marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:L.description})]}),s.jsx("div",{onClick:T=>T.stopPropagation(),children:s.jsx(At,{alwaysVisible:g,items:[{label:"Rename",icon:s.jsx(ls,{size:13}),action:()=>te(L)},{label:"Delete",icon:s.jsx(it,{size:13}),action:()=>y({id:L.id,name:L.name}),destructive:!0,separator:!0}]})}),s.jsx(Fn,{size:14,color:"var(--t-text-secondary)",style:{opacity:g?1:0,transition:"opacity 0.15s",flexShrink:0}})]},L.id)})})]}),s.jsx(ca,{open:c,onOpenChange:f,onAdd:n}),s.jsx(Fr,{open:m!==null,title:"Delete app",description:`"${m==null?void 0:m.name}" and all its spaces, folders, tests, and runs will be permanently deleted.`,confirmLabel:"Delete App",onConfirm:async()=>{m&&(await d(m.id),y(null))},onCancel:()=>y(null)}),s.jsx(Ae,{open:p!==null,onOpenChange:L=>{L||h(null)},children:s.jsxs(Me,{children:[s.jsxs(_e,{children:[s.jsx(Fe,{children:"Rename App"}),s.jsx(_r,{children:"Update the name or description of this app."})]}),s.jsxs("form",{onSubmit:ne,className:"flex flex-col gap-4 mt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs(B,{htmlFor:"rename-app-name",children:["Name ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(q,{id:"rename-app-name",value:j,onChange:L=>b(L.target.value),placeholder:"App name",autoFocus:!0})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(B,{htmlFor:"rename-app-desc",children:"Description"}),s.jsx(q,{id:"rename-app-desc",value:S,onChange:L=>w(L.target.value),placeholder:"Optional description"})]}),s.jsxs(Je,{className:"mt-2",children:[s.jsx(K,{type:"button",variant:"outline",onClick:()=>h(null),children:"Cancel"}),s.jsx(K,{type:"submit",disabled:k||!j.trim(),children:k?"Saving…":"Save"})]})]})]})})]})}const pa="modulepreload",fa=function(e){return"/"+e},qs={},ce=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=Promise.allSettled(r.map(m=>{if(m=fa(m),m in qs)return;qs[m]=!0;const y=m.endsWith(".css"),p=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${p}`))return;const h=document.createElement("link");if(h.rel=y?"stylesheet":pa,y||(h.as="script"),h.crossOrigin="",h.href=m,f&&h.setAttribute("nonce",f),document.head.appendChild(h),y)return new Promise((j,b)=>{h.addEventListener("load",j),h.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${m}`)))})}))}function d(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return i.then(c=>{for(const f of c||[])f.status==="rejected"&&d(f.reason);return t().catch(d)})};function ue(e,t){return l.lazy(()=>e().then(r=>({default:r[t]})))}const ma=ue(()=>ce(()=>import("./AIView-BYoeRnLC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])),"AIView"),ga=ue(()=>ce(()=>import("./AdminSettingsView-JqCQI3K1.js"),__vite__mapDeps([9,1,2,8,10,5,6,4,7,3])),"AdminSettingsView"),ha=ue(()=>ce(()=>import("./SpaceView-BxtPCtW1.js"),__vite__mapDeps([11,1,2,8,10])),"SpaceView"),xa=ue(()=>ce(()=>import("./TestEditor-Dthst0HS.js"),__vite__mapDeps([12,1,2,6,8])),"TestEditor"),ya=ue(()=>ce(()=>import("./RunsView-oDa9JyRq.js"),__vite__mapDeps([13,1,2,8])),"RunsView"),ba=ue(()=>ce(()=>import("./RunExecution-BJnn0cq7.js"),__vite__mapDeps([14,1,2,8,5,6,10])),"RunExecution"),va=ue(()=>ce(()=>import("./MilestonesView-CTJ8r67W.js"),__vite__mapDeps([15,1,2,8])),"MilestonesView"),Sa=ue(()=>ce(()=>import("./MilestonesView-CTJ8r67W.js"),__vite__mapDeps([15,1,2,8])),"MilestoneDetailView"),ja=ue(()=>ce(()=>import("./SettingsView-BVCLWqOk.js"),__vite__mapDeps([16,1,2,8])),"SettingsView"),wa=ue(()=>ce(()=>import("./TrashView-B5uFN2Ua.js"),__vite__mapDeps([17,1,2,8])),"TrashView"),$a=ue(()=>ce(()=>import("./UsersView-DwWeOblN.js"),__vite__mapDeps([18,1,2,8])),"UsersView"),ka=ue(()=>ce(()=>import("./UserGroupsView-MGu6frpT.js"),__vite__mapDeps([19,1,2,8])),"UserGroupsView"),Ca=ue(()=>ce(()=>import("./TestMuImportDialog-B2yx7BdF.js"),__vite__mapDeps([20,1,8,2])),"TestMuImportDialog"),Ra=ue(()=>ce(()=>import("./ReportsView-DJ8KPr1J.js"),__vite__mapDeps([21,1,2,4,5,6,7,8])),"ReportsView"),Ta=ue(()=>ce(()=>import("./ReportsView-DJ8KPr1J.js"),__vite__mapDeps([21,1,2,4,5,6,7,8])),"AnalysisDetailView"),Ea=ue(()=>ce(()=>import("./ReportsView-DJ8KPr1J.js"),__vite__mapDeps([21,1,2,4,5,6,7,8])),"PlanDetailView"),We=new Map;function za(e){const t=e!==null?We.get(e)??null:null,[r,n]=l.useState(t??[]),[i,d]=l.useState(t===null&&e!==null),[c,f]=l.useState(null),m=l.useRef(0),y=l.useRef(null);if(y.current!==e){y.current=e,m.current++;const S=e!==null?We.get(e)??null:null;n(S??[]),d(S===null&&e!==null),f(null)}const p=l.useCallback(async()=>{if(e===null)return;const S=++m.current;We.has(e)||d(!0);try{f(null);const w=await I.spaces.list(e);if(m.current!==S)return;We.set(e,w),n(w)}catch(w){if(m.current!==S)return;f(w instanceof Error?w.message:"Failed to fetch spaces")}finally{m.current===S&&d(!1)}},[e]);l.useEffect(()=>{p()},[p]);const h=async S=>{if(e===null)return;const w=await I.spaces.create(e,S);return n(k=>{const C=[...k,w];return We.set(e,C),C}),w},j=async S=>{e!==null&&(await I.spaces.delete(e,S),n(w=>{const k=w.filter(C=>C.id!==S);return We.set(e,k),k}))},b=l.useCallback(async()=>{e!==null&&We.delete(e),await p()},[e,p]);return{spaces:r,loading:i,error:c,addSpace:h,removeSpace:j,refetch:b}}function Xa(){return We.size}function Za(){We.clear()}const Ge=new Map;function Pa(e){const t=e!==null?Ge.get(e)??null:null,[r,n]=l.useState(t??[]),[i,d]=l.useState(t===null&&e!==null),[c,f]=l.useState(null),m=l.useRef(0),y=l.useRef(null);if(y.current!==e){y.current=e,m.current++;const S=e!==null?Ge.get(e)??null:null;n(S??[]),d(S===null&&e!==null),f(null)}const p=l.useCallback(async()=>{if(e===null)return;const S=++m.current;Ge.has(e)||d(!0);try{f(null);const w=await I.runs.list(e);if(m.current!==S)return;Ge.set(e,w),n(w)}catch(w){if(m.current!==S)return;f(w instanceof Error?w.message:"Failed to fetch runs")}finally{m.current===S&&d(!1)}},[e]);l.useEffect(()=>{p()},[p]);const h=async S=>{if(e===null)return;const w=await I.runs.create(e,S);return n(k=>{const C=[...k,w];return Ge.set(e,C),C}),w},j=async S=>{e!==null&&(await I.runs.delete(e,S),n(w=>{const k=w.filter(C=>C.id!==S);return Ge.set(e,k),k}))},b=l.useCallback(async()=>{e!==null&&Ge.delete(e),await p()},[e,p]);return{runs:r,loading:i,error:c,createRun:h,removeRun:j,refetch:b}}function Oa(e){const t=e.map(r=>r.status);return t.some(r=>r==="fail")?"fail":t.some(r=>r==="blocked")?"blocked":!t.some(r=>r==="pending")&&t.some(r=>r==="pass")?"pass":"pending"}const he=new Map,we=new Map;function Ia(e,t){const r=e!==null&&t!==null?`${e}:${t}`:null,n=r?he.get(r)??null:null,i=r?we.get(r)??null:null,[d,c]=l.useState(n??[]),[f,m]=l.useState(i??null),[y,p]=l.useState(n===null&&r!==null),h=l.useRef(0),j=l.useRef(null);if(j.current!==r){j.current=r,h.current++;const g=r?he.get(r)??null:null,T=r?we.get(r)??null:null;c(g??[]),m(T??null),p(g===null&&r!==null)}const b=l.useCallback(async()=>{if(e===null||t===null||!r)return;const g=++h.current;he.has(r)||p(!0);try{const[T,F]=await Promise.all([I.runs.results(e,t),I.runs.report(e,t)]);if(h.current!==g)return;he.set(r,T),F&&we.set(r,F),c(T),m(F)}finally{h.current===g&&p(!1)}},[e,t,r]);l.useEffect(()=>{b()},[b]);const S=(g,T,F)=>{if(!g)return g;const N={...g.summary};return N[T]=Math.max(0,(N[T]??0)-1),N[F]=(N[F]??0)+1,N.passRate=g.summary.total>0?Math.round(N.pass/g.summary.total*100):0,{...g,summary:N}},w=async(g,T,F)=>{if(e===null||t===null)return;const N=d,_=f,D=d.find(A=>A.id===g),Y=d.map(A=>{if(A.id!==g)return A;const Q=F!=null&&F.propagateToSteps?A.stepResults.map(ie=>({...ie,status:T})):A.stepResults;return{...A,status:T,stepResults:Q}}),se=D?S(_,D.status,T):_;c(Y),m(se),r&&(he.set(r,Y),se&&we.set(r,se));try{await I.runs.markResult(e,t,g,{status:T,...F})}catch{c(N),m(_),r&&(he.set(r,N),_&&we.set(r,_))}},k=async(g,T,F)=>{if(e===null||t===null)return;const N=d,_=f,D=d.map(Q=>{if(Q.id!==g)return Q;const ie=Q.stepResults.map(O=>O.id===T?{...O,status:F}:O),$e=Oa(ie);return{...Q,status:$e,stepResults:ie}}),Y=d.find(Q=>Q.id===g),se=D.find(Q=>Q.id===g),A=Y&&se&&Y.status!==se.status?S(_,Y.status,se.status):_;c(D),m(A),r&&(he.set(r,D),A&&we.set(r,A));try{await I.runs.markStep(e,t,g,T,{status:F})}catch{c(N),m(_),r&&(he.set(r,N),_&&we.set(r,_))}},C=async(g,T,F)=>{if(e===null||t===null)return;const N=new Set(g),_=d,D=f;let Y=D;const se=d.map(A=>{if(!N.has(A.id))return A;const Q=F!=null&&F.propagateToSteps?A.stepResults.map(ie=>({...ie,status:T})):A.stepResults;return Y=S(Y,A.status,T),{...A,status:T,stepResults:Q}});c(se),m(Y),r&&(he.set(r,se),Y&&we.set(r,Y));try{await Promise.all(g.map(A=>I.runs.markResult(e,t,A,{status:T,...F})))}catch{c(_),m(D),r&&(he.set(r,_),D&&we.set(r,D))}},M=g=>{const T=d.map(N=>g.has(N.id)?{...N,status:"pending",stepResults:N.stepResults.map(_=>({..._,status:"pending"}))}:N),F=(()=>{if(!f)return f;const N={...f.summary};for(const _ of d)g.has(_.id)&&(N[_.status]=Math.max(0,(N[_.status]??0)-1),N.pending=(N.pending??0)+1);return N.passRate=N.total>0?Math.round(N.pass/N.total*100):0,{...f,summary:N}})();return{next:T,nextReport:F}},H=(g,T)=>{c(g),m(T),r&&(he.set(r,g),T&&we.set(r,T))},te=(g,T)=>{c(g),m(T),r&&(he.set(r,g),T&&we.set(r,T))};return{results:d,report:f,loading:y,markResult:w,bulkMarkResult:C,markStep:k,resetResult:async g=>{if(e===null||t===null)return;const T=d,F=f,{next:N,nextReport:_}=M(new Set([g]));H(N,_);try{await I.runs.resetResult(e,t,g)}catch{te(T,F)}},resetProgress:async g=>{if(e===null||t===null)return;const T=d,F=f,N=new Set(g!==void 0?d.filter(Y=>Y.folderId===g).map(Y=>Y.id):d.map(Y=>Y.id)),{next:_,nextReport:D}=M(N);H(_,D);try{await I.runs.resetProgress(e,t,g)}catch{te(T,F)}},bulkReset:async g=>{if(e===null||t===null)return;const T=d,F=f,{next:N,nextReport:_}=M(new Set(g));H(N,_);try{await Promise.all(g.map(D=>I.runs.resetResult(e,t,D)))}catch{te(T,F)}},refetch:b}}function ei(){return Ge.size}function ti(){Ge.clear()}function si(){return he.size}function ri(){he.clear(),we.clear()}const ve=new Map,ni=()=>ve.size,oi=()=>ve.clear();function Da(e){const t=e!==null?ve.get(e)??null:null,[r,n]=l.useState(t??[]),[i,d]=l.useState(t===null&&e!==null),[c,f]=l.useState(null),m=l.useRef(0),y=l.useRef(null);if(y.current!==e){y.current=e,m.current++;const w=e!==null?ve.get(e)??null:null;n(w??[]),d(w===null&&e!==null),f(null)}const p=l.useCallback(async()=>{if(e===null)return;const w=++m.current;ve.has(e)||d(!0);try{f(null);const k=await I.milestones.list(e);if(m.current!==w)return;ve.set(e,k),n(k)}catch(k){if(m.current!==w)return;f(k instanceof Error?k.message:"Failed to fetch milestones")}finally{m.current===w&&d(!1)}},[e]);l.useEffect(()=>{p()},[p]);const h=async w=>{if(e===null)return;const k=await I.milestones.create(e,w),C=[...ve.get(e)??[],k];return ve.set(e,C),n(C),k},j=async(w,k)=>{if(e===null)return;const C=await I.milestones.update(e,w,k),M=(ve.get(e)??[]).map(H=>H.id===w?C:H);return ve.set(e,M),n(M),C},b=async w=>{if(e===null)return;await I.milestones.delete(e,w);const k=(ve.get(e)??[]).filter(C=>C.id!==w);ve.set(e,k),n(k)},S=l.useCallback(async()=>{e!==null&&ve.delete(e),await p()},[e,p]);return{milestones:r,loading:i,error:c,createMilestone:h,updateMilestone:j,removeMilestone:b,refetch:S}}const Na=new Set(["chat","tickets","repos","commands","settings"]),La=new Set(["analysis","test-plan","test-report"]);function Ks(e){switch(e.type){case"apps":return"/";case"ai":return`/apps/${e.appId}/ai/${e.section??"chat"}`;case"spaces":return`/apps/${e.appId}/spaces`;case"tests":return e.folderId==null?`/apps/${e.appId}/spaces/${e.spaceId}`:e.selectedTestId!=null?`/apps/${e.appId}/spaces/${e.spaceId}/folders/${e.folderId}/tests/${e.selectedTestId}`:`/apps/${e.appId}/spaces/${e.spaceId}/folders/${e.folderId}`;case"test-editor":return e.testId!=null?`/apps/${e.appId}/spaces/${e.spaceId}/folders/${e.folderId}/tests/${e.testId}/edit`:`/apps/${e.appId}/spaces/${e.spaceId}/folders/${e.folderId}/tests/new`;case"runs":return`/apps/${e.appId}/runs`;case"run-execution":return e.selectedResultId!=null?`/apps/${e.appId}/runs/${e.runId}/results/${e.selectedResultId}`:`/apps/${e.appId}/runs/${e.runId}`;case"milestones":return`/apps/${e.appId}/milestones`;case"milestone-detail":return`/apps/${e.appId}/milestones/${e.milestoneId}`;case"reports":return`/apps/${e.appId}/reports/${e.section??"analysis"}`;case"analysis-detail":return`/apps/${e.appId}/reports/analysis/${e.analysisId}`;case"plan-detail":return`/apps/${e.appId}/reports/test-plan/${e.planId}`;case"settings":return`/apps/${e.appId}/settings`;case"trash":return`/apps/${e.appId}/spaces/${e.spaceId}/trash`;case"users":return"/users";case"admin-settings":return"/admin-settings";default:return e}}function Qs(e){const t=e.replace(/\/$/,"")||"/";let r=t.match(/^\/apps\/(\d+)\/spaces\/(\d+)\/folders\/(\d+)\/tests\/new$/);return r?{type:"test-editor",appId:+r[1],spaceId:+r[2],folderId:+r[3]}:(r=t.match(/^\/apps\/(\d+)\/spaces\/(\d+)\/folders\/(\d+)\/tests\/(\d+)\/edit$/),r?{type:"test-editor",appId:+r[1],spaceId:+r[2],folderId:+r[3],testId:+r[4]}:(r=t.match(/^\/apps\/(\d+)\/spaces\/(\d+)\/folders\/(\d+)\/tests\/(\d+)$/),r?{type:"tests",appId:+r[1],spaceId:+r[2],folderId:+r[3],selectedTestId:+r[4]}:(r=t.match(/^\/apps\/(\d+)\/spaces\/(\d+)\/folders\/(\d+)$/),r?{type:"tests",appId:+r[1],spaceId:+r[2],folderId:+r[3]}:(r=t.match(/^\/apps\/(\d+)\/spaces\/(\d+)$/),r?{type:"tests",appId:+r[1],spaceId:+r[2]}:(r=t.match(/^\/apps\/(\d+)\/spaces$/),r?{type:"spaces",appId:+r[1]}:(r=t.match(/^\/apps\/(\d+)\/runs\/(\d+)\/results\/(\d+)$/),r?{type:"run-execution",appId:+r[1],runId:+r[2],selectedResultId:+r[3]}:(r=t.match(/^\/apps\/(\d+)\/runs\/(\d+)$/),r?{type:"run-execution",appId:+r[1],runId:+r[2]}:(r=t.match(/^\/apps\/(\d+)\/runs$/),r?{type:"runs",appId:+r[1]}:(r=t.match(/^\/apps\/(\d+)\/milestones\/(\d+)$/),r?{type:"milestone-detail",appId:+r[1],milestoneId:+r[2]}:(r=t.match(/^\/apps\/(\d+)\/milestones$/),r?{type:"milestones",appId:+r[1]}:(r=t.match(/^\/apps\/(\d+)\/spaces\/(\d+)\/trash$/),r?{type:"trash",appId:+r[1],spaceId:+r[2]}:(r=t.match(/^\/apps\/(\d+)\/settings$/),r?{type:"settings",appId:+r[1]}:(r=t.match(/^\/apps\/(\d+)\/reports\/analysis\/(\d+)$/),r?{type:"analysis-detail",appId:+r[1],analysisId:+r[2]}:(r=t.match(/^\/apps\/(\d+)\/reports\/test-plan\/(\d+)$/),r?{type:"plan-detail",appId:+r[1],planId:+r[2]}:(r=t.match(/^\/apps\/(\d+)\/reports\/([a-z-]+)$/),r&&La.has(r[2])?{type:"reports",appId:+r[1],section:r[2]}:(r=t.match(/^\/apps\/(\d+)\/reports$/),r?{type:"reports",appId:+r[1],section:"analysis"}:(r=t.match(/^\/apps\/(\d+)\/ai\/([a-z]+)$/),r&&Na.has(r[2])?{type:"ai",appId:+r[1],section:r[2]}:(r=t.match(/^\/apps\/(\d+)\/ai$/),r?{type:"ai",appId:+r[1],section:"chat"}:(r=t.match(/^\/apps\/(\d+)$/),r?{type:"ai",appId:+r[1],section:"chat"}:t==="/users"?{type:"users"}:t==="/admin-settings"?{type:"admin-settings"}:{type:"apps"})))))))))))))))))))}function Gr(e){return e.flatMap(t=>[t,...Gr(t.children)])}function Aa({crumbs:e}){return e.length===0?null:s.jsx("div",{style:{display:"flex",alignItems:"center",gap:2,padding:"0 18px",height:34,flexShrink:0,borderBottom:"1px solid var(--t-border-subtle)",background:"var(--t-bg-elevated)"},children:e.map((t,r)=>{const n=r===e.length-1;return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:2},children:[r>0&&s.jsx(Ts,{size:10,color:"#666",style:{flexShrink:0,margin:"0 2px"}}),s.jsxs("button",{onClick:t.onClick,style:{display:"flex",alignItems:"center",gap:5,border:"none",cursor:n?"default":"pointer",background:"transparent",padding:"2px 6px",borderRadius:4,fontSize:"var(--t-text-sm)",color:n?"var(--t-text-primary)":"var(--t-text-secondary)",fontWeight:n?500:400,pointerEvents:n?"none":"auto",transition:"color 0.1s"},onMouseEnter:i=>{n||(i.currentTarget.style.color="var(--t-text-primary)")},onMouseLeave:i=>{n||(i.currentTarget.style.color="var(--t-text-secondary)")},children:[t.icon&&s.jsx("span",{style:{display:"flex",opacity:n?1:.75},children:t.icon}),t.label]})]},r)})})}function Ma(){const{user:e,loading:t,authScreen:r}=bt(),n=Es();if(t){const i=yr(n,!0),d=!!i,c=!!n.appTitle;return s.jsxs("div",{style:{minHeight:"100vh",background:"var(--t-bg-base)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:16},children:[d?s.jsx("img",{src:i,alt:n.appTitle,style:{width:48,height:48,objectFit:"contain"}}):s.jsx(ye,{width:48,height:48,borderRadius:12}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[c?s.jsx("p",{style:{margin:0,fontSize:"var(--t-text-lg)",fontWeight:600,color:"var(--t-text-primary)"},children:n.appTitle}):s.jsx(ye,{width:120,height:16,borderRadius:4}),s.jsx(ye,{width:160,height:12,borderRadius:4})]})]})}return e?s.jsx(Fa,{}):r==="forgot-password"?s.jsx(Zo,{}):r==="reset-password"?s.jsx(ea,{}):s.jsx(Xo,{})}function _a(){return s.jsx(Zn,{children:s.jsx(Kn,{children:s.jsx(Yn,{children:s.jsx(Ma,{})})})})}function Fa(){const{user:e}=bt(),[t,r]=l.useState(()=>Qs(window.location.pathname)),[n,i]=l.useState(!1),[d,c]=l.useState(""),[f,m]=l.useState(""),[y,p]=l.useState(!1),[h,j]=l.useState(!1),[b,S]=l.useState(""),[w,k]=l.useState(""),[C,M]=l.useState(null),[H,te]=l.useState(""),[ne,L]=l.useState(""),[v,g]=l.useState(null),[T,F]=l.useState(!1),[N,_]=l.useState(!1);l.useEffect(()=>{const R=de=>{const Ce=de.state;r(Ce??Qs(window.location.pathname))};return window.addEventListener("popstate",R),()=>window.removeEventListener("popstate",R)},[]),l.useEffect(()=>{const R=Ks(t);window.location.pathname!==R&&window.history.pushState(t,"",R)},[t]);const D="appId"in t?t.appId:null,Y="spaceId"in t?t.spaceId:null,se=("folderId"in t?t.folderId:void 0)??void 0,A=t.type==="run-execution"?t.runId:null,Q=t.type==="test-editor"?t.testId:void 0,{apps:ie,loading:$e,addApp:O,updateApp:st,removeApp:Ue,refetch:He}=ia(),{spaces:ze,loading:oe,addSpace:re,removeSpace:Pe,refetch:ke}=za(D);l.useEffect(()=>{const R=()=>void He(),de=()=>void ke();return window.addEventListener("sdet:apps:refresh",R),window.addEventListener("sdet:spaces:refresh",de),()=>{window.removeEventListener("sdet:apps:refresh",R),window.removeEventListener("sdet:spaces:refresh",de)}},[He,ke]);const{tree:Z}=Jr(Y),{runs:Ye,loading:qe,createRun:Se,removeRun:Oe,refetch:pe}=Pa(D),{milestones:dt,loading:vt,createMilestone:Mt,removeMilestone:St}=Da(D),{results:_t,report:jt,loading:Ft,markResult:wt,bulkMarkResult:Jt,markStep:$t,resetResult:ct,resetProgress:ds,bulkReset:Bt,refetch:kt}=Ia(D,A),le=ie.find(R=>R.id===D)??null,Ke=ze.find(R=>R.id===Y)??null,ut=Ye.find(R=>R.id===A)??null,Ct=t.type==="milestone-detail"?t.milestoneId:null,pt=dt.find(R=>R.id===Ct)??null,rt=Gr(Z).find(R=>R.id===se)??null,{isEditor:Ie,isAdmin:Rt,loading:ft}=Br(D),W=R=>{window.history.pushState(R,"",Ks(R)),r(R)},Tt=(e==null?void 0:e.globalRole)==="super_admin";if(!Tt&&(t.type==="admin-settings"||t.type==="users"))return W({type:"apps"}),null;if(!$e&&D!==null&&new Set(["ai","spaces","tests","test-editor","runs","run-execution","milestones","milestone-detail","reports","analysis-detail","plan-detail","settings","trash"]).has(t.type)&&!le)return W({type:"apps"}),null;if(t.type==="settings"&&D!==null&&!ft&&!Ie)return W({type:"ai",appId:D,section:"chat"}),null;const fe=Rt||Tt;if(t.type==="ai"&&D!==null&&!ft&&(t.section==="commands"||t.section==="settings")&&!fe)return W({type:"ai",appId:D,section:"chat"}),null;const me=async R=>{!D||!A||(await I.runs.setStatus(D,A,R),await pe(),await kt())},$=[];if(t.type!=="apps"&&t.type!=="admin-settings"&&$.push({label:"Apps",onClick:()=>W({type:"apps"})}),le&&t.type!=="apps"&&$.push({label:le.name,icon:s.jsx(Dt,{size:11}),onClick:()=>W({type:"ai",appId:le.id,section:"chat"})}),Ke&&(t.type==="tests"||t.type==="test-editor"||t.type==="trash")&&$.push({label:Ke.name,icon:s.jsx(ir,{size:11}),onClick:()=>W({type:"tests",appId:le.id,spaceId:Ke.id})}),rt&&(t.type==="tests"||t.type==="test-editor")&&$.push({label:rt.name,icon:s.jsx(Rs,{size:11}),onClick:()=>W({type:"tests",appId:le.id,spaceId:Ke.id,folderId:rt.id})}),(t.type==="runs"||t.type==="run-execution")&&$.push({label:"Runs",icon:s.jsx(os,{size:11}),onClick:()=>W({type:"runs",appId:le.id})}),t.type==="run-execution"&&ut&&$.push({label:ut.name,icon:s.jsx(os,{size:11}),onClick:()=>{}}),t.type==="settings"&&$.push({label:t.section==="members"?"Members":"Settings",icon:s.jsx(tr,{size:11}),onClick:()=>{}}),t.type==="users"&&$.push({label:t.section==="user-groups"?"User Groups":"Users",icon:s.jsx(ns,{size:11}),onClick:()=>{}}),t.type==="trash"&&$.push({label:"Trash",icon:s.jsx(it,{size:11}),onClick:()=>{}}),(t.type==="milestones"||t.type==="milestone-detail")&&$.push({label:"Milestones",icon:s.jsx(bs,{size:11}),onClick:()=>W({type:"milestones",appId:le.id})}),t.type==="milestone-detail"&&pt&&$.push({label:pt.name,icon:s.jsx(bs,{size:11}),onClick:()=>{}}),t.type==="ai"){const R={chat:{label:"Chat",icon:s.jsx(sr,{size:11})},tickets:{label:"Tickets",icon:s.jsx(rr,{size:11})},repos:{label:"Repo Management",icon:s.jsx(nr,{size:11})},commands:{label:"Custom Commands",icon:s.jsx(or,{size:11})},settings:{label:"Settings",icon:s.jsx(ar,{size:11})}};$.push({label:"AI",icon:s.jsx(er,{size:11}),onClick:()=>W({type:"ai",appId:t.appId,section:"chat"})});const de=t.section??"chat",Ce=R[de];$.push({label:Ce.label,icon:Ce.icon,onClick:()=>{}})}if(t.type==="reports"){const R={analysis:{label:"Analysis",icon:s.jsx(at,{size:11})},"test-plan":{label:"Test Plan",icon:s.jsx(vs,{size:11})},"test-report":{label:"Test Report",icon:s.jsx(Cs,{size:11})}};$.push({label:"Reports",icon:s.jsx(at,{size:11}),onClick:()=>W({type:"reports",appId:t.appId,section:"analysis"})});const de=t.section??"analysis",Ce=R[de];$.push({label:Ce.label,icon:Ce.icon,onClick:()=>{}})}return t.type==="analysis-detail"&&($.push({label:"Reports",icon:s.jsx(at,{size:11}),onClick:()=>W({type:"reports",appId:t.appId,section:"analysis"})}),$.push({label:"Analysis",icon:s.jsx(at,{size:11}),onClick:()=>W({type:"reports",appId:t.appId,section:"analysis"})}),$.push({label:`#${t.analysisId}`,onClick:()=>{}})),t.type==="plan-detail"&&($.push({label:"Reports",icon:s.jsx(at,{size:11}),onClick:()=>W({type:"reports",appId:t.appId,section:"analysis"})}),$.push({label:"Test Plans",icon:s.jsx(vs,{size:11}),onClick:()=>W({type:"reports",appId:t.appId,section:"test-plan"})}),$.push({label:`#${t.planId}`,onClick:()=>{}})),s.jsxs(Un,{children:[s.jsx("div",{className:"flex flex-col h-screen overflow-hidden",style:{background:"var(--t-bg-base)"},children:s.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[s.jsx(da,{apps:ie,selectedApp:le,spaces:ze,spacesLoading:oe,runs:Ye,runsLoading:qe,milestones:dt,milestonesLoading:vt,view:t,onNavigate:W,onAddApp:O,onDeleteApp:Ue,onAddSpace:async R=>{await re(R),await ke()},onDeleteSpace:async R=>{await Pe(R),await ke()},onCreateRun:async R=>Se({...R,createdBy:"me"}),onDeleteRun:Oe,onDuplicateRun:async R=>{D&&(await I.runs.duplicate(D,R),await pe())},onCreateMilestone:async R=>Mt({...R,createdBy:"me"}),onDeleteMilestone:St}),s.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:0},children:[s.jsx(Aa,{crumbs:$}),s.jsxs(l.Suspense,{fallback:s.jsx("div",{style:{flex:1,padding:24},children:s.jsx(eo,{count:6,rowHeight:36,padding:"4px 0",showIcon:!1})}),children:[t.type==="apps"&&s.jsx(ua,{apps:ie,loading:$e,onNavigate:W,onAdd:O,onRename:st,onDelete:Ue}),t.type==="ai"&&s.jsx(ma,{appId:t.appId,section:t.section}),t.type==="reports"&&s.jsx(Ra,{appId:t.appId,section:t.section,onNavigate:W}),t.type==="analysis-detail"&&s.jsx(Ta,{appId:t.appId,analysisId:t.analysisId,onBack:()=>W({type:"reports",appId:t.appId,section:"analysis"})}),t.type==="plan-detail"&&s.jsx(Ea,{appId:t.appId,planId:t.planId,onBack:()=>W({type:"reports",appId:t.appId,section:"test-plan"})}),(t.type==="spaces"||t.type==="tests")&&D&&s.jsx(ha,{appId:D,activeSpaceId:Y??void 0,activeFolderId:se,selectedTestId:t.type==="tests"?t.selectedTestId??null:null,onSelectTest:R=>{t.type==="tests"&&t.folderId!=null&&W({...t,selectedTestId:R??void 0})},onNavigate:W,onImportFromTestMu:Ie?()=>_(!0):void 0,onImportFromTestRail:Ie?()=>{alert("Import from TestRail — coming soon")}:void 0,onImportFromCsv:Ie?()=>{alert("Import from CSV — coming soon")}:void 0,onAddFolder:Ie?()=>{window.dispatchEvent(new CustomEvent("sdet:open:add-folder"))}:void 0,onAddSpace:Ie?()=>{c(""),m(""),i(!0)}:void 0}),t.type==="test-editor"&&s.jsx(xa,{folderId:t.folderId,testId:Q,appId:t.appId,spaceId:t.spaceId,onNavigate:W,onSaved:()=>{}}),t.type==="runs"&&D&&s.jsx(ya,{appId:D,onNavigate:W,onCreateRun:Ie?()=>{S(""),k(""),M(null),te(""),L(""),g(null),j(!0)}:void 0}),t.type==="run-execution"&&s.jsx(ba,{run:ut,results:_t,report:jt,loading:Ft,appId:t.appId,spaces:ze,initialSelectedResultId:t.selectedResultId,onNavigate:W,onMarkResult:wt,onBulkMarkResult:Jt,onMarkStep:$t,onResetResult:ct,onResetProgress:ds,onBulkReset:Bt,onSetRunStatus:me,onRefreshResults:kt,onRunUpdated:async()=>{await pe()}}),t.type==="milestones"&&D&&s.jsx(va,{appId:D,onNavigate:W}),t.type==="milestone-detail"&&D&&s.jsx(Sa,{appId:D,milestoneId:t.milestoneId,onNavigate:W}),t.type==="settings"&&s.jsx(ja,{appId:t.appId,appName:(le==null?void 0:le.name)??"App",section:t.section}),t.type==="trash"&&s.jsx(wa,{spaceId:t.spaceId}),t.type==="users"&&(t.section==="user-groups"?s.jsx(ka,{}):s.jsx($a,{})),t.type==="admin-settings"&&s.jsx(ga,{})]})]})]})}),N&&s.jsx(l.Suspense,{fallback:null,children:s.jsx(Ca,{open:N,onClose:()=>_(!1),appId:D})}),s.jsx(Ae,{open:n,onOpenChange:i,children:s.jsxs(Me,{children:[s.jsx(_e,{children:s.jsx(Fe,{children:"Create Space"})}),s.jsxs("form",{onSubmit:async R=>{if(R.preventDefault(),!(!d.trim()||!D)){p(!0);try{await re({name:d.trim(),description:f.trim()||void 0}),await ke(),i(!1)}finally{p(!1)}}},style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs(B,{children:["Name ",s.jsx("span",{style:{color:"var(--t-accent-danger, #e5484d)"},children:"*"})]}),s.jsx(q,{value:d,onChange:R=>c(R.target.value),placeholder:"e.g. Web App",autoFocus:!0})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Description"}),s.jsx(q,{value:f,onChange:R=>m(R.target.value),placeholder:"Optional"})]}),s.jsxs(Je,{style:{marginTop:8},children:[s.jsx(K,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),s.jsx(K,{type:"submit",disabled:y||!d.trim(),children:y?"Creating…":"Create Space"})]})]})]})}),s.jsx(Ae,{open:h,onOpenChange:j,children:s.jsxs(Me,{className:"max-w-125",children:[s.jsx(_e,{children:s.jsx(Fe,{children:"New Run"})}),s.jsxs("form",{onSubmit:async R=>{if(R.preventDefault(),!(!b.trim()||!D)){F(!0);try{const de=await Se({name:b.trim(),environment:w.trim()||void 0,milestoneId:C??void 0,jiraIssueKey:H.trim()||void 0,referenceDoc:ne.trim()||void 0,assigneeId:v||void 0,createdBy:"me"});await pe(),j(!1),de&&W({type:"run-execution",appId:D,runId:de.id})}finally{F(!1)}}},style:{display:"flex",flexDirection:"column",gap:14,marginTop:8},children:[s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs(B,{children:["Name ",s.jsx("span",{style:{color:"var(--t-accent-danger, #e5484d)"},children:"*"})]}),s.jsx(q,{value:b,onChange:R=>S(R.target.value),placeholder:"e.g. Sprint 12 Smoke",autoFocus:!0})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Environment"}),s.jsxs("div",{style:{position:"relative"},children:[s.jsx(q,{value:w,onChange:R=>k(R.target.value),placeholder:"e.g. Staging",list:"new-run-env-opts"}),s.jsxs("datalist",{id:"new-run-env-opts",children:[s.jsx("option",{value:"Development"}),s.jsx("option",{value:"Staging"}),s.jsx("option",{value:"Production"}),s.jsx("option",{value:"QA"}),s.jsx("option",{value:"UAT"}),s.jsx("option",{value:"Pre-production"}),s.jsx("option",{value:"Local"})]})]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Milestone"}),s.jsxs("select",{value:C??"",onChange:R=>M(R.target.value?Number(R.target.value):null),style:{height:36,padding:"0 8px",borderRadius:6,border:"1px solid var(--t-border-default)",background:"var(--t-bg-surface)",color:C?"var(--t-text-primary)":"var(--t-text-muted)",fontSize:"var(--t-text-base)",outline:"none",cursor:"pointer"},children:[s.jsx("option",{value:"",children:"None"}),dt.map(R=>s.jsx("option",{value:R.id,children:R.name},R.id))]})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Jira Issue Key"}),s.jsx(q,{value:H,onChange:R=>te(R.target.value),placeholder:"e.g. PROJ-123"})]}),s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Reference Document"}),s.jsx(q,{value:ne,onChange:R=>L(R.target.value),placeholder:"Confluence URL"})]}),D&&s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsx(B,{children:"Assignee"}),s.jsx(ks,{appId:D,value:v,onChange:g})]}),s.jsxs(Je,{style:{marginTop:4},children:[s.jsx(K,{type:"button",variant:"outline",onClick:()=>j(!1),children:"Cancel"}),s.jsxs(K,{type:"submit",disabled:T||!b.trim(),children:[s.jsx(xe,{size:13})," ",T?"Creating…":"Create"]})]})]})]})})]})}Cn(document.getElementById("root")).render(s.jsx(l.StrictMode,{children:s.jsx(_a,{})}));export{ks as A,K as B,Fr as C,Ae as D,Me as E,_e as F,Fe as G,Je as H,q as I,Wa as J,Pt as K,B as L,At as R,ye as S,Mr as T,Br as a,I as b,Sr as c,Es as d,eo as e,js as f,Qa as g,Za as h,Ha as i,ti as j,ri as k,oi as l,Ka as m,Xa as n,Ua as o,ei as p,si as q,ni as r,Hn as s,Ga as t,bt as u,Ks as v,Da as w,tt as x,Ya as y,qa as z};
|