1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectCanvas-DO9kHdmq.js","assets/rolldown-runtime-Dw2cE7zH.js","assets/vendor-react-BZAXVne3.js","assets/vendor-misc-CrIMeqLY.js","assets/button-DnzGb2kg.js","assets/vendor-ui-Dvz_NghM.js","assets/runStopEndpoints-BXCYJVo5.js","assets/projectCanvasBroadcast-Lv9HDEU6.js","assets/AuthContext-Bz6CIGum.js","assets/AgentSourcesLine-D58jyUCX.js","assets/dialog-ByJfP-CB.js","assets/select-DUalOC1F.js","assets/switch-2APeBuUH.js","assets/table-BmDHi3vX.js","assets/boardCatalog-DuZzLIQZ.js","assets/workingCalendar-BKfkPHnG.js","assets/projectCanvasDoc-B843A2Qt.js","assets/Boards-Y7zFC64P.js","assets/useSSE-DMoXXAUY.js","assets/wbsGantt-CHg0907d.js","assets/RunCenter-DJaQBCpz.js","assets/ScriptRunCard-SkgbikAh.js","assets/Admin-Df5xjMfX.js","assets/checkbox-C9-ns9HC.js","assets/tabs-nKUK-kVf.js","assets/IntegrationsSettings-CIDPqq_x.js","assets/MondayBoardsEditor-CRGZTJkI.js","assets/JiraBoardsEditor-Bx72DxgO.js","assets/DevComponents-fksE0AqU.js"])))=>i.map(i=>d[i]); 2import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{a as t,c as n,n as r,o as i,r as a,t as o}from"./vendor-misc-CrIMeqLY.js";import{$ as s,A as c,B as l,D as u,F as d,G as f,H as p,I as m,J as h,K as g,L as _,M as v,N as y,O as b,P as x,Q as S,R as C,U as w,V as ee,W as te,X as T,Z as E,at as D,ct as O,dt as k,et as A,ft as ne,ht as re,j as ie,k as j,lt as ae,mt as M,nt as oe,ot as se,pt as ce,q as le,rt as ue,st as N,tt as de,ut as P,z as fe}from"./vendor-react-BZAXVne3.js";import{A as pe,D as me,E as he,H as ge,I as _e,L as ve,N as F,S as I,U as L,V as ye,X as be,_ as xe,_t as Se,b as Ce,bt as we,gt as Te,k as Ee,l as De,m as Oe,nt as ke,o as Ae,ot as je,p as Me,q as Ne,r as Pe,s as Fe,tt as Ie,v as Le,w as Re,x as ze,yt as R,z as Be}from"./vendor-ui-Dvz_NghM.js";import{S as z,b as Ve,h as He,i as Ue,m as We,n as Ge,o as Ke,s as qe,t as Je,v as Ye,x as Xe}from"./AuthContext-Bz6CIGum.js";import{a as Ze,c as Qe,l as $e,n as et,o as tt,r as nt,s as rt,t as it,u as at}from"./boardCatalog-DuZzLIQZ.js";import{n as ot,r as B,t as V}from"./button-DnzGb2kg.js";import{a as st,i as ct,n as lt,o as ut,r as dt,t as ft}from"./dialog-ByJfP-CB.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var H=e(n(),1),pt=re(),U=r(),mt=({...e})=>{let{theme:t=`system`}=i();return(0,U.jsx)(a,{theme:t,className:`toaster group`,icons:{success:(0,U.jsx)(ke,{className:`size-4`}),info:(0,U.jsx)(ve,{className:`size-4`}),warning:(0,U.jsx)(Ae,{className:`size-4`}),error:(0,U.jsx)(Re,{className:`size-4`}),loading:(0,U.jsx)(F,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},toastOptions:{classNames:{toast:`cn-toast`}},...e})};[...Ze(it)];function ht(e,t){return(e||``).trim()||(t||`unknown_project`).trim().replace(/[^A-Za-z0-9._-]+/g,`_`).replace(/^_+|_+$/g,``)||`unknown_project`}function gt(e,t){return et(e,t)}function _t(e){return e&&(e.columns=Array.isArray(e.columns)?e.columns.filter(e=>String(e)!==`locked`):[],e.rows=Array.isArray(e.rows)?e.rows:[],e)}function vt(e){return`spai.selectedBoard.${e||`default`}`}async function yt(e,t,n=``){let r=ht(e,t);if(!r)return[];let i=`data/boards/${r}`,a=[],o=await nt();try{let e=await Ke(`${We.boards}?path=${encodeURIComponent(i)}&ts=${Date.now()}`);if(e.ok){let t=await e.json();for(let e of t.boards||[]){let t=e.data||{},n=(e.board_key||``).toString().trim();if(n===`schedule_insights`)continue;let r=n||(t.board_id||``).toString().trim();_t(t),a.push({id:r,title:gt(r,o)||e.board_key})}}else{let e=await Ke(`${We.listDir}?path=${encodeURIComponent(i)}&ts=${Date.now()}`),t=[];if(e.ok){let n=await e.json();t=Array.isArray(n.items)?n.items:[]}if(t.length===0){let e=await Promise.all(Ze(o).map(async e=>{let t=`data/boards/${r}/${e.filename}`;try{return{kb:e,d:await qe(t)}}catch{return null}}));for(let t of e)t&&(_t(t.d),a.push({id:t.kb.id,title:t.kb.title}))}else{let e=await Promise.all(t.map(async e=>{let t=e.path||(e.name?`${i}/${e.name}`:``);if(!t)return null;let n=(e.name||``).replace(/\.json$/i,``);try{return{d:await qe(t),fid:n}}catch{return null}}));for(let t of e){if(!t)continue;let e=(t.d.board_id||t.fid||``).toString().trim()||t.fid;_t(t.d),a.push({id:e,title:gt(e,o)||t.fid})}}}let t=rt(o,n);for(let e of t){if(a.some(t=>t.id===e))continue;let t=tt(o,e);!t||t.agent||t.agent_script||a.push({id:e,title:t.title||e})}return Qe(a,o,n)}catch{return[]}}var bt=(0,H.createContext)(null);
2function xt(){let e=(0,H.useContext)(bt);if(!e)throw Error(`useBoardSelection must be used within BoardSelectionProvider`);return e}function St({children:e}){let{currentEntry:t}=at(),[n,r]=(0,H.useState)(``),i=t?.internal_id;(0,H.useEffect)(()=>{if(!i){r(``);return}try{let e=vt(i);r(localStorage.getItem(e)||``)}catch{r(``)}},[i]);let a=(0,H.useCallback)(e=>{r(e)},[]);return(0,U.jsx)(bt.Provider,{value:{activeBoardId:n,setActiveBoardId:a},children:e})}function Ct(e={}){let{nonce:t,locale:n,onScriptLoadSuccess:r,onScriptLoadError:i}=e,[a,o]=(0,H.useState)(!1),s=(0,H.useRef)(r);s.current=r;let c=(0,H.useRef)(i);return c.current=i,(0,H.useEffect)(()=>{let e=document.createElement(`script`);return e.src=`https://accounts.google.com/gsi/client`,n&&(e.src+=`?hl=${n}`),e.async=!0,e.defer=!0,e.nonce=t,e.onload=()=>{var e;o(!0),(e=s.current)==null||e.call(s)},e.onerror=()=>{var e;o(!1),(e=c.current)==null||e.call(c)},document.body.appendChild(e),()=>{document.body.removeChild(e)}},[t]),a}var wt=(0,H.createContext)(null);function Tt({clientId:e,nonce:t,locale:n,onScriptLoadSuccess:r,onScriptLoadError:i,children:a}){let o=Ct({nonce:t,onScriptLoadSuccess:r,onScriptLoadError:i,locale:n}),s=(0,H.useMemo)(()=>({locale:n,clientId:e,scriptLoadedSuccessfully:o}),[e,o]);return H.createElement(wt.Provider,{value:s},a)}function Et(){let e=(0,H.useContext)(wt);if(!e)throw Error(`Google OAuth components must be used within GoogleOAuthProvider`);return e}var Dt={signin_with:`Sign in with Google`,signup_with:`Sign up with Google`};function Ot(){return(0,U.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 48 48`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{fill:`#EA4335`,d:`M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z`}),(0,U.jsx)(`path`,{fill:`#4285F4`,d:`M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z`}),(0,U.jsx)(`path`,{fill:`#FBBC05`,d:`M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z`}),(0,U.jsx)(`path`,{fill:`#34A853`,d:`M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z`})]})}function kt({onSuccess:e,onError:t,text:n=`signin_with`,isDark:r=!1}){let i=(0,H.useRef)(null),a=(0,H.useRef)(e),o=(0,H.useRef)(t),{clientId:s,scriptLoadedSuccessfully:c}=Et();a.current=e,o.current=t,(0,H.useEffect)(()=>{let e=i.current;if(!(!c||!e))return window.google?.accounts.id.initialize({client_id:s,color_scheme:r?`dark`:`light`,callback:e=>{if(!e.credential){o.current?.();return}a.current(e.credential)}}),window.google?.accounts.id.renderButton(e,{type:`standard`,theme:r?`filled_black`:`outline`,size:`large`,text:n,width:328}),()=>{e.innerHTML=``}},[s,c,r,n]);let l=Dt[n];return(0,U.jsxs)(`div`,{className:`relative mx-auto h-10 w-full max-w-[328px]`,children:[(0,U.jsxs)(`div`,{"aria-hidden":`true`,className:B(`pointer-events-none absolute inset-0 flex items-center justify-center gap-3 rounded border px-4 text-sm font-medium`,r?`border-[#8E918F] bg-[#131314] text-[#E3E3E3]`:`border-[#747775] bg-white text-[#1F1F1F]`),children:[(0,U.jsx)(`span`,{className:B(`flex size-[18px] shrink-0 items-center justify-center`,!r&&`bg-white`),children:(0,U.jsx)(Ot,{})}),(0,U.jsx)(`span`,{children:l})]}),(0,U.jsx)(`div`,{ref:i,className:`absolute inset-0 z-10 overflow-hidden opacity-[0.01]`,"aria-label":l})]})}function W({className:e,type:t,...n}){return(0,U.jsx)(ue,{type:t,"data-slot":`input`,className:B(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function G({className:e,size:t=`default`,...n}){return(0,U.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:B(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground
2/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function K({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-header`,className:B(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function At({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-title`,className:B(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function q({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-content`,className:B(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}function jt(){let{login:e,loginWithGoogle:t,register:n,needsVerification:r,pendingEmail:a,resendVerification:o,clearVerification:s,kickedOut:c,clearKickedOut:l}=Ge(),u=window.location.pathname===`/reset-password`,[d]=(0,H.useState)(()=>new URLSearchParams(window.location.search).get(`invite`)??``),[f,p]=(0,H.useState)(()=>u?`resetPassword`:new URLSearchParams(window.location.search).get(`invite`)?`register`:`login`),[m,h]=(0,H.useState)(``),[g,_]=(0,H.useState)(``),[v,y]=(0,H.useState)(``),[b,x]=(0,H.useState)(``),[S,C]=(0,H.useState)(!1),[w,ee]=(0,H.useState)(``),[te,T]=(0,H.useState)(!1),[E,D]=(0,H.useState)(``),O=(0,H.useRef)(null),k=(0,H.useRef)(null),[A,ne]=(0,H.useState)(``),[re,ie]=(0,H.useState)(!1),[j,ae]=(0,H.useState)(()=>u?new URLSearchParams(window.location.search).get(`token`)??``:``),[M,oe]=(0,H.useState)(!1),[se,ce]=(0,H.useState)(``),{resolvedTheme:le}=i(),[ue,N]=(0,H.useState)(!1);(0,H.useEffect)(()=>{N(!0)},[]);let de=ue&&le===`dark`,P=de?`dark`:`light`;(0,H.useEffect)(()=>{fetch(`/auth/turnstile-site-key`,{cache:`no-store`}).then(e=>e.json()).then(e=>{e.site_key&&D(e.site_key)}).catch(()=>{})},[]),(0,H.useEffect)(()=>{fetch(He.googleConfig,{cache:`no-store`}).then(e=>e.json()).then(e=>{e.client_id&&ce(e.client_id)}).catch(()=>{})},[]),(0,H.useEffect)(()=>{if(!E||f!==`register`)return;let e=()=>{let e=window.turnstile;!e||!O.current||k.current!==null||(k.current=e.render(O.current,{sitekey:E,theme:P}))};if(window.turnstile)e();else if(!document.querySelector(`script[data-cf-turnstile]`)){let t=document.createElement(`script`);t.src=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,t.async=!0,t.setAttribute(`data-cf-turnstile`,`1`),t.onload=e,document.head.appendChild(t)}return()=>{if(k.current!==null){try{window.turnstile?.remove(k.current)}catch{}k.current=null}}},[E,f,P]);async function fe(e){x(``),C(!0);let n=await t(e);C(!1),n.ok||(n.error===`already_logged_in`?T(!0):x(n.error??`Google sign-in failed`))}async function pe(t){t.preventDefault(),x(``),C(!0);let n=await e(m,g);C(!1),n.ok||(n.error===`already_logged_in`?T(!0):n.error!==`email_not_verified`&&x(n.error??`Login failed`))}async function me(e){if(e.preventDefault(),x(``),g.length<6){x(`Password must be at least 6 characters.`);return}if(g!==v){x(`Passwords do not match.`);return}let t=E&&k.current!==null?window.turnstile?.getResponse(k.current)??``:``;C(!0);let r=await n(m,g,t,d||void 0);if(C(!1),r.ok&&d&&window.history.replaceState({},``,`/`),!r.ok&&(x(r.error??`Registration failed`),E&&k.current!==null))try{window.turnstile?.reset(k.current)}catch{}}async function he(){ee(``),ee((await o()).message??``)}async function ge(e){e.preventDefault(),x(``),C(!0);try{await Ke(He.requestPasswordReset,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({email:A})})}catch{}C(!1),ie(!0)}let ve=(0,H.useCallback)(async e=>{if(e.preventDefault(),x(``),g.length<6){x(`Password must be at least 6 characters.`);return}if(g!==v){x(`Passwords do not match.`);return}C(!0);try{let e=await(await Ke(He.resetPassword,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:j,new_password:g})})).json();C(!1),e.ok?(oe(!0),window.history.replaceState({}
2,``,`/`)):x(e.error===`invalid_or_expired_token`?`This reset link has expired or is invalid. Please request a new one.`:e.error??`Password reset failed.`)}catch{C(!1),x(`Network error. Please try again.`)}},[g,v,j]);function I(e){p(e),x(``),l()}function L(){window.history.replaceState({},``,`/`),ae(``),oe(!1),_(``),y(``),I(`login`)}return r?(0,U.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:(0,U.jsxs)(G,{className:`w-full max-w-sm`,children:[(0,U.jsxs)(K,{className:`text-center`,children:[(0,U.jsx)(`div`,{className:`mx-auto mb-3 flex size-12 items-center justify-center rounded-full bg-primary/10`,children:(0,U.jsx)(Ee,{size:24,className:`text-primary`})}),(0,U.jsx)(At,{className:`text-lg`,children:`Check your email`})]}),(0,U.jsxs)(q,{className:`space-y-4 text-center`,children:[(0,U.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`We sent a verification email to`,` `,(0,U.jsx)(`span`,{className:`font-medium text-foreground`,children:a})]}),(0,U.jsx)(V,{variant:`outline`,size:`sm`,onClick:he,className:`w-full`,children:`Resend verification email`}),w&&(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:w}),(0,U.jsxs)(`button`,{onClick:s,className:`flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mx-auto`,children:[(0,U.jsx)(R,{size:14}),`Back to Sign In`]})]})]})}):f===`forgotPassword`?(0,U.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:(0,U.jsxs)(G,{className:`w-full max-w-sm`,children:[(0,U.jsxs)(K,{className:`text-center`,children:[(0,U.jsx)(`div`,{className:`mx-auto mb-3 flex size-12 items-center justify-center rounded-full bg-primary/10`,children:(0,U.jsx)(_e,{size:24,className:`text-primary`})}),(0,U.jsx)(At,{className:`text-lg`,children:`Forgot your password?`})]}),(0,U.jsx)(q,{className:`space-y-4`,children:re?(0,U.jsxs)(`div`,{className:`space-y-4 text-center`,children:[(0,U.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`If an account exists for `,(0,U.jsx)(`span`,{className:`font-medium text-foreground`,children:A}),`, a reset link has been sent. Check your inbox.`]}),(0,U.jsxs)(`button`,{onClick:()=>I(`login`),className:`flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mx-auto`,children:[(0,U.jsx)(R,{size:14}),`Back to Sign In`]})]}):(0,U.jsxs)(`form`,{onSubmit:ge,className:`space-y-3`,children:[(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Enter your email and we'll send you a link to reset your password.`}),(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`forgot-email`,className:`text-sm`,children:`Email`}),(0,U.jsx)(W,{id:`forgot-email`,type:`email`,value:A,onChange:e=>ne(e.target.value),placeholder:`[email protected]`,required:!0,autoComplete:`email`})]}),b&&(0,U.jsx)(`p`,{className:`text-sm text-destructive`,children:b}),(0,U.jsxs)(V,{type:`submit`,className:`w-full`,size:`sm`,disabled:S,children:[S&&(0,U.jsx)(F,{size:16,className:`animate-spin`}),`Send reset link`]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>I(`login`),className:`flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mx-auto pt-1`,children:[(0,U.jsx)(R,{size:14}),`Back to Sign In`]})]})})]})}):f===`resetPassword`?(0,U.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:(0,U.jsxs)(G,{className:`w-full max-w-sm`,children:[(0,U.jsxs)(K,{className:`text-center`,children:[(0,U.jsx)(`div`,{className:`mx-auto mb-3 flex size-12 items-center justify-center rounded-full bg-primary/10`,children:(0,U.jsx)(_e,{size:24,className:`text-primary`})}),(0,U.jsx)(At,{className:`text-lg`,children:`Reset your password`})]}),(0,U.jsx)(q,{className:`space-y-4`,children:j?M?(0,U.jsxs)(`div`,{className:`space-y-4 text-center`,children:[(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Your password has been updated. You can now sign in with your new password.`}),(0,U.jsxs)(`button`,{onClick:L,className:`flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mx-auto`,children:[(0,U.jsx)(R,{size:14}),`Back to Sign In`]})]}):(0,U.jsxs)(`form`,{onSubmit:ve,className:`space-y-3`,children:[(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`reset-password`,className:`text-sm`,children:`New password`}),(0,U.jsx)(W,{id:`reset-password`,type:`password`,value:g,onChange:e=>_(e.target.value),placeholder:`â¢â¢â¢â¢â¢â¢â¢â¢`,required:!0,autoComplete:`new-password`})]}),(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`reset-confirm`,className:`text-sm`,children:`Confirm password`}
2),(0,U.jsx)(W,{id:`reset-confirm`,type:`password`,value:v,onChange:e=>y(e.target.value),placeholder:`â¢â¢â¢â¢â¢â¢â¢â¢`,required:!0,autoComplete:`new-password`})]}),b&&(0,U.jsx)(`p`,{className:`text-sm text-destructive`,children:b}),(0,U.jsxs)(V,{type:`submit`,className:`w-full`,size:`sm`,disabled:S,children:[S&&(0,U.jsx)(F,{size:16,className:`animate-spin`}),`Set new password`]}),(0,U.jsxs)(`button`,{type:`button`,onClick:L,className:`flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mx-auto pt-1`,children:[(0,U.jsx)(R,{size:14}),`Back to Sign In`]})]}):(0,U.jsxs)(`div`,{className:`space-y-4 text-center`,children:[(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This reset link is invalid or has expired.`}),(0,U.jsxs)(`button`,{onClick:L,className:`flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mx-auto`,children:[(0,U.jsx)(R,{size:14}),`Back to Sign In`]})]})})]})}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ft,{open:te,onOpenChange:T,children:(0,U.jsxs)(lt,{children:[(0,U.jsxs)(st,{children:[(0,U.jsx)(ut,{children:`Account Already Signed In`}),(0,U.jsx)(dt,{children:`This account is currently signed in from another device or browser. Please sign out from that session, or wait until it expires, before signing in here.`})]}),(0,U.jsx)(ct,{children:(0,U.jsx)(V,{onClick:()=>T(!1),children:`OK`})})]})}),(0,U.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:(0,U.jsxs)(G,{className:`w-full max-w-sm`,children:[(0,U.jsxs)(K,{className:`text-center`,children:[(0,U.jsxs)(`div`,{className:`mx-auto mb-2 flex flex-col items-center gap-2`,children:[(0,U.jsx)(`img`,{src:`/assets/images/logo-wordmark-light.png`,alt:`SmartProject.AI`,className:`h-16 w-auto max-w-[18rem] dark:hidden`}),(0,U.jsx)(`img`,{src:`/assets/images/logo-wordmark-dark.png`,alt:`SmartProject.AI`,className:`hidden h-16 w-auto max-w-[18rem] dark:block`})]}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`AI-Powered Project Management`})]}),c&&(()=>{let e=``;try{e=sessionStorage.getItem(`spai_kicked_out`)??``}catch{}return(0,U.jsxs)(`div`,{className:`mx-6 mb-0 rounded-md border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-200`,children:[Ue(e===`true`?`concurrent`:e),(0,U.jsx)(`button`,{className:`ml-2 underline`,onClick:l,children:`Dismiss`})]})})(),(0,U.jsxs)(q,{className:`space-y-4`,children:[(0,U.jsxs)(`div`,{className:`flex rounded-md border p-0.5`,children:[(0,U.jsx)(`button`,{onClick:()=>I(`login`),className:`flex-1 rounded-sm px-3 py-1.5 text-sm transition-colors ${f===`login`?`bg-accent text-accent-foreground font-medium`:`text-muted-foreground hover:text-foreground`}`,children:`Sign In`}),(0,U.jsx)(`button`,{onClick:()=>I(`register`),className:`flex-1 rounded-sm px-3 py-1.5 text-sm transition-colors ${f===`register`?`bg-accent text-accent-foreground font-medium`:`text-muted-foreground hover:text-foreground`}`,children:`Register`})]}),(0,U.jsxs)(`form`,{onSubmit:f===`login`?pe:me,className:`space-y-3`,children:[(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`auth-email`,className:`text-sm`,children:`Email`}),(0,U.jsx)(W,{id:`auth-email`,type:`email`,value:m,onChange:e=>h(e.target.value),placeholder:`[email protected]`,required:!0,autoComplete:`email`})]}),(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`label`,{htmlFor:`auth-password`,className:`text-sm`,children:`Password`}),f===`login`&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>{ne(m),I(`forgotPassword`)},className:`text-xs text-muted-foreground hover:text-foreground`,children:`Forgot your password?`})]}),(0,U.jsx)(W,{id:`auth-password`,type:`password`,value:g,onChange:e=>_(e.target.value),placeholder:`â¢â¢â¢â¢â¢â¢â¢â¢`,required:!0,autoComplete:f===`login`?`current-password`:`new-password`})]}),f===`register`&&(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsx)(`label`,{htmlFor:`auth-confirm`,className:`text-sm`,children:`Confirm Password`}
2),(0,U.jsx)(W,{id:`auth-confirm`,type:`password`,value:v,onChange:e=>y(e.target.value),placeholder:`â¢â¢â¢â¢â¢â¢â¢â¢`,required:!0,autoComplete:`new-password`})]}),f===`register`&&E&&(0,U.jsx)(`div`,{ref:O}),b&&(0,U.jsx)(`p`,{className:`text-sm text-destructive`,children:b}),(0,U.jsxs)(V,{type:`submit`,className:`w-full`,size:`sm`,disabled:S,children:[S&&(0,U.jsx)(F,{size:16,className:`animate-spin`}),f===`login`?`Sign In`:`Create Account`]})]}),se&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,U.jsx)(`div`,{className:`flex-grow border-t border-border`}),(0,U.jsx)(`span`,{className:`mx-3 text-xs text-muted-foreground`,children:`or`}),(0,U.jsx)(`div`,{className:`flex-grow border-t border-border`})]}),(0,U.jsx)(Tt,{clientId:se,children:(0,U.jsx)(kt,{isDark:de,onSuccess:e=>fe(e),onError:()=>x(`Google sign-in failed. Please try again.`),text:f===`register`?`signup_with`:`signin_with`},de?`dark`:`light`)})]})]})]})})]})}var Mt=768;function Nt(){let[e,t]=H.useState(void 0);return H.useEffect(()=>{let e=window.matchMedia(`(max-width: ${Mt-1}px)`),n=()=>{t(window.innerWidth<Mt)};return e.addEventListener(`change`,n),t(window.innerWidth<Mt),()=>e.removeEventListener(`change`,n)},[]),!!e}function Pt({className:e,orientation:t=`horizontal`,...n}){return(0,U.jsx)(le,{"data-slot":`separator`,orientation:t,className:B(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}function Ft({...e}){return(0,U.jsx)(E,{"data-slot":`sheet`,...e})}function It({...e}){return(0,U.jsx)(S,{"data-slot":`sheet-portal`,...e})}function Lt({className:e,...t}){return(0,U.jsx)(oe,{"data-slot":`sheet-overlay`,className:B(`fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function Rt({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,U.jsxs)(It,{children:[(0,U.jsx)(Lt,{}),(0,U.jsxs)(s,{"data-slot":`sheet-content`,"data-side":n,className:B(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...i,children:[t,r&&(0,U.jsxs)(de,{"data-slot":`sheet-close`,render:(0,U.jsx)(V,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`}),children:[(0,U.jsx)(Pe,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function zt({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sheet-header`,className:B(`flex flex-col gap-0.5 p-4`,e),...t})}function Bt({className:e,...t}){return(0,U.jsx)(T,{"data-slot":`sheet-title`,className:B(`font-heading text-base font-medium text-foreground`,e),...t})}function Vt({className:e,...t}){return(0,U.jsx)(A,{"data-slot":`sheet-description`,className:B(`text-sm text-muted-foreground`,e),...t})}function Ht({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`skeleton`,className:B(`animate-pulse rounded-md bg-muted`,e),...t})}function Ut({delay:e=0,...t}){return(0,U.jsx)(l,{"data-slot":`tooltip-provider`,delay:e,...t})}function J({...e}){return(0,U.jsx)(g,{"data-slot":`tooltip`,...e})}function Y({...e}){return(0,U.jsx)(f,{"data-slot":`tooltip-trigger`,...e})}function X({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,
2children:a,...o}){return(0,U.jsx)(te,{children:(0,U.jsx)(w,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,U.jsxs)(p,{"data-slot":`tooltip-content`,className:B(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,U.jsx)(ee,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] border border-border bg-popover fill-popover data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var Wt=`sidebar_state`,Gt=3600*24*7,Kt=`16rem`,qt=`18rem`,Jt=`3rem`,Yt=`b`,Xt=H.createContext(null);function Z(){let e=H.useContext(Xt);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Zt({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=Nt(),[c,l]=H.useState(!1),[u,d]=H.useState(e),f=t??u,[p,m]=H.useState(!1),h=H.useRef(!1);h.current=p;let g=H.useCallback(e=>{let t=typeof e==`function`?e(f):e;m(!1),n?n(t):d(t),document.cookie=`${Wt}=${t}; path=/; max-age=${Gt}`},[n,f]),_=H.useCallback(e=>{d(e),m(e)},[]),v=H.useCallback(()=>{if(s)return l(e=>!e);h.current?(m(!1),d(!0),document.cookie=`${Wt}=true; path=/; max-age=${Gt}`):g(e=>!e)},[s,g,l]);H.useEffect(()=>{let e=e=>{e.key===Yt&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[v]);let y=f?`expanded`:`collapsed`,b=H.useMemo(()=>({state:y,open:f,setOpen:g,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:v,isPeeking:p,setOpenTransient:_}),[y,f,g,s,c,l,v,p,_]);return(0,U.jsx)(Xt.Provider,{value:b,children:(0,U.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":Kt,"--sidebar-width-icon":Jt,...i},className:B(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function Qt({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=Z();return n===`none`?(0,U.jsx)(`div`,{"data-slot":`sidebar`,className:B(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,U.jsx)(Ft,{open:l,onOpenChange:u,...o,children:(0,U.jsxs)(Rt,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":qt},side:e,children:[(0,U.jsxs)(zt,{className:`sr-only`,children:[(0,U.jsx)(Bt,{children:`Sidebar`}),(0,U.jsx)(Vt,{children:`Displays the mobile sidebar.`})]}),(0,U.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,U.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,U.jsx)(`div`,{"data-slot":`sidebar-gap`,className:B(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,U.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:B(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,U.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function $t({className:e,...t}){return(0,U.jsx)(`main`,{"data-slot":`sidebar-inset`,className:B(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function en({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:B(`flex flex-col gap-2 p-2`,e),...t})}function tn({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:B(`flex min-h-0 flex-1 flex-col gap-0 overflow-y-auto overflow-x-hidden group-data-[collapsible=icon]:overflow-hidden`,`[scrollbar-width:thin] [scrollbar-color:var(--sidebar-border)_transparent]`,`[&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-transparent`,`[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-[var(--sidebar-border)]`,e),...t})}function nn({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:B(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function rn({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:B(`w-full text-sm`,e),...t})}function an({className:e,...t}){return(0,U.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:B(`flex w-full min-w-0 flex-col gap-0`,e),...t})}function on({className:e,...t}){return(0,U.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:B(`group/menu-item relative`,e),...t})}var sn=ot(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md py-2 pl-0 pr-2 text-left text-sm r
2ing-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-primary/10 data-active:font-medium data-active:text-primary data-active:border-l-2 data-active:border-primary [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function cn({render:e,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let{isMobile:s,state:c}=Z(),l=h({defaultTagName:`button`,props:D({className:B(sn({variant:n,size:r}),a)},o),render:i?(0,U.jsx)(Y,{render:e}):e,state:{slot:`sidebar-menu-button`,sidebar:`menu-button`,size:r,active:t}});return i?(typeof i==`string`&&(i={children:i}),(0,U.jsxs)(J,{children:[l,(0,U.jsx)(X,{side:`right`,align:`center`,hidden:c!==`collapsed`||s,...i})]})):l}function ln({className:e,render:t,showOnHover:n=!1,...r}){return h({defaultTagName:`button`,props:D({className:B(`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0`,e)},r),render:t,state:{slot:`sidebar-menu-action`,sidebar:`menu-action`}})}function un({className:e,showIcon:t=!1,...n}){let[r]=H.useState(()=>`${Math.floor(Math.random()*40)+50}%`);return(0,U.jsxs)(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:B(`flex h-8 items-center gap-2 rounded-md px-2`,e),...n,children:[t&&(0,U.jsx)(Ht,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,U.jsx)(Ht,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":r}})]})}function dn({...e}){return(0,U.jsx)(y,{"data-slot":`dropdown-menu`,...e})}function fn({...e}){return(0,U.jsx)(v,{"data-slot":`dropdown-menu-trigger`,...e})}function pn({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,U.jsx)(d,{children:(0,U.jsx)(x,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,U.jsx)(m,{"data-slot":`dropdown-menu-content`,className:B(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a}
2)})})}function mn({...e}){return(0,U.jsx)(fe,{"data-slot":`dropdown-menu-group`,...e})}function hn({className:e,inset:t,...n}){return(0,U.jsx)(C,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:B(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function Q({className:e,inset:t,variant:n=`default`,...r}){return(0,U.jsx)(_,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:B(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function $({className:e,...t}){return(0,U.jsx)(le,{"data-slot":`dropdown-menu-separator`,className:B(`-mx-1 my-1 h-px bg-border`,e),...t})}function gn({open:e,onOpenChange:t,title:n,description:r,onConfirm:i,confirmLabel:a=`Confirm`,cancelLabel:o=`Cancel`,destructive:s=!1}){function c(){i(),t(!1)}return(0,U.jsx)(ft,{open:e,onOpenChange:t,children:(0,U.jsxs)(lt,{children:[(0,U.jsxs)(st,{children:[(0,U.jsx)(ut,{children:n}),r?(0,U.jsx)(dt,{children:r}):null]}),(0,U.jsxs)(ct,{children:[(0,U.jsx)(V,{variant:`secondary`,onClick:()=>t(!1),children:o}),(0,U.jsx)(V,{variant:s?`destructive`:`default`,onClick:c,children:a})]})]})})}function _n(){try{return localStorage.getItem(z.boardViewMode)===`single`?`single`:`full`}catch{return`full`}}function vn(e){try{localStorage.setItem(z.boardViewMode,e)}catch{}window.dispatchEvent(new Event(`spai-boardviewmode`))}function yn(e){return window.addEventListener(`spai-boardviewmode`,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(`spai-boardviewmode`,e),window.removeEventListener(`storage`,e)}}function bn({onAddProject:e,onToggle:t,isTemporary:n=!1}){let r=n?`Expand Sidebar`:`Collapse Sidebar`;return(0,U.jsxs)(`div`,{className:`flex h-12 w-full min-w-0 shrink-0 items-center gap-1 px-1 text-sidebar-foreground`,children:[(0,U.jsxs)(J,{children:[(0,U.jsxs)(Y,{render:(0,U.jsx)(V,{type:`button`,size:`icon-sm`,variant:`ghost`,onClick:t,className:`size-8 shrink-0`}),children:[(0,U.jsx)(n?ze:I,{size:16}),(0,U.jsx)(`span`,{className:`sr-only`,children:r})]}),(0,U.jsx)(X,{side:`bottom`,children:r})]}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-1 text-sm font-semibold text-foreground`,children:`Projects`}),(0,U.jsxs)(J,{children:[(0,U.jsxs)(Y,{render:(0,U.jsx)(V,{type:`button`,size:`sm`,onClick:e,className:`h-8 shrink-0`}),children:[(0,U.jsx)(xe,{size:16}),`Add Project`]}),(0,U.jsx)(X,{side:`bottom`,children:`Add Project`})]})]})}function xn(){let{addProject:e}=at(),{state:t,toggleSidebar:n,isPeeking:r}=Z();return t===`collapsed`?(0,U.jsx)(`div`,{className:`flex h-12 shrink-0 items-center justify-center border-b border-sidebar-border bg-sidebar px-1`,children:(0,U.jsxs)(J,{children:[(0,U.jsxs)(Y,{render:(0,U.jsx)(V,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`size-8`,onClick:n}),children:[(0,U.jsx)(ze,{className:`size-4`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Expand Sidebar`})]}),(0,U.jsx)(X,{side:`right`,children:`Expand Sidebar`})]})}):(0,U.jsx)(`div`,{className:`shrink-0 border-b border-sidebar-border bg-sidebar`,children:(0,U.jsx)(bn,{onAddProject:()=>e(),onToggle:n,isTemporary:r})})}function Sn({isActive:e}){return e?(0,U.jsx)(L,{size:16,className:`text-primary shrink-0`}):(0,U.jsx)(ye,{size:16,className:`text-muted-foreground shrink-0`})}function Cn(){try{let e=localStorage.getItem(z.expandedProjects);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.map(String)):new Set}catch{return new Set}}function wn({name:e}){let t=(0,H.useRef)(null),[n,r]=(0,H.useState)(!1);return(0,U.jsxs)(J,{open:n,onOpenChange:e=>{e||r(!1)},children:[(0,U.jsx)(Y,{render:(0,U.jsx)(`span`,{ref:t,onMouseEnter:()=>{let e=t.current;r(!!e&&e.scrollWidth>e.offsetWidth)},className:`min-w-0 truncate group-data-[collapsible=icon]:hidden`}),children:e}),(0,U.jsx)(X,{side:`right`,children:e})]})}function Tn(){let e=ce(),{state:t}=Z(),n=t!==`collapsed`,{activeBoardId:r,setActiveBoardId:i}=xt(),{index:a,currentIndex:o,isLoading:s,loadIndex:c,selectProject:l,duplicateProject:u,deleteProject:d,moveProject:f,reorderProject:p}=at(),[m,h]=(0,H.useState)(null),[g,_]=(0,H.useState)(null),[v,y]=(0,H.useState)(null),b=(0,H.useRef)(0),[x,S]=(0,H.useState)(Cn),[C,w]=(0,H.useState)({});(0,H.useEffect)(()=>{c()},[c]),(0,H.useEffect)(()=>{try{localStorage.setItem(z.expandedProjects,JSON.stringify([...x]))}catch{}},[x]),(0,H.useEffect)(()=>
2{s||x.forEach(e=>{let t=a.projects.find(t=>t.internal_id===e);t&&C[e]===void 0&&(w(t=>({...t,[e]:`loading`})),yt(t.internal_id,t.project_name,t.project_type).then(t=>{w(n=>({...n,[e]:t}))}))})},[s,a.projects,x,C]),(0,H.useEffect)(()=>{let e=null;try{e=new BroadcastChannel(`project-canvas`)}catch{return}let t=e=>{let t=e.data;if(!t||t.type!==`boards-changed`)return;let n=(t.projectKey||``).toString().trim();n&&w(e=>{let t={...e},r=a.projects.find(e=>e.internal_id===n||e.project_name===n)?.internal_id??n;return t[r]!==void 0&&delete t[r],t})};return e.addEventListener(`message`,t),()=>{e?.removeEventListener(`message`,t),e?.close()}},[a.projects]);function ee(e){let t=e.internal_id;S(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})}function te(t,n,r){try{localStorage.setItem(vt(n.internal_id),r)}catch{}vn(`single`),i(r),l(t),e(`/boards`)}function T(e,t){_(t),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,String(t)),e.currentTarget instanceof HTMLElement&&(e.currentTarget.style.opacity=`0.5`)}function E(e){e.currentTarget instanceof HTMLElement&&(e.currentTarget.style.opacity=``),_(null),y(null),b.current=0}function D(e){b.current++,y(e)}function O(){b.current--,b.current<=0&&(y(null),b.current=0)}function k(e){e.preventDefault(),e.dataTransfer.dropEffect=`move`}function A(e,t){e.preventDefault();let n=parseInt(e.dataTransfer.getData(`text/plain`),10);!isNaN(n)&&n!==t&&p(n,t),_(null),y(null),b.current=0}return s?(0,U.jsx)(nn,{children:(0,U.jsx)(rn,{children:(0,U.jsx)(an,{children:Array.from({length:4}).map((e,t)=>(0,U.jsx)(un,{showIcon:!0},t))})})}):a.projects.length===0?(0,U.jsx)(nn,{children:(0,U.jsx)(rn,{children:(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-8 text-center`,children:[(0,U.jsx)(ge,{size:32,className:`text-muted-foreground/50`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No projects yet`})]})})}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(gn,{open:m!==null,onOpenChange:e=>{e||h(null)},title:`Delete "${m?.name}"?`,description:`Deletes the project with all of its boards and its entire run history, including runs started by other people. This cannot be undone.`,onConfirm:()=>{d(m.idx)},confirmLabel:`Delete`,destructive:!0}),(0,U.jsx)(nn,{children:(0,U.jsx)(rn,{className:`mt-2`,children:(0,U.jsx)(an,{children:a.projects.map((e,t)=>{let i=e.internal_id,s=x.has(i),c=C[i],d=n&&s;return(0,U.jsxs)(on,{onDragEnter:()=>D(t),onDragLeave:O,onDragOver:k,onDrop:e=>A(e,t),className:B(`flex flex-col items-stretch gap-0`,`transition-[border-color] duration-150`,v===t&&g!==null&&g!==t&&`border-t-2 border-primary`),children:[(0,U.jsxs)(`div`,{className:`flex w-full min-w-0 items-center gap-0`,draggable:!0,onDragStart:e=>T(e,t),onDragEnd:E,children:[n?(0,U.jsx)(`button`,{type:`button`,className:`text-sidebar-foreground/80 hover:text-sidebar-foreground flex h-8 w-7 shrink-0 items-center justify-center rounded-md hover:bg-sidebar-accent`,"aria-label":s?`Collapse boards`:`Expand boards`,onClick:t=>{t.stopPropagation(),ee(e)},children:(0,U.jsx)(je,{size:16,className:B(`transition-transform`,s&&`rotate-90`)})}):null,(0,U.jsxs)(cn,{className:`min-w-0 flex-1`,isActive:t===o,onClick:()=>l(t),tooltip:e.project_name,children:[(0,U.jsx)(Be,{size:14,className:`shrink-0 cursor-grab text-muted-foreground/50 opacity-0 group-hover/menu-item:opacity-100 active:cursor-grabbing -ml-1 -mr-1.5 w-0 group-hover/menu-item:w-auto group-hover/menu-item:ml-0 group-hover/menu-item:mr-0 transition-all overflow-hidden group-data-[collapsible=icon]:hidden`}),(0,U.jsx)(Sn,{isActive:t===o}),(0,U.jsx)(wn,{name:e.project_name})]}),(0,U.jsxs)(dn,{children:[(0,U.jsxs)(ln,{showOnHover:!0,render:(0,U.jsx)(fn,{}),children:[(0,U.jsx)(Ne,{size:16}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Project actions`})]}),(0,U.jsxs)(pn,{side:`right`,align:`start`,children:[(0,U.jsxs)(Q,{onClick:()=>u(t),children:[(0,U.jsx)(be,{size:16}),(0,U.jsx)(`span`,{children:`Duplicate`})]}),(0,U.jsxs)(Q,{onClick:()=>f(t,-1),disabled:t===0,children:[(0,U.jsx)(Se,{size:16}),(0,U.jsx)(`span`,{children:`Move Up`})]}),(0,U.jsxs)(Q,{onClick:()=>f(t,1),disabled:t===a.projects.length-1,children:[(0,U.jsx)(we,{size:16}),(0,U.jsx)(`span`,{children:`Move Down`})]}),(0,U.jsx)($,{}),(0,U.jsxs)(Q,{variant:`destructive`,onClick:()=>h({idx:t,name:e.project_name}),children:[(0,U.jsx)(Fe,{size:16}),(0,U.jsx)(`span`,{children:`Delete`})]})]})]})]}),d?(0,U.jsx)(`div`,{className:`border-sidebar-border relative z-10 ml-9 w-full min-w-0 border-l pl-4 pr-1 pt-1 pb-1 flex flex-col items-start`,children:c===`loading`||c===void 0?(0,U.jsx)(`div`,{className:`text-muted-foreground px-2 py-1 text-xs`,children:`Loadingâ¦`}):c.length===0?(0,U.jsx)(`div`,{className:`text-muted-foreground px-2 py-1 text-xs`,children:`No boards`}):c.map(n=>(0,U.jsx)(`button`,{type:`button`,className:B(`hover:bg-sidebar-accent/80 max-w-full min-w-0 overflow-hidden cursor-pointer rounded px-2 py-1 text-left text-xs`,t===o&&r===n.id?`bg-primary/15 text-primary font-semibold border-l-2 border-primary pl-[6px] dark:bg-primary/20`:`border-l-2 border-transparent pl-[6px]`),title:n.title,onClick:r=>{r.stopPropagation(),te(t,e,n.id)},children:(0,U.jsx)(`span`,{className:`block truncate`,children:n.title})},n.id))}):null]},e.internal_id)})})})})]})}var En=(0,H.createContext)(null),Dn=(0,H.createContext)(()=>{});function On({children:e}){let[t,n]=(0,H.useState)(null);return(0,U.jsx)(Dn.Provider,{value:n,children:(0,U.jsx)(En.Provider,{value:t,children:e})})}function kn(){return(0,H.useContext)(En)}function An(e){let t=(0,H.useContext)(Dn);(0,H.useLayoutEffect)(()=>(t(e),()=>t(null)))}var jn=[{key:`status`,label:`Status`,color:`bg-blue-500/10 text-blue-700 dark:bg-blue-400/15 dark:text-blue-200 dark:ring-1 dark:ring-blue-400/25`},{key:`domain`,label:`Domain`,color:`bg-purple-500/10 text-purple-700 dark:bg-purple-400/15 dark:text-purple-200 dark:ring-1 dark:ring-purple-400/25`},{key:`project_type`,label:`Type`,color:`bg-emerald-500/10 text-emerald-700 dark:bg-emerald-400/15 dark:text-emerald-200 dark:ring-1 dark:ring-emerald-400/25`},{key:`language`,label:`Language`,color:`bg-amber-500/10 text-amber-700 dark:bg-amber-400/15 dark:text-amber-200 dark:ring-1 dark:ring-amber-400/25`},{key:`system`,label:`System`,color:`bg-rose-500/10 text-rose-700 dark:bg-rose-400/15 dark:text-rose-200 dark:ring-1 dark:ring-rose-400/25`},{key:`planned_start_date`,label:`Start Date`,color:`bg-cyan-500/10 text-cyan-700 dark:bg-cyan-400/15 dark:text-cyan-200 dark:ring-1 dark:ring-cyan-400/25`}];function Mn(){let{currentEntry:e,isDirty:t}=at(),n=kn();if(!e)return null;let r=jn.filter(t=>e[t.key]);return(0,U.jsxs)(`div`,{className:`z-10 grid min-h-12 shrink-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 border-b bg-background px-6 min-w-0 overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 overflow-hidden`,children:[(0,U.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold`,title:e.project_name,children:e.project_name}),t&&(0,U.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-dirt
2y`,title:`Unsaved changes`}),r.length>0?(0,U.jsx)(`div`,{className:`hidden min-w-0 items-center gap-2 overflow-hidden lg:flex`,children:r.map(t=>(0,U.jsxs)(`span`,{className:`flex min-w-0 max-w-[11rem] shrink items-center gap-1.5`,title:`${t.label}: ${e[t.key]}`,children:[(0,U.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[t.label,`:`]}),(0,U.jsx)(`span`,{className:`inline-flex min-w-0 max-w-full truncate whitespace-nowrap items-center rounded-full px-2 py-0.5 text-xs font-medium ${t.color}`,children:e[t.key]})]},t.key))}):null]}),n?(0,U.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:n}):null]})}function Nn(e){let t=e.split(`@`)[0]??``;return t.length<=1?t.toUpperCase():(t[0]+t[1]).toUpperCase()}function Pn(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Fn(){let{user:e,logout:t}=Ge(),[n,r]=(0,H.useState)(!0),[i,a]=(0,H.useState)(!0),o=()=>{qe(`api_keys.json`).then(e=>{r(e?.monday?.enabled??!0),a(e?.jira?.enabled??!0)}).catch(()=>{})};return(0,H.useEffect)(()=>{o()},[]),e?(0,U.jsxs)(dn,{onOpenChange:e=>{e&&o()},children:[(0,U.jsxs)(J,{children:[(0,U.jsx)(Y,{render:(0,U.jsx)(fn,{render:(0,U.jsx)(`button`,{className:`flex size-7 items-center justify-center rounded-full bg-primary text-primary-foreground text-xs font-medium hover:opacity-90 transition-opacity`})}),children:Nn(e.email)}),(0,U.jsx)(X,{children:e.email})]}),(0,U.jsxs)(pn,{align:`end`,className:`w-56`,children:[(0,U.jsx)(mn,{children:(0,U.jsx)(hn,{children:(0,U.jsxs)(`div`,{className:`flex flex-col`,children:[(0,U.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e.email}),(0,U.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[Pn(e.role),e.tenant_name&&(0,U.jsxs)(`span`,{className:`ml-1 text-muted-foreground/70`,children:[`[`,e.tenant_name,`]`]})]})]})})}),(0,U.jsx)($,{}),(0,U.jsxs)(mn,{children:[(0,U.jsxs)(Q,{render:(0,U.jsx)(N,{to:`/integrations`}),children:[(0,U.jsx)(Oe,{size:16,className:`text-blue-500`}),(0,U.jsx)(`span`,{children:`Integrations`})]}),n?(0,U.jsxs)(Q,{render:(0,U.jsx)(N,{to:`/monday-editor`}),children:[(0,U.jsx)(`img`,{src:Xe,alt:``,className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:`Monday Hub`})]}):(0,U.jsxs)(J,{children:[(0,U.jsx)(Y,{render:(0,U.jsx)(`span`,{className:`block`}),children:(0,U.jsxs)(Q,{disabled:!0,children:[(0,U.jsx)(`img`,{src:Xe,alt:``,className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:`Monday Hub`})]})}),(0,U.jsx)(X,{children:`Enable Integrations for Monday Hub`})]}),i?(0,U.jsxs)(Q,{render:(0,U.jsx)(N,{to:`/jira-editor`}),children:[(0,U.jsx)(`img`,{src:Ve,alt:``,className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:`Jira Hub`})]}):(0,U.jsxs)(J,{children:[(0,U.jsx)(Y,{render:(0,U.jsx)(`span`,{className:`block`}),children:(0,U.jsxs)(Q,{disabled:!0,children:[(0,U.jsx)(`img`,{src:Ve,alt:``,className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:`Jira Hub`})]})}),(0,U.jsx)(X,{children:`Enable Integrations for Jira Hub`})]})]}),e.role===`platform_admin`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($,{}),(0,U.jsx)(mn,{children:(0,U.jsxs)(Q,{render:(0,U.jsx)(N,{to:`/admin`}),children:[(0,U.jsx)(Me,{size:16,className:`text-amber-500`}),(0,U.jsx)(`span`,{children:`Admin`})]})})]}),(0,U.jsx)($,{}),(0,U.jsx)(mn,{children:(0,U.jsxs)(Q,{onClick:()=>t(),className:`text-red-500 focus:text-red-500`,children:[(0,U.jsx)(pe,{size:16}),(0,U.jsx)(`span`,{children:`Sign Out`})]})})]})]}):null}function In(){let{setTheme:e,resolvedTheme:t}=i();return(0,U.jsxs)(dn,{children:[(0,U.jsxs)(fn,{render:(0,U.jsx)(V,{variant:`ghost`,size:`icon-sm`,title:`Toggle theme`}),children:[t===`dark`?(0,U.jsx)(he,{size:16}):(0,U.jsx)(De,{size:16}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Toggle theme`})]}),(0,U.jsxs)(pn,{align:`end`,children:[(0,U.jsxs)(Q,{onClick:()=>e(`light`),children:[(0,U.jsx)(De,{size:16}),(0,U.jsx)(`span`,{children:`Light`})]}),(0,U.jsxs)(Q,{onClick:()=>e(`dark`),children:[(0,U.jsx)(he,{size:16}),(0,U.jsx)(`span`,{children:`Dark`})]}),(0,U.jsxs)(Q,{onClick:()=>e(`system`),children:[(0,U.jsx)(me,{size:16}),(0,U.jsx)(`span`,{children:`System`})]})]})]})}function Ln({className:e,children:t,...n}){return(0,U.jsxs)(ie,{"data-slot":`scroll-area`,className:B(`relative`,e),...n,children:[(0,U.jsx)(c,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,U.jsx)(Rn,{}),(0,U.jsx)(u,{})]})}function Rn({className:e,orientation:t=`vertical`,...n}){return(0,U.jsx)(j,{"data-slot":`scroll-area-scrollbar`,"data-orientation":t,orientation:t,className:B(`flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,e),...n,children:(0,U.jsx)(b,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}var zn={"/canvas":`project_canvas.md`,"/boards":`boards.md`,"/run-center":`run_center.md`,"/admin":`admin.md`,"/integrations":`integrations_settings.md`,"/monday-editor":`Monday_boards_editor.md`,"/jira-editor":`Jira_boards_editor.md`},Bn=[{label:`Getting Started`,file:`getting_started.md`},{label:`Project Canvas`,file:`project_canvas.md`},{label:`Run Center`,file:`run_center.md`},{label:`Boards`,file:`boards.md`},{label:`Integrations`,file:`integrations_settings.md`}];function Vn({open:e,onOpenChange:t}){let n=ne(),[r,i]=(0,H.useState)(``),[a,s]=(0,H.useState)(`getting_started.md`),c=(0,H.useRef)(new Map);function l(e){s(e);let t=c.current.get(e);if(t){i(t);return}fetch(`${Ye}/${e}`).then(e=>e.ok?e.text():`Guide page not found.`).then(t=>{c.current.set(e,t),i(t)}
2).catch(()=>i(`Failed to load guide.`))}return(0,H.useEffect)(()=>{if(!e)return;let t=zn[n.pathname]??`getting_started.md`,r=!1,a=c.current.get(t);return(a==null?fetch(`${Ye}/${t}`).then(e=>e.ok?e.text():`Guide page not found.`).catch(()=>`Failed to load guide.`):Promise.resolve(a)).then(e=>{r||typeof e!=`string`||(c.current.set(t,e),s(t),i(e))}),()=>{r=!0}},[e,n.pathname]),(0,H.useEffect)(()=>{function n(n){n.key===`F1`&&(n.preventDefault(),t(!e)),n.key===`Escape`&&e&&t(!1)}return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),(0,U.jsx)(Ft,{open:e,onOpenChange:t,children:(0,U.jsxs)(Rt,{side:`right`,className:`w-full sm:max-w-md gap-0 p-0`,children:[(0,U.jsx)(zt,{className:`shrink-0 border-b px-4 py-3`,children:(0,U.jsxs)(Bt,{className:`flex items-center gap-2 text-base`,children:[(0,U.jsx)(Te,{size:18}),`Guide`]})}),(0,U.jsx)(`nav`,{className:`flex shrink-0 gap-1 overflow-x-auto border-b px-4 py-2`,children:Bn.map(e=>(0,U.jsx)(V,{variant:a===e.file?`default`:`ghost`,size:`sm`,className:`shrink-0 text-xs`,onClick:()=>l(e.file),children:e.label},e.file))}),(0,U.jsx)(Ln,{className:`min-h-0 flex-1`,children:(0,U.jsx)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none p-4 text-sm [&_a]:text-primary`,children:(0,U.jsx)(o,{children:r})})})]})})}var Hn=ot(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Un({className:e,variant:t=`default`,render:n,...r}){return h({defaultTagName:`span`,props:D({className:B(Hn({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var Wn=[{path:`/canvas`,label:`Project Canvas`,icon:Ce,iconColor:`text-blue-500`},{path:`/run-center`,label:`Run Center`,icon:Le,iconColor:`text-emerald-500`}],Gn=200,Kn=480,qn=256,Jn=`spai_leftPanelWidth`;function Yn(){try{let e=localStorage.getItem(Jn);if(e){let t=parseInt(e,10);if(t>=Gn&&t<=Kn)return t}}catch{}return qn}function Xn({width:e,onResize:t}){let{state:n,toggleSidebar:r}=Z(),i=(0,H.useRef)(!1),a=(0,H.useRef)(0),o=(0,H.useRef)(0),s=(0,H.useRef)(!1);(0,H.useEffect)(()=>{function e(e){if(!i.current)return;let n=e.clientX-a.current;Math.abs(n)>3&&(s.current=!0),t(Math.min(Kn,Math.max(Gn,o.current+n)))}function n(){i.current&&(i.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``,s.current||r())}return window.addEventListener(`mousemove`,e),window.addEventListener(`mouseup`,n),()=>{window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,n)}},[t,r]);function c(t){if(n===`collapsed`){r();return}i.current=!0,s.current=!1,a.current=t.clientX,o.current=e,document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,t.preventDefault()}return(0,U.jsx)(`div`,{onMouseDown:c,className:B(`absolute inset-y-0 -right-1 z-20 hidden w-2 sm:flex`,`after:absolute after:inset-y-0 after:left-1/2 after:w-px after:bg-transparent after:transition-colors hover:after:bg-sidebar-border`,n===`collapsed`?`cursor-e-resize`:`cursor-col-resize`),title:n===`collapsed`?`Expand sidebar`:`Drag to resize`})}var Zn=150;function Qn({sidebarWidth:e,onResize:t,isImpersonating:n}){let{state:r,isPeeking:i,setOpenTransient:a,isMobile:o}=Z(),s=(0,H.useRef)(null),c=(0,H.useCallback)(()=>{r!==`collapsed`||o||(s.current=setTimeout(()=>{a(!0)},Zn))},[r,o,a]),l=(0,H.useCallback)(()=>{s.current!==null&&(clearTimeout(s.current),s.current=null),i&&a(!1)},[i,a]);return(0,H.useEffect)(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]),(0,U.jsxs)(Qt,{collapsible:`icon`,className:B(`!top-12 !bottom-0 !h-auto !max-h-none`,n&&`!top-20`),onMouseEnter:c,onMouseLeave:l,children:[(0,U.jsx)(xn,{}),(0,U.jsx)(tn,{children:(0,U.jsx)(Tn,{})}),(0,U.jsx)(en,{className:`border-t`}),(0,U.jsx)(Xn,{width:e,onResize:t})]})}function $n(e){switch(e){case`Pro`:return`bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400`;case`Pro+`:return`bg-blue-500 text-white dark:bg-blue-600`;case`Enterprise`:return`bg-indigo-600 text-white dark:bg-indigo-500`;default:return`bg-amber-400 text-amber-900 dark:bg-amber-500 dark:text-amber-950`}}function er(){let e=ne(),t=ce(),{user:n,isImpersonating:r,impersonatorEmail:i,stopImpersonation:a}=Ge(),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(Yn),u=(0,H.useCallback)(e=>{l(e);try{localStorage.setItem(Jn,String(e))}catch{}},[]);return(0,U.jsx)(Zt,{className:`!max-h-svh !h-svh overflow-hidden`,style:{"--sidebar-width":`${c}px`},children:(0,U.jsxs)(`div`,{className:`flex h-svh min-h-0 w-full flex-col overflow-hidden`,children:[(0,U.jsxs)(`header`,{className:`relative z-50 grid h-12 shrink-0 grid-cols-[minmax(16rem,1fr)_auto_1fr] items-center gap-2 border-b bg-background px-4`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsxs)(N,{to:`/canvas`,className:`relative -top-px flex shrink-0 items-center pl-0.5`,children:[(0,U.jsx)(`img`,{src:`/assets/images/logo-wordmark-light.png`,alt:`SmartProject.AI`,className:`h-8 w-auto max-w-[12rem] shrink-0 dark:hidden`}),(0,U.jsx)(`img`,{src:`/assets/images/logo-wordmark-dark.png`,alt:`SmartProject.AI`,className:`hidden h-8 w-auto max-w-[12rem] shrink-0 dark:block`})]}),n?.plan&&(0,U.jsx)(Un,{className:B(`shrink-0`,$n(n.plan)),children:n.plan})]}),(0,U.jsx)(`nav`,{className:`flex items-center justify-center gap-1`,"aria-label":`Primary`,children:Wn.map(n=>{let r=e.pathname===n.path;return(0,U.jsxs)(`button`,{type:`button`,"aria-current":r?`page`:void 0,className:B(`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm transition-colors`,r?`bg-accent text-accent-foreground font-medium`:`text-muted-foreground hover:bg-accent/50 hover:text-foreground`),onClick:()=>void t(n.path),children:[(0,U.jsx)(n.icon,{size:16,className:n.iconColor}),(0,U.jsx)(`span`,{className:`hidden sm:inline`,children:n.label})]},n.path)})}),(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center justify-end gap-2`,children:[(0,U.jsx)(In,{}),(0,U.jsxs)(J,{children:[(0,U.jsxs)(Y,{render:(0,U.jsx)(V,{variant:`ghost`,size:`icon-sm`,onClick:()=>s(!0)}),children:[(0,U.jsx)(Ie,{size:16}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Guide (F1)`})]}),(0,U.jsx)(X,{children:`Guide (F1)`})]}),(0,U.jsx)(Fn,{})]})]}),r&&(0,U.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-center gap-2 border-b border-amber-500/20 bg-amber-500/10 text-xs`,children:[(0,U.jsx)(Ae,{size:14,className:`text-amber-600`}),(0,U.jsxs)(`span`,{className:`text-amber-700 dark:text-amber-400`,children:[`Impersonating `,i]}),(0,U.jsx)(V,{variant:`ghost`,size:`sm`,className:`h-5 text-xs`,onClick:()=>a(),children:`Stop`})]}),(0,U.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,U.jsx)(Qn,{sidebarWidth:c,onResize:u,isImpersonating:r}),(0,U.jsx)($t,{className:`relative z-30 min-h-0 min-w-0 flex-1 overflow-hidden`,children:(0,U.jsxs)(On,{children:[(0,U.jsx)(Mn,{}),(0,U.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto overflow-x-hidden`,children:(0,U.jsx)(ae,{})})]})})]}),(0,U.jsx)(Vn,{open:o,onOpenChange:s})]})})}var tr=class extends H.Component{state={hasError:!1,message:``};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:`An unexpected error occurred.`}}componentDidCatch(e,t){console.error(`[ErrorBoundary]`,e,t.componentStack),e instanceof Error&&(e.message.includes(`Failed to fetch dynamically imported module`)||e.message.includes(`Importing a module script failed`))&&window.location.reload()}handleReload=()=>{window.location.reload()};render(){return this.state.hasError?(0,U.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-6`,children:(0,U.jsxs)(`div`,{className:`w-full max-w-md rounded-lg border bg-card p-8 text-center shadow-sm`,children:[(0,U.jsx)(`h2`,{className:`mb-2 text-lg font-semibold text-foreground`,children:`Something went wrong`}),(0,U.jsx)(`p`,{className:`mb-6 text-sm text-muted-foreground`,children:this.state.message}),(0,U.jsx)(`button`,{onClick:this.handleReload,className:`rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90`,children:`Reload page`})]})}):this.props.children}},nr=(0,H.lazy)(()=>M(()=>import(`./ProjectCanvas-DO9kHdmq.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),rr=(0,H.lazy)(()=>M(()=>import(`./Boards-Y7zFC64P.js`),__vite__mapDeps([17,1,2,3,4,5,9,7,10,11,8,14,15,18,19]))),ir=(0,H.lazy)(()=>M(()=>import(`./RunCenter-DJaQBCpz.js`),__vite__mapDeps([20,1,3,4,2,5,6,7,8,21,14,15,18,16]))),ar=(0,H.lazy)(()=>M(()=>import(`./Admin-Df5xjMfX.js`),__vite__mapDeps([22,1,3,4,2,5,23,10,11,13,24,8]))),or=(0,H.lazy)(()=>M(()=>import(`./IntegrationsSettings-CIDPqq_x.js`),__vite__mapDeps([25,1,3,4,2,23,5,8]))),sr=(0,H.lazy)(()=>M(()=>import(`./MondayBoardsEditor-CRGZTJkI.js`),__vite__mapDeps([26,1,3,4,2,6,5,7,8,21,14,15,18]))),cr=(0,H.lazy)(()=>M(()=>
2import(`./JiraBoardsEditor-Bx72DxgO.js`),__vite__mapDeps([27,1,3,4,2,5,6,7,8,21,14,15,18,23,11,13])));(0,H.lazy)(()=>M(()=>import(`./DevComponents-fksE0AqU.js`),__vite__mapDeps([28,1,3,4,2,5,10,11,12,13,24])));function lr(){let{isLoading:e,isAuthenticated:t,needsVerification:n}=Ge();return e?(0,U.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background`,children:(0,U.jsx)(F,{size:24,className:`animate-spin text-muted-foreground`})}):(0,U.jsx)(tr,{children:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(`div`,{className:`flex min-h-[50vh] items-center justify-center`,children:(0,U.jsx)(F,{size:20,className:`animate-spin text-muted-foreground`})}),children:(0,U.jsxs)(k,{children:[!1,!t||n?(0,U.jsx)(P,{path:`*`,element:(0,U.jsx)(jt,{})}):(0,U.jsxs)(P,{element:(0,U.jsx)($e,{children:(0,U.jsx)(St,{children:(0,U.jsx)(er,{})})}),children:[(0,U.jsx)(P,{path:`/canvas`,element:(0,U.jsx)(nr,{})}),(0,U.jsx)(P,{path:`/boards`,element:(0,U.jsx)(rr,{})}),(0,U.jsx)(P,{path:`/run-center`,element:(0,U.jsx)(ir,{})}),(0,U.jsx)(P,{path:`/admin`,element:(0,U.jsx)(ar,{})}),(0,U.jsx)(P,{path:`/integrations`,element:(0,U.jsx)(or,{})}),(0,U.jsx)(P,{path:`/monday-editor`,element:(0,U.jsx)(sr,{})}),(0,U.jsx)(P,{path:`/jira-editor`,element:(0,U.jsx)(cr,{})}),(0,U.jsx)(P,{path:`/`,element:(0,U.jsx)(O,{to:`/canvas`,replace:!0})}),(0,U.jsx)(P,{path:`*`,element:(0,U.jsx)(O,{to:`/canvas`,replace:!0})})]})]})})})}function ur(){return(0,U.jsxs)(t,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,children:[(0,U.jsx)(Je,{children:(0,U.jsx)(lr,{})}),(0,U.jsx)(mt,{})]})}window.addEventListener(`vite:preloadError`,()=>{window.location.reload()}),(0,pt.createRoot)(document.getElementById(`root`)).render((0,U.jsx)(H.StrictMode,{children:(0,U.jsx)(se,{children:(0,U.jsx)(ur,{})})}));export{gt as A,Pt as C,At as D,K as E,vt as M,W as O,Bt as S,q as T,Ht as _,vn as a,Vt as b,dn as c,$ as d,fn as f,Y as g,Ut as h,_n as i,ht as j,xt as k,pn as l,X as m,Ln as n,yn as o,J as p,An as r,gn as s,Un as t,Q as u,Ft as v,G as w,zt as x,Rt as y};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.